@behavioral-agentic-design-system/core 0.27.0 → 0.29.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 +5 -5
- package/scripts/a11y-lint.cjs +78 -9
- package/scripts/build-tokens.cjs +273 -15
- package/scripts/wcag-audit.cjs +37 -7
- package/src/api/layers/file.ts +1 -0
- package/src/app/font-ready.tsx +6 -5
- package/src/app/layout.tsx +54 -3
- package/src/app/preview/components/page.tsx +5735 -2500
- package/src/app/preview/layout.tsx +4 -1
- package/src/app/preview/showcase-filter.tsx +66 -0
- package/src/app/preview/tab-replay.tsx +63 -0
- package/src/app/shell.tsx +91 -18
- package/src/components/customize/save-bar.tsx +19 -6
- package/src/components/docs-tab.tsx +36 -24
- package/src/components/layers-tab.tsx +37 -5
- package/src/components/ui/ai-badge.tsx +74 -0
- package/src/components/ui/alert.tsx +12 -0
- package/src/components/ui/badge.tsx +19 -0
- package/src/components/ui/chat-bubble.tsx +298 -0
- package/src/components/ui/chat-marker.tsx +120 -0
- package/src/components/ui/checkbox.tsx +9 -1
- package/src/components/ui/clipboard.tsx +291 -0
- package/src/components/ui/close-button.tsx +71 -0
- package/src/components/ui/combobox.tsx +62 -3
- package/src/components/ui/container.tsx +65 -0
- package/src/components/ui/copy-button.tsx +5 -1
- package/src/components/ui/data-table.tsx +388 -0
- package/src/components/ui/date-field.tsx +368 -0
- package/src/components/ui/drawer.tsx +334 -0
- package/src/components/ui/file-button.tsx +145 -0
- package/src/components/ui/floating-indicator.tsx +217 -0
- package/src/components/ui/focus-trap.tsx +184 -0
- package/src/components/ui/format-byte.tsx +113 -0
- package/src/components/ui/index.ts +28 -0
- package/src/components/ui/input.tsx +38 -3
- package/src/components/ui/keyboard-shortcut.tsx +146 -0
- package/src/components/ui/loading-dots.tsx +99 -0
- package/src/components/ui/mark.tsx +69 -0
- package/src/components/ui/month-picker.tsx +296 -0
- package/src/components/ui/multi-select.tsx +15 -13
- package/src/components/ui/nav-link.tsx +200 -0
- package/src/components/ui/navigation-rail.tsx +256 -0
- package/src/components/ui/notification.tsx +20 -0
- package/src/components/ui/password-input.tsx +34 -1
- package/src/components/ui/progress.tsx +15 -1
- package/src/components/ui/prose.tsx +62 -0
- package/src/components/ui/result.tsx +151 -0
- package/src/components/ui/rolling-number.tsx +201 -0
- package/src/components/ui/simple-grid.tsx +110 -0
- package/src/components/ui/skeleton.tsx +52 -3
- package/src/components/ui/squircle.tsx +274 -0
- package/src/components/ui/stack.tsx +105 -0
- package/src/components/ui/status-badge.tsx +93 -0
- package/src/components/ui/tabs.tsx +34 -7
- package/src/components/ui/tag.tsx +46 -5
- package/src/components/ui/theme-icon.tsx +138 -0
- package/src/components/ui/timeline.tsx +27 -10
- package/src/components/ui/tooltip.tsx +12 -1
- package/src/components/ui/tree-select.tsx +386 -0
- package/src/components/ui/typing-indicator.tsx +2 -2
- package/src/components/ui/word-rotate.tsx +6 -1
- package/src/components/ui/year-picker.tsx +307 -0
- package/src/data/docs-index.ts +10 -0
- package/src/hooks/use-global-primary-color.ts +57 -6
- package/src/stories/AiBadge.stories.tsx +67 -0
- package/src/stories/Alert.stories.tsx +31 -1
- package/src/stories/Badge.stories.tsx +63 -6
- package/src/stories/ChatBubble.stories.tsx +222 -0
- package/src/stories/ChatMarker.stories.tsx +59 -0
- package/src/stories/Checkbox.stories.tsx +5 -0
- package/src/stories/Clipboard.stories.tsx +136 -0
- package/src/stories/CloseButton.stories.tsx +65 -0
- package/src/stories/Combobox.stories.tsx +74 -3
- package/src/stories/Container.stories.tsx +134 -0
- package/src/stories/CopyButton.stories.tsx +2 -0
- package/src/stories/DataTable.stories.tsx +271 -0
- package/src/stories/DateField.stories.tsx +114 -0
- package/src/stories/Drawer.stories.tsx +211 -0
- package/src/stories/FileButton.stories.tsx +117 -0
- package/src/stories/FloatingIndicator.stories.tsx +343 -0
- package/src/stories/FocusTrap.stories.tsx +218 -0
- package/src/stories/FormatByte.stories.tsx +142 -0
- package/src/stories/Input.stories.tsx +91 -0
- package/src/stories/KeyboardShortcut.stories.tsx +87 -0
- package/src/stories/LoadingDots.stories.tsx +73 -0
- package/src/stories/Mark.stories.tsx +84 -0
- package/src/stories/MonthPicker.stories.tsx +99 -0
- package/src/stories/MultiSelect.stories.tsx +3 -1
- package/src/stories/NavLink.stories.tsx +213 -0
- package/src/stories/NavigationRail.stories.tsx +413 -0
- package/src/stories/Notification.stories.tsx +53 -0
- package/src/stories/PasswordInput.stories.tsx +21 -0
- package/src/stories/Progress.stories.tsx +38 -0
- package/src/stories/Prose.stories.tsx +232 -0
- package/src/stories/Result.stories.tsx +145 -0
- package/src/stories/RollingNumber.stories.tsx +226 -0
- package/src/stories/SimpleGrid.stories.tsx +130 -0
- package/src/stories/Skeleton.stories.tsx +62 -1
- package/src/stories/Squircle.stories.tsx +127 -0
- package/src/stories/Stack.stories.tsx +139 -0
- package/src/stories/StatusBadge.stories.tsx +125 -0
- package/src/stories/Tabs.stories.tsx +56 -1
- package/src/stories/Tag.stories.tsx +31 -0
- package/src/stories/ThemeIcon.stories.tsx +97 -0
- package/src/stories/Timeline.stories.tsx +69 -0
- package/src/stories/Tooltip.stories.tsx +18 -0
- package/src/stories/TreeSelect.stories.tsx +222 -0
- package/src/stories/TypingIndicator.stories.tsx +1 -0
- package/src/stories/WordRotate.stories.tsx +1 -0
- package/src/stories/YearPicker.stories.tsx +100 -0
- package/src/styles.css +289 -15
- package/src/tokens.json +96 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Container } from "@behavioral-agentic-design-system/core/components/ui/container";
|
|
4
|
+
import { Stack } from "@behavioral-agentic-design-system/core/components/ui/stack";
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardHeader,
|
|
10
|
+
CardTitle,
|
|
11
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Container> = {
|
|
14
|
+
title: "Components/Container",
|
|
15
|
+
component: Container,
|
|
16
|
+
parameters: { layout: "fullscreen" },
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
/** Visualizes the container bounds against the viewport. */
|
|
23
|
+
function Bounds({ label }: { label: string }) {
|
|
24
|
+
return (
|
|
25
|
+
<div className="rounded-lg border border-dashed border-border bg-card p-4">
|
|
26
|
+
<p className="text-sm text-muted-foreground">{label}</p>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Default: StoryObj = {
|
|
32
|
+
render: () => (
|
|
33
|
+
<div className="bg-muted/40 py-6">
|
|
34
|
+
<Container>
|
|
35
|
+
<Bounds label='size="lg" (default) — max-w-6xl, centered, px-4 sm:px-6 gutters' />
|
|
36
|
+
</Container>
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Size_Sm: StoryObj = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<div className="bg-muted/40 py-6">
|
|
44
|
+
<Container size="sm">
|
|
45
|
+
<Bounds label='size="sm" — 672px reading column' />
|
|
46
|
+
</Container>
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Size_Md: StoryObj = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<div className="bg-muted/40 py-6">
|
|
54
|
+
<Container size="md">
|
|
55
|
+
<Bounds label='size="md" — 896px, forms and narrow content' />
|
|
56
|
+
</Container>
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Size_Lg: StoryObj = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<div className="bg-muted/40 py-6">
|
|
64
|
+
<Container size="lg">
|
|
65
|
+
<Bounds label='size="lg" — 1152px, standard app content' />
|
|
66
|
+
</Container>
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const Size_Xl: StoryObj = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<div className="bg-muted/40 py-6">
|
|
74
|
+
<Container size="xl">
|
|
75
|
+
<Bounds label='size="xl" — 1280px, wide dashboards' />
|
|
76
|
+
</Container>
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const Size_Full: StoryObj = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<div className="bg-muted/40 py-6">
|
|
84
|
+
<Container size="full">
|
|
85
|
+
<Bounds label='size="full" — no width cap, shared gutters only' />
|
|
86
|
+
</Container>
|
|
87
|
+
</div>
|
|
88
|
+
),
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const NoGutters: StoryObj = {
|
|
92
|
+
render: () => (
|
|
93
|
+
<div className="bg-muted/40 py-6">
|
|
94
|
+
<Container size="md" gutters={false}>
|
|
95
|
+
<Bounds label="gutters={false} — parent already provides page padding" />
|
|
96
|
+
</Container>
|
|
97
|
+
</div>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const RealisticUse: StoryObj = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<div className="bg-muted/40 py-8">
|
|
104
|
+
<Container size="md">
|
|
105
|
+
<Stack gap="lg">
|
|
106
|
+
<div>
|
|
107
|
+
<h2 className="text-2xl font-semibold text-foreground">
|
|
108
|
+
Design system review
|
|
109
|
+
</h2>
|
|
110
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
111
|
+
Tokens v2 proposal — milestone review scheduled for May 26, 2026.
|
|
112
|
+
</p>
|
|
113
|
+
</div>
|
|
114
|
+
<Card>
|
|
115
|
+
<CardHeader>
|
|
116
|
+
<CardTitle>Tokens v2 proposal</CardTitle>
|
|
117
|
+
<CardDescription>
|
|
118
|
+
Jordan Reeves — design-system review milestone ($12,500.00
|
|
119
|
+
retainer).
|
|
120
|
+
</CardDescription>
|
|
121
|
+
</CardHeader>
|
|
122
|
+
<CardContent>
|
|
123
|
+
<p className="text-sm text-muted-foreground">
|
|
124
|
+
The proposal consolidates the spacing scale to eight stops and
|
|
125
|
+
retires four orphaned color tokens flagged in the July audit
|
|
126
|
+
(a11y-audit-findings-2026-07.pdf).
|
|
127
|
+
</p>
|
|
128
|
+
</CardContent>
|
|
129
|
+
</Card>
|
|
130
|
+
</Stack>
|
|
131
|
+
</Container>
|
|
132
|
+
</div>
|
|
133
|
+
),
|
|
134
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// Motion: the copy↔copied swap narrowed transition-all → transition-[opacity,transform] (explicit-properties rule).
|
|
2
|
+
// Types: onCopy is (value: string) => void — the DOM ClipboardEventHandler is Omit-ed
|
|
3
|
+
// from the button props so the callback parameter is a clean string (2026-08-06).
|
|
2
4
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
5
|
import * as React from "react"
|
|
4
6
|
import { CopyButton } from "@behavioral-agentic-design-system/core/components/ui/copy-button"
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import {
|
|
4
|
+
DataTable,
|
|
5
|
+
type ColumnDef,
|
|
6
|
+
} from "@behavioral-agentic-design-system/core/components/ui/data-table";
|
|
7
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
8
|
+
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Meta
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof DataTable> = {
|
|
14
|
+
title: "Components/DataTable",
|
|
15
|
+
component: DataTable,
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: "padded",
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component:
|
|
21
|
+
"Sortable, paginated, optionally selectable data grid. Wraps @tanstack/react-table for state management and exposes a declarative columns + data API. Use for admin tables, report outputs, and any structured dataset with >10 rows. Prefer the bare Table primitive for static reference data.",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
tags: ["autodocs"],
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
// Shared types & data
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
interface TeamMember {
|
|
36
|
+
name: string;
|
|
37
|
+
role: string;
|
|
38
|
+
email: string;
|
|
39
|
+
joined: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const TEAM_MEMBERS: TeamMember[] = [
|
|
43
|
+
{
|
|
44
|
+
name: "Jordan Reeves",
|
|
45
|
+
role: "Design Lead",
|
|
46
|
+
email: "jordan@reeves.design",
|
|
47
|
+
joined: "2024-03-12",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Anika Patel",
|
|
51
|
+
role: "Frontend Engineer",
|
|
52
|
+
email: "anika.patel@bads.design",
|
|
53
|
+
joined: "2024-05-01",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "Marcus Lindqvist",
|
|
57
|
+
role: "Product Manager",
|
|
58
|
+
email: "m.lindqvist@bads.design",
|
|
59
|
+
joined: "2023-11-20",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "Priya Nair",
|
|
63
|
+
role: "Accessibility Specialist",
|
|
64
|
+
email: "priya.nair@bads.design",
|
|
65
|
+
joined: "2025-01-08",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "Theo Okafor",
|
|
69
|
+
role: "Design Technologist",
|
|
70
|
+
email: "theo.okafor@bads.design",
|
|
71
|
+
joined: "2024-09-15",
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const TEAM_COLUMNS: ColumnDef<TeamMember>[] = [
|
|
76
|
+
{ accessorKey: "name", header: "Name" },
|
|
77
|
+
{ accessorKey: "role", header: "Role" },
|
|
78
|
+
{ accessorKey: "email", header: "Email" },
|
|
79
|
+
{ accessorKey: "joined", header: "Joined" },
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
// Default
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
|
|
86
|
+
export const Default: Story = {
|
|
87
|
+
render: () => (
|
|
88
|
+
<DataTable columns={TEAM_COLUMNS} data={TEAM_MEMBERS} />
|
|
89
|
+
),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
// Sortable (explicit prop — same as default since sorting is on by default)
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
export const Sortable: Story = {
|
|
97
|
+
render: () => (
|
|
98
|
+
<DataTable columns={TEAM_COLUMNS} data={TEAM_MEMBERS} sorting={true} />
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// WithPagination (15+ rows)
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
interface ComponentAdoption {
|
|
107
|
+
component: string;
|
|
108
|
+
status: string;
|
|
109
|
+
adopters: number;
|
|
110
|
+
coverage: string;
|
|
111
|
+
lastUpdated: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const ADOPTION_DATA: ComponentAdoption[] = [
|
|
115
|
+
{ component: "Button", status: "Stable", adopters: 14, coverage: "100%", lastUpdated: "2026-07-28" },
|
|
116
|
+
{ component: "Input", status: "Stable", adopters: 13, coverage: "98%", lastUpdated: "2026-07-22" },
|
|
117
|
+
{ component: "Card", status: "Stable", adopters: 12, coverage: "95%", lastUpdated: "2026-07-15" },
|
|
118
|
+
{ component: "Dialog", status: "Stable", adopters: 11, coverage: "91%", lastUpdated: "2026-07-10" },
|
|
119
|
+
{ component: "Table", status: "Stable", adopters: 10, coverage: "88%", lastUpdated: "2026-07-08" },
|
|
120
|
+
{ component: "Badge", status: "Stable", adopters: 9, coverage: "84%", lastUpdated: "2026-07-05" },
|
|
121
|
+
{ component: "Select", status: "Stable", adopters: 9, coverage: "82%", lastUpdated: "2026-07-01" },
|
|
122
|
+
{ component: "Checkbox", status: "Stable", adopters: 8, coverage: "78%", lastUpdated: "2026-06-28" },
|
|
123
|
+
{ component: "Tooltip", status: "Stable", adopters: 8, coverage: "75%", lastUpdated: "2026-06-25" },
|
|
124
|
+
{ component: "Accordion", status: "Stable", adopters: 7, coverage: "70%", lastUpdated: "2026-06-20" },
|
|
125
|
+
{ component: "Sheet", status: "Stable", adopters: 7, coverage: "68%", lastUpdated: "2026-06-18" },
|
|
126
|
+
{ component: "Popover", status: "Stable", adopters: 6, coverage: "64%", lastUpdated: "2026-06-14" },
|
|
127
|
+
{ component: "Tabs", status: "Stable", adopters: 6, coverage: "61%", lastUpdated: "2026-06-10" },
|
|
128
|
+
{ component: "DataTable", status: "New", adopters: 1, coverage: "12%", lastUpdated: "2026-08-03" },
|
|
129
|
+
{ component: "Slider", status: "Beta", adopters: 4, coverage: "42%", lastUpdated: "2026-06-05" },
|
|
130
|
+
{ component: "Calendar", status: "Beta", adopters: 3, coverage: "38%", lastUpdated: "2026-06-02" },
|
|
131
|
+
{ component: "TreeView", status: "Beta", adopters: 2, coverage: "24%", lastUpdated: "2026-05-28" },
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
const ADOPTION_COLUMNS: ColumnDef<ComponentAdoption>[] = [
|
|
135
|
+
{ accessorKey: "component", header: "Component" },
|
|
136
|
+
{ accessorKey: "status", header: "Status" },
|
|
137
|
+
{ accessorKey: "adopters", header: "Adopters" },
|
|
138
|
+
{ accessorKey: "coverage", header: "Coverage" },
|
|
139
|
+
{ accessorKey: "lastUpdated", header: "Last Updated" },
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
export const WithPagination: Story = {
|
|
143
|
+
render: () => (
|
|
144
|
+
<DataTable
|
|
145
|
+
columns={ADOPTION_COLUMNS}
|
|
146
|
+
data={ADOPTION_DATA}
|
|
147
|
+
pagination={{ pageSize: 8 }}
|
|
148
|
+
/>
|
|
149
|
+
),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// ---------------------------------------------------------------------------
|
|
153
|
+
// WithRowSelection
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
export const WithRowSelection: Story = {
|
|
157
|
+
render: () => (
|
|
158
|
+
<DataTable
|
|
159
|
+
columns={TEAM_COLUMNS}
|
|
160
|
+
data={TEAM_MEMBERS}
|
|
161
|
+
rowSelection={true}
|
|
162
|
+
/>
|
|
163
|
+
),
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
// Dense
|
|
168
|
+
// ---------------------------------------------------------------------------
|
|
169
|
+
|
|
170
|
+
export const Dense: Story = {
|
|
171
|
+
render: () => (
|
|
172
|
+
<DataTable
|
|
173
|
+
columns={TEAM_COLUMNS}
|
|
174
|
+
data={TEAM_MEMBERS}
|
|
175
|
+
density="dense"
|
|
176
|
+
/>
|
|
177
|
+
),
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
// EmptyState
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
|
|
184
|
+
export const EmptyState: Story = {
|
|
185
|
+
render: () => (
|
|
186
|
+
<DataTable
|
|
187
|
+
columns={TEAM_COLUMNS}
|
|
188
|
+
data={[]}
|
|
189
|
+
emptyMessage="No team members matched your filters."
|
|
190
|
+
/>
|
|
191
|
+
),
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// ---------------------------------------------------------------------------
|
|
195
|
+
// RealisticUse — design system component adoption table
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
|
|
198
|
+
type AdoptionStatus = "Stable" | "Beta" | "New" | "Deprecated";
|
|
199
|
+
|
|
200
|
+
interface ComponentRow {
|
|
201
|
+
component: string;
|
|
202
|
+
status: AdoptionStatus;
|
|
203
|
+
adopters: number;
|
|
204
|
+
coverage: string;
|
|
205
|
+
lastUpdated: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const REALISTIC_DATA: ComponentRow[] = [
|
|
209
|
+
{ component: "Button", status: "Stable", adopters: 14, coverage: "100%", lastUpdated: "2026-07-28" },
|
|
210
|
+
{ component: "Input", status: "Stable", adopters: 13, coverage: "98%", lastUpdated: "2026-07-22" },
|
|
211
|
+
{ component: "Card", status: "Stable", adopters: 12, coverage: "95%", lastUpdated: "2026-07-15" },
|
|
212
|
+
{ component: "Dialog", status: "Stable", adopters: 11, coverage: "91%", lastUpdated: "2026-07-10" },
|
|
213
|
+
{ component: "DataTable", status: "New", adopters: 1, coverage: "12%", lastUpdated: "2026-08-03" },
|
|
214
|
+
{ component: "Slider", status: "Beta", adopters: 4, coverage: "42%", lastUpdated: "2026-06-05" },
|
|
215
|
+
{ component: "Calendar", status: "Beta", adopters: 3, coverage: "38%", lastUpdated: "2026-06-02" },
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
const STATUS_VARIANT_MAP: Record<AdoptionStatus, "default" | "secondary" | "outline" | "destructive"> = {
|
|
219
|
+
Stable: "default",
|
|
220
|
+
Beta: "secondary",
|
|
221
|
+
New: "outline",
|
|
222
|
+
Deprecated: "destructive",
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const REALISTIC_COLUMNS: ColumnDef<ComponentRow>[] = [
|
|
226
|
+
{ accessorKey: "component", header: "Component" },
|
|
227
|
+
{
|
|
228
|
+
accessorKey: "status",
|
|
229
|
+
header: "Status",
|
|
230
|
+
cell: ({ row }) => {
|
|
231
|
+
const status = row.getValue<AdoptionStatus>("status");
|
|
232
|
+
return (
|
|
233
|
+
<Badge variant={STATUS_VARIANT_MAP[status]} className="text-xs">
|
|
234
|
+
{status}
|
|
235
|
+
</Badge>
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
accessorKey: "adopters",
|
|
241
|
+
header: "Adopters",
|
|
242
|
+
cell: ({ row }) => (
|
|
243
|
+
<span className="tabular-nums">{row.getValue<number>("adopters")}</span>
|
|
244
|
+
),
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
accessorKey: "coverage",
|
|
248
|
+
header: "Coverage",
|
|
249
|
+
cell: ({ row }) => (
|
|
250
|
+
<span className="tabular-nums font-medium">{row.getValue<string>("coverage")}</span>
|
|
251
|
+
),
|
|
252
|
+
},
|
|
253
|
+
{ accessorKey: "lastUpdated", header: "Last Updated" },
|
|
254
|
+
];
|
|
255
|
+
|
|
256
|
+
export const RealisticUse: Story = {
|
|
257
|
+
render: () => (
|
|
258
|
+
<div className="space-y-2">
|
|
259
|
+
<p className="text-sm text-muted-foreground">
|
|
260
|
+
Component adoption tracker — Jordan Reeves' team across 14 product surfaces.
|
|
261
|
+
</p>
|
|
262
|
+
<DataTable
|
|
263
|
+
columns={REALISTIC_COLUMNS}
|
|
264
|
+
data={REALISTIC_DATA}
|
|
265
|
+
sorting={true}
|
|
266
|
+
pagination={{ pageSize: 5 }}
|
|
267
|
+
rowSelection={true}
|
|
268
|
+
/>
|
|
269
|
+
</div>
|
|
270
|
+
),
|
|
271
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import { DateField } from "@behavioral-agentic-design-system/core/components/ui/date-field"
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
11
|
+
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label"
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof DateField> = {
|
|
14
|
+
title: "Components/DateField",
|
|
15
|
+
component: DateField,
|
|
16
|
+
parameters: { layout: "centered" },
|
|
17
|
+
}
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof DateField>
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<div className="w-64">
|
|
24
|
+
<DateField />
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Prefilled: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<div className="w-64">
|
|
32
|
+
<DateField defaultValue={new Date(2026, 4, 26)} />
|
|
33
|
+
</div>
|
|
34
|
+
),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Sizes: Story = {
|
|
38
|
+
render: () => (
|
|
39
|
+
<div className="flex w-64 flex-col gap-3">
|
|
40
|
+
<DateField defaultValue={new Date(2026, 4, 26)} size="sm" />
|
|
41
|
+
<DateField defaultValue={new Date(2026, 4, 26)} size="default" />
|
|
42
|
+
<DateField defaultValue={new Date(2026, 4, 26)} size="lg" />
|
|
43
|
+
</div>
|
|
44
|
+
),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Disabled: Story = {
|
|
48
|
+
render: () => (
|
|
49
|
+
<div className="w-64">
|
|
50
|
+
<DateField disabled defaultValue={new Date(2026, 4, 1)} />
|
|
51
|
+
</div>
|
|
52
|
+
),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const WithMinMax: Story = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<div className="flex w-72 flex-col gap-2">
|
|
58
|
+
<DateField
|
|
59
|
+
defaultValue={new Date(2026, 4, 26)}
|
|
60
|
+
min={new Date(2026, 0, 1)}
|
|
61
|
+
max={new Date(2026, 11, 31)}
|
|
62
|
+
/>
|
|
63
|
+
<p className="text-xs text-muted-foreground">
|
|
64
|
+
Jordan Reeves' engagement window — dates clamp to the 2026 retainer
|
|
65
|
+
year (Jan 1 – Dec 31, 2026).
|
|
66
|
+
</p>
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Clearable: Story = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<div className="w-64">
|
|
74
|
+
<DateField clearable defaultValue={new Date(2026, 4, 26)} />
|
|
75
|
+
</div>
|
|
76
|
+
),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const RealisticUse: Story = {
|
|
80
|
+
render: () => {
|
|
81
|
+
const [dueDate, setDueDate] = React.useState<Date | undefined>(
|
|
82
|
+
new Date(2026, 4, 26)
|
|
83
|
+
)
|
|
84
|
+
return (
|
|
85
|
+
<Card className="w-96">
|
|
86
|
+
<CardHeader>
|
|
87
|
+
<CardTitle>Tokens v2 proposal</CardTitle>
|
|
88
|
+
<CardDescription>
|
|
89
|
+
Jordan Reeves — design-system review milestone ($12,500.00
|
|
90
|
+
retainer).
|
|
91
|
+
</CardDescription>
|
|
92
|
+
</CardHeader>
|
|
93
|
+
<CardContent className="flex flex-col gap-3">
|
|
94
|
+
<Label htmlFor="story-due-date">Due date</Label>
|
|
95
|
+
<DateField
|
|
96
|
+
id="story-due-date"
|
|
97
|
+
value={dueDate}
|
|
98
|
+
onValueChange={setDueDate}
|
|
99
|
+
clearable
|
|
100
|
+
/>
|
|
101
|
+
<p className="text-xs text-muted-foreground">
|
|
102
|
+
{dueDate
|
|
103
|
+
? `Review scheduled for ${dueDate.toLocaleDateString("en-US", {
|
|
104
|
+
month: "long",
|
|
105
|
+
day: "numeric",
|
|
106
|
+
year: "numeric",
|
|
107
|
+
})}.`
|
|
108
|
+
: "No due date set — the milestone stays unscheduled."}
|
|
109
|
+
</p>
|
|
110
|
+
</CardContent>
|
|
111
|
+
</Card>
|
|
112
|
+
)
|
|
113
|
+
},
|
|
114
|
+
}
|