@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.
Files changed (131) hide show
  1. package/package.json +5 -2
  2. package/scripts/build-tokens.cjs +79 -5
  3. package/src/app/preview/components/page.tsx +4474 -208
  4. package/src/app/shell.tsx +18 -6
  5. package/src/components/customize/brand-mark-section.tsx +1 -1
  6. package/src/components/customize-tab.tsx +2 -2
  7. package/src/components/home-tab.tsx +2 -2
  8. package/src/components/ui/action-bar.tsx +142 -0
  9. package/src/components/ui/affix.tsx +109 -0
  10. package/src/components/ui/alert.tsx +37 -3
  11. package/src/components/ui/anchor.tsx +136 -0
  12. package/src/components/ui/angle-slider.tsx +265 -0
  13. package/src/components/ui/autocomplete.tsx +223 -0
  14. package/src/components/ui/avatar.tsx +8 -2
  15. package/src/components/ui/blockquote.tsx +112 -0
  16. package/src/components/ui/bottom-navigation.tsx +144 -0
  17. package/src/components/ui/burger.tsx +117 -0
  18. package/src/components/ui/button.tsx +101 -3
  19. package/src/components/ui/calendar.tsx +1 -1
  20. package/src/components/ui/card.tsx +43 -5
  21. package/src/components/ui/carousel.tsx +10 -5
  22. package/src/components/ui/cascader.tsx +253 -0
  23. package/src/components/ui/checkbox-card.tsx +176 -0
  24. package/src/components/ui/checkbox-group.tsx +231 -0
  25. package/src/components/ui/checkbox.tsx +14 -3
  26. package/src/components/ui/chip.tsx +143 -0
  27. package/src/components/ui/circular-progress.tsx +2 -2
  28. package/src/components/ui/color-swatch.tsx +73 -0
  29. package/src/components/ui/copy-button.tsx +21 -4
  30. package/src/components/ui/date-picker.tsx +6 -3
  31. package/src/components/ui/date-range-picker.tsx +6 -3
  32. package/src/components/ui/float-label.tsx +114 -0
  33. package/src/components/ui/floating-panel.tsx +129 -0
  34. package/src/components/ui/format-number.tsx +122 -0
  35. package/src/components/ui/highlight.tsx +85 -0
  36. package/src/components/ui/image.tsx +195 -0
  37. package/src/components/ui/index.ts +50 -0
  38. package/src/components/ui/indicator.tsx +2 -2
  39. package/src/components/ui/input.tsx +48 -4
  40. package/src/components/ui/kbd.tsx +1 -1
  41. package/src/components/ui/link.tsx +158 -0
  42. package/src/components/ui/listbox.tsx +426 -0
  43. package/src/components/ui/loading-overlay.tsx +80 -0
  44. package/src/components/ui/marquee.tsx +193 -0
  45. package/src/components/ui/masonry.tsx +164 -0
  46. package/src/components/ui/meter.tsx +186 -0
  47. package/src/components/ui/motion-toggle.tsx +170 -0
  48. package/src/components/ui/notification.tsx +175 -0
  49. package/src/components/ui/overlay.tsx +63 -0
  50. package/src/components/ui/progress.tsx +95 -4
  51. package/src/components/ui/rating-group.tsx +1 -0
  52. package/src/components/ui/separator.tsx +57 -1
  53. package/src/components/ui/sidebar.tsx +1 -1
  54. package/src/components/ui/signature-pad.tsx +381 -0
  55. package/src/components/ui/skeleton.tsx +59 -2
  56. package/src/components/ui/skip-link.tsx +117 -0
  57. package/src/components/ui/slider.tsx +86 -1
  58. package/src/components/ui/spoiler.tsx +131 -0
  59. package/src/components/ui/tabs.tsx +1 -1
  60. package/src/components/ui/text.tsx +135 -0
  61. package/src/components/ui/textarea.tsx +66 -2
  62. package/src/components/ui/timeline.tsx +71 -14
  63. package/src/components/ui/timer.tsx +183 -0
  64. package/src/components/ui/tour.tsx +332 -0
  65. package/src/components/ui/transfer-list.tsx +308 -0
  66. package/src/components/ui/visually-hidden.tsx +42 -0
  67. package/src/components/ui/watermark.tsx +0 -0
  68. package/src/data/docs-index.ts +9 -2
  69. package/src/stories/ActionBar.stories.tsx +201 -0
  70. package/src/stories/Affix.stories.tsx +165 -0
  71. package/src/stories/Alert.stories.tsx +58 -0
  72. package/src/stories/Anchor.stories.tsx +236 -0
  73. package/src/stories/AngleSlider.stories.tsx +128 -0
  74. package/src/stories/Autocomplete.stories.tsx +216 -0
  75. package/src/stories/Avatar.stories.tsx +73 -1
  76. package/src/stories/Blockquote.stories.tsx +148 -0
  77. package/src/stories/BottomNavigation.stories.tsx +195 -0
  78. package/src/stories/Burger.stories.tsx +79 -0
  79. package/src/stories/Button.stories.tsx +103 -2
  80. package/src/stories/Calendar.stories.tsx +4 -0
  81. package/src/stories/Card.stories.tsx +30 -0
  82. package/src/stories/Carousel.stories.tsx +2 -1
  83. package/src/stories/Cascader.stories.tsx +285 -0
  84. package/src/stories/Checkbox.stories.tsx +13 -0
  85. package/src/stories/CheckboxCard.stories.tsx +210 -0
  86. package/src/stories/CheckboxGroup.stories.tsx +186 -0
  87. package/src/stories/Chip.stories.tsx +173 -0
  88. package/src/stories/CircularProgress.stories.tsx +3 -0
  89. package/src/stories/ColorSwatch.stories.tsx +81 -0
  90. package/src/stories/CopyButton.stories.tsx +3 -3
  91. package/src/stories/DatePicker.stories.tsx +3 -0
  92. package/src/stories/DateRangePicker.stories.tsx +3 -0
  93. package/src/stories/Editable.stories.tsx +14 -0
  94. package/src/stories/FloatLabel.stories.tsx +148 -0
  95. package/src/stories/FloatingPanel.stories.tsx +176 -0
  96. package/src/stories/FormatNumber.stories.tsx +308 -0
  97. package/src/stories/Highlight.stories.tsx +140 -0
  98. package/src/stories/Image.stories.tsx +141 -0
  99. package/src/stories/Indicator.stories.tsx +3 -0
  100. package/src/stories/Input.stories.tsx +33 -0
  101. package/src/stories/Kbd.stories.tsx +3 -0
  102. package/src/stories/Link.stories.tsx +198 -0
  103. package/src/stories/Listbox.stories.tsx +240 -0
  104. package/src/stories/LoadingOverlay.stories.tsx +148 -0
  105. package/src/stories/Marquee.stories.tsx +170 -0
  106. package/src/stories/Masonry.stories.tsx +227 -0
  107. package/src/stories/Meter.stories.tsx +143 -0
  108. package/src/stories/MotionToggle.stories.tsx +85 -0
  109. package/src/stories/Notification.stories.tsx +264 -0
  110. package/src/stories/Overlay.stories.tsx +169 -0
  111. package/src/stories/PasswordInput.stories.tsx +4 -0
  112. package/src/stories/Progress.stories.tsx +70 -27
  113. package/src/stories/RatingGroup.stories.tsx +5 -0
  114. package/src/stories/Separator.stories.tsx +41 -5
  115. package/src/stories/Sidebar.stories.tsx +2 -1
  116. package/src/stories/SignaturePad.stories.tsx +112 -0
  117. package/src/stories/Skeleton.stories.tsx +23 -4
  118. package/src/stories/SkipLink.stories.tsx +137 -0
  119. package/src/stories/Slider.stories.tsx +28 -0
  120. package/src/stories/Spoiler.stories.tsx +122 -0
  121. package/src/stories/Tabs.stories.tsx +2 -1
  122. package/src/stories/Text.stories.tsx +191 -0
  123. package/src/stories/Textarea.stories.tsx +58 -6
  124. package/src/stories/Timeline.stories.tsx +82 -0
  125. package/src/stories/Timer.stories.tsx +160 -0
  126. package/src/stories/Tour.stories.tsx +191 -0
  127. package/src/stories/TransferList.stories.tsx +169 -0
  128. package/src/stories/VisuallyHidden.stories.tsx +105 -0
  129. package/src/stories/Watermark.stories.tsx +212 -0
  130. package/src/styles.css +80 -6
  131. package/src/tokens.json +2 -2
