@alkimi.org/ui-kit 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,315 @@
1
+ # Alkimi UI Kit
2
+
3
+ A React component library built with [shadcn/ui](https://ui.shadcn.com/) and [Tailwind CSS](https://tailwindcss.com/).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @alkimi.org/ui-kit
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ ### 1. Install Tailwind CSS
14
+
15
+ If you haven't already, install Tailwind CSS in your project:
16
+
17
+ ```bash
18
+ npm install -D tailwindcss postcss autoprefixer
19
+ npx tailwindcss init -p
20
+ ```
21
+
22
+ ### 2. Configure Tailwind
23
+
24
+ Update your `tailwind.config.js` to include the library's content:
25
+
26
+ ```js
27
+ /** @type {import('tailwindcss').Config} */
28
+ module.exports = {
29
+ darkMode: ["class"],
30
+ content: [
31
+ "./src/**/*.{js,jsx,ts,tsx}",
32
+ "./node_modules/@alkimi/ui-kit/dist/**/*.{js,mjs}",
33
+ ],
34
+ theme: {
35
+ extend: {
36
+ colors: {
37
+ border: "hsl(var(--border))",
38
+ input: "hsl(var(--input))",
39
+ ring: "hsl(var(--ring))",
40
+ background: "hsl(var(--background))",
41
+ foreground: "hsl(var(--foreground))",
42
+ primary: {
43
+ DEFAULT: "hsl(var(--primary))",
44
+ foreground: "hsl(var(--primary-foreground))",
45
+ },
46
+ secondary: {
47
+ DEFAULT: "hsl(var(--secondary))",
48
+ foreground: "hsl(var(--secondary-foreground))",
49
+ },
50
+ destructive: {
51
+ DEFAULT: "hsl(var(--destructive))",
52
+ foreground: "hsl(var(--destructive-foreground))",
53
+ },
54
+ muted: {
55
+ DEFAULT: "hsl(var(--muted))",
56
+ foreground: "hsl(var(--muted-foreground))",
57
+ },
58
+ accent: {
59
+ DEFAULT: "hsl(var(--accent))",
60
+ foreground: "hsl(var(--accent-foreground))",
61
+ },
62
+ popover: {
63
+ DEFAULT: "hsl(var(--popover))",
64
+ foreground: "hsl(var(--popover-foreground))",
65
+ },
66
+ card: {
67
+ DEFAULT: "hsl(var(--card))",
68
+ foreground: "hsl(var(--card-foreground))",
69
+ },
70
+ },
71
+ borderRadius: {
72
+ lg: "var(--radius)",
73
+ md: "calc(var(--radius) - 2px)",
74
+ sm: "calc(var(--radius) - 4px)",
75
+ },
76
+ },
77
+ },
78
+ plugins: [require("tailwindcss-animate")],
79
+ }
80
+ ```
81
+
82
+ ### 3. Import Styles
83
+
84
+ Import the library's CSS in your main application file (e.g., `App.tsx` or `index.tsx`):
85
+
86
+ ```tsx
87
+ import "@alkimi.org/ui-kit/styles.css"
88
+ ```
89
+
90
+ Or if you prefer, add the CSS variables to your own CSS file:
91
+
92
+ ```css
93
+ @layer base {
94
+ :root {
95
+ --background: 0 0% 100%;
96
+ --foreground: 222.2 84% 4.9%;
97
+ --card: 0 0% 100%;
98
+ --card-foreground: 222.2 84% 4.9%;
99
+ --popover: 0 0% 100%;
100
+ --popover-foreground: 222.2 84% 4.9%;
101
+ --primary: 222.2 47.4% 11.2%;
102
+ --primary-foreground: 210 40% 98%;
103
+ --secondary: 210 40% 96.1%;
104
+ --secondary-foreground: 222.2 47.4% 11.2%;
105
+ --muted: 210 40% 96.1%;
106
+ --muted-foreground: 215.4 16.3% 46.9%;
107
+ --accent: 210 40% 96.1%;
108
+ --accent-foreground: 222.2 47.4% 11.2%;
109
+ --destructive: 0 84.2% 60.2%;
110
+ --destructive-foreground: 210 40% 98%;
111
+ --border: 214.3 31.8% 91.4%;
112
+ --input: 214.3 31.8% 91.4%;
113
+ --ring: 222.2 84% 4.9%;
114
+ --radius: 0.5rem;
115
+ }
116
+
117
+ .dark {
118
+ --background: 222.2 84% 4.9%;
119
+ --foreground: 210 40% 98%;
120
+ --card: 222.2 84% 4.9%;
121
+ --card-foreground: 210 40% 98%;
122
+ --popover: 222.2 84% 4.9%;
123
+ --popover-foreground: 210 40% 98%;
124
+ --primary: 210 40% 98%;
125
+ --primary-foreground: 222.2 47.4% 11.2%;
126
+ --secondary: 217.2 32.6% 17.5%;
127
+ --secondary-foreground: 210 40% 98%;
128
+ --muted: 217.2 32.6% 17.5%;
129
+ --muted-foreground: 215 20.2% 65.1%;
130
+ --accent: 217.2 32.6% 17.5%;
131
+ --accent-foreground: 210 40% 98%;
132
+ --destructive: 0 62.8% 30.6%;
133
+ --destructive-foreground: 210 40% 98%;
134
+ --border: 217.2 32.6% 17.5%;
135
+ --input: 217.2 32.6% 17.5%;
136
+ --ring: 212.7 26.8% 83.9%;
137
+ }
138
+ }
139
+ ```
140
+
141
+ ## Usage
142
+
143
+ ### Button Component
144
+
145
+ ```tsx
146
+ import { Button } from "@alkimi/ui-kit"
147
+
148
+ function App() {
149
+ return (
150
+ <div>
151
+ <Button>Click me</Button>
152
+ <Button variant="secondary">Secondary</Button>
153
+ <Button variant="destructive">Delete</Button>
154
+ <Button variant="outline">Outline</Button>
155
+ <Button variant="ghost">Ghost</Button>
156
+ <Button variant="link">Link</Button>
157
+ <Button size="sm">Small</Button>
158
+ <Button size="lg">Large</Button>
159
+ </div>
160
+ )
161
+ }
162
+ ```
163
+
164
+ ### Card Component
165
+
166
+ ```tsx
167
+ import {
168
+ Card,
169
+ CardHeader,
170
+ CardTitle,
171
+ CardDescription,
172
+ CardContent,
173
+ CardFooter,
174
+ Button,
175
+ } from "@alkimi/ui-kit"
176
+
177
+ function App() {
178
+ return (
179
+ <Card>
180
+ <CardHeader>
181
+ <CardTitle>Card Title</CardTitle>
182
+ <CardDescription>Card Description</CardDescription>
183
+ </CardHeader>
184
+ <CardContent>
185
+ <p>Card Content</p>
186
+ </CardContent>
187
+ <CardFooter>
188
+ <Button>Action</Button>
189
+ </CardFooter>
190
+ </Card>
191
+ )
192
+ }
193
+ ```
194
+
195
+ ## Adding More Components
196
+
197
+ To add more shadcn/ui components to this library:
198
+
199
+ 1. Use the shadcn CLI to add components:
200
+
201
+ ```bash
202
+ npx shadcn-ui@latest add [component-name]
203
+ ```
204
+
205
+ 2. Export the new component in [src/index.ts](src/index.ts):
206
+
207
+ ```tsx
208
+ export { ComponentName } from "./components/component-name"
209
+ ```
210
+
211
+ 3. Rebuild the library:
212
+ ```bash
213
+ npm run build
214
+ ```
215
+
216
+ ## Development
217
+
218
+ ### Running the Demo
219
+
220
+ To see the components in action, run the demo application:
221
+
222
+ ```bash
223
+ cd demo
224
+ npm install
225
+ npm run dev
226
+ ```
227
+
228
+ Then open [http://localhost:5173](http://localhost:5173) in your browser.
229
+
230
+ The demo showcases all available components with interactive examples, including:
231
+
232
+ - All button variants and sizes
233
+ - Card layouts and compositions
234
+ - Dark mode toggle
235
+ - Interactive component states
236
+
237
+ ### Build
238
+
239
+ Build the library for production:
240
+
241
+ ```bash
242
+ npm run build
243
+ ```
244
+
245
+ ### Watch Mode
246
+
247
+ Build the library in watch mode during development:
248
+
249
+ ```bash
250
+ npm run dev
251
+ ```
252
+
253
+ ### Type Check
254
+
255
+ Run TypeScript type checking:
256
+
257
+ ```bash
258
+ npm run type-check
259
+ ```
260
+
261
+ ### Storybook
262
+
263
+ View and develop components in isolation using Storybook:
264
+
265
+ ```bash
266
+ npm run storybook
267
+ ```
268
+
269
+ This will start Storybook on [http://localhost:6006](http://localhost:6006).
270
+
271
+ #### Building Storybook for Deployment
272
+
273
+ To build a static version of Storybook for deployment:
274
+
275
+ ```bash
276
+ npm run build-storybook
277
+ ```
278
+
279
+ This will generate a static site in the `storybook-static` directory that you can deploy to any static hosting service.
280
+
281
+ #### Deploying to Vercel
282
+
283
+ **Option 1: Using Vercel Dashboard (No Terminal Required)**
284
+
285
+ 1. Build Storybook locally: `npm run build-storybook`
286
+ 2. Go to [vercel.com](https://vercel.com) and log in
287
+ 3. Click "Add New..." → "Project"
288
+ 4. If this is your first time:
289
+ - Import your repository from GitHub/GitLab/Bitbucket
290
+ - In the project settings, configure:
291
+ - **Build Command**: `npm run build-storybook`
292
+ - **Output Directory**: `storybook-static`
293
+ - **Install Command**: `npm install`
294
+ 5. Click "Deploy"
295
+
296
+ Vercel will automatically deploy your Storybook and provide you with a URL. Every time you push to your main branch, Vercel will rebuild and redeploy automatically.
297
+
298
+ **Option 2: Using Vercel CLI**
299
+
300
+ 1. Build Storybook: `npm run build-storybook`
301
+ 2. Install Vercel CLI (if not already installed): `npm i -g vercel`
302
+ 3. Deploy: `vercel storybook-static`
303
+
304
+ ## Publishing to npm
305
+
306
+ 1. Update the version number in [package.json](package.json) (e.g., from `0.1.3` to `0.1.4`)
307
+ 2. Build the library: `npm run build`
308
+ 3. Login to npm (if not already logged in): `npm login`
309
+ 4. Publish: `npm publish`
310
+
311
+ **Note:** Make sure to bump the version in [package.json](package.json) before publishing any changes to avoid conflicts with existing versions on npm.
312
+
313
+ ## License
314
+
315
+ MIT
package/README.md CHANGED
@@ -192,81 +192,6 @@ function App() {
192
192
  }
193
193
  ```
194
194
 
195
- ## Adding More Components
196
-
197
- To add more shadcn/ui components to this library:
198
-
199
- 1. Use the shadcn CLI to add components:
200
-
201
- ```bash
202
- npx shadcn-ui@latest add [component-name]
203
- ```
204
-
205
- 2. Export the new component in [src/index.ts](src/index.ts):
206
-
207
- ```tsx
208
- export { ComponentName } from "./components/component-name"
209
- ```
210
-
211
- 3. Rebuild the library:
212
- ```bash
213
- npm run build
214
- ```
215
-
216
- ## Development
217
-
218
- ### Running the Demo
219
-
220
- To see the components in action, run the demo application:
221
-
222
- ```bash
223
- cd demo
224
- npm install
225
- npm run dev
226
- ```
227
-
228
- Then open [http://localhost:5173](http://localhost:5173) in your browser.
229
-
230
- The demo showcases all available components with interactive examples, including:
231
-
232
- - All button variants and sizes
233
- - Card layouts and compositions
234
- - Dark mode toggle
235
- - Interactive component states
236
-
237
- ### Build
238
-
239
- Build the library for production:
240
-
241
- ```bash
242
- npm run build
243
- ```
244
-
245
- ### Watch Mode
246
-
247
- Build the library in watch mode during development:
248
-
249
- ```bash
250
- npm run dev
251
- ```
252
-
253
- ### Type Check
254
-
255
- Run TypeScript type checking:
256
-
257
- ```bash
258
- npm run type-check
259
- ```
260
-
261
- ## Publishing to npm
262
-
263
- 1. Update the version number in [package.json](package.json) (e.g., from `0.1.3` to `0.1.4`)
264
- 2. Build the library: `npm run build`
265
- 3. Login to npm (if not already logged in): `npm login`
266
- 4. Publish: `npm publish`
267
-
268
- **Note:** Make sure to bump the version in [package.json](package.json) before publishing any changes to avoid conflicts with existing versions on npm.
269
-
270
195
  ## License
271
196
 
272
197
  MIT
package/README.npm.md ADDED
@@ -0,0 +1,197 @@
1
+ # Alkimi UI Kit
2
+
3
+ A React component library built with [shadcn/ui](https://ui.shadcn.com/) and [Tailwind CSS](https://tailwindcss.com/).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @alkimi.org/ui-kit
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ ### 1. Install Tailwind CSS
14
+
15
+ If you haven't already, install Tailwind CSS in your project:
16
+
17
+ ```bash
18
+ npm install -D tailwindcss postcss autoprefixer
19
+ npx tailwindcss init -p
20
+ ```
21
+
22
+ ### 2. Configure Tailwind
23
+
24
+ Update your `tailwind.config.js` to include the library's content:
25
+
26
+ ```js
27
+ /** @type {import('tailwindcss').Config} */
28
+ module.exports = {
29
+ darkMode: ["class"],
30
+ content: [
31
+ "./src/**/*.{js,jsx,ts,tsx}",
32
+ "./node_modules/@alkimi/ui-kit/dist/**/*.{js,mjs}",
33
+ ],
34
+ theme: {
35
+ extend: {
36
+ colors: {
37
+ border: "hsl(var(--border))",
38
+ input: "hsl(var(--input))",
39
+ ring: "hsl(var(--ring))",
40
+ background: "hsl(var(--background))",
41
+ foreground: "hsl(var(--foreground))",
42
+ primary: {
43
+ DEFAULT: "hsl(var(--primary))",
44
+ foreground: "hsl(var(--primary-foreground))",
45
+ },
46
+ secondary: {
47
+ DEFAULT: "hsl(var(--secondary))",
48
+ foreground: "hsl(var(--secondary-foreground))",
49
+ },
50
+ destructive: {
51
+ DEFAULT: "hsl(var(--destructive))",
52
+ foreground: "hsl(var(--destructive-foreground))",
53
+ },
54
+ muted: {
55
+ DEFAULT: "hsl(var(--muted))",
56
+ foreground: "hsl(var(--muted-foreground))",
57
+ },
58
+ accent: {
59
+ DEFAULT: "hsl(var(--accent))",
60
+ foreground: "hsl(var(--accent-foreground))",
61
+ },
62
+ popover: {
63
+ DEFAULT: "hsl(var(--popover))",
64
+ foreground: "hsl(var(--popover-foreground))",
65
+ },
66
+ card: {
67
+ DEFAULT: "hsl(var(--card))",
68
+ foreground: "hsl(var(--card-foreground))",
69
+ },
70
+ },
71
+ borderRadius: {
72
+ lg: "var(--radius)",
73
+ md: "calc(var(--radius) - 2px)",
74
+ sm: "calc(var(--radius) - 4px)",
75
+ },
76
+ },
77
+ },
78
+ plugins: [require("tailwindcss-animate")],
79
+ }
80
+ ```
81
+
82
+ ### 3. Import Styles
83
+
84
+ Import the library's CSS in your main application file (e.g., `App.tsx` or `index.tsx`):
85
+
86
+ ```tsx
87
+ import "@alkimi.org/ui-kit/styles.css"
88
+ ```
89
+
90
+ Or if you prefer, add the CSS variables to your own CSS file:
91
+
92
+ ```css
93
+ @layer base {
94
+ :root {
95
+ --background: 0 0% 100%;
96
+ --foreground: 222.2 84% 4.9%;
97
+ --card: 0 0% 100%;
98
+ --card-foreground: 222.2 84% 4.9%;
99
+ --popover: 0 0% 100%;
100
+ --popover-foreground: 222.2 84% 4.9%;
101
+ --primary: 222.2 47.4% 11.2%;
102
+ --primary-foreground: 210 40% 98%;
103
+ --secondary: 210 40% 96.1%;
104
+ --secondary-foreground: 222.2 47.4% 11.2%;
105
+ --muted: 210 40% 96.1%;
106
+ --muted-foreground: 215.4 16.3% 46.9%;
107
+ --accent: 210 40% 96.1%;
108
+ --accent-foreground: 222.2 47.4% 11.2%;
109
+ --destructive: 0 84.2% 60.2%;
110
+ --destructive-foreground: 210 40% 98%;
111
+ --border: 214.3 31.8% 91.4%;
112
+ --input: 214.3 31.8% 91.4%;
113
+ --ring: 222.2 84% 4.9%;
114
+ --radius: 0.5rem;
115
+ }
116
+
117
+ .dark {
118
+ --background: 222.2 84% 4.9%;
119
+ --foreground: 210 40% 98%;
120
+ --card: 222.2 84% 4.9%;
121
+ --card-foreground: 210 40% 98%;
122
+ --popover: 222.2 84% 4.9%;
123
+ --popover-foreground: 210 40% 98%;
124
+ --primary: 210 40% 98%;
125
+ --primary-foreground: 222.2 47.4% 11.2%;
126
+ --secondary: 217.2 32.6% 17.5%;
127
+ --secondary-foreground: 210 40% 98%;
128
+ --muted: 217.2 32.6% 17.5%;
129
+ --muted-foreground: 215 20.2% 65.1%;
130
+ --accent: 217.2 32.6% 17.5%;
131
+ --accent-foreground: 210 40% 98%;
132
+ --destructive: 0 62.8% 30.6%;
133
+ --destructive-foreground: 210 40% 98%;
134
+ --border: 217.2 32.6% 17.5%;
135
+ --input: 217.2 32.6% 17.5%;
136
+ --ring: 212.7 26.8% 83.9%;
137
+ }
138
+ }
139
+ ```
140
+
141
+ ## Usage
142
+
143
+ ### Button Component
144
+
145
+ ```tsx
146
+ import { Button } from "@alkimi/ui-kit"
147
+
148
+ function App() {
149
+ return (
150
+ <div>
151
+ <Button>Click me</Button>
152
+ <Button variant="secondary">Secondary</Button>
153
+ <Button variant="destructive">Delete</Button>
154
+ <Button variant="outline">Outline</Button>
155
+ <Button variant="ghost">Ghost</Button>
156
+ <Button variant="link">Link</Button>
157
+ <Button size="sm">Small</Button>
158
+ <Button size="lg">Large</Button>
159
+ </div>
160
+ )
161
+ }
162
+ ```
163
+
164
+ ### Card Component
165
+
166
+ ```tsx
167
+ import {
168
+ Card,
169
+ CardHeader,
170
+ CardTitle,
171
+ CardDescription,
172
+ CardContent,
173
+ CardFooter,
174
+ Button,
175
+ } from "@alkimi/ui-kit"
176
+
177
+ function App() {
178
+ return (
179
+ <Card>
180
+ <CardHeader>
181
+ <CardTitle>Card Title</CardTitle>
182
+ <CardDescription>Card Description</CardDescription>
183
+ </CardHeader>
184
+ <CardContent>
185
+ <p>Card Content</p>
186
+ </CardContent>
187
+ <CardFooter>
188
+ <Button>Action</Button>
189
+ </CardFooter>
190
+ </Card>
191
+ )
192
+ }
193
+ ```
194
+
195
+ ## License
196
+
197
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alkimi.org/ui-kit",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "A React component library built with shadcn/ui and Tailwind CSS",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -20,7 +20,10 @@
20
20
  "build": "tsup && cp dist/index.css dist/styles.css && cp dist/index.css.map dist/styles.css.map",
21
21
  "dev": "tsup --watch",
22
22
  "type-check": "tsc --noEmit",
23
- "prepublishOnly": "npm run build"
23
+ "storybook": "storybook dev -p 6006",
24
+ "build-storybook": "storybook build",
25
+ "prepublishOnly": "npm run build && mv README.md README.github.md && cp README.npm.md README.md",
26
+ "postpublish": "mv README.github.md README.md"
24
27
  },
25
28
  "keywords": [
26
29
  "react",
@@ -44,6 +47,13 @@
44
47
  "react-dom": "^18.0.0 || ^19.0.0"
45
48
  },
46
49
  "devDependencies": {
50
+ "@storybook/addon-essentials": "^8.6.14",
51
+ "@storybook/addon-interactions": "^8.6.14",
52
+ "@storybook/addon-links": "^8.6.14",
53
+ "@storybook/blocks": "^8.6.14",
54
+ "@storybook/react": "^8.6.14",
55
+ "@storybook/react-vite": "^8.6.14",
56
+ "@storybook/test": "^8.6.14",
47
57
  "@types/node": "^20.10.0",
48
58
  "@types/react": "^18.2.45",
49
59
  "@types/react-dom": "^18.2.18",
@@ -51,10 +61,12 @@
51
61
  "postcss": "^8.4.32",
52
62
  "react": "^18.2.0",
53
63
  "react-dom": "^18.2.0",
64
+ "storybook": "^8.6.14",
54
65
  "tailwindcss": "^3.4.0",
55
66
  "tailwindcss-animate": "^1.0.7",
56
67
  "tsup": "^8.0.1",
57
- "typescript": "^5.3.3"
68
+ "typescript": "^5.3.3",
69
+ "vite": "^5.4.21"
58
70
  },
59
71
  "dependencies": {
60
72
  "@radix-ui/react-slot": "^1.0.2",