@alkimi.org/ui-kit 0.1.12 → 0.1.14

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.
package/README.github.md CHANGED
@@ -10,76 +10,59 @@ npm install @alkimi.org/ui-kit
10
10
 
11
11
  ## Setup
12
12
 
13
- ### 1. Install Tailwind CSS
13
+ ### 1. Install Tailwind CSS v4
14
14
 
15
- If you haven't already, install Tailwind CSS in your project:
15
+ If you haven't already, install Tailwind CSS v4 and its dependencies in your project:
16
16
 
17
17
  ```bash
18
- npm install -D tailwindcss postcss autoprefixer
19
- npx tailwindcss init -p
18
+ npm install -D tailwindcss@next @tailwindcss/postcss@next postcss autoprefixer
20
19
  ```
21
20
 
22
- ### 2. Configure Tailwind
21
+ ### 2. Configure PostCSS
23
22
 
24
- Update your `tailwind.config.js` to include the library's content:
23
+ Create or update your `postcss.config.js`:
24
+
25
+ ```js
26
+ module.exports = {
27
+ plugins: {
28
+ "@tailwindcss/postcss": {},
29
+ autoprefixer: {},
30
+ },
31
+ }
32
+ ```
33
+
34
+ ### 3. Configure Tailwind
35
+
36
+ Create a `tailwind.config.js` to specify your content paths:
25
37
 
26
38
  ```js
27
39
  /** @type {import('tailwindcss').Config} */
28
40
  module.exports = {
29
- darkMode: ["class"],
30
41
  content: [
42
+ // 👇 Scans YOUR project files for Tailwind classes
31
43
  "./src/**/*.{js,jsx,ts,tsx}",
44
+ "./app/**/*.{js,jsx,ts,tsx}", // If using Next.js App Router
45
+ "./pages/**/*.{js,jsx,ts,tsx}", // If using Next.js Pages Router
46
+ "./components/**/*.{js,jsx,ts,tsx}",
47
+
48
+ // 👇 Scans the UI Kit's components for their Tailwind classes
49
+ // (Required for library components to be styled correctly)
32
50
  "./node_modules/@alkimi.org/ui-kit/dist/**/*.{js,mjs}",
33
51
  ],
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
52
  }
80
53
  ```
81
54
 
82
- ### 3. Import Styles
55
+ **Important**: The second path (`node_modules/@alkimi.org/ui-kit/dist/...`) is **required** for the library components to display correctly. It tells Tailwind to scan the library's compiled files and generate CSS for the utility classes used inside the components (like `bg-primary`, `rounded-3xl`, etc.).
56
+
57
+ ### 4. Import Tailwind in Your CSS
58
+
59
+ Create or update your main CSS file (e.g., `app.css` or `globals.css`):
60
+
61
+ ```css
62
+ @import "tailwindcss";
63
+ ```
64
+
65
+ ### 5. Import Styles
83
66
 
84
67
  Import the library's CSS in your main application file (e.g., `App.tsx` or `index.tsx`):
85
68
 
@@ -87,57 +70,98 @@ Import the library's CSS in your main application file (e.g., `App.tsx` or `inde
87
70
  import "@alkimi.org/ui-kit/styles.css"
88
71
  ```
89
72
 
90
- Or if you prefer, add the CSS variables to your own CSS file:
73
+ ## Customizing Colors
74
+
75
+ The library uses CSS variables for colors, making it easy to customize. You have two approaches:
76
+
77
+ ### Option A: Override CSS Variables (Recommended)
78
+
79
+ Add custom color values to your CSS file **after** importing the library styles:
91
80
 
92
81
  ```css
82
+ /* In your app.css or globals.css */
83
+ @import "tailwindcss";
84
+ @import "@alkimi.org/ui-kit/styles.css";
85
+
86
+ /* 👇 Override the library's default colors */
93
87
  @layer base {
94
88
  :root {
89
+ /* Your custom colors (HSL format: Hue Saturation% Lightness%) */
90
+ --primary: 220 100% 50%; /* Custom blue primary color */
91
+ --primary-foreground: 0 0% 100%; /* White text on primary */
92
+ --secondary: 280 60% 60%; /* Custom purple secondary */
93
+ --background: 0 0% 100%; /* White background */
94
+ --foreground: 0 0% 0%; /* Black text */
95
+
96
+ /* You can override any of these variables:
97
+ --muted, --muted-foreground
98
+ --accent, --accent-foreground
99
+ --destructive, --destructive-foreground
100
+ --border, --input, --ring
101
+ --radius (border radius)
102
+ */
103
+ }
104
+ }
105
+ ```
106
+
107
+ ### Option B: Don't Import Library CSS (Manual Setup)
108
+
109
+ If you want complete control, skip importing the library CSS and define all variables yourself:
110
+
111
+ ```css
112
+ /* In your app.css or globals.css */
113
+ @import "tailwindcss";
114
+
115
+ @layer base {
116
+ :root {
117
+ /* Define ALL color variables used by the library */
95
118
  --background: 0 0% 100%;
96
- --foreground: 222.2 84% 4.9%;
119
+ --foreground: 0 0% 0%;
97
120
  --card: 0 0% 100%;
98
- --card-foreground: 222.2 84% 4.9%;
121
+ --card-foreground: 0 0% 0%;
99
122
  --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%;
123
+ --popover-foreground: 0 0% 0%;
124
+ --primary: 220 100% 50%;
125
+ --primary-foreground: 0 0% 100%;
126
+ --secondary: 280 60% 60%;
127
+ --secondary-foreground: 0 0% 100%;
128
+ --muted: 0 0% 96%;
129
+ --muted-foreground: 0 0% 45%;
130
+ --accent: 0 0% 96%;
131
+ --accent-foreground: 0 0% 0%;
132
+ --destructive: 0 84% 60%;
133
+ --destructive-foreground: 0 0% 100%;
134
+ --border: 0 0% 90%;
135
+ --input: 0 0% 90%;
136
+ --ring: 220 100% 50%;
114
137
  --radius: 0.5rem;
115
138
  }
116
139
 
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%;
140
+ body {
141
+ @apply bg-background text-foreground;
137
142
  }
138
143
  }
