@behavioral-agentic-design-system/core 0.39.1 → 0.42.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 (115) hide show
  1. package/README.md +2 -0
  2. package/package.json +26 -5
  3. package/scripts/a11y-lint.cjs +88 -8
  4. package/scripts/bads-components.mjs +118 -0
  5. package/scripts/build-tokens.cjs +133 -12
  6. package/scripts/check-stories.mjs +1 -1
  7. package/scripts/health-report.mjs +16 -2
  8. package/scripts/lint-component-source.mjs +100 -0
  9. package/scripts/lint-microanimation.mjs +267 -0
  10. package/scripts/lint-slop.mjs +25 -1
  11. package/scripts/size-audit.cjs +79 -0
  12. package/scripts/source-of-truth.cjs +58 -0
  13. package/scripts/ux-smoke.mjs +438 -0
  14. package/scripts/wcag-audit.cjs +121 -6
  15. package/src/api/layers/file.ts +1 -0
  16. package/src/app/opengraph-image.tsx +5 -0
  17. package/src/app/preview/components/page.tsx +2237 -2
  18. package/src/app/shell.tsx +17 -16
  19. package/src/components/Foundations/Motion.stories.tsx +1 -0
  20. package/src/components/customize/brand-mark-section.tsx +4 -2
  21. package/src/components/customize/design-controls.tsx +17 -2
  22. package/src/components/customize/discipline-section.tsx +3 -6
  23. package/src/components/customize/font-pickers.tsx +1 -1
  24. package/src/components/customize/letter-spacing.tsx +1 -1
  25. package/src/components/customize/save-bar.tsx +2 -2
  26. package/src/components/customize/theme-io.tsx +7 -7
  27. package/src/components/customize/type-scale.tsx +1 -1
  28. package/src/components/customize-tab.tsx +7 -4
  29. package/src/components/home-tab.tsx +3 -0
  30. package/src/components/studio/studio.tsx +153 -0
  31. package/src/components/ui/accordion.tsx +7 -0
  32. package/src/components/ui/alert.tsx +1 -0
  33. package/src/components/ui/anchor.tsx +37 -3
  34. package/src/components/ui/announcement-bar.tsx +256 -0
  35. package/src/components/ui/attachment.tsx +211 -0
  36. package/src/components/ui/badge.tsx +1 -0
  37. package/src/components/ui/callout.tsx +218 -0
  38. package/src/components/ui/chart.tsx +5 -14
  39. package/src/components/ui/code.tsx +1 -1
  40. package/src/components/ui/color-picker.tsx +2 -2
  41. package/src/components/ui/format-relative-time.tsx +139 -0
  42. package/src/components/ui/gauge-chart.tsx +238 -0
  43. package/src/components/ui/grid.tsx +255 -0
  44. package/src/components/ui/heatmap.tsx +256 -0
  45. package/src/components/ui/icon.tsx +108 -0
  46. package/src/components/ui/index.ts +17 -0
  47. package/src/components/ui/infinite-scroll.tsx +103 -0
  48. package/src/components/ui/json-input.tsx +351 -0
  49. package/src/components/ui/navigation-progress.tsx +281 -0
  50. package/src/components/ui/number-input.tsx +1 -4
  51. package/src/components/ui/page-header.tsx +63 -0
  52. package/src/components/ui/password-input.tsx +2 -1
  53. package/src/components/ui/password-strength-input.tsx +288 -0
  54. package/src/components/ui/pill.tsx +140 -0
  55. package/src/components/ui/popover.tsx +27 -4
  56. package/src/components/ui/portal.tsx +111 -0
  57. package/src/components/ui/presence.tsx +172 -0
  58. package/src/components/ui/progress-stack.tsx +258 -0
  59. package/src/components/ui/scroll-progress.tsx +100 -0
  60. package/src/components/ui/select.tsx +89 -4
  61. package/src/components/ui/separator.tsx +1 -0
  62. package/src/components/ui/slider.tsx +83 -3
  63. package/src/components/ui/snackbar.tsx +393 -0
  64. package/src/components/ui/sortable-list.tsx +342 -0
  65. package/src/components/ui/sparkline.tsx +2 -14
  66. package/src/components/ui/squircle.tsx +1 -1
  67. package/src/components/ui/table.tsx +1 -1
  68. package/src/components/ui/textarea.tsx +28 -1
  69. package/src/components/ui/tour.tsx +1 -3
  70. package/src/data/docs-index.ts +25 -0
  71. package/src/hooks/use-reduced-motion.ts +6 -0
  72. package/src/lib/clamp.ts +2 -0
  73. package/src/stories/Accordion.stories.tsx +59 -0
  74. package/src/stories/Alert.stories.tsx +3 -1
  75. package/src/stories/Anchor.stories.tsx +54 -0
  76. package/src/stories/AnnouncementBar.stories.tsx +261 -0
  77. package/src/stories/Attachment.stories.tsx +189 -0
  78. package/src/stories/Badge.stories.tsx +3 -0
  79. package/src/stories/Calendar.stories.tsx +1 -1
  80. package/src/stories/Callout.stories.tsx +219 -0
  81. package/src/stories/Chart.stories.tsx +8 -0
  82. package/src/stories/Code.stories.tsx +1 -0
  83. package/src/stories/ColorPicker.stories.tsx +24 -0
  84. package/src/stories/FormatRelativeTime.stories.tsx +116 -0
  85. package/src/stories/GaugeChart.stories.tsx +163 -0
  86. package/src/stories/Grid.stories.tsx +197 -0
  87. package/src/stories/Heatmap.stories.tsx +172 -0
  88. package/src/stories/Icon.stories.tsx +175 -0
  89. package/src/stories/InfiniteScroll.stories.tsx +225 -0
  90. package/src/stories/JsonInput.stories.tsx +212 -0
  91. package/src/stories/MultiSelect.stories.tsx +1 -1
  92. package/src/stories/NavigationProgress.stories.tsx +159 -0
  93. package/src/stories/NumberInput.stories.tsx +1 -0
  94. package/src/stories/PageHeader.stories.tsx +102 -0
  95. package/src/stories/PasswordInput.stories.tsx +4 -0
  96. package/src/stories/PasswordStrengthInput.stories.tsx +211 -0
  97. package/src/stories/Pill.stories.tsx +201 -0
  98. package/src/stories/Popover.stories.tsx +29 -1
  99. package/src/stories/Portal.stories.tsx +191 -0
  100. package/src/stories/Presence.stories.tsx +228 -0
  101. package/src/stories/ProgressStack.stories.tsx +287 -0
  102. package/src/stories/ScrollProgress.stories.tsx +117 -0
  103. package/src/stories/Select.stories.tsx +25 -0
  104. package/src/stories/Separator.stories.tsx +3 -0
  105. package/src/stories/Slider.stories.tsx +54 -5
  106. package/src/stories/Snackbar.stories.tsx +315 -0
  107. package/src/stories/SortableList.stories.tsx +263 -0
  108. package/src/stories/Sparkline.stories.tsx +3 -0
  109. package/src/stories/Squircle.stories.tsx +1 -0
  110. package/src/stories/Table.stories.tsx +1 -0
  111. package/src/stories/Textarea.stories.tsx +18 -0
  112. package/src/stories/Tour.stories.tsx +1 -0
  113. package/src/stories/story-groups.json +26 -6
  114. package/src/styles.css +133 -12
  115. package/LICENSE +0 -21
