@behavioral-agentic-design-system/core 0.34.0 → 0.36.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 +220 -0
- package/scripts/lint-token-intent.mjs +128 -0
- package/src/app/preview/components/page.tsx +132 -0
- package/src/components/home-tab.tsx +43 -12
- package/src/components/ui/data-table.tsx +20 -2
- package/src/components/ui/input.tsx +13 -2
- 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/DataTable.stories.tsx +38 -0
- package/src/stories/Input.stories.tsx +54 -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
|
@@ -1,76 +1,92 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
|
|
3
2
|
import * as React from "react"
|
|
4
|
-
|
|
5
3
|
import { cn } from "../../lib/utils"
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
interface TableVariantContextValue {
|
|
6
|
+
striped: boolean
|
|
7
|
+
bordered: boolean
|
|
8
|
+
compact: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const TableVariantContext = React.createContext<TableVariantContextValue>({
|
|
12
|
+
striped: false,
|
|
13
|
+
bordered: false,
|
|
14
|
+
compact: false,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
type TableSection = "header" | "body" | "footer"
|
|
18
|
+
|
|
19
|
+
const TableSectionContext = React.createContext<TableSection>("body")
|
|
20
|
+
|
|
21
|
+
interface TableProps extends React.ComponentProps<"table"> {
|
|
22
|
+
wrapperClassName?: string
|
|
23
|
+
wrapperStyle?: React.CSSProperties
|
|
24
|
+
/** Zebra-stripe even body rows (bg-muted/30) for scanability on wide tables. Visual only — never the sole carrier of meaning. */
|
|
25
|
+
striped?: boolean
|
|
26
|
+
/** Draw a rounded outer border on the scroll container plus column separators between cells. */
|
|
27
|
+
bordered?: boolean
|
|
28
|
+
/** Reduced vertical density: h-8 header cells, py-1 body cells. For data-only rows — a flow-changing CTA inside a compact row keeps its own min-h-11. */
|
|
29
|
+
compact?: boolean
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Table({ className, wrapperClassName, wrapperStyle, striped = false, bordered = false, compact = false, ...props }: TableProps) {
|
|
33
|
+
const variants = React.useMemo(() => ({ striped, bordered, compact }), [striped, bordered, compact])
|
|
8
34
|
return (
|
|
9
|
-
<
|
|
10
|
-
data-slot="table-container"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className={cn("w-full caption-bottom text-sm", className)}
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
35
|
+
<TableVariantContext.Provider value={variants}>
|
|
36
|
+
<div data-slot="table-container" tabIndex={0}
|
|
37
|
+
className={cn(
|
|
38
|
+
"relative w-full overflow-x-auto scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent",
|
|
39
|
+
bordered && "rounded-md border",
|
|
40
|
+
wrapperClassName
|
|
41
|
+
)}
|
|
42
|
+
style={wrapperStyle}
|
|
43
|
+
>
|
|
44
|
+
<table
|
|
45
|
+
data-slot="table"
|
|
46
|
+
data-striped={striped ? "" : undefined}
|
|
47
|
+
data-bordered={bordered ? "" : undefined}
|
|
48
|
+
data-compact={compact ? "" : undefined}
|
|
49
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</TableVariantContext.Provider>
|
|
32
54
|
)
|
|
33
55
|
}
|
|
34
56
|
|
|
35
57
|
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
36
58
|
return (
|
|
37
|
-
<
|
|
38
|
-
data-slot="table-header"
|
|
39
|
-
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
59
|
+
<TableSectionContext.Provider value="header">
|
|
60
|
+
<thead data-slot="table-header" className={cn("[&_tr]:border-b", className)} {...props} />
|
|
61
|
+
</TableSectionContext.Provider>
|
|
42
62
|
)
|
|
43
63
|
}
|
|
44
64
|
|
|
45
65
|
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
46
66
|
return (
|
|
47
|
-
<
|
|
48
|
-
data-slot="table-body"
|
|
49
|
-
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
67
|
+
<TableSectionContext.Provider value="body">
|
|
68
|
+
<tbody data-slot="table-body" className={cn("[&_tr:last-child]:border-0", className)} {...props} />
|
|
69
|
+
</TableSectionContext.Provider>
|
|
52
70
|
)
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
56
74
|
return (
|
|
57
|
-
<
|
|
58
|
-
data-slot="table-footer"
|
|
59
|
-
|
|
60
|
-
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
61
|
-
className
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
75
|
+
<TableSectionContext.Provider value="footer">
|
|
76
|
+
<tfoot data-slot="table-footer" className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)} {...props} />
|
|
77
|
+
</TableSectionContext.Provider>
|
|
65
78
|
)
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
82
|
+
const { striped } = React.useContext(TableVariantContext)
|
|
83
|
+
const section = React.useContext(TableSectionContext)
|
|
69
84
|
return (
|
|
70
85
|
<tr
|
|
71
86
|
data-slot="table-row"
|
|
72
87
|
className={cn(
|
|
73
88
|
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
89
|
+
striped && section === "body" && "even:bg-muted/30",
|
|
74
90
|
className
|
|
75
91
|
)}
|
|
76
92
|
{...props}
|
|
@@ -79,11 +95,14 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
98
|
+
const { bordered, compact } = React.useContext(TableVariantContext)
|
|
82
99
|
return (
|
|
83
100
|
<th
|
|
84
101
|
data-slot="table-head"
|
|
85
102
|
className={cn(
|
|
86
|
-
"h-
|
|
103
|
+
compact ? "h-8" : "h-10",
|
|
104
|
+
"px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
105
|
+
bordered && "border-r last:border-r-0",
|
|
87
106
|
className
|
|
88
107
|
)}
|
|
89
108
|
{...props}
|
|
@@ -92,11 +111,14 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
|
92
111
|
}
|
|
93
112
|
|
|
94
113
|
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
114
|
+
const { bordered, compact } = React.useContext(TableVariantContext)
|
|
95
115
|
return (
|
|
96
116
|
<td
|
|
97
117
|
data-slot="table-cell"
|
|
98
118
|
className={cn(
|
|
99
|
-
"
|
|
119
|
+
compact ? "px-2 py-1" : "p-2",
|
|
120
|
+
"align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
121
|
+
bordered && "border-r last:border-r-0",
|
|
100
122
|
className
|
|
101
123
|
)}
|
|
102
124
|
{...props}
|
|
@@ -104,26 +126,8 @@ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
|
104
126
|
)
|
|
105
127
|
}
|
|
106
128
|
|
|
107
|
-
function TableCaption({
|
|
108
|
-
className,
|
|
109
|
-
...props
|
|
110
|
-
}: React.ComponentProps<"caption">) {
|
|
111
|
-
return (
|
|
112
|
-
<caption
|
|
113
|
-
data-slot="table-caption"
|
|
114
|
-
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
115
|
-
{...props}
|
|
116
|
-
/>
|
|
117
|
-
)
|
|
129
|
+
function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
|
|
130
|
+
return <caption data-slot="table-caption" className={cn("mt-4 text-sm text-muted-foreground", className)} {...props} />
|
|
118
131
|
}
|
|
119
132
|
|
|
120
|
-
export {
|
|
121
|
-
Table,
|
|
122
|
-
TableHeader,
|
|
123
|
-
TableBody,
|
|
124
|
-
TableFooter,
|
|
125
|
-
TableHead,
|
|
126
|
-
TableRow,
|
|
127
|
-
TableCell,
|
|
128
|
-
TableCaption,
|
|
129
|
-
}
|
|
133
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }
|
|
@@ -4,10 +4,28 @@
|
|
|
4
4
|
// a server component at all. See the note in button.tsx for why the components
|
|
5
5
|
// that merely forward an optional callback are left server-renderable.
|
|
6
6
|
import * as React from "react"
|
|
7
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
7
8
|
|
|
8
9
|
import { cn } from "../../lib/utils"
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const textareaVariants = cva(
|
|
12
|
+
"flex field-sizing-content w-full rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: "min-h-14 px-2.5 py-1.5 text-sm",
|
|
17
|
+
default: "min-h-16 px-3 py-2 text-base md:text-sm",
|
|
18
|
+
lg: "min-h-20 px-4 py-2.5 text-base",
|
|
19
|
+
xl: "min-h-24 px-5 py-3 text-lg",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { size: "default" },
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
interface TextareaProps
|
|
27
|
+
extends React.ComponentProps<"textarea">,
|
|
28
|
+
VariantProps<typeof textareaVariants> {
|
|
11
29
|
/** Show a character count below the textarea. Default false. */
|
|
12
30
|
showCount?: boolean
|
|
13
31
|
/**
|
|
@@ -22,6 +40,7 @@ interface TextareaProps extends React.ComponentProps<"textarea"> {
|
|
|
22
40
|
|
|
23
41
|
function Textarea({
|
|
24
42
|
className,
|
|
43
|
+
size,
|
|
25
44
|
showCount = false,
|
|
26
45
|
maxLength,
|
|
27
46
|
countId,
|
|
@@ -50,10 +69,7 @@ function Textarea({
|
|
|
50
69
|
data-slot="textarea"
|
|
51
70
|
maxLength={maxLength}
|
|
52
71
|
aria-describedby={showCount ? resolvedCountId : undefined}
|
|
53
|
-
className={cn(
|
|
54
|
-
"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
55
|
-
className
|
|
56
|
-
)}
|
|
72
|
+
className={cn(textareaVariants({ size }), className)}
|
|
57
73
|
value={value}
|
|
58
74
|
defaultValue={defaultValue}
|
|
59
75
|
onChange={handleChange}
|
|
@@ -83,5 +99,5 @@ function Textarea({
|
|
|
83
99
|
)
|
|
84
100
|
}
|
|
85
101
|
|
|
86
|
-
export { Textarea }
|
|
102
|
+
export { Textarea, textareaVariants }
|
|
87
103
|
export type { TextareaProps }
|
package/src/data/docs-index.ts
CHANGED
|
@@ -209,6 +209,8 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
209
209
|
{ title: "Spec — skill package", path: "docs/specs/2026-08-21-skill-package.md", summary: "The durable contract for packages/skill: generated-only output, usage-focused recipes, ≤2k-word SKILL.md, deterministic builds, the check:skill staleness gate, and the eval --context=skill acceptance instrument." },
|
|
210
210
|
{ title: "Plan — self-healing layer", path: "docs/plans/2026-08-21-self-healing-layer.md", summary: "Approved plan: the watch-half of the system — drift ledger, token intent validator, component health score, and a Health surface, assembled from signals BADS already owns; runtime telemetry deliberately deferred behind consent + futures-check." },
|
|
211
211
|
{ title: "Spec — self-healing layer", path: "docs/specs/2026-08-21-self-healing-layer.md", summary: "Phase A contract: informational-only health score (Goodhart guard), no runtime telemetry, deterministic visible-copy intent rules, drift-ledger status convention, and the calibration record (6→0 false positives; two scoring bugs caught by face-checking)." },
|
|
212
|
+
{ title: "Plan — drift elimination", path: "docs/plans/2026-08-31-drift-elimination.md", summary: "Closing the loop between upstream, client forks, and prototype repos. Built on the one artifact every working template-sync tool shares: a committed record of which upstream version a downstream copy is layered on. Three phases ordered by risk — additive checks, then PR-gated fork sync, then the deferred structural calls." },
|
|
213
|
+
{ title: "Spec — drift elimination", path: "docs/specs/2026-08-31-drift-elimination.md", summary: "Phase A contract: precision over recall (unverifiable is never reported as drift), advisory-by-default with one blocking generated-artifact gate, additive-only sync manifest, and declared expected-drift allowlists. Calibration: 51→0 false positives on the registry checker, and real drift caught including llms.txt advertising 79 components when there were 173." },
|
|
212
214
|
],
|
|
213
215
|
},
|
|
214
216
|
];
|
|
@@ -253,6 +253,44 @@ const REALISTIC_COLUMNS: ColumnDef<ComponentRow>[] = [
|
|
|
253
253
|
{ accessorKey: "lastUpdated", header: "Last Updated" },
|
|
254
254
|
];
|
|
255
255
|
|
|
256
|
+
// ---------------------------------------------------------------------------
|
|
257
|
+
// StickyHeader — header stays visible as rows scroll
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
259
|
+
|
|
260
|
+
export const StickyHeader: Story = {
|
|
261
|
+
render: () => (
|
|
262
|
+
<DataTable
|
|
263
|
+
columns={ADOPTION_COLUMNS}
|
|
264
|
+
data={ADOPTION_DATA}
|
|
265
|
+
stickyHeader
|
|
266
|
+
scrollHeight="260px"
|
|
267
|
+
/>
|
|
268
|
+
),
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
// ---------------------------------------------------------------------------
|
|
272
|
+
// WideOverflowing — a min-width table in a constrained wrapper (scroll test)
|
|
273
|
+
// ---------------------------------------------------------------------------
|
|
274
|
+
|
|
275
|
+
export const WideOverflowing: Story = {
|
|
276
|
+
render: () => (
|
|
277
|
+
<div className="w-[380px]">
|
|
278
|
+
<DataTable
|
|
279
|
+
columns={[
|
|
280
|
+
{ accessorKey: "component", header: "Component", size: 200 },
|
|
281
|
+
{ accessorKey: "status", header: "Status", size: 120 },
|
|
282
|
+
{ accessorKey: "adopters", header: "Adopters", size: 100 },
|
|
283
|
+
{ accessorKey: "coverage", header: "Coverage", size: 100 },
|
|
284
|
+
{ accessorKey: "lastUpdated", header: "Last Updated", size: 140 },
|
|
285
|
+
]}
|
|
286
|
+
data={ADOPTION_DATA.slice(0, 6)}
|
|
287
|
+
stickyHeader
|
|
288
|
+
scrollHeight="200px"
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
),
|
|
292
|
+
};
|
|
293
|
+
|
|
256
294
|
export const RealisticUse: Story = {
|
|
257
295
|
render: () => (
|
|
258
296
|
<div className="space-y-2">
|
|
@@ -66,6 +66,60 @@ export const WithError: Story = {
|
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
export const Variant_Ghost: Story = {
|
|
70
|
+
name: "Variant: Ghost (inline edit)",
|
|
71
|
+
render: () => {
|
|
72
|
+
const [value, setValue] = React.useState("Amara Okafor");
|
|
73
|
+
return (
|
|
74
|
+
<div className="flex w-72 flex-col gap-4">
|
|
75
|
+
<Input
|
|
76
|
+
variant="ghost"
|
|
77
|
+
type="search"
|
|
78
|
+
aria-label="Search projects"
|
|
79
|
+
placeholder="Search projects…"
|
|
80
|
+
leftSection={<SearchIcon size={16} strokeWidth={1.5} aria-hidden="true" />}
|
|
81
|
+
/>
|
|
82
|
+
<Input
|
|
83
|
+
variant="ghost"
|
|
84
|
+
aria-label="Assignee name"
|
|
85
|
+
value={value}
|
|
86
|
+
onChange={(e) => setValue(e.target.value)}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const Variant_Filled: Story = {
|
|
94
|
+
name: "Variant: Filled",
|
|
95
|
+
render: () => {
|
|
96
|
+
const [value, setValue] = React.useState("maya.chen@lumenworks.studio");
|
|
97
|
+
return (
|
|
98
|
+
<div className="flex w-72 flex-col gap-4">
|
|
99
|
+
<Input variant="filled" aria-label="Filter by name" placeholder="Filter by name" />
|
|
100
|
+
<Input
|
|
101
|
+
variant="filled"
|
|
102
|
+
type="email"
|
|
103
|
+
aria-label="Work email"
|
|
104
|
+
value={value}
|
|
105
|
+
onChange={(e) => setValue(e.target.value)}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const Variant_AllThree: Story = {
|
|
113
|
+
name: "Variant: outline / ghost / filled",
|
|
114
|
+
render: () => (
|
|
115
|
+
<div className="flex w-72 flex-col gap-4">
|
|
116
|
+
<Input variant="outline" aria-label="Outline variant" placeholder="Search projects…" />
|
|
117
|
+
<Input variant="ghost" aria-label="Ghost variant" placeholder="Search projects…" />
|
|
118
|
+
<Input variant="filled" aria-label="Filled variant" placeholder="Search projects…" />
|
|
119
|
+
</div>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
69
123
|
export const Variant_WithLeftIcon: Story = {
|
|
70
124
|
name: "Variant: With left icon",
|
|
71
125
|
args: {
|
|
@@ -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
|
),
|