@behavioral-agentic-design-system/core 0.30.0 → 0.32.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.
@@ -1,3 +1,5 @@
1
+ // size prop added 2026-08-23: sm=24px visible box, default=32px (unchanged).
2
+ // Hit area stays 44px via before:size-11 in both sizes (WCAG 2.2 SC 2.5.5 AAA).
1
3
  import type { Meta, StoryObj } from "@storybook/react";
2
4
  import { Checkbox } from "@behavioral-agentic-design-system/core/components/ui/checkbox";
3
5
  import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
@@ -7,6 +9,9 @@ const meta: Meta<typeof Checkbox> = {
7
9
  component: Checkbox,
8
10
  parameters: { layout: "centered" },
9
11
  tags: ["autodocs"],
12
+ argTypes: {
13
+ size: { control: "select", options: ["sm", "default"] },
14
+ },
10
15
  };
11
16
 
12
17
  export default meta;
@@ -41,10 +46,59 @@ export const Disabled: Story = {
41
46
  args: { disabled: true, "aria-label": "I agree to the terms" } as any,
42
47
  };
43
48
 
49
+ /**
50
+ * Size ladder (peer parity: Mantine size, MUI size, Chakra size).
51
+ * sm = 24px visible box — fits dense tables and list rows.
52
+ * default = 32px visible box — unchanged.
53
+ * Hit area is 44px in both sizes (WCAG 2.2 SC 2.5.5 AAA pointer target).
54
+ */
55
+ export const Size_Sm: Story = {
56
+ render: () => (
57
+ <div className="flex items-center gap-2">
58
+ <Checkbox id="size-sm" size="sm" defaultChecked />
59
+ <Label htmlFor="size-sm">Compact checkbox</Label>
60
+ </div>
61
+ ),
62
+ };
63
+
64
+ export const Sizes: Story = {
65
+ render: () => (
66
+ <div className="space-y-3">
67
+ <div className="flex items-center gap-2">
68
+ <Checkbox id="sz-sm" size="sm" defaultChecked />
69
+ <Label htmlFor="sz-sm">Small (24px)</Label>
70
+ </div>
71
+ <div className="flex items-center gap-2">
72
+ <Checkbox id="sz-default" defaultChecked />
73
+ <Label htmlFor="sz-default">Default (32px)</Label>
74
+ </div>
75
+ </div>
76
+ ),
77
+ };
78
+
44
79
  export const RealisticUse: Story = {
45
- render: () => (<div className="flex items-center gap-2">
46
- <Checkbox id="terms-realistic" defaultChecked />
47
- <Label htmlFor="terms-realistic">I agree to the terms</Label>
48
- </div>),
80
+ render: () => (
81
+ <div className="space-y-4">
82
+ <div className="flex items-center gap-2">
83
+ <Checkbox id="terms-realistic" defaultChecked />
84
+ <Label htmlFor="terms-realistic">I agree to the terms</Label>
85
+ </div>
86
+ <div className="space-y-2">
87
+ <p className="text-sm font-medium text-foreground">Notification preferences</p>
88
+ <div className="flex items-center gap-2">
89
+ <Checkbox id="notif-email" size="sm" defaultChecked />
90
+ <Label htmlFor="notif-email">Email updates</Label>
91
+ </div>
92
+ <div className="flex items-center gap-2">
93
+ <Checkbox id="notif-slack" size="sm" />
94
+ <Label htmlFor="notif-slack">Slack notifications</Label>
95
+ </div>
96
+ <div className="flex items-center gap-2">
97
+ <Checkbox id="notif-all" size="sm" checked="indeterminate" />
98
+ <Label htmlFor="notif-all">Select all</Label>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ ),
49
103
  };
50
104
 
@@ -123,12 +123,66 @@ export const Sizes: Story = {
123
123
  ),
124
124
  };
125
125
 