@@ -0,0 +1,263 @@
1
+ import * as React from "react"
2
+ import type { Meta, StoryObj } from "@storybook/react"
3
+ import { SortableList } from "@behavioral-agentic-design-system/core/components/ui/sortable-list"
4
+ import {
5
+ Field,
6
+ FieldLabel,
7
+ FieldHelper,
8
+ } from "@behavioral-agentic-design-system/core/components/ui/field"
9
+ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge"
10
+
11
+ // ─── Meta ─────────────────────────────────────────────────────────────────────
12
+
13
+ const meta = {
14
+ title: "Components/Layout/SortableList",
15
+ component: SortableList,
16
+ parameters: {
17
+ layout: "padded",
18
+ docs: {
19
+ description: {
20
+ component:
21
+ "Drag-and-drop reorderable list using @dnd-kit. Keyboard accessible — Space/Enter to lift, arrow keys to move, Space/Enter/Escape to drop/cancel. Items require a stable `id`.",
22
+ },
23
+ },
24
+ },
25
+ } satisfies Meta<typeof SortableList>
26
+
27
+ export default meta
28
+
29
+ // ─── Fixtures ─────────────────────────────────────────────────────────────────
30
+
31
+ const PRIORITIES = [
32
+ { id: "p1", label: "Northwind Health integration", priority: "high" },
33
+ { id: "p2", label: "Token refresh for Cedar & Pine Studio", priority: "medium" },
34
+ { id: "p3", label: "Harborline Logistics onboarding flow", priority: "medium" },
35
+ { id: "p4", label: "WCAG AAA audit — Meridian Payments", priority: "low" },
36
+ { id: "p5", label: "Lumen Analytics dashboard components", priority: "low" },
37
+ ]
38
+
39
+ const PIPELINE_STAGES = [
40
+ { id: "s1", label: "Qualification" },
41
+ { id: "s2", label: "Discovery" },
42
+ { id: "s3", label: "Proposal" },
43
+ { id: "s4", label: "Negotiation" },
44
+ { id: "s5", label: "Closed" },
45
+ ]
46
+
47
+ const TEAM_MEMBERS = [
48
+ { id: "u1", name: "Jordan Reeves", role: "Design Lead" },
49
+ { id: "u2", name: "Seo-yun Park", role: "Senior Engineer" },
50
+ { id: "u3", name: "Marcus Lindqvist", role: "Product Manager" },
51
+ { id: "u4", name: "Anika Patel", role: "QA Engineer" },
52
+ ]
53
+
54
+ // ─── Story helpers ────────────────────────────────────────────────────────────
55
+
56
+ function useItems<T>(initial: T[]) {
57
+ const [items, setItems] = React.useState(initial)
58
+ return { items, setItems }
59
+ }
60
+
61
+ // ─── Stories ──────────────────────────────────────────────────────────────────
62
+
63
+ type Story = StoryObj<typeof meta>
64
+
65
+ export const Default: Story = {
66
+ parameters: { controls: { disable: true } },
67
+ render: () => {
68
+ const { items, setItems } = useItems(PIPELINE_STAGES)
69
+ return (
70
+ <div className="w-80">
71
+ <SortableList
72
+ items={items}
73
+ onReorder={setItems}
74
+ aria-label="Pipeline stages"
75
+ renderItem={(item) => (
76
+ <span className="text-sm text-foreground">{item.label}</span>
77
+ )}
78
+ />
79
+ </div>
80
+ )
81
+ },
82
+ }
83
+
84
+ export const WithBadges: Story = {
85
+ parameters: { controls: { disable: true } },
86
+ render: () => {
87
+ const { items, setItems } = useItems(PRIORITIES)
88
+ return (
89
+ <div className="w-96">
90
+ <SortableList
91
+ items={items}
92
+ onReorder={setItems}
93
+ aria-label="Project priorities"
94
+ renderItem={(item) => (
95
+ <div className="flex min-w-0 items-center gap-2">
96
+ <span className="min-w-0 flex-1 truncate text-sm text-foreground">
97
+ {item.label}
98
+ </span>
99
+ <Badge
100
+ variant={
101
+ item.priority === "high"
102
+ ? "destructive"
103
+ : item.priority === "medium"
104
+ ? "secondary"
105
+ : "outline"
106
+ }
107
+ className="shrink-0 text-xs"
108
+ >
109
+ {item.priority}
110
+ </Badge>
111
+ </div>
112
+ )}
113
+ />
114
+ </div>
115
+ )
116
+ },
117
+ }
118
+
119
+ export const NoHandle: Story = {
120
+ parameters: { controls: { disable: true } },
121
+ render: () => {
122
+ const { items, setItems } = useItems(PIPELINE_STAGES)
123
+ return (
124
+ <div className="w-80">
125
+ <SortableList
126
+ items={items}
127
+ onReorder={setItems}
128
+ handle={false}
129
+ aria-label="Pipeline stages — full row draggable"
130
+ renderItem={(item) => (
131
+ <span className="cursor-grab text-sm text-foreground active:cursor-grabbing">
132
+ {item.label}
133
+ </span>
134
+ )}
135
+ />
136
+ </div>
137
+ )
138
+ },
139
+ }
140
+
141
+ export const Size_Sm: Story = {
142
+ parameters: { controls: { disable: true } },
143
+ render: () => {
144
+ const { items, setItems } = useItems(PIPELINE_STAGES)
145
+ return (
146
+ <div className="w-72">
147
+ <SortableList
148
+ items={items}
149
+ onReorder={setItems}
150
+ size="sm"
151
+ aria-label="Pipeline stages (small)"
152
+ renderItem={(item) => (
153
+ <span className="text-xs text-foreground">{item.label}</span>
154
+ )}
155
+ />
156
+ </div>
157
+ )
158
+ },
159
+ }
160
+
161
+ export const Size_Default: Story = {
162
+ parameters: { controls: { disable: true } },
163
+ render: () => {
164
+ const { items, setItems } = useItems(PIPELINE_STAGES)
165
+ return (
166
+ <div className="w-80">
167
+ <SortableList
168
+ items={items}
169
+ onReorder={setItems}
170
+ size="default"
171
+ aria-label="Pipeline stages (default)"
172
+ renderItem={(item) => (
173
+ <span className="text-sm text-foreground">{item.label}</span>
174
+ )}
175
+ />
176
+ </div>
177
+ )
178
+ },
179
+ }
180
+
181
+ export const Size_Lg: Story = {
182
+ parameters: { controls: { disable: true } },
183
+ render: () => {
184
+ const { items, setItems } = useItems(PIPELINE_STAGES)
185
+ return (
186
+ <div className="w-80">
187
+ <SortableList
188
+ items={items}
189
+ onReorder={setItems}
190
+ size="lg"
191
+ aria-label="Pipeline stages (large)"
192
+ renderItem={(item) => (
193
+ <span className="text-base text-foreground">{item.label}</span>
194
+ )}
195
+ />
196
+ </div>
197
+ )
198
+ },
199
+ }
200
+
201
+ export const Disabled: Story = {
202
+ parameters: { controls: { disable: true } },
203
+ render: () => {
204
+ const { items, setItems } = useItems(PIPELINE_STAGES)
205
+ return (
206
+ <div className="w-80">
207
+ <SortableList
208
+ items={items}
209
+ onReorder={setItems}
210
+ disabled
211
+ aria-label="Pipeline stages (read-only)"
212
+ renderItem={(item) => (
213
+ <span className="text-sm text-muted-foreground">{item.label}</span>
214
+ )}
215
+ />
216
+ </div>
217
+ )
218
+ },
219
+ }
220
+
221
+ // ─── Realistic use ────────────────────────────────────────────────────────────
222
+
223
+ function RealisticUseDemo() {
224
+ const [members, setMembers] = React.useState(TEAM_MEMBERS)
225
+
226
+ return (
227
+ <div className="w-80 space-y-3">
228
+ <Field name="team-order">
229
+ <FieldLabel>Review order</FieldLabel>
230
+ <FieldHelper>
231
+ Drag to set the order in which the team reviews Fieldnote Labs pull
232
+ requests.
233
+ </FieldHelper>
234
+ <SortableList
235
+ items={members}
236
+ onReorder={setMembers}
237
+ aria-label="Team review order"
238
+ renderItem={(member) => (
239
+ <div className="min-w-0">
240
+ <p className="truncate text-sm font-medium text-foreground">
241
+ {member.name}
242
+ </p>
243
+ <p className="truncate text-xs text-muted-foreground">
244
+ {member.role}
245
+ </p>
246
+ </div>
247
+ )}
248
+ />
249
+ </Field>
250
+ <p className="text-xs text-muted-foreground">
251
+ Current order:{" "}
252
+ {members.map((m) => m.name.split(" ")[0]).join(" → ")}
253
+ </p>
254
+ </div>
255
+ )
256
+ }
257
+
258
+ export const RealisticUse: Story = {
259
+ parameters: {
260
+ controls: { disable: true },
261
+ },
262
+ render: () => <RealisticUseDemo />,
263
+ }
@@ -39,6 +39,9 @@ const NEGATIVE_DATA = [-12, 4, -8, 15, -3, 22, 8, -5]
39
39
  // no range of its own to scale against.