139
144
  ```
140
145
 
146
+ **Note**: When using Option B, don't import `@alkimi.org/ui-kit/styles.css` in your code.
147
+
148
+ ## Typography & Sizing
149
+
150
+ The library uses **rem-based sizing** with a base font size of **1rem (16px)**. All font sizes use rem units for better accessibility and scalability:
151
+
152
+ - **Base text**: 1rem (16px)
153
+ - **Small text**: 0.875rem (14px) - Used in small buttons, captions, etc.
154
+ - **Large text**: 1.125rem (18px) and above
155
+
156
+ ### Button Sizes
157
+
158
+ Buttons have the following font sizes by default:
159
+ - **Small** (`size="sm"`): 0.875rem (14px)
160
+ - **Default**: 1rem (16px)
161
+ - **Large** (`size="lg"`): 1rem (16px)
162
+
163
+ You can override these sizes using Tailwind's text utility classes (e.g., `className="text-lg"`) on any component.
164
+
141
165
  ## Usage
142
166
 
143
167
  You can import components in two ways:
@@ -210,37 +234,6 @@ function App() {
210
234
  }
211
235
  ```
212
236
 
213
- ### Card Component
214
-
215
- ```tsx
216
- import {
217
- Card,
218
- CardHeader,
219
- CardTitle,
220
- CardDescription,
221
- CardContent,
222
- CardFooter,
223
- } from "@alkimi.org/ui-kit/card"
224
- import { Button } from "@alkimi.org/ui-kit/button"
225
-
226
- function App() {
227
- return (
228
- <Card>
229
- <CardHeader>
230
- <CardTitle>Card Title</CardTitle>
231
- <CardDescription>Card Description</CardDescription>
232
- </CardHeader>
233
- <CardContent>
234
- <p>Card Content</p>
235
- </CardContent>
236
- <CardFooter>
237
- <Button>Action</Button>
238
- </CardFooter>
239
- </Card>
240
- )
241
- }
242
- ```
243
-
244
237
  ## Adding More Components
245
238
 
246
239
  To add more shadcn/ui components to this library:
package/README.md CHANGED
@@ -10,76 +10,59 @@ npm install @alkimi.org/ui-kit
10
10
 
11
11
  ## Setup
12
12
 
13
- ### 1. Install Tailwind CSS
13
+ ### 1. Install Tailwind CSS v4
14
14
 
15
- If you haven't already, install Tailwind CSS in your project:
15
+ If you haven't already, install Tailwind CSS v4 and its dependencies in your project:
16
16
 
17
17
  ```bash
18
- npm install -D tailwindcss postcss autoprefixer
19
- npx tailwindcss init -p
18
+ npm install -D tailwindcss@next @tailwindcss/postcss@next postcss autoprefixer
20
19
  ```
21
20
 
22
- ### 2. Configure Tailwind
21
+ ### 2. Configure PostCSS
23
22
 
24
- Update your `tailwind.config.js` to include the library's content:
23
+ Create or update your `postcss.config.js`:
24
+
25
+ ```js
26
+ module.exports = {
27
+ plugins: {
28
+ "@tailwindcss/postcss": {},
29
+ autoprefixer: {},
30
+ },
31
+ }
32
+ ```
33
+
34
+ ### 3. Configure Tailwind
35
+
36
+ Create a `tailwind.config.js` to specify your content paths:
25
37
 
26
38
  ```js
27
39
  /** @type {import('tailwindcss').Config} */
28
40
  module.exports = {
29
- darkMode: ["class"],
30
41
  content: [
42
+ // Scans YOUR project files for Tailwind classes
31
43
  "./src/**/*.{js,jsx,ts,tsx}",
44
+ "./app/**/*.{js,jsx,ts,tsx}", // If using Next.js App Router
45
+ "./pages/**/*.{js,jsx,ts,tsx}", // If using Next.js Pages Router
46
+ "./components/**/*.{js,jsx,ts,tsx}",
47
+
48
+ // Scans the UI Kit's components for their Tailwind classes
49
+ // (Required for library components to be styled correctly)
32
50
  "./node_modules/@alkimi.org/ui-kit/dist/**/*.{js,mjs}",
33
51
  ],
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
52
  }
80
53
  ```