126
+ /**
127
+ * Semantic color intent (peer parity: Mantine Progress `color`, MUI
128
+ * LinearProgress `color`, Chakra `colorScheme`, Ant Design `status`). Only
129
+ * the indicator fill changes — the track stays primary-tinted. Intent is
130
+ * visual only; always pair with a label or aria-label naming the state.
131
+ */
132
+ export const Intent_Success: Story = {
133
+ args: { value: 100, intent: "success", label: "Deployment complete", showValue: true },
134
+ render: (args) => (
135
+ <div className="w-72">
136
+ <Progress {...args} />
137
+ </div>
138
+ ),
139
+ };
140
+
141
+ export const Intent_Warning: Story = {
142
+ args: { value: 78, intent: "warning", label: "Disk quota: 78% used", showValue: true },
143
+ render: (args) => (
144
+ <div className="w-72">
145
+ <Progress {...args} />
146
+ </div>
147
+ ),
148
+ };
149
+
150
+ export const Intent_Error: Story = {
151
+ args: { value: 100, intent: "error", label: "Build failed", showValue: true },
152
+ render: (args) => (
153
+ <div className="w-72">
154
+ <Progress {...args} />
155
+ </div>
156
+ ),
157
+ };
158
+
159
+ export const Intent_Info: Story = {
160
+ args: { value: 42, intent: "info", label: "Syncing design tokens", showValue: true },
161
+ render: (args) => (
162
+ <div className="w-72">
163
+ <Progress {...args} />
164
+ </div>
165
+ ),
166
+ };
167
+
168
+ export const Intents: Story = {
169
+ render: () => (
170
+ <div className="w-72 space-y-4">
171
+ <Progress value={60} intent="default" aria-label="Default progress" />
172
+ <Progress value={100} intent="success" label="Deployment complete" showValue />
173
+ <Progress value={78} intent="warning" label="Disk quota: 78% used" showValue />
174
+ <Progress value={100} intent="error" label="Build failed" showValue />
175
+ <Progress value={42} intent="info" label="Syncing design tokens" showValue />
176
+ </div>
177
+ ),
178
+ };
179
+
126
180
  export const RealisticUse: Story = {
127
181
  render: () => (
128
182
  <div className="w-72 space-y-6">
129
183
  <Progress value={28} label="Uploading brand-fonts.woff2" showValue />
130
184
  <Progress value={72} label="Processing tokens" showValue />
131
- <Progress value={100} label="Storybook coverage" showValue />
185
+ <Progress value={100} intent="success" label="Storybook coverage" showValue />
132
186
  <Progress
133
187
  value={14}
134
188
  max={36}
@@ -136,9 +190,7 @@ export const RealisticUse: Story = {
136
190
  showValue
137
191
  getValueLabel={(value, max) => `${value} of ${max}`}
138
192
  />
139
- {/* sm reads as quiet inline progress in dense rows; lg carries an
140
- upload panel. */}
141
- <Progress value={64} size="sm" aria-label="Background sync" />
193
+ <Progress value={78} intent="warning" size="sm" aria-label="Storage: 78% used" />
142
194
  <Progress value={38} size="lg" label="Uploading brand assets" showValue />
143
195
  </div>
144
196
  ),
@@ -0,0 +1,97 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { SkeletonTable } from "@behavioral-agentic-design-system/core/components/ui/skeleton";
3
+ import {
4
+ Table,
5
+ TableBody,
6
+ TableCell,
7
+ TableHead,
8
+ TableHeader,
9
+ TableRow,
10
+ } from "@behavioral-agentic-design-system/core/components/ui/table";
11
+
12
+ // SkeletonTable ships in skeleton.tsx alongside Skeleton and SkeletonRegion, but
13
+ // it gets its OWN stories file rather than extra exports on Skeleton.stories.tsx.
14
+ // A stories file has exactly one default export, so a second `Meta` const in the
15
+ // same file is inert: its `title` is ignored and every story it claims renders
16
+ // under the file's real meta instead — mis-titled and impossible to find under
17
+ // its own name in the sidebar.
18
+ const meta: Meta<typeof SkeletonTable> = {
19
+ title: "Components/SkeletonTable",
20
+ component: SkeletonTable,
21
+ parameters: { layout: "padded" },
22
+ tags: ["autodocs"],
23
+ argTypes: {
24
+ rows: { control: { type: "number", min: 1, max: 20 } },
25
+ columns: { control: { type: "number", min: 1, max: 12 } },
26
+ showHeader: { control: "boolean" },
27
+ animation: { control: "select", options: ["pulse", "wave", false] },
28
+ },
29
+ };
30
+
31
+ export default meta;
32
+ type Story = StoryObj<typeof meta>;
33
+
34
+ export const Default: Story = {
35
+ render: () => <SkeletonTable />,
36
+ };
37
+
38
+ /** For tables whose header renders separately, or is sticky outside the scroll area. */
39
+ export const NoHeader: Story = {
40
+ render: () => <SkeletonTable showHeader={false} />,
41
+ };
42
+
43
+ export const CustomShape: Story = {
44
+ render: () => <SkeletonTable rows={3} columns={6} />,
45
+ };
46
+
47
+ export const Animation_Wave: Story = {
48
+ render: () => <SkeletonTable animation="wave" />,
49
+ };
50
+
51
+ export const Animation_None: Story = {
52
+ render: () => <SkeletonTable animation={false} />,
53
+ };
54
+
55
+ /**
56
+ * The placeholder and the table it stands in for, one above the other. Row and
57
+ * column counts should match the real table's shape — a 5×4 skeleton that
58
+ * resolves into a 3×6 table reads as a layout bug rather than a load.
59
+ */
60
+ export const RealisticUse: Story = {
61
+ render: () => (
62
+ <div className="w-full max-w-[720px] space-y-8">
63
+ <div>
64
+ <p className="mb-3 text-sm text-muted-foreground">
65
+ Loading — 4 rows × 3 columns, matching the table below.
66
+ </p>
67
+ <SkeletonTable rows={4} columns={3} />
68
+ </div>
69
+ <div>
70
+ <p className="mb-3 text-sm text-muted-foreground">Loaded</p>
71
+ <Table>
72
+ <TableHeader>
73
+ <TableRow>
74
+ <TableHead>Reviewer</TableHead>
75
+ <TableHead>Component</TableHead>
76
+ <TableHead>Status</TableHead>
77
+ </TableRow>
78
+ </TableHeader>
79
+ <TableBody>
80
+ {[
81
+ ["Seo-yun Park", "MultiSelect", "Approved"],
82
+ ["Marcus Lindqvist", "TreeSelect", "Changes requested"],
83
+ ["Anika Patel", "DataTable", "Approved"],
84
+ ["Chloé Dubois-Martin", "TagsInput", "In review"],
85
+ ].map(([reviewer, component, status]) => (
86
+ <TableRow key={reviewer}>
87
+ <TableCell className="font-medium">{reviewer}</TableCell>
88
+ <TableCell>{component}</TableCell>
89
+ <TableCell className="text-muted-foreground">{status}</TableCell>
90
+ </TableRow>
91
+ ))}
92
+ </TableBody>
93
+ </Table>
94
+ </div>
95
+ </div>
96
+ ),
97
+ };
@@ -105,20 +105,68 @@ export const Default: Story = {
105
105
  // New TabsPanels primitive — cross-fades between forceMount'd panels instead of
106
106
  // unmount/remount. Use when switching tabs would cause a flash (iframes, charts,
107
107
  // anything with expensive first render).
108
+ //
109
+ // The panels here SCROLL on purpose, and the default panel is deliberately NOT
110
+ // the last sibling. Every forceMount'd panel is absolutely stacked at inset-0,
111
+ // so before TabsPanels set an explicit z-order the later siblings sat on top of
112
+ // the active one. Invisible in Chromium — but Safari's async scrolling tree
113
+ // hit-tests those overlapping scroll containers without honouring
114
+ // `pointer-events: none`, so the transparent sibling ate the wheel gesture and
115
+ // the visible panel refused to scroll. Keep this story's shape (scrollable
116
+ // content + a non-last default) so a regression is reproducible by hand.
108
117
  export const RealisticUse: Story = {
109
118
  render: () => (
110
- <Tabs defaultValue="cards" className="w-[600px] h-[200px]">
119
+ <Tabs defaultValue="reviewers" className="w-[600px] h-[240px]">
111
120
  <TabsList>
112
- <TabsTrigger value="cards">Cards</TabsTrigger>
113
- <TabsTrigger value="dashboard">Dashboard</TabsTrigger>
121
+ <TabsTrigger value="reviewers">Reviewers</TabsTrigger>
122
+ <TabsTrigger value="activity">Activity</TabsTrigger>
114
123
  </TabsList>
115
- <div className="relative flex-1 mt-4 border rounded-lg overflow-hidden h-[140px]">
124
+ <div className="relative flex-1 mt-4 border rounded-lg overflow-hidden h-[180px]">
116
125
  <TabsPanels>
117
- <TabsContent value="cards" forceMount className="m-0 size-full p-4">
118
- Cards panel — cross-fades in.
126
+ <TabsContent
127
+ value="reviewers"
128
+ forceMount
129
+ className="m-0 size-full overflow-y-auto p-4"
130
+ >
131
+ <ul className="flex flex-col gap-3 text-sm">
132
+ {[
133
+ ["Jordan Reeves", "jordan@reeves.design"],
134
+ ["Seo-yun Park", "seoyun.park@figma.com"],
135
+ ["Marcus Lindqvist", "marcus@lindqvist.dev"],
136
+ ["Anika Patel", "anika.patel@stripe.com"],
137
+ ["Tomás Herrera", "tomas.herrera@vercel.com"],
138
+ ["Yuki Tanaka", "yuki.tanaka@linear.app"],
139
+ ["Chloé Dubois-Martin", "chloe@dubois-martin.fr"],
140
+ ["Kofi Asante", "kofi.asante@gmail.com"],
141
+ ].map(([name, email]) => (
142
+ <li key={email} className="flex min-w-0 flex-col">
143
+ <span className="truncate font-medium">{name}</span>
144
+ <span className="truncate text-muted-foreground">{email}</span>
145
+ </li>
146
+ ))}
147
+ </ul>
119
148
  </TabsContent>
120
- <TabsContent value="dashboard" forceMount className="m-0 size-full p-4">
121
- Dashboard panel — cross-fades in.
149
+ <TabsContent
150
+ value="activity"
151
+ forceMount
152
+ className="m-0 size-full overflow-y-auto p-4"
153
+ >
154
+ <ol className="flex flex-col gap-3 text-sm">
155
+ {[
156
+ "Seo-yun Park opened tokens-v2-proposal",
157
+ "Marcus Lindqvist approved the semantic token rename",
158
+ "Anika Patel flagged a AAA contrast miss on --muted-foreground",
159
+ "Jordan Reeves published v0.28.0 to the registry",
160
+ "Kofi Asante forked the system for a new engagement",
161
+ "Yuki Tanaka requested a dark-mode review",
162
+ "Tomás Herrera closed the chart palette thread",
163
+ "Chloé Dubois-Martin added the French microcopy pass",
164
+ ].map((entry) => (
165
+ <li key={entry} className="text-muted-foreground">
166
+ {entry}
167
+ </li>
168
+ ))}
169
+ </ol>
122
170
  </TabsContent>
123
171
  </TabsPanels>
124
172
  </div>
@@ -0,0 +1,106 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import * as React from "react";
3
+ import { Info } from "lucide-react";
4
+ import { ToggleTip } from "@behavioral-agentic-design-system/core/components/ui/toggle-tip";
5
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
6
+ import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
7
+ import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
8
+
9
+ const meta: Meta<typeof ToggleTip> = {
10
+ title: "Components/ToggleTip",
11
+ component: ToggleTip,
12
+ parameters: { layout: "centered" },
13
+ tags: ["autodocs"],
14
+ };
15
+
16
+ export default meta;
17
+
18
+ export const Default: StoryObj = {
19
+ render: () => (
20
+ <ToggleTip content="Semantic tokens alias primitives, so one brand change propagates everywhere.">
21
+ <Button variant="ghost" size="icon" aria-label="More about semantic tokens">
22
+ <Info strokeWidth={1.5} className="size-4" />
23
+ </Button>
24
+ </ToggleTip>
25
+ ),
26
+ };
27
+
28
+ export const Disabled: StoryObj = {
29
+ render: () => (
30
+ <ToggleTip
31
+ disabled
32
+ content="This tip never opens while the trigger is disabled."
33
+ >
34
+ <Button variant="ghost" size="icon" aria-label="More about semantic tokens">
35
+ <Info strokeWidth={1.5} className="size-4" />
36
+ </Button>
37
+ </ToggleTip>
38
+ ),
39
+ };
40
+
41
+ export const WithFormLabel: StoryObj = {
42
+ render: () => (
43
+ <div className="w-80 space-y-3">
44
+ <div className="flex items-center gap-1">
45
+ <Label htmlFor="npm-scope">npm scope</Label>
46
+ <ToggleTip
47
+ side="right"
48
+ content="The package prefix your forks import from. The npm package name stays @behavioral-agentic-design-system/core even after a rename."
49
+ >
50
+ <Button
51
+ variant="ghost"
52
+ size="icon-sm"
53
+ aria-label="What is an npm scope?"
54
+ >
55
+ <Info strokeWidth={1.5} className="size-4" />
56
+ </Button>
57
+ </ToggleTip>
58
+ </div>
59
+ <Input id="npm-scope" defaultValue="@behavioral-agentic-design-system" />
60
+ </div>
61
+ ),
62
+ };
63
+
64
+ export const RealisticUse: StoryObj = {
65
+ render: () => (
66
+ <div className="w-96 space-y-4 rounded-lg border border-border bg-card p-4">
67
+ <p className="text-sm font-medium text-foreground">Fork settings</p>
68
+ <div className="flex items-center justify-between gap-3">
69
+ <div className="flex items-center gap-1">
70
+ <span className="text-sm text-foreground">Client savings to date</span>
71
+ <ToggleTip
72
+ side="top"
73
+ content="Computed by pnpm roi:report from the registry's costModel hours at the rates in roi/rates.json. Jordan Reeves' fork is at $182,450."
74
+ >
75
+ <Button
76
+ variant="ghost"
77
+ size="icon-sm"
78
+ aria-label="How is client savings calculated?"
79
+ >
80
+ <Info strokeWidth={1.5} className="size-4" />
81
+ </Button>
82
+ </ToggleTip>
83
+ </div>
84
+ <span className="text-sm font-medium text-foreground">$182,450</span>
85
+ </div>
86
+ <div className="flex items-center justify-between gap-3">
87
+ <div className="flex items-center gap-1">
88
+ <span className="text-sm text-foreground">Components shipped</span>
89
+ <ToggleTip
90
+ side="bottom"
91
+ content="Primitives published from packages/core. Run pnpm build:tokens after any token change so the count reflects reality."
92
+ >
93
+ <Button
94
+ variant="ghost"
95
+ size="icon-sm"
96
+ aria-label="What counts as a shipped component?"
97
+ >
98
+ <Info strokeWidth={1.5} className="size-4" />
99
+ </Button>
100
+ </ToggleTip>
101
+ </div>
102
+ <span className="text-sm font-medium text-foreground">36 components</span>
103
+ </div>
104
+ </div>
105
+ ),
106
+ };
package/src/styles.css CHANGED
@@ -4,20 +4,31 @@
4
4
  /* @behavioral-agentic-design-system/core — single-file theme import.
5
5
  *
6
6
  * Usage in your app's global stylesheet:
7
+ * @import "@behavioral-agentic-design-system/core/fonts-cdn.css";
7
8
  * @import "tailwindcss";
8
9
  * @import "tw-animate-css";
9
10
  * @import "@behavioral-agentic-design-system/core/styles.css";
10
11
  *
11
- * Atkinson Hyperlegible loaded from Google Fonts; zero font setup required.
12
- * Override any token by re-declaring it after this @import.
12
+ * fonts-cdn.css goes FIRST and is optional — skip it if the app loads Inter
13
+ * and Atkinson Hyperlegible itself (next/font, self-hosted woff2). Everything
14
+ * else about font setup is zero-config. Override any token by re-declaring it
15
+ * after this @import.
13
16
  */
14
17
 
15
- /* Inter Variable leads (the default sans) as the zero-setup CDN fallback;
16
- * Atkinson Hyperlegible stays as the accessibility-preserving secondary.
17
- * Self-hosted equivalents in fonts.css win when consumers copy the binaries
18
- * (see note below). */
19
- @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
20
- @import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');
18
+ /* This file deliberately contains NO remote `@import url(...)`.
19
+ *
20
+ * CSS only allows @import ahead of all rules. A consumer imports this file
21
+ * AFTER `@import "tailwindcss"`, which expands into real rules — so a remote
22
+ * @import here parses as invalid CSS, lightningcss/Turbopack fails the whole
23
+ * stylesheet, and every route 500s. It went unnoticed for a long time because
24
+ * the preview app in this repo never imports this file the way a consumer
25
+ * does; it reads styles/globals.css, where the font imports lead. The Google
26
+ * Fonts CDN faces now live in the separate fonts-cdn.css, which a consumer
27
+ * places before Tailwind. check:consumer-css compiles the documented usage
28
+ * above and fails if this ever regresses.
29
+ *
30
+ * The relative imports below are fine: the bundler inlines them rather than
31
+ * leaving an @import statement in the output. */
21
32
 
22
33
  /* Self-hosted brand faces shipped inside this package. fonts.css holds the
23
34
  * canonical SIL OFL defaults (Hyperlegible Sans, 6 weights). brand-fonts.css
@@ -26,8 +37,9 @@
26
37
  * — consumers copy the binaries from
27
38
  * `node_modules/@behavioral-agentic-design-system/core/fonts/` into their own
28
39
  * `public/fonts/` so the URLs resolve. See CLIENT_ONBOARDING.md → Shipping
29
- * fonts. CSS @import order: Google Fonts first (lowest priority fallback),
30
- * then local @font-face rules so the brand stack wins.
40
+ * fonts. Load order still puts the CDN faces first (lowest priority fallback)
41
+ * and these local @font-face rules after, so the brand stack wins — that
42
+ * ordering is now the consumer's import order, not this file's.
31
43
  */
32
44
  @import "./fonts.css";
33
45
  @import "./brand-fonts.css";