40
40
  const FLAT_DATA = [64, 64, 64, 64, 64, 64, 64, 64]
41
41
 
42
+ // The entrance draw-in follows the shared `useReducedMotion` hook
43
+ // (hooks/use-reduced-motion), the same one ChartContainer reads, so a
44
+ // reduced-motion user gets the final frame immediately in every story below.
42
45
  export const Default: Story = {
43
46
  render: () => (
44
47
  <div className="flex flex-col gap-2">
@@ -125,3 +125,4 @@ export const RealisticUse: Story = {
125
125
  </div>
126
126
  ),
127
127
  };
128
+
@@ -134,6 +134,7 @@ export const WithWrapperProps: Story = {
134
134
  ),
135
135
  };
136
136
 
137
+ // Scrollbar styled via native CSS: [scrollbar-width:thin] [scrollbar-color:...]
137
138
  export const WideOverflowing: Story = {
138
139
  render: () => (
139
140
  <div className="w-[380px]">
@@ -119,3 +119,21 @@ export const RealisticUse: Story = {
119
119
  </div>
120
120
  ),
121
121
  };
122
+
123
+ export const MaxRows: Story = {
124
+ // Static story — maxRows is the feature under test, not a driven arg.
125
+ parameters: { controls: { disable: true } },
126
+ render: () => (
127
+ <div className="flex flex-col gap-2 w-[320px]">
128
+ <Label htmlFor="maxrows-demo">Note (max 4 rows)</Label>
129
+ <Textarea
130
+ id="maxrows-demo"
131
+ placeholder="Start typing — the field grows up to 4 rows then scrolls."
132
+ maxRows={4}
133
+ />
134
+ <p className="text-xs text-muted-foreground">
135
+ Auto-grows with content; caps at 4 lines.
136
+ </p>
137
+ </div>
138
+ ),
139
+ };
@@ -189,3 +189,4 @@ export const RealisticUse: Story = {
189
189
  );
190
190
  },
