@behavioral-agentic-design-system/core 0.1.5 → 0.2.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/package.json +1 -1
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/button.tsx +3 -0
- package/src/components/ui/checkbox.tsx +2 -2
- package/src/components/ui/dialog.tsx +28 -7
- package/src/components/ui/field.tsx +265 -0
- package/src/components/ui/input.tsx +29 -8
- package/src/components/ui/progress.tsx +6 -1
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/resizable.tsx +3 -3
- package/src/components/ui/scroll-area.tsx +4 -4
- package/src/components/ui/sheet.tsx +6 -2
- package/src/components/ui/slider.tsx +7 -2
- package/src/components/ui/switch.tsx +7 -2
- package/src/components/ui/tabs.tsx +69 -2
- package/src/lib/color-name.ts +182 -0
- package/src/lib/theme-editor.ts +213 -0
- package/src/styles.css +222 -77
- package/src/tokens.default.json +984 -0
- package/src/tokens.json +188 -90
package/src/styles.css
CHANGED
|
@@ -20,84 +20,111 @@
|
|
|
20
20
|
--font-sans: 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui;
|
|
21
21
|
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
|
22
22
|
--font-serif: ui-serif, Georgia, serif;
|
|
23
|
+
--font-size-scale: 1;
|
|
23
24
|
|
|
24
25
|
--background: oklch(1 0 0);
|
|
25
|
-
--foreground: oklch(0.
|
|
26
|
+
--foreground: oklch(0.1450 0 0);
|
|
26
27
|
--card: oklch(1 0 0);
|
|
27
|
-
--card-foreground: oklch(0.
|
|
28
|
+
--card-foreground: oklch(0.1450 0 0);
|
|
28
29
|
--popover: oklch(1 0 0);
|
|
29
|
-
--popover-foreground: oklch(0.
|
|
30
|
-
--primary:
|
|
31
|
-
--primary-foreground:
|
|
32
|
-
--secondary: oklch(0.
|
|
33
|
-
--secondary-foreground: oklch(0.
|
|
34
|
-
--muted: oklch(0.
|
|
35
|
-
--muted-foreground: oklch(0.
|
|
36
|
-
--accent: oklch(0.
|
|
37
|
-
--accent-foreground: oklch(0.
|
|
38
|
-
--destructive: oklch(0.
|
|
39
|
-
--destructive-foreground: oklch(
|
|
40
|
-
--border: oklch(0.
|
|
41
|
-
--input: oklch(0.
|
|
42
|
-
--ring: oklch(0.
|
|
43
|
-
--chart-1: oklch(0.
|
|
44
|
-
--chart-2: oklch(0.
|
|
45
|
-
--chart-3: oklch(0.
|
|
46
|
-
--chart-4: oklch(0.
|
|
47
|
-
--chart-5: oklch(0.
|
|
48
|
-
--sidebar: oklch(0.
|
|
49
|
-
--sidebar-foreground: oklch(0.
|
|
50
|
-
--sidebar-primary: oklch(0.
|
|
51
|
-
--sidebar-primary-foreground: oklch(0.
|
|
52
|
-
--sidebar-accent: oklch(0.
|
|
53
|
-
--sidebar-accent-foreground: oklch(0.
|
|
54
|
-
--sidebar-border: oklch(0.
|
|
55
|
-
--sidebar-ring: oklch(0.
|
|
30
|
+
--popover-foreground: oklch(0.1450 0 0);
|
|
31
|
+
--primary: #1F1F1F;
|
|
32
|
+
--primary-foreground: #FAFAFA;
|
|
33
|
+
--secondary: oklch(0.9700 0 0);
|
|
34
|
+
--secondary-foreground: oklch(0.2050 0 0);
|
|
35
|
+
--muted: oklch(0.9700 0 0);
|
|
36
|
+
--muted-foreground: oklch(0.3700 0 0);
|
|
37
|
+
--accent: oklch(0.9700 0 0);
|
|
38
|
+
--accent-foreground: oklch(0.2050 0 0);
|
|
39
|
+
--destructive: oklch(0.4400 0.2300 27.3250);
|
|
40
|
+
--destructive-foreground: oklch(1 0 0);
|
|
41
|
+
--border: oklch(0.6100 0 0);
|
|
42
|
+
--input: oklch(0.6100 0 0);
|
|
43
|
+
--ring: oklch(0.4500 0 0);
|
|
44
|
+
--chart-1: oklch(0.5800 0.2000 252);
|
|
45
|
+
--chart-2: oklch(0.5500 0.1800 145);
|
|
46
|
+
--chart-3: oklch(0.5800 0.1800 50);
|
|
47
|
+
--chart-4: oklch(0.5300 0.2100 320);
|
|
48
|
+
--chart-5: oklch(0.5500 0.2000 25);
|
|
49
|
+
--sidebar: oklch(0.9850 0 0);
|
|
50
|
+
--sidebar-foreground: oklch(0.1450 0 0);
|
|
51
|
+
--sidebar-primary: oklch(0.2050 0 0);
|
|
52
|
+
--sidebar-primary-foreground: oklch(0.9850 0 0);
|
|
53
|
+
--sidebar-accent: oklch(0.9700 0 0);
|
|
54
|
+
--sidebar-accent-foreground: oklch(0.2050 0 0);
|
|
55
|
+
--sidebar-border: oklch(0.6100 0 0);
|
|
56
|
+
--sidebar-ring: oklch(0.4500 0 0);
|
|
57
|
+
--semantic-text-primary: var(--foreground);
|
|
58
|
+
--semantic-text-secondary: var(--muted-foreground);
|
|
59
|
+
--semantic-text-on-primary: var(--primary-foreground);
|
|
60
|
+
--semantic-surface-page: var(--background);
|
|
61
|
+
--semantic-surface-card: var(--card);
|
|
62
|
+
--semantic-surface-overlay: oklch(0.145 0 0 / 0.8);
|
|
63
|
+
--semantic-border-default: var(--border);
|
|
64
|
+
--semantic-border-input: var(--input);
|
|
65
|
+
--semantic-border-focus: var(--ring);
|
|
66
|
+
--semantic-action-primary: var(--primary);
|
|
67
|
+
--semantic-action-primary-hover: oklch(from var(--primary) calc(l + 0.1) c h);
|
|
68
|
+
--semantic-action-destructive: var(--destructive);
|
|
56
69
|
|
|
57
70
|
--radius: 0.625rem;
|
|
58
|
-
--shadow-
|
|
59
|
-
--shadow-
|
|
60
|
-
--shadow-
|
|
61
|
-
--shadow: 0 1px 3px 0px hsl(0 0% 0% /
|
|
62
|
-
--shadow
|
|
63
|
-
--shadow-
|
|
64
|
-
--shadow-
|
|
65
|
-
--shadow-
|
|
71
|
+
--shadow-opacity: 0.10;
|
|
72
|
+
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / calc(var(--shadow-opacity) * 0.5));
|
|
73
|
+
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / calc(var(--shadow-opacity) * 0.5));
|
|
74
|
+
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 1px 2px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
75
|
+
--shadow: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 1px 2px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
76
|
+
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 2px 4px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
77
|
+
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 4px 6px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
78
|
+
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 8px 10px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
79
|
+
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / calc(var(--shadow-opacity) * 2.5));
|
|
80
|
+
--spacing: 0.25rem;
|
|
81
|
+
|
|
82
|
+
/* Chart palette — derives from --primary so brand changes propagate.
|
|
83
|
+
Override individual --chart-N inline (documentElement.style) to opt out. */
|
|
84
|
+
--chart-lightness: 0.58;
|
|
85
|
+
--chart-1: oklch(from var(--primary) var(--chart-lightness) c h);
|
|
86
|
+
--chart-2: oklch(from var(--primary) var(--chart-lightness) calc(c * 0.65) calc(h + 35));
|
|
87
|
+
--chart-3: oklch(from var(--primary) var(--chart-lightness) c calc(h + 70));
|
|
88
|
+
--chart-4: oklch(from var(--primary) var(--chart-lightness) c calc(h + 105));
|
|
89
|
+
--chart-5: oklch(from var(--primary) var(--chart-lightness) c calc(h + 140));
|
|
66
90
|
}
|
|
67
91
|
|
|
68
92
|
.dark {
|
|
69
|
-
--background: oklch(0.
|
|
70
|
-
--foreground: oklch(0.
|
|
71
|
-
--card: oklch(0.
|
|
72
|
-
--card-foreground: oklch(0.
|
|
73
|
-
--popover: oklch(0.
|
|
74
|
-
--popover-foreground: oklch(0.
|
|
75
|
-
--primary:
|
|
76
|
-
--primary-foreground:
|
|
77
|
-
--secondary: oklch(0.
|
|
78
|
-
--secondary-foreground: oklch(0.
|
|
79
|
-
--muted: oklch(0.
|
|
80
|
-
--muted-foreground: oklch(0.
|
|
81
|
-
--accent: oklch(0.
|
|
82
|
-
--accent-foreground: oklch(0.
|
|
83
|
-
--destructive: oklch(0.
|
|
84
|
-
--destructive-foreground: oklch(0.
|
|
85
|
-
--border: oklch(
|
|
86
|
-
--input: oklch(
|
|
87
|
-
--ring: oklch(0.
|
|
88
|
-
--chart-1: oklch(0.
|
|
89
|
-
--chart-2: oklch(0.
|
|
90
|
-
--chart-3: oklch(0.
|
|
91
|
-
--chart-4: oklch(0.
|
|
92
|
-
--chart-5: oklch(0.
|
|
93
|
-
--sidebar: oklch(0.
|
|
94
|
-
--sidebar-foreground: oklch(0.
|
|
95
|
-
--sidebar-primary: oklch(0.
|
|
96
|
-
--sidebar-primary-foreground: oklch(0.
|
|
97
|
-
--sidebar-accent: oklch(0.
|
|
98
|
-
--sidebar-accent-foreground: oklch(0.
|
|
99
|
-
--sidebar-border: oklch(
|
|
100
|
-
--sidebar-ring: oklch(0.
|
|
93
|
+
--background: oklch(0.1450 0 0);
|
|
94
|
+
--foreground: oklch(0.9850 0 0);
|
|
95
|
+
--card: oklch(0.2050 0 0);
|
|
96
|
+
--card-foreground: oklch(0.9850 0 0);
|
|
97
|
+
--popover: oklch(0.2690 0 0);
|
|
98
|
+
--popover-foreground: oklch(0.9850 0 0);
|
|
99
|
+
--primary: #FAFAFA;
|
|
100
|
+
--primary-foreground: #1F1F1F;
|
|
101
|
+
--secondary: oklch(0.2690 0 0);
|
|
102
|
+
--secondary-foreground: oklch(0.9850 0 0);
|
|
103
|
+
--muted: oklch(0.2690 0 0);
|
|
104
|
+
--muted-foreground: oklch(0.7800 0 0);
|
|
105
|
+
--accent: oklch(0.3710 0 0);
|
|
106
|
+
--accent-foreground: oklch(0.9850 0 0);
|
|
107
|
+
--destructive: oklch(0.7500 0.1600 22.2160);
|
|
108
|
+
--destructive-foreground: oklch(0.1500 0 0);
|
|
109
|
+
--border: oklch(0.5500 0 0);
|
|
110
|
+
--input: oklch(0.5500 0 0);
|
|
111
|
+
--ring: oklch(0.7000 0 0);
|
|
112
|
+
--chart-1: oklch(0.7800 0.1600 220);
|
|
113
|
+
--chart-2: oklch(0.7400 0.1800 145);
|
|
114
|
+
--chart-3: oklch(0.8000 0.1700 80);
|
|
115
|
+
--chart-4: oklch(0.7200 0.2000 320);
|
|
116
|
+
--chart-5: oklch(0.7400 0.1900 35);
|
|
117
|
+
--sidebar: oklch(0.2050 0 0);
|
|
118
|
+
--sidebar-foreground: oklch(0.9850 0 0);
|
|
119
|
+
--sidebar-primary: oklch(0.4200 0.2000 264.3760);
|
|
120
|
+
--sidebar-primary-foreground: oklch(0.9850 0 0);
|
|
121
|
+
--sidebar-accent: oklch(0.2690 0 0);
|
|
122
|
+
--sidebar-accent-foreground: oklch(0.9850 0 0);
|
|
123
|
+
--sidebar-border: oklch(0.5500 0 0);
|
|
124
|
+
--sidebar-ring: oklch(0.7000 0 0);
|
|
125
|
+
|
|
126
|
+
/* Lift lightness on dark backgrounds so charts stay readable. */
|
|
127
|
+
--chart-lightness: 0.78;
|
|
101
128
|
}
|
|
102
129
|
|
|
103
130
|
@theme inline {
|
|
@@ -143,14 +170,60 @@
|
|
|
143
170
|
--radius-lg: var(--radius);
|
|
144
171
|
--radius-xl: calc(var(--radius) + 4px);
|
|
145
172
|
|
|
146
|
-
/*
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
--
|
|
151
|
-
--
|
|
152
|
-
--
|
|
153
|
-
--
|
|
173
|
+
/* Map Tailwind's shadow-* utilities through to the :root --shadow-* tokens
|
|
174
|
+
so the Customize tab's Shadow Opacity slider takes effect. Without this
|
|
175
|
+
mapping, shadow-sm / shadow-md / shadow-lg etc. resolve to Tailwind's
|
|
176
|
+
built-in box-shadow values and ignore --shadow-opacity entirely. */
|
|
177
|
+
--shadow-2xs: var(--shadow-2xs);
|
|
178
|
+
--shadow-xs: var(--shadow-xs);
|
|
179
|
+
--shadow-sm: var(--shadow-sm);
|
|
180
|
+
--shadow: var(--shadow);
|
|
181
|
+
--shadow-md: var(--shadow-md);
|
|
182
|
+
--shadow-lg: var(--shadow-lg);
|
|
183
|
+
--shadow-xl: var(--shadow-xl);
|
|
184
|
+
--shadow-2xl: var(--shadow-2xl);
|
|
185
|
+
|
|
186
|
+
/* Accessibility floor — minimum 14px for text-xs (vs Tailwind's 12px default).
|
|
187
|
+
Font sizes are dynamically computed by useGlobalTypeScale hook and set as
|
|
188
|
+
--text-xs-size, --text-sm-size, etc. These are then scaled by --font-size-scale
|
|
189
|
+
(1 = 100%, 0.8 = 80%, etc) so the Customize tab slider affects all text. */
|
|
190
|
+
--text-xs: calc(var(--text-xs-size, 14px) * var(--font-size-scale, 1));
|
|
191
|
+
--text-sm: calc(var(--text-sm-size, 16px) * var(--font-size-scale, 1));
|
|
192
|
+
--text-base: calc(var(--text-base-size, 18px) * var(--font-size-scale, 1));
|
|
193
|
+
--text-lg: calc(var(--text-lg-size, 20px) * var(--font-size-scale, 1));
|
|
194
|
+
--text-xl: calc(var(--text-xl-size, 24px) * var(--font-size-scale, 1));
|
|
195
|
+
--text-2xl: calc(var(--text-2xl-size, 28px) * var(--font-size-scale, 1));
|
|
196
|
+
--text-3xl: calc(var(--text-3xl-size, 32px) * var(--font-size-scale, 1));
|
|
197
|
+
|
|
198
|
+
/* Marketing tier — display sizes for landing pages, hero blocks, editorial.
|
|
199
|
+
Tailwind only emits utilities that get used, so a non-marketing fork pays
|
|
200
|
+
nothing for these. line-height drops to 1.1 at scale to keep big type
|
|
201
|
+
readable; tracking tightens slightly to compensate for optical loosening. */
|
|
202
|
+
--text-4xl: calc(36px * var(--font-size-scale, 1));
|
|
203
|
+
--text-5xl: calc(48px * var(--font-size-scale, 1));
|
|
204
|
+
--text-6xl: calc(60px * var(--font-size-scale, 1));
|
|
205
|
+
--text-7xl: calc(72px * var(--font-size-scale, 1));
|
|
206
|
+
--text-8xl: calc(96px * var(--font-size-scale, 1));
|
|
207
|
+
--text-4xl--line-height: 1.15;
|
|
208
|
+
--text-5xl--line-height: 1.10;
|
|
209
|
+
--text-6xl--line-height: 1.05;
|
|
210
|
+
--text-7xl--line-height: 1.02;
|
|
211
|
+
--text-8xl--line-height: 1.00;
|
|
212
|
+
--text-4xl--letter-spacing: -0.015em;
|
|
213
|
+
--text-5xl--letter-spacing: -0.020em;
|
|
214
|
+
--text-6xl--letter-spacing: -0.025em;
|
|
215
|
+
--text-7xl--letter-spacing: -0.030em;
|
|
216
|
+
--text-8xl--letter-spacing: -0.035em;
|
|
217
|
+
|
|
218
|
+
/* Tracking — every Tailwind tracking-* utility folds in the runtime
|
|
219
|
+
--tracking-offset offset, so the Customize tab slider moves the
|
|
220
|
+
entire app (headlines included), not just unstyled text. */
|
|
221
|
+
--tracking-tighter: calc(-0.05em + var(--tracking-offset, 0em));
|
|
222
|
+
--tracking-tight: calc(-0.025em + var(--tracking-offset, 0em));
|
|
223
|
+
--tracking-normal: var(--tracking-offset, 0em);
|
|
224
|
+
--tracking-wide: calc(0.025em + var(--tracking-offset, 0em));
|
|
225
|
+
--tracking-wider: calc(0.05em + var(--tracking-offset, 0em));
|
|
226
|
+
--tracking-widest: calc(0.1em + var(--tracking-offset, 0em));
|
|
154
227
|
}
|
|
155
228
|
|
|
156
229
|
@layer base {
|
|
@@ -161,5 +234,77 @@
|
|
|
161
234
|
@apply bg-background text-foreground;
|
|
162
235
|
-webkit-font-smoothing: antialiased;
|
|
163
236
|
-moz-osx-font-smoothing: grayscale;
|
|
237
|
+
/* WCAG AAA 1.4.8 Visual Presentation: body line-height ≥ 1.5. */
|
|
238
|
+
line-height: 1.5;
|
|
239
|
+
/* WCAG AAA 1.4.8: avoid full-justified body — uneven word spacing
|
|
240
|
+
hurts readability. Components opt-in to justify only when needed. */
|
|
241
|
+
text-align: start;
|
|
242
|
+
}
|
|
243
|
+
/* WCAG AAA 1.4.8: paragraph spacing ≥ 1.5× line-height inside running
|
|
244
|
+
text. Scope to <p> only — UI primitives stay tight. Last-child has
|
|
245
|
+
no trailing margin so containers don't get extra padding. */
|
|
246
|
+
p:not(:last-child) {
|
|
247
|
+
margin-bottom: 1.5em;
|
|
248
|
+
}
|
|
249
|
+
/* WCAG AAA 2.4.13 Focus Appearance: focus indicator must be ≥ 2 CSS
|
|
250
|
+
pixels thick AND have ≥ 3:1 contrast against adjacent colors. The
|
|
251
|
+
--ring token is luminance-tuned for 3:1 against every surface in
|
|
252
|
+
the system. Always show a 2px offset so the ring isn't visually
|
|
253
|
+
obscured by the component's own border. */
|
|
254
|
+
:focus-visible {
|
|
255
|
+
outline-offset: 2px;
|
|
256
|
+
}
|
|
257
|
+
/* WCAG AAA 2.3.3 Animation from Interactions: respect the user's
|
|
258
|
+
reduced-motion preference globally. Components with essential
|
|
259
|
+
motion (loading spinners, progress bars) opt back in via
|
|
260
|
+
`motion-safe:` Tailwind utilities or scoped @media queries. */
|
|
261
|
+
@media (prefers-reduced-motion: reduce) {
|
|
262
|
+
*,
|
|
263
|
+
*::before,
|
|
264
|
+
*::after {
|
|
265
|
+
animation-duration: 0.01ms !important;
|
|
266
|
+
animation-iteration-count: 1 !important;
|
|
267
|
+
transition-duration: 0.01ms !important;
|
|
268
|
+
scroll-behavior: auto !important;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* Global tracking offset — the Letter Spacing slider in the Customize
|
|
274
|
+
tab writes --tracking-offset on documentElement (via use-global-design-
|
|
275
|
+
controls). Both the @theme inline tracking-* tokens AND this body rule
|
|
276
|
+
fold it in, so every element retracks live: utilities-styled elements
|
|
277
|
+
via the Tailwind classes, unstyled text via inheritance from body. */
|
|
278
|
+
html, body {
|
|
279
|
+
letter-spacing: var(--tracking-offset, 0em);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* Theme toggle: iris reveal via View Transitions API. The click coords are
|
|
283
|
+
written to --x / --y on <html> before startViewTransition fires (see
|
|
284
|
+
app/page.tsx toggleDark). */
|
|
285
|
+
::view-transition-old(root),
|
|
286
|
+
::view-transition-new(root) {
|
|
287
|
+
animation: none;
|
|
288
|
+
mix-blend-mode: normal;
|
|
289
|
+
}
|
|
290
|
+
::view-transition-old(root) { z-index: 0; }
|
|
291
|
+
::view-transition-new(root) { z-index: 1; }
|
|
292
|
+
|
|
293
|
+
@keyframes theme-reveal {
|
|
294
|
+
from {
|
|
295
|
+
clip-path: circle(0% at var(--x, 50%) var(--y, 50%));
|
|
296
|
+
opacity: 0.7;
|
|
164
297
|
}
|
|
298
|
+
to {
|
|
299
|
+
clip-path: circle(150% at var(--x, 50%) var(--y, 50%));
|
|
300
|
+
opacity: 1;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
::view-transition-new(root) {
|
|
305
|
+
animation: theme-reveal 0.4s ease-in-out forwards;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@media (prefers-reduced-motion: reduce) {
|
|
309
|
+
::view-transition-new(root) { animation: none; }
|
|
165
310
|
}
|