@behavioral-agentic-design-system/core 0.24.0 → 0.26.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 +5 -2
- package/scripts/build-tokens.cjs +79 -5
- package/src/app/preview/components/page.tsx +4474 -208
- package/src/app/shell.tsx +18 -6
- package/src/components/customize/brand-mark-section.tsx +1 -1
- package/src/components/customize-tab.tsx +2 -2
- package/src/components/home-tab.tsx +2 -2
- package/src/components/ui/action-bar.tsx +142 -0
- package/src/components/ui/affix.tsx +109 -0
- package/src/components/ui/alert.tsx +37 -3
- package/src/components/ui/anchor.tsx +136 -0
- package/src/components/ui/angle-slider.tsx +265 -0
- package/src/components/ui/autocomplete.tsx +223 -0
- package/src/components/ui/avatar.tsx +8 -2
- package/src/components/ui/blockquote.tsx +112 -0
- package/src/components/ui/bottom-navigation.tsx +144 -0
- package/src/components/ui/burger.tsx +117 -0
- package/src/components/ui/button.tsx +101 -3
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/card.tsx +43 -5
- package/src/components/ui/carousel.tsx +10 -5
- package/src/components/ui/cascader.tsx +253 -0
- package/src/components/ui/checkbox-card.tsx +176 -0
- package/src/components/ui/checkbox-group.tsx +231 -0
- package/src/components/ui/checkbox.tsx +14 -3
- package/src/components/ui/chip.tsx +143 -0
- package/src/components/ui/circular-progress.tsx +2 -2
- package/src/components/ui/color-swatch.tsx +73 -0
- package/src/components/ui/copy-button.tsx +21 -4
- package/src/components/ui/date-picker.tsx +6 -3
- package/src/components/ui/date-range-picker.tsx +6 -3
- package/src/components/ui/float-label.tsx +114 -0
- package/src/components/ui/floating-panel.tsx +129 -0
- package/src/components/ui/format-number.tsx +122 -0
- package/src/components/ui/highlight.tsx +85 -0
- package/src/components/ui/image.tsx +195 -0
- package/src/components/ui/index.ts +50 -0
- package/src/components/ui/indicator.tsx +2 -2
- package/src/components/ui/input.tsx +48 -4
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/link.tsx +158 -0
- package/src/components/ui/listbox.tsx +426 -0
- package/src/components/ui/loading-overlay.tsx +80 -0
- package/src/components/ui/marquee.tsx +193 -0
- package/src/components/ui/masonry.tsx +164 -0
- package/src/components/ui/meter.tsx +186 -0
- package/src/components/ui/motion-toggle.tsx +170 -0
- package/src/components/ui/notification.tsx +175 -0
- package/src/components/ui/overlay.tsx +63 -0
- package/src/components/ui/progress.tsx +95 -4
- package/src/components/ui/rating-group.tsx +1 -0
- package/src/components/ui/separator.tsx +57 -1
- package/src/components/ui/sidebar.tsx +1 -1
- package/src/components/ui/signature-pad.tsx +381 -0
- package/src/components/ui/skeleton.tsx +59 -2
- package/src/components/ui/skip-link.tsx +117 -0
- package/src/components/ui/slider.tsx +86 -1
- package/src/components/ui/spoiler.tsx +131 -0
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/text.tsx +135 -0
- package/src/components/ui/textarea.tsx +66 -2
- package/src/components/ui/timeline.tsx +71 -14
- package/src/components/ui/timer.tsx +183 -0
- package/src/components/ui/tour.tsx +332 -0
- package/src/components/ui/transfer-list.tsx +308 -0
- package/src/components/ui/visually-hidden.tsx +42 -0
- package/src/components/ui/watermark.tsx +0 -0
- package/src/data/docs-index.ts +9 -2
- package/src/stories/ActionBar.stories.tsx +201 -0
- package/src/stories/Affix.stories.tsx +165 -0
- package/src/stories/Alert.stories.tsx +58 -0
- package/src/stories/Anchor.stories.tsx +236 -0
- package/src/stories/AngleSlider.stories.tsx +128 -0
- package/src/stories/Autocomplete.stories.tsx +216 -0
- package/src/stories/Avatar.stories.tsx +73 -1
- package/src/stories/Blockquote.stories.tsx +148 -0
- package/src/stories/BottomNavigation.stories.tsx +195 -0
- package/src/stories/Burger.stories.tsx +79 -0
- package/src/stories/Button.stories.tsx +103 -2
- package/src/stories/Calendar.stories.tsx +4 -0
- package/src/stories/Card.stories.tsx +30 -0
- package/src/stories/Carousel.stories.tsx +2 -1
- package/src/stories/Cascader.stories.tsx +285 -0
- package/src/stories/Checkbox.stories.tsx +13 -0
- package/src/stories/CheckboxCard.stories.tsx +210 -0
- package/src/stories/CheckboxGroup.stories.tsx +186 -0
- package/src/stories/Chip.stories.tsx +173 -0
- package/src/stories/CircularProgress.stories.tsx +3 -0
- package/src/stories/ColorSwatch.stories.tsx +81 -0
- package/src/stories/CopyButton.stories.tsx +3 -3
- package/src/stories/DatePicker.stories.tsx +3 -0
- package/src/stories/DateRangePicker.stories.tsx +3 -0
- package/src/stories/Editable.stories.tsx +14 -0
- package/src/stories/FloatLabel.stories.tsx +148 -0
- package/src/stories/FloatingPanel.stories.tsx +176 -0
- package/src/stories/FormatNumber.stories.tsx +308 -0
- package/src/stories/Highlight.stories.tsx +140 -0
- package/src/stories/Image.stories.tsx +141 -0
- package/src/stories/Indicator.stories.tsx +3 -0
- package/src/stories/Input.stories.tsx +33 -0
- package/src/stories/Kbd.stories.tsx +3 -0
- package/src/stories/Link.stories.tsx +198 -0
- package/src/stories/Listbox.stories.tsx +240 -0
- package/src/stories/LoadingOverlay.stories.tsx +148 -0
- package/src/stories/Marquee.stories.tsx +170 -0
- package/src/stories/Masonry.stories.tsx +227 -0
- package/src/stories/Meter.stories.tsx +143 -0
- package/src/stories/MotionToggle.stories.tsx +85 -0
- package/src/stories/Notification.stories.tsx +264 -0
- package/src/stories/Overlay.stories.tsx +169 -0
- package/src/stories/PasswordInput.stories.tsx +4 -0
- package/src/stories/Progress.stories.tsx +70 -27
- package/src/stories/RatingGroup.stories.tsx +5 -0
- package/src/stories/Separator.stories.tsx +41 -5
- package/src/stories/Sidebar.stories.tsx +2 -1
- package/src/stories/SignaturePad.stories.tsx +112 -0
- package/src/stories/Skeleton.stories.tsx +23 -4
- package/src/stories/SkipLink.stories.tsx +137 -0
- package/src/stories/Slider.stories.tsx +28 -0
- package/src/stories/Spoiler.stories.tsx +122 -0
- package/src/stories/Tabs.stories.tsx +2 -1
- package/src/stories/Text.stories.tsx +191 -0
- package/src/stories/Textarea.stories.tsx +58 -6
- package/src/stories/Timeline.stories.tsx +82 -0
- package/src/stories/Timer.stories.tsx +160 -0
- package/src/stories/Tour.stories.tsx +191 -0
- package/src/stories/TransferList.stories.tsx +169 -0
- package/src/stories/VisuallyHidden.stories.tsx +105 -0
- package/src/stories/Watermark.stories.tsx +212 -0
- package/src/styles.css +80 -6
- package/src/tokens.json +2 -2
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { ArrowUp, MessageCircle } from "lucide-react";
|
|
4
|
+
import { Affix } from "@behavioral-agentic-design-system/core/components/ui/affix";
|
|
5
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Affix> = {
|
|
9
|
+
title: "Components/Affix",
|
|
10
|
+
component: Affix,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: "centered",
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
"Pins arbitrary content to a fixed viewport position — scroll-to-top buttons, chat FABs, floating action chrome. Renders through a document.body portal by default (usePortalThemeClass keeps theme-scoped variables reaching it); the wrapper itself is presentational, so accessible names, 44×44 targets, and interactive states belong to the children. Stories use withinPortal={false} inside a transformed frame so the fixed element pins to the demo frame instead of the Storybook viewport.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
tags: ["autodocs"],
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Demo frame: `transform: translateZ(0)` makes this box the containing block
|
|
28
|
+
* for `position: fixed` descendants, so `withinPortal={false}` Affix content
|
|
29
|
+
* pins to the frame instead of the Storybook viewport. In a real app, keep
|
|
30
|
+
* the default portal and the content pins to the true viewport.
|
|
31
|
+
*/
|
|
32
|
+
function DemoFrame({ children }: { children: React.ReactNode }) {
|
|
33
|
+
return (
|
|
34
|
+
<div className="relative h-64 w-96 overflow-hidden rounded-lg border border-border bg-card [transform:translateZ(0)]">
|
|
35
|
+
<div className="p-4">
|
|
36
|
+
<p className="text-sm font-medium text-foreground">design.bads.com</p>
|
|
37
|
+
<p className="text-sm text-muted-foreground">
|
|
38
|
+
The frame stands in for the viewport — the pinned content stays put
|
|
39
|
+
while everything else scrolls.
|
|
40
|
+
</p>
|
|
41
|
+
</div>
|
|
42
|
+
{children}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
render: () => (
|
|
49
|
+
<DemoFrame>
|
|
50
|
+
<Affix withinPortal={false} position={{ bottom: 20, right: 20 }}>
|
|
51
|
+
<Button size="icon-xl" aria-label="Open chat">
|
|
52
|
+
<MessageCircle strokeWidth={1.5} aria-hidden="true" />
|
|
53
|
+
</Button>
|
|
54
|
+
</Affix>
|
|
55
|
+
</DemoFrame>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const TopRight: Story = {
|
|
60
|
+
render: () => (
|
|
61
|
+
<DemoFrame>
|
|
62
|
+
<Affix withinPortal={false} position={{ top: 16, right: 16 }}>
|
|
63
|
+
<Badge>36 components</Badge>
|
|
64
|
+
</Affix>
|
|
65
|
+
</DemoFrame>
|
|
66
|
+
),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const TopLeft: Story = {
|
|
70
|
+
render: () => (
|
|
71
|
+
<DemoFrame>
|
|
72
|
+
<Affix withinPortal={false} position={{ top: 16, left: 16 }}>
|
|
73
|
+
<Badge variant="secondary">Story coverage 98.4%</Badge>
|
|
74
|
+
</Affix>
|
|
75
|
+
</DemoFrame>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const CustomZIndex: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<DemoFrame>
|
|
82
|
+
{/* The zIndex prop controls stacking: the FAB (zIndex 50, default tier)
|
|
83
|
+
sits above the banner (zIndex 10) where the two overlap. */}
|
|
84
|
+
<Affix withinPortal={false} position={{ bottom: 0, left: 0, right: 0 }} zIndex={10}>
|
|
85
|
+
<div className="border-t border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
|
|
86
|
+
Token build finished — 12,417 references scanned.
|
|
87
|
+
</div>
|
|
88
|
+
</Affix>
|
|
89
|
+
<Affix withinPortal={false} position={{ bottom: 12, right: 12 }} zIndex={50}>
|
|
90
|
+
<Button size="icon-xl" variant="outline" aria-label="Back to top">
|
|
91
|
+
<ArrowUp strokeWidth={1.5} aria-hidden="true" />
|
|
92
|
+
</Button>
|
|
93
|
+
</Affix>
|
|
94
|
+
</DemoFrame>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Real content from content/personas/bads.json (primary persona pool).
|
|
99
|
+
const changelog = [
|
|
100
|
+
{
|
|
101
|
+
date: "2026-05-26",
|
|
102
|
+
author: "Jordan Reeves",
|
|
103
|
+
entry: "Shared 36 components for review at design.bads.com/share/tokens-v2-proposal.",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
date: "2026-01-15",
|
|
107
|
+
author: "Seo-yun Park",
|
|
108
|
+
entry: "Raised the contrast floor to 7:1 across every shipped token pair.",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
date: "2025-11-20",
|
|
112
|
+
author: "Marcus Lindqvist",
|
|
113
|
+
entry: "Moved the touch-target audit to the 44×44px target across all CTAs.",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
date: "2027-03-01",
|
|
117
|
+
author: "Anika Patel",
|
|
118
|
+
entry: "Scheduled the semantic-layer migration — token drift lint goes strict.",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
date: "2026-05-26",
|
|
122
|
+
author: "Tomás Herrera",
|
|
123
|
+
entry: "Tuned every transition to the 180ms transition baseline.",
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
|
|
127
|
+
export const RealisticUse: Story = {
|
|
128
|
+
render: function RealisticUseStory() {
|
|
129
|
+
const scrollRef = React.useRef<HTMLDivElement>(null);
|
|
130
|
+
return (
|
|
131
|
+
<div className="relative h-72 w-[420px] overflow-hidden rounded-lg border border-border bg-card [transform:translateZ(0)]">
|
|
132
|
+
<div ref={scrollRef} className="h-full overflow-y-auto p-4">
|
|
133
|
+
<h3 className="text-base font-semibold text-foreground">
|
|
134
|
+
Design system changelog
|
|
135
|
+
</h3>
|
|
136
|
+
<ul className="mt-3 space-y-4">
|
|
137
|
+
{[...changelog, ...changelog].map((item, i) => (
|
|
138
|
+
<li key={i} className="space-y-1">
|
|
139
|
+
<p className="text-sm font-medium text-foreground">
|
|
140
|
+
{item.author}{" "}
|
|
141
|
+
<span className="font-normal text-muted-foreground">
|
|
142
|
+
· {item.date}
|
|
143
|
+
</span>
|
|
144
|
+
</p>
|
|
145
|
+
<p className="text-sm text-muted-foreground">{item.entry}</p>
|
|
146
|
+
</li>
|
|
147
|
+
))}
|
|
148
|
+
</ul>
|
|
149
|
+
</div>
|
|
150
|
+
<Affix withinPortal={false} position={{ bottom: 16, right: 16 }}>
|
|
151
|
+
<Button
|
|
152
|
+
size="icon-xl"
|
|
153
|
+
variant="secondary"
|
|
154
|
+
aria-label="Scroll to top"
|
|
155
|
+
onClick={() =>
|
|
156
|
+
scrollRef.current?.scrollTo({ top: 0, behavior: "smooth" })
|
|
157
|
+
}
|
|
158
|
+
>
|
|
159
|
+
<ArrowUp strokeWidth={1.5} aria-hidden="true" />
|
|
160
|
+
</Button>
|
|
161
|
+
</Affix>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
},
|
|
165
|
+
};
|
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
// read as one family. (Accent/border colors use arbitrary `border-[var(--token)]!`
|
|
7
7
|
// because the named border-color utilities don't emit a rule in this Tailwind v4
|
|
8
8
|
// setup.) Any change to alertVariants should re-snapshot here in Chromatic.
|
|
9
|
+
// Dismissible + WithAction: onDismiss renders a top-right × button; action
|
|
10
|
+
// renders a row below AlertDescription. Both are optional and compose freely.
|
|
9
11
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
12
|
import { AlertCircleIcon } from "lucide-react";
|
|
11
13
|
import { Alert, AlertTitle, AlertDescription } from "@behavioral-agentic-design-system/core/components/ui/alert";
|
|
14
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
12
15
|
import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
13
16
|
|
|
14
17
|
const meta: Meta<typeof Alert> = {
|
|
@@ -100,3 +103,58 @@ export const RealisticUse: Story = {
|
|
|
100
103
|
</div>),
|
|
101
104
|
};
|
|
102
105
|
|
|
106
|
+
export const Dismissible: Story = {
|
|
107
|
+
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
108
|
+
<Alert onDismiss={() => {}}>
|
|
109
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
110
|
+
<AlertTitle>Email not verified</AlertTitle>
|
|
111
|
+
<AlertDescription>Check your inbox or resend the link.</AlertDescription>
|
|
112
|
+
</Alert>
|
|
113
|
+
<Alert variant="destructive" onDismiss={() => {}}>
|
|
114
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
115
|
+
<AlertTitle>Connection lost</AlertTitle>
|
|
116
|
+
<AlertDescription>Changes may not have been saved.</AlertDescription>
|
|
117
|
+
</Alert>
|
|
118
|
+
</div>),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const WithAction: Story = {
|
|
122
|
+
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
123
|
+
<Alert
|
|
124
|
+
action={<Button size="sm" variant="outline">Resend link</Button>}
|
|
125
|
+
>
|
|
126
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
127
|
+
<AlertTitle>Email not verified</AlertTitle>
|
|
128
|
+
<AlertDescription>We sent a link to your address 3 days ago.</AlertDescription>
|
|
129
|
+
</Alert>
|
|
130
|
+
<Alert
|
|
131
|
+
variant="destructive"
|
|
132
|
+
action={<Button size="sm" variant="outline">Try again</Button>}
|
|
133
|
+
>
|
|
134
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
135
|
+
<AlertTitle>Save failed</AlertTitle>
|
|
136
|
+
<AlertDescription>Couldn't reach the server.</AlertDescription>
|
|
137
|
+
</Alert>
|
|
138
|
+
</div>),
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const DismissibleWithAction: Story = {
|
|
142
|
+
render: () => (<div className="w-[420px]">
|
|
143
|
+
<Alert
|
|
144
|
+
onDismiss={() => {}}
|
|
145
|
+
action={
|
|
146
|
+
<>
|
|
147
|
+
<Button size="sm" variant="outline">Resend link</Button>
|
|
148
|
+
<Button size="sm" variant="ghost">Remind me later</Button>
|
|
149
|
+
</>
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
153
|
+
<AlertTitle>Email not verified</AlertTitle>
|
|
154
|
+
<AlertDescription>
|
|
155
|
+
Verify your email to unlock sharing and export features.
|
|
156
|
+
</AlertDescription>
|
|
157
|
+
</Alert>
|
|
158
|
+
</div>),
|
|
159
|
+
};
|
|
160
|
+
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Anchor } from "@behavioral-agentic-design-system/core/components/ui/anchor";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Anchor> = {
|
|
6
|
+
title: "Components/Anchor",
|
|
7
|
+
component: Anchor,
|
|
8
|
+
parameters: { layout: "padded" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof Anchor>;
|
|
14
|
+
|
|
15
|
+
// Ids are prefixed per story so the autodocs page (which renders every story
|
|
16
|
+
// at once) never produces duplicate DOM ids.
|
|
17
|
+
|
|
18
|
+
function DemoSection({
|
|
19
|
+
id,
|
|
20
|
+
title,
|
|
21
|
+
children,
|
|
22
|
+
}: {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}) {
|
|
27
|
+
return (
|
|
28
|
+
<section id={id} className="scroll-mt-4 space-y-2 pb-10">
|
|
29
|
+
<h3 className="text-lg font-semibold tracking-tight">{title}</h3>
|
|
30
|
+
<p className="text-sm text-muted-foreground">{children}</p>
|
|
31
|
+
</section>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Default: Story = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<div className="flex w-[640px] max-w-full gap-8">
|
|
38
|
+
<div className="h-72 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5">
|
|
39
|
+
<DemoSection id="anc-default-overview" title="Overview">
|
|
40
|
+
BADS ships tokens, components, and accessibility contracts as one
|
|
41
|
+
portable system. Fork it, rename it, and every client engagement
|
|
42
|
+
starts from the same AAA baseline.
|
|
43
|
+
</DemoSection>
|
|
44
|
+
<DemoSection id="anc-default-install" title="Installation">
|
|
45
|
+
Run pnpm install, then pnpm build:tokens. The generated styles.css
|
|
46
|
+
carries the full theme — 36 components, 7:1 contrast, 14px minimum
|
|
47
|
+
type, 180ms transitions.
|
|
48
|
+
</DemoSection>
|
|
49
|
+
<DemoSection id="anc-default-tokens" title="Tokens">
|
|
50
|
+
tokens.json is the single source of truth. Edit a value, rebuild, and
|
|
51
|
+
both the published package and the local preview regenerate — never
|
|
52
|
+
hand-edit the CSS.
|
|
53
|
+
</DemoSection>
|
|
54
|
+
<DemoSection id="anc-default-registry" title="Component registry">
|
|
55
|
+
Every primitive declares its props, a11y contract, anti-patterns, and
|
|
56
|
+
cost model in the machine-readable registry that agents read before
|
|
57
|
+
building anything.
|
|
58
|
+
</DemoSection>
|
|
59
|
+
</div>
|
|
60
|
+
<Anchor
|
|
61
|
+
className="w-44 shrink-0"
|
|
62
|
+
items={[
|
|
63
|
+
{ id: "anc-default-overview", label: "Overview" },
|
|
64
|
+
{ id: "anc-default-install", label: "Installation" },
|
|
65
|
+
{ id: "anc-default-tokens", label: "Tokens" },
|
|
66
|
+
{ id: "anc-default-registry", label: "Component registry" },
|
|
67
|
+
]}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const WithGroups: Story = {
|
|
74
|
+
render: () => (
|
|
75
|
+
<div className="flex w-[640px] max-w-full gap-8">
|
|
76
|
+
<div className="h-72 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5">
|
|
77
|
+
<DemoSection id="anc-groups-foundation" title="Foundation">
|
|
78
|
+
Voice, tone, language, and personas — the layer every piece of copy
|
|
79
|
+
checks against before it ships.
|
|
80
|
+
</DemoSection>
|
|
81
|
+
<DemoSection id="anc-groups-voice" title="Voice and tone">
|
|
82
|
+
Four axes: Friendly, Daring, Radiant, Genuine. The voice-check prompt
|
|
83
|
+
scores copy against them.
|
|
84
|
+
</DemoSection>
|
|
85
|
+
<DemoSection id="anc-groups-microcopy" title="Microcopy bank">
|
|
86
|
+
Canonical strings agents reach for first — empty states, errors,
|
|
87
|
+
confirmations.
|
|
88
|
+
</DemoSection>
|
|
89
|
+
<DemoSection id="anc-groups-ethics" title="Ethics and responsibility">
|
|
90
|
+
Ethical floors, anti-patterns, the 10 Core Drives, and the futures
|
|
91
|
+
check that runs before any consent or data surface ships.
|
|
92
|
+
</DemoSection>
|
|
93
|
+
<DemoSection id="anc-groups-futures" title="Futures thinking">
|
|
94
|
+
Six lenses — Scale, Time, Adversary, Behavior, Drift, Equity — run
|
|
95
|
+
against every mandatory-list feature.
|
|
96
|
+
</DemoSection>
|
|
97
|
+
</div>
|
|
98
|
+
<Anchor
|
|
99
|
+
className="w-52 shrink-0"
|
|
100
|
+
label="Sections in this guide"
|
|
101
|
+
items={[
|
|
102
|
+
{ id: "anc-groups-foundation", label: "Foundation" },
|
|
103
|
+
{ id: "anc-groups-voice", label: "Voice and tone", depth: 1 },
|
|
104
|
+
{ id: "anc-groups-microcopy", label: "Microcopy bank", depth: 2 },
|
|
105
|
+
{ id: "anc-groups-ethics", label: "Ethics and responsibility" },
|
|
106
|
+
{ id: "anc-groups-futures", label: "Futures thinking", depth: 1 },
|
|
107
|
+
]}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
),
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const Sticky: Story = {
|
|
114
|
+
render: () => (
|
|
115
|
+
<div className="h-80 w-[640px] max-w-full overflow-y-auto rounded-lg border border-border">
|
|
116
|
+
<div className="flex gap-8 p-5">
|
|
117
|
+
<div className="min-w-0 flex-1">
|
|
118
|
+
<DemoSection id="anc-sticky-audit" title="Accessibility audit">
|
|
119
|
+
pnpm wcag:audit checks every shipped token pair against the AAA
|
|
120
|
+
floor — 7:1 for text, 3:1 for non-text — and fails CI on any miss.
|
|
121
|
+
</DemoSection>
|
|
122
|
+
<DemoSection id="anc-sticky-contrast" title="Contrast grades">
|
|
123
|
+
The Brand Color picker shows AAA / AA / AA Large / Fail pills so a
|
|
124
|
+
custom color never silently drops below the floor.
|
|
125
|
+
</DemoSection>
|
|
126
|
+
<DemoSection id="anc-sticky-targets" title="Touch targets">
|
|
127
|
+
Every flow-changing control clears 44 by 44 pixels. Compact chrome
|
|
128
|
+
uses the documented dense exception, never a shrunken CTA.
|
|
129
|
+
</DemoSection>
|
|
130
|
+
<DemoSection id="anc-sticky-motion" title="Reduced motion">
|
|
131
|
+
One base-layer media query collapses every animation to 0.01ms for
|
|
132
|
+
users who opt out — components never need their own guard.
|
|
133
|
+
</DemoSection>
|
|
134
|
+
</div>
|
|
135
|
+
<div className="w-44 shrink-0">
|
|
136
|
+
<Anchor
|
|
137
|
+
className="sticky top-4"
|
|
138
|
+
offset={16}
|
|
139
|
+
items={[
|
|
140
|
+
{ id: "anc-sticky-audit", label: "Accessibility audit" },
|
|
141
|
+
{ id: "anc-sticky-contrast", label: "Contrast grades" },
|
|
142
|
+
{ id: "anc-sticky-targets", label: "Touch targets" },
|
|
143
|
+
{ id: "anc-sticky-motion", label: "Reduced motion" },
|
|
144
|
+
]}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const Customized: Story = {
|
|
153
|
+
render: () => (
|
|
154
|
+
<div className="flex w-[640px] max-w-full gap-8">
|
|
155
|
+
<div className="h-64 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5">
|
|
156
|
+
<DemoSection id="anc-custom-savings" title="Client savings">
|
|
157
|
+
The ROI report prices what an in-house team would have charged to
|
|
158
|
+
build the system from scratch — $182,450 to date.
|
|
159
|
+
</DemoSection>
|
|
160
|
+
<DemoSection id="anc-custom-defects" title="Defect exposure avoided">
|
|
161
|
+
A conservative $24,500 expected value from public accessibility
|
|
162
|
+
filings, sourced line by line in rates.json.
|
|
163
|
+
</DemoSection>
|
|
164
|
+
<DemoSection id="anc-custom-hours" title="Build hours avoided">
|
|
165
|
+
1,432 engineering and design hours the registry cost models add up
|
|
166
|
+
to across active forks.
|
|
167
|
+
</DemoSection>
|
|
168
|
+
</div>
|
|
169
|
+
<Anchor
|
|
170
|
+
className="w-56 shrink-0 rounded-lg bg-muted/50 p-3"
|
|
171
|
+
label="Report contents"
|
|
172
|
+
items={[
|
|
173
|
+
{ id: "anc-custom-savings", label: "Client savings" },
|
|
174
|
+
{ id: "anc-custom-defects", label: "Defect exposure avoided" },
|
|
175
|
+
{ id: "anc-custom-hours", label: "Build hours avoided" },
|
|
176
|
+
]}
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
),
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const RealisticUse: Story = {
|
|
183
|
+
render: () => (
|
|
184
|
+
<div className="w-[720px] max-w-full rounded-lg border border-border bg-card p-6">
|
|
185
|
+
<div className="mb-4 space-y-1">
|
|
186
|
+
<p className="text-lg font-semibold tracking-tight">
|
|
187
|
+
Getting started with BADS
|
|
188
|
+
</p>
|
|
189
|
+
<p className="text-sm text-muted-foreground">
|
|
190
|
+
design.bads.com/docs/getting-started · updated by Jordan Reeves
|
|
191
|
+
</p>
|
|
192
|
+
</div>
|
|
193
|
+
<div className="flex gap-8">
|
|
194
|
+
<div className="h-80 min-w-0 flex-1 overflow-y-auto pr-2">
|
|
195
|
+
<DemoSection id="anc-real-fork" title="Fork and rename">
|
|
196
|
+
Every engagement starts by forking BADS and running pnpm rename
|
|
197
|
+
with the client display name and slug. The npm package name stays
|
|
198
|
+
stable; the localStorage prefix and header follow the new brand.
|
|
199
|
+
</DemoSection>
|
|
200
|
+
<DemoSection id="anc-real-brief" title="Write the brief">
|
|
201
|
+
BRIEF.md is the AI-readable one-pager — mission, audience,
|
|
202
|
+
surfaces, tone, refusals. Until it exists, generated UI reads as
|
|
203
|
+
generic SaaS. Run the onboarding prompts before any client work.
|
|
204
|
+
</DemoSection>
|
|
205
|
+
<DemoSection id="anc-real-tokens" title="Customize tokens">
|
|
206
|
+
Edit tokens.json, run pnpm build:tokens, and both the published
|
|
207
|
+
theme and the local preview regenerate. The wcag audit keeps every
|
|
208
|
+
pair at the 7:1 AAA floor while you tune.
|
|
209
|
+
</DemoSection>
|
|
210
|
+
<DemoSection id="anc-real-components" title="Adopt the components">
|
|
211
|
+
105 primitives ship with a11y contracts, stories, and cost models.
|
|
212
|
+
The readiness audit gates anything new so the registry never
|
|
213
|
+
grows past what earns its keep.
|
|
214
|
+
</DemoSection>
|
|
215
|
+
<DemoSection id="anc-real-verify" title="Verify and ship">
|
|
216
|
+
pnpm a11y runs the contrast audit, the static lint, and the size
|
|
217
|
+
contract in one pass. Chromatic baselines every story on the next
|
|
218
|
+
push to main.
|
|
219
|
+
</DemoSection>
|
|
220
|
+
</div>
|
|
221
|
+
<div className="w-48 shrink-0">
|
|
222
|
+
<Anchor
|
|
223
|
+
className="sticky top-0"
|
|
224
|
+
items={[
|
|
225
|
+
{ id: "anc-real-fork", label: "Fork and rename" },
|
|
226
|
+
{ id: "anc-real-brief", label: "Write the brief" },
|
|
227
|
+
{ id: "anc-real-tokens", label: "Customize tokens" },
|
|
228
|
+
{ id: "anc-real-components", label: "Adopt the components" },
|
|
229
|
+
{ id: "anc-real-verify", label: "Verify and ship" },
|
|
230
|
+
]}
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
),
|
|
236
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { AngleSlider } from "@behavioral-agentic-design-system/core/components/ui/angle-slider";
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
10
|
+
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof AngleSlider> = {
|
|
13
|
+
title: "Components/AngleSlider",
|
|
14
|
+
component: AngleSlider,
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: "centered",
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component:
|
|
20
|
+
"Circular drag input for selecting angles 0–360°. The whole circle is the focusable role=slider node (every size ≥ 64px, clearing the 44px target floor). Keyboard: arrows ±step, Shift+Arrow ±10×step, Home/End. Value changes ease via var(--duration-base) + var(--ease-out) on keyboard steps and pointer release; tracking is instant during drag. Not for linear ranges — use Slider.",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof AngleSlider>;
|
|
28
|
+
|
|
29
|
+
function ControlledAngleSlider(
|
|
30
|
+
props: React.ComponentProps<typeof AngleSlider>
|
|
31
|
+
) {
|
|
32
|
+
const [angle, setAngle] = React.useState(props.defaultValue ?? 45);
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex flex-col items-center gap-3">
|
|
35
|
+
<AngleSlider {...props} value={angle} onChange={setAngle} />
|
|
36
|
+
<p className="text-sm font-medium tabular-nums text-foreground">
|
|
37
|
+
{angle}°
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Default: Story = {
|
|
44
|
+
render: () => (
|
|
45
|
+
<ControlledAngleSlider defaultValue={45} aria-label="Angle" />
|
|
46
|
+
),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Size_Sm: Story = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<ControlledAngleSlider size="sm" defaultValue={45} aria-label="Angle" />
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Size_Md: Story = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<ControlledAngleSlider size="md" defaultValue={45} aria-label="Angle" />
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Size_Lg: Story = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<ControlledAngleSlider size="lg" defaultValue={45} aria-label="Angle" />
|
|
64
|
+
),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Sizes: Story = {
|
|
68
|
+
render: () => (
|
|
69
|
+
<div className="flex items-end gap-8">
|
|
70
|
+
<ControlledAngleSlider size="sm" defaultValue={45} aria-label="Small angle" />
|
|
71
|
+
<ControlledAngleSlider size="md" defaultValue={135} aria-label="Medium angle" />
|
|
72
|
+
<ControlledAngleSlider size="lg" defaultValue={270} aria-label="Large angle" />
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Disabled: Story = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<AngleSlider disabled defaultValue={135} aria-label="Angle (disabled)" />
|
|
80
|
+
),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const RealisticUse: Story = {
|
|
84
|
+
render: function RealisticUseStory() {
|
|
85
|
+
// Real content: Jordan Reeves' tokens-v2-proposal share surface
|
|
86
|
+
// (content/personas/bads.json) — tuning the brand gradient angle.
|
|
87
|
+
const [angle, setAngle] = React.useState(135);
|
|
88
|
+
return (
|
|
89
|
+
<Card className="w-80">
|
|
90
|
+
<CardHeader>
|
|
91
|
+
<CardTitle className="text-2xl">Rotation</CardTitle>
|
|
92
|
+
<p className="text-xs text-muted-foreground">
|
|
93
|
+
tokens-v2-proposal · Jordan Reeves
|
|
94
|
+
</p>
|
|
95
|
+
</CardHeader>
|
|
96
|
+
<CardContent className="space-y-4">
|
|
97
|
+
<div className="flex items-center justify-between gap-6">
|
|
98
|
+
<div className="space-y-1">
|
|
99
|
+
<Label htmlFor="gradient-angle-display">Gradient angle</Label>
|
|
100
|
+
<p
|
|
101
|
+
id="gradient-angle-display"
|
|
102
|
+
className="text-sm font-medium tabular-nums text-foreground"
|
|
103
|
+
aria-live="polite"
|
|
104
|
+
>
|
|
105
|
+
{angle}°
|
|
106
|
+
</p>
|
|
107
|
+
<p className="text-xs text-muted-foreground">
|
|
108
|
+
Drives --brand-gradient across hero and share surfaces.
|
|
109
|
+
</p>
|
|
110
|
+
</div>
|
|
111
|
+
<AngleSlider
|
|
112
|
+
value={angle}
|
|
113
|
+
onChange={setAngle}
|
|
114
|
+
aria-label="Gradient angle"
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
<div
|
|
118
|
+
aria-hidden="true"
|
|
119
|
+
className="h-16 rounded-md border border-border"
|
|
120
|
+
style={{
|
|
121
|
+
backgroundImage: `linear-gradient(${angle}deg, var(--primary), var(--muted))`,
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
</CardContent>
|
|
125
|
+
</Card>
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
};
|