191
191
  };
192
+
@@ -42,6 +42,7 @@
42
42
  "SearchInput",
43
43
  "Textarea",
44
44
  "PasswordInput",
45
+ "PasswordStrengthInput",
45
46
  "NumberInput",
46
47
  "PinInput",
47
48
  "TagsInput",
@@ -52,7 +53,8 @@
52
53
  "FloatLabel",
53
54
  "FileUpload",
54
55
  "SignaturePad",
55
- "Questionnaire"
56
+ "Questionnaire",
57
+ "JsonInput"
56
58
  ],
57
59
  "Selection": [
58
60
  "Select",
@@ -111,6 +113,7 @@
111
113
  "AlertDialog",
112
114
  "Notification",
113
115
  "Sonner",
116
+ "Snackbar",
114
117
  "Spinner",
115
118
  "Progress",
116
119
  "CircularProgress",
@@ -124,16 +127,23 @@
124
127
  "Meter",
125
128
  "Timer",
126
129
  "TypingIndicator",
127
- "ToggleTip"
130
+ "ToggleTip",
131
+ "Presence",
132
+ "Callout",
133
+ "AnnouncementBar",
134
+ "ScrollProgress",
135
+ "NavigationProgress"
128
136
  ],
129
137
  "Layout": [
130
138
  "Container",
131
139
  "Stack",
132
140
  "SimpleGrid",
141
+ "Grid",
133
142
  "Masonry",
134
143
  "Separator",
135
144
  "AspectRatio",
136
145
  "ScrollArea",
146
+ "InfiniteScroll",
137
147
  "Resizable",
138
148
  "Affix",
139
149
  "Collapsible",
@@ -146,7 +156,9 @@
146
156
  "FloatingIndicator",
147
157
  "FloatingPanel",
148
158
  "Carousel",
149
- "Card"
159
+ "Card",
160
+ "PageHeader",
161
+ "SortableList"
150
162
  ],