81
54
 
82
- ### 3. Import Styles
55
+ **Important**: The second path (`node_modules/@alkimi.org/ui-kit/dist/...`) is **required** for the library components to display correctly. It tells Tailwind to scan the library's compiled files and generate CSS for the utility classes used inside the components (like `bg-primary`, `rounded-3xl`, etc.).
56
+
57
+ ### 4. Import Tailwind in Your CSS
58
+
59
+ Create or update your main CSS file (e.g., `app.css` or `globals.css`):
60
+
61
+ ```css
62
+ @import "tailwindcss";
63
+ ```
64
+
65
+ ### 5. Import Styles
83
66
 
84
67
  Import the library's CSS in your main application file (e.g., `App.tsx` or `index.tsx`):
85
68
 
@@ -87,57 +70,100 @@ Import the library's CSS in your main application file (e.g., `App.tsx` or `inde
87
70
  import "@alkimi.org/ui-kit/styles.css"
88
71
  ```
89
72
 
90
- Or if you prefer, add the CSS variables to your own CSS file:
73
+ ## Customizing Colors
74
+
75
+ The library uses CSS variables for colors, making it easy to customize. You have two approaches:
76
+
77
+ ### Option A: Override CSS Variables (Recommended)
78
+
79
+ Add custom color values to your CSS file **after** importing the library styles:
91
80
 
92
81
  ```css
82
+ /* In your app.css or globals.css */
83
+ @import "tailwindcss";
84
+ @import "@alkimi.org/ui-kit/styles.css";
85
+
86
+ /* 👇 Override the library's default colors */
87
+ @layer base {
88
+ :root {
89
+ /* Your custom colors (HSL format: Hue Saturation% Lightness%) */
90
+ --primary: 220 100% 50%; /* Custom blue primary color */
91
+ --primary-foreground: 0 0% 100%; /* White text on primary */
92
+ --secondary: 280 60% 60%; /* Custom purple secondary */
93
+ --background: 0 0% 100%; /* White background */
94
+ --foreground: 0 0% 0%; /* Black text */
95
+
96
+ /* You can override any of these variables:
97
+ --card, --card-foreground
98
+ --popover, --popover-foreground
99
+ --muted, --muted-foreground
100
+ --accent, --accent-foreground
101
+ --destructive, --destructive-foreground
102
+ --border, --input, --ring
103
+ --radius (border radius)
104
+ */
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Option B: Don't Import Library CSS (Manual Setup)
110
+
111
+ If you want complete control, skip importing the library CSS and define all variables yourself:
112
+
113
+ ```css
114
+ /* In your app.css or globals.css */
115
+ @import "tailwindcss";
116
+
93
117
  @layer base {
94
118
  :root {
119
+ /* Define ALL color variables used by the library */
95
120
  --background: 0 0% 100%;
96
- --foreground: 222.2 84% 4.9%;
121
+ --foreground: 0 0% 0%;
97
122
  --card: 0 0% 100%;
98
- --card-foreground: 222.2 84% 4.9%;
123
+ --card-foreground: 0 0% 0%;
99
124
  --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%;
125
+ --popover-foreground: 0 0% 0%;
126
+ --primary: 220 100% 50%;
127
+ --primary-foreground: 0 0% 100%;
128
+ --secondary: 280 60% 60%;
129
+ --secondary-foreground: 0 0% 100%;
130
+ --muted: 0 0% 96%;
131
+ --muted-foreground: 0 0% 45%;
132
+ --accent: 0 0% 96%;
133
+ --accent-foreground: 0 0% 0%;
134
+ --destructive: 0 84% 60%;
135
+ --destructive-foreground: 0 0% 100%;
136
+ --border: 0 0% 90%;
137
+ --input: 0 0% 90%;
138
+ --ring: 220 100% 50%;
114
139
  --radius: 0.5rem;
115
140
  }
116
141
 
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%;
142
+ body {
143
+ @apply bg-background text-foreground;
137
144
  }
138
145
  }
139
146
  ```
140
147
 
148
+ **Note**: When using Option B, don't import `@alkimi.org/ui-kit/styles.css` in your code.
149
+
150
+ ## Typography & Sizing
151
+
152
+ The library uses **rem-based sizing** with a base font size of **1rem (16px)**. All font sizes use rem units for better accessibility and scalability:
153
+
154
+ - **Base text**: 1rem (16px)
155
+ - **Small text**: 0.875rem (14px) - Used in small buttons, captions, etc.
156
+ - **Large text**: 1.125rem (18px) and above
157
+
158
+ ### Button Sizes
159
+
160
+ Buttons have the following font sizes by default:
161
+ - **Small** (`size="sm"`): 0.875rem (14px)
162
+ - **Default**: 1rem (16px)
163
+ - **Large** (`size="lg"`): 1rem (16px)
164
+
165
+ You can override these sizes using Tailwind's text utility classes (e.g., `className="text-lg"`) on any component.
166
+
141
167
  ## Usage
142
168
 
143
169
  ### Button Component