@behavioral-agentic-design-system/core 0.38.0 → 0.39.1
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 +2 -2
- package/scripts/a11y-lint.cjs +47 -34
- package/scripts/a11y-ratchet.mjs +10 -23
- package/scripts/build-tokens.cjs +42 -5
- package/scripts/health-report.mjs +52 -10
- package/scripts/lib/scan-roots.cjs +143 -0
- package/scripts/lint-slop.mjs +21 -28
- package/scripts/lint-token-intent.mjs +10 -16
- package/scripts/size-audit.cjs +15 -27
- package/src/api/layers/file.ts +1 -0
- package/src/app/preview/components/page.tsx +366 -0
- package/src/app/preview/health/page.tsx +8 -5
- package/src/app/preview/history/page.tsx +11 -0
- package/src/app/shell.tsx +262 -86
- package/src/components/Foundations/Typography.stories.tsx +82 -21
- package/src/components/customize/discipline-section.tsx +94 -0
- package/src/components/customize-tab.tsx +2 -0
- package/src/components/ui/accordion.tsx +67 -5
- package/src/components/ui/alert.tsx +20 -7
- package/src/components/ui/avatar.tsx +18 -4
- package/src/components/ui/breadcrumb.tsx +47 -0
- package/src/components/ui/checkbox-card.tsx +48 -8
- package/src/components/ui/checkbox.tsx +17 -8
- package/src/components/ui/format-date.tsx +107 -0
- package/src/components/ui/progress.tsx +6 -5
- package/src/components/ui/sparkline.tsx +210 -0
- package/src/components/ui/tag.tsx +17 -1
- package/src/components/ui/tags-input.tsx +84 -11
- package/src/components/ui/toggle-group.tsx +13 -0
- package/src/components/ui/week-picker.tsx +463 -0
- package/src/data/docs-index.ts +11 -0
- package/src/data/history.json +269 -0
- package/src/stories/Accordion.stories.tsx +59 -1
- package/src/stories/ActionBar.stories.tsx +1 -1
- package/src/stories/Affix.stories.tsx +1 -1
- package/src/stories/AiBadge.stories.tsx +1 -1
- package/src/stories/Alert.stories.tsx +36 -1
- package/src/stories/AlertDialog.stories.tsx +1 -1
- package/src/stories/Anchor.stories.tsx +1 -1
- package/src/stories/AngleSlider.stories.tsx +1 -1
- package/src/stories/AspectRatio.stories.tsx +1 -1
- package/src/stories/Autocomplete.stories.tsx +1 -1
- package/src/stories/Avatar.stories.tsx +41 -1
- package/src/stories/Badge.stories.tsx +1 -1
- package/src/stories/Blockquote.stories.tsx +1 -1
- package/src/stories/BottomNavigation.stories.tsx +1 -1
- package/src/stories/Breadcrumb.stories.tsx +38 -5
- package/src/stories/Burger.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +9 -1
- package/src/stories/ButtonGroup.stories.tsx +1 -1
- package/src/stories/Calendar.stories.tsx +1 -1
- package/src/stories/Card.stories.tsx +1 -1
- package/src/stories/Carousel.stories.tsx +1 -1
- package/src/stories/Cascader.stories.tsx +1 -1
- package/src/stories/Chart.stories.tsx +1 -1
- package/src/stories/ChatBubble.stories.tsx +1 -1
- package/src/stories/ChatMarker.stories.tsx +1 -1
- package/src/stories/Checkbox.stories.tsx +36 -5
- package/src/stories/CheckboxCard.stories.tsx +37 -2
- package/src/stories/CheckboxGroup.stories.tsx +1 -1
- package/src/stories/Chip.stories.tsx +1 -1
- package/src/stories/CircularProgress.stories.tsx +17 -1
- package/src/stories/Clipboard.stories.tsx +1 -1
- package/src/stories/CloseButton.stories.tsx +1 -1
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/Collapsible.stories.tsx +1 -1
- package/src/stories/ColorPicker.stories.tsx +1 -1
- package/src/stories/ColorSwatch.stories.tsx +1 -1
- package/src/stories/Combobox.stories.tsx +1 -1
- package/src/stories/Command.stories.tsx +1 -1
- package/src/stories/Container.stories.tsx +1 -1
- package/src/stories/ContextMenu.stories.tsx +1 -1
- package/src/stories/CopyButton.stories.tsx +9 -1
- package/src/stories/DataList.stories.tsx +1 -1
- package/src/stories/DataTable.stories.tsx +1 -1
- package/src/stories/DateField.stories.tsx +1 -1
- package/src/stories/DatePicker.stories.tsx +1 -1
- package/src/stories/DateRangePicker.stories.tsx +1 -1
- package/src/stories/Dialog.stories.tsx +1 -1
- package/src/stories/Drawer.stories.tsx +1 -1
- package/src/stories/DropdownMenu.stories.tsx +1 -1
- package/src/stories/Editable.stories.tsx +1 -1
- package/src/stories/EmptyState.stories.tsx +1 -1
- package/src/stories/Field.stories.tsx +1 -1
- package/src/stories/Fieldset.stories.tsx +1 -1
- package/src/stories/FileButton.stories.tsx +1 -1
- package/src/stories/FileUpload.stories.tsx +1 -1
- package/src/stories/FloatLabel.stories.tsx +1 -1
- package/src/stories/FloatingActionButton.stories.tsx +1 -1
- package/src/stories/FloatingIndicator.stories.tsx +1 -1
- package/src/stories/FloatingPanel.stories.tsx +9 -1
- package/src/stories/FocusTrap.stories.tsx +1 -1
- package/src/stories/FormatByte.stories.tsx +1 -1
- package/src/stories/FormatDate.stories.tsx +174 -0
- package/src/stories/FormatNumber.stories.tsx +1 -1
- package/src/stories/Highlight.stories.tsx +1 -1
- package/src/stories/HoverCard.stories.tsx +1 -1
- package/src/stories/Image.stories.tsx +1 -1
- package/src/stories/Indicator.stories.tsx +17 -1
- package/src/stories/Input.stories.tsx +1 -1
- package/src/stories/InputClearButton.stories.tsx +1 -1
- package/src/stories/InputGroup.stories.tsx +1 -1
- package/src/stories/Kbd.stories.tsx +1 -1
- package/src/stories/KeyboardShortcut.stories.tsx +1 -1
- package/src/stories/Label.stories.tsx +1 -1
- package/src/stories/Link.stories.tsx +1 -1
- package/src/stories/List.stories.tsx +1 -1
- package/src/stories/Listbox.stories.tsx +1 -1
- package/src/stories/LoadingDots.stories.tsx +1 -1
- package/src/stories/LoadingOverlay.stories.tsx +1 -1
- package/src/stories/Mark.stories.tsx +1 -1
- package/src/stories/Marquee.stories.tsx +1 -1
- package/src/stories/Masonry.stories.tsx +1 -1
- package/src/stories/Menubar.stories.tsx +1 -1
- package/src/stories/Meter.stories.tsx +1 -1
- package/src/stories/MonthPicker.stories.tsx +1 -1
- package/src/stories/MotionToggle.stories.tsx +1 -1
- package/src/stories/MultiSelect.stories.tsx +1 -1
- package/src/stories/NativeSelect.stories.tsx +1 -1
- package/src/stories/NavLink.stories.tsx +1 -1
- package/src/stories/NavigationMenu.stories.tsx +1 -1
- package/src/stories/NavigationRail.stories.tsx +9 -1
- package/src/stories/Notification.stories.tsx +1 -1
- package/src/stories/NumberInput.stories.tsx +1 -1
- package/src/stories/Overlay.stories.tsx +1 -1
- package/src/stories/Pagination.stories.tsx +1 -1
- package/src/stories/PasswordInput.stories.tsx +1 -1
- package/src/stories/PinInput.stories.tsx +1 -1
- package/src/stories/Popover.stories.tsx +1 -1
- package/src/stories/Progress.stories.tsx +11 -1
- package/src/stories/Prose.stories.tsx +1 -1
- package/src/stories/QrCode.stories.tsx +1 -1
- package/src/stories/Questionnaire.stories.tsx +1 -1
- package/src/stories/RadioGroup.stories.tsx +1 -1
- package/src/stories/RatingGroup.stories.tsx +1 -1
- package/src/stories/Resizable.stories.tsx +1 -1
- package/src/stories/Result.stories.tsx +1 -1
- package/src/stories/Reveal.stories.tsx +1 -1
- package/src/stories/RollingNumber.stories.tsx +1 -1
- package/src/stories/ScrollArea.stories.tsx +1 -1
- package/src/stories/SearchInput.stories.tsx +1 -1
- package/src/stories/SegmentedControl.stories.tsx +1 -1
- package/src/stories/Select.stories.tsx +1 -1
- package/src/stories/Separator.stories.tsx +1 -1
- package/src/stories/Sheet.stories.tsx +10 -4
- package/src/stories/Sidebar.stories.tsx +1 -1
- package/src/stories/SignaturePad.stories.tsx +1 -1
- package/src/stories/SimpleGrid.stories.tsx +1 -1
- package/src/stories/Skeleton.stories.tsx +1 -1
- package/src/stories/SkeletonTable.stories.tsx +1 -1
- package/src/stories/SkipLink.stories.tsx +1 -1
- package/src/stories/Slider.stories.tsx +1 -1
- package/src/stories/Sonner.stories.tsx +1 -1
- package/src/stories/Sparkline.stories.tsx +244 -0
- package/src/stories/Spinner.stories.tsx +9 -1
- package/src/stories/Spoiler.stories.tsx +1 -1
- package/src/stories/Squircle.stories.tsx +1 -1
- package/src/stories/Stack.stories.tsx +1 -1
- package/src/stories/StatusBadge.stories.tsx +1 -1
- package/src/stories/Stepper.stories.tsx +1 -1
- package/src/stories/Switch.stories.tsx +1 -1
- package/src/stories/Table.stories.tsx +1 -1
- package/src/stories/Tabs.stories.tsx +1 -1
- package/src/stories/Tag.stories.tsx +23 -1
- package/src/stories/TagsInput.stories.tsx +46 -1
- package/src/stories/Text.stories.tsx +1 -1
- package/src/stories/Textarea.stories.tsx +1 -1
- package/src/stories/ThemeIcon.stories.tsx +1 -1
- package/src/stories/TimePicker.stories.tsx +1 -1
- package/src/stories/Timeline.stories.tsx +9 -1
- package/src/stories/Timer.stories.tsx +1 -1
- package/src/stories/Toggle.stories.tsx +1 -1
- package/src/stories/ToggleGroup.stories.tsx +21 -1
- package/src/stories/ToggleTip.stories.tsx +1 -1
- package/src/stories/Toolbar.stories.tsx +1 -1
- package/src/stories/Tooltip.stories.tsx +1 -1
- package/src/stories/Tour.stories.tsx +1 -1
- package/src/stories/TransferList.stories.tsx +1 -1
- package/src/stories/TreeSelect.stories.tsx +1 -1
- package/src/stories/TreeView.stories.tsx +1 -1
- package/src/stories/TypingIndicator.stories.tsx +1 -1
- package/src/stories/VisuallyHidden.stories.tsx +1 -1
- package/src/stories/Watermark.stories.tsx +1 -1
- package/src/stories/WeekPicker.stories.tsx +90 -0
- package/src/stories/WordRotate.stories.tsx +1 -1
- package/src/stories/YearPicker.stories.tsx +1 -1
- package/src/stories/story-groups.json +199 -0
|
@@ -8,7 +8,7 @@ import { RatingGroup } from "@behavioral-agentic-design-system/core/components/u
|
|
|
8
8
|
// the affordance rather than a decorative pop.
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof RatingGroup> = {
|
|
11
|
-
title: "Components/RatingGroup",
|
|
11
|
+
title: "Components/Selection/RatingGroup",
|
|
12
12
|
component: RatingGroup,
|
|
13
13
|
parameters: { layout: "centered" },
|
|
14
14
|
tags: ["autodocs"],
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@behavioral-agentic-design-system/core/components/ui/resizable";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof ResizablePanelGroup> = {
|
|
5
|
-
title: "Components/Resizable",
|
|
5
|
+
title: "Components/Layout/Resizable",
|
|
6
6
|
component: ResizablePanelGroup,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -5,7 +5,7 @@ import { Result } from "@behavioral-agentic-design-system/core/components/ui/res
|
|
|
5
5
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof Result> = {
|
|
8
|
-
title: "Components/Result",
|
|
8
|
+
title: "Components/Feedback/Result",
|
|
9
9
|
component: Result,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: "centered",
|
|
@@ -11,7 +11,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-de
|
|
|
11
11
|
* The stories document usage; the behavior is best seen live by scrolling.
|
|
12
12
|
*/
|
|
13
13
|
const meta: Meta<typeof Reveal> = {
|
|
14
|
-
title: "
|
|
14
|
+
title: "Components/Content and data/Reveal",
|
|
15
15
|
component: Reveal,
|
|
16
16
|
parameters: {
|
|
17
17
|
layout: "fullscreen",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof RollingNumber> = {
|
|
14
|
-
title: "Components/RollingNumber",
|
|
14
|
+
title: "Components/Content and data/RollingNumber",
|
|
15
15
|
component: RollingNumber,
|
|
16
16
|
parameters: {
|
|
17
17
|
layout: "centered",
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { ScrollArea } from "@behavioral-agentic-design-system/core/components/ui/scroll-area";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof ScrollArea> = {
|
|
5
|
-
title: "Components/ScrollArea",
|
|
5
|
+
title: "Components/Layout/ScrollArea",
|
|
6
6
|
component: ScrollArea,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -4,7 +4,7 @@ import { SearchInput } from "@behavioral-agentic-design-system/core/components/u
|
|
|
4
4
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof SearchInput> = {
|
|
7
|
-
title: "Components/SearchInput",
|
|
7
|
+
title: "Components/Forms/SearchInput",
|
|
8
8
|
component: SearchInput,
|
|
9
9
|
parameters: { layout: "centered" },
|
|
10
10
|
tags: ["autodocs"],
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "@behavioral-agentic-design-system/core/components/ui/segmented-control";
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof SegmentedControl> = {
|
|
16
|
-
title: "Components/SegmentedControl",
|
|
16
|
+
title: "Components/Selection/SegmentedControl",
|
|
17
17
|
component: SegmentedControl,
|
|
18
18
|
parameters: { layout: "centered" },
|
|
19
19
|
tags: ["autodocs"],
|
|
@@ -8,7 +8,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
8
8
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@behavioral-agentic-design-system/core/components/ui/select";
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof Select> = {
|
|
11
|
-
title: "Components/Select",
|
|
11
|
+
title: "Components/Selection/Select",
|
|
12
12
|
component: Select,
|
|
13
13
|
parameters: { layout: "centered" },
|
|
14
14
|
tags: ["autodocs"],
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Separator> = {
|
|
5
|
-
title: "Components/Separator",
|
|
5
|
+
title: "Components/Layout/Separator",
|
|
6
6
|
component: Separator,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -14,9 +14,18 @@ import { Input } from "@behavioral-agentic-design-system/core/components/ui/inpu
|
|
|
14
14
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
15
15
|
import { Textarea } from "@behavioral-agentic-design-system/core/components/ui/textarea";
|
|
16
16
|
import { Avatar, AvatarFallback } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
17
|
+
// A static import, not a require() inside render.
|
|
18
|
+
//
|
|
19
|
+
// This was `const { PortalThemeProvider } = require(...)` with an eslint-disable
|
|
20
|
+
// on it, which works under Node and is simply undefined in a browser bundle:
|
|
21
|
+
// the story threw `require is not defined` on every run. It went unnoticed
|
|
22
|
+
// because the Storybook a11y suite has been failing to start at all, so no
|
|
23
|
+
// story has actually executed in CI for some time — see vitest.config.ts.
|
|
24
|
+
import { PortalThemeProvider } from "@behavioral-agentic-design-system/core/hooks/use-portal-theme-class";
|
|
25
|
+
|
|
17
26
|
|
|
18
27
|
const meta: Meta<typeof Sheet> = {
|
|
19
|
-
title: "Components/Sheet",
|
|
28
|
+
title: "Components/Overlays/Sheet",
|
|
20
29
|
component: Sheet,
|
|
21
30
|
parameters: { layout: "centered" },
|
|
22
31
|
tags: ["autodocs"],
|
|
@@ -166,9 +175,6 @@ export const Side_Bottom_NoHandle: Story = {
|
|
|
166
175
|
// repository-level theme classes.
|
|
167
176
|
export const WithPortalTheme: Story = {
|
|
168
177
|
render: () => {
|
|
169
|
-
const { PortalThemeProvider } =
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
171
|
-
require("@behavioral-agentic-design-system/core/hooks/use-portal-theme-class");
|
|
172
178
|
return (
|
|
173
179
|
<PortalThemeProvider scope="dark">
|
|
174
180
|
<Sheet>
|
|
@@ -8,7 +8,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
8
8
|
import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider } from "@behavioral-agentic-design-system/core/components/ui/sidebar";
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof Sidebar> = {
|
|
11
|
-
title: "Components/Sidebar",
|
|
11
|
+
title: "Components/Navigation/Sidebar",
|
|
12
12
|
component: Sidebar,
|
|
13
13
|
parameters: { layout: "centered" },
|
|
14
14
|
tags: ["autodocs"],
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof SignaturePad> = {
|
|
16
|
-
title: "Components/SignaturePad",
|
|
16
|
+
title: "Components/Forms/SignaturePad",
|
|
17
17
|
component: SignaturePad,
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: "centered",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof SimpleGrid> = {
|
|
13
|
-
title: "Components/SimpleGrid",
|
|
13
|
+
title: "Components/Layout/SimpleGrid",
|
|
14
14
|
component: SimpleGrid,
|
|
15
15
|
parameters: { layout: "padded" },
|
|
16
16
|
tags: ["autodocs"],
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { Skeleton, SkeletonRegion } from "@behavioral-agentic-design-system/core/components/ui/skeleton";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Skeleton> = {
|
|
5
|
-
title: "Components/Skeleton",
|
|
5
|
+
title: "Components/Feedback/Skeleton",
|
|
6
6
|
component: Skeleton,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
// under the file's real meta instead — mis-titled and impossible to find under
|
|
17
17
|
// its own name in the sidebar.
|
|
18
18
|
const meta: Meta<typeof SkeletonTable> = {
|
|
19
|
-
title: "Components/SkeletonTable",
|
|
19
|
+
title: "Components/Feedback/SkeletonTable",
|
|
20
20
|
component: SkeletonTable,
|
|
21
21
|
parameters: { layout: "padded" },
|
|
22
22
|
tags: ["autodocs"],
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof SkipLink> = {
|
|
16
|
-
title: "Components/SkipLink",
|
|
16
|
+
title: "Components/Navigation/SkipLink",
|
|
17
17
|
component: SkipLink,
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: "padded",
|
|
@@ -9,7 +9,7 @@ import { Slider } from "@behavioral-agentic-design-system/core/components/ui/sli
|
|
|
9
9
|
* border. Documented AAA exception lives in CLAUDE.md → Known AAA exceptions.
|
|
10
10
|
*/
|
|
11
11
|
const meta: Meta<typeof Slider> = {
|
|
12
|
-
title: "Components/Slider",
|
|
12
|
+
title: "Components/Selection/Slider",
|
|
13
13
|
component: Slider,
|
|
14
14
|
parameters: {
|
|
15
15
|
layout: "centered",
|
|
@@ -4,7 +4,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
4
4
|
import { toast } from "sonner";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Toaster> = {
|
|
7
|
-
title: "Components/Sonner",
|
|
7
|
+
title: "Components/Feedback/Sonner",
|
|
8
8
|
component: Toaster,
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: "centered",
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { Sparkline } from "@behavioral-agentic-design-system/core/components/ui/sparkline"
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
CardDescription,
|
|
10
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
11
|
+
import { FormatNumber } from "@behavioral-agentic-design-system/core/components/ui/format-number"
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Sparkline> = {
|
|
14
|
+
title: "Components/Content and data/Sparkline",
|
|
15
|
+
component: Sparkline,
|
|
16
|
+
parameters: { layout: "centered" },
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
argTypes: {
|
|
19
|
+
type: { control: "select", options: ["area", "line"] },
|
|
20
|
+
curveType: { control: "select", options: ["linear", "monotone", "step"] },
|
|
21
|
+
height: { control: "number" },
|
|
22
|
+
withDot: { control: "boolean" },
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default meta
|
|
27
|
+
type Story = StoryObj<typeof meta>
|
|
28
|
+
|
|
29
|
+
// Revenue figures from content/personas/bads.json → primary.metrics.monthly
|
|
30
|
+
const REVENUE_DATA = [24000, 27500, 25800, 31200, 29400, 34100, 32600, 36200]
|
|
31
|
+
// User signups (positive trend)
|
|
32
|
+
const USER_DATA = [82, 95, 104, 98, 117, 131, 128, 142]
|
|
33
|
+
// Churn rate (declining = good; slightly bumpy)
|
|
34
|
+
const CHURN_DATA = [8.2, 7.9, 8.5, 7.4, 7.1, 6.8, 6.3, 6.0]
|
|
35
|
+
// Negative / mixed dataset
|
|
36
|
+
const NEGATIVE_DATA = [-12, 4, -8, 15, -3, 22, 8, -5]
|
|
37
|
+
// Flat dataset — a metric that hasn't moved. Exercises the `max === min`
|
|
38
|
+
// branch of the domain padding, which is the only path where the series has
|
|
39
|
+
// no range of its own to scale against.
|
|
40
|
+
const FLAT_DATA = [64, 64, 64, 64, 64, 64, 64, 64]
|
|
41
|
+
|
|
42
|
+
export const Default: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<div className="flex flex-col gap-2">
|
|
45
|
+
<Sparkline
|
|
46
|
+
data={REVENUE_DATA}
|
|
47
|
+
className="w-32"
|
|
48
|
+
aria-label="Monthly revenue trend"
|
|
49
|
+
/>
|
|
50
|
+
<p className="text-xs text-muted-foreground">
|
|
51
|
+
Area chart (default) — 40px height, monotone curve
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
),
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const WithLine: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<div className="flex flex-col gap-2">
|
|
60
|
+
<Sparkline
|
|
61
|
+
data={USER_DATA}
|
|
62
|
+
type="line"
|
|
63
|
+
className="w-32"
|
|
64
|
+
aria-label="User signup trend"
|
|
65
|
+
/>
|
|
66
|
+
<p className="text-xs text-muted-foreground">
|
|
67
|
+
Line chart variant — no fill, same stroke weight
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
),
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const WithDot: Story = {
|
|
74
|
+
render: () => (
|
|
75
|
+
<div className="flex flex-col gap-2">
|
|
76
|
+
<Sparkline
|
|
77
|
+
data={REVENUE_DATA}
|
|
78
|
+
withDot
|
|
79
|
+
className="w-32"
|
|
80
|
+
aria-label="Monthly revenue with current value dot"
|
|
81
|
+
/>
|
|
82
|
+
<p className="text-xs text-muted-foreground">
|
|
83
|
+
withDot — marks the last data point as the current value
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
86
|
+
),
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const Negative: Story = {
|
|
90
|
+
render: () => (
|
|
91
|
+
<div className="flex flex-col gap-4">
|
|
92
|
+
<div className="flex flex-col gap-1">
|
|
93
|
+
<Sparkline
|
|
94
|
+
data={NEGATIVE_DATA}
|
|
95
|
+
type="area"
|
|
96
|
+
className="w-32"
|
|
97
|
+
aria-label="Mixed positive and negative trend"
|
|
98
|
+
/>
|
|
99
|
+
<p className="text-xs text-muted-foreground">Area — mixed sign data</p>
|
|
100
|
+
</div>
|
|
101
|
+
<div className="flex flex-col gap-1">
|
|
102
|
+
<Sparkline
|
|
103
|
+
data={NEGATIVE_DATA}
|
|
104
|
+
type="line"
|
|
105
|
+
color="var(--color-destructive)"
|
|
106
|
+
className="w-32"
|
|
107
|
+
aria-label="Mixed trend line in destructive color"
|
|
108
|
+
/>
|
|
109
|
+
<p className="text-xs text-muted-foreground">
|
|
110
|
+
Line — destructive color, negative-first dataset
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
),
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const FlatData: Story = {
|
|
118
|
+
// Two sparklines side by side is the point of this story: it proves the flat
|
|
119
|
+
// path centres the series in both area and line mode. That can't be driven
|
|
120
|
+
// from a single set of args, so the Controls panel is disabled rather than
|
|
121
|
+
// left present and inert (check:story-controls).
|
|
122
|
+
parameters: { controls: { disable: true } },
|
|
123
|
+
render: () => (
|
|
124
|
+
<div className="flex flex-col gap-4">
|
|
125
|
+
<div className="flex flex-col gap-1">
|
|
126
|
+
<Sparkline
|
|
127
|
+
data={FLAT_DATA}
|
|
128
|
+
type="area"
|
|
129
|
+
className="w-32"
|
|
130
|
+
aria-label="Flat trend, no change over the period"
|
|
131
|
+
/>
|
|
132
|
+
<p className="text-xs text-muted-foreground">Area — no change</p>
|
|
133
|
+
</div>
|
|
134
|
+
<div className="flex flex-col gap-1">
|
|
135
|
+
<Sparkline
|
|
136
|
+
data={FLAT_DATA}
|
|
137
|
+
type="line"
|
|
138
|
+
className="w-32"
|
|
139
|
+
aria-label="Flat trend line, no change over the period"
|
|
140
|
+
/>
|
|
141
|
+
<p className="text-xs text-muted-foreground">
|
|
142
|
+
Line — the series sits mid-box rather than pinned to an edge
|
|
143
|
+
</p>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
),
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const RealisticUse: Story = {
|
|
150
|
+
render: () => {
|
|
151
|
+
const stats = [
|
|
152
|
+
{
|
|
153
|
+
label: "Revenue",
|
|
154
|
+
value: 36200,
|
|
155
|
+
format: "currency",
|
|
156
|
+
data: REVENUE_DATA,
|
|
157
|
+
trend: "+6.4%",
|
|
158
|
+
trendUp: true,
|
|
159
|
+
ariaLabel: "Monthly revenue trend",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
label: "Active users",
|
|
163
|
+
value: 142,
|
|
164
|
+
format: "number",
|
|
165
|
+
data: USER_DATA,
|
|
166
|
+
trend: "+10.9%",
|
|
167
|
+
trendUp: true,
|
|
168
|
+
ariaLabel: "Monthly active users trend",
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: "Churn rate",
|
|
172
|
+
value: 6.0,
|
|
173
|
+
format: "percent",
|
|
174
|
+
data: CHURN_DATA,
|
|
175
|
+
trend: "−0.3pp",
|
|
176
|
+
trendUp: false,
|
|
177
|
+
ariaLabel: "Monthly churn rate trend",
|
|
178
|
+
},
|
|
179
|
+
]
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<Card className="w-[480px]">
|
|
183
|
+
<CardHeader>
|
|
184
|
+
<CardTitle>Engagement health</CardTitle>
|
|
185
|
+
<CardDescription>
|
|
186
|
+
BADS — Austin design systems team, last 8 months
|
|
187
|
+
</CardDescription>
|
|
188
|
+
</CardHeader>
|
|
189
|
+
<CardContent>
|
|
190
|
+
<div className="grid grid-cols-3 gap-4">
|
|
191
|
+
{stats.map((stat) => (
|
|
192
|
+
<div key={stat.label} className="flex flex-col gap-2">
|
|
193
|
+
<p className="text-xs font-medium text-muted-foreground">
|
|
194
|
+
{stat.label}
|
|
195
|
+
</p>
|
|
196
|
+
<p className="text-lg font-semibold tabular-nums text-foreground">
|
|
197
|
+
{stat.format === "currency" ? (
|
|
198
|
+
<FormatNumber
|
|
199
|
+
value={stat.value}
|
|
200
|
+
style="currency"
|
|
201
|
+
currency="USD"
|
|
202
|
+
notation="compact"
|
|
203
|
+
/>
|
|
204
|
+
) : stat.format === "percent" ? (
|
|
205
|
+
<FormatNumber
|
|
206
|
+
value={stat.value / 100}
|
|
207
|
+
style="percent"
|
|
208
|
+
maximumFractionDigits={1}
|
|
209
|
+
/>
|
|
210
|
+
) : (
|
|
211
|
+
<FormatNumber value={stat.value} />
|
|
212
|
+
)}
|
|
213
|
+
</p>
|
|
214
|
+
<Sparkline
|
|
215
|
+
data={stat.data}
|
|
216
|
+
withDot
|
|
217
|
+
height={36}
|
|
218
|
+
className="w-full"
|
|
219
|
+
color={
|
|
220
|
+
stat.label === "Churn rate"
|
|
221
|
+
? "var(--color-destructive)"
|
|
222
|
+
: "var(--color-primary)"
|
|
223
|
+
}
|
|
224
|
+
aria-label={stat.ariaLabel}
|
|
225
|
+
/>
|
|
226
|
+
<p
|
|
227
|
+
className="text-xs font-medium"
|
|
228
|
+
style={{
|
|
229
|
+
color:
|
|
230
|
+
stat.label === "Churn rate"
|
|
231
|
+
? "var(--color-destructive)"
|
|
232
|
+
: "var(--color-primary)",
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
235
|
+
{stat.trend}
|
|
236
|
+
</p>
|
|
237
|
+
</div>
|
|
238
|
+
))}
|
|
239
|
+
</div>
|
|
240
|
+
</CardContent>
|
|
241
|
+
</Card>
|
|
242
|
+
)
|
|
243
|
+
},
|
|
244
|
+
}
|
|
@@ -3,7 +3,7 @@ import { Spinner } from "@behavioral-agentic-design-system/core/components/ui/sp
|
|
|
3
3
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Spinner> = {
|
|
6
|
-
title: "Components/Spinner",
|
|
6
|
+
title: "Components/Feedback/Spinner",
|
|
7
7
|
component: Spinner,
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: "centered",
|
|
@@ -56,7 +56,15 @@ export const Size_Lg: Story = {
|
|
|
56
56
|
render: () => <Spinner size="lg" />,
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Every option at once, for a person comparing them side by side.
|
|
61
|
+
*
|
|
62
|
+
* Tagged out of the machine-readable manifest: an assistant reading this as an
|
|
63
|
+
* example learns to render a gallery of variants where a screen was asked for.
|
|
64
|
+
* It stays visible in the sidebar, where a human reads it as the reference it is.
|
|
65
|
+
*/
|
|
59
66
|
export const AllSizes: Story = {
|
|
67
|
+
tags: ["!manifest"],
|
|
60
68
|
render: () => (
|
|
61
69
|
<div className="flex items-center gap-4">
|
|
62
70
|
<Spinner size="xs" />
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof Spoiler> = {
|
|
13
|
-
title: "Components/Spoiler",
|
|
13
|
+
title: "Components/Layout/Spoiler",
|
|
14
14
|
component: Spoiler,
|
|
15
15
|
parameters: { layout: "centered" },
|
|
16
16
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import { Squircle } from "@behavioral-agentic-design-system/core/components/ui/s
|
|
|
3
3
|
import { Card } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Squircle> = {
|
|
6
|
-
title: "Components/Squircle",
|
|
6
|
+
title: "Components/Layout/Squircle",
|
|
7
7
|
component: Squircle,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -5,7 +5,7 @@ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badg
|
|
|
5
5
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
6
|
|
|
7
7
|
const meta: Meta = {
|
|
8
|
-
title: "Components/Stack",
|
|
8
|
+
title: "Components/Layout/Stack",
|
|
9
9
|
parameters: { layout: "centered" },
|
|
10
10
|
tags: ["autodocs"],
|
|
11
11
|
};
|
|
@@ -13,7 +13,7 @@ import { StatusBadge } from "@behavioral-agentic-design-system/core/components/u
|
|
|
13
13
|
* prefers-reduced-motion rule stills it automatically.
|
|
14
14
|
*/
|
|
15
15
|
const meta: Meta<typeof StatusBadge> = {
|
|
16
|
-
title: "Components/StatusBadge",
|
|
16
|
+
title: "Components/Feedback/StatusBadge",
|
|
17
17
|
component: StatusBadge,
|
|
18
18
|
parameters: { layout: "centered" },
|
|
19
19
|
tags: ["autodocs"],
|
|
@@ -11,7 +11,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof Stepper> = {
|
|
14
|
-
title: "Components/Stepper",
|
|
14
|
+
title: "Components/Navigation/Stepper",
|
|
15
15
|
component: Stepper,
|
|
16
16
|
parameters: {
|
|
17
17
|
layout: "centered",
|
|
@@ -3,7 +3,7 @@ import { Switch } from "@behavioral-agentic-design-system/core/components/ui/swi
|
|
|
3
3
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Switch> = {
|
|
6
|
-
title: "Components/Switch",
|
|
6
|
+
title: "Components/Selection/Switch",
|
|
7
7
|
component: Switch,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@behavioral-agentic-design-system/core/components/ui/table";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Table> = {
|
|
5
|
-
title: "Components/Table",
|
|
5
|
+
title: "Components/Content and data/Table",
|
|
6
6
|
component: Table,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Tag } from "@behavioral-agentic-design-system/core/components/ui/tag";
|
|
3
|
+
import { Check, AlertTriangle, Info, Zap } from "lucide-react";
|
|
3
4
|
|
|
4
5
|
const meta: Meta<typeof Tag> = {
|
|
5
|
-
title: "Components/Tag",
|
|
6
|
+
title: "Components/Badges and avatars/Tag",
|
|
6
7
|
component: Tag,
|
|
7
8
|
parameters: { layout: "centered" },
|
|
8
9
|
tags: ["autodocs"],
|
|
@@ -73,6 +74,27 @@ export const Size_LG: Story = {
|
|
|
73
74
|
</div>),
|
|
74
75
|
};
|
|
75
76
|
|
|
77
|
+
export const Variant_WithIcon: Story = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<div className="flex items-center gap-2 flex-wrap">
|
|
80
|
+
<Tag variant="success" label="Verified" icon={<Check strokeWidth={1.5} />} />
|
|
81
|
+
<Tag variant="warning" label="Needs review" icon={<AlertTriangle strokeWidth={1.5} />} />
|
|
82
|
+
<Tag variant="info" label="Tip" icon={<Info strokeWidth={1.5} />} />
|
|
83
|
+
<Tag variant="default" label="New feature" icon={<Zap strokeWidth={1.5} />} />
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const Variant_IconAndDismiss: Story = {
|
|
89
|
+
render: () => (
|
|
90
|
+
<div className="flex items-center gap-2 flex-wrap">
|
|
91
|
+
<Tag label="design-tokens" icon={<Zap strokeWidth={1.5} />} onClose={() => {}} />
|
|
92
|
+
<Tag variant="success" size="sm" label="shipped" icon={<Check strokeWidth={1.5} />} onClose={() => {}} />
|
|
93
|
+
<Tag variant="info" size="lg" label="in review" icon={<Info strokeWidth={1.5} />} onClose={() => {}} />
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
76
98
|
export const RealisticUse: Story = {
|
|
77
99
|
render: () => (<div className="flex items-center gap-2 flex-wrap">
|
|
78
100
|
<Tag label="Design" onClose={() => {}} />
|