151
163
  "Content and data": [
152
164
  "Table",
@@ -166,25 +178,32 @@
166
178
  "FormatByte",
167
179
  "FormatNumber",
168
180
  "FormatDate",
181
+ "FormatRelativeTime",
169
182
  "RollingNumber",
170
183
  "Watermark",
171
184
  "Marquee",
172
185
  "WordRotate",
173
186
  "Reveal",
174
- "Sparkline"
187
+ "Sparkline",
188
+ "Icon",
189
+ "ProgressStack",
190
+ "GaugeChart",
191
+ "Heatmap"
175
192
  ],
176
193
  "Badges and avatars": [
177
194
  "Avatar",
178
195
  "Badge",
179
196
  "Tag",
180
197
  "Chip",
198
+ "Pill",
181
199
  "Indicator",
182
200
  "Kbd",
183
201
  "KeyboardShortcut",
184
202
  "ThemeIcon",
185
203
  "AiBadge",
186
204
  "ChatBubble",
187
- "ChatMarker"
205
+ "ChatMarker",
206
+ "Attachment"
188
207
  ],
189
208
  "Overlays": [
190
209
  "Dialog",
@@ -194,6 +213,7 @@
194
213
  "HoverCard",
195
214
  "Tooltip",
196
215
  "ContextMenu",
197
- "DropdownMenu"
216
+ "DropdownMenu",
217
+ "Portal"
198
218
  ]
