@behavioral-agentic-design-system/core 0.28.0 → 0.29.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 +2 -2
- package/scripts/a11y-lint.cjs +78 -9
- package/scripts/build-tokens.cjs +273 -15
- package/scripts/wcag-audit.cjs +37 -7
- package/src/api/layers/file.ts +1 -0
- package/src/app/font-ready.tsx +6 -5
- package/src/app/layout.tsx +54 -3
- package/src/app/preview/components/page.tsx +5532 -3044
- package/src/app/preview/layout.tsx +4 -1
- package/src/app/preview/showcase-filter.tsx +66 -0
- package/src/app/preview/tab-replay.tsx +63 -0
- package/src/app/shell.tsx +74 -18
- package/src/components/customize/save-bar.tsx +19 -6
- package/src/components/docs-tab.tsx +36 -24
- package/src/components/layers-tab.tsx +37 -5
- package/src/components/ui/alert.tsx +12 -0
- package/src/components/ui/badge.tsx +19 -0
- package/src/components/ui/chat-marker.tsx +120 -0
- package/src/components/ui/checkbox.tsx +9 -1
- package/src/components/ui/close-button.tsx +71 -0
- package/src/components/ui/combobox.tsx +62 -3
- package/src/components/ui/container.tsx +65 -0
- package/src/components/ui/date-field.tsx +368 -0
- package/src/components/ui/drawer.tsx +334 -0
- package/src/components/ui/file-button.tsx +145 -0
- package/src/components/ui/floating-indicator.tsx +217 -0
- package/src/components/ui/format-byte.tsx +113 -0
- package/src/components/ui/index.ts +21 -0
- package/src/components/ui/input.tsx +38 -3
- package/src/components/ui/keyboard-shortcut.tsx +146 -0
- package/src/components/ui/loading-dots.tsx +99 -0
- package/src/components/ui/month-picker.tsx +296 -0
- package/src/components/ui/multi-select.tsx +15 -13
- package/src/components/ui/nav-link.tsx +200 -0
- package/src/components/ui/navigation-rail.tsx +256 -0
- package/src/components/ui/notification.tsx +20 -0
- package/src/components/ui/password-input.tsx +34 -1
- package/src/components/ui/progress.tsx +15 -1
- package/src/components/ui/prose.tsx +62 -0
- package/src/components/ui/result.tsx +151 -0
- package/src/components/ui/rolling-number.tsx +1 -0
- package/src/components/ui/simple-grid.tsx +110 -0
- package/src/components/ui/skeleton.tsx +52 -3
- package/src/components/ui/squircle.tsx +274 -0
- package/src/components/ui/stack.tsx +105 -0
- package/src/components/ui/status-badge.tsx +93 -0
- package/src/components/ui/tabs.tsx +34 -7
- package/src/components/ui/tag.tsx +46 -5
- package/src/components/ui/theme-icon.tsx +138 -0
- package/src/components/ui/timeline.tsx +27 -10
- package/src/components/ui/tooltip.tsx +12 -1
- package/src/components/ui/tree-select.tsx +386 -0
- package/src/components/ui/year-picker.tsx +307 -0
- package/src/data/docs-index.ts +10 -0
- package/src/hooks/use-global-primary-color.ts +57 -6
- package/src/stories/Alert.stories.tsx +31 -1
- package/src/stories/Badge.stories.tsx +63 -6
- package/src/stories/ChatMarker.stories.tsx +59 -0
- package/src/stories/Checkbox.stories.tsx +5 -0
- package/src/stories/CloseButton.stories.tsx +65 -0
- package/src/stories/Combobox.stories.tsx +74 -3
- package/src/stories/Container.stories.tsx +134 -0
- package/src/stories/DateField.stories.tsx +114 -0
- package/src/stories/Drawer.stories.tsx +211 -0
- package/src/stories/FileButton.stories.tsx +117 -0
- package/src/stories/FloatingIndicator.stories.tsx +343 -0
- package/src/stories/FormatByte.stories.tsx +142 -0
- package/src/stories/Input.stories.tsx +91 -0
- package/src/stories/KeyboardShortcut.stories.tsx +87 -0
- package/src/stories/LoadingDots.stories.tsx +73 -0
- package/src/stories/MonthPicker.stories.tsx +99 -0
- package/src/stories/MultiSelect.stories.tsx +3 -1
- package/src/stories/NavLink.stories.tsx +213 -0
- package/src/stories/NavigationRail.stories.tsx +413 -0
- package/src/stories/Notification.stories.tsx +53 -0
- package/src/stories/PasswordInput.stories.tsx +21 -0
- package/src/stories/Progress.stories.tsx +38 -0
- package/src/stories/Prose.stories.tsx +232 -0
- package/src/stories/Result.stories.tsx +145 -0
- package/src/stories/RollingNumber.stories.tsx +1 -1
- package/src/stories/SimpleGrid.stories.tsx +130 -0
- package/src/stories/Skeleton.stories.tsx +62 -1
- package/src/stories/Squircle.stories.tsx +127 -0
- package/src/stories/Stack.stories.tsx +139 -0
- package/src/stories/StatusBadge.stories.tsx +125 -0
- package/src/stories/Tabs.stories.tsx +56 -1
- package/src/stories/Tag.stories.tsx +31 -0
- package/src/stories/ThemeIcon.stories.tsx +97 -0
- package/src/stories/Timeline.stories.tsx +69 -0
- package/src/stories/Tooltip.stories.tsx +18 -0
- package/src/stories/TreeSelect.stories.tsx +222 -0
- package/src/stories/YearPicker.stories.tsx +100 -0
- package/src/styles.css +289 -15
- package/src/tokens.json +96 -1
- package/LICENSE +0 -21
package/src/data/docs-index.ts
CHANGED
|
@@ -58,6 +58,7 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
58
58
|
{ title: "Component backlog", path: "docs/component-backlog.md", summary: "Figma-library primitives queued for Night Shift." },
|
|
59
59
|
{ title: "Component index", path: "COMPONENT_INDEX.md" },
|
|
60
60
|
{ title: "Component design rules", path: "COMPONENT_DESIGN.md" },
|
|
61
|
+
{ title: "Atomic design taxonomy", path: "ATOMIC_DESIGN.md", summary: "Atoms → molecules → organisms → templates → pages, in RFC-2119 language (MUST/MUST NOT/SHOULD/MAY): what each level may do (business logic, data fetching, local state) and where it lives in BADS, plus a bucket A–D ↔ level cheat sheet. For engineers and AI agents; makes promoting a BADS component into a client library 1:1. Adapted from web-common." },
|
|
61
62
|
{ title: "Storybook rule", path: "STORYBOOK_RULE.md" },
|
|
62
63
|
{ title: "CTA size contract", path: "prompts/cta-size-contract.md" },
|
|
63
64
|
{ title: "Motion spec", path: "prompts/motion-spec.md" },
|
|
@@ -90,10 +91,15 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
90
91
|
{ title: "Skill — persona-pressure-test", path: ".claude/skills/persona-pressure-test/SKILL.md" },
|
|
91
92
|
{ title: "Skill — promote-prototype", path: ".claude/skills/promote-prototype/SKILL.md" },
|
|
92
93
|
{ title: "Skill — visual-verify", path: ".claude/skills/visual-verify/SKILL.md" },
|
|
94
|
+
{ title: "Skill — motion-review", path: ".claude/skills/motion-review/SKILL.md" },
|
|
95
|
+
{ title: "Skill — redesign", path: ".claude/skills/redesign/SKILL.md", summary: "Re-skin an existing surface WITHOUT changing what it does — preserve copy / IA / routes / brand, rebuild only the visual + interaction layer with a fresh (diversified) fingerprint. Distinct from design-exploration (new surface) and component-builder (one component). Adapted BADS-native from Hallmark's redesign verb." },
|
|
93
96
|
{ title: "Prompt — conceptual model", path: "prompts/conceptual-model.md", summary: "Before sketching a product surface, name its domain objects, states, relationships, and vocabulary — Jamie Mill's 'most neglected layer,' wired into Path B as design-exploration step 3.5. Feeds the real-content pool, state patterns, and primitive selection." },
|
|
94
97
|
{ title: "Prompt — parallel rollout", path: "prompts/parallel-rollout.md", summary: "For a Path B build that's N similar surfaces: build one reference screen, turn it into an explicit contract, sign off on the contract, then fan the rest out against it (via Workflow) and verify each to the contract. Stops multi-screen drift. Adapted from the design-spec-framework." },
|
|
95
98
|
{ title: "Prompt — design directions", path: "prompts/design-directions.md" },
|
|
99
|
+
{ title: "Prompt — plan & spec", path: "prompts/plan-and-spec.md", summary: "Lightweight per-feature convention: a matched plan (how you'll build it) + spec (the durable contract, in RFC-2119 language) under docs/plans/ and docs/specs/, dated and slugged the same. The trail that lets the next agent — or the client's team after the engagement — reconstruct why. Adapted from web-common's superpowers/plans + specs." },
|
|
100
|
+
{ title: "Prompt — macrostructures", path: "prompts/macrostructures.md", summary: "Named menu of ~16 structural paradigms (the positive counterpart to the anti-defaults) with when-it-fits / what-it-costs each, plus a diversification rule so a fork's screens don't converge on one shape. Consumed at design-exploration step 3.7. Adapted BADS-native from Nutlope's Hallmark." },
|
|
96
101
|
{ title: "Prompt — design critique", path: "prompts/design-critique.md" },
|
|
102
|
+
{ title: "Prompt — design DNA", path: "prompts/design-dna.md", summary: "Extract a single admired reference's DNA along three axes (macrostructure + type-pairing + colour anchor), refuse templates/marketplaces, and seed it into the fork's exemplars as a portable visual target. The single-reference counterpart to art-direction's gallery sweep. Adapted BADS-native from Hallmark's study verb." },
|
|
97
103
|
{ title: "Prompt — independent critique", path: "prompts/independent-critique.md" },
|
|
98
104
|
{ title: "Prompt — futures check", path: "prompts/futures-check.md" },
|
|
99
105
|
{ title: "Prompt — persona pressure test", path: "prompts/persona-pressure-test.md" },
|
|
@@ -105,6 +111,8 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
105
111
|
description: "How the system stays honest — anti-patterns, the corrections log, the ethics floor.",
|
|
106
112
|
entries: [
|
|
107
113
|
{ title: "Design rules", path: "DESIGN.md", summary: "Visual system + accessibility baseline." },
|
|
114
|
+
{ title: "Release-please evaluation", path: "docs/release-please-evaluation.md", summary: "Decision record: release-please vs changesets. Recommendation — stay on changesets (BADS ships one package; human-authored changelogs fit the intentional-output ethos), revisit release-please when BADS goes multi-package or Night Shift's auto-merge cadence outpaces manual changeset authoring. Item 12 from the web-common spec." },
|
|
115
|
+
{ title: "Token migration", path: "docs/token-migration.md", summary: "The pattern for renaming/restructuring tokens in a fork without a heroic all-at-once PR: a token-migration.json old→new mapping enforced diff-aware (changed files held to new names, legacy tolerated in untouched files) via pnpm check:token-migration, plus a copy-pasteable mapping table. Adapted from web-common." },
|
|
108
116
|
{ title: "Chart color palette", path: "docs/chart-color-palette.md", summary: "Accessible 5-color categorical palette for data viz — Okabe-Ito-derived, reviewed against WCAG 1.4.11 non-text contrast." },
|
|
109
117
|
{ title: "Chart design", path: "docs/chart-design.md", summary: "Chart composition rules — grid, axes, labels, legend, tooltip, number formatting, states, motion. The 'data is the only saturated thing' register; companion to the color palette." },
|
|
110
118
|
{ title: "Privacy-first design (8 principles)", path: "layer-2-ethics-responsibility/privacy-first-design.md", summary: "Matthew Stephens' 8-principle privacy framework: minimize collection, transparency, expiration, no dark patterns, user control, ethical monetization, sustainable practices, accountability — mapped to BADS enforcement." },
|
|
@@ -177,6 +185,8 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
177
185
|
description: "Deferred plans — what we'd build if the activation signal fires.",
|
|
178
186
|
entries: [
|
|
179
187
|
{ title: "Roadmap", path: "docs/roadmap.md", summary: "Layer 2/6/8/9/10 deferred work with the signal that should activate each one." },
|
|
188
|
+
{ title: "Plan — skill package", path: "docs/plans/2026-08-21-skill-package.md", summary: "Approved plan: generate a per-fork, npx-installable agent skill — SKILL.md + drift-proof component recipes + token CSS — so the design system's rules travel into the client product repos where components are consumed. Phase A shipped; see the spec." },
|
|
189
|
+
{ title: "Spec — skill package", path: "docs/specs/2026-08-21-skill-package.md", summary: "The durable contract for packages/skill: generated-only output, usage-focused recipes, ≤2k-word SKILL.md, deterministic builds, the check:skill staleness gate, and the eval --context=skill acceptance instrument." },
|
|
180
190
|
],
|
|
181
191
|
},
|
|
182
192
|
];
|
|
@@ -278,12 +278,57 @@ function clearPrimaryColor() {
|
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Floor for the brand primary in dark mode. --primary feeds fills, the focus ring, and (via
|
|
283
|
+
* --link) inline link text, so the text floor is the one that has to hold.
|
|
284
|
+
*/
|
|
285
|
+
const PRIMARY_DARK_FLOOR = 4.5;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Should the brand primary be written inline at all?
|
|
289
|
+
*
|
|
290
|
+
* The picker used to write --primary unconditionally, in both themes. That is fine for a brand
|
|
291
|
+
* colour with mid-to-high luminance and wrong for a dark one. A client fork whose brand primary is
|
|
292
|
+
* a deep navy measured 1.79:1 on the dark card and 1.98:1 on the dark page, producing 25 rendered
|
|
293
|
+
* contrast failures the moment dark mode actually rendered. tokens.json already carries a
|
|
294
|
+
* luminance-tuned dark primary for exactly this reason — the inline write was overwriting it.
|
|
295
|
+
*
|
|
296
|
+
* Same discipline as pickAccentForeground below, and the same rationale: an inline override that
|
|
297
|
+
* fails contrast is worse than no override, because the stylesheet value it replaces was tuned.
|
|
298
|
+
* Both are invisible to wcag:audit, which only sees declared tokens — pnpm check:contrast is what
|
|
299
|
+
* catches this class of bug.
|
|
300
|
+
*/
|
|
301
|
+
function shouldWritePrimary(opt: PrimaryColorOption): boolean {
|
|
302
|
+
if (typeof document === "undefined") return true;
|
|
303
|
+
const html = document.documentElement;
|
|
304
|
+
if (!html.classList.contains("dark")) return true;
|
|
305
|
+
const bg = parseCssColorToRgb(
|
|
306
|
+
getComputedStyle(html).getPropertyValue("--background").trim(),
|
|
307
|
+
);
|
|
308
|
+
if (!bg) return true; // can't tell — leave existing behaviour alone
|
|
309
|
+
try {
|
|
310
|
+
return contrastRatio(rgbFromHex(opt.primary), bg) >= PRIMARY_DARK_FLOOR;
|
|
311
|
+
} catch {
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
281
316
|
function applyColor(opt: PrimaryColorOption) {
|
|
282
317
|
if (typeof document === "undefined") return;
|
|
283
318
|
const root = document.documentElement.style;
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
319
|
+
const writePrimary = shouldWritePrimary(opt);
|
|
320
|
+
if (writePrimary) {
|
|
321
|
+
root.setProperty("--primary", opt.primary);
|
|
322
|
+
root.setProperty("--primary-foreground", opt.primaryForeground);
|
|
323
|
+
root.setProperty("--ring", opt.primary);
|
|
324
|
+
} else {
|
|
325
|
+
// Remove rather than substitute. --primary-foreground goes too: it is paired with the brand
|
|
326
|
+
// colour, and leaving it behind would put the brand's foreground on the stylesheet's tuned
|
|
327
|
+
// dark primary — a pairing nobody chose and which measures worse than either default.
|
|
328
|
+
root.removeProperty("--primary");
|
|
329
|
+
root.removeProperty("--primary-foreground");
|
|
330
|
+
root.removeProperty("--ring");
|
|
331
|
+
}
|
|
287
332
|
|
|
288
333
|
// --accent-foreground used to be set unconditionally to opt.primary. That
|
|
289
334
|
// produced silent contrast failures when the brand color was too close in
|
|
@@ -300,9 +345,15 @@ function applyColor(opt: PrimaryColorOption) {
|
|
|
300
345
|
root.removeProperty("--accent-foreground");
|
|
301
346
|
}
|
|
302
347
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
348
|
+
if (writePrimary) {
|
|
349
|
+
root.setProperty("--sidebar-primary", opt.primary);
|
|
350
|
+
root.setProperty("--sidebar-primary-foreground", opt.primaryForeground);
|
|
351
|
+
root.setProperty("--sidebar-ring", opt.primary);
|
|
352
|
+
} else {
|
|
353
|
+
root.removeProperty("--sidebar-primary");
|
|
354
|
+
root.removeProperty("--sidebar-primary-foreground");
|
|
355
|
+
root.removeProperty("--sidebar-ring");
|
|
356
|
+
}
|
|
306
357
|
// Inline-write the chart ramp so brand picker changes reach charts. The
|
|
307
358
|
// stylesheet rule is precomputed by Lightning CSS into a frozen lab().
|
|
308
359
|
writeChartRamp();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// Dismissible + WithAction: onDismiss renders a top-right × button; action
|
|
10
10
|
// renders a row below AlertDescription. Both are optional and compose freely.
|
|
11
11
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
12
|
-
import { AlertCircleIcon } from "lucide-react";
|
|
12
|
+
import { AlertCircleIcon, CheckCircle2Icon, TriangleAlertIcon, InfoIcon } from "lucide-react";
|
|
13
13
|
import { Alert, AlertTitle, AlertDescription } from "@behavioral-agentic-design-system/core/components/ui/alert";
|
|
14
14
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
15
15
|
import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
@@ -59,6 +59,36 @@ export const Variant_Destructive: Story = {
|
|
|
59
59
|
</div>),
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
export const Variant_Success: Story = {
|
|
63
|
+
render: () => (<div className="w-[420px]">
|
|
64
|
+
<Alert variant="success">
|
|
65
|
+
<CheckCircle2Icon className="h-5 w-5" />
|
|
66
|
+
<AlertTitle>Changes saved</AlertTitle>
|
|
67
|
+
<AlertDescription>Your profile has been updated successfully.</AlertDescription>
|
|
68
|
+
</Alert>
|
|
69
|
+
</div>),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Variant_Warning: Story = {
|
|
73
|
+
render: () => (<div className="w-[420px]">
|
|
74
|
+
<Alert variant="warning">
|
|
75
|
+
<TriangleAlertIcon className="h-5 w-5" />
|
|
76
|
+
<AlertTitle>Plan limit approaching</AlertTitle>
|
|
77
|
+
<AlertDescription>You've used 80% of your monthly API calls.</AlertDescription>
|
|
78
|
+
</Alert>
|
|
79
|
+
</div>),
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const Variant_Info: Story = {
|
|
83
|
+
render: () => (<div className="w-[420px]">
|
|
84
|
+
<Alert variant="info">
|
|
85
|
+
<InfoIcon className="h-5 w-5" />
|
|
86
|
+
<AlertTitle>Maintenance scheduled</AlertTitle>
|
|
87
|
+
<AlertDescription>We'll be down for 15 minutes on Sunday at 2am UTC.</AlertDescription>
|
|
88
|
+
</Alert>
|
|
89
|
+
</div>),
|
|
90
|
+
};
|
|
91
|
+
|
|
62
92
|
// NestedInCard verifies the hierarchy contract — an Alert sitting inside a
|
|
63
93
|
// Card must remain visually distinct. Pre-fix, both surfaces used bg-card and
|
|
64
94
|
// the alert disappeared into the card.
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { CircleCheck, TriangleAlert, Info } from "lucide-react";
|
|
2
3
|
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
3
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Badge ships six neutral variants plus three semantic status variants
|
|
7
|
+
* (success / warning / info — peer parity: Mantine Badge color, Chakra
|
|
8
|
+
* colorPalette, Ant Design status Tags). Status variants share Alert's
|
|
9
|
+
* color language: semantic-token border + tinted background + icon in the
|
|
10
|
+
* semantic color, while the label stays text-foreground so it holds the
|
|
11
|
+
* AAA 7:1 floor. Pair status badges with an icon or distinct label — never
|
|
12
|
+
* color alone.
|
|
13
|
+
*/
|
|
4
14
|
const meta: Meta<typeof Badge> = {
|
|
5
15
|
title: "Components/Badge",
|
|
6
16
|
component: Badge,
|
|
@@ -44,11 +54,58 @@ export const Variant_Link: Story = {
|
|
|
44
54
|
render: () => <Badge variant="link">Link</Badge>,
|
|
45
55
|
};
|
|
46
56
|
|
|
57
|
+
export const Variant_Success: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<Badge variant="success">
|
|
60
|
+
<CircleCheck strokeWidth={1.5} aria-hidden />
|
|
61
|
+
Passing
|
|
62
|
+
</Badge>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const Variant_Warning: Story = {
|
|
67
|
+
render: () => (
|
|
68
|
+
<Badge variant="warning">
|
|
69
|
+
<TriangleAlert strokeWidth={1.5} aria-hidden />
|
|
70
|
+
Degraded
|
|
71
|
+
</Badge>
|
|
72
|
+
),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Variant_Info: Story = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<Badge variant="info">
|
|
78
|
+
<Info strokeWidth={1.5} aria-hidden />
|
|
79
|
+
Preview
|
|
80
|
+
</Badge>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
83
|
+
|
|
47
84
|
export const RealisticUse: Story = {
|
|
48
|
-
render: () => (
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
85
|
+
render: () => (
|
|
86
|
+
<div className="flex max-w-md flex-col gap-3">
|
|
87
|
+
<div className="flex items-center gap-2">
|
|
88
|
+
<Badge>Default</Badge>
|
|
89
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
90
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
91
|
+
<Badge variant="outline">Outline</Badge>
|
|
92
|
+
</div>
|
|
93
|
+
{/* Status row as it appears in a component-registry table: the icon
|
|
94
|
+
carries the non-color signal alongside the label. */}
|
|
95
|
+
<div className="flex items-center gap-2">
|
|
96
|
+
<Badge variant="success">
|
|
97
|
+
<CircleCheck strokeWidth={1.5} aria-hidden />
|
|
98
|
+
AAA audit passing
|
|
99
|
+
</Badge>
|
|
100
|
+
<Badge variant="warning">
|
|
101
|
+
<TriangleAlert strokeWidth={1.5} aria-hidden />
|
|
102
|
+
2 advisory warnings
|
|
103
|
+
</Badge>
|
|
104
|
+
<Badge variant="info">
|
|
105
|
+
<Info strokeWidth={1.5} aria-hidden />
|
|
106
|
+
Tokens v2 preview
|
|
107
|
+
</Badge>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
),
|
|
54
111
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
|
|
3
|
+
import { ChatMarker } from "../components/ui/chat-marker"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ChatMarker> = {
|
|
6
|
+
title: "UI/ChatMarker",
|
|
7
|
+
component: ChatMarker,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded",
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default meta
|
|
15
|
+
type Story = StoryObj<typeof ChatMarker>
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
label: "Today",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Variant_Yesterday: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
label: "Yesterday",
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Variant_Status: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
variant: "status",
|
|
32
|
+
label: "Seen 2:14 PM",
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Variant_Divider: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
variant: "divider",
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const RealisticUse: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<div className="flex w-72 flex-col gap-1 rounded-lg border bg-card p-4">
|
|
45
|
+
<div className="rounded-lg bg-muted px-3 py-2 text-sm">
|
|
46
|
+
Hey, you around?
|
|
47
|
+
</div>
|
|
48
|
+
<ChatMarker label="Yesterday" />
|
|
49
|
+
<div className="self-end rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground">
|
|
50
|
+
Yeah! What's up?
|
|
51
|
+
</div>
|
|
52
|
+
<ChatMarker label="Today" />
|
|
53
|
+
<div className="rounded-lg bg-muted px-3 py-2 text-sm">
|
|
54
|
+
Can we jump on a call?
|
|
55
|
+
</div>
|
|
56
|
+
<ChatMarker variant="status" label="Seen 9:41 AM" />
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
}
|
|
@@ -12,6 +12,11 @@ const meta: Meta<typeof Checkbox> = {
|
|
|
12
12
|
export default meta;
|
|
13
13
|
type Story = StoryObj<typeof meta>;
|
|
14
14
|
|
|
15
|
+
// The visible box is 32px but the pointer target is 44px (WCAG 2.2 SC 2.5.5
|
|
16
|
+
// Enhanced / AAA), delivered by a centered transparent ::before overlay on the
|
|
17
|
+
// Root — see checkbox.tsx. It's invisible and layout-neutral, so it can't be
|
|
18
|
+
// verified by eye here; this note is the regression guard. Do not remove the
|
|
19
|
+
// `before:*` hit-area utilities without a replacement that keeps the target 44px.
|
|
15
20
|
export const Default: Story = {
|
|
16
21
|
render: () => (<div className="flex items-center gap-2">
|
|
17
22
|
<Checkbox id="terms" defaultChecked />
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { CloseButton } from "@behavioral-agentic-design-system/core/components/ui/close-button";
|
|
4
|
+
import { Tag } from "@behavioral-agentic-design-system/core/components/ui/tag";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof CloseButton> = {
|
|
7
|
+
title: "Components/CloseButton",
|
|
8
|
+
component: CloseButton,
|
|
9
|
+
parameters: { layout: "centered" },
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
export const Default: StoryObj = {
|
|
16
|
+
render: () => <CloseButton />,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Sizes: StoryObj = {
|
|
20
|
+
render: () => (
|
|
21
|
+
<div className="flex items-center gap-3">
|
|
22
|
+
{(["icon-xs", "icon-sm", "icon", "icon-lg", "icon-xl"] as const).map(
|
|
23
|
+
(size) => (
|
|
24
|
+
<div key={size} className="flex flex-col items-center gap-1">
|
|
25
|
+
<CloseButton size={size} aria-label={`Close (${size})`} />
|
|
26
|
+
<span className="text-xs text-muted-foreground">{size}</span>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Variant_Outline: StoryObj = {
|
|
35
|
+
render: () => <CloseButton variant="outline" />,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Variant_Secondary: StoryObj = {
|
|
39
|
+
render: () => <CloseButton variant="secondary" />,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Disabled: StoryObj = {
|
|
43
|
+
render: () => <CloseButton disabled />,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const RealisticUse: StoryObj = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<div className="flex w-96 items-start justify-between gap-3 rounded-lg border border-border bg-card p-4">
|
|
49
|
+
<div className="min-w-0">
|
|
50
|
+
<p className="text-sm font-medium text-foreground">
|
|
51
|
+
Tokens v2 proposal shared
|
|
52
|
+
</p>
|
|
53
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
54
|
+
Jordan Reeves shared tokens-v2-proposal.pdf with the review group.
|
|
55
|
+
Review is scheduled for May 26, 2026.
|
|
56
|
+
</p>
|
|
57
|
+
<div className="mt-2 flex flex-wrap gap-1.5">
|
|
58
|
+
<Tag label="design-review" />
|
|
59
|
+
<Tag label="tokens" />
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<CloseButton aria-label="Dismiss notification" />
|
|
63
|
+
</div>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
@@ -96,10 +96,52 @@ export const WithDisabledOptions: Story = {
|
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
export const Variant_Creatable: Story = {
|
|
100
|
+
name: "Variant — Creatable",
|
|
101
|
+
render: () => {
|
|
102
|
+
const [value, setValue] = React.useState("");
|
|
103
|
+
const [options, setOptions] = React.useState([
|
|
104
|
+
{ value: "design", label: "Design" },
|
|
105
|
+
{ value: "engineering", label: "Engineering" },
|
|
106
|
+
{ value: "product", label: "Product" },
|
|
107
|
+
{ value: "marketing", label: "Marketing" },
|
|
108
|
+
{ value: "research", label: "Research" },
|
|
109
|
+
]);
|
|
110
|
+
|
|
111
|
+
function handleCreate(newLabel: string) {
|
|
112
|
+
const newOption = { value: newLabel.toLowerCase().replace(/\s+/g, "-"), label: newLabel };
|
|
113
|
+
setOptions((prev) => [...prev, newOption]);
|
|
114
|
+
setValue(newOption.value);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div className="space-y-2">
|
|
119
|
+
<p className="text-sm text-muted-foreground">
|
|
120
|
+
Type a department name not in the list to create it.
|
|
121
|
+
</p>
|
|
122
|
+
<Combobox
|
|
123
|
+
options={options}
|
|
124
|
+
value={value}
|
|
125
|
+
onValueChange={setValue}
|
|
126
|
+
placeholder="Select or create department..."
|
|
127
|
+
searchPlaceholder="Search or type new..."
|
|
128
|
+
creatable
|
|
129
|
+
onCreateOption={handleCreate}
|
|
130
|
+
/>
|
|
131
|
+
{value && (
|
|
132
|
+
<p className="text-xs text-muted-foreground">
|
|
133
|
+
Selected: <span className="font-medium text-foreground">{value}</span>
|
|
134
|
+
</p>
|
|
135
|
+
)}
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
99
141
|
export const RealisticUse: Story = {
|
|
100
142
|
decorators: [
|
|
101
143
|
(Story) => (
|
|
102
|
-
<div className="flex min-h-[
|
|
144
|
+
<div className="flex min-h-[520px] w-[380px] items-start justify-center pt-8">
|
|
103
145
|
<div className="w-full rounded-lg border bg-card p-6 shadow-sm">
|
|
104
146
|
<Story />
|
|
105
147
|
</div>
|
|
@@ -109,6 +151,14 @@ export const RealisticUse: Story = {
|
|
|
109
151
|
render: () => {
|
|
110
152
|
const [country, setCountry] = React.useState("");
|
|
111
153
|
const [timezone, setTimezone] = React.useState("");
|
|
154
|
+
const [skillValue, setSkillValue] = React.useState("");
|
|
155
|
+
const [skillOptions, setSkillOptions] = React.useState([
|
|
156
|
+
{ value: "accessibility", label: "Accessibility" },
|
|
157
|
+
{ value: "data-viz", label: "Data Visualization" },
|
|
158
|
+
{ value: "design-systems", label: "Design Systems" },
|
|
159
|
+
{ value: "motion-design", label: "Motion Design" },
|
|
160
|
+
{ value: "user-research", label: "User Research" },
|
|
161
|
+
]);
|
|
112
162
|
|
|
113
163
|
const countries = [
|
|
114
164
|
{ value: "us", label: "United States" },
|
|
@@ -132,11 +182,19 @@ export const RealisticUse: Story = {
|
|
|
132
182
|
{ value: "utc+9", label: "Japan Standard Time (UTC+9)" },
|
|
133
183
|
];
|
|
134
184
|
|
|
185
|
+
function handleCreateSkill(newLabel: string) {
|
|
186
|
+
const newOption = { value: newLabel.toLowerCase().replace(/\s+/g, "-"), label: newLabel };
|
|
187
|
+
setSkillOptions((prev) => [...prev, newOption]);
|
|
188
|
+
setSkillValue(newOption.value);
|
|
189
|
+
}
|
|
190
|
+
|
|
135
191
|
return (
|
|
136
192
|
<div className="space-y-5">
|
|
137
193
|
<div>
|
|
138
|
-
<h3 className="text-sm font-semibold text-foreground">
|
|
139
|
-
<p className="mt-0.5 text-sm text-muted-foreground">
|
|
194
|
+
<h3 className="text-sm font-semibold text-foreground">Profile settings</h3>
|
|
195
|
+
<p className="mt-0.5 text-sm text-muted-foreground">
|
|
196
|
+
Set your location and add a primary skill. Type a skill name to create one if it's not listed.
|
|
197
|
+
</p>
|
|
140
198
|
</div>
|
|
141
199
|
<div className="space-y-3">
|
|
142
200
|
<div className="space-y-1.5">
|
|
@@ -161,6 +219,19 @@ export const RealisticUse: Story = {
|
|
|
161
219
|
emptyText="Timezone not found."
|
|
162
220
|
/>
|
|
163
221
|
</div>
|
|
222
|
+
<div className="space-y-1.5">
|
|
223
|
+
<Label htmlFor="skill">Primary skill</Label>
|
|
224
|
+
<Combobox
|
|
225
|
+
options={skillOptions}
|
|
226
|
+
value={skillValue}
|
|
227
|
+
onValueChange={setSkillValue}
|
|
228
|
+
placeholder="Select or create skill..."
|
|
229
|
+
searchPlaceholder="Search or type new..."
|
|
230
|
+
emptyText="No skill found."
|
|
231
|
+
creatable
|
|
232
|
+
onCreateOption={handleCreateSkill}
|
|
233
|
+
/>
|
|
234
|
+
</div>
|
|
164
235
|
</div>
|
|
165
236
|
</div>
|
|
166
237
|
);
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Container } from "@behavioral-agentic-design-system/core/components/ui/container";
|
|
4
|
+
import { Stack } from "@behavioral-agentic-design-system/core/components/ui/stack";
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardHeader,
|
|
10
|
+
CardTitle,
|
|
11
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Container> = {
|
|
14
|
+
title: "Components/Container",
|
|
15
|
+
component: Container,
|
|
16
|
+
parameters: { layout: "fullscreen" },
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
/** Visualizes the container bounds against the viewport. */
|
|
23
|
+
function Bounds({ label }: { label: string }) {
|
|
24
|
+
return (
|
|
25
|
+
<div className="rounded-lg border border-dashed border-border bg-card p-4">
|
|
26
|
+
<p className="text-sm text-muted-foreground">{label}</p>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Default: StoryObj = {
|
|
32
|
+
render: () => (
|
|
33
|
+
<div className="bg-muted/40 py-6">
|
|
34
|
+
<Container>
|
|
35
|
+
<Bounds label='size="lg" (default) — max-w-6xl, centered, px-4 sm:px-6 gutters' />
|
|
36
|
+
</Container>
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Size_Sm: StoryObj = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<div className="bg-muted/40 py-6">
|
|
44
|
+
<Container size="sm">
|
|
45
|
+
<Bounds label='size="sm" — 672px reading column' />
|
|
46
|
+
</Container>
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Size_Md: StoryObj = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<div className="bg-muted/40 py-6">
|
|
54
|
+
<Container size="md">
|
|
55
|
+
<Bounds label='size="md" — 896px, forms and narrow content' />
|
|
56
|
+
</Container>
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Size_Lg: StoryObj = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<div className="bg-muted/40 py-6">
|
|
64
|
+
<Container size="lg">
|
|
65
|
+
<Bounds label='size="lg" — 1152px, standard app content' />
|
|
66
|
+
</Container>
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const Size_Xl: StoryObj = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<div className="bg-muted/40 py-6">
|
|
74
|
+
<Container size="xl">
|
|
75
|
+
<Bounds label='size="xl" — 1280px, wide dashboards' />
|
|
76
|
+
</Container>
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const Size_Full: StoryObj = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<div className="bg-muted/40 py-6">
|
|
84
|
+
<Container size="full">
|
|
85
|
+
<Bounds label='size="full" — no width cap, shared gutters only' />
|
|
86
|
+
</Container>
|
|
87
|
+
</div>
|
|
88
|
+
),
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const NoGutters: StoryObj = {
|
|
92
|
+
render: () => (
|
|
93
|
+
<div className="bg-muted/40 py-6">
|
|
94
|
+
<Container size="md" gutters={false}>
|
|
95
|
+
<Bounds label="gutters={false} — parent already provides page padding" />
|
|
96
|
+
</Container>
|
|
97
|
+
</div>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const RealisticUse: StoryObj = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<div className="bg-muted/40 py-8">
|
|
104
|
+
<Container size="md">
|
|
105
|
+
<Stack gap="lg">
|
|
106
|
+
<div>
|
|
107
|
+
<h2 className="text-2xl font-semibold text-foreground">
|
|
108
|
+
Design system review
|
|
109
|
+
</h2>
|
|
110
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
111
|
+
Tokens v2 proposal — milestone review scheduled for May 26, 2026.
|
|
112
|
+
</p>
|
|
113
|
+
</div>
|
|
114
|
+
<Card>
|
|
115
|
+
<CardHeader>
|
|
116
|
+
<CardTitle>Tokens v2 proposal</CardTitle>
|
|
117
|
+
<CardDescription>
|
|
118
|
+
Jordan Reeves — design-system review milestone ($12,500.00
|
|
119
|
+
retainer).
|
|
120
|
+
</CardDescription>
|
|
121
|
+
</CardHeader>
|
|
122
|
+
<CardContent>
|
|
123
|
+
<p className="text-sm text-muted-foreground">
|
|
124
|
+
The proposal consolidates the spacing scale to eight stops and
|
|
125
|
+
retires four orphaned color tokens flagged in the July audit
|
|
126
|
+
(a11y-audit-findings-2026-07.pdf).
|
|
127
|
+
</p>
|
|
128
|
+
</CardContent>
|
|
129
|
+
</Card>
|
|
130
|
+
</Stack>
|
|
131
|
+
</Container>
|
|
132
|
+
</div>
|
|
133
|
+
),
|
|
134
|
+
};
|