@@ -0,0 +1,264 @@
1
+ // Stories cover all Notification variants, states, and compositions.
2
+ // 2026-07-23: added axe target-size rule to Dismissible story (SC 2.5.8 audit
3
+ // per Thursday accessibility research — dismiss button is size-6 offset-exception).
4
+ import * as React from "react";
5
+ import type { Meta, StoryObj } from "@storybook/react";
6
+ import {
7
+ Bell,
8
+ CheckCircle2,
9
+ GitPullRequest,
10
+ MessageSquare,
11
+ TriangleAlert,
12
+ } from "lucide-react";
13
+ import { Notification } from "@behavioral-agentic-design-system/core/components/ui/notification";
14
+ import {
15
+ Avatar,
16
+ AvatarFallback,
17
+ } from "@behavioral-agentic-design-system/core/components/ui/avatar";
18
+
19
+ const meta: Meta<typeof Notification> = {
20
+ title: "Components/Notification",
21
+ component: Notification,
22
+ parameters: { layout: "centered" },
23
+ tags: ["autodocs"],
24
+ decorators: [
25
+ (Story) => (
26
+ <div className="w-96">
27
+ <Story />
28
+ </div>
29
+ ),
30
+ ],
31
+ };
32
+
33
+ export default meta;
34
+ type Story = StoryObj<typeof meta>;
35
+
36
+ export const Default: Story = {
37
+ render: () => (
38
+ <Notification
39
+ title="Chromatic baseline updated"
40
+ description="4 visual changes are ready to review on the tokens-v2-proposal branch."
41
+ />
42
+ ),
43
+ };
44
+
45
+ export const Unread: Story = {
46
+ render: () => (
47
+ <Notification
48
+ unread
49
+ title="Jordan Reeves mentioned you"
50
+ description="“Can you confirm the 7:1 pair on the new success accent before I merge?”"
51
+ />
52
+ ),
53
+ };
54
+
55
+ export const WithTimestamp: Story = {
56
+ render: () => (
57
+ <Notification
58
+ title="Story coverage report ready"
59
+ description="Coverage is at 98.4% after last night's build pass."
60
+ timestamp="2 min ago"
61
+ />
62
+ ),
63
+ };
64
+
65
+ export const WithIcon: Story = {
66
+ render: () => (
67
+ <Notification
68
+ icon={<GitPullRequest strokeWidth={1.5} />}
69
+ title="PR #482 opened"
70
+ description="feat(notification): add Notification primitive [Night Shift]"
71
+ timestamp="Just now"
72
+ />
73
+ ),
74
+ };
75
+
76
+ export const Loading: Story = {
77
+ render: () => (
78
+ <Notification
79
+ loading
80
+ title="Publishing tokens v2"
81
+ description="Running pnpm build:tokens and pushing to the registry."
82
+ />
83
+ ),
84
+ };
85
+
86
+ export const Variant_Destructive: Story = {
87
+ render: () => (
88
+ <Notification
89
+ variant="destructive"
90
+ icon={<TriangleAlert strokeWidth={1.5} />}
91
+ title="CI gate failed"
92
+ description="lint:microanimation found a duration-200 literal in sheet.tsx."
93
+ timestamp="8 min ago"
94
+ />
95
+ ),
96
+ };
97
+
98
+ export const Variant_Success: Story = {
99
+ render: () => (
100
+ <Notification
101
+ variant="success"
102
+ icon={<CheckCircle2 strokeWidth={1.5} />}
103
+ title="WCAG audit passed"
104
+ description="All 41 token pairs meet the AAA 7:1 floor."
105
+ timestamp="1 hr ago"
106
+ />
107
+ ),
108
+ };
109
+
110
+ export const Variant_Warning: Story = {
111
+ render: () => (
112
+ <Notification
113
+ variant="warning"
114
+ icon={<TriangleAlert strokeWidth={1.5} />}
115
+ title="Token drift detected"
116
+ description="3 hardcoded hex values found in components/examples/cards."
117
+ timestamp="Yesterday"
118
+ />
119
+ ),
120
+ };
121
+
122
+ function DismissibleDemo() {
123
+ const [visible, setVisible] = React.useState(true);
124
+ if (!visible) {
125
+ return (
126
+ <button
127
+ type="button"
128
+ className="text-sm font-medium text-primary underline underline-offset-4 min-h-11"
129
+ onClick={() => setVisible(true)}
130
+ >
131
+ Restore notification
132
+ </button>
133
+ );
134
+ }
135
+ return (
136
+ <Notification
137
+ unread
138
+ icon={<Bell strokeWidth={1.5} />}
139
+ title="Weekly digest ready"
140
+ description="12 registry changes and 2 new corrections this week."
141
+ timestamp="Mon 09:00"
142
+ onDismiss={() => setVisible(false)}
143
+ />
144
+ );
145
+ }
146
+
147
+ export const Dismissible: Story = {
148
+ render: () => <DismissibleDemo />,
149
+ parameters: {
150
+ a11y: {
151
+ config: {
152
+ rules: [
153
+ {
154
+ // SC 2.5.8 AA: dismiss button is size-6 (24×24px) — satisfies via
155
+ // the offset exception (ml-auto + self-start provides ≥24px clearance
156
+ // from every adjacent interactive element). Enable target-size rule
157
+ // to surface any regressions if layout changes narrow that offset.
158
+ id: "target-size",
159
+ enabled: true,
160
+ },
161
+ ],
162
+ },
163
+ },
164
+ },
165
+ };
166
+
167
+ export const NoTitle: Story = {
168
+ render: () => (
169
+ <Notification
170
+ description="Seo-yun Park accepted your invite to the design-tokens workspace."
171
+ timestamp="3 hrs ago"
172
+ />
173
+ ),
174
+ };
175
+
176
+ type FeedItem = {
177
+ id: string;
178
+ variant?: "default" | "destructive" | "success" | "warning";
179
+ unread?: boolean;
180
+ icon: React.ReactNode;
181
+ title: string;
182
+ description: string;
183
+ timestamp: string;
184
+ };
185
+
186
+ const FEED_ITEMS: FeedItem[] = [
187
+ {
188
+ id: "comment",
189
+ unread: true,
190
+ icon: (
191
+ <Avatar className="size-6">
192
+ <AvatarFallback className="text-xs">JR</AvatarFallback>
193
+ </Avatar>
194
+ ),
195
+ title: "Jordan Reeves commented on Chip",
196
+ description:
197
+ "“The selected fill should use the AAA-verified primary pair, not secondary.”",
198
+ timestamp: "2 min ago",
199
+ },
200
+ {
201
+ id: "ci",
202
+ variant: "destructive",
203
+ unread: true,
204
+ icon: <TriangleAlert strokeWidth={1.5} />,
205
+ title: "CI gate failed: lint:microanimation",
206
+ description:
207
+ "notification.tsx must not use duration-fast — use var(--duration-fast).",
208
+ timestamp: "14 min ago",
209
+ },
210
+ {
211
+ id: "chromatic",
212
+ variant: "success",
213
+ icon: <CheckCircle2 strokeWidth={1.5} />,
214
+ title: "Chromatic baseline updated",
215
+ description:
216
+ "4 changes to review across Button, Tabs, and the Foundations stories.",
217
+ timestamp: "1 hr ago",
218
+ },
219
+ {
220
+ id: "mention",
221
+ icon: <MessageSquare strokeWidth={1.5} />,
222
+ title: "Anika Patel replied in #bads",
223
+ description:
224
+ "“Morning brief looks good — shipping the orphan-lint sweep today.”",
225
+ timestamp: "Yesterday",
226
+ },
227
+ ];
228
+
229
+ function RealisticUseDemo() {
230
+ const [items, setItems] = React.useState(FEED_ITEMS);
231
+
232
+ return (
233
+ <div
234
+ role="feed"
235
+ aria-label="Notifications"
236
+ className="flex w-full flex-col gap-2"
237
+ >
238
+ {items.map((item) => (
239
+ <Notification
240
+ key={item.id}
241
+ role="article"
242
+ variant={item.variant}
243
+ unread={item.unread}
244
+ icon={item.icon}
245
+ title={item.title}
246
+ description={item.description}
247
+ timestamp={item.timestamp}
248
+ onDismiss={() =>
249
+ setItems((prev) => prev.filter((i) => i.id !== item.id))
250
+ }
251
+ />
252
+ ))}
253
+ {items.length === 0 && (
254
+ <p className="py-6 text-center text-sm text-muted-foreground">
255
+ You&rsquo;re all caught up.
256
+ </p>
257
+ )}
258
+ </div>
259
+ );
260
+ }
261
+
262
+ export const RealisticUse: Story = {
263
+ render: () => <RealisticUseDemo />,
264
+ };
@@ -0,0 +1,169 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Overlay } from "@behavioral-agentic-design-system/core/components/ui/overlay";
4
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
5
+ import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
6
+ import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
7
+ import {
8
+ Card,
9
+ CardContent,
10
+ CardDescription,
11
+ CardHeader,
12
+ CardTitle,
13
+ } from "@behavioral-agentic-design-system/core/components/ui/card";
14
+
15
+ const meta: Meta<typeof Overlay> = {
16
+ title: "Components/Overlay",
17
+ component: Overlay,
18
+ parameters: {
19
+ layout: "centered",
20
+ docs: {
21
+ description: {
22
+ component:
23
+ "Thin translucent layer covering its nearest position:relative ancestor (or the viewport with fixed) — the raw backdrop primitive LoadingOverlay builds on. Purely decorative (aria-hidden, never focusable); it blocks pointer input by sitting on top, so the reason a region is frozen must ship in a visible, announced element beside it. Fade rides transition-opacity on the motion tokens.",
24
+ },
25
+ },
26
+ },
27
+ tags: ["autodocs"],
28
+ };
29
+
30
+ export default meta;
31
+ type Story = StoryObj<typeof meta>;
32
+
33
+ // Real content from content/personas/bads.json (primary persona pool).
34
+ function ShareCardBody() {
35
+ return (
36
+ <div className="w-80 space-y-2 rounded-lg border border-border p-4">
37
+ <p className="text-sm font-medium text-foreground">tokens-v2-proposal</p>
38
+ <p className="text-sm text-muted-foreground">
39
+ Jordan Reeves shared 36 components for review at
40
+ design.bads.com/share/tokens-v2-proposal.
41
+ </p>
42
+ </div>
43
+ );
44
+ }
45
+
46
+ export const Default: Story = {
47
+ render: () => (
48
+ // The consumer wraps the frozen container in `relative`;
49
+ // the overlay covers that nearest positioned ancestor.
50
+ <div className="relative">
51
+ <ShareCardBody />
52
+ <Overlay radius="rounded-lg" />
53
+ </div>
54
+ ),
55
+ };
56
+
57
+ export const WithBlur: Story = {
58
+ render: () => (
59
+ <div className="relative">
60
+ <ShareCardBody />
61
+ <Overlay blur radius="rounded-lg" />
62
+ </div>
63
+ ),
64
+ };
65
+
66
+ function FixedDemo() {
67
+ const [shown, setShown] = React.useState(false);
68
+ React.useEffect(() => {
69
+ if (!shown) return;
70
+ const t = setTimeout(() => setShown(false), 3000);
71
+ return () => clearTimeout(t);
72
+ }, [shown]);
73
+ return (
74
+ <div className="flex flex-col items-start gap-4">
75
+ <Button size="xl" variant="outline" onClick={() => setShown(true)}>
76
+ {shown ? "Covering the viewport…" : "Show fixed overlay (3s)"}
77
+ </Button>
78
+ <ShareCardBody />
79
+ {shown && <Overlay fixed blur zIndex={40} />}
80
+ </div>
81
+ );
82
+ }
83
+
84
+ export const Fixed: Story = {
85
+ parameters: { layout: "fullscreen" },
86
+ render: () => (
87
+ <div className="p-8">
88
+ <p className="mb-4 text-sm text-muted-foreground">
89
+ <code>fixed</code> switches to viewport coverage (position: fixed) for
90
+ full-screen use. It does not lock body scroll — that is dialog-layer
91
+ behavior, not the paint layer&rsquo;s job.
92
+ </p>
93
+ <FixedDemo />
94
+ </div>
95
+ ),
96
+ };
97
+
98
+ export const Custom: Story = {
99
+ render: () => (
100
+ <div className="relative">
101
+ <ShareCardBody />
102
+ <Overlay color="bg-primary/10" radius="rounded-lg" />
103
+ </div>
104
+ ),
105
+ };
106
+
107
+ function RealisticUseDemo() {
108
+ const [submitting, setSubmitting] = React.useState(false);
109
+ React.useEffect(() => {
110
+ if (!submitting) return;
111
+ const t = setTimeout(() => setSubmitting(false), 2400);
112
+ return () => clearTimeout(t);
113
+ }, [submitting]);
114
+ return (
115
+ <Card className="w-96">
116
+ <CardHeader>
117
+ <CardTitle className="text-2xl">Billing contact</CardTitle>
118
+ <CardDescription>
119
+ design.bads.com &middot; Jordan Reeves&rsquo; workspace
120
+ </CardDescription>
121
+ </CardHeader>
122
+ <CardContent>
123
+ {/* The overlay freezes the fieldset visually; the disabled inputs and
124
+ the role="status" line carry the state to assistive tech — the
125
+ overlay itself is aria-hidden and announces nothing. */}
126
+ <div className="relative">
127
+ <form
128
+ className="flex flex-col gap-5"
129
+ onSubmit={(e) => {
130
+ e.preventDefault();
131
+ setSubmitting(true);
132
+ }}
133
+ >
134
+ <div className="flex flex-col gap-3">
135
+ <Label htmlFor="overlay-billing-name">Full name</Label>
136
+ <Input
137
+ id="overlay-billing-name"
138
+ autoComplete="name"
139
+ defaultValue="Jordan Reeves"
140
+ disabled={submitting}
141
+ />
142
+ </div>
143
+ <div className="flex flex-col gap-3">
144
+ <Label htmlFor="overlay-billing-email">Billing email</Label>
145
+ <Input
146
+ id="overlay-billing-email"
147
+ type="email"
148
+ autoComplete="email"
149
+ defaultValue="jordan@reeves.design"
150
+ disabled={submitting}
151
+ />
152
+ </div>
153
+ <Button size="xl" type="submit" disabled={submitting}>
154
+ {submitting ? "Saving…" : "Save billing contact"}
155
+ </Button>
156
+ </form>
157
+ {submitting && <Overlay radius="rounded-lg" />}
158
+ </div>
159
+ <p role="status" aria-live="polite" className="mt-3 text-sm text-muted-foreground">
160
+ {submitting ? "Saving your billing contact…" : " "}
161
+ </p>
162
+ </CardContent>
163
+ </Card>
164
+ );
165
+ }
166
+
167
+ export const RealisticUse: Story = {
168
+ render: () => <RealisticUseDemo />,
169
+ };
@@ -30,6 +30,10 @@ export const Size_Xl: Story = {
30
30
  args: { size: "xl" },
31
31
  };
