From fb5f6022943d7c0b0fe7c00bb33a211b6055eb99 Mon Sep 17 00:00:00 2001 From: yougyung Date: Fri, 23 Feb 2024 00:32:44 +0900 Subject: [PATCH 1/2] feat: shadcn/ui default setting --- app/utils/shadcn/utils.ts | 6 ++++++ components.json | 17 +++++++++++++++++ package-lock.json | 20 +++++++++++++++++++- package.json | 6 ++++-- 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 app/utils/shadcn/utils.ts create mode 100644 components.json diff --git a/app/utils/shadcn/utils.ts b/app/utils/shadcn/utils.ts new file mode 100644 index 00000000..29996101 --- /dev/null +++ b/app/utils/shadcn/utils.ts @@ -0,0 +1,6 @@ +import { twMerge } from 'tailwind-merge'; +import { type ClassValue, clsx } from 'clsx'; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/components.json b/components.json new file mode 100644 index 00000000..13b8add1 --- /dev/null +++ b/components.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "slate", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/app/ui/view/shadcn", + "utils": "@/app/utils/shadcn/utils" + } +} diff --git a/package-lock.json b/package-lock.json index 40d080ae..b4c90f4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,10 +15,12 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "express": "^4.18.2", + "lucide-react": "^0.336.0", "next": "14.1.0", "react": "^18", "react-dom": "^18", - "tailwind-merge": "^2.2.1" + "tailwind-merge": "^2.2.1", + "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@storybook/addon-essentials": "^7.6.15", @@ -15155,6 +15157,14 @@ "node": "14 || >=16.14" } }, + "node_modules/lucide-react": { + "version": "0.336.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.336.0.tgz", + "integrity": "sha512-e06J4Qrdrk3BP/hf3MnkW3LnymdthfyEtVbdEg0xPQ/olTEKfOfTv03DYmdRm1+XpaNQdCpiHT7Vi6regbxDCQ==", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", @@ -19366,6 +19376,14 @@ "node": ">=14.0.0" } }, + "node_modules/tailwindcss-animate": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz", + "integrity": "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==", + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", diff --git a/package.json b/package.json index 8111b5c4..5d3f2c89 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,12 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "express": "^4.18.2", + "lucide-react": "^0.336.0", "next": "14.1.0", "react": "^18", "react-dom": "^18", - "tailwind-merge": "^2.2.1" + "tailwind-merge": "^2.2.1", + "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@storybook/addon-essentials": "^7.6.15", @@ -40,7 +42,6 @@ "@storybook/nextjs": "^7.6.15", "@storybook/react": "^7.6.15", "@storybook/test": "^7.6.15", - "chromatic": "^10.9.4", "@testing-library/jest-dom": "^6.4.2", "@testing-library/react": "^14.2.1", "@testing-library/user-event": "^14.5.2", @@ -50,6 +51,7 @@ "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", + "chromatic": "^10.9.4", "concurrently": "^8.2.2", "cross-env": "^7.0.3", "eslint": "^8", From 22f2be81b061778bde21afeea4c279ace9502981 Mon Sep 17 00:00:00 2001 From: yougyung Date: Fri, 23 Feb 2024 01:33:16 +0900 Subject: [PATCH 2/2] feat: animation, color setting --- components.json | 3 ++- tailwind.config.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components.json b/components.json index 13b8add1..d20264b0 100644 --- a/components.json +++ b/components.json @@ -7,11 +7,12 @@ "config": "tailwind.config.ts", "css": "app/globals.css", "baseColor": "slate", - "cssVariables": true, + "cssVariables": false, "prefix": "" }, "aliases": { "components": "@/app/ui/view/shadcn", + "ui": "@/app/ui/view/shadcn", "utils": "@/app/utils/shadcn/utils" } } diff --git a/tailwind.config.ts b/tailwind.config.ts index 2271ede8..1bf81b4f 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -45,6 +45,6 @@ const config: Config = { }, }, }, - plugins: [headlessui], + plugins: [headlessui, require('tailwindcss-animate')], }; export default config;