199
219
  }
package/src/styles.css CHANGED
@@ -272,10 +272,18 @@
272
272
  :root above already defines --font-sans, and Tailwind picks it up
273
273
  for the font-sans utility automatically. */
274
274
 
275
- --radius-sm: calc(var(--radius) - 4px);
276
- --radius-md: calc(var(--radius) - 2px);
277
- --radius-lg: var(--radius);
278
- --radius-xl: calc(var(--radius) + 4px);
275
+ /* Per-step override hook, same shape as the type scale above: a fork whose
276
+ brand radius ramp isn't linear-from-one-base (e.g. Furnished Finder's
277
+ 4/8/12/16, which no single --radius value produces from these calc()s)
278
+ sets --radius-sm-size etc. directly. Also closes the duplicate-value
279
+ trap this used to have — a brand file that declared --radius-lg in
280
+ :root created a second, silently-losing value under the same name as
281
+ this computed one; the override name is now distinct from the utility
282
+ name it feeds. */
283
+ --radius-sm: var(--radius-sm-size, calc(var(--radius) - 4px));
284
+ --radius-md: var(--radius-md-size, calc(var(--radius) - 2px));
285
+ --radius-lg: var(--radius-lg-size, var(--radius));
286
+ --radius-xl: var(--radius-xl-size, calc(var(--radius) + 4px));
279
287
 
