@behavioral-agentic-design-system/core 0.17.0 → 0.18.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 +1 -1
- package/scripts/check-stories.mjs +12 -5
- package/scripts/fix-stories.mjs +6 -6
- package/scripts/generate-stories.cjs +7 -7
- package/src/stories/Accordion.stories.tsx +152 -0
- package/src/stories/Alert.stories.tsx +102 -0
- package/src/stories/AlertDialog.stories.tsx +125 -0
- package/src/stories/AspectRatio.stories.tsx +82 -0
- package/src/stories/Avatar.stories.tsx +36 -0
- package/src/stories/Badge.stories.tsx +54 -0
- package/src/stories/Breadcrumb.stories.tsx +36 -0
- package/src/stories/Button.stories.tsx +144 -0
- package/src/stories/ButtonGroup.stories.tsx +176 -0
- package/src/stories/Calendar.stories.tsx +67 -0
- package/src/stories/Card.stories.tsx +43 -0
- package/src/stories/Carousel.stories.tsx +233 -0
- package/src/stories/Chart.stories.tsx +174 -0
- package/src/stories/Checkbox.stories.tsx +32 -0
- package/src/stories/CircularProgress.stories.tsx +136 -0
- package/src/stories/Code.stories.tsx +131 -0
- package/src/stories/Collapsible.stories.tsx +27 -0
- package/src/stories/ColorPicker.stories.tsx +155 -0
- package/src/stories/Combobox.stories.tsx +168 -0
- package/src/stories/Command.stories.tsx +40 -0
- package/src/stories/ContextMenu.stories.tsx +293 -0
- package/src/stories/CopyButton.stories.tsx +111 -0
- package/src/stories/DatePicker.stories.tsx +176 -0
- package/src/stories/DateRangePicker.stories.tsx +95 -0
- package/src/stories/Dialog.stories.tsx +186 -0
- package/src/stories/DropdownMenu.stories.tsx +47 -0
- package/src/stories/EmptyState.stories.tsx +199 -0
- package/src/stories/Field.stories.tsx +155 -0
- package/src/stories/FileUpload.stories.tsx +134 -0
- package/src/stories/HoverCard.stories.tsx +149 -0
- package/src/stories/Indicator.stories.tsx +255 -0
- package/src/stories/Input.stories.tsx +69 -0
- package/src/stories/Kbd.stories.tsx +123 -0
- package/src/stories/Label.stories.tsx +27 -0
- package/src/stories/List.stories.tsx +159 -0
- package/src/stories/Menubar.stories.tsx +190 -0
- package/src/stories/MultiSelect.stories.tsx +107 -0
- package/src/stories/NativeSelect.stories.tsx +107 -0
- package/src/stories/NavigationMenu.stories.tsx +322 -0
- package/src/stories/NumberInput.stories.tsx +100 -0
- package/src/stories/Pagination.stories.tsx +201 -0
- package/src/stories/PasswordInput.stories.tsx +62 -0
- package/src/stories/PinInput.stories.tsx +136 -0
- package/src/stories/Popover.stories.tsx +37 -0
- package/src/stories/Progress.stories.tsx +64 -0
- package/src/stories/RadioGroup.stories.tsx +39 -0
- package/src/stories/RatingGroup.stories.tsx +102 -0
- package/src/stories/Resizable.stories.tsx +28 -0
- package/src/stories/Reveal.stories.tsx +63 -0
- package/src/stories/ScrollArea.stories.tsx +76 -0
- package/src/stories/SegmentedControl.stories.tsx +182 -0
- package/src/stories/Select.stories.tsx +62 -0
- package/src/stories/Separator.stories.tsx +28 -0
- package/src/stories/Sheet.stories.tsx +193 -0
- package/src/stories/Sidebar.stories.tsx +53 -0
- package/src/stories/Skeleton.stories.tsx +32 -0
- package/src/stories/Slider.stories.tsx +67 -0
- package/src/stories/Sonner.stories.tsx +146 -0
- package/src/stories/Spinner.stories.tsx +94 -0
- package/src/stories/Stepper.stories.tsx +228 -0
- package/src/stories/Switch.stories.tsx +58 -0
- package/src/stories/Table.stories.tsx +38 -0
- package/src/stories/Tabs.stories.tsx +128 -0
- package/src/stories/Tag.stories.tsx +51 -0
- package/src/stories/TagsInput.stories.tsx +154 -0
- package/src/stories/Textarea.stories.tsx +31 -0
- package/src/stories/TimePicker.stories.tsx +54 -0
- package/src/stories/Timeline.stories.tsx +263 -0
- package/src/stories/Toggle.stories.tsx +45 -0
- package/src/stories/ToggleGroup.stories.tsx +39 -0
- package/src/stories/Toolbar.stories.tsx +295 -0
- package/src/stories/Tooltip.stories.tsx +37 -0
- package/src/stories/TreeView.stories.tsx +293 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behavioral-agentic-design-system/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "BADS core — tokens, shadcn/ui components, and the BADS template shell (app routes, customize tab, theme hooks). Forks consume this and re-export, keeping client repos to ~30 lines of glue.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Matthew Stephens <work@matthewstephens.com> (https://github.com/matthewlarn)",
|
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
* Storybook coverage check.
|
|
4
4
|
*
|
|
5
5
|
* Strict rule: every primitive in packages/core/src/components/ui/*.tsx must
|
|
6
|
-
* have a matching
|
|
7
|
-
* is touched in a commit, its story file must be touched in the
|
|
6
|
+
* have a matching packages/core/src/stories/<PascalCase>.stories.tsx. When a
|
|
7
|
+
* component file is touched in a commit, its story file must be touched in the
|
|
8
|
+
* same commit.
|
|
9
|
+
*
|
|
10
|
+
* Stories live INSIDE the published @core package (under src/) so they ship to
|
|
11
|
+
* forks over npm the same way the Foundations stories already do — a fork's
|
|
12
|
+
* Storybook globs node_modules/@.../core/src/stories/*.stories.tsx and gets
|
|
13
|
+
* every upstream story automatically on the next @core bump.
|
|
8
14
|
*
|
|
9
15
|
* Modes:
|
|
10
16
|
* pnpm check:stories → precommit mode (staged-only, used by hook)
|
|
@@ -19,7 +25,7 @@ import { join, basename } from "node:path";
|
|
|
19
25
|
|
|
20
26
|
const ROOT = process.cwd();
|
|
21
27
|
const COMPONENTS_DIR = join(ROOT, "packages/core/src/components/ui");
|
|
22
|
-
const STORIES_DIR = join(ROOT, "
|
|
28
|
+
const STORIES_DIR = join(ROOT, "packages/core/src/stories");
|
|
23
29
|
|
|
24
30
|
const ALL = process.argv.includes("--all");
|
|
25
31
|
|
|
@@ -32,8 +38,9 @@ function pascal(kebab) {
|
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
function componentToStoryPath(componentRel) {
|
|
35
|
-
// packages/core/src/components/ui/dropdown-menu.tsx
|
|
36
|
-
|
|
41
|
+
// packages/core/src/components/ui/dropdown-menu.tsx
|
|
42
|
+
// → packages/core/src/stories/DropdownMenu.stories.tsx
|
|
43
|
+
return `packages/core/src/stories/${pascal(basename(componentRel))}.stories.tsx`;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
function listAllComponents() {
|
package/scripts/fix-stories.mjs
CHANGED
|
@@ -20,14 +20,14 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from
|
|
|
20
20
|
import { join, basename, dirname } from "node:path";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
22
|
|
|
23
|
-
// Shipped as the `bads-fix-stories` bin.
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
23
|
+
// Shipped as the `bads-fix-stories` bin. Both the component SOURCE and the
|
|
24
|
+
// stories OUTPUT are package-owned: stories now live in the core package under
|
|
25
|
+
// src/stories/ so they ship to forks over npm (a fork's Storybook globs
|
|
26
|
+
// node_modules/@.../core/src/stories/*.stories.tsx). Resolve both relative to
|
|
27
|
+
// this script's own location inside the package.
|
|
27
28
|
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
|
|
28
|
-
const ROOT = process.cwd();
|
|
29
29
|
const COMPONENTS_DIR = join(SCRIPT_DIR, "..", "src/components/ui");
|
|
30
|
-
const STORIES_DIR = join(
|
|
30
|
+
const STORIES_DIR = join(SCRIPT_DIR, "..", "src/stories");
|
|
31
31
|
if (!existsSync(STORIES_DIR)) mkdirSync(STORIES_DIR, { recursive: true });
|
|
32
32
|
|
|
33
33
|
function pascal(kebab) {
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
|
|
6
|
-
// Shipped as the `bads-generate-stories` bin.
|
|
7
|
-
// package-owned
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// land in the fork's components/ dir, and imports always reference the core
|
|
6
|
+
// Shipped as the `bads-generate-stories` bin. Both the component SOURCE and the
|
|
7
|
+
// stories OUTPUT are package-owned: stories live under the core package's
|
|
8
|
+
// src/stories/ so they ship to forks over npm. Resolve both relative to this
|
|
9
|
+
// script's own location inside the package. Imports still reference the core
|
|
11
10
|
// package by its real published name (read from core's own package.json, so a
|
|
12
|
-
// fork's rename never corrupts the scope)
|
|
11
|
+
// fork's rename never corrupts the scope) — the specifier self-resolves both
|
|
12
|
+
// inside the package and from a consumer's node_modules.
|
|
13
13
|
const CORE = require(path.join(__dirname, '..', 'package.json')).name;
|
|
14
14
|
const componentDir = path.join(__dirname, '..', 'src/components/ui');
|
|
15
|
-
const storiesDir = path.join(
|
|
15
|
+
const storiesDir = path.join(__dirname, '..', 'src/stories');
|
|
16
16
|
|
|
17
17
|
if (!fs.existsSync(storiesDir)) fs.mkdirSync(storiesDir, { recursive: true });
|
|
18
18
|
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Accordion,
|
|
4
|
+
AccordionItem,
|
|
5
|
+
AccordionTrigger,
|
|
6
|
+
AccordionContent,
|
|
7
|
+
} from "@behavioral-agentic-design-system/core/components/ui/accordion";
|
|
8
|
+
|
|
9
|
+
// Note: Accordion drives its transition duration/timing via inline style with
|
|
10
|
+
// var() references (BADS motion tokens), not Tailwind duration utilities.
|
|
11
|
+
// Never write an arbitrary-value duration class literally in the accordion
|
|
12
|
+
// source or here — Tailwind's content scanner extracts class-like tokens even
|
|
13
|
+
// from comments and compiles them into invalid CSS that breaks the build.
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof Accordion> = {
|
|
16
|
+
title: "Components/Accordion",
|
|
17
|
+
component: Accordion,
|
|
18
|
+
parameters: { layout: "centered" },
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<Accordion type="single" collapsible className="w-[400px]">
|
|
28
|
+
<AccordionItem value="item-1">
|
|
29
|
+
<AccordionTrigger>What is BADS?</AccordionTrigger>
|
|
30
|
+
<AccordionContent>
|
|
31
|
+
BADS (Behavioral Agentic Design System) is a portable, distributable
|
|
32
|
+
design system built as the starting point for client engagements. It
|
|
33
|
+
ships tokens, components, ethics layers, and agent interfaces in one
|
|
34
|
+
cohesive package.
|
|
35
|
+
</AccordionContent>
|
|
36
|
+
</AccordionItem>
|
|
37
|
+
<AccordionItem value="item-2">
|
|
38
|
+
<AccordionTrigger>How do I customize tokens?</AccordionTrigger>
|
|
39
|
+
<AccordionContent>
|
|
40
|
+
Edit <code>tokens.json</code> and run{" "}
|
|
41
|
+
<code>pnpm build:tokens</code>. Both the published CSS and the local
|
|
42
|
+
preview regenerate automatically.
|
|
43
|
+
</AccordionContent>
|
|
44
|
+
</AccordionItem>
|
|
45
|
+
<AccordionItem value="item-3">
|
|
46
|
+
<AccordionTrigger>What accessibility standard does BADS target?</AccordionTrigger>
|
|
47
|
+
<AccordionContent>
|
|
48
|
+
BADS targets WCAG 2.2 AAA out of the box — 7:1 contrast for normal
|
|
49
|
+
text, 44 × 44 px touch targets, reduced-motion respected, and
|
|
50
|
+
focus-visible on every interactive element.
|
|
51
|
+
</AccordionContent>
|
|
52
|
+
</AccordionItem>
|
|
53
|
+
</Accordion>
|
|
54
|
+
),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const Variant_Multiple: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<Accordion type="multiple" className="w-[400px]">
|
|
60
|
+
<AccordionItem value="item-1">
|
|
61
|
+
<AccordionTrigger>Primary membership</AccordionTrigger>
|
|
62
|
+
<AccordionContent>
|
|
63
|
+
Covers the account holder and up to two dependents. Includes all
|
|
64
|
+
scheduled group classes and open lap swim.
|
|
65
|
+
</AccordionContent>
|
|
66
|
+
</AccordionItem>
|
|
67
|
+
<AccordionItem value="item-2">
|
|
68
|
+
<AccordionTrigger>Guest passes</AccordionTrigger>
|
|
69
|
+
<AccordionContent>
|
|
70
|
+
Members can bring one guest per visit at no charge. Guests must
|
|
71
|
+
sign a liability waiver at the front desk.
|
|
72
|
+
</AccordionContent>
|
|
73
|
+
</AccordionItem>
|
|
74
|
+
<AccordionItem value="item-3">
|
|
75
|
+
<AccordionTrigger>Facility hours</AccordionTrigger>
|
|
76
|
+
<AccordionContent>
|
|
77
|
+
Weekdays 5:30 am – 10:00 pm. Weekends 7:00 am – 8:00 pm. Holiday
|
|
78
|
+
hours posted on the bulletin board.
|
|
79
|
+
</AccordionContent>
|
|
80
|
+
</AccordionItem>
|
|
81
|
+
</Accordion>
|
|
82
|
+
),
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Disabled: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<Accordion type="single" collapsible className="w-[400px]">
|
|
88
|
+
<AccordionItem value="item-1">
|
|
89
|
+
<AccordionTrigger>Available — click to expand</AccordionTrigger>
|
|
90
|
+
<AccordionContent>
|
|
91
|
+
This item is enabled and interactive.
|
|
92
|
+
</AccordionContent>
|
|
93
|
+
</AccordionItem>
|
|
94
|
+
<AccordionItem value="item-2">
|
|
95
|
+
<AccordionTrigger disabled>Disabled item</AccordionTrigger>
|
|
96
|
+
<AccordionContent>
|
|
97
|
+
This content is inaccessible when the trigger is disabled.
|
|
98
|
+
</AccordionContent>
|
|
99
|
+
</AccordionItem>
|
|
100
|
+
<AccordionItem value="item-3">
|
|
101
|
+
<AccordionTrigger>Another available item</AccordionTrigger>
|
|
102
|
+
<AccordionContent>
|
|
103
|
+
This item is also enabled and interactive.
|
|
104
|
+
</AccordionContent>
|
|
105
|
+
</AccordionItem>
|
|
106
|
+
</Accordion>
|
|
107
|
+
),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const RealisticUse: Story = {
|
|
111
|
+
render: () => (
|
|
112
|
+
<div className="w-[480px] rounded-lg border bg-card p-6">
|
|
113
|
+
<h3 className="mb-4 text-2xl font-semibold">Frequently asked questions</h3>
|
|
114
|
+
<Accordion type="single" collapsible>
|
|
115
|
+
<AccordionItem value="q1">
|
|
116
|
+
<AccordionTrigger>How long does onboarding take?</AccordionTrigger>
|
|
117
|
+
<AccordionContent className="text-muted-foreground">
|
|
118
|
+
Most teams are fully set up within one afternoon. The onboarding
|
|
119
|
+
wizard walks you through brand tokens, voice calibration, and
|
|
120
|
+
component scoping — no design-system experience required.
|
|
121
|
+
</AccordionContent>
|
|
122
|
+
</AccordionItem>
|
|
123
|
+
<AccordionItem value="q2">
|
|
124
|
+
<AccordionTrigger>Can I use my own font stack?</AccordionTrigger>
|
|
125
|
+
<AccordionContent className="text-muted-foreground">
|
|
126
|
+
Yes. Add your font files to <code>public/fonts/</code> and declare
|
|
127
|
+
them in <code>brand-fonts.json</code>. Run{" "}
|
|
128
|
+
<code>pnpm build:fonts</code> and the CSS updates automatically.
|
|
129
|
+
</AccordionContent>
|
|
130
|
+
</AccordionItem>
|
|
131
|
+
<AccordionItem value="q3">
|
|
132
|
+
<AccordionTrigger>Is Figma sync supported?</AccordionTrigger>
|
|
133
|
+
<AccordionContent className="text-muted-foreground">
|
|
134
|
+
Figma sync (Token Studio export → BADS import) is a v2 feature on
|
|
135
|
+
the roadmap. Today, tokens live in <code>tokens.json</code> and
|
|
136
|
+
are the single source of truth.
|
|
137
|
+
</AccordionContent>
|
|
138
|
+
</AccordionItem>
|
|
139
|
+
<AccordionItem value="q4">
|
|
140
|
+
<AccordionTrigger>What if I need a component BADS doesn't ship?</AccordionTrigger>
|
|
141
|
+
<AccordionContent className="text-muted-foreground">
|
|
142
|
+
Run the Component Readiness Audit in{" "}
|
|
143
|
+
<code>prompts/component-readiness-audit.md</code>. If the outcome
|
|
144
|
+
is "new primitive," surface it for approval. The Night Shift agent
|
|
145
|
+
builds one new primitive per night and hands you a draft PR in the
|
|
146
|
+
morning.
|
|
147
|
+
</AccordionContent>
|
|
148
|
+
</AccordionItem>
|
|
149
|
+
</Accordion>
|
|
150
|
+
</div>
|
|
151
|
+
),
|
|
152
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// These stories exercise the icon + title + description grid layout in Alert,
|
|
2
|
+
// AND the surface-hierarchy + accent contract: default = subtle primary tint +
|
|
3
|
+
// 4px primary left-accent bar + primary icon; destructive = full red border +
|
|
4
|
+
// 4px red left bar + red icon/text + subtle red tint. The colored-icon +
|
|
5
|
+
// left-accent language matches the Sonner toasts so alerts and notifications
|
|
6
|
+
// read as one family. (Accent/border colors use arbitrary `border-[var(--token)]!`
|
|
7
|
+
// because the named border-color utilities don't emit a rule in this Tailwind v4
|
|
8
|
+
// setup.) Any change to alertVariants should re-snapshot here in Chromatic.
|
|
9
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { AlertCircleIcon } from "lucide-react";
|
|
11
|
+
import { Alert, AlertTitle, AlertDescription } from "@behavioral-agentic-design-system/core/components/ui/alert";
|
|
12
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof Alert> = {
|
|
15
|
+
title: "Components/Alert",
|
|
16
|
+
component: Alert,
|
|
17
|
+
parameters: { layout: "centered" },
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
26
|
+
<Alert>
|
|
27
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
28
|
+
<AlertTitle>Heads up</AlertTitle>
|
|
29
|
+
<AlertDescription>You can update settings any time.</AlertDescription>
|
|
30
|
+
</Alert>
|
|
31
|
+
<Alert variant="destructive">
|
|
32
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
33
|
+
<AlertTitle>Save failed</AlertTitle>
|
|
34
|
+
<AlertDescription>Couldn't reach the server. Try again.</AlertDescription>
|
|
35
|
+
</Alert>
|
|
36
|
+
</div>),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Variant_Default: Story = {
|
|
40
|
+
render: () => (<div className="w-[420px]">
|
|
41
|
+
<Alert variant="default">
|
|
42
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
43
|
+
<AlertTitle>Default</AlertTitle>
|
|
44
|
+
<AlertDescription>Heads up — something to read.</AlertDescription>
|
|
45
|
+
</Alert>
|
|
46
|
+
</div>),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Variant_Destructive: Story = {
|
|
50
|
+
render: () => (<div className="w-[420px]">
|
|
51
|
+
<Alert variant="destructive">
|
|
52
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
53
|
+
<AlertTitle>Destructive</AlertTitle>
|
|
54
|
+
<AlertDescription>Couldn't reach the server. Try again.</AlertDescription>
|
|
55
|
+
</Alert>
|
|
56
|
+
</div>),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// NestedInCard verifies the hierarchy contract — an Alert sitting inside a
|
|
60
|
+
// Card must remain visually distinct. Pre-fix, both surfaces used bg-card and
|
|
61
|
+
// the alert disappeared into the card.
|
|
62
|
+
export const NestedInCard: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<Card className="w-[460px]">
|
|
65
|
+
<CardHeader>
|
|
66
|
+
<CardTitle>Account settings</CardTitle>
|
|
67
|
+
</CardHeader>
|
|
68
|
+
<CardContent className="flex flex-col gap-3">
|
|
69
|
+
<Alert>
|
|
70
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
71
|
+
<AlertTitle>Email not verified</AlertTitle>
|
|
72
|
+
<AlertDescription>
|
|
73
|
+
Send a new verification link or skip for now.
|
|
74
|
+
</AlertDescription>
|
|
75
|
+
</Alert>
|
|
76
|
+
<Alert variant="destructive">
|
|
77
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
78
|
+
<AlertTitle>Plan downgrade pending</AlertTitle>
|
|
79
|
+
<AlertDescription>
|
|
80
|
+
Takes effect at the next billing cycle. Cancel anytime.
|
|
81
|
+
</AlertDescription>
|
|
82
|
+
</Alert>
|
|
83
|
+
</CardContent>
|
|
84
|
+
</Card>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const RealisticUse: Story = {
|
|
89
|
+
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
90
|
+
<Alert>
|
|
91
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
92
|
+
<AlertTitle>Heads up</AlertTitle>
|
|
93
|
+
<AlertDescription>You can update settings any time.</AlertDescription>
|
|
94
|
+
</Alert>
|
|
95
|
+
<Alert variant="destructive">
|
|
96
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
97
|
+
<AlertTitle>Save failed</AlertTitle>
|
|
98
|
+
<AlertDescription>Couldn't reach the server. Try again.</AlertDescription>
|
|
99
|
+
</Alert>
|
|
100
|
+
</div>),
|
|
101
|
+
};
|
|
102
|
+
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
AlertDialog,
|
|
4
|
+
AlertDialogTrigger,
|
|
5
|
+
AlertDialogContent,
|
|
6
|
+
AlertDialogHeader,
|
|
7
|
+
AlertDialogTitle,
|
|
8
|
+
AlertDialogDescription,
|
|
9
|
+
AlertDialogFooter,
|
|
10
|
+
AlertDialogCancel,
|
|
11
|
+
AlertDialogAction,
|
|
12
|
+
} from "@behavioral-agentic-design-system/core/components/ui/alert-dialog";
|
|
13
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
14
|
+
import { buttonVariants } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof AlertDialog> = {
|
|
17
|
+
title: "Components/AlertDialog",
|
|
18
|
+
component: AlertDialog,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
},
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
render: () => (
|
|
30
|
+
<AlertDialog>
|
|
31
|
+
<AlertDialogTrigger asChild>
|
|
32
|
+
<Button variant="outline">Delete project</Button>
|
|
33
|
+
</AlertDialogTrigger>
|
|
34
|
+
<AlertDialogContent>
|
|
35
|
+
<AlertDialogHeader>
|
|
36
|
+
<AlertDialogTitle>Delete this project?</AlertDialogTitle>
|
|
37
|
+
<AlertDialogDescription>
|
|
38
|
+
This will permanently delete the Meridian Brand Refresh project and
|
|
39
|
+
all its components. This action cannot be undone.
|
|
40
|
+
</AlertDialogDescription>
|
|
41
|
+
</AlertDialogHeader>
|
|
42
|
+
<AlertDialogFooter>
|
|
43
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
44
|
+
<AlertDialogAction className={buttonVariants({ variant: "destructive" })}>
|
|
45
|
+
Delete
|
|
46
|
+
</AlertDialogAction>
|
|
47
|
+
</AlertDialogFooter>
|
|
48
|
+
</AlertDialogContent>
|
|
49
|
+
</AlertDialog>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Variant_Destructive: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<AlertDialog>
|
|
56
|
+
<AlertDialogTrigger asChild>
|
|
57
|
+
<Button variant="destructive">Remove team member</Button>
|
|
58
|
+
</AlertDialogTrigger>
|
|
59
|
+
<AlertDialogContent>
|
|
60
|
+
<AlertDialogHeader>
|
|
61
|
+
<AlertDialogTitle>Remove Jordan Nakamura?</AlertDialogTitle>
|
|
62
|
+
<AlertDialogDescription>
|
|
63
|
+
Jordan will lose access to all projects and shared components
|
|
64
|
+
immediately. You can re-invite them from the team settings.
|
|
65
|
+
</AlertDialogDescription>
|
|
66
|
+
</AlertDialogHeader>
|
|
67
|
+
<AlertDialogFooter>
|
|
68
|
+
<AlertDialogCancel>Keep member</AlertDialogCancel>
|
|
69
|
+
<AlertDialogAction className={buttonVariants({ variant: "destructive" })}>
|
|
70
|
+
Remove
|
|
71
|
+
</AlertDialogAction>
|
|
72
|
+
</AlertDialogFooter>
|
|
73
|
+
</AlertDialogContent>
|
|
74
|
+
</AlertDialog>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Variant_Confirm: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<AlertDialog>
|
|
81
|
+
<AlertDialogTrigger asChild>
|
|
82
|
+
<Button>Publish design system</Button>
|
|
83
|
+
</AlertDialogTrigger>
|
|
84
|
+
<AlertDialogContent>
|
|
85
|
+
<AlertDialogHeader>
|
|
86
|
+
<AlertDialogTitle>Publish to production?</AlertDialogTitle>
|
|
87
|
+
<AlertDialogDescription>
|
|
88
|
+
The Clap v2.1.0 package will be published to npm and made available
|
|
89
|
+
to all client forks. Existing installs will not auto-update.
|
|
90
|
+
</AlertDialogDescription>
|
|
91
|
+
</AlertDialogHeader>
|
|
92
|
+
<AlertDialogFooter>
|
|
93
|
+
<AlertDialogCancel>Not yet</AlertDialogCancel>
|
|
94
|
+
<AlertDialogAction>Publish now</AlertDialogAction>
|
|
95
|
+
</AlertDialogFooter>
|
|
96
|
+
</AlertDialogContent>
|
|
97
|
+
</AlertDialog>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const RealisticUse: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<AlertDialog>
|
|
104
|
+
<AlertDialogTrigger asChild>
|
|
105
|
+
<Button variant="outline" size="sm">
|
|
106
|
+
Archive sprint
|
|
107
|
+
</Button>
|
|
108
|
+
</AlertDialogTrigger>
|
|
109
|
+
<AlertDialogContent>
|
|
110
|
+
<AlertDialogHeader>
|
|
111
|
+
<AlertDialogTitle>Archive Sprint 14?</AlertDialogTitle>
|
|
112
|
+
<AlertDialogDescription>
|
|
113
|
+
Archiving moves all incomplete tasks to the backlog and closes the
|
|
114
|
+
sprint report. Team members will no longer see Sprint 14 in their
|
|
115
|
+
active work view.
|
|
116
|
+
</AlertDialogDescription>
|
|
117
|
+
</AlertDialogHeader>
|
|
118
|
+
<AlertDialogFooter>
|
|
119
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
120
|
+
<AlertDialogAction>Archive sprint</AlertDialogAction>
|
|
121
|
+
</AlertDialogFooter>
|
|
122
|
+
</AlertDialogContent>
|
|
123
|
+
</AlertDialog>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AspectRatio } from "@behavioral-agentic-design-system/core/components/ui/aspect-ratio";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof AspectRatio> = {
|
|
5
|
+
title: "Components/AspectRatio",
|
|
6
|
+
component: AspectRatio,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
const PlaceholderImage = ({
|
|
15
|
+
label,
|
|
16
|
+
className,
|
|
17
|
+
}: {
|
|
18
|
+
label?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}) => (
|
|
21
|
+
<div
|
|
22
|
+
className={`flex h-full w-full items-center justify-center bg-muted text-sm text-muted-foreground ${className ?? ""}`}
|
|
23
|
+
aria-label={label ?? "Placeholder image"}
|
|
24
|
+
>
|
|
25
|
+
{label ?? "Image"}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<div className="w-[400px]">
|
|
32
|
+
<AspectRatio ratio={16 / 9}>
|
|
33
|
+
<PlaceholderImage label="16 / 9" />
|
|
34
|
+
</AspectRatio>
|
|
35
|
+
</div>
|
|
36
|
+
),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Square: Story = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<div className="w-[300px]">
|
|
42
|
+
<AspectRatio ratio={1}>
|
|
43
|
+
<PlaceholderImage label="1 / 1 (square)" />
|
|
44
|
+
</AspectRatio>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Portrait: Story = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<div className="w-[200px]">
|
|
52
|
+
<AspectRatio ratio={2 / 3}>
|
|
53
|
+
<PlaceholderImage label="2 / 3 (portrait)" />
|
|
54
|
+
</AspectRatio>
|
|
55
|
+
</div>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const RealisticUse: Story = {
|
|
60
|
+
render: () => (
|
|
61
|
+
<div className="grid w-[560px] grid-cols-3 gap-3">
|
|
62
|
+
{[
|
|
63
|
+
{ label: "Jordan Reeves — Lead designer", ratio: 1 },
|
|
64
|
+
{ label: "Seo-yun Park — Engineer", ratio: 1 },
|
|
65
|
+
{ label: "Marcus Lindqvist — Architect", ratio: 1 },
|
|
66
|
+
].map((item) => (
|
|
67
|
+
<div key={item.label} className="overflow-hidden rounded-md">
|
|
68
|
+
<AspectRatio ratio={item.ratio}>
|
|
69
|
+
<div className="flex h-full w-full flex-col items-center justify-center gap-1 bg-muted text-center">
|
|
70
|
+
<span className="text-xs font-medium text-foreground leading-tight px-2">
|
|
71
|
+
{item.label.split(" — ")[0]}
|
|
72
|
+
</span>
|
|
73
|
+
<span className="text-xs text-muted-foreground">
|
|
74
|
+
{item.label.split(" — ")[1]}
|
|
75
|
+
</span>
|
|
76
|
+
</div>
|
|
77
|
+
</AspectRatio>
|
|
78
|
+
</div>
|
|
79
|
+
))}
|
|
80
|
+
</div>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Avatar> = {
|
|
5
|
+
title: "Components/Avatar",
|
|
6
|
+
component: Avatar,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
render: () => (<div className="flex items-center gap-3">
|
|
16
|
+
<Avatar>
|
|
17
|
+
<AvatarImage src="/avatars/01.png" alt="Olivia Martin" />
|
|
18
|
+
<AvatarFallback>OM</AvatarFallback>
|
|
19
|
+
</Avatar>
|
|
20
|
+
<Avatar>
|
|
21
|
+
<AvatarFallback>MS</AvatarFallback>
|
|
22
|
+
</Avatar>
|
|
23
|
+
</div>),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const RealisticUse: Story = {
|
|
27
|
+
render: () => (<div className="flex items-center gap-3">
|
|
28
|
+
<Avatar>
|
|
29
|
+
<AvatarImage src="/avatars/01.png" alt="Olivia Martin" />
|
|
30
|
+
<AvatarFallback>OM</AvatarFallback>
|
|
31
|
+
</Avatar>
|
|
32
|
+
<Avatar>
|
|
33
|
+
<AvatarFallback>MS</AvatarFallback>
|
|
34
|
+
</Avatar>
|
|
35
|
+
</div>),
|
|
36
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Badge> = {
|
|
5
|
+
title: "Components/Badge",
|
|
6
|
+
component: Badge,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
render: () => (<div className="flex items-center gap-2">
|
|
16
|
+
<Badge>Default</Badge>
|
|
17
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
18
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
19
|
+
<Badge variant="outline">Outline</Badge>
|
|
20
|
+
</div>),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Variant_Default: Story = {
|
|
24
|
+
render: () => <Badge variant="default">Default</Badge>,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Variant_Secondary: Story = {
|
|
28
|
+
render: () => <Badge variant="secondary">Secondary</Badge>,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Variant_Destructive: Story = {
|
|
32
|
+
render: () => <Badge variant="destructive">Destructive</Badge>,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Variant_Outline: Story = {
|
|
36
|
+
render: () => <Badge variant="outline">Outline</Badge>,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Variant_Ghost: Story = {
|
|
40
|
+
render: () => <Badge variant="ghost">Ghost</Badge>,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Variant_Link: Story = {
|
|
44
|
+
render: () => <Badge variant="link">Link</Badge>,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const RealisticUse: Story = {
|
|
48
|
+
render: () => (<div className="flex items-center gap-2">
|
|
49
|
+
<Badge>Default</Badge>
|
|
50
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
51
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
52
|
+
<Badge variant="outline">Outline</Badge>
|
|
53
|
+
</div>),
|
|
54
|
+
};
|