@alkimi.org/ui-kit 0.2.29 → 0.2.31

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
@@ -64,19 +64,50 @@ Create your `globals.css`:
64
64
 
65
65
  /* Optional: Override library CSS variables */
66
66
  :root {
67
- /* Example: Custom primary color */
67
+ /* Base color variables */
68
+ --background: oklch(0.992 0.019 155.826);
69
+ --foreground: oklch(0.205 0 0);
68
70
  --primary: oklch(0.992 0.019 155.826);
69
71
  --primary-foreground: oklch(0.205 0 0);
72
+ --secondary: oklch(0.269 0 0);
73
+ --secondary-foreground: oklch(0.992 0.019 155.826);
74
+ --muted: oklch(0.269 0 0);
75
+ --muted-foreground: oklch(0.608 0 0);
76
+ --accent: oklch(0.269 0 0);
77
+ --accent-foreground: oklch(0.992 0.019 155.826);
78
+ --destructive: oklch(0.576 0.214 25.467);
79
+ --destructive-foreground: oklch(0.992 0.019 155.826);
80
+ --border: #3f3f46;
81
+ --input: #3f3f46;
82
+ --ring: oklch(0.992 0.019 155.826);
83
+ --radius: 0.625rem;
84
+
85
+ /* Component-specific variables (optional - default to base variables) */
86
+ /* Override these to customize individual components independently */
87
+ --sidebar: var(--background);
88
+ --sidebar-foreground: var(--primary-accent);
89
+ --sidebar-accent: var(--base-accent);
90
+ --sidebar-accent-foreground: var(--base-accent-foreground);
91
+ --sidebar-border: var(--border);
92
+ --sidebar-ring: var(--ring);
70
93
 
71
- /* You can override any of these variables:
72
- --secondary, --secondary-foreground
73
- --background, --foreground
74
- --muted, --muted-foreground
75
- --accent, --accent-foreground
76
- --destructive, --destructive-foreground
77
- --border, --input, --ring
78
- --radius (border radius)
79
- */
94
+ --card: var(--background);
95
+ --card-foreground: var(--primary-accent);
96
+
97
+ --popover: var(--background);
98
+ --popover-foreground: var(--primary-accent);
99
+
100
+ --dialog: var(--background);
101
+ --dialog-foreground: var(--foreground);
102
+
103
+ --sheet: var(--background);
104
+ --sheet-foreground: var(--foreground);
105
+
106
+ --tooltip: var(--background);
107
+ --tooltip-foreground: var(--primary-accent);
108
+
109
+ --dropdown-menu: var(--background);
110
+ --dropdown-menu-foreground: var(--primary-accent);
80
111
  }