32
32
 
33
+ export const Size_2xl: Story = {
34
+ args: { size: "2xl" },
35
+ };
36
+
33
37
  export const Visible: Story = {
34
38
  args: { defaultVisible: true, placeholder: "Visible by default" },
35
39
  };
@@ -1,12 +1,18 @@
1
+ // Motion: fill narrowed transition-all → transition-transform (the fill only translates; explicit-properties rule).
1
2
  import { Meta, StoryObj } from "@storybook/react";
2
3
  import { Progress } from "@behavioral-agentic-design-system/core/components/ui/progress";
3
4
 
4
5
  /**
5
- * Progress is a non-CVA primitive — only `Default` + `RealisticUse` per
6
- * the storybook rule. Track surface uses `bg-primary/30 dark:bg-primary/60`,
7
- * an asymmetric alpha that lands at typical-progress-track contrast in light
8
- * mode and AAA-passing 6.79:1 in dark mode (documented exception in CLAUDE.md
9
- * → Known AAA exceptions).
6
+ * Progress is a non-CVA primitive — `Default` + `RealisticUse` per the
7
+ * storybook rule, plus one story per new prop surface (label / showValue).
8
+ * Track surface uses `bg-primary/30 dark:bg-primary/60`, an asymmetric alpha
9
+ * that lands at typical-progress-track contrast in light mode and AAA-passing
10
+ * 6.79:1 in dark mode (documented exception in CLAUDE.md → Known AAA
11
+ * exceptions).
12
+ *
13
+ * The `label` prop becomes the accessible name (generated-id aria-labelledby)
14
+ * and `showValue` renders the exact string Radix announces via aria-valuetext
15
+ * (`getValueLabel`), so the visible and announced values cannot diverge.
10
16
  */