280
288
  /* Map Tailwind's shadow-* utilities through to the :root --shadow-* tokens
281
289
  so the Customize tab's Shadow Opacity slider takes effect. Without this
@@ -328,12 +336,15 @@
328
336
  /* Marketing tier — display sizes for landing pages, hero blocks, editorial.
329
337
  Tailwind only emits utilities that get used, so a non-marketing fork pays
330
338
  nothing for these. line-height drops to 1.1 at scale to keep big type
331
- readable; tracking tightens slightly to compensate for optical loosening. */
332
- --text-4xl: calc(36px * var(--font-size-scale, 1));
333
- --text-5xl: calc(48px * var(--font-size-scale, 1));
334
- --text-6xl: calc(60px * var(--font-size-scale, 1));
335
- --text-7xl: calc(72px * var(--font-size-scale, 1));
336
- --text-8xl: calc(96px * var(--font-size-scale, 1));
339
+ readable; tracking tightens slightly to compensate for optical loosening.
340
+ Same --text-*-size override hook as the body tier above, so a fork with
341
+ its own display scale (corrections.md-class drift otherwise) can retarget
342
+ these steps too instead of hitting a cliff at text-4xl. */
343
+ --text-4xl: calc(var(--text-4xl-size, 36px) * var(--font-size-scale, 1));
344
+ --text-5xl: calc(var(--text-5xl-size, 48px) * var(--font-size-scale, 1));
345
+ --text-6xl: calc(var(--text-6xl-size, 60px) * var(--font-size-scale, 1));
346
+ --text-7xl: calc(var(--text-7xl-size, 72px) * var(--font-size-scale, 1));
347
+ --text-8xl: calc(var(--text-8xl-size, 96px) * var(--font-size-scale, 1));
337
348
  --text-4xl--line-height: 1.15;
338
349
  --text-5xl--line-height: 1.10;
339
350
  --text-6xl--line-height: 1.05;
@@ -427,8 +438,19 @@
427
438
  body { transition: none; }
428
439
  }
429
440
  /* WCAG AAA 1.4.8: paragraph spacing ≥ 1.5× line-height inside running
430
- text. Scope to <p> only — UI primitives stay tight. Last-child has
431
- no trailing margin so containers don't get extra padding. */
441
+ text. Last-child has no trailing margin so containers don't get extra
442
+ padding.
443
+
444
+ "UI primitives stay tight" is NOT this rule's doing — it is the flex/grid
445
+ carve-out immediately below, and you cannot tell that by reading this
446
+ selector. Measured 2026-09-11 across all eight rail destinations: exactly
447
+ 18 paragraphs in the whole app compute to 1.5em, all of them section
448
+ descriptions on the Components showcase, which is running text and is
449
+ what the rule is for. EmptyState, Stepper, Questionnaire, FileUpload and
450
+ HoverCard all compute to margin-bottom 0 because their content sits in a
451
+ flex column. Every one of those five had been reported as "loosened by
452
+ this rule" from counting <p> tags in source rather than reading the DOM.
453
+ If you are about to rescope or delete this rule, measure first. */
432
454
  p:not(:last-child) {
433
455
  margin-bottom: 1.5em;
434
456
  }
@@ -792,6 +814,105 @@ html, body {
792
814
  animation: progress-stripe var(--progress-stripe-duration, 1s) linear infinite;
793
815
  }
794
816
 
