@behavioral-agentic-design-system/core 0.6.0 → 0.7.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/LICENSE +21 -0
- package/package.json +30 -5
- package/scripts/bads-sync.mjs +1 -1
- package/scripts/build-fonts.cjs +15 -8
- package/scripts/build-tokens.cjs +139 -23
- package/src/api/brand-fonts.ts +27 -6
- package/src/api/layers/file.ts +4 -3
- package/src/api/layers.ts +8 -7
- package/src/api/site-auth.ts +50 -0
- package/src/app/font-ready.tsx +1 -1
- package/src/app/layout.tsx +9 -3
- package/src/app/preview/components/page.tsx +78 -1
- package/src/app/preview/icons/page.tsx +5 -0
- package/src/app/shell.tsx +27 -22
- package/src/app/site-login/page.tsx +82 -0
- package/src/brand-fonts.css +5 -0
- package/src/components/Foundations/Motion.stories.tsx +66 -0
- package/src/components/customize/letter-spacing.tsx +3 -2
- package/src/components/customize/type-scale.tsx +3 -2
- package/src/components/customize-tab.tsx +8 -7
- package/src/components/home-tab.tsx +498 -235
- package/src/components/layers-tab.tsx +141 -3
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/bottom-sheet.tsx +124 -0
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/chart.tsx +115 -14
- package/src/components/ui/checkbox.tsx +3 -2
- package/src/components/ui/dialog.tsx +3 -3
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/radio-group.tsx +4 -3
- package/src/components/ui/sheet.tsx +1 -1
- package/src/components/ui/switch.tsx +3 -3
- package/src/components/ui/tabs.tsx +6 -0
- package/src/fonts/HyperlegibleSans-Bold.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-BoldItalic.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-Italic.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-Medium.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-MediumItalic.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-Regular.woff2 +0 -0
- package/src/fonts/InterVariable-Italic.woff2 +0 -0
- package/src/fonts/InterVariable.woff2 +0 -0
- package/src/fonts.css +99 -0
- package/src/hooks/use-global-primary-color.ts +114 -68
- package/src/hooks/use-global-serif-font.ts +1 -1
- package/src/lib/storage.ts +2 -2
- package/src/styles.css +151 -61
- package/src/tokens.default.json +4 -4
- package/src/tokens.json +159 -162
- package/src/app/preview/login/page.tsx +0 -5
- package/src/app/preview/mail/page.tsx +0 -4
- package/src/app/preview/pricing/page.tsx +0 -4
- package/src/components/admin-menu.stories.tsx +0 -68
- package/src/components/admin-menu.tsx +0 -59
|
@@ -25,6 +25,16 @@ import {
|
|
|
25
25
|
DialogTitle,
|
|
26
26
|
DialogTrigger,
|
|
27
27
|
} from "@behavioral-agentic-design-system/core/components/ui/dialog";
|
|
28
|
+
import {
|
|
29
|
+
BottomSheet,
|
|
30
|
+
BottomSheetClose,
|
|
31
|
+
BottomSheetContent,
|
|
32
|
+
BottomSheetDescription,
|
|
33
|
+
BottomSheetFooter,
|
|
34
|
+
BottomSheetHeader,
|
|
35
|
+
BottomSheetTitle,
|
|
36
|
+
BottomSheetTrigger,
|
|
37
|
+
} from "@behavioral-agentic-design-system/core/components/ui/bottom-sheet";
|
|
28
38
|
import { Sparkles, Info } from "lucide-react";
|
|
29
39
|
|
|
30
40
|
// Stable, deterministic data for ScrollArea — never use Math.random in
|
|
@@ -39,7 +49,7 @@ function Section({ title, children }: { title: string; children: React.ReactNode
|
|
|
39
49
|
return (
|
|
40
50
|
<section className="space-y-4">
|
|
41
51
|
<h2 className="text-2xl font-semibold tracking-tight">{title}</h2>
|
|
42
|
-
<
|
|
52
|
+
<Card className="p-6 shadow-none">{children}</Card>
|
|
43
53
|
</section>
|
|
44
54
|
);
|
|
45
55
|
}
|
|
@@ -226,6 +236,73 @@ export default function ComponentsPreview() {
|
|
|
226
236
|
</ul>
|
|
227
237
|
</ScrollArea>
|
|
228
238
|
</Section>
|
|
239
|
+
|
|
240
|
+
<Section title="BottomSheet">
|
|
241
|
+
<div className="flex flex-wrap gap-3">
|
|
242
|
+
{/* Default — grab handle + close button */}
|
|
243
|
+
<BottomSheet>
|
|
244
|
+
<BottomSheetTrigger asChild>
|
|
245
|
+
<Button variant="outline">Open</Button>
|
|
246
|
+
</BottomSheetTrigger>
|
|
247
|
+
<BottomSheetContent>
|
|
248
|
+
<BottomSheetHeader>
|
|
249
|
+
<BottomSheetTitle>Display density</BottomSheetTitle>
|
|
250
|
+
<BottomSheetDescription>
|
|
251
|
+
Choose how much information shows on each row.
|
|
252
|
+
</BottomSheetDescription>
|
|
253
|
+
</BottomSheetHeader>
|
|
254
|
+
</BottomSheetContent>
|
|
255
|
+
</BottomSheet>
|
|
256
|
+
|
|
257
|
+
{/* No handle variant */}
|
|
258
|
+
<BottomSheet>
|
|
259
|
+
<BottomSheetTrigger asChild>
|
|
260
|
+
<Button variant="outline">No handle</Button>
|
|
261
|
+
</BottomSheetTrigger>
|
|
262
|
+
<BottomSheetContent showHandle={false}>
|
|
263
|
+
<BottomSheetHeader>
|
|
264
|
+
<BottomSheetTitle>No grab handle</BottomSheetTitle>
|
|
265
|
+
<BottomSheetDescription>
|
|
266
|
+
Handle hidden via showHandle={"{false}"}.
|
|
267
|
+
</BottomSheetDescription>
|
|
268
|
+
</BottomSheetHeader>
|
|
269
|
+
</BottomSheetContent>
|
|
270
|
+
</BottomSheet>
|
|
271
|
+
|
|
272
|
+
{/* Realistic action sheet with a footer */}
|
|
273
|
+
<BottomSheet>
|
|
274
|
+
<BottomSheetTrigger asChild>
|
|
275
|
+
<Button>View settings</Button>
|
|
276
|
+
</BottomSheetTrigger>
|
|
277
|
+
<BottomSheetContent>
|
|
278
|
+
<BottomSheetHeader>
|
|
279
|
+
<BottomSheetTitle>View settings</BottomSheetTitle>
|
|
280
|
+
<BottomSheetDescription>
|
|
281
|
+
These apply to the Components board only.
|
|
282
|
+
</BottomSheetDescription>
|
|
283
|
+
</BottomSheetHeader>
|
|
284
|
+
<div className="flex flex-col gap-5 px-4 py-2">
|
|
285
|
+
<div className="flex items-center justify-between">
|
|
286
|
+
<Label htmlFor="density-group">Group by status</Label>
|
|
287
|
+
<Switch id="density-group" defaultChecked />
|
|
288
|
+
</div>
|
|
289
|
+
<div className="flex items-center justify-between">
|
|
290
|
+
<Label htmlFor="density-sub">Show sub-tasks</Label>
|
|
291
|
+
<Switch id="density-sub" />
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
<BottomSheetFooter className="flex-row justify-end gap-2">
|
|
295
|
+
<BottomSheetClose asChild>
|
|
296
|
+
<Button variant="ghost">Cancel</Button>
|
|
297
|
+
</BottomSheetClose>
|
|
298
|
+
<BottomSheetClose asChild>
|
|
299
|
+
<Button>Apply</Button>
|
|
300
|
+
</BottomSheetClose>
|
|
301
|
+
</BottomSheetFooter>
|
|
302
|
+
</BottomSheetContent>
|
|
303
|
+
</BottomSheet>
|
|
304
|
+
</div>
|
|
305
|
+
</Section>
|
|
229
306
|
</div>
|
|
230
307
|
</div>
|
|
231
308
|
);
|
package/src/app/shell.tsx
CHANGED
|
@@ -30,7 +30,6 @@ import { CustomizeTab } from "@behavioral-agentic-design-system/core/components/
|
|
|
30
30
|
import { LayersTab } from "@behavioral-agentic-design-system/core/components/layers-tab";
|
|
31
31
|
import { HomeTab } from "@behavioral-agentic-design-system/core/components/home-tab";
|
|
32
32
|
import { BrandMark } from "@behavioral-agentic-design-system/core/components/brand-mark";
|
|
33
|
-
import { AdminMenu } from "@behavioral-agentic-design-system/core/components/admin-menu";
|
|
34
33
|
|
|
35
34
|
/**
|
|
36
35
|
* Iframe-hosted preview surface. Listens for the parent's dark-mode state and
|
|
@@ -109,12 +108,13 @@ export type ShellTabContext = {
|
|
|
109
108
|
};
|
|
110
109
|
|
|
111
110
|
/**
|
|
112
|
-
* Lets tab content request a tab switch without prop-drilling
|
|
113
|
-
*
|
|
114
|
-
*
|
|
111
|
+
* Lets tab content request a tab switch without prop-drilling through the
|
|
112
|
+
* render tree. Use when a button deep inside a tab (e.g. "Customize" CTA on
|
|
113
|
+
* the Home tab) needs to jump to another tab. The `goToTab` render-prop is
|
|
114
|
+
* still the right call for top-level tab components that already receive
|
|
115
|
+
* ShellTabContext directly.
|
|
115
116
|
*
|
|
116
|
-
* Falls back to a no-op
|
|
117
|
-
* Home tab stays usable in isolation.
|
|
117
|
+
* Falls back to a no-op outside Shell so Home stays usable in storybook.
|
|
118
118
|
*/
|
|
119
119
|
type ShellNav = { setTab: (value: string) => void };
|
|
120
120
|
const ShellNavContext = createContext<ShellNav | null>(null);
|
|
@@ -152,10 +152,9 @@ export const DEFAULT_TABS: ShellTab[] = [
|
|
|
152
152
|
{ value: "components", label: "Components", render: ({ dark }) => <IframePreview dark={dark} src="/preview/components" /> },
|
|
153
153
|
{ value: "cards", label: "Cards", render: ({ dark }) => <IframePreview dark={dark} src="/preview/cards" /> },
|
|
154
154
|
{ value: "dashboard", label: "Dashboard", hidden: "md", render: ({ dark }) => <IframePreview dark={dark} src="/preview/dashboard" minWidth="1400px" /> },
|
|
155
|
-
{ value: "mail", label: "Mail", hidden: "md", render: ({ dark }) => <IframePreview dark={dark} src="/preview/mail" minWidth="1300px" /> },
|
|
156
|
-
{ value: "pricing", label: "Pricing", render: ({ dark }) => <IframePreview dark={dark} src="/preview/pricing" /> },
|
|
157
155
|
{ value: "layers", label: "Layers", render: () => <LayersTab /> },
|
|
158
156
|
{ value: "colors", label: "Customize", render: () => <CustomizeTab /> },
|
|
157
|
+
{ value: "icons", label: "Icons", render: ({ dark }) => <IframePreview dark={dark} src="/preview/icons" /> },
|
|
159
158
|
];
|
|
160
159
|
|
|
161
160
|
/**
|
|
@@ -216,15 +215,25 @@ export function Shell({ tabs, defaultTab }: ShellProps) {
|
|
|
216
215
|
const prefersReduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
217
216
|
const supports = typeof document !== "undefined" && "startViewTransition" in document;
|
|
218
217
|
|
|
219
|
-
// Sync
|
|
220
|
-
// new theme at the same instant the parent does —
|
|
221
|
-
// behind React's useEffect and the
|
|
218
|
+
// Sync iframes in the currently-active tab right now so the visible
|
|
219
|
+
// surface matches the new theme at the same instant the parent does —
|
|
220
|
+
// otherwise the iframe lags behind React's useEffect and the view
|
|
221
|
+
// transition captures stale content. Off-screen iframes (other tabs that
|
|
222
|
+
// were preloaded into the DOM) catch up via the per-IframePreview
|
|
223
|
+
// useEffect when React commits the new `dark` prop. Skipping the
|
|
224
|
+
// synchronous sync for those iframes matters when one of them holds
|
|
225
|
+
// expensive content (the Icons tab renders ~1,700 SVGs whose
|
|
226
|
+
// currentColor strokes all recompute on `.dark` toggle) — paying for
|
|
227
|
+
// that recompute every toggle, even when not visible, dominated the
|
|
228
|
+
// perceived toggle latency.
|
|
222
229
|
const syncIframes = () => {
|
|
223
|
-
document
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
230
|
+
document
|
|
231
|
+
.querySelectorAll<HTMLIFrameElement>('[data-state="active"] iframe')
|
|
232
|
+
.forEach((f) => {
|
|
233
|
+
try {
|
|
234
|
+
f.contentDocument?.documentElement.classList.toggle("dark", next);
|
|
235
|
+
} catch {}
|
|
236
|
+
});
|
|
228
237
|
};
|
|
229
238
|
const syncHost = () => {
|
|
230
239
|
root.classList.toggle("dark", next);
|
|
@@ -268,9 +277,9 @@ export function Shell({ tabs, defaultTab }: ShellProps) {
|
|
|
268
277
|
variant="ghost"
|
|
269
278
|
size="sm"
|
|
270
279
|
className="group h-8 gap-1.5 border border-foreground/30 hover:!bg-foreground hover:!text-background hover:border-foreground"
|
|
271
|
-
title="Open Storybook (requires `pnpm dev` or `pnpm storybook` to be running on :
|
|
280
|
+
title="Open Storybook (requires `pnpm dev` or `pnpm storybook` to be running on :6080)"
|
|
272
281
|
>
|
|
273
|
-
<a href="http://localhost:
|
|
282
|
+
<a href="http://localhost:6080" target="_blank" rel="noreferrer" aria-label="Open Storybook in a new tab">
|
|
274
283
|
<BookOpen className="h-4 w-4 transition-all group-hover:scale-110" strokeWidth={1.5} />
|
|
275
284
|
<span className="text-xs font-medium">Storybook</span>
|
|
276
285
|
</a>
|
|
@@ -344,10 +353,6 @@ export function Shell({ tabs, defaultTab }: ShellProps) {
|
|
|
344
353
|
</div>
|
|
345
354
|
</section>
|
|
346
355
|
</Tabs>
|
|
347
|
-
|
|
348
|
-
<div className="fixed bottom-4 right-4 flex items-end gap-2">
|
|
349
|
-
<AdminMenu />
|
|
350
|
-
</div>
|
|
351
356
|
</div>
|
|
352
357
|
</ShellNavContext.Provider>
|
|
353
358
|
);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { brand } from "@/brand.config";
|
|
2
|
+
import { BrandMark } from "@behavioral-agentic-design-system/core/components/brand-mark";
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Input,
|
|
6
|
+
} from "@behavioral-agentic-design-system/core/components/ui";
|
|
7
|
+
import {
|
|
8
|
+
Field,
|
|
9
|
+
FieldError,
|
|
10
|
+
FieldLabel,
|
|
11
|
+
} from "@behavioral-agentic-design-system/core/components/ui/field";
|
|
12
|
+
|
|
13
|
+
// Server-rendered password gate for the BADS demo deployment. Activated by
|
|
14
|
+
// middleware.ts when SITE_PASSWORD is set on the deployment target. Page is
|
|
15
|
+
// nested under the root layout so it inherits brand fonts + tokens — the
|
|
16
|
+
// gate feels like part of the system, not a generic basic-auth pop-up.
|
|
17
|
+
|
|
18
|
+
export default async function SiteLoginPage({
|
|
19
|
+
searchParams,
|
|
20
|
+
}: {
|
|
21
|
+
searchParams: Promise<{ next?: string; error?: string }>;
|
|
22
|
+
}) {
|
|
23
|
+
const { next = "/", error } = await searchParams;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<main className="grid min-h-screen place-items-center bg-background px-6 py-12">
|
|
27
|
+
<div className="w-full max-w-sm space-y-8">
|
|
28
|
+
<div className="flex items-center gap-3">
|
|
29
|
+
<BrandMark className="size-8" />
|
|
30
|
+
<div className="flex flex-col">
|
|
31
|
+
<span className="text-base font-medium leading-tight">
|
|
32
|
+
{brand.name}
|
|
33
|
+
</span>
|
|
34
|
+
<span className="text-xs text-muted-foreground">
|
|
35
|
+
{brand.tagline}
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div className="space-y-2">
|
|
41
|
+
<h1 className="text-2xl font-semibold tracking-tight">
|
|
42
|
+
Password required
|
|
43
|
+
</h1>
|
|
44
|
+
<p className="text-sm text-muted-foreground">
|
|
45
|
+
This preview is gated while we tune it for the next round of
|
|
46
|
+
client reviews. Enter the shared password to continue.
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<form
|
|
51
|
+
method="POST"
|
|
52
|
+
action="/api/site-auth"
|
|
53
|
+
className="space-y-4"
|
|
54
|
+
autoComplete="off"
|
|
55
|
+
>
|
|
56
|
+
<input type="hidden" name="next" value={next} />
|
|
57
|
+
<Field>
|
|
58
|
+
<FieldLabel htmlFor="site-password">Password</FieldLabel>
|
|
59
|
+
<Input
|
|
60
|
+
id="site-password"
|
|
61
|
+
name="password"
|
|
62
|
+
type="password"
|
|
63
|
+
autoComplete="off"
|
|
64
|
+
autoFocus
|
|
65
|
+
required
|
|
66
|
+
aria-invalid={error ? "true" : "false"}
|
|
67
|
+
aria-describedby={error ? "site-password-error" : undefined}
|
|
68
|
+
/>
|
|
69
|
+
{error && (
|
|
70
|
+
<FieldError id="site-password-error">
|
|
71
|
+
That password didn't match. Try again.
|
|
72
|
+
</FieldError>
|
|
73
|
+
)}
|
|
74
|
+
</Field>
|
|
75
|
+
<Button type="submit" size="xl" className="w-full">
|
|
76
|
+
Continue
|
|
77
|
+
</Button>
|
|
78
|
+
</form>
|
|
79
|
+
</div>
|
|
80
|
+
</main>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* GENERATED FROM brand-fonts.json — DO NOT EDIT BY HAND.
|
|
2
|
+
* Run `pnpm build:fonts` after changing brand-fonts.json (this happens
|
|
3
|
+
* automatically when fonts are added/removed via the Customize tab). */
|
|
4
|
+
|
|
5
|
+
/* No brand fonts registered yet. Add one via the Customize tab → font picker → "+". */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
|
|
4
5
|
const meta: Meta = {
|
|
@@ -128,6 +129,71 @@ export const Easings: Story = {
|
|
|
128
129
|
},
|
|
129
130
|
};
|
|
130
131
|
|
|
132
|
+
// Semantic motion layer — intent-named pairs emitted as --motion-<intent>-*.
|
|
133
|
+
// Each demo animates the property the intent is meant for, driven entirely by
|
|
134
|
+
// the CSS vars (no hardcoded numbers), so it tracks tokens.json automatically.
|
|
135
|
+
const SEMANTIC_MOTIONS = [
|
|
136
|
+
{ name: "fade", prop: "opacity", from: "0", to: "1", note: "Overlays, content swaps, in-place appear" },
|
|
137
|
+
{ name: "slide", prop: "transform", from: "translateY(24px)", to: "translateY(0)", note: "Sheets, drawers, toasts from an edge" },
|
|
138
|
+
{ name: "scale", prop: "transform", from: "scale(0.85)", to: "scale(1)", note: "Popovers, menus, tooltips from origin" },
|
|
139
|
+
{ name: "expand", prop: "transform", from: "scaleY(0)", to: "scaleY(1)", note: "Accordions, collapsibles, disclosure" },
|
|
140
|
+
{ name: "spin", prop: "transform", from: "rotate(0deg)", to: "rotate(360deg)", note: "Loaders, busy chevrons (loops)" },
|
|
141
|
+
] as const;
|
|
142
|
+
|
|
143
|
+
export const SemanticMotion: Story = {
|
|
144
|
+
parameters: {
|
|
145
|
+
docs: {
|
|
146
|
+
description: {
|
|
147
|
+
story:
|
|
148
|
+
"Intent-named motion: reach for --motion-<intent>-duration / -ease instead of raw numbers. Each box animates with only its intent's CSS vars. See layer-6 motion.md for the decision tree.",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
render: () => {
|
|
153
|
+
const [tick, setTick] = useState(0);
|
|
154
|
+
return (
|
|
155
|
+
<div className="p-8 bg-background">
|
|
156
|
+
<div className="flex items-baseline justify-between mb-6">
|
|
157
|
+
<h3 className="text-sm font-semibold text-muted-foreground">Semantic motion (by intent)</h3>
|
|
158
|
+
<button
|
|
159
|
+
type="button"
|
|
160
|
+
onClick={() => setTick((t) => t + 1)}
|
|
161
|
+
className="text-sm font-medium underline underline-offset-4 hover:text-primary"
|
|
162
|
+
>
|
|
163
|
+
Replay
|
|
164
|
+
</button>
|
|
165
|
+
</div>
|
|
166
|
+
<div className="space-y-6">
|
|
167
|
+
{SEMANTIC_MOTIONS.map((m) => (
|
|
168
|
+
<div key={m.name} className="flex items-center gap-6">
|
|
169
|
+
<div className="w-44 shrink-0">
|
|
170
|
+
<code className="text-xs font-mono text-foreground">--motion-{m.name}-*</code>
|
|
171
|
+
<p className="text-xs text-muted-foreground font-mono mt-0.5">
|
|
172
|
+
duration / ease
|
|
173
|
+
</p>
|
|
174
|
+
</div>
|
|
175
|
+
<div className="relative h-12 w-12">
|
|
176
|
+
<div
|
|
177
|
+
key={tick}
|
|
178
|
+
className="h-12 w-12 rounded-md bg-primary"
|
|
179
|
+
style={{
|
|
180
|
+
transition: `${m.prop} var(--motion-${m.name}-duration) var(--motion-${m.name}-ease)`,
|
|
181
|
+
transformOrigin: m.name === "expand" ? "top" : "center",
|
|
182
|
+
// Flip from "from" to "to" on each replay (key remount) so
|
|
183
|
+
// the transition plays. Cast covers the dynamic prop key.
|
|
184
|
+
[m.prop]: tick % 2 === 0 ? m.to : m.from,
|
|
185
|
+
} as CSSProperties}
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
<p className="text-sm text-muted-foreground">{m.note}</p>
|
|
189
|
+
</div>
|
|
190
|
+
))}
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
131
197
|
export const ReducedMotion: Story = {
|
|
132
198
|
parameters: {
|
|
133
199
|
docs: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
4
|
+
import { Card } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
4
5
|
import { Slider } from "@behavioral-agentic-design-system/core/components/ui/slider";
|
|
5
6
|
import {
|
|
6
7
|
DESIGN_CONTROL_DEFAULTS,
|
|
@@ -87,7 +88,7 @@ export function LetterSpacingPanel() {
|
|
|
87
88
|
</p>
|
|
88
89
|
</div>
|
|
89
90
|
|
|
90
|
-
<
|
|
91
|
+
<Card className="p-6 shadow-none space-y-3">
|
|
91
92
|
<p className="text-3xl font-semibold leading-tight">
|
|
92
93
|
The quick brown fox
|
|
93
94
|
</p>
|
|
@@ -98,7 +99,7 @@ export function LetterSpacingPanel() {
|
|
|
98
99
|
<p className="text-xs text-muted-foreground font-mono">
|
|
99
100
|
0123456789 — sample numerals
|
|
100
101
|
</p>
|
|
101
|
-
</
|
|
102
|
+
</Card>
|
|
102
103
|
</div>
|
|
103
104
|
</section>
|
|
104
105
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
4
|
+
import { Card } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
4
5
|
import { Slider } from "@behavioral-agentic-design-system/core/components/ui/slider";
|
|
5
6
|
import {
|
|
6
7
|
RATIO_PRESETS,
|
|
@@ -106,7 +107,7 @@ export function TypeScalePanel() {
|
|
|
106
107
|
</div>
|
|
107
108
|
</div>
|
|
108
109
|
|
|
109
|
-
<
|
|
110
|
+
<Card className="p-6 shadow-none space-y-4">
|
|
110
111
|
{PREVIEW_ROWS.map((row) => (
|
|
111
112
|
<div
|
|
112
113
|
key={row.token}
|
|
@@ -128,7 +129,7 @@ export function TypeScalePanel() {
|
|
|
128
129
|
</div>
|
|
129
130
|
</div>
|
|
130
131
|
))}
|
|
131
|
-
</
|
|
132
|
+
</Card>
|
|
132
133
|
</section>
|
|
133
134
|
);
|
|
134
135
|
}
|
|
@@ -143,12 +143,13 @@ function ColorSwatch({
|
|
|
143
143
|
type="button"
|
|
144
144
|
onClick={() => {
|
|
145
145
|
resetToken(variable);
|
|
146
|
-
// Chart
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
// Chart vars are written inline by use-global-primary-color
|
|
147
|
+
// so clearing the override here doesn't put the live --chart-N
|
|
148
|
+
// back into a brand-derived state — call back into the hook
|
|
149
|
+
// to re-evaluate the ramp against the current --primary.
|
|
150
|
+
if (variable.startsWith("--chart-")) {
|
|
151
|
+
reapplyChartRamp();
|
|
152
|
+
}
|
|
152
153
|
}}
|
|
153
154
|
className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors"
|
|
154
155
|
>
|
|
@@ -486,7 +487,7 @@ function BrandColorCard({
|
|
|
486
487
|
<div className="group relative">
|
|
487
488
|
{opt.grade !== "AAA" && (
|
|
488
489
|
<span
|
|
489
|
-
className="pointer-events-none absolute -top-2 -
|
|
490
|
+
className="pointer-events-none absolute -top-2 -right-2 z-10 inline-flex h-7 w-7 items-center justify-center rounded-full bg-amber-50 dark:bg-amber-950 border border-amber-300 dark:border-amber-700 shadow-sm"
|
|
490
491
|
title={`Below WCAG AAA — current ${opt.contrast}:1 (${opt.grade}), required 7:1`}
|
|
491
492
|
aria-label={`${opt.label} is below WCAG AAA contrast`}
|
|
492
493
|
>
|