Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nnecec committed Mar 20, 2024
0 parents commit 395b6c6
Show file tree
Hide file tree
Showing 71 changed files with 12,187 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["website"]
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI Test

on: [pull_request]

jobs:
test:
timeout-minutes: 20

runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 20

- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Test
run: pnpm test
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
workflow_dispatch:
push:
paths:
- '.changeset/**'
- 'packages/**'
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or Release to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# dist
.next/
out/
build
dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# vercel
.vercel
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.org/
public-hoist-pattern[]=*@nextui-org/*
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@nnecec/prettier-config"
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 nnecec

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 36 additions & 0 deletions apps/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions apps/website/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public-hoist-pattern[]=*@nextui-org/*
Binary file added apps/website/app/favicon.ico
Binary file not shown.
7 changes: 7 additions & 0 deletions apps/website/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--slate: #ff0000;
}
25 changes: 25 additions & 0 deletions apps/website/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Metadata } from 'next'

// eslint-disable-next-line camelcase
import { Roboto_Mono } from 'next/font/google'

import './globals.css'

const font = Roboto_Mono({ subsets: ['latin'] })

export const metadata: Metadata = {
description: 'Welcome to the ColorKit world!',
icons: [
{ rel: 'icon', sizes: '32x32', url: '/favicon-32x32.png' },
{ rel: 'icon', sizes: '16x16', url: '/favicon-16x16.png' },
{ rel: 'apple-touch-icon', sizes: '180x180', url: '/apple-touch-icon.png' },
],
title: 'tailwind-plugin-palette - ColorKit',
}
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html className="dark" lang="en">
<body className={font.className}>{children}</body>
</html>
)
}
24 changes: 24 additions & 0 deletions apps/website/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client'

import { MotionConfig } from 'framer-motion'
import { Provider } from 'jotai'

import { PaletteFooter } from '../components/palette/footer'
import { PaletteIntro } from '../components/palette/intro'
import { PaletteSwatches } from '../components/palette/swatches'
import { PaletteTools } from '../components/palette/tools'

export default function RootPage() {
return (
<div className="relative min-h-screen p-3 lg:p-0">
<Provider>
<MotionConfig transition={{ duration: 0.4, ease: 'easeInOut' }}>
<PaletteIntro />
<PaletteSwatches />
<PaletteTools />
<PaletteFooter />
</MotionConfig>
</Provider>
</div>
)
}
7 changes: 7 additions & 0 deletions apps/website/app/provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client'

import { NextUIProvider } from '@nextui-org/react'

export default function Providers({ children }: { children: React.ReactNode }) {
return <NextUIProvider>{children}</NextUIProvider>
}
17 changes: 17 additions & 0 deletions apps/website/app/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "ColorKit",
"short_name": "ColorKit",
"icons": [
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" },
{
"src": "/favicon.ico",
"sizes": "any",
"type": "image/x-icon"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"start_url": "/"
}
46 changes: 46 additions & 0 deletions apps/website/components/color-picker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import type { ButtonProps } from '@nextui-org/react'

import { useRef } from 'react'

import { Button } from '@nextui-org/react'

import { usePropsValue } from '../utils/use-props-value'

export const ColorPicker = ({
defaultValue,
onChange,
value,
...props
}: { defaultValue?: string; onChange?: (value: string) => void; value?: string } & Omit<ButtonProps, 'onChange'>) => {
const ref = useRef<HTMLInputElement>(null)

const [val, setVal] = usePropsValue<string>({ defaultValue: defaultValue ?? '', onChange, value })

return (
<Button
isIconOnly
onClick={() => {
ref.current?.click()
}}
radius="full"
style={{
backgroundColor: val ?? '#fff',
backgroundImage:
val ? 'none' : (
`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>')`
),
zIndex: 10,
}}
{...props}
>
<input
className="invisible absolute left-1/2 top-1/2 size-1"
defaultValue={defaultValue}
onChange={e => setVal(e.target.value)}
ref={ref}
type="color"
value={val}
/>
</Button>
)
}
Loading

0 comments on commit 395b6c6

Please sign in to comment.