11
17
  const meta: Meta<typeof Progress> = {
12
18
  title: "Components/Progress",
@@ -17,6 +23,7 @@ const meta: Meta<typeof Progress> = {
17
23
  tags: ["autodocs"],
18
24
  argTypes: {
19
25
  value: { control: { type: "range", min: 0, max: 100, step: 1 } },
26
+ showValue: { control: "boolean" },
20
27
  },
21
28
  };
22
29
 
@@ -35,30 +42,66 @@ export const Default: Story = {
35
42
  ),
36
43
  };
37
44
 
45
+ export const WithLabel: Story = {
46
+ args: { value: 62, label: "Token migration" },
47
+ render: (args) => (
48
+ <div className="w-72">
49
+ <Progress {...args} />
50
+ </div>
51
+ ),
52
+ };
53
+
54
+ export const WithValue: Story = {
55
+ args: { value: 72, showValue: true, "aria-label": "Storybook coverage" },
56
+ render: (args) => (
57
+ <div className="w-72">
58
+ <Progress {...args} />
59
+ </div>
60
+ ),
61
+ };
62
+
63
+ export const WithLabelAndValue: Story = {
64
+ args: { value: 100, label: "AAA contrast audit", showValue: true },
65
+ render: (args) => (
66
+ <div className="w-72">
67
+ <Progress {...args} />
68
+ </div>
69
+ ),
70
+ };
71
+
72
+ /**
73
+ * Custom value formatting rides the (passthrough) Radix `getValueLabel` prop:
74
+ * the same function drives the visible text AND aria-valuetext, so "14 of 36
75
+ * components" is what sighted users see and what screen readers announce.
76
+ * The fill is max-aware on the labeled path (14 of 36 ≈ 39% filled).
77
+ */
78
+ export const CustomValueFormat: Story = {
79
+ render: () => (
80
+ <div className="w-72">
81
+ <Progress
82
+ value={14}
83
+ max={36}
84
+ label="Components migrated"
85
+ showValue
86
+ getValueLabel={(value, max) => `${value} of ${max} components`}
87
+ />
88
+ </div>
89
+ ),
90
+ };
91
+
38
92
  export const RealisticUse: Story = {
39
93
  render: () => (
40
94
  <div className="w-72 space-y-6">
41
- <div className="space-y-2">
42
- <div className="flex justify-between text-sm">
43
- <span id="progress-uploading" className="text-foreground">Uploading…</span>
44
- <span className="text-muted-foreground tabular-nums">28%</span>
45
- </div>
46
- <Progress value={28} aria-labelledby="progress-uploading" />
47
- </div>
48
- <div className="space-y-2">
49
- <div className="flex justify-between text-sm">
50
- <span id="progress-processing" className="text-foreground">Processing</span>
51
- <span className="text-muted-foreground tabular-nums">72%</span>
52
- </div>
53
- <Progress value={72} aria-labelledby="progress-processing" />
54
- </div>
55
- <div className="space-y-2">
56
- <div className="flex justify-between text-sm">
57
- <span id="progress-done" className="text-foreground">Done</span>
58
- <span className="text-muted-foreground tabular-nums">100%</span>
59
- </div>
60
- <Progress value={100} aria-labelledby="progress-done" />
61
- </div>
95
+ <Progress value={28} label="Uploading brand-fonts.woff2" showValue />
96
+ <Progress value={72} label="Processing tokens" showValue />
97
+ <Progress value={100} label="Storybook coverage" showValue />
98
+ <Progress
99
+ value={14}
100
+ max={36}
101
+ label="a11y contracts reviewed"
102
+ showValue
103
+ getValueLabel={(value, max) => `${value} of ${max}`}
104
+ />
62
105
  </div>
63
106
  ),
64
- };
107
+ };
@@ -2,6 +2,11 @@ import * as React from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react";
3
3
  import { RatingGroup } from "@behavioral-agentic-design-system/core/components/ui/rating-group";