81
112
  ```
82
113
 
@@ -144,20 +175,20 @@ Create your `globals.css`:
144
175
 
145
176
  /* REQUIRED: Define ALL CSS variables the library needs */
146
177
  :root {
178
+ /* Base color variables */
147
179
  --background: oklch(0.992 0.019 155.826);
148
180
  --foreground: oklch(0.205 0 0);
149
- --card: oklch(0.992 0.019 155.826);
150
- --card-foreground: oklch(0.205 0 0);
151
- --popover: oklch(0.992 0.019 155.826);
152
- --popover-foreground: oklch(0.205 0 0);
153
181
  --primary: oklch(0.992 0.019 155.826);
154
182
  --primary-foreground: oklch(0.205 0 0);
183
+ --primary-accent: oklch(0.992 0.019 155.826);
155
184
  --secondary: oklch(0.269 0 0);
156
185
  --secondary-foreground: oklch(0.992 0.019 155.826);
157
186
  --muted: oklch(0.269 0 0);
158
187
  --muted-foreground: oklch(0.608 0 0);
159
188
  --accent: oklch(0.269 0 0);
160
189
  --accent-foreground: oklch(0.992 0.019 155.826);
190
+ --base-accent: oklch(0.269 0 0);
191
+ --base-accent-foreground: oklch(0.992 0.019 155.826);
161
192
  --destructive: oklch(0.576 0.214 25.467);
162
193
  --destructive-foreground: oklch(0.992 0.019 155.826);
163
194
  --border: #3f3f46;
@@ -165,6 +196,34 @@ Create your `globals.css`:
165
196
  --ring: oklch(0.992 0.019 155.826);
166
197
  --radius: 0.625rem;
167
198
  --font-family: "Helvetica Now Display", "Helvetica", sans-serif;
199
+
200
+ /* Component-specific variables (default to base variables, can be overridden) */
201
+ --sidebar: var(--background);
202
+ --sidebar-foreground: var(--primary-accent);
203
+ --sidebar-primary: var(--primary-accent);
204
+ --sidebar-primary-foreground: var(--primary-foreground);
205
+ --sidebar-accent: var(--base-accent);
206
+ --sidebar-accent-foreground: var(--base-accent-foreground);
207
+ --sidebar-border: var(--border);
208
+ --sidebar-ring: var(--ring);
209
+
210
+ --card: var(--background);
211
+ --card-foreground: var(--primary-accent);
212
+
213
+ --popover: var(--background);
214
+ --popover-foreground: var(--primary-accent);
215
+
216
+ --dialog: var(--background);
217
+ --dialog-foreground: var(--foreground);
218
+
219
+ --sheet: var(--background);
220
+ --sheet-foreground: var(--foreground);
221
+
222
+ --tooltip: var(--background);
223
+ --tooltip-foreground: var(--primary-accent);
224
+
225
+ --dropdown-menu: var(--background);
226
+ --dropdown-menu-foreground: var(--primary-accent);
168
227
  }
169
228
 
170
229
  body {
@@ -188,6 +247,56 @@ body {
188
247
 
189
248
  ---
190
249
 
250
+ ## Customizing Component Colors
251
+
252
+ The library supports **component-specific color customization**. By default, all components use base color variables, but you can override individual component colors independently.
253
+
254
+ ### How It Works
255
+
256
+ Component-specific variables (like `--sidebar`, `--card`, `--popover`, etc.) default to base variables but can be overridden:
257
+
258
+ ```css
259
+ :root {
260
+ /* Base colors */
261
+ --background: oklch(0.992 0.019 155.826);
262
+ --primary-accent: oklch(0.992 0.019 155.826);
263
+
264
+ /* Override just the sidebar color */
265
+ --sidebar: oklch(0.2 0.05 200); /* Custom sidebar background */
266
+ --sidebar-foreground: oklch(0.9 0.02 150); /* Custom sidebar text */
267
+
268
+ /* Override card independently */
269
+ --card: oklch(0.95 0.02 150);
270
+ --card-foreground: oklch(0.1 0.05 200);
271
+
272
+ /* All other components still use --background */
273
+ }
274
+ ```
275
+
276
+ ### Available Component Variables
277
+
278
+ - **Sidebar**: `--sidebar`, `--sidebar-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring`
279
+ - **Card**: `--card`, `--card-foreground`
280
+ - **Popover**: `--popover`, `--popover-foreground`
281
+ - **Dialog**: `--dialog`, `--dialog-foreground`
282
+ - **Sheet**: `--sheet`, `--sheet-foreground`
283
+ - **Tooltip**: `--tooltip`, `--tooltip-foreground`
284
+ - **Dropdown Menu**: `--dropdown-menu`, `--dropdown-menu-foreground`
285
+
286
+ ### Example: Custom Sidebar Theme
287
+
288
+ ```css
289
+ :root {
290
+ /* Custom sidebar with different colors */
291
+ --sidebar: oklch(0.15 0.05 250); /* Dark blue sidebar */
292
+ --sidebar-foreground: oklch(0.95 0.02 150); /* Light text */
293
+ --sidebar-accent: oklch(0.25 0.08 250); /* Hover state */
294
+ --sidebar-accent-foreground: oklch(0.98 0.01 150);
295
+ }
296
+ ```
297
+
298
+ ---
299
+
191
300
  ## Typography & Sizing
192
301
 
193
302
  ### Default Font
@@ -267,9 +376,7 @@ function App() {
267
376
  <SidebarHeader showTrigger>
268
377
  <h2>My App</h2>
269
378
  </SidebarHeader>
270
- <SidebarContent>
271
- {/* Your sidebar content */}
272
- </SidebarContent>
379
+ <SidebarContent>{/* Your sidebar content */}</SidebarContent>
273
380
  </Sidebar>
274
381
  <SidebarInset>
275
382
  <header>
@@ -290,6 +397,7 @@ function App() {
290
397
  Wraps your entire layout and provides sidebar context.
291
398
 
292
399
  **Props:**
400
+
293
401
  - `defaultOpen?: boolean` - Initial sidebar state (default: `true`)
294
402
  - `open?: boolean` - Controlled sidebar state
295
403
  - `onOpenChange?: (open: boolean) => void` - Callback when sidebar state changes
@@ -299,6 +407,7 @@ Wraps your entire layout and provides sidebar context.
299
407
  The main sidebar container.
300
408
 
301
409
  **Props:**
410
+
302
411
  - `side?: "left" | "right"` - Sidebar position (default: `"left"`)
303
412
  - `variant?: "sidebar" | "floating" | "inset"` - Visual style (default: `"sidebar"`)
304
413
  - `collapsible?: "offcanvas" | "icon" | "none"` - Collapse behavior (default: `"offcanvas"`)
@@ -311,6 +420,7 @@ The main sidebar container.
311
420
  Header section of the sidebar.
312
421
 
313
422
  **Props:**
423
+
314
424
  - `showTrigger?: boolean` - Show toggle button in header (default: `false`)
315
425
 
316
426
  ##### SidebarContent
@@ -342,8 +452,7 @@ import {
342
452
  SidebarGroupLabel,
343
453
  SidebarGroupContent,
344
454
  } from "@alkimi.org/ui-kit"
345
-
346
- <SidebarGroup>
455
+ ;<SidebarGroup>
347
456
  <SidebarGroupLabel>Navigation</SidebarGroupLabel>
348
457
  <SidebarGroupContent>
349
458
  <SidebarMenu>
@@ -359,6 +468,7 @@ import {
359
468
  ```