817
+ /* Presence enter/exit keyframes — applied via the data-slot + data-transition
818
+ + data-state selectors the Presence primitive sets (spec §4 pattern (b):
819
+ plain CSS in the design-system layer, no Tailwind utility generation in
820
+ the path). The component flips data-state to "closed" and waits on
821
+ element.getAnimations() before unmounting, so the -out keyframe is what
822
+ the user actually sees.
823
+
824
+ - fill-mode "both" is load-bearing: the -out keyframe must HOLD its final
825
+ frame (opacity 0) until React commits the unmount, otherwise the element
826
+ pops back to fully visible for one frame after animationend.
827
+ - Translate distances are small (0.5rem) so the motion reads as a settle,
828
+ not a slide; scale starts at .96 for the same reason.
829
+ - Reduced motion: the base layer forces animation-duration to 0.01ms; the
830
+ finished promise still resolves, so the unmount is effectively instant. */
831
+ @keyframes presence-fade-in {
832
+ from { opacity: 0; }
833
+ to { opacity: 1; }
834
+ }
835
+ @keyframes presence-fade-out {
836
+ from { opacity: 1; }
837
+ to { opacity: 0; }
838
+ }
839
+ @keyframes presence-scale-in {
840
+ from { opacity: 0; transform: scale(0.96); }
841
+ to { opacity: 1; transform: scale(1); }
842
+ }
843
+ @keyframes presence-scale-out {
844
+ from { opacity: 1; transform: scale(1); }
845
+ to { opacity: 0; transform: scale(0.96); }
846
+ }
847
+ @keyframes presence-slide-up-in {
848
+ from { opacity: 0; transform: translateY(0.5rem); }
849
+ to { opacity: 1; transform: translateY(0); }
850
+ }
851
+ @keyframes presence-slide-up-out {
852
+ from { opacity: 1; transform: translateY(0); }
853
+ to { opacity: 0; transform: translateY(0.5rem); }
854
+ }
855
+ @keyframes presence-slide-down-in {
856
+ from { opacity: 0; transform: translateY(-0.5rem); }
857
+ to { opacity: 1; transform: translateY(0); }
858
+ }
859
+ @keyframes presence-slide-down-out {
860
+ from { opacity: 1; transform: translateY(0); }
861
+ to { opacity: 0; transform: translateY(-0.5rem); }
862
+ }
863
+ @keyframes presence-slide-left-in {
864
+ from { opacity: 0; transform: translateX(0.5rem); }
865
+ to { opacity: 1; transform: translateX(0); }
866
+ }
867
+ @keyframes presence-slide-left-out {
868
+ from { opacity: 1; transform: translateX(0); }
869
+ to { opacity: 0; transform: translateX(0.5rem); }
870
+ }
871
+ @keyframes presence-slide-right-in {
872
+ from { opacity: 0; transform: translateX(-0.5rem); }
873
+ to { opacity: 1; transform: translateX(0); }
874
+ }
875
+ @keyframes presence-slide-right-out {
876
+ from { opacity: 1; transform: translateX(0); }
877
+ to { opacity: 0; transform: translateX(-0.5rem); }
878
+ }
879
+ [data-slot="presence"][data-transition="fade"][data-state="open"] {
880
+ animation: presence-fade-in var(--duration-base) var(--ease-out) both;
881
+ }
882
+ [data-slot="presence"][data-transition="fade"][data-state="closed"] {
883
+ animation: presence-fade-out var(--duration-base) var(--ease-out) both;
884
+ }
885
+ [data-slot="presence"][data-transition="scale"][data-state="open"] {
886
+ animation: presence-scale-in var(--duration-base) var(--ease-out) both;
887
+ }
888
+ [data-slot="presence"][data-transition="scale"][data-state="closed"] {
889
+ animation: presence-scale-out var(--duration-base) var(--ease-out) both;
890
+ }
891
+ [data-slot="presence"][data-transition="slide-up"][data-state="open"] {
892
+ animation: presence-slide-up-in var(--duration-base) var(--ease-out) both;
893
+ }
894
+ [data-slot="presence"][data-transition="slide-up"][data-state="closed"] {
895
+ animation: presence-slide-up-out var(--duration-base) var(--ease-out) both;
896
+ }
897
+ [data-slot="presence"][data-transition="slide-down"][data-state="open"] {
898
+ animation: presence-slide-down-in var(--duration-base) var(--ease-out) both;
899
+ }
900
+ [data-slot="presence"][data-transition="slide-down"][data-state="closed"] {
901
+ animation: presence-slide-down-out var(--duration-base) var(--ease-out) both;
902
+ }
903
+ [data-slot="presence"][data-transition="slide-left"][data-state="open"] {
904
+ animation: presence-slide-left-in var(--duration-base) var(--ease-out) both;
905
+ }
906
+ [data-slot="presence"][data-transition="slide-left"][data-state="closed"] {
907
+ animation: presence-slide-left-out var(--duration-base) var(--ease-out) both;
908
+ }
909
+ [data-slot="presence"][data-transition="slide-right"][data-state="open"] {
910
+ animation: presence-slide-right-in var(--duration-base) var(--ease-out) both;
911
+ }
912
+ [data-slot="presence"][data-transition="slide-right"][data-state="closed"] {
913
+ animation: presence-slide-right-out var(--duration-base) var(--ease-out) both;
914
+ }
915
+
795
916
  /* Prose — long-form typographic rhythm for arbitrary HTML descendants
796
917
  (MDX output, CMS articles, rendered markdown). Keyed off the .prose
797
918
  class the Prose primitive (data-slot="prose") applies — same
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Matthew Stephens
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.