@behavioral-agentic-design-system/core 0.48.0 → 0.49.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/scripts/build-tokens.cjs +24 -3
- package/scripts/ux-smoke.mjs +5 -1
- package/src/api/save-tokens.ts +170 -24
- package/src/app/layout.tsx +12 -1
- package/src/app/preview/components/page.tsx +25 -18
- package/src/app/preview/global-font-client.tsx +2 -0
- package/src/app/providers.tsx +2 -0
- package/src/app/shell.tsx +50 -156
- package/src/components/customize/brand-mark-section.tsx +65 -95
- package/src/components/customize/font-pickers.tsx +25 -2
- package/src/components/customize/save-bar.tsx +120 -7
- package/src/components/customize/theme-io.tsx +62 -21
- package/src/components/customize-tab.tsx +3 -1
- package/src/components/home-recent.tsx +58 -25
- package/src/components/motion/reveal.tsx +168 -12
- package/src/components/studio/control-panel.tsx +98 -19
- package/src/components/studio/import-theme-dialog.tsx +167 -0
- package/src/components/studio/tokens-panel.tsx +215 -0
- package/src/components/studio/types.ts +5 -2
- package/src/components/studio/use-studio-tweaks.ts +36 -4
- package/src/components/studio/use-token-edits.ts +160 -0
- package/src/components/ui/toggle-tip.tsx +38 -29
- package/src/data/component-stories.json +1214 -0
- package/src/data/docs-index.ts +7 -2
- package/src/data/hidden-views.ts +22 -0
- package/src/data/history.json +32 -32
- package/src/data/sticker-sheet.json +1878 -1821
- package/src/fonts/Figtree-OFL.txt +93 -0
- package/src/fonts/figtree-latin-ext-wght-normal.woff2 +0 -0
- package/src/fonts/figtree-latin-wght-italic.woff2 +0 -0
- package/src/fonts/figtree-latin-wght-normal.woff2 +0 -0
- package/src/fonts-cdn.css +3 -1
- package/src/fonts.css +44 -0
- package/src/hooks/use-global-heading-font.ts +104 -0
- package/src/hooks/use-global-sans-font.ts +8 -3
- package/src/hooks/use-global-theme.ts +2 -2
- package/src/hooks/use-token-overrides.ts +62 -14
- package/src/lib/css-color.ts +42 -0
- package/src/lib/storybook-url.ts +28 -0
- package/src/lib/theme-editor.ts +7 -1
- package/src/lib/theme-import.ts +99 -0
- package/src/lib/theme-transition.ts +93 -0
- package/src/lib/token-list.ts +133 -0
- package/src/lib/token-value.ts +31 -0
- package/src/stories/Accordion.stories.tsx +1 -1
- package/src/stories/Affix.stories.tsx +1 -1
- package/src/stories/AiBadge.stories.tsx +1 -1
- package/src/stories/Alert.stories.tsx +1 -1
- package/src/stories/AlertDialog.stories.tsx +1 -1
- package/src/stories/AngleSlider.stories.tsx +1 -1
- package/src/stories/AnnouncementBar.stories.tsx +2 -2
- package/src/stories/AspectRatio.stories.tsx +1 -1
- package/src/stories/Attachment.stories.tsx +1 -1
- package/src/stories/Autocomplete.stories.tsx +1 -1
- package/src/stories/Avatar.stories.tsx +1 -1
- package/src/stories/Badge.stories.tsx +1 -1
- package/src/stories/Blockquote.stories.tsx +1 -1
- package/src/stories/Burger.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/ButtonGroup.stories.tsx +1 -1
- package/src/stories/Calendar.stories.tsx +1 -1
- package/src/stories/Callout.stories.tsx +1 -1
- package/src/stories/Canvas.stories.tsx +1 -1
- package/src/stories/Card.stories.tsx +1 -1
- package/src/stories/Carousel.stories.tsx +1 -1
- package/src/stories/Cascader.stories.tsx +1 -1
- package/src/stories/Chart.stories.tsx +1 -1
- package/src/stories/ChatBubble.stories.tsx +1 -1
- package/src/stories/ChatMarker.stories.tsx +1 -1
- package/src/stories/Checkbox.stories.tsx +1 -1
- package/src/stories/CheckboxCard.stories.tsx +1 -1
- package/src/stories/CheckboxGroup.stories.tsx +1 -1
- package/src/stories/Chip.stories.tsx +1 -1
- package/src/stories/CircularProgress.stories.tsx +1 -1
- package/src/stories/Clipboard.stories.tsx +1 -1
- package/src/stories/CloseButton.stories.tsx +1 -1
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/Collapsible.stories.tsx +1 -1
- package/src/stories/ColorPicker.stories.tsx +1 -1
- package/src/stories/ColorSwatch.stories.tsx +1 -1
- package/src/stories/Combobox.stories.tsx +1 -1
- package/src/stories/Container.stories.tsx +1 -1
- package/src/stories/ContextMenu.stories.tsx +1 -1
- package/src/stories/CopyButton.stories.tsx +1 -1
- package/src/stories/DataList.stories.tsx +1 -1
- package/src/stories/DataTable.stories.tsx +1 -1
- package/src/stories/DateField.stories.tsx +1 -1
- package/src/stories/DatePicker.stories.tsx +1 -1
- package/src/stories/DateRangePicker.stories.tsx +1 -1
- package/src/stories/Dialog.stories.tsx +1 -1
- package/src/stories/Drawer.stories.tsx +1 -1
- package/src/stories/DropdownMenu.stories.tsx +1 -1
- package/src/stories/Editable.stories.tsx +1 -1
- package/src/stories/EmptyState.stories.tsx +1 -1
- package/src/stories/FacetedFilter.stories.tsx +1 -1
- package/src/stories/Field.stories.tsx +1 -1
- package/src/stories/Fieldset.stories.tsx +1 -1
- package/src/stories/FileButton.stories.tsx +1 -1
- package/src/stories/FileUpload.stories.tsx +1 -1
- package/src/stories/FloatLabel.stories.tsx +1 -1
- package/src/stories/FloatingActionButton.stories.tsx +1 -1
- package/src/stories/FloatingIndicator.stories.tsx +1 -1
- package/src/stories/FloatingPanel.stories.tsx +1 -1
- package/src/stories/FocusTrap.stories.tsx +1 -1
- package/src/stories/FormatByte.stories.tsx +1 -1
- package/src/stories/FormatDate.stories.tsx +1 -1
- package/src/stories/FormatNumber.stories.tsx +1 -1
- package/src/stories/FormatRelativeTime.stories.tsx +1 -1
- package/src/stories/GaugeChart.stories.tsx +1 -1
- package/src/stories/Grid.stories.tsx +1 -1
- package/src/stories/Heatmap.stories.tsx +1 -1
- package/src/stories/Highlight.stories.tsx +1 -1
- package/src/stories/HoverCard.stories.tsx +1 -1
- package/src/stories/Icon.stories.tsx +1 -1
- package/src/stories/Image.stories.tsx +1 -1
- package/src/stories/Indicator.stories.tsx +1 -1
- package/src/stories/InfiniteScroll.stories.tsx +1 -1
- package/src/stories/InlineEdit.stories.tsx +1 -1
- package/src/stories/Input.stories.tsx +1 -1
- package/src/stories/InputClearButton.stories.tsx +1 -1
- package/src/stories/InputGroup.stories.tsx +1 -1
- package/src/stories/JsonInput.stories.tsx +1 -1
- package/src/stories/Kbd.stories.tsx +1 -1
- package/src/stories/KeyboardShortcut.stories.tsx +1 -1
- package/src/stories/Label.stories.tsx +1 -1
- package/src/stories/List.stories.tsx +1 -1
- package/src/stories/Listbox.stories.tsx +1 -1
- package/src/stories/LoadingDots.stories.tsx +1 -1
- package/src/stories/LoadingOverlay.stories.tsx +1 -1
- package/src/stories/Mark.stories.tsx +1 -1
- package/src/stories/MarkdownPreview.stories.tsx +1 -1
- package/src/stories/Marquee.stories.tsx +1 -1
- package/src/stories/Masonry.stories.tsx +1 -1
- package/src/stories/Meter.stories.tsx +1 -1
- package/src/stories/MonthPicker.stories.tsx +1 -1
- package/src/stories/MotionToggle.stories.tsx +1 -1
- package/src/stories/MultiSelect.stories.tsx +1 -1
- package/src/stories/NativeSelect.stories.tsx +1 -1
- package/src/stories/NavigationProgress.stories.tsx +1 -1
- package/src/stories/Notification.stories.tsx +1 -1
- package/src/stories/NumberField.stories.tsx +1 -1
- package/src/stories/NumberInput.stories.tsx +1 -1
- package/src/stories/OtpInput.stories.tsx +1 -1
- package/src/stories/Overlay.stories.tsx +1 -1
- package/src/stories/PageHeader.stories.tsx +1 -1
- package/src/stories/PasswordInput.stories.tsx +1 -1
- package/src/stories/PasswordStrengthInput.stories.tsx +1 -1
- package/src/stories/PhoneInput.stories.tsx +1 -1
- package/src/stories/Pill.stories.tsx +1 -1
- package/src/stories/PinInput.stories.tsx +1 -1
- package/src/stories/Popover.stories.tsx +1 -1
- package/src/stories/Portal.stories.tsx +1 -1
- package/src/stories/Presence.stories.tsx +1 -1
- package/src/stories/Progress.stories.tsx +1 -1
- package/src/stories/ProgressStack.stories.tsx +1 -1
- package/src/stories/Prose.stories.tsx +1 -1
- package/src/stories/QrCode.stories.tsx +1 -1
- package/src/stories/Questionnaire.stories.tsx +1 -1
- package/src/stories/RadioGroup.stories.tsx +1 -1
- package/src/stories/RatingGroup.stories.tsx +1 -1
- package/src/stories/Resizable.stories.tsx +1 -1
- package/src/stories/Result.stories.tsx +1 -1
- package/src/stories/Reveal.stories.tsx +1 -1
- package/src/stories/RollingNumber.stories.tsx +1 -1
- package/src/stories/ScrollArea.stories.tsx +1 -1
- package/src/stories/ScrollProgress.stories.tsx +1 -1
- package/src/stories/SearchInput.stories.tsx +1 -1
- package/src/stories/SegmentedControl.stories.tsx +1 -1
- package/src/stories/Select.stories.tsx +1 -1
- package/src/stories/Separator.stories.tsx +1 -1
- package/src/stories/Sheet.stories.tsx +1 -1
- package/src/stories/SignaturePad.stories.tsx +1 -1
- package/src/stories/SimpleGrid.stories.tsx +1 -1
- package/src/stories/Skeleton.stories.tsx +1 -1
- package/src/stories/SkeletonTable.stories.tsx +1 -1
- package/src/stories/Slider.stories.tsx +1 -1
- package/src/stories/Snackbar.stories.tsx +1 -1
- package/src/stories/Sonner.stories.tsx +1 -1
- package/src/stories/SortableList.stories.tsx +1 -1
- package/src/stories/Sparkline.stories.tsx +1 -1
- package/src/stories/Spinner.stories.tsx +1 -1
- package/src/stories/Spoiler.stories.tsx +1 -1
- package/src/stories/Squircle.stories.tsx +1 -1
- package/src/stories/Stack.stories.tsx +1 -1
- package/src/stories/StatusBadge.stories.tsx +1 -1
- package/src/stories/Switch.stories.tsx +1 -1
- package/src/stories/Table.stories.tsx +1 -1
- package/src/stories/Tag.stories.tsx +1 -1
- package/src/stories/TagsInput.stories.tsx +1 -1
- package/src/stories/Text.stories.tsx +1 -1
- package/src/stories/Textarea.stories.tsx +1 -1
- package/src/stories/ThemeIcon.stories.tsx +1 -1
- package/src/stories/TimePicker.stories.tsx +1 -1
- package/src/stories/Timeline.stories.tsx +1 -1
- package/src/stories/Timer.stories.tsx +1 -1
- package/src/stories/Toggle.stories.tsx +1 -1
- package/src/stories/ToggleGroup.stories.tsx +1 -1
- package/src/stories/ToggleTip.stories.tsx +106 -1
- package/src/stories/Tooltip.stories.tsx +56 -1
- package/src/stories/TransferList.stories.tsx +1 -1
- package/src/stories/TreeSelect.stories.tsx +1 -1
- package/src/stories/TypingIndicator.stories.tsx +1 -1
- package/src/stories/VisuallyHidden.stories.tsx +1 -1
- package/src/stories/Watermark.stories.tsx +1 -1
- package/src/stories/WeekPicker.stories.tsx +1 -1
- package/src/stories/WordRotate.stories.tsx +1 -1
- package/src/stories/YearPicker.stories.tsx +1 -1
- package/src/stories/story-groups.json +216 -224
- package/src/styles.css +20 -3
- package/src/tokens.default.json +6 -1
- package/src/tokens.json +7 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a light/dark switch as an iris: a circular reveal that grows from a point (the toggle), new theme on top,
|
|
3
|
+
* old theme underneath. One place, used by the shell's toggle and by Storybook's theme switcher.
|
|
4
|
+
*
|
|
5
|
+
* Why it needs more than startViewTransition: the new snapshot is captured about a frame after `apply` runs, and
|
|
6
|
+
* any element with `transition-colors` is still fading from its old colour at that moment. The snapshot then holds
|
|
7
|
+
* a mix of old and new, and the reveal reads as different parts of the page changing at different times. So the
|
|
8
|
+
* root carries `data-theme-switching` for the length of the switch, and styles.css turns every transition off
|
|
9
|
+
* under it. Same-origin iframe documents (the Studio and Components previews) get the same attribute, since their
|
|
10
|
+
* pixels are in the host's snapshot too.
|
|
11
|
+
*
|
|
12
|
+
* Instant switch, no iris, when: the browser has no startViewTransition, the OS asks for reduced motion (unless
|
|
13
|
+
* the app's MotionToggle forces motion on), or the app's MotionToggle is set to reduce.
|
|
14
|
+
*
|
|
15
|
+
* The easing is the system's --ease-in-out token, read at call time; the duration matches the 0.4s keyframes in
|
|
16
|
+
* styles.css (theme-reveal), which stay as the coordinate-free fallback.
|
|
17
|
+
*/
|
|
18
|
+
export const THEME_SWITCH_ATTR = "data-theme-switching";
|
|
19
|
+
const DURATION_MS = 400;
|
|
20
|
+
|
|
21
|
+
type VT = { finished: Promise<void>; ready: Promise<void> };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A second toggle skips the first transition, and the first one's `finished` settles while the second capture is
|
|
25
|
+
* still in flight. Only the newest switch may clear the attribute, and it clears every document any switch marked.
|
|
26
|
+
*/
|
|
27
|
+
let latest = 0;
|
|
28
|
+
const marked = new Set<Document>();
|
|
29
|
+
|
|
30
|
+
export function shouldReduceThemeMotion(root: HTMLElement = document.documentElement): boolean {
|
|
31
|
+
const motion = root.getAttribute("data-motion");
|
|
32
|
+
if (motion === "reduce") return true;
|
|
33
|
+
if (motion === "full") return false;
|
|
34
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function runThemeTransition(
|
|
38
|
+
apply: () => void,
|
|
39
|
+
opts: { x?: number; y?: number; docs?: Document[]; onFinished?: () => void } = {},
|
|
40
|
+
): void {
|
|
41
|
+
const root = document.documentElement;
|
|
42
|
+
const supported = "startViewTransition" in document;
|
|
43
|
+
if (!supported || shouldReduceThemeMotion(root)) {
|
|
44
|
+
apply();
|
|
45
|
+
opts.onFinished?.();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const x = opts.x ?? window.innerWidth / 2;
|
|
50
|
+
const y = opts.y ?? window.innerHeight / 2;
|
|
51
|
+
const docs = [document, ...(opts.docs ?? [])];
|
|
52
|
+
const run = ++latest;
|
|
53
|
+
docs.forEach((d) => {
|
|
54
|
+
try {
|
|
55
|
+
d.documentElement.setAttribute(THEME_SWITCH_ATTR, "");
|
|
56
|
+
marked.add(d);
|
|
57
|
+
} catch {}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Exact reach: click to the farthest corner, plus 3%, so the eased timeline spends its time on visible sweep.
|
|
61
|
+
const r = Math.ceil(Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y)) * 1.03);
|
|
62
|
+
root.style.setProperty("--r", `${r}px`);
|
|
63
|
+
|
|
64
|
+
// A style flush so every document is transition-free before the class flips.
|
|
65
|
+
void root.offsetHeight;
|
|
66
|
+
const vt = (document as Document & { startViewTransition: (cb: () => void) => VT }).startViewTransition(apply);
|
|
67
|
+
|
|
68
|
+
vt.ready.then(
|
|
69
|
+
() => {
|
|
70
|
+
try {
|
|
71
|
+
const easing = getComputedStyle(root).getPropertyValue("--ease-in-out").trim() || "ease-in-out";
|
|
72
|
+
// Scripted origin: current Chrome does not carry --x/--y into the pseudo tree. Wins over the CSS keyframe.
|
|
73
|
+
root.animate(
|
|
74
|
+
{ clipPath: [`circle(0px at ${x}px ${y}px)`, `circle(${r}px at ${x}px ${y}px)`] },
|
|
75
|
+
{ duration: DURATION_MS, easing, fill: "forwards", pseudoElement: "::view-transition-new(root)" },
|
|
76
|
+
);
|
|
77
|
+
} catch {}
|
|
78
|
+
},
|
|
79
|
+
() => {},
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const done = () => {
|
|
83
|
+
if (run !== latest) return; // a newer switch owns the attribute now
|
|
84
|
+
marked.forEach((d) => {
|
|
85
|
+
try {
|
|
86
|
+
d.documentElement.removeAttribute(THEME_SWITCH_ATTR);
|
|
87
|
+
} catch {}
|
|
88
|
+
});
|
|
89
|
+
marked.clear();
|
|
90
|
+
opts.onFinished?.();
|
|
91
|
+
};
|
|
92
|
+
vt.finished.then(done, done);
|
|
93
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Studio's token list, built from tokens.json so it cannot drift from the file.
|
|
3
|
+
*
|
|
4
|
+
* Primitive vs semantic follows the repo's own layers (layer-3 and layer-4 READMEs):
|
|
5
|
+
* primitive the raw ingredients: the colour palette, font families, type, spacing, radius, shadow, motion and
|
|
6
|
+
* breakpoint scales, and the chart ramp parameters.
|
|
7
|
+
* semantic what each value means in the product: the `theme` role tokens (background, primary, border, ...,
|
|
8
|
+
* each with a light and a dark value), plus the text styles, motion presets, component tokens and
|
|
9
|
+
* composites, whose values are aliases like {fontSize.3xl} that resolve to a primitive.
|
|
10
|
+
*
|
|
11
|
+
* Every leaf in those sections is one row, so the two tiers add up to the whole file.
|
|
12
|
+
*/
|
|
13
|
+
import tokens from "@/packages/core/src/tokens.json";
|
|
14
|
+
|
|
15
|
+
export type TokenTier = "primitive" | "semantic";
|
|
16
|
+
export type TokenKind = "color" | "font" | "dimension" | "shadow" | "time" | "easing" | "number" | "text";
|
|
17
|
+
|
|
18
|
+
export interface TokenRow {
|
|
19
|
+
id: string;
|
|
20
|
+
tier: TokenTier;
|
|
21
|
+
/** Section heading in the list. */
|
|
22
|
+
group: string;
|
|
23
|
+
/** Short name shown in the row. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Dotted path in tokens.json. For theme roles this is theme.light.<name>; `dark` carries the dark value. */
|
|
26
|
+
path: string;
|
|
27
|
+
kind: TokenKind;
|
|
28
|
+
/** Default (light) value from tokens.json. */
|
|
29
|
+
value: string;
|
|
30
|
+
/** Default dark value, for theme roles. */
|
|
31
|
+
dark?: string;
|
|
32
|
+
/** CSS custom property the value drives, when there is one. */
|
|
33
|
+
cssVar?: string;
|
|
34
|
+
/** For alias values: the path it points at, e.g. fontSize.3xl. */
|
|
35
|
+
alias?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type Leaf = { $value: unknown; $type?: string; $description?: string };
|
|
40
|
+
const isLeaf = (v: unknown): v is Leaf => !!v && typeof v === "object" && "$value" in (v as object);
|
|
41
|
+
|
|
42
|
+
export const PRIMITIVE_SECTIONS = [
|
|
43
|
+
"color", "fontFamily", "fontVariationSettings", "fontSize", "fontWeight", "lineHeight", "spacing", "borderRadius",
|
|
44
|
+
"cornerSmoothing", "shadow", "breakpoint", "duration", "easing", "chart",
|
|
45
|
+
] as const;
|
|
46
|
+
export const SEMANTIC_SECTIONS = ["theme", "typography", "motion", "component", "composites"] as const;
|
|
47
|
+
|
|
48
|
+
const SECTION_TITLE: Record<string, string> = {
|
|
49
|
+
color: "Colors", fontFamily: "Font families", fontVariationSettings: "Font variation", fontSize: "Font sizes",
|
|
50
|
+
fontWeight: "Font weights", lineHeight: "Line heights", spacing: "Spacing", borderRadius: "Radius",
|
|
51
|
+
cornerSmoothing: "Corner smoothing", shadow: "Shadows", breakpoint: "Breakpoints", duration: "Durations",
|
|
52
|
+
easing: "Easing", chart: "Chart ramp", theme: "Colors", typography: "Text styles", motion: "Motion presets",
|
|
53
|
+
component: "Component tokens", composites: "Composites",
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** CSS variables the generated styles.css exposes for primitive scales. Anything not here has no live variable. */
|
|
57
|
+
const PRIMITIVE_VAR: Record<string, (rest: string[]) => string | undefined> = {
|
|
58
|
+
color: (r) => `--primitive-${r[1]}-${r[2]}`, // color.primitive.<family>.<step>; declared by the override sheet
|
|
59
|
+
fontFamily: (r) => `--font-${r[0]}`,
|
|
60
|
+
borderRadius: (r) => (["sm", "md", "lg", "xl"].includes(r[0]) ? `--radius-${r[0]}` : undefined),
|
|
61
|
+
shadow: (r) => (r[0] === "opacity" ? "--shadow-opacity" : r[0] === "none" ? undefined : `--shadow-${r[0]}`),
|
|
62
|
+
duration: (r) => `--duration-${r[0]}`,
|
|
63
|
+
easing: (r) => `--ease-${r[0]}`,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function kindOf(section: string, leaf: Leaf): TokenKind {
|
|
67
|
+
const t = leaf.$type ?? "";
|
|
68
|
+
if (t === "color") return "color";
|
|
69
|
+
if (t === "fontFamily") return "font";
|
|
70
|
+
if (t === "shadow") return "shadow";
|
|
71
|
+
if (section === "easing" || t === "cubicBezier") return "easing";
|
|
72
|
+
if (section === "duration") return "time";
|
|
73
|
+
if (t === "dimension") return "dimension";
|
|
74
|
+
if (t === "number") return "number";
|
|
75
|
+
return "text";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const asText = (v: unknown) => (typeof v === "string" ? v : JSON.stringify(v));
|
|
79
|
+
|
|
80
|
+
function walk(section: string, node: unknown, trail: string[], out: TokenRow[], tier: TokenTier) {
|
|
81
|
+
if (isLeaf(node)) {
|
|
82
|
+
const path = [section, ...trail].join(".");
|
|
83
|
+
const raw = asText(node.$value);
|
|
84
|
+
const alias = /^\{(.+)\}$/.exec(raw)?.[1];
|
|
85
|
+
const cssVar = tier === "primitive" ? PRIMITIVE_VAR[section]?.(trail) : undefined;
|
|
86
|
+
out.push({
|
|
87
|
+
id: path, tier, group: SECTION_TITLE[section] ?? section, name: trail.join(".") || section, path,
|
|
88
|
+
kind: kindOf(section, node), value: raw, ...(cssVar ? { cssVar } : {}), ...(alias ? { alias } : {}),
|
|
89
|
+
...(node.$description ? { description: node.$description } : {}),
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (node && typeof node === "object") {
|
|
94
|
+
for (const [k, v] of Object.entries(node)) if (!k.startsWith("$")) walk(section, v, [...trail, k], out, tier);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function build(): TokenRow[] {
|
|
99
|
+
const root = tokens as unknown as Record<string, unknown>;
|
|
100
|
+
const out: TokenRow[] = [];
|
|
101
|
+
for (const s of PRIMITIVE_SECTIONS) if (root[s]) walk(s, root[s], [], out, "primitive");
|
|
102
|
+
// Colours: drop the redundant "primitive." segment from the name.
|
|
103
|
+
for (const r of out) if (r.path.startsWith("color.primitive.")) r.name = r.path.slice("color.primitive.".length);
|
|
104
|
+
|
|
105
|
+
const theme = (root.theme ?? {}) as { light?: Record<string, unknown>; dark?: Record<string, unknown> };
|
|
106
|
+
for (const [name, leaf] of Object.entries(theme.light ?? {})) {
|
|
107
|
+
if (!isLeaf(leaf)) continue;
|
|
108
|
+
const dark = (theme.dark ?? {})[name];
|
|
109
|
+
out.push({
|
|
110
|
+
id: `theme.${name}`, tier: "semantic", group: "Colors", name, path: `theme.light.${name}`, kind: "color",
|
|
111
|
+
value: asText(leaf.$value), ...(isLeaf(dark) ? { dark: asText(dark.$value) } : {}), cssVar: `--${name}`,
|
|
112
|
+
...(leaf.$description ? { description: leaf.$description } : {}),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
for (const s of SEMANTIC_SECTIONS) if (s !== "theme" && root[s]) walk(s, root[s], [], out, "semantic");
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const TOKEN_ROWS: readonly TokenRow[] = build();
|
|
120
|
+
export const PRIMITIVE_ROWS = TOKEN_ROWS.filter((r) => r.tier === "primitive");
|
|
121
|
+
export const SEMANTIC_ROWS = TOKEN_ROWS.filter((r) => r.tier === "semantic");
|
|
122
|
+
|
|
123
|
+
/** Light and dark of a theme role are two tokens in the file, so they count as two. */
|
|
124
|
+
export const tokenCount = (rows: readonly TokenRow[]) => rows.reduce((n, r) => n + (r.dark !== undefined ? 2 : 1), 0);
|
|
125
|
+
|
|
126
|
+
/** The palette, as choices for a semantic role to alias. */
|
|
127
|
+
export const PRIMITIVE_COLORS = PRIMITIVE_ROWS.filter((r) => r.kind === "color" && r.cssVar);
|
|
128
|
+
|
|
129
|
+
export function groupRows(rows: readonly TokenRow[]): { title: string; rows: TokenRow[] }[] {
|
|
130
|
+
const groups = new Map<string, TokenRow[]>();
|
|
131
|
+
for (const r of rows) groups.set(r.group, [...(groups.get(r.group) ?? []), r]);
|
|
132
|
+
return [...groups].map(([title, rs]) => ({ title, rows: rs }));
|
|
133
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cssColorToHex } from "@behavioral-agentic-design-system/core/lib/css-color";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A token value is written into a <style> element and, on Save, into tokens.json and then the published
|
|
5
|
+
* styles.css. So anything that could close a declaration or a rule has to be refused up front, not escaped.
|
|
6
|
+
*
|
|
7
|
+
* Accepted: a palette alias, exactly `var(--primitive-<name>)` (the override sheet declares the palette, so it works
|
|
8
|
+
* live; save-bar turns it into a {color.primitive.x.y} alias, and any other spelling of it is refused, as the save
|
|
9
|
+
* routes refuse it), or text with none of ; { } < > @ \ or a control, format or line separator character, no
|
|
10
|
+
* url( / image-set( / src( / element( / cross-fade( / expression( / @import / comment markers / !important, at most 200 characters. For colour tokens the
|
|
11
|
+
* browser's own colour parser must also accept it. The server routes repeat the character rules (they cannot
|
|
12
|
+
* parse colours without a DOM), so a hand-built request is held to the same text rules.
|
|
13
|
+
*/
|
|
14
|
+
export const MAX_TOKEN_VALUE = 200;
|
|
15
|
+
const ALIAS = /^var\(--primitive-[a-z0-9-]+\)$/;
|
|
16
|
+
const SAFE_TEXT = /^[^;{}<>@\\\p{Cc}\p{Cf}\u2028\u2029]+$/u;
|
|
17
|
+
const BANNED = /(url|expression)\s*\(|\b(image-set|src|element|cross-fade)\s*\(|var\(\s*--primitive-|@import|\/\*|\*\/|!\s*important/i;
|
|
18
|
+
|
|
19
|
+
export type ValueCheck = { ok: true; value: string } | { ok: false; reason: string };
|
|
20
|
+
|
|
21
|
+
export function checkTokenValue(raw: string, kind?: string): ValueCheck {
|
|
22
|
+
const value = raw.trim();
|
|
23
|
+
if (!value) return { ok: false, reason: "Value is empty" };
|
|
24
|
+
if (value.length > MAX_TOKEN_VALUE) return { ok: false, reason: `Value is over ${MAX_TOKEN_VALUE} characters` };
|
|
25
|
+
if (ALIAS.test(value)) return { ok: true, value };
|
|
26
|
+
if (!SAFE_TEXT.test(value) || BANNED.test(value)) {
|
|
27
|
+
return { ok: false, reason: "Value has characters or functions a token cannot hold" };
|
|
28
|
+
}
|
|
29
|
+
if (kind === "color" && cssColorToHex(value) === null) return { ok: false, reason: "Not a color the browser reads" };
|
|
30
|
+
return { ok: true, value };
|
|
31
|
+
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
// from comments and compiles them into invalid CSS that breaks the build.
|
|
15
15
|
|
|
16
16
|
const meta: Meta<typeof Accordion> = {
|
|
17
|
-
title: "Components/
|
|
17
|
+
title: "Components/Foundations/Accordion",
|
|
18
18
|
component: Accordion,
|
|
19
19
|
parameters: { layout: "centered" },
|
|
20
20
|
tags: ["autodocs"],
|
|
@@ -6,7 +6,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
6
6
|
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof Affix> = {
|
|
9
|
-
title: "Components/
|
|
9
|
+
title: "Components/Foundations/Affix",
|
|
10
10
|
component: Affix,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: "centered",
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { AiBadge } from "@behavioral-agentic-design-system/core/components/ui/ai-badge";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof AiBadge> = {
|
|
5
|
-
title: "Components/
|
|
5
|
+
title: "Components/Data Display/AiBadge",
|
|
6
6
|
component: AiBadge,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -17,7 +17,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
17
17
|
import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
18
18
|
|
|
19
19
|
const meta: Meta<typeof Alert> = {
|
|
20
|
-
title: "Components/Feedback/Alert",
|
|
20
|
+
title: "Components/Feedback & Overlays/Alert",
|
|
21
21
|
component: Alert,
|
|
22
22
|
parameters: { layout: "centered" },
|
|
23
23
|
tags: ["autodocs"],
|
|
@@ -14,7 +14,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
14
14
|
import { buttonVariants } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
15
15
|
|
|
16
16
|
const meta: Meta<typeof AlertDialog> = {
|
|
17
|
-
title: "Components/Feedback/AlertDialog",
|
|
17
|
+
title: "Components/Feedback & Overlays/AlertDialog",
|
|
18
18
|
component: AlertDialog,
|
|
19
19
|
parameters: {
|
|
20
20
|
layout: "centered",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof AngleSlider> = {
|
|
13
|
-
title: "Components/
|
|
13
|
+
title: "Components/Forms & Inputs/AngleSlider",
|
|
14
14
|
component: AngleSlider,
|
|
15
15
|
parameters: {
|
|
16
16
|
layout: "centered",
|
|
@@ -21,7 +21,7 @@ import { AnnouncementBar } from "@behavioral-agentic-design-system/core/componen
|
|
|
21
21
|
* `role="region"` and no action row or inline placement constraints.
|
|
22
22
|
*/
|
|
23
23
|
const meta: Meta<typeof AnnouncementBar> = {
|
|
24
|
-
title: "Components/Feedback/AnnouncementBar",
|
|
24
|
+
title: "Components/Feedback & Overlays/AnnouncementBar",
|
|
25
25
|
component: AnnouncementBar,
|
|
26
26
|
parameters: { layout: "fullscreen" },
|
|
27
27
|
tags: ["autodocs"],
|
|
@@ -124,7 +124,7 @@ export const Variant_Destructive: Story = {
|
|
|
124
124
|
|
|
125
125
|
export const AllVariants: Story = {
|
|
126
126
|
parameters: { controls: { disable: true } }, render: () => (
|
|
127
|
-
<div className="flex flex-col">
|
|
127
|
+
<div className="flex flex-col [&>[data-slot=announcement-bar]:last-child]:border-b-0">
|
|
128
128
|
<AnnouncementBar variant="default">
|
|
129
129
|
BADS v2.4 — ProgressStack, Callout, and AnnouncementBar now available.
|
|
130
130
|
</AnnouncementBar>
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { AspectRatio } from "@behavioral-agentic-design-system/core/components/ui/aspect-ratio";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof AspectRatio> = {
|
|
5
|
-
title: "Components/
|
|
5
|
+
title: "Components/Foundations/AspectRatio",
|
|
6
6
|
component: AspectRatio,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -4,7 +4,7 @@ import { Autocomplete } from "@behavioral-agentic-design-system/core/components/
|
|
|
4
4
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Autocomplete> = {
|
|
7
|
-
title: "Components/
|
|
7
|
+
title: "Components/Forms & Inputs/Autocomplete",
|
|
8
8
|
component: Autocomplete,
|
|
9
9
|
parameters: { layout: "centered" },
|
|
10
10
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
3
3
|
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Avatar> = {
|
|
6
|
-
title: "Components/
|
|
6
|
+
title: "Components/Data Display/Avatar",
|
|
7
7
|
component: Avatar,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -19,7 +19,7 @@ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badg
|
|
|
19
19
|
* — an override needs the same importance, e.g. `border-transparent!`.
|
|
20
20
|
*/
|
|
21
21
|
const meta: Meta<typeof Badge> = {
|
|
22
|
-
title: "Components/
|
|
22
|
+
title: "Components/Data Display/Badge",
|
|
23
23
|
component: Badge,
|
|
24
24
|
parameters: { layout: "centered" },
|
|
25
25
|
tags: ["autodocs"],
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof Blockquote> = {
|
|
16
|
-
title: "Components/
|
|
16
|
+
title: "Components/Data Display/Blockquote",
|
|
17
17
|
component: Blockquote,
|
|
18
18
|
parameters: { layout: "centered" },
|
|
19
19
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
3
3
|
import { Burger } from "@behavioral-agentic-design-system/core/components/ui/burger";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Burger> = {
|
|
6
|
-
title: "Components/Actions/Burger",
|
|
6
|
+
title: "Components/Buttons & Actions/Burger",
|
|
7
7
|
component: Burger,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -8,7 +8,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
8
8
|
import { Heart } from "lucide-react"
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof Button> = {
|
|
11
|
-
title: "Components/Actions/Button",
|
|
11
|
+
title: "Components/Buttons & Actions/Button",
|
|
12
12
|
component: Button,
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: "centered",
|
|
@@ -18,7 +18,7 @@ import { ButtonGroup } from "@behavioral-agentic-design-system/core/components/u
|
|
|
18
18
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
|
|
19
19
|
|
|
20
20
|
const meta: Meta<typeof ButtonGroup> = {
|
|
21
|
-
title: "Components/Actions/ButtonGroup",
|
|
21
|
+
title: "Components/Buttons & Actions/ButtonGroup",
|
|
22
22
|
component: ButtonGroup,
|
|
23
23
|
parameters: {
|
|
24
24
|
layout: "centered",
|
|
@@ -12,7 +12,7 @@ import { Calendar } from "@behavioral-agentic-design-system/core/components/ui/c
|
|
|
12
12
|
import type { DateRange } from "react-day-picker";
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof Calendar> = {
|
|
15
|
-
title: "Components/
|
|
15
|
+
title: "Components/Forms & Inputs/Calendar",
|
|
16
16
|
component: Calendar,
|
|
17
17
|
parameters: { layout: "centered" },
|
|
18
18
|
tags: ["autodocs"],
|
|
@@ -16,7 +16,7 @@ import { Code } from "@behavioral-agentic-design-system/core/components/ui/code"
|
|
|
16
16
|
* paragraphs all render correctly inside the body.
|
|
17
17
|
*/
|
|
18
18
|
const meta: Meta<typeof Callout> = {
|
|
19
|
-
title: "Components/Feedback/Callout",
|
|
19
|
+
title: "Components/Feedback & Overlays/Callout",
|
|
20
20
|
component: Callout,
|
|
21
21
|
parameters: { layout: "centered" },
|
|
22
22
|
tags: ["autodocs"],
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@behavioral-agentic-design-system/core/components/canvas/sample";
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof Canvas> = {
|
|
10
|
-
title: "Components/
|
|
10
|
+
title: "Components/Foundations/Canvas",
|
|
11
11
|
component: Canvas,
|
|
12
12
|
parameters: { layout: "fullscreen" },
|
|
13
13
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, CardFooter }
|
|
|
3
3
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Card> = {
|
|
6
|
-
title: "Components/
|
|
6
|
+
title: "Components/Foundations/Card",
|
|
7
7
|
component: Card,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { Card, CardContent } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof Carousel> = {
|
|
15
|
-
title: "Components/
|
|
15
|
+
title: "Components/Foundations/Carousel",
|
|
16
16
|
component: Carousel,
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: "centered",
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { Cascader, type CascaderOption } from "@behavioral-agentic-design-system/core/components/ui/cascader";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Cascader> = {
|
|
6
|
-
title: "Components/
|
|
6
|
+
title: "Components/Forms & Inputs/Cascader",
|
|
7
7
|
component: Cascader,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "recharts";
|
|
28
28
|
|
|
29
29
|
const meta: Meta<typeof ChartContainer> = {
|
|
30
|
-
title: "Components/
|
|
30
|
+
title: "Components/Data Display/Chart",
|
|
31
31
|
component: ChartContainer,
|
|
32
32
|
parameters: { layout: "centered" },
|
|
33
33
|
tags: ["autodocs"],
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@behavioral-agentic-design-system/core/components/ui/chat-bubble";
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof ChatBubble> = {
|
|
15
|
-
title: "Components/
|
|
15
|
+
title: "Components/Data Display/ChatBubble",
|
|
16
16
|
component: ChatBubble,
|
|
17
17
|
parameters: { layout: "padded" },
|
|
18
18
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react"
|
|
|
3
3
|
import { ChatMarker } from "../components/ui/chat-marker"
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ChatMarker> = {
|
|
6
|
-
title: "Components/
|
|
6
|
+
title: "Components/Data Display/ChatMarker",
|
|
7
7
|
component: ChatMarker,
|
|
8
8
|
tags: ["autodocs"],
|
|
9
9
|
parameters: {
|
|
@@ -6,7 +6,7 @@ import { Checkbox } from "@behavioral-agentic-design-system/core/components/ui/c
|
|
|
6
6
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof Checkbox> = {
|
|
9
|
-
title: "Components/
|
|
9
|
+
title: "Components/Forms & Inputs/Checkbox",
|
|
10
10
|
component: Checkbox,
|
|
11
11
|
parameters: { layout: "centered" },
|
|
12
12
|
tags: ["autodocs"],
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@behavioral-agentic-design-system/core/components/ui/checkbox-card";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof CheckboxCard> = {
|
|
9
|
-
title: "Components/
|
|
9
|
+
title: "Components/Forms & Inputs/CheckboxCard",
|
|
10
10
|
component: CheckboxCard,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: "centered",
|
|
@@ -15,7 +15,7 @@ import { Label } from "@behavioral-agentic-design-system/core/components/ui/labe
|
|
|
15
15
|
import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
|
|
16
16
|
|
|
17
17
|
const meta: Meta<typeof CheckboxGroup> = {
|
|
18
|
-
title: "Components/
|
|
18
|
+
title: "Components/Forms & Inputs/CheckboxGroup",
|
|
19
19
|
component: CheckboxGroup,
|
|
20
20
|
parameters: {
|
|
21
21
|
layout: "centered",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof Chip> = {
|
|
13
|
-
title: "Components/
|
|
13
|
+
title: "Components/Data Display/Chip",
|
|
14
14
|
component: Chip,
|
|
15
15
|
parameters: {
|
|
16
16
|
layout: "centered",
|
|
@@ -3,7 +3,7 @@ import * as React from "react"
|
|
|
3
3
|
import { CircularProgress } from "@behavioral-agentic-design-system/core/components/ui/circular-progress"
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof CircularProgress> = {
|
|
6
|
-
title: "Components/Feedback/CircularProgress",
|
|
6
|
+
title: "Components/Feedback & Overlays/CircularProgress",
|
|
7
7
|
component: CircularProgress,
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: "centered",
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
19
19
|
|
|
20
20
|
const meta: Meta<typeof Clipboard> = {
|
|
21
|
-
title: "Components/Actions/Clipboard",
|
|
21
|
+
title: "Components/Buttons & Actions/Clipboard",
|
|
22
22
|
component: Clipboard,
|
|
23
23
|
parameters: {
|
|
24
24
|
layout: "centered",
|
|
@@ -4,7 +4,7 @@ import { CloseButton } from "@behavioral-agentic-design-system/core/components/u
|
|
|
4
4
|
import { Tag } from "@behavioral-agentic-design-system/core/components/ui/tag";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof CloseButton> = {
|
|
7
|
-
title: "Components/Actions/CloseButton",
|
|
7
|
+
title: "Components/Buttons & Actions/CloseButton",
|
|
8
8
|
component: CloseButton,
|
|
9
9
|
parameters: { layout: "centered" },
|
|
10
10
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react"
|
|
|
3
3
|
import { Code } from "@behavioral-agentic-design-system/core/components/ui/code"
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Code> = {
|
|
6
|
-
title: "Components/
|
|
6
|
+
title: "Components/Data Display/Code",
|
|
7
7
|
component: Code,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@behavioral
|
|
|
3
3
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Collapsible> = {
|
|
6
|
-
title: "Components/
|
|
6
|
+
title: "Components/Foundations/Collapsible",
|
|
7
7
|
component: Collapsible,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -10,7 +10,7 @@ import { ColorSwatch } from "@behavioral-agentic-design-system/core/components/u
|
|
|
10
10
|
* (rounded/circle/square). Not interactive — wrap in a Button to make it click.
|
|
11
11
|
*/
|
|
12
12
|
const meta: Meta<typeof ColorSwatch> = {
|
|
13
|
-
title: "Components/
|
|
13
|
+
title: "Components/Forms & Inputs/ColorSwatch",
|
|
14
14
|
component: ColorSwatch,
|
|
15
15
|
parameters: {
|
|
16
16
|
layout: "centered",
|