@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
|
@@ -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
|