360
469
 
361
470
  **Available Components:**
471
+
362
472
  - `SidebarGroup` - Groups related menu items
363
473
  - `SidebarGroupLabel` - Label for a group
364
474
  - `SidebarGroupContent` - Container for group items
@@ -406,6 +516,7 @@ function MyComponent() {
406
516
  ```
407
517
 
408
518
  **Returns:**
519
+
409
520
  - `state: "expanded" | "collapsed"` - Current sidebar state
410
521
  - `isOpen: boolean` - Whether sidebar is fully open
411
522
  - `setOpen: (open: boolean) => void` - Set desktop sidebar state
@@ -487,11 +598,7 @@ import { useScreenSize } from "@alkimi.org/ui-kit"
487
598
  function MyComponent() {
488
599
  const { isMobile, isLg } = useScreenSize()
489
600
 
490
- return (
491
- <div>
492
- {isMobile ? <MobileView /> : <DesktopView />}
493
- </div>
494
- )
601
+ return <div>{isMobile ? <MobileView /> : <DesktopView />}</div>
495
602
  }
496
603
  ```
497
604
 
@@ -549,9 +656,7 @@ The library uses these Tailwind breakpoints:
549
656
  Use Tailwind's responsive prefixes in your components:
550
657
 
551
658
  ```tsx
552
- <div className="text-sm md:text-base lg:text-lg">
553
- Responsive text size
554
- </div>
659
+ <div className="text-sm md:text-base lg:text-lg">Responsive text size</div>
555
660
  ```
556
661
 
557
662
  ### Migrating useSidebar Hook
package/README.md CHANGED
@@ -64,19 +64,50 @@ Create your `globals.css`:
64
64
 
65
65
  /* Optional: Override library CSS variables */
66
66
  :root {
67
- /* Example: Custom primary color */
67
+ /* Base color variables */
68
+ --background: oklch(0.992 0.019 155.826);
69
+ --foreground: oklch(0.205 0 0);
68
70
  --primary: oklch(0.992 0.019 155.826);
69
71
  --primary-foreground: oklch(0.205 0 0);
72
+ --secondary: oklch(0.269 0 0);
73
+ --secondary-foreground: oklch(0.992 0.019 155.826);
74
+ --muted: oklch(0.269 0 0);
75
+ --muted-foreground: oklch(0.608 0 0);
76
+ --accent: oklch(0.269 0 0);
77
+ --accent-foreground: oklch(0.992 0.019 155.826);
78
+ --destructive: oklch(0.576 0.214 25.467);
79
+ --destructive-foreground: oklch(0.992 0.019 155.826);
80
+ --border: #3f3f46;
81
+ --input: #3f3f46;
82
+ --ring: oklch(0.992 0.019 155.826);
83
+ --radius: 0.625rem;
70
84
 
71
- /* You can override any of these variables:
72
- --secondary, --secondary-foreground
73
- --background, --foreground
74
- --muted, --muted-foreground
75
- --accent, --accent-foreground
76
- --destructive, --destructive-foreground
77
- --border, --input, --ring
78
- --radius (border radius)
79
- */
85
+ /* Component-specific variables (optional - default to base variables) */
86
+ /* Override these to customize individual components independently */
87
+ --sidebar: var(--background);
88
+ --sidebar-foreground: var(--primary-accent);
89
+ --sidebar-accent: var(--base-accent);
90
+ --sidebar-accent-foreground: var(--base-accent-foreground);
91
+ --sidebar-border: var(--border);
92
+ --sidebar-ring: var(--ring);
93
+
94
+ --card: var(--background);
95
+ --card-foreground: var(--primary-accent);
96
+
97
+ --popover: var(--background);
98
+ --popover-foreground: var(--primary-accent);
99
+
100
+ --dialog: var(--background);
101
+ --dialog-foreground: var(--foreground);
102
+
103
+ --sheet: var(--background);
104
+ --sheet-foreground: var(--foreground);
105
+
106
+ --tooltip: var(--background);
107
+ --tooltip-foreground: var(--primary-accent);
108
+
109
+ --dropdown-menu: var(--background);
110
+ --dropdown-menu-foreground: var(--primary-accent);
80
111
  }
81
112
  ```
82
113
 
@@ -144,20 +175,20 @@ Create your `globals.css`:
144
175
 
145
176
  /* REQUIRED: Define ALL CSS variables the library needs */
146
177
  :root {
178
+ /* Base color variables */
147
179
  --background: oklch(0.992 0.019 155.826);
148
180
  --foreground: oklch(0.205 0 0);
149
- --card: oklch(0.992 0.019 155.826);
150
- --card-foreground: oklch(0.205 0 0);
151
- --popover: oklch(0.992 0.019 155.826);
152
- --popover-foreground: oklch(0.205 0 0);
153
181
  --primary: oklch(0.992 0.019 155.826);
154
182
  --primary-foreground: oklch(0.205 0 0);
183
+ --primary-accent: oklch(0.992 0.019 155.826);
155
184
  --secondary: oklch(0.269 0 0);
156
185
  --secondary-foreground: oklch(0.992 0.019 155.826);
157
186
  --muted: oklch(0.269 0 0);
158
187
  --muted-foreground: oklch(0.608 0 0);
159
188
  --accent: oklch(0.269 0 0);
160
189
  --accent-foreground: oklch(0.992 0.019 155.826);
190
+ --base-accent: oklch(0.269 0 0);
191
+ --base-accent-foreground: oklch(0.992 0.019 155.826);
161
192
  --destructive: oklch(0.576 0.214 25.467);
162
193
  --destructive-foreground: oklch(0.992 0.019 155.826);
163
194
  --border: #3f3f46;
@@ -165,6 +196,34 @@ Create your `globals.css`:
165
196
  --ring: oklch(0.992 0.019 155.826);
166
197
  --radius: 0.625rem;
167
198
  --font-family: "Helvetica Now Display", "Helvetica", sans-serif;
199
+
200
+ /* Component-specific variables (default to base variables, can be overridden) */
201
+ --sidebar: var(--background);
202
+ --sidebar-foreground: var(--primary-accent);
203
+ --sidebar-primary: var(--primary-accent);
204
+ --sidebar-primary-foreground: var(--primary-foreground);
205
+ --sidebar-accent: var(--base-accent);
206
+ --sidebar-accent-foreground: var(--base-accent-foreground);
207
+ --sidebar-border: var(--border);
208
+ --sidebar-ring: var(--ring);
209
+
210
+ --card: var(--background);
211
+ --card-foreground: var(--primary-accent);
212
+
213
+ --popover: var(--background);
214
+ --popover-foreground: var(--primary-accent);
215
+
216
+ --dialog: var(--background);
217
+ --dialog-foreground: var(--foreground);
218
+
219
+ --sheet: var(--background);
220
+ --sheet-foreground: var(--foreground);
221
+
222
+ --tooltip: var(--background);
223
+ --tooltip-foreground: var(--primary-accent);
224
+
225
+ --dropdown-menu: var(--background);
226
+ --dropdown-menu-foreground: var(--primary-accent);
168
227
  }
169
228
 
170
229
  body {
@@ -188,6 +247,56 @@ body {
188
247
 
189
248
  ---
190
249
 
250
+ ## Customizing Component Colors
251
+
252
+ The library supports **component-specific color customization**. By default, all components use base color variables, but you can override individual component colors independently.
253
+
254
+ ### How It Works
255
+
256
+ Component-specific variables (like `--sidebar`, `--card`, `--popover`, etc.) default to base variables but can be overridden:
257
+
258
+ ```css
259
+ :root {
260
+ /* Base colors */
261
+ --background: oklch(0.992 0.019 155.826);
262
+ --primary-accent: oklch(0.992 0.019 155.826);
263
+
264
+ /* Override just the sidebar color */
265
+ --sidebar: oklch(0.2 0.05 200); /* Custom sidebar background */
266
+ --sidebar-foreground: oklch(0.9 0.02 150); /* Custom sidebar text */
267
+
268
+ /* Override card independently */
269
+ --card: oklch(0.95 0.02 150);
270
+ --card-foreground: oklch(0.1 0.05 200);
271
+
272
+ /* All other components still use --background */
273
+ }
274
+ ```
275
+
276
+ ### Available Component Variables
277
+
278
+ - **Sidebar**: `--sidebar`, `--sidebar-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring`
279
+ - **Card**: `--card`, `--card-foreground`
280
+ - **Popover**: `--popover`, `--popover-foreground`
281
+ - **Dialog**: `--dialog`, `--dialog-foreground`
282
+ - **Sheet**: `--sheet`, `--sheet-foreground`
283
+ - **Tooltip**: `--tooltip`, `--tooltip-foreground`
284
+ - **Dropdown Menu**: `--dropdown-menu`, `--dropdown-menu-foreground`
285
+
286
+ ### Example: Custom Sidebar Theme
287
+
288
+ ```css
289
+ :root {
290
+ /* Custom sidebar with different colors */
291
+ --sidebar: oklch(0.15 0.05 250); /* Dark blue sidebar */
292
+ --sidebar-foreground: oklch(0.95 0.02 150); /* Light text */
293
+ --sidebar-accent: oklch(0.25 0.08 250); /* Hover state */
294
+ --sidebar-accent-foreground: oklch(0.98 0.01 150);
295
+ }
296
+ ```
297
+
298
+ ---
299
+
191
300
  ## Typography & Sizing
192
301
 
193
302
  ### Default Font
@@ -267,9 +376,7 @@ function App() {
267
376
  <SidebarHeader showTrigger>
268
377
  <h2>My App</h2>
269
378
  </SidebarHeader>
270
- <SidebarContent>
271
- {/* Your sidebar content */}
272
- </SidebarContent>
379
+ <SidebarContent>{/* Your sidebar content */}</SidebarContent>
273
380
  </Sidebar>
274
381
  <SidebarInset>
275
382
  <header>
@@ -290,6 +397,7 @@ function App() {
290
397
  Wraps your entire layout and provides sidebar context.
291
398
 
292
399
  **Props:**
400
+
293
401
  - `defaultOpen?: boolean` - Initial sidebar state (default: `true`)
294
402
  - `open?: boolean` - Controlled sidebar state
295
403
  - `onOpenChange?: (open: boolean) => void` - Callback when sidebar state changes
@@ -299,6 +407,7 @@ Wraps your entire layout and provides sidebar context.
299
407
  The main sidebar container.
300
408
 
301
409
  **Props:**
410
+
302
411
  - `side?: "left" | "right"` - Sidebar position (default: `"left"`)
303
412
  - `variant?: "sidebar" | "floating" | "inset"` - Visual style (default: `"sidebar"`)
304
413
  - `collapsible?: "offcanvas" | "icon" | "none"` - Collapse behavior (default: `"offcanvas"`)
@@ -311,6 +420,7 @@ The main sidebar container.
311
420
  Header section of the sidebar.
312
421
 
313
422
  **Props:**
423
+
314
424
  - `showTrigger?: boolean` - Show toggle button in header (default: `false`)
315
425
 
316
426
  ##### SidebarContent
@@ -343,7 +453,7 @@ import {
343
453
  SidebarGroupContent,
344
454
  } from "@alkimi.org/ui-kit"
345
455
 
346
- <SidebarGroup>
456
+ ;<SidebarGroup>
347
457
  <SidebarGroupLabel>Navigation</SidebarGroupLabel>
348
458
  <SidebarGroupContent>
349
459
  <SidebarMenu>
@@ -359,6 +469,7 @@ import {
359
469
  ```
360
470
 
361
471
  **Available Components:**
472
+
362
473
  - `SidebarGroup` - Groups related menu items
363
474
  - `SidebarGroupLabel` - Label for a group
364
475
  - `SidebarGroupContent` - Container for group items
@@ -406,6 +517,7 @@ function MyComponent() {
406
517
  ```
407
518
 
408
519
  **Returns:**
520
+
409
521
  - `state: "expanded" | "collapsed"` - Current sidebar state
410
522
  - `open: boolean` - Whether sidebar is open (desktop)
411
523
  - `setOpen: (open: boolean) => void` - Set sidebar state