@craftzbay/ui 0.10.0 → 0.11.0
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.md +14 -8
- package/dist-lib/__tests__/helpers/color.d.ts +9 -0
- package/dist-lib/__tests__/helpers/theme.d.ts +18 -0
- package/dist-lib/components/ui/Accordion.js +18 -7
- package/dist-lib/components/ui/Accordion.js.map +1 -1
- package/dist-lib/components/ui/Alert.d.ts +16 -0
- package/dist-lib/components/ui/Alert.js +47 -34
- package/dist-lib/components/ui/Alert.js.map +1 -1
- package/dist-lib/components/ui/Avatar.d.ts +1 -1
- package/dist-lib/components/ui/Avatar.js +45 -47
- package/dist-lib/components/ui/Avatar.js.map +1 -1
- package/dist-lib/components/ui/Badge.d.ts +3 -1
- package/dist-lib/components/ui/Badge.js +24 -15
- package/dist-lib/components/ui/Badge.js.map +1 -1
- package/dist-lib/components/ui/Breadcrumbs.d.ts +2 -0
- package/dist-lib/components/ui/Breadcrumbs.js +46 -28
- package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
- package/dist-lib/components/ui/Button.d.ts +5 -3
- package/dist-lib/components/ui/Button.js +59 -45
- package/dist-lib/components/ui/Button.js.map +1 -1
- package/dist-lib/components/ui/Calendar.d.ts +1 -1
- package/dist-lib/components/ui/Calendar.js +87 -59
- package/dist-lib/components/ui/Calendar.js.map +1 -1
- package/dist-lib/components/ui/Card.d.ts +2 -0
- package/dist-lib/components/ui/Card.js +48 -67
- package/dist-lib/components/ui/Card.js.map +1 -1
- package/dist-lib/components/ui/Carousel.d.ts +6 -6
- package/dist-lib/components/ui/Carousel.js +133 -102
- package/dist-lib/components/ui/Carousel.js.map +1 -1
- package/dist-lib/components/ui/Chart.d.ts +49 -10
- package/dist-lib/components/ui/Chart.js +415 -181
- package/dist-lib/components/ui/Chart.js.map +1 -1
- package/dist-lib/components/ui/Checkbox.js +42 -28
- package/dist-lib/components/ui/Checkbox.js.map +1 -1
- package/dist-lib/components/ui/Combobox.d.ts +2 -0
- package/dist-lib/components/ui/Combobox.js +142 -111
- package/dist-lib/components/ui/Combobox.js.map +1 -1
- package/dist-lib/components/ui/CommandPalette.d.ts +6 -3
- package/dist-lib/components/ui/CommandPalette.js +92 -87
- package/dist-lib/components/ui/CommandPalette.js.map +1 -1
- package/dist-lib/components/ui/ContextMenu.d.ts +7 -2
- package/dist-lib/components/ui/ContextMenu.js +77 -62
- package/dist-lib/components/ui/ContextMenu.js.map +1 -1
- package/dist-lib/components/ui/DataGrid.d.ts +17 -4
- package/dist-lib/components/ui/DataGrid.js +65 -50
- package/dist-lib/components/ui/DataGrid.js.map +1 -1
- package/dist-lib/components/ui/DatePicker.js +118 -99
- package/dist-lib/components/ui/DatePicker.js.map +1 -1
- package/dist-lib/components/ui/DesignSystemProvider.d.ts +94 -40
- package/dist-lib/components/ui/DesignSystemProvider.js +111 -55
- package/dist-lib/components/ui/DesignSystemProvider.js.map +1 -1
- package/dist-lib/components/ui/Dialog.d.ts +18 -3
- package/dist-lib/components/ui/Dialog.js +105 -80
- package/dist-lib/components/ui/Dialog.js.map +1 -1
- package/dist-lib/components/ui/Drawer.d.ts +17 -2
- package/dist-lib/components/ui/Drawer.js +89 -55
- package/dist-lib/components/ui/Drawer.js.map +1 -1
- package/dist-lib/components/ui/DropdownMenu.js +14 -9
- package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
- package/dist-lib/components/ui/EmptyState.d.ts +2 -0
- package/dist-lib/components/ui/EmptyState.js +30 -16
- package/dist-lib/components/ui/EmptyState.js.map +1 -1
- package/dist-lib/components/ui/ErrorState.d.ts +13 -2
- package/dist-lib/components/ui/ErrorState.js +44 -23
- package/dist-lib/components/ui/ErrorState.js.map +1 -1
- package/dist-lib/components/ui/FileUpload.js +59 -56
- package/dist-lib/components/ui/FileUpload.js.map +1 -1
- package/dist-lib/components/ui/Form.d.ts +15 -2
- package/dist-lib/components/ui/Form.js +97 -71
- package/dist-lib/components/ui/Form.js.map +1 -1
- package/dist-lib/components/ui/Icon.d.ts +1 -1
- package/dist-lib/components/ui/Icon.js +20 -14
- package/dist-lib/components/ui/Icon.js.map +1 -1
- package/dist-lib/components/ui/IconButton.d.ts +2 -2
- package/dist-lib/components/ui/IconButton.js +28 -20
- package/dist-lib/components/ui/IconButton.js.map +1 -1
- package/dist-lib/components/ui/Input.d.ts +3 -1
- package/dist-lib/components/ui/Input.js +92 -78
- package/dist-lib/components/ui/Input.js.map +1 -1
- package/dist-lib/components/ui/Kbd.js +1 -1
- package/dist-lib/components/ui/Kbd.js.map +1 -1
- package/dist-lib/components/ui/MultiSelect.js +121 -107
- package/dist-lib/components/ui/MultiSelect.js.map +1 -1
- package/dist-lib/components/ui/Pagination.js +67 -62
- package/dist-lib/components/ui/Pagination.js.map +1 -1
- package/dist-lib/components/ui/Popover.js +14 -14
- package/dist-lib/components/ui/Popover.js.map +1 -1
- package/dist-lib/components/ui/Progress.d.ts +3 -3
- package/dist-lib/components/ui/Progress.js +77 -72
- package/dist-lib/components/ui/Progress.js.map +1 -1
- package/dist-lib/components/ui/RadioGroup.d.ts +1 -1
- package/dist-lib/components/ui/RadioGroup.js +69 -52
- package/dist-lib/components/ui/RadioGroup.js.map +1 -1
- package/dist-lib/components/ui/RelativeTime.d.ts +19 -0
- package/dist-lib/components/ui/RelativeTime.js +31 -0
- package/dist-lib/components/ui/RelativeTime.js.map +1 -0
- package/dist-lib/components/ui/ScrollArea.d.ts +9 -1
- package/dist-lib/components/ui/ScrollArea.js +43 -27
- package/dist-lib/components/ui/ScrollArea.js.map +1 -1
- package/dist-lib/components/ui/Select.d.ts +6 -1
- package/dist-lib/components/ui/Select.js +79 -71
- package/dist-lib/components/ui/Select.js.map +1 -1
- package/dist-lib/components/ui/Separator.js +1 -1
- package/dist-lib/components/ui/Separator.js.map +1 -1
- package/dist-lib/components/ui/Sheet.d.ts +9 -0
- package/dist-lib/components/ui/Sheet.js +69 -46
- package/dist-lib/components/ui/Sheet.js.map +1 -1
- package/dist-lib/components/ui/Sidebar.d.ts +12 -9
- package/dist-lib/components/ui/Sidebar.js +152 -109
- package/dist-lib/components/ui/Sidebar.js.map +1 -1
- package/dist-lib/components/ui/Skeleton.d.ts +13 -2
- package/dist-lib/components/ui/Skeleton.js +15 -14
- package/dist-lib/components/ui/Skeleton.js.map +1 -1
- package/dist-lib/components/ui/Slider.js +41 -29
- package/dist-lib/components/ui/Slider.js.map +1 -1
- package/dist-lib/components/ui/Snackbar.js +23 -22
- package/dist-lib/components/ui/Snackbar.js.map +1 -1
- package/dist-lib/components/ui/Spinner.js +18 -6
- package/dist-lib/components/ui/Spinner.js.map +1 -1
- package/dist-lib/components/ui/Stepper.d.ts +6 -0
- package/dist-lib/components/ui/Stepper.js +71 -48
- package/dist-lib/components/ui/Stepper.js.map +1 -1
- package/dist-lib/components/ui/Switch.js +46 -43
- package/dist-lib/components/ui/Switch.js.map +1 -1
- package/dist-lib/components/ui/Table.d.ts +33 -5
- package/dist-lib/components/ui/Table.js +141 -119
- package/dist-lib/components/ui/Table.js.map +1 -1
- package/dist-lib/components/ui/Tabs.js +50 -48
- package/dist-lib/components/ui/Tabs.js.map +1 -1
- package/dist-lib/components/ui/TagInput.js +45 -45
- package/dist-lib/components/ui/TagInput.js.map +1 -1
- package/dist-lib/components/ui/Textarea.js +65 -54
- package/dist-lib/components/ui/Textarea.js.map +1 -1
- package/dist-lib/components/ui/Timeline.js +39 -35
- package/dist-lib/components/ui/Timeline.js.map +1 -1
- package/dist-lib/components/ui/Toast.js +44 -57
- package/dist-lib/components/ui/Toast.js.map +1 -1
- package/dist-lib/components/ui/Tooltip.d.ts +4 -1
- package/dist-lib/components/ui/Tooltip.js +24 -22
- package/dist-lib/components/ui/Tooltip.js.map +1 -1
- package/dist-lib/components/ui/TopNav.d.ts +7 -3
- package/dist-lib/components/ui/TopNav.js +35 -25
- package/dist-lib/components/ui/TopNav.js.map +1 -1
- package/dist-lib/components/ui/Tree.d.ts +15 -10
- package/dist-lib/components/ui/Tree.js +82 -79
- package/dist-lib/components/ui/Tree.js.map +1 -1
- package/dist-lib/hooks/use-debounce.d.ts +19 -0
- package/dist-lib/hooks/use-debounce.js +36 -0
- package/dist-lib/hooks/use-debounce.js.map +1 -0
- package/dist-lib/hooks/use-delayed-loading.d.ts +21 -0
- package/dist-lib/hooks/use-delayed-loading.js +20 -0
- package/dist-lib/hooks/use-delayed-loading.js.map +1 -0
- package/dist-lib/hooks/use-field-ids.d.ts +2 -1
- package/dist-lib/hooks/use-field-ids.js +9 -9
- package/dist-lib/hooks/use-field-ids.js.map +1 -1
- package/dist-lib/hooks/use-media-query.d.ts +3 -1
- package/dist-lib/hooks/use-media-query.js +16 -12
- package/dist-lib/hooks/use-media-query.js.map +1 -1
- package/dist-lib/hooks/use-modifier-key.d.ts +13 -0
- package/dist-lib/hooks/use-modifier-key.js +19 -0
- package/dist-lib/hooks/use-modifier-key.js.map +1 -0
- package/dist-lib/hooks/use-toast.d.ts +7 -2
- package/dist-lib/hooks/use-toast.js +61 -30
- package/dist-lib/hooks/use-toast.js.map +1 -1
- package/dist-lib/icons/index.d.ts +9 -0
- package/dist-lib/icons/index.js +148 -130
- package/dist-lib/icons/index.js.map +1 -1
- package/dist-lib/illustrations/index.d.ts +1 -0
- package/dist-lib/illustrations/index.js +15 -6
- package/dist-lib/illustrations/index.js.map +1 -1
- package/dist-lib/index.d.ts +6 -0
- package/dist-lib/index.js +280 -260
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/lib/format.d.ts +65 -0
- package/dist-lib/lib/format.js +95 -0
- package/dist-lib/lib/format.js.map +1 -0
- package/dist-lib/lib/return-focus.d.ts +11 -0
- package/dist-lib/lib/return-focus.js +12 -0
- package/dist-lib/lib/return-focus.js.map +1 -0
- package/dist-lib/lib/strings.d.ts +62 -1
- package/dist-lib/lib/strings.js +75 -19
- package/dist-lib/lib/strings.js.map +1 -1
- package/dist-lib/lib/strings.mn.js +50 -5
- package/dist-lib/lib/strings.mn.js.map +1 -1
- package/dist-lib/styles.css +1 -1
- package/dist-lib/theme.css +141 -78
- package/package.json +10 -3
package/dist-lib/theme.css
CHANGED
|
@@ -16,13 +16,18 @@
|
|
|
16
16
|
* Light mode
|
|
17
17
|
* foreground (neutral-900) on background (white) → 17.9:1
|
|
18
18
|
* foreground-muted (neutral-600) on background (white) → 7.4:1
|
|
19
|
-
* foreground-subtle (
|
|
19
|
+
* foreground-subtle (hsl 215 16% 45%) on background (white) → 5.1:1
|
|
20
|
+
* foreground-subtle on background-muted → 4.6:1 (was 4.3 at 47%)
|
|
21
|
+
* amber preset accent (oklch .56 .14 65) + white text → 4.8:1 (was 3.8 at L .62)
|
|
22
|
+
* chart-1 (hsl 217 70% 50%) on background (white) → 5.0:1 (no longer aliases --accent)
|
|
20
23
|
* accent-600 text on background (white) → 7.7:1
|
|
21
24
|
* accent-600 bg + white text → 7.7:1
|
|
22
25
|
* success-solid bg + white text → 5.2:1
|
|
23
26
|
* warning-solid bg + white text → 4.6:1
|
|
24
27
|
* danger-solid bg + white text → 4.8:1
|
|
25
|
-
* border-input (hsl 215 16%
|
|
28
|
+
* border-input (hsl 215 16% 55%) on background (white) → 3.55:1 (UI)
|
|
29
|
+
* border-input on background-muted → 3.24:1 (UI)
|
|
30
|
+
* switch-track-off (hsl 215 16% 55%) on background / muted → 3.55 / 3.24:1 (UI)
|
|
26
31
|
* border (neutral-200) / border-strong (neutral-300) → decorative (1.3 / 1.7)
|
|
27
32
|
* Dark mode
|
|
28
33
|
* foreground (neutral-50) on background (neutral-950) → 18.8:1
|
|
@@ -31,7 +36,10 @@
|
|
|
31
36
|
* accent-400 text on background (neutral-950) → 5.4:1
|
|
32
37
|
* accent-400 bg + neutral-950 text → 5.4:1
|
|
33
38
|
* success/warning/danger-solid + neutral-950 text → 9.0 / 9.3 / 5.2:1
|
|
34
|
-
* border-input (hsl 215 16%
|
|
39
|
+
* border-input (hsl 215 16% 45%) on background (neutral-950) → 3.88:1 (UI)
|
|
40
|
+
* border-input on background-muted → 3.28:1 (UI)
|
|
41
|
+
* switch-track-off (hsl 215 16% 45%) on background / muted → 3.88 / 3.28:1 (UI)
|
|
42
|
+
* background-muted on popover (menu highlight) is decorative: 1.10 (light) / 1.08 (dark) — not a 3:1 target.
|
|
35
43
|
* ============================================================================= */
|
|
36
44
|
|
|
37
45
|
/* Geist + Geist Mono are loaded via a <link> in index.html (Google Fonts). */
|
|
@@ -64,9 +72,6 @@
|
|
|
64
72
|
--text-base--line-height: 1.5rem; /* 24 — 1.71 */
|
|
65
73
|
--text-base--letter-spacing: 0;
|
|
66
74
|
|
|
67
|
-
--text-md: 0.9375rem; /* 15 */
|
|
68
|
-
--text-md--line-height: 1.5rem;
|
|
69
|
-
|
|
70
75
|
--text-lg: 1rem; /* 16 */
|
|
71
76
|
--text-lg--line-height: 1.5rem;
|
|
72
77
|
--text-lg--letter-spacing: -0.005em;
|
|
@@ -134,14 +139,10 @@
|
|
|
134
139
|
|
|
135
140
|
/* Shadow — neutral, whisper-soft. Reserved for floating surfaces. -------- */
|
|
136
141
|
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
|
|
137
|
-
--shadow-sm:
|
|
138
|
-
|
|
139
|
-
--shadow-
|
|
140
|
-
|
|
141
|
-
--shadow-lg:
|
|
142
|
-
0 12px 24px -6px rgb(0 0 0 / 0.08), 0 4px 8px -4px rgb(0 0 0 / 0.04);
|
|
143
|
-
--shadow-xl:
|
|
144
|
-
0 24px 48px -12px rgb(0 0 0 / 0.12), 0 8px 16px -8px rgb(0 0 0 / 0.06);
|
|
142
|
+
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
|
|
143
|
+
--shadow-md: 0 4px 8px -2px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
|
|
144
|
+
--shadow-lg: 0 12px 24px -6px rgb(0 0 0 / 0.08), 0 4px 8px -4px rgb(0 0 0 / 0.04);
|
|
145
|
+
--shadow-xl: 0 24px 48px -12px rgb(0 0 0 / 0.12), 0 8px 16px -8px rgb(0 0 0 / 0.06);
|
|
145
146
|
|
|
146
147
|
/* Z-index scale — semantic. ---------------------------------------------- */
|
|
147
148
|
--z-dropdown: 1000;
|
|
@@ -176,30 +177,30 @@
|
|
|
176
177
|
* ========================================================================== */
|
|
177
178
|
|
|
178
179
|
/* Neutral — cool gray (hue ≈ 220°) -------------------------------------- */
|
|
179
|
-
--color-neutral-50: hsl(210 40% 98%);
|
|
180
|
-
--color-neutral-100: hsl(210 40% 96%);
|
|
181
|
-
--color-neutral-200: hsl(214 32% 91%);
|
|
182
|
-
--color-neutral-300: hsl(213 27% 84%);
|
|
183
|
-
--color-neutral-400: hsl(215 20% 65%);
|
|
184
|
-
--color-neutral-500: hsl(215 16% 47%);
|
|
185
|
-
--color-neutral-600: hsl(215 19% 35%);
|
|
186
|
-
--color-neutral-700: hsl(215 25% 27%);
|
|
187
|
-
--color-neutral-800: hsl(217 33% 17%);
|
|
188
|
-
--color-neutral-900: hsl(222 47% 11%);
|
|
189
|
-
--color-neutral-950: hsl(229 50% 6%);
|
|
180
|
+
--color-neutral-50: hsl(210 40% 98%); /* #f8fafc */
|
|
181
|
+
--color-neutral-100: hsl(210 40% 96%); /* #f1f5f9 */
|
|
182
|
+
--color-neutral-200: hsl(214 32% 91%); /* #e2e8f0 */
|
|
183
|
+
--color-neutral-300: hsl(213 27% 84%); /* #cbd5e1 */
|
|
184
|
+
--color-neutral-400: hsl(215 20% 65%); /* #94a3b8 */
|
|
185
|
+
--color-neutral-500: hsl(215 16% 47%); /* #64748b */
|
|
186
|
+
--color-neutral-600: hsl(215 19% 35%); /* #475569 */
|
|
187
|
+
--color-neutral-700: hsl(215 25% 27%); /* #334155 */
|
|
188
|
+
--color-neutral-800: hsl(217 33% 17%); /* #1e293b */
|
|
189
|
+
--color-neutral-900: hsl(222 47% 11%); /* #0f172a */
|
|
190
|
+
--color-neutral-950: hsl(229 50% 6%); /* #0a0d14 (slightly warmer than slate-950) */
|
|
190
191
|
|
|
191
192
|
/* Accent — graphite indigo (desaturated indigo, hue ≈ 238°) ------------- */
|
|
192
|
-
--color-accent-50: hsl(232 100% 97%);
|
|
193
|
-
--color-accent-100: hsl(232 87% 94%);
|
|
194
|
-
--color-accent-200: hsl(233 79% 87%);
|
|
195
|
-
--color-accent-300: hsl(234 71% 78%);
|
|
196
|
-
--color-accent-400: hsl(238 60% 67%);
|
|
197
|
-
--color-accent-500: hsl(238 55% 58%);
|
|
198
|
-
--color-accent-600: hsl(238 50% 49%);
|
|
199
|
-
--color-accent-700: hsl(238 48% 40%);
|
|
200
|
-
--color-accent-800: hsl(238 43% 32%);
|
|
201
|
-
--color-accent-900: hsl(238 40% 26%);
|
|
202
|
-
--color-accent-950: hsl(238 50% 16%);
|
|
193
|
+
--color-accent-50: hsl(232 100% 97%); /* #eef2ff */
|
|
194
|
+
--color-accent-100: hsl(232 87% 94%); /* #e0e6ff */
|
|
195
|
+
--color-accent-200: hsl(233 79% 87%); /* #c7d0fb */
|
|
196
|
+
--color-accent-300: hsl(234 71% 78%); /* #a5b1f7 */
|
|
197
|
+
--color-accent-400: hsl(238 60% 67%); /* #828df0 */
|
|
198
|
+
--color-accent-500: hsl(238 55% 58%); /* #6371df */
|
|
199
|
+
--color-accent-600: hsl(238 50% 49%); /* #4e5fc4 */
|
|
200
|
+
--color-accent-700: hsl(238 48% 40%); /* #4350a7 */
|
|
201
|
+
--color-accent-800: hsl(238 43% 32%); /* #3a4385 */
|
|
202
|
+
--color-accent-900: hsl(238 40% 26%); /* #312f6c */
|
|
203
|
+
--color-accent-950: hsl(238 50% 16%); /* #1c1d50 */
|
|
203
204
|
|
|
204
205
|
/* Success — emerald, muted -------------------------------------------- */
|
|
205
206
|
--color-success-50: hsl(152 76% 96%);
|
|
@@ -268,12 +269,14 @@
|
|
|
268
269
|
/* Text ----------------------------------------------------------------- */
|
|
269
270
|
--foreground: hsl(222 47% 11%);
|
|
270
271
|
--foreground-muted: hsl(215 19% 35%);
|
|
271
|
-
--foreground-subtle: hsl(215 16%
|
|
272
|
+
--foreground-subtle: hsl(215 16% 45%); /* ≥4.5:1 on background-muted too */
|
|
272
273
|
|
|
273
274
|
/* Borders -------------------------------------------------------------- */
|
|
274
275
|
--border: hsl(214 32% 91%);
|
|
275
276
|
--border-strong: hsl(213 27% 84%);
|
|
276
|
-
--border-input: hsl(
|
|
277
|
+
--border-input: hsl(
|
|
278
|
+
215 16% 55%
|
|
279
|
+
); /* ≥3:1 on background AND background-muted (WCAG 1.4.11) — every interactive control edge: fields, selects, checkbox/radio, outline buttons */
|
|
277
280
|
|
|
278
281
|
/* Card / popover ------------------------------------------------------- */
|
|
279
282
|
--card: hsl(0 0% 100%);
|
|
@@ -296,13 +299,13 @@
|
|
|
296
299
|
--overlay: hsl(229 50% 6% / 0.6);
|
|
297
300
|
--tooltip: hsl(222 47% 11%);
|
|
298
301
|
--tooltip-foreground: hsl(210 40% 98%);
|
|
299
|
-
--chart-1:
|
|
302
|
+
--chart-1: hsl(217 70% 50%); /* categorical blue — never the accent, so series ≠ interactive */
|
|
300
303
|
--chart-2: hsl(162 66% 29%);
|
|
301
304
|
--chart-3: hsl(38 92% 40%);
|
|
302
305
|
--chart-4: hsl(0 72% 45%);
|
|
303
306
|
--chart-5: hsl(215 16% 47%);
|
|
304
307
|
--chart-6: hsl(262 52% 55%);
|
|
305
|
-
--switch-track-off: hsl(
|
|
308
|
+
--switch-track-off: hsl(215 16% 55%); /* ≥3:1 vs background (off state is a UI boundary) */
|
|
306
309
|
--switch-thumb: hsl(0 0% 100%);
|
|
307
310
|
|
|
308
311
|
/* Status — 4-step mini scales ----------------------------------------- */
|
|
@@ -352,7 +355,7 @@
|
|
|
352
355
|
|
|
353
356
|
--border: hsl(217 33% 17%);
|
|
354
357
|
--border-strong: hsl(215 25% 27%);
|
|
355
|
-
--border-input: hsl(215 16%
|
|
358
|
+
--border-input: hsl(215 16% 45%); /* 3.88:1 bg / 3.28:1 muted */
|
|
356
359
|
|
|
357
360
|
/* Floating/card surfaces sit one step above background-subtle for lift. */
|
|
358
361
|
--card: hsl(222 47% 11%);
|
|
@@ -372,13 +375,13 @@
|
|
|
372
375
|
--overlay: hsl(229 50% 6% / 0.7);
|
|
373
376
|
--tooltip: hsl(210 40% 98%);
|
|
374
377
|
--tooltip-foreground: hsl(222 47% 11%);
|
|
375
|
-
--chart-1:
|
|
378
|
+
--chart-1: hsl(217 80% 68%);
|
|
376
379
|
--chart-2: hsl(162 60% 55%);
|
|
377
380
|
--chart-3: hsl(38 92% 60%);
|
|
378
381
|
--chart-4: hsl(0 80% 68%);
|
|
379
382
|
--chart-5: hsl(215 20% 65%);
|
|
380
383
|
--chart-6: hsl(262 70% 75%);
|
|
381
|
-
--switch-track-off: hsl(215
|
|
384
|
+
--switch-track-off: hsl(215 16% 45%); /* 3.88:1 vs background */
|
|
382
385
|
--switch-thumb: hsl(0 0% 100%);
|
|
383
386
|
|
|
384
387
|
--success-subtle: hsl(165 80% 8%);
|
|
@@ -497,10 +500,10 @@
|
|
|
497
500
|
--color-accent-800: oklch(0.46 0.12 65);
|
|
498
501
|
}
|
|
499
502
|
:root[data-accent='amber'] {
|
|
500
|
-
--accent: oklch(0.
|
|
503
|
+
--accent: oklch(0.56 0.14 65); /* 4.8:1 with white text (0.62 was 3.8:1) */
|
|
501
504
|
--accent-subtle: oklch(0.96 0.04 75);
|
|
502
505
|
--accent-subtle-foreground: oklch(0.48 0.12 65);
|
|
503
|
-
--ring: oklch(0.
|
|
506
|
+
--ring: oklch(0.64 0.14 65); /* 3.17:1 on background-muted (0.66 was 2.93) */
|
|
504
507
|
}
|
|
505
508
|
.dark[data-accent='amber'] {
|
|
506
509
|
--accent: oklch(0.66 0.14 65);
|
|
@@ -602,11 +605,13 @@
|
|
|
602
605
|
}
|
|
603
606
|
|
|
604
607
|
html {
|
|
608
|
+
/* Reserve the scrollbar track so layout doesn't shift when content height changes. */
|
|
609
|
+
scrollbar-gutter: stable;
|
|
605
610
|
font-family: var(--font-sans);
|
|
606
611
|
font-feature-settings:
|
|
607
|
-
'cv11' on,
|
|
608
|
-
|
|
609
|
-
'rlig' on;
|
|
612
|
+
'cv11' on,
|
|
613
|
+
/* Geist: stylistic single-storey a in numbers context */ 'ss03' on,
|
|
614
|
+
/* Geist: alternate G */ 'rlig' on;
|
|
610
615
|
-webkit-font-smoothing: antialiased;
|
|
611
616
|
-moz-osx-font-smoothing: grayscale;
|
|
612
617
|
text-rendering: optimizeLegibility;
|
|
@@ -626,7 +631,9 @@
|
|
|
626
631
|
line-height: var(--text-base--line-height);
|
|
627
632
|
font-weight: var(--font-weight-normal);
|
|
628
633
|
/* Long Cyrillic words / URLs must never overflow their container. */
|
|
629
|
-
|
|
634
|
+
/* break-word, not anywhere: `anywhere` shrinks min-content so flex/table
|
|
635
|
+
columns collapse to one character on narrow screens (Cyrillic or not). */
|
|
636
|
+
overflow-wrap: break-word;
|
|
630
637
|
font-synthesis: none;
|
|
631
638
|
}
|
|
632
639
|
|
|
@@ -642,6 +649,14 @@
|
|
|
642
649
|
outline-offset: 2px;
|
|
643
650
|
}
|
|
644
651
|
|
|
652
|
+
/* Chart series are focusable SVG <g> groups. Tailwind's ring utilities are
|
|
653
|
+
box-shadow based and do not paint on SVG groups; CSS `outline` does
|
|
654
|
+
(Chromium + Firefox), drawn around the group's bounding box. */
|
|
655
|
+
[data-chart-series]:focus-visible {
|
|
656
|
+
outline: 2px solid var(--ring);
|
|
657
|
+
outline-offset: 2px;
|
|
658
|
+
}
|
|
659
|
+
|
|
645
660
|
/* tw-animate-css `animate-in` / `animate-out` defaults. Set as the
|
|
646
661
|
overridable `--tw-*` fallbacks so `duration-*` / `ease-*` utilities on
|
|
647
662
|
the same element still win. */
|
|
@@ -682,18 +697,78 @@
|
|
|
682
697
|
transition-duration: 0.001ms !important;
|
|
683
698
|
scroll-behavior: auto !important;
|
|
684
699
|
}
|
|
700
|
+
/* Opt-out for essential progress indicators (Spinner, indeterminate
|
|
701
|
+
Progress): they keep a slow (≥1s), non-flashing opacity pulse so the
|
|
702
|
+
"busy" state remains perceivable. Never use on decorative motion. */
|
|
703
|
+
[data-motion-keep],
|
|
704
|
+
.motion-safe-keep {
|
|
705
|
+
animation-name: motion-keep-pulse !important;
|
|
706
|
+
animation-duration: 1.6s !important;
|
|
707
|
+
animation-timing-function: ease-in-out !important;
|
|
708
|
+
animation-iteration-count: infinite !important;
|
|
709
|
+
transform: none !important;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/* Forced colors (Windows High Contrast): system colours replace tokens;
|
|
714
|
+
keep boundaries and focus visible. */
|
|
715
|
+
@media (forced-colors: active) {
|
|
716
|
+
:root,
|
|
717
|
+
.dark {
|
|
718
|
+
--border: CanvasText;
|
|
719
|
+
--border-strong: CanvasText;
|
|
720
|
+
--border-input: CanvasText;
|
|
721
|
+
--ring: Highlight;
|
|
722
|
+
--ring-offset: Canvas;
|
|
723
|
+
}
|
|
724
|
+
:focus-visible {
|
|
725
|
+
outline: 2px solid Highlight;
|
|
726
|
+
outline-offset: 2px;
|
|
727
|
+
}
|
|
728
|
+
.focus-ring,
|
|
729
|
+
.ring-focus {
|
|
730
|
+
outline: 2px solid Highlight;
|
|
731
|
+
box-shadow: none;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/* prefers-contrast: more — darker hairlines and secondary text. */
|
|
736
|
+
@media (prefers-contrast: more) {
|
|
737
|
+
:root {
|
|
738
|
+
--border: hsl(213 27% 78%);
|
|
739
|
+
--border-strong: hsl(215 16% 55%);
|
|
740
|
+
--foreground-muted: hsl(222 47% 20%);
|
|
741
|
+
--foreground-subtle: hsl(215 19% 35%);
|
|
742
|
+
}
|
|
743
|
+
.dark {
|
|
744
|
+
--border: hsl(215 25% 30%);
|
|
745
|
+
--border-strong: hsl(215 16% 45%);
|
|
746
|
+
--foreground-muted: hsl(210 40% 92%);
|
|
747
|
+
--foreground-subtle: hsl(213 27% 80%);
|
|
748
|
+
}
|
|
685
749
|
}
|
|
686
750
|
|
|
687
|
-
/*
|
|
688
|
-
|
|
751
|
+
/* prefers-reduced-transparency — components must not rely on backdrop
|
|
752
|
+
blur; anything still using `backdrop-blur*` falls back to an opaque
|
|
753
|
+
surface here. */
|
|
754
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
755
|
+
[class*='backdrop-blur'],
|
|
756
|
+
.glass-fallback {
|
|
757
|
+
backdrop-filter: none !important;
|
|
758
|
+
-webkit-backdrop-filter: none !important;
|
|
759
|
+
background-color: var(--background) !important;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/* Global subtle scrollbars — thin, transparent track, low-contrast thumb
|
|
764
|
+
always visible, brightened on hover of the scroll container. Applies to every scrollable surface
|
|
689
765
|
unless a component explicitly opts out. */
|
|
690
766
|
* {
|
|
691
767
|
scrollbar-width: thin;
|
|
692
|
-
scrollbar-color: transparent transparent;
|
|
768
|
+
scrollbar-color: color-mix(in oklab, var(--color-border-strong) 45%, transparent) transparent;
|
|
693
769
|
}
|
|
694
770
|
*:hover {
|
|
695
|
-
scrollbar-color:
|
|
696
|
-
transparent;
|
|
771
|
+
scrollbar-color: var(--color-border-strong) transparent;
|
|
697
772
|
}
|
|
698
773
|
*::-webkit-scrollbar {
|
|
699
774
|
width: 8px;
|
|
@@ -703,15 +778,13 @@
|
|
|
703
778
|
background: transparent;
|
|
704
779
|
}
|
|
705
780
|
*::-webkit-scrollbar-thumb {
|
|
706
|
-
background-color: transparent;
|
|
781
|
+
background-color: color-mix(in oklab, var(--color-border-strong) 45%, transparent);
|
|
707
782
|
border-radius: 9999px;
|
|
708
783
|
border: 2px solid transparent;
|
|
709
784
|
background-clip: padding-box;
|
|
710
785
|
transition: background-color 0.15s ease;
|
|
711
786
|
}
|
|
712
|
-
*:hover::-webkit-scrollbar-thumb
|
|
713
|
-
background-color: color-mix(in oklab, var(--color-border-strong) 60%, transparent);
|
|
714
|
-
}
|
|
787
|
+
*:hover::-webkit-scrollbar-thumb,
|
|
715
788
|
*::-webkit-scrollbar-thumb:hover {
|
|
716
789
|
background-color: var(--color-border-strong);
|
|
717
790
|
}
|
|
@@ -723,6 +796,16 @@
|
|
|
723
796
|
/* -----------------------------------------------------------------------------
|
|
724
797
|
* Utilities — tiny refined-minimal helpers reused across components.
|
|
725
798
|
* --------------------------------------------------------------------------- */
|
|
799
|
+
@keyframes motion-keep-pulse {
|
|
800
|
+
0%,
|
|
801
|
+
100% {
|
|
802
|
+
opacity: 1;
|
|
803
|
+
}
|
|
804
|
+
50% {
|
|
805
|
+
opacity: 0.4;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
|
|
726
809
|
@keyframes progress-indeterminate {
|
|
727
810
|
0% {
|
|
728
811
|
transform: translateX(-100%) scaleX(0.6);
|
|
@@ -754,24 +837,4 @@
|
|
|
754
837
|
border-width: 1px;
|
|
755
838
|
border-style: solid;
|
|
756
839
|
}
|
|
757
|
-
|
|
758
|
-
/* Truncate to 1, 2, 3 lines. */
|
|
759
|
-
.line-clamp-1 {
|
|
760
|
-
display: -webkit-box;
|
|
761
|
-
-webkit-line-clamp: 1;
|
|
762
|
-
-webkit-box-orient: vertical;
|
|
763
|
-
overflow: hidden;
|
|
764
|
-
}
|
|
765
|
-
.line-clamp-2 {
|
|
766
|
-
display: -webkit-box;
|
|
767
|
-
-webkit-line-clamp: 2;
|
|
768
|
-
-webkit-box-orient: vertical;
|
|
769
|
-
overflow: hidden;
|
|
770
|
-
}
|
|
771
|
-
.line-clamp-3 {
|
|
772
|
-
display: -webkit-box;
|
|
773
|
-
-webkit-line-clamp: 3;
|
|
774
|
-
-webkit-box-orient: vertical;
|
|
775
|
-
overflow: hidden;
|
|
776
|
-
}
|
|
777
840
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craftzbay/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Refined-minimal Tailwind v4 + React design system — 50+ accessible, themeable primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "craftzbay",
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"@types/react": "^18.3.12",
|
|
106
106
|
"@types/react-dom": "^18.3.1",
|
|
107
107
|
"@vitejs/plugin-react": "^4.3.4",
|
|
108
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
108
109
|
"@vitest/ui": "^4.1.6",
|
|
109
110
|
"autoprefixer": "^10.4.20",
|
|
110
111
|
"eslint": "^9.16.0",
|
|
@@ -129,11 +130,15 @@
|
|
|
129
130
|
"peerDependencies": {
|
|
130
131
|
"react": "^18 || ^19",
|
|
131
132
|
"react-dom": "^18 || ^19",
|
|
132
|
-
"tailwindcss": "^4"
|
|
133
|
+
"tailwindcss": "^4",
|
|
134
|
+
"tw-animate-css": "^1"
|
|
133
135
|
},
|
|
134
136
|
"peerDependenciesMeta": {
|
|
135
137
|
"tailwindcss": {
|
|
136
138
|
"optional": true
|
|
139
|
+
},
|
|
140
|
+
"tw-animate-css": {
|
|
141
|
+
"optional": true
|
|
137
142
|
}
|
|
138
143
|
},
|
|
139
144
|
"scripts": {
|
|
@@ -143,9 +148,11 @@
|
|
|
143
148
|
"format": "prettier --write .",
|
|
144
149
|
"test": "vitest run",
|
|
145
150
|
"test:watch": "vitest",
|
|
151
|
+
"test:coverage": "vitest run --coverage",
|
|
146
152
|
"changeset": "changeset",
|
|
147
153
|
"changeset:version": "changeset version",
|
|
148
154
|
"changeset:release": "pnpm build && changeset publish",
|
|
149
|
-
"lint": "eslint src"
|
|
155
|
+
"lint": "eslint src",
|
|
156
|
+
"test:treeshake": "vitest run src/__tests__/treeshake.test.ts"
|
|
150
157
|
}
|
|
151
158
|
}
|