4
4
 
5
+ // Note: the star's hover:scale-110 is a deliberate selection-preview affordance
6
+ // (documented via an allow-slop:BADS-SLOP-3 escape hatch in the component) —
7
+ // the star you're about to pick grows. This is the one place a scale hover is
8
+ // the affordance rather than a decorative pop.
9
+
5
10
  const meta: Meta<typeof RatingGroup> = {
6
11
  title: "Components/RatingGroup",
7
12
  component: RatingGroup,
@@ -19,10 +19,46 @@ export const Default: Story = {
19
19
  </div>),
20
20
  };
21
21
 
22
+ export const Label_Center: Story = {
23
+ render: () => (
24
+ <div className="w-[280px]">
25
+ <Separator label="or" />
26
+ </div>
27
+ ),
28
+ };
29
+
30
+ export const Label_Start: Story = {
31
+ render: () => (
32
+ <div className="w-[280px]">
33
+ <Separator label="Recent" labelPosition="start" />
34
+ </div>
35
+ ),
36
+ };
37
+
38
+ export const Label_End: Story = {
39
+ render: () => (
40
+ <div className="w-[280px]">
41
+ <Separator label="Archived" labelPosition="end" />
42
+ </div>
43
+ ),
44
+ };
45
+
46
+ // Regression guard: a long / non-Latin label must clip with an ellipsis inside
47
+ // its container, not push the rule out (caught by the persona UX-test pass).
48
+ export const Label_LongTruncates: Story = {
49
+ render: () => (
50
+ <div className="w-[280px]">
51
+ <Separator label="アーカイブされたプロジェクトとドラフト — a very long divider label" />
52
+ </div>
53
+ ),
54
+ };
55
+
22
56
  export const RealisticUse: Story = {
23
- render: () => (<div className="w-[280px] space-y-3">
24
- <p className="text-sm">Section one.</p>
25
- <Separator />
26
- <p className="text-sm">Section two.</p>
27
- </div>),
57
+ render: () => (
58
+ <div className="w-[280px] space-y-4">
59
+ <p className="text-sm">Continue with your work email.</p>
60
+ <Separator label="or" />
61
+ <p className="text-sm text-muted-foreground">Use a single sign-on provider instead.</p>
62
+ </div>
63
+ ),
28
64
  };
@@ -1,3 +1,4 @@
1
+ // Motion: rail hover narrowed transition-all → transition-colors (only the after-bg animates; explicit-properties rule).
1
2
  // Sidebar sticky container gained `h-svh` so the bg always spans the
2
3
  // viewport even when the menu is shorter than the screen. No new variants
3
4
  // or sizes — existing story matrix still covers the change.
@@ -50,4 +51,4 @@ export const RealisticUse: Story = {
50
51
  </SidebarContent>
51
52
  </Sidebar>
52
53
  </SidebarProvider>),
53
- };
54
+ };