@behavioral-agentic-design-system/core 0.34.0 → 0.37.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 +12 -6
- package/scripts/bads-doctor.mjs +217 -0
- package/scripts/build-tokens.cjs +29 -0
- package/scripts/check-sync.mjs +270 -0
- package/scripts/health-report.mjs +158 -0
- package/scripts/lint-ethics-contract.mjs +129 -0
- package/scripts/lint-slop.mjs +160 -0
- package/scripts/lint-token-intent.mjs +128 -0
- package/scripts/slop-rules.mjs +77 -0
- package/src/app/preview/components/page.tsx +132 -0
- package/src/components/home-tab.tsx +43 -12
- package/src/components/ui/combobox.tsx +8 -0
- package/src/components/ui/data-table.tsx +20 -2
- package/src/components/ui/input.tsx +13 -2
- package/src/components/ui/multi-select.tsx +16 -1
- package/src/components/ui/pagination.tsx +65 -12
- package/src/components/ui/progress.tsx +18 -0
- package/src/components/ui/radio-group.tsx +39 -8
- package/src/components/ui/switch.tsx +4 -4
- package/src/components/ui/table.tsx +71 -67
- package/src/components/ui/textarea.tsx +22 -6
- package/src/data/docs-index.ts +2 -0
- package/src/stories/Combobox.stories.tsx +48 -0
- package/src/stories/DataTable.stories.tsx +38 -0
- package/src/stories/Input.stories.tsx +54 -0
- package/src/stories/MultiSelect.stories.tsx +36 -0
- package/src/stories/Pagination.stories.tsx +108 -0
- package/src/stories/Progress.stories.tsx +46 -0
- package/src/stories/RadioGroup.stories.tsx +40 -0
- package/src/stories/Switch.stories.tsx +8 -3
- package/src/stories/Table.stories.tsx +88 -0
- package/src/stories/Textarea.stories.tsx +36 -0
- package/src/styles.css +29 -0
|
@@ -145,6 +145,114 @@ const MEMBERS = [
|
|
|
145
145
|
{ name: "Teo Marchetti", plan: "Annual", joined: "Nov 5, 2023", status: "Active" },
|
|
146
146
|
];
|
|
147
147
|
|
|
148
|
+
/**
|
|
149
|
+
* size="sm" — 36×36px hit targets. Use in dense chrome where min-h-11 controls
|
|
150
|
+
* don't fit: table footers, list paginators, compact data grids.
|
|
151
|
+
* Note: sm is below the WCAG 2.5.5 Enhanced 44px floor — reserve for dense
|
|
152
|
+
* non-CTA chrome only, not stand-alone navigation paginators.
|
|
153
|
+
*/
|
|
154
|
+
export const Size_Sm: Story = {
|
|
155
|
+
render: () => (
|
|
156
|
+
<Pagination size="sm" className="w-[500px]">
|
|
157
|
+
<PaginationContent>
|
|
158
|
+
<PaginationItem>
|
|
159
|
+
<PaginationPrevious href="#" />
|
|
160
|
+
</PaginationItem>
|
|
161
|
+
<PaginationItem>
|
|
162
|
+
<PaginationLink href="#">1</PaginationLink>
|
|
163
|
+
</PaginationItem>
|
|
164
|
+
<PaginationItem>
|
|
165
|
+
<PaginationLink href="#" isActive>2</PaginationLink>
|
|
166
|
+
</PaginationItem>
|
|
167
|
+
<PaginationItem>
|
|
168
|
+
<PaginationLink href="#">3</PaginationLink>
|
|
169
|
+
</PaginationItem>
|
|
170
|
+
<PaginationItem>
|
|
171
|
+
<PaginationEllipsis />
|
|
172
|
+
</PaginationItem>
|
|
173
|
+
<PaginationItem>
|
|
174
|
+
<PaginationLink href="#">10</PaginationLink>
|
|
175
|
+
</PaginationItem>
|
|
176
|
+
<PaginationItem>
|
|
177
|
+
<PaginationNext href="#" />
|
|
178
|
+
</PaginationItem>
|
|
179
|
+
</PaginationContent>
|
|
180
|
+
</Pagination>
|
|
181
|
+
),
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* size="lg" — 48×48px hit targets. Use on prominent surfaces where extra
|
|
186
|
+
* breathing room is appropriate: full-bleed article paginators, marketing pages.
|
|
187
|
+
*/
|
|
188
|
+
export const Size_Lg: Story = {
|
|
189
|
+
render: () => (
|
|
190
|
+
<Pagination size="lg" className="w-[560px]">
|
|
191
|
+
<PaginationContent>
|
|
192
|
+
<PaginationItem>
|
|
193
|
+
<PaginationPrevious href="#" />
|
|
194
|
+
</PaginationItem>
|
|
195
|
+
<PaginationItem>
|
|
196
|
+
<PaginationLink href="#">1</PaginationLink>
|
|
197
|
+
</PaginationItem>
|
|
198
|
+
<PaginationItem>
|
|
199
|
+
<PaginationLink href="#" isActive>2</PaginationLink>
|
|
200
|
+
</PaginationItem>
|
|
201
|
+
<PaginationItem>
|
|
202
|
+
<PaginationLink href="#">3</PaginationLink>
|
|
203
|
+
</PaginationItem>
|
|
204
|
+
<PaginationItem>
|
|
205
|
+
<PaginationEllipsis />
|
|
206
|
+
</PaginationItem>
|
|
207
|
+
<PaginationItem>
|
|
208
|
+
<PaginationLink href="#">10</PaginationLink>
|
|
209
|
+
</PaginationItem>
|
|
210
|
+
<PaginationItem>
|
|
211
|
+
<PaginationNext href="#" />
|
|
212
|
+
</PaginationItem>
|
|
213
|
+
</PaginationContent>
|
|
214
|
+
</Pagination>
|
|
215
|
+
),
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/** All three sizes stacked — sm / default / lg comparison. */
|
|
219
|
+
export const Sizes: Story = {
|
|
220
|
+
render: () => (
|
|
221
|
+
<div className="space-y-6">
|
|
222
|
+
{(["sm", "default", "lg"] as const).map((size) => (
|
|
223
|
+
<div key={size} className="space-y-1">
|
|
224
|
+
<p className="text-xs text-muted-foreground">size="{size}"</p>
|
|
225
|
+
<Pagination size={size} className="w-[500px]">
|
|
226
|
+
<PaginationContent>
|
|
227
|
+
<PaginationItem>
|
|
228
|
+
<PaginationPrevious href="#" />
|
|
229
|
+
</PaginationItem>
|
|
230
|
+
<PaginationItem>
|
|
231
|
+
<PaginationLink href="#">1</PaginationLink>
|
|
232
|
+
</PaginationItem>
|
|
233
|
+
<PaginationItem>
|
|
234
|
+
<PaginationLink href="#" isActive>2</PaginationLink>
|
|
235
|
+
</PaginationItem>
|
|
236
|
+
<PaginationItem>
|
|
237
|
+
<PaginationLink href="#">3</PaginationLink>
|
|
238
|
+
</PaginationItem>
|
|
239
|
+
<PaginationItem>
|
|
240
|
+
<PaginationEllipsis />
|
|
241
|
+
</PaginationItem>
|
|
242
|
+
<PaginationItem>
|
|
243
|
+
<PaginationLink href="#">10</PaginationLink>
|
|
244
|
+
</PaginationItem>
|
|
245
|
+
<PaginationItem>
|
|
246
|
+
<PaginationNext href="#" />
|
|
247
|
+
</PaginationItem>
|
|
248
|
+
</PaginationContent>
|
|
249
|
+
</Pagination>
|
|
250
|
+
</div>
|
|
251
|
+
))}
|
|
252
|
+
</div>
|
|
253
|
+
),
|
|
254
|
+
};
|
|
255
|
+
|
|
148
256
|
export const RealisticUse: Story = {
|
|
149
257
|
render: () => (
|
|
150
258
|
<div className="w-[640px] space-y-4">
|
|
@@ -177,6 +177,52 @@ export const Intents: Story = {
|
|
|
177
177
|
),
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Diagonal stripe overlay on the indicator fill. Stripes are a semi-transparent
|
|
182
|
+
* white so they read on every intent without hardcoded colors. Use striped to
|
|
183
|
+
* signal "in progress / active" state — never as the sole status signal; always
|
|
184
|
+
* pair with a label or aria-label naming the state.
|
|
185
|
+
*/
|
|
186
|
+
export const Striped: Story = {
|
|
187
|
+
args: { value: 55, striped: true, label: "Processing tokens", showValue: true },
|
|
188
|
+
render: (args) => (
|
|
189
|
+
<div className="w-72">
|
|
190
|
+
<Progress {...args} />
|
|
191
|
+
</div>
|
|
192
|
+
),
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Animated stripe sweeps the pattern left→right on an ambient loop. Reduced-
|
|
197
|
+
* motion users see a static stripe — the base layer collapses animation-duration
|
|
198
|
+
* to 0.01ms so the visual distinction is preserved without vestibular risk.
|
|
199
|
+
* `animated` only fires when `striped` is also true.
|
|
200
|
+
*/
|
|
201
|
+
export const Animated: Story = {
|
|
202
|
+
args: { value: 40, striped: true, animated: true, label: "Uploading brand-fonts.woff2", showValue: true },
|
|
203
|
+
render: (args) => (
|
|
204
|
+
<div className="w-72">
|
|
205
|
+
<Progress {...args} />
|
|
206
|
+
</div>
|
|
207
|
+
),
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Striped across every intent. The semi-transparent white overlay reads on
|
|
212
|
+
* default, success, warning, error, and info fills without adjustment.
|
|
213
|
+
*/
|
|
214
|
+
export const StripedIntents: Story = {
|
|
215
|
+
render: () => (
|
|
216
|
+
<div className="w-72 space-y-4">
|
|
217
|
+
<Progress value={60} striped aria-label="Default striped" />
|
|
218
|
+
<Progress value={60} striped intent="success" label="Deployment" showValue />
|
|
219
|
+
<Progress value={60} striped intent="warning" label="Disk quota" showValue />
|
|
220
|
+
<Progress value={60} striped intent="error" label="Build failed" showValue />
|
|
221
|
+
<Progress value={60} striped intent="info" label="Syncing tokens" showValue />
|
|
222
|
+
</div>
|
|
223
|
+
),
|
|
224
|
+
};
|
|
225
|
+
|
|
180
226
|
export const RealisticUse: Story = {
|
|
181
227
|
render: () => (
|
|
182
228
|
<div className="w-72 space-y-6">
|
|
@@ -30,6 +30,46 @@ export const Disabled: Story = {
|
|
|
30
30
|
),
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
export const Size_Sm: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
36
|
+
<div className="flex items-center gap-2"><RadioGroupItem size="sm" value="default" id="rs1" /><Label htmlFor="rs1">Default</Label></div>
|
|
37
|
+
<div className="flex items-center gap-2"><RadioGroupItem size="sm" value="comfortable" id="rs2" /><Label htmlFor="rs2">Comfortable</Label></div>
|
|
38
|
+
<div className="flex items-center gap-2"><RadioGroupItem size="sm" value="compact" id="rs3" /><Label htmlFor="rs3">Compact</Label></div>
|
|
39
|
+
</RadioGroup>
|
|
40
|
+
),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Size_Default: Story = {
|
|
44
|
+
render: () => (
|
|
45
|
+
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
46
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="rsd1" /><Label htmlFor="rsd1">Default</Label></div>
|
|
47
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="rsd2" /><Label htmlFor="rsd2">Comfortable</Label></div>
|
|
48
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="compact" id="rsd3" /><Label htmlFor="rsd3">Compact</Label></div>
|
|
49
|
+
</RadioGroup>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Size_Lg: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
56
|
+
<div className="flex items-center gap-2"><RadioGroupItem size="lg" value="default" id="rl1" /><Label htmlFor="rl1">Default</Label></div>
|
|
57
|
+
<div className="flex items-center gap-2"><RadioGroupItem size="lg" value="comfortable" id="rl2" /><Label htmlFor="rl2">Comfortable</Label></div>
|
|
58
|
+
<div className="flex items-center gap-2"><RadioGroupItem size="lg" value="compact" id="rl3" /><Label htmlFor="rl3">Compact</Label></div>
|
|
59
|
+
</RadioGroup>
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Horizontal: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<RadioGroup orientation="horizontal" defaultValue="comfortable">
|
|
66
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="rh1" /><Label htmlFor="rh1">Default</Label></div>
|
|
67
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="rh2" /><Label htmlFor="rh2">Comfortable</Label></div>
|
|
68
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="compact" id="rh3" /><Label htmlFor="rh3">Compact</Label></div>
|
|
69
|
+
</RadioGroup>
|
|
70
|
+
),
|
|
71
|
+
};
|
|
72
|
+
|
|
33
73
|
export const RealisticUse: Story = {
|
|
34
74
|
render: () => (<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
35
75
|
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="r1" /><Label htmlFor="r1">Default</Label></div>
|
|
@@ -35,15 +35,20 @@ export const Disabled: Story = {
|
|
|
35
35
|
export const Sizes: Story = {
|
|
36
36
|
render: () => (
|
|
37
37
|
<div className="flex items-center gap-8">
|
|
38
|
+
<div className="flex flex-col items-center gap-3">
|
|
39
|
+
<span className="text-xs text-muted-foreground">Small</span>
|
|
40
|
+
<Switch size="sm" aria-label="Small off" />
|
|
41
|
+
<Switch size="sm" aria-label="Small on" defaultChecked />
|
|
42
|
+
</div>
|
|
38
43
|
<div className="flex flex-col items-center gap-3">
|
|
39
44
|
<span className="text-xs text-muted-foreground">Default</span>
|
|
40
45
|
<Switch aria-label="Default off" />
|
|
41
46
|
<Switch aria-label="Default on" defaultChecked />
|
|
42
47
|
</div>
|
|
43
48
|
<div className="flex flex-col items-center gap-3">
|
|
44
|
-
<span className="text-xs text-muted-foreground">
|
|
45
|
-
<Switch size="
|
|
46
|
-
<Switch size="
|
|
49
|
+
<span className="text-xs text-muted-foreground">Large</span>
|
|
50
|
+
<Switch size="lg" aria-label="Large off" />
|
|
51
|
+
<Switch size="lg" aria-label="Large on" defaultChecked />
|
|
47
52
|
</div>
|
|
48
53
|
</div>
|
|
49
54
|
),
|
|
@@ -24,6 +24,65 @@ export const Default: Story = {
|
|
|
24
24
|
</Table>),
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
const teamRows = [
|
|
28
|
+
{ name: "Avery Castillo", dept: "Core", role: "Staff engineer", prs: "48" },
|
|
29
|
+
{ name: "Seo-yun Park", dept: "Web", role: "Design engineer", prs: "41" },
|
|
30
|
+
{ name: "Priya Raman", dept: "Web", role: "Senior engineer", prs: "37" },
|
|
31
|
+
{ name: "Marcus Lindqvist", dept: "Platform", role: "Engineer", prs: "29" },
|
|
32
|
+
{ name: "Chloé Dubois-Martin", dept: "Core", role: "Design engineer", prs: "24" },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
function TeamTable({ striped, bordered, compact }: { striped?: boolean; bordered?: boolean; compact?: boolean }) {
|
|
36
|
+
return (
|
|
37
|
+
<Table className="w-[520px]" striped={striped} bordered={bordered} compact={compact}>
|
|
38
|
+
<TableCaption>Design System Team — Q3 contributions</TableCaption>
|
|
39
|
+
<TableHeader>
|
|
40
|
+
<TableRow>
|
|
41
|
+
<TableHead>Contributor</TableHead>
|
|
42
|
+
<TableHead>Team</TableHead>
|
|
43
|
+
<TableHead>Role</TableHead>
|
|
44
|
+
<TableHead className="text-right">PRs</TableHead>
|
|
45
|
+
</TableRow>
|
|
46
|
+
</TableHeader>
|
|
47
|
+
<TableBody>
|
|
48
|
+
{teamRows.map((r) => (
|
|
49
|
+
<TableRow key={r.name}>
|
|
50
|
+
<TableCell className="font-medium">{r.name}</TableCell>
|
|
51
|
+
<TableCell className="text-muted-foreground">{r.dept}</TableCell>
|
|
52
|
+
<TableCell>{r.role}</TableCell>
|
|
53
|
+
<TableCell className="text-right tabular-nums">{r.prs}</TableCell>
|
|
54
|
+
</TableRow>
|
|
55
|
+
))}
|
|
56
|
+
</TableBody>
|
|
57
|
+
</Table>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** striped: even body rows sit on bg-muted/30. Body-only — a multi-row header never stripes. Visual scanability aid, never the sole carrier of meaning. */
|
|
62
|
+
export const Striped: Story = {
|
|
63
|
+
render: () => <TeamTable striped />,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** bordered: rounded outer border on the scroll container + column separators between cells. */
|
|
67
|
+
export const Bordered: Story = {
|
|
68
|
+
render: () => <TeamTable bordered />,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** compact: h-8 header cells, py-1 body cells — dense data-only rows (~32px). CTAs inside a compact row keep their own min-h-11. */
|
|
72
|
+
export const Compact: Story = {
|
|
73
|
+
render: () => <TeamTable compact />,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** The variants compose — stripes inside a bordered frame. */
|
|
77
|
+
export const StripedBordered: Story = {
|
|
78
|
+
render: () => <TeamTable striped bordered />,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** Dense zebra table — the admin-list register (Mantine striped + MUI size="small" equivalent). */
|
|
82
|
+
export const CompactStriped: Story = {
|
|
83
|
+
render: () => <TeamTable compact striped />,
|
|
84
|
+
};
|
|
85
|
+
|
|
27
86
|
export const RealisticUse: Story = {
|
|
28
87
|
render: () => (<Table className="w-[480px]">
|
|
29
88
|
<TableCaption>Recent invoices.</TableCaption>
|
|
@@ -46,6 +105,35 @@ export const RealisticUse: Story = {
|
|
|
46
105
|
* are unreachable without a pointer. Keep this story wide-in-a-narrow-box so
|
|
47
106
|
* the a11y suite covers the case that actually regresses.
|
|
48
107
|
*/
|
|
108
|
+
/**
|
|
109
|
+
* wrapperClassName + wrapperStyle: the Table's scroll-container div now accepts
|
|
110
|
+
* extra classes and inline styles. Primary consumer is DataTable's stickyHeader
|
|
111
|
+
* prop, which injects overflow-y-auto + maxHeight. Verify the props reach the
|
|
112
|
+
* container — not the <table> element — so the scroll boundary is correct.
|
|
113
|
+
*/
|
|
114
|
+
export const WithWrapperProps: Story = {
|
|
115
|
+
render: () => (
|
|
116
|
+
<Table
|
|
117
|
+
className="w-[480px]"
|
|
118
|
+
wrapperClassName="overflow-y-auto"
|
|
119
|
+
wrapperStyle={{ maxHeight: "120px" }}
|
|
120
|
+
>
|
|
121
|
+
<TableHeader className="sticky top-0 z-10 bg-white dark:bg-neutral-950">
|
|
122
|
+
<TableRow><TableHead>Invoice</TableHead><TableHead>Status</TableHead><TableHead className="text-right">Amount</TableHead></TableRow>
|
|
123
|
+
</TableHeader>
|
|
124
|
+
<TableBody>
|
|
125
|
+
{["INV001","INV002","INV003","INV004","INV005"].map((inv, i) => (
|
|
126
|
+
<TableRow key={inv}>
|
|
127
|
+
<TableCell>{inv}</TableCell>
|
|
128
|
+
<TableCell>{i % 2 === 0 ? "Paid" : "Pending"}</TableCell>
|
|
129
|
+
<TableCell className="text-right tabular-nums">${(i + 1) * 75}.00</TableCell>
|
|
130
|
+
</TableRow>
|
|
131
|
+
))}
|
|
132
|
+
</TableBody>
|
|
133
|
+
</Table>
|
|
134
|
+
),
|
|
135
|
+
};
|
|
136
|
+
|
|
49
137
|
export const WideOverflowing: Story = {
|
|
50
138
|
render: () => (
|
|
51
139
|
<div className="w-[380px]">
|
|
@@ -66,6 +66,42 @@ export const ShowCountAtLimit: Story = {
|
|
|
66
66
|
),
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
export const Size_Sm: Story = {
|
|
70
|
+
render: () => (
|
|
71
|
+
<div className="flex flex-col gap-2 w-[320px]">
|
|
72
|
+
<Label htmlFor="msg-sm">Notes (sm)</Label>
|
|
73
|
+
<Textarea id="msg-sm" size="sm" placeholder="Brief note…" />
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Size_Default: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<div className="flex flex-col gap-2 w-[320px]">
|
|
81
|
+
<Label htmlFor="msg-default">Message (default)</Label>
|
|
82
|
+
<Textarea id="msg-default" placeholder="Tell us what's on your mind." />
|
|
83
|
+
</div>
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const Size_Lg: Story = {
|
|
88
|
+
render: () => (
|
|
89
|
+
<div className="flex flex-col gap-2 w-[320px]">
|
|
90
|
+
<Label htmlFor="msg-lg">Description (lg)</Label>
|
|
91
|
+
<Textarea id="msg-lg" size="lg" placeholder="Describe your project in a few sentences." />
|
|
92
|
+
</div>
|
|
93
|
+
),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const Size_Xl: Story = {
|
|
97
|
+
render: () => (
|
|
98
|
+
<div className="flex flex-col gap-2 w-[320px]">
|
|
99
|
+
<Label htmlFor="msg-xl">Long-form content (xl)</Label>
|
|
100
|
+
<Textarea id="msg-xl" size="xl" placeholder="Write something substantial…" />
|
|
101
|
+
</div>
|
|
102
|
+
),
|
|
103
|
+
};
|
|
104
|
+
|
|
69
105
|
export const RealisticUse: Story = {
|
|
70
106
|
render: () => (
|
|
71
107
|
<div className="flex flex-col gap-2 w-[320px]">
|
package/src/styles.css
CHANGED
|
@@ -763,6 +763,35 @@ html, body {
|
|
|
763
763
|
animation: skeleton-wave var(--skeleton-wave-duration, 2s) linear infinite;
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
+
/* Progress — striped and animated variants
|
|
767
|
+
Striped: diagonal 45° repeating-linear-gradient overlay on the indicator
|
|
768
|
+
fill. Stripe color is a semi-transparent white so it reads on every intent
|
|
769
|
+
(default/success/warning/error/info) without hardcoded values, and tracks
|
|
770
|
+
the brand primary in dark mode automatically.
|
|
771
|
+
Animated: adds an ambient left→right sweep on the stripe pattern (same
|
|
772
|
+
linear timing as skeleton-wave — easing would lurch on a seamless loop).
|
|
773
|
+
--progress-stripe-duration is consumer-tunable (default 1s).
|
|
774
|
+
Reduced motion: base layer collapses animation-duration to 0.01ms so the
|
|
775
|
+
stripe freezes to a static pattern — striped but not moving. That keeps the
|
|
776
|
+
visual distinction without vestibular risk. */
|
|
777
|
+
@keyframes progress-stripe {
|
|
778
|
+
from { background-position: 1rem 0; }
|
|
779
|
+
to { background-position: 0 0; }
|
|
780
|
+
}
|
|
781
|
+
[data-slot="progress-indicator"][data-striped="true"] {
|
|
782
|
+
background-image: repeating-linear-gradient(
|
|
783
|
+
45deg,
|
|
784
|
+
transparent,
|
|
785
|
+
transparent 0.375rem,
|
|
786
|
+
color-mix(in oklab, white, transparent 70%) 0.375rem,
|
|
787
|
+
color-mix(in oklab, white, transparent 70%) 0.75rem
|
|
788
|
+
);
|
|
789
|
+
background-size: 1rem 1rem;
|
|
790
|
+
}
|
|
791
|
+
[data-slot="progress-indicator"][data-animated="true"] {
|
|
792
|
+
animation: progress-stripe var(--progress-stripe-duration, 1s) linear infinite;
|
|
793
|
+
}
|
|
794
|
+
|
|
766
795
|
/* Prose — long-form typographic rhythm for arbitrary HTML descendants
|
|
767
796
|
(MDX output, CMS articles, rendered markdown). Keyed off the .prose
|
|
768
797
|
class the Prose primitive (data-slot="prose") applies — same
|