@behavioral-agentic-design-system/core 0.42.0 → 0.47.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 +38 -8
- package/scripts/a11y-lint.cjs +101 -14
- package/scripts/bads-sync.mjs +1 -1
- package/scripts/build-tokens.cjs +122 -7
- package/scripts/check-dark-contrast.mjs +204 -0
- package/scripts/check-flush-edges.mjs +245 -0
- package/scripts/check-spec.mjs +73 -0
- package/scripts/deal-directions.mjs +186 -0
- package/scripts/design-system-advisory/README.md +239 -0
- package/scripts/design-system-advisory/check-copy-punctuation.mjs +44 -0
- package/scripts/design-system-advisory/check-even-padding.mjs +35 -0
- package/scripts/design-system-advisory/check-hand-built-button.mjs +46 -0
- package/scripts/design-system-advisory/check-html-nesting.mjs +51 -0
- package/scripts/design-system-advisory/check-icon-sizing.mjs +79 -0
- package/scripts/design-system-advisory/check-label-case.mjs +92 -0
- package/scripts/design-system-advisory/check-native-form-controls.mjs +53 -0
- package/scripts/design-system-advisory/check-radius.mjs +56 -0
- package/scripts/design-system-advisory/check-raw-values.mjs +61 -0
- package/scripts/design-system-advisory/check-small-text.mjs +72 -0
- package/scripts/design-system-advisory/check-tap-target.mjs +70 -0
- package/scripts/design-system-advisory/defaults.mjs +90 -0
- package/scripts/design-system-advisory/fixtures/clean.tsx.fixture +12 -0
- package/scripts/design-system-advisory/fixtures/violations.tsx.fixture +19 -0
- package/scripts/design-system-advisory/lib.mjs +255 -0
- package/scripts/design-system-advisory/run.mjs +189 -0
- package/scripts/design-system-advisory/workflow.yml +82 -0
- package/scripts/health-report.mjs +20 -14
- package/scripts/lib/copy-strings.mjs +146 -0
- package/scripts/lib/counted-lint.mjs +100 -0
- package/scripts/lib/dark-contrast.mjs +120 -0
- package/scripts/lib/flush-edges.mjs +294 -0
- package/scripts/lib/lab-lint.mjs +62 -0
- package/scripts/lib/marketing-library.mjs +129 -0
- package/scripts/lib/mount-page.mjs +25 -0
- package/scripts/lib/on-system.mjs +249 -0
- package/scripts/lib/random.mjs +22 -0
- package/scripts/lib/source-scan.mjs +173 -0
- package/scripts/lib/spec-parse.d.mts +25 -0
- package/scripts/lib/spec-parse.mjs +188 -0
- package/scripts/lib/tells.mjs +366 -0
- package/scripts/lint-arbitrary-tokens.mjs +47 -0
- package/scripts/lint-component-token-refs.mjs +63 -0
- package/scripts/lint-content-hierarchy.mjs +114 -0
- package/scripts/lint-control-baseline.mjs +72 -0
- package/scripts/lint-copy-punctuation.mjs +60 -0
- package/scripts/lint-css-vars.mjs +175 -0
- package/scripts/lint-even-padding.mjs +58 -0
- package/scripts/lint-html-nesting.mjs +116 -0
- package/scripts/lint-label-case.mjs +219 -0
- package/scripts/lint-live-ctas.mjs +138 -0
- package/scripts/lint-microanimation.mjs +2 -2
- package/scripts/lint-proximity.mjs +181 -0
- package/scripts/lint-slop.mjs +1 -1
- package/scripts/lint-spacing-scale.mjs +78 -0
- package/scripts/lint-target-size.cjs +132 -0
- package/scripts/lint-token-primitives.mjs +307 -0
- package/scripts/on-system-score.mjs +95 -0
- package/scripts/size-audit.cjs +2 -2
- package/scripts/slop-rules.mjs +1 -1
- package/scripts/source-images.mjs +180 -0
- package/scripts/ux-tells.mjs +80 -0
- package/scripts/wcag-audit.cjs +25 -4
- package/src/api/brand-colors.ts +3 -0
- package/src/api/brand-fonts.ts +3 -0
- package/src/api/brand-mark.ts +6 -1
- package/src/api/dev-write-guard.ts +53 -0
- package/src/api/layers/file.ts +9 -4
- package/src/api/onboarding-extract.ts +85 -30
- package/src/api/onboarding.ts +3 -0
- package/src/api/save-tokens.ts +3 -0
- package/src/api/site-auth.ts +14 -2
- package/src/app/layout.tsx +6 -0
- package/src/app/preview/canvas/page.tsx +12 -0
- package/src/app/preview/components/page.tsx +828 -14
- package/src/app/preview/sticker-sheet/page.tsx +329 -0
- package/src/app/preview/sticker-sheet/specimens.tsx +296 -0
- package/src/app/preview/studio/blank-screen.tsx +143 -0
- package/src/app/preview/studio/page.tsx +7 -0
- package/src/app/shell.tsx +164 -47
- package/src/components/Foundations/Colors.stories.tsx +119 -8
- package/src/components/canvas/canvas.tsx +458 -0
- package/src/components/canvas/layout.ts +72 -0
- package/src/components/canvas/parse-canvas.ts +32 -0
- package/src/components/canvas/sample.ts +90 -0
- package/src/components/canvas/spec-frame.tsx +43 -0
- package/src/components/canvas/types.ts +33 -0
- package/src/components/docs-tab.tsx +7 -7
- package/src/components/home-recent.tsx +73 -0
- package/src/components/home-tab.tsx +19 -14
- package/src/components/layers-tab.tsx +2 -2
- package/src/components/markdown-preview.tsx +60 -12
- package/src/components/onboarding-wizard.tsx +1 -1
- package/src/components/studio/control-panel.tsx +299 -0
- package/src/components/studio/control-row.tsx +77 -0
- package/src/components/studio/preview-frame.tsx +165 -0
- package/src/components/studio/preview-pane.tsx +247 -0
- package/src/components/studio/studio.tsx +133 -128
- package/src/components/studio/types.ts +218 -0
- package/src/components/studio/use-studio-tweaks.ts +128 -0
- package/src/components/studio/use-studio-view-state.ts +72 -0
- package/src/components/ui/autocomplete.tsx +1 -1
- package/src/components/ui/avatar.tsx +4 -0
- package/src/components/ui/chart.tsx +134 -42
- package/src/components/ui/checkbox-group.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/color-picker.tsx +20 -4
- package/src/components/ui/combobox.tsx +1 -0
- package/src/components/ui/command.tsx +1 -1
- package/src/components/ui/data-table.tsx +64 -3
- package/src/components/ui/date-field.tsx +1 -1
- package/src/components/ui/date-picker.tsx +2 -0
- package/src/components/ui/date-range-picker.tsx +4 -0
- package/src/components/ui/editable.tsx +1 -0
- package/src/components/ui/faceted-filter.tsx +187 -0
- package/src/components/ui/file-upload.tsx +21 -2
- package/src/components/ui/gauge-chart.tsx +18 -4
- package/src/components/ui/heatmap.tsx +3 -1
- package/src/components/ui/inline-edit.tsx +175 -0
- package/src/components/ui/input-group.tsx +5 -2
- package/src/components/ui/month-picker.tsx +1 -1
- package/src/components/ui/multi-select.tsx +1 -0
- package/src/components/ui/number-input.tsx +28 -5
- package/src/components/ui/otp-input.tsx +208 -0
- package/src/components/ui/phone-input.tsx +274 -0
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/search-input.tsx +1 -1
- package/src/components/ui/sparkline.tsx +33 -4
- package/src/components/ui/spinner.tsx +23 -4
- package/src/components/ui/table.tsx +9 -0
- package/src/components/ui/tags-input.tsx +1 -1
- package/src/components/ui/timer.tsx +1 -0
- package/src/components/ui/transfer-list.tsx +13 -26
- package/src/components/ui/week-picker.tsx +1 -13
- package/src/components/ui/year-picker.tsx +1 -1
- package/src/data/component-added.json +966 -0
- package/src/data/docs-index.ts +35 -2
- package/src/data/history.json +161 -161
- package/src/data/sticker-sheet.json +9244 -0
- package/src/docs-trace-globs.json +1 -0
- package/src/hooks/use-global-mono-font.ts +1 -0
- package/src/hooks/use-global-primary-color.ts +1 -0
- package/src/hooks/use-global-sans-font.ts +1 -0
- package/src/hooks/use-global-serif-font.ts +1 -0
- package/src/hooks/use-global-type-scale.ts +17 -2
- package/src/hooks/use-mobile.ts +2 -0
- package/src/hooks/use-sync-type-scale.ts +7 -11
- package/src/lib/chart-motion.ts +41 -0
- package/src/lib/get-icon-color.ts +1 -1
- package/src/lib/spec-parse.ts +4 -0
- package/src/lib/svg-sanitize.ts +19 -9
- package/src/stories/Accordion.stories.tsx +7 -0
- package/src/stories/ActionBar.stories.tsx +5 -0
- package/src/stories/Affix.stories.tsx +4 -0
- package/src/stories/AiBadge.stories.tsx +9 -7
- package/src/stories/Alert.stories.tsx +13 -0
- package/src/stories/AlertDialog.stories.tsx +4 -0
- package/src/stories/Anchor.stories.tsx +5 -0
- package/src/stories/AngleSlider.stories.tsx +6 -3
- package/src/stories/AspectRatio.stories.tsx +4 -0
- package/src/stories/Autocomplete.stories.tsx +8 -0
- package/src/stories/Avatar.stories.tsx +10 -0
- package/src/stories/Badge.stories.tsx +14 -6
- package/src/stories/Blockquote.stories.tsx +6 -0
- package/src/stories/BottomNavigation.stories.tsx +4 -0
- package/src/stories/Breadcrumb.stories.tsx +3 -0
- package/src/stories/Burger.stories.tsx +1 -0
- package/src/stories/Button.stories.tsx +24 -0
- package/src/stories/ButtonGroup.stories.tsx +9 -0
- package/src/stories/Calendar.stories.tsx +3 -0
- package/src/stories/Canvas.stories.tsx +45 -0
- package/src/stories/Card.stories.tsx +4 -0
- package/src/stories/Carousel.stories.tsx +6 -0
- package/src/stories/Cascader.stories.tsx +4 -0
- package/src/stories/Chart.stories.tsx +46 -1
- package/src/stories/ChatBubble.stories.tsx +8 -2
- package/src/stories/ChatMarker.stories.tsx +1 -0
- package/src/stories/Checkbox.stories.tsx +40 -0
- package/src/stories/CheckboxCard.stories.tsx +8 -0
- package/src/stories/CheckboxGroup.stories.tsx +19 -0
- package/src/stories/Chip.stories.tsx +10 -19
- package/src/stories/CircularProgress.stories.tsx +13 -27
- package/src/stories/Clipboard.stories.tsx +6 -0
- package/src/stories/CloseButton.stories.tsx +6 -4
- package/src/stories/Code.stories.tsx +8 -1
- package/src/stories/Collapsible.stories.tsx +2 -0
- package/src/stories/ColorPicker.stories.tsx +46 -0
- package/src/stories/ColorSwatch.stories.tsx +1 -0
- package/src/stories/Combobox.stories.tsx +9 -0
- package/src/stories/Command.stories.tsx +2 -0
- package/src/stories/Container.stories.tsx +8 -0
- package/src/stories/ContextMenu.stories.tsx +9 -0
- package/src/stories/CopyButton.stories.tsx +12 -36
- package/src/stories/DataList.stories.tsx +8 -0
- package/src/stories/DataTable.stories.tsx +39 -0
- package/src/stories/DateField.stories.tsx +28 -0
- package/src/stories/DatePicker.stories.tsx +34 -0
- package/src/stories/DateRangePicker.stories.tsx +32 -0
- package/src/stories/Dialog.stories.tsx +8 -0
- package/src/stories/Drawer.stories.tsx +6 -0
- package/src/stories/DropdownMenu.stories.tsx +2 -0
- package/src/stories/Editable.stories.tsx +12 -0
- package/src/stories/EmptyState.stories.tsx +9 -0
- package/src/stories/FacetedFilter.stories.tsx +197 -0
- package/src/stories/Field.stories.tsx +7 -0
- package/src/stories/Fieldset.stories.tsx +8 -0
- package/src/stories/FileButton.stories.tsx +4 -0
- package/src/stories/FileUpload.stories.tsx +16 -17
- package/src/stories/FloatLabel.stories.tsx +3 -8
- package/src/stories/FloatingActionButton.stories.tsx +10 -0
- package/src/stories/FloatingIndicator.stories.tsx +4 -0
- package/src/stories/FloatingPanel.stories.tsx +6 -0
- package/src/stories/FocusTrap.stories.tsx +5 -0
- package/src/stories/FormatByte.stories.tsx +6 -0
- package/src/stories/FormatDate.stories.tsx +8 -0
- package/src/stories/FormatNumber.stories.tsx +9 -0
- package/src/stories/GaugeChart.stories.tsx +9 -3
- package/src/stories/Heatmap.stories.tsx +11 -0
- package/src/stories/Highlight.stories.tsx +6 -0
- package/src/stories/HoverCard.stories.tsx +4 -0
- package/src/stories/Image.stories.tsx +9 -0
- package/src/stories/Indicator.stories.tsx +19 -0
- package/src/stories/InlineEdit.stories.tsx +106 -0
- package/src/stories/Input.stories.tsx +7 -0
- package/src/stories/InputClearButton.stories.tsx +3 -0
- package/src/stories/InputGroup.stories.tsx +40 -0
- package/src/stories/Kbd.stories.tsx +7 -1
- package/src/stories/KeyboardShortcut.stories.tsx +2 -0
- package/src/stories/Label.stories.tsx +2 -0
- package/src/stories/Link.stories.tsx +9 -0
- package/src/stories/List.stories.tsx +8 -0
- package/src/stories/Listbox.stories.tsx +1 -0
- package/src/stories/LoadingDots.stories.tsx +5 -3
- package/src/stories/LoadingOverlay.stories.tsx +5 -1
- package/src/stories/Mark.stories.tsx +5 -0
- package/src/stories/MarkdownPreview.stories.tsx +53 -0
- package/src/stories/Marquee.stories.tsx +4 -0
- package/src/stories/Masonry.stories.tsx +5 -0
- package/src/stories/Menubar.stories.tsx +3 -0
- package/src/stories/Meter.stories.tsx +11 -17
- package/src/stories/MonthPicker.stories.tsx +26 -1
- package/src/stories/MotionToggle.stories.tsx +1 -0
- package/src/stories/MultiSelect.stories.tsx +9 -0
- package/src/stories/NativeSelect.stories.tsx +1 -0
- package/src/stories/NavLink.stories.tsx +7 -0
- package/src/stories/NavigationMenu.stories.tsx +5 -0
- package/src/stories/NavigationRail.stories.tsx +10 -0
- package/src/stories/Notification.stories.tsx +13 -34
- package/src/stories/NumberInput.stories.tsx +33 -1
- package/src/stories/OtpInput.stories.tsx +110 -0
- package/src/stories/Overlay.stories.tsx +5 -1
- package/src/stories/Pagination.stories.tsx +8 -0
- package/src/stories/PasswordInput.stories.tsx +2 -0
- package/src/stories/PhoneInput.stories.tsx +127 -0
- package/src/stories/PinInput.stories.tsx +9 -2
- package/src/stories/Popover.stories.tsx +2 -0
- package/src/stories/Progress.stories.tsx +6 -1
- package/src/stories/Prose.stories.tsx +8 -0
- package/src/stories/QrCode.stories.tsx +2 -0
- package/src/stories/Questionnaire.stories.tsx +7 -0
- package/src/stories/RadioGroup.stories.tsx +40 -0
- package/src/stories/RatingGroup.stories.tsx +8 -4
- package/src/stories/Resizable.stories.tsx +4 -2
- package/src/stories/Result.stories.tsx +3 -0
- package/src/stories/Reveal.stories.tsx +2 -0
- package/src/stories/RollingNumber.stories.tsx +5 -0
- package/src/stories/ScrollArea.stories.tsx +3 -1
- package/src/stories/SearchInput.stories.tsx +10 -6
- package/src/stories/SegmentedControl.stories.tsx +11 -0
- package/src/stories/Select.stories.tsx +7 -0
- package/src/stories/Separator.stories.tsx +6 -0
- package/src/stories/Sheet.stories.tsx +5 -0
- package/src/stories/Sidebar.stories.tsx +40 -1
- package/src/stories/SimpleGrid.stories.tsx +5 -0
- package/src/stories/Skeleton.stories.tsx +8 -0
- package/src/stories/SkeletonTable.stories.tsx +6 -5
- package/src/stories/SkipLink.stories.tsx +3 -0
- package/src/stories/Slider.stories.tsx +2 -1
- package/src/stories/Sonner.stories.tsx +7 -0
- package/src/stories/Sparkline.stories.tsx +14 -1
- package/src/stories/Spinner.stories.tsx +20 -10
- package/src/stories/Spoiler.stories.tsx +5 -0
- package/src/stories/Squircle.stories.tsx +7 -0
- package/src/stories/Stack.stories.tsx +7 -0
- package/src/stories/StatusBadge.stories.tsx +12 -6
- package/src/stories/Stepper.stories.tsx +5 -0
- package/src/stories/Switch.stories.tsx +4 -0
- package/src/stories/Table.stories.tsx +10 -1
- package/src/stories/Tabs.stories.tsx +8 -0
- package/src/stories/Tag.stories.tsx +13 -5
- package/src/stories/TagsInput.stories.tsx +15 -0
- package/src/stories/Text.stories.tsx +12 -0
- package/src/stories/Textarea.stories.tsx +9 -0
- package/src/stories/ThemeIcon.stories.tsx +6 -3
- package/src/stories/TimePicker.stories.tsx +2 -0
- package/src/stories/Timeline.stories.tsx +12 -0
- package/src/stories/Timer.stories.tsx +30 -0
- package/src/stories/Toggle.stories.tsx +7 -5
- package/src/stories/ToggleGroup.stories.tsx +5 -0
- package/src/stories/ToggleTip.stories.tsx +4 -0
- package/src/stories/Toolbar.stories.tsx +6 -0
- package/src/stories/Tooltip.stories.tsx +3 -0
- package/src/stories/Tour.stories.tsx +3 -0
- package/src/stories/TransferList.stories.tsx +7 -0
- package/src/stories/TreeSelect.stories.tsx +4 -0
- package/src/stories/TreeView.stories.tsx +5 -0
- package/src/stories/TypingIndicator.stories.tsx +4 -0
- package/src/stories/VisuallyHidden.stories.tsx +3 -0
- package/src/stories/Watermark.stories.tsx +6 -0
- package/src/stories/WeekPicker.stories.tsx +25 -1
- package/src/stories/WordRotate.stories.tsx +5 -0
- package/src/stories/YearPicker.stories.tsx +26 -11
- package/src/stories/story-groups.json +22 -16
- package/src/styles.css +50 -2
- package/src/tokens.json +86 -58
|
@@ -19,6 +19,7 @@ export default meta
|
|
|
19
19
|
type Story = StoryObj<typeof DateField>
|
|
20
20
|
|
|
21
21
|
export const Default: Story = {
|
|
22
|
+
parameters: { controls: { disable: true } },
|
|
22
23
|
render: () => (
|
|
23
24
|
<div className="w-64">
|
|
24
25
|
<DateField />
|
|
@@ -27,6 +28,7 @@ export const Default: Story = {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const Prefilled: Story = {
|
|
31
|
+
parameters: { controls: { disable: true } },
|
|
30
32
|
render: () => (
|
|
31
33
|
<div className="w-64">
|
|
32
34
|
<DateField defaultValue={new Date(2026, 4, 26)} />
|
|
@@ -35,6 +37,7 @@ export const Prefilled: Story = {
|
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export const Sizes: Story = {
|
|
40
|
+
parameters: { controls: { disable: true } },
|
|
38
41
|
render: () => (
|
|
39
42
|
<div className="flex w-64 flex-col gap-3">
|
|
40
43
|
<DateField defaultValue={new Date(2026, 4, 26)} size="sm" />
|
|
@@ -45,6 +48,7 @@ export const Sizes: Story = {
|
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export const Disabled: Story = {
|
|
51
|
+
parameters: { controls: { disable: true } },
|
|
48
52
|
render: () => (
|
|
49
53
|
<div className="w-64">
|
|
50
54
|
<DateField disabled defaultValue={new Date(2026, 4, 1)} />
|
|
@@ -53,6 +57,7 @@ export const Disabled: Story = {
|
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
export const WithMinMax: Story = {
|
|
60
|
+
parameters: { controls: { disable: true } },
|
|
56
61
|
render: () => (
|
|
57
62
|
<div className="flex w-72 flex-col gap-2">
|
|
58
63
|
<DateField
|
|
@@ -69,6 +74,7 @@ export const WithMinMax: Story = {
|
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
export const Clearable: Story = {
|
|
77
|
+
parameters: { controls: { disable: true } },
|
|
72
78
|
render: () => (
|
|
73
79
|
<div className="w-64">
|
|
74
80
|
<DateField clearable defaultValue={new Date(2026, 4, 26)} />
|
|
@@ -77,6 +83,7 @@ export const Clearable: Story = {
|
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
export const RealisticUse: Story = {
|
|
86
|
+
parameters: { controls: { disable: true } },
|
|
80
87
|
render: () => {
|
|
81
88
|
const [dueDate, setDueDate] = React.useState<Date | undefined>(
|
|
82
89
|
new Date(2026, 4, 26)
|
|
@@ -112,3 +119,24 @@ export const RealisticUse: Story = {
|
|
|
112
119
|
)
|
|
113
120
|
},
|
|
114
121
|
}
|
|
122
|
+
|
|
123
|
+
// Controlled from an empty state: `useState<Date>()` starts as undefined, which used to read as
|
|
124
|
+
// "uncontrolled", so a later Clear showed the first pick again.
|
|
125
|
+
export const ControlledStartsEmpty: Story = {
|
|
126
|
+
parameters: { controls: { disable: true } },
|
|
127
|
+
render: () => {
|
|
128
|
+
const [value, setValue] = React.useState<Date>()
|
|
129
|
+
return (
|
|
130
|
+
<div className="flex flex-col items-start gap-3">
|
|
131
|
+
<DateField value={value} onValueChange={(v) => setValue(v)} />
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
className="min-h-11 rounded-md border px-4 text-sm font-medium"
|
|
135
|
+
onClick={() => setValue(undefined)}
|
|
136
|
+
>
|
|
137
|
+
Clear
|
|
138
|
+
</button>
|
|
139
|
+
</div>
|
|
140
|
+
)
|
|
141
|
+
},
|
|
142
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
3
|
import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
|
|
4
|
+
import { userEvent, within, expect, waitFor } from "storybook/test";
|
|
4
5
|
|
|
5
6
|
// react-day-picker v10 migration (2026-07-07): fromDate/toDate props preserved
|
|
6
7
|
// on DatePicker — they now map to startMonth/endMonth + disabled internally.
|
|
@@ -16,6 +17,7 @@ export default meta;
|
|
|
16
17
|
type Story = StoryObj<typeof meta>;
|
|
17
18
|
|
|
18
19
|
export const Default: Story = {
|
|
20
|
+
parameters: { controls: { disable: true } },
|
|
19
21
|
render: () => {
|
|
20
22
|
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
21
23
|
return (
|
|
@@ -31,6 +33,7 @@ export const Default: Story = {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
export const Size_Small: Story = {
|
|
36
|
+
parameters: { controls: { disable: true } },
|
|
34
37
|
render: () => {
|
|
35
38
|
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
36
39
|
return (
|
|
@@ -42,6 +45,7 @@ export const Size_Small: Story = {
|
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
export const Size_Default: Story = {
|
|
48
|
+
parameters: { controls: { disable: true } },
|
|
45
49
|
render: () => {
|
|
46
50
|
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
47
51
|
return (
|
|
@@ -53,6 +57,7 @@ export const Size_Default: Story = {
|
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
export const Size_Large: Story = {
|
|
60
|
+
parameters: { controls: { disable: true } },
|
|
56
61
|
render: () => {
|
|
57
62
|
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
58
63
|
return (
|
|
@@ -64,6 +69,7 @@ export const Size_Large: Story = {
|
|
|
64
69
|
};
|
|
65
70
|
|
|
66
71
|
export const Variant_Clearable: Story = {
|
|
72
|
+
parameters: { controls: { disable: true } },
|
|
67
73
|
render: () => {
|
|
68
74
|
const [date, setDate] = React.useState<Date | undefined>(
|
|
69
75
|
new Date("2026-08-15")
|
|
@@ -81,7 +87,32 @@ export const Variant_Clearable: Story = {
|
|
|
81
87
|
},
|
|
82
88
|
};
|
|
83
89
|
|
|
90
|
+
// Opening a picker that already holds a date shows that date's month.
|
|
91
|
+
export const Interaction_OpensOnSelectedMonth: Story = {
|
|
92
|
+
parameters: { controls: { disable: true } },
|
|
93
|
+
tags: ["test"],
|
|
94
|
+
render: () => {
|
|
95
|
+
const [date, setDate] = React.useState<Date | undefined>(
|
|
96
|
+
new Date(2026, 7, 14)
|
|
97
|
+
);
|
|
98
|
+
return (
|
|
99
|
+
<div className="w-[280px]">
|
|
100
|
+
<DatePicker value={date} onValueChange={setDate} />
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
play: async ({ canvasElement }) => {
|
|
105
|
+
const canvas = within(canvasElement);
|
|
106
|
+
await userEvent.click(canvas.getByRole("button", { name: /Aug 14, 2026/ }));
|
|
107
|
+
const body = within(document.body);
|
|
108
|
+
// The popover fades in, so the caption exists before it is visible. Wait for
|
|
109
|
+
// the animation instead of sampling the first frame (this was flaky in CI).
|
|
110
|
+
await waitFor(() => expect(body.getByText("August 2026")).toBeVisible());
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
84
114
|
export const Variant_Clearable_Empty: Story = {
|
|
115
|
+
parameters: { controls: { disable: true } },
|
|
85
116
|
render: () => {
|
|
86
117
|
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
87
118
|
return (
|
|
@@ -99,6 +130,7 @@ export const Variant_Clearable_Empty: Story = {
|
|
|
99
130
|
};
|
|
100
131
|
|
|
101
132
|
export const Variant_WithBounds: Story = {
|
|
133
|
+
parameters: { controls: { disable: true } },
|
|
102
134
|
render: () => {
|
|
103
135
|
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
104
136
|
const today = new Date();
|
|
@@ -119,6 +151,7 @@ export const Variant_WithBounds: Story = {
|
|
|
119
151
|
};
|
|
120
152
|
|
|
121
153
|
export const Disabled: Story = {
|
|
154
|
+
parameters: { controls: { disable: true } },
|
|
122
155
|
render: () => (
|
|
123
156
|
<div className="w-[280px]">
|
|
124
157
|
<DatePicker
|
|
@@ -131,6 +164,7 @@ export const Disabled: Story = {
|
|
|
131
164
|
};
|
|
132
165
|
|
|
133
166
|
export const RealisticUse: Story = {
|
|
167
|
+
parameters: { controls: { disable: true } },
|
|
134
168
|
render: () => {
|
|
135
169
|
const [startDate, setStartDate] = React.useState<Date | undefined>(undefined);
|
|
136
170
|
const [endDate, setEndDate] = React.useState<Date | undefined>(undefined);
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
DateRangePicker,
|
|
5
5
|
DateRangeValue,
|
|
6
6
|
} from "@behavioral-agentic-design-system/core/components/ui/date-range-picker"
|
|
7
|
+
import { userEvent, within, expect, waitFor } from "storybook/test"
|
|
7
8
|
|
|
8
9
|
// react-day-picker v10 migration (2026-07-07): fromDate/toDate props preserved
|
|
9
10
|
// on DateRangePicker — they now map to startMonth/endMonth + disabled internally.
|
|
@@ -31,7 +32,34 @@ export const Default: Story = {
|
|
|
31
32
|
),
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
// Opening a picker that already holds a range shows that range's month, not
|
|
36
|
+
// today's, so both ends of the selection are on screen.
|
|
37
|
+
export const Interaction_OpensOnSelectedRange: Story = {
|
|
38
|
+
parameters: { controls: { disable: true } },
|
|
39
|
+
tags: ["test"],
|
|
40
|
+
render: () => {
|
|
41
|
+
const [range, setRange] = React.useState<DateRangeValue | undefined>({
|
|
42
|
+
from: new Date(2026, 5, 1),
|
|
43
|
+
to: new Date(2026, 5, 15),
|
|
44
|
+
})
|
|
45
|
+
return (
|
|
46
|
+
<div className="w-96">
|
|
47
|
+
<DateRangePicker value={range} onValueChange={setRange} />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
},
|
|
51
|
+
play: async ({ canvasElement }) => {
|
|
52
|
+
const canvas = within(canvasElement)
|
|
53
|
+
await userEvent.click(canvas.getByRole("button", { name: /Jun 1, 2026/ }))
|
|
54
|
+
const body = within(document.body)
|
|
55
|
+
// The popover fades in, so the caption exists before it is visible. Wait for
|
|
56
|
+
// the animation instead of sampling the first frame (this was flaky in CI).
|
|
57
|
+
await waitFor(() => expect(body.getByText("June 2026")).toBeVisible())
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
export const Clearable: Story = {
|
|
62
|
+
parameters: { controls: { disable: true } },
|
|
35
63
|
render: () => {
|
|
36
64
|
const [range, setRange] = React.useState<DateRangeValue | undefined>({
|
|
37
65
|
from: new Date(2026, 5, 10),
|
|
@@ -46,6 +74,7 @@ export const Clearable: Story = {
|
|
|
46
74
|
}
|
|
47
75
|
|
|
48
76
|
export const Sizes: Story = {
|
|
77
|
+
parameters: { controls: { disable: true } },
|
|
49
78
|
render: () => {
|
|
50
79
|
const range = { from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }
|
|
51
80
|
return (
|
|
@@ -59,6 +88,7 @@ export const Sizes: Story = {
|
|
|
59
88
|
}
|
|
60
89
|
|
|
61
90
|
export const Empty: Story = {
|
|
91
|
+
parameters: { controls: { disable: true } },
|
|
62
92
|
render: () => (
|
|
63
93
|
<div className="w-96">
|
|
64
94
|
<DateRangePicker size="default" />
|
|
@@ -67,6 +97,7 @@ export const Empty: Story = {
|
|
|
67
97
|
}
|
|
68
98
|
|
|
69
99
|
export const Disabled: Story = {
|
|
100
|
+
parameters: { controls: { disable: true } },
|
|
70
101
|
render: () => (
|
|
71
102
|
<div className="w-96">
|
|
72
103
|
<DateRangePicker
|
|
@@ -78,6 +109,7 @@ export const Disabled: Story = {
|
|
|
78
109
|
}
|
|
79
110
|
|
|
80
111
|
export const RealisticUse: Story = {
|
|
112
|
+
parameters: { controls: { disable: true } },
|
|
81
113
|
render: () => {
|
|
82
114
|
const [range, setRange] = React.useState<DateRangeValue | undefined>()
|
|
83
115
|
return (
|
|
@@ -31,6 +31,7 @@ export default meta;
|
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
32
32
|
|
|
33
33
|
export const Default: Story = {
|
|
34
|
+
parameters: { controls: { disable: true } },
|
|
34
35
|
render: () => (
|
|
35
36
|
<Dialog>
|
|
36
37
|
<DialogTrigger asChild>
|
|
@@ -53,6 +54,7 @@ export const Default: Story = {
|
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export const Size_SM: Story = {
|
|
57
|
+
parameters: { controls: { disable: true } },
|
|
56
58
|
render: () => (
|
|
57
59
|
<Dialog>
|
|
58
60
|
<DialogTrigger asChild>
|
|
@@ -75,6 +77,7 @@ export const Size_SM: Story = {
|
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
export const Size_LG: Story = {
|
|
80
|
+
parameters: { controls: { disable: true } },
|
|
78
81
|
render: () => (
|
|
79
82
|
<Dialog>
|
|
80
83
|
<DialogTrigger asChild>
|
|
@@ -97,6 +100,7 @@ export const Size_LG: Story = {
|
|
|
97
100
|
};
|
|
98
101
|
|
|
99
102
|
export const Size_XL: Story = {
|
|
103
|
+
parameters: { controls: { disable: true } },
|
|
100
104
|
render: () => (
|
|
101
105
|
<Dialog>
|
|
102
106
|
<DialogTrigger asChild>
|
|
@@ -119,6 +123,7 @@ export const Size_XL: Story = {
|
|
|
119
123
|
};
|
|
120
124
|
|
|
121
125
|
export const Size_2XL: Story = {
|
|
126
|
+
parameters: { controls: { disable: true } },
|
|
122
127
|
render: () => (
|
|
123
128
|
<Dialog>
|
|
124
129
|
<DialogTrigger asChild>
|
|
@@ -141,6 +146,7 @@ export const Size_2XL: Story = {
|
|
|
141
146
|
};
|
|
142
147
|
|
|
143
148
|
export const Size_Full: Story = {
|
|
149
|
+
parameters: { controls: { disable: true } },
|
|
144
150
|
render: () => (
|
|
145
151
|
<Dialog>
|
|
146
152
|
<DialogTrigger asChild>
|
|
@@ -164,6 +170,7 @@ export const Size_Full: Story = {
|
|
|
164
170
|
|
|
165
171
|
export const Interaction_Opens: Story = {
|
|
166
172
|
tags: ["test"],
|
|
173
|
+
parameters: { controls: { disable: true } },
|
|
167
174
|
render: () => (
|
|
168
175
|
<Dialog>
|
|
169
176
|
<DialogTrigger asChild>
|
|
@@ -195,6 +202,7 @@ export const Interaction_Opens: Story = {
|
|
|
195
202
|
};
|
|
196
203
|
|
|
197
204
|
export const RealisticUse: Story = {
|
|
205
|
+
parameters: { controls: { disable: true } },
|
|
198
206
|
render: () => (
|
|
199
207
|
<Dialog>
|
|
200
208
|
<DialogTrigger asChild>
|
|
@@ -27,6 +27,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
27
27
|
// Default — bottom drawer with drag-to-dismiss, uses BADS persona content
|
|
28
28
|
// ---------------------------------------------------------------------------
|
|
29
29
|
export const Default: Story = {
|
|
30
|
+
parameters: { controls: { disable: true } },
|
|
30
31
|
render: () => (
|
|
31
32
|
<Drawer>
|
|
32
33
|
<DrawerTrigger asChild>
|
|
@@ -56,6 +57,7 @@ export const Default: Story = {
|
|
|
56
57
|
// Side_Right — right-edge drawer
|
|
57
58
|
// ---------------------------------------------------------------------------
|
|
58
59
|
export const Side_Right: Story = {
|
|
60
|
+
parameters: { controls: { disable: true } },
|
|
59
61
|
render: () => (
|
|
60
62
|
<Drawer>
|
|
61
63
|
<DrawerTrigger asChild>
|
|
@@ -85,6 +87,7 @@ export const Side_Right: Story = {
|
|
|
85
87
|
// Side_Left — left-edge drawer
|
|
86
88
|
// ---------------------------------------------------------------------------
|
|
87
89
|
export const Side_Left: Story = {
|
|
90
|
+
parameters: { controls: { disable: true } },
|
|
88
91
|
render: () => (
|
|
89
92
|
<Drawer>
|
|
90
93
|
<DrawerTrigger asChild>
|
|
@@ -115,6 +118,7 @@ export const Side_Left: Story = {
|
|
|
115
118
|
// Side_Top — top-edge drawer
|
|
116
119
|
// ---------------------------------------------------------------------------
|
|
117
120
|
export const Side_Top: Story = {
|
|
121
|
+
parameters: { controls: { disable: true } },
|
|
118
122
|
render: () => (
|
|
119
123
|
<Drawer>
|
|
120
124
|
<DrawerTrigger asChild>
|
|
@@ -142,6 +146,7 @@ export const Side_Top: Story = {
|
|
|
142
146
|
// WithFooter — bottom drawer with header + footer action buttons
|
|
143
147
|
// ---------------------------------------------------------------------------
|
|
144
148
|
export const WithFooter: Story = {
|
|
149
|
+
parameters: { controls: { disable: true } },
|
|
145
150
|
render: () => (
|
|
146
151
|
<Drawer>
|
|
147
152
|
<DrawerTrigger asChild>
|
|
@@ -178,6 +183,7 @@ export const WithFooter: Story = {
|
|
|
178
183
|
// RealisticUse — Submit feedback bottom drawer with Textarea
|
|
179
184
|
// ---------------------------------------------------------------------------
|
|
180
185
|
export const RealisticUse: Story = {
|
|
186
|
+
parameters: { controls: { disable: true } },
|
|
181
187
|
render: () => (
|
|
182
188
|
<Drawer>
|
|
183
189
|
<DrawerTrigger asChild>
|
|
@@ -19,6 +19,7 @@ export default meta;
|
|
|
19
19
|
type Story = StoryObj<typeof meta>;
|
|
20
20
|
|
|
21
21
|
export const Default: Story = {
|
|
22
|
+
parameters: { controls: { disable: true } },
|
|
22
23
|
render: () => (<DropdownMenu>
|
|
23
24
|
<DropdownMenuTrigger asChild><Button variant="outline">Open menu</Button></DropdownMenuTrigger>
|
|
24
25
|
<DropdownMenuContent>
|
|
@@ -33,6 +34,7 @@ export const Default: Story = {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export const RealisticUse: Story = {
|
|
37
|
+
parameters: { controls: { disable: true } },
|
|
36
38
|
render: () => (<DropdownMenu>
|
|
37
39
|
<DropdownMenuTrigger asChild><Button variant="outline">Open menu</Button></DropdownMenuTrigger>
|
|
38
40
|
<DropdownMenuContent>
|
|
@@ -20,6 +20,7 @@ export default meta
|
|
|
20
20
|
type Story = StoryObj<typeof Editable>
|
|
21
21
|
|
|
22
22
|
export const Default: Story = {
|
|
23
|
+
parameters: { controls: { disable: true } },
|
|
23
24
|
render: () => (
|
|
24
25
|
<div className="w-64">
|
|
25
26
|
<Editable defaultValue="Project Alpha">
|
|
@@ -33,6 +34,7 @@ export const Default: Story = {
|
|
|
33
34
|
// render below it (visible) once editing begins — not hidden behind the input.
|
|
34
35
|
// Save/Cancel are the BADS Button primitive (default + ghost), spaced with gap-2.
|
|
35
36
|
export const WithControls: Story = {
|
|
37
|
+
parameters: { controls: { disable: true } },
|
|
36
38
|
render: () => (
|
|
37
39
|
<div className="w-64">
|
|
38
40
|
<Editable defaultValue="Untitled sprint" submitMode="enter">
|
|
@@ -47,6 +49,7 @@ export const WithControls: Story = {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
export const SubmitMode_Blur: Story = {
|
|
52
|
+
parameters: { controls: { disable: true } },
|
|
50
53
|
render: () => (
|
|
51
54
|
<div className="w-64">
|
|
52
55
|
<Editable defaultValue="Click to edit, then blur to save" submitMode="blur">
|
|
@@ -57,6 +60,7 @@ export const SubmitMode_Blur: Story = {
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
export const SubmitMode_Enter: Story = {
|
|
63
|
+
parameters: { controls: { disable: true } },
|
|
60
64
|
render: () => (
|
|
61
65
|
<div className="w-64">
|
|
62
66
|
<Editable defaultValue="Press Enter to save, Escape to cancel" submitMode="enter">
|
|
@@ -71,6 +75,7 @@ export const SubmitMode_Enter: Story = {
|
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
export const SubmitMode_Both: Story = {
|
|
78
|
+
parameters: { controls: { disable: true } },
|
|
74
79
|
render: () => (
|
|
75
80
|
<div className="w-64">
|
|
76
81
|
<Editable defaultValue="Blur or press Enter to save" submitMode="both">
|
|
@@ -87,6 +92,7 @@ export const SubmitMode_Both: Story = {
|
|
|
87
92
|
// Disabled renders as a single dimmed (opacity-50) preview label — the overlay
|
|
88
93
|
// input stays hidden, so the value is not ghosted over itself.
|
|
89
94
|
export const Disabled: Story = {
|
|
95
|
+
parameters: { controls: { disable: true } },
|
|
90
96
|
render: () => (
|
|
91
97
|
<div className="w-64">
|
|
92
98
|
<Editable defaultValue="Read-only field" disabled>
|
|
@@ -97,6 +103,7 @@ export const Disabled: Story = {
|
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
export const WithPlaceholder: Story = {
|
|
106
|
+
parameters: { controls: { disable: true } },
|
|
100
107
|
render: () => (
|
|
101
108
|
<div className="w-64">
|
|
102
109
|
<Editable defaultValue="" placeholder="Add a title...">
|
|
@@ -113,6 +120,7 @@ export const WithPlaceholder: Story = {
|
|
|
113
120
|
// deliberately does NOT steal focus back. `label` names the edit input for
|
|
114
121
|
// screen readers; without it the input falls back to the placeholder text.
|
|
115
122
|
export const KeyboardFocusReturn: Story = {
|
|
123
|
+
parameters: { controls: { disable: true } },
|
|
116
124
|
render: () => (
|
|
117
125
|
<div className="w-64">
|
|
118
126
|
<Editable defaultValue="Tab here, press Enter, then Escape" label="Demo field" submitMode="both">
|
|
@@ -127,6 +135,7 @@ export const KeyboardFocusReturn: Story = {
|
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
export const Controlled: Story = {
|
|
138
|
+
parameters: { controls: { disable: true } },
|
|
130
139
|
render: () => {
|
|
131
140
|
const [value, setValue] = React.useState("Maya Chen")
|
|
132
141
|
return (
|
|
@@ -142,7 +151,10 @@ export const Controlled: Story = {
|
|
|
142
151
|
},
|
|
143
152
|
}
|
|
144
153
|
|
|
154
|
+
// Enter pressed to confirm an IME candidate (Japanese, Chinese, Korean) is ignored by this component.
|
|
155
|
+
// Not scriptable in a story; check by hand with an IME on.
|
|
145
156
|
export const RealisticUse: Story = {
|
|
157
|
+
parameters: { controls: { disable: true } },
|
|
146
158
|
render: () => {
|
|
147
159
|
const [name, setName] = React.useState("Brand refresh sprint")
|
|
148
160
|
const [lead, setLead] = React.useState("Maya Chen")
|
|
@@ -38,6 +38,7 @@ export default meta
|
|
|
38
38
|
type Story = StoryObj<typeof EmptyState>
|
|
39
39
|
|
|
40
40
|
export const Default: Story = {
|
|
41
|
+
parameters: { controls: { disable: true } },
|
|
41
42
|
render: () => (
|
|
42
43
|
<EmptyState className="w-80">
|
|
43
44
|
<EmptyStateIcon>
|
|
@@ -52,6 +53,7 @@ export const Default: Story = {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
export const WithAction: Story = {
|
|
56
|
+
parameters: { controls: { disable: true } },
|
|
55
57
|
render: () => (
|
|
56
58
|
<EmptyState className="w-80">
|
|
57
59
|
<EmptyStateIcon>
|
|
@@ -72,6 +74,7 @@ export const WithAction: Story = {
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
export const WithDualActions: Story = {
|
|
77
|
+
parameters: { controls: { disable: true } },
|
|
75
78
|
render: () => (
|
|
76
79
|
<EmptyState className="w-80">
|
|
77
80
|
<EmptyStateIcon>
|
|
@@ -93,6 +96,7 @@ export const WithDualActions: Story = {
|
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
export const SearchEmpty: Story = {
|
|
99
|
+
parameters: { controls: { disable: true } },
|
|
96
100
|
render: () => (
|
|
97
101
|
<EmptyState className="w-80">
|
|
98
102
|
<EmptyStateIcon>
|
|
@@ -110,6 +114,7 @@ export const SearchEmpty: Story = {
|
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
export const ErrorState: Story = {
|
|
117
|
+
parameters: { controls: { disable: true } },
|
|
113
118
|
render: () => (
|
|
114
119
|
<EmptyState className="w-80">
|
|
115
120
|
<EmptyStateIcon className="bg-destructive/10 text-destructive">
|
|
@@ -127,6 +132,7 @@ export const ErrorState: Story = {
|
|
|
127
132
|
}
|
|
128
133
|
|
|
129
134
|
export const Size_Sm: Story = {
|
|
135
|
+
parameters: { controls: { disable: true } },
|
|
130
136
|
render: () => (
|
|
131
137
|
<EmptyState size="sm" className="w-64 border border-border rounded-lg">
|
|
132
138
|
<EmptyStateIcon className="size-9 [&>svg]:size-5">
|
|
@@ -139,6 +145,7 @@ export const Size_Sm: Story = {
|
|
|
139
145
|
}
|
|
140
146
|
|
|
141
147
|
export const Size_Default: Story = {
|
|
148
|
+
parameters: { controls: { disable: true } },
|
|
142
149
|
render: () => (
|
|
143
150
|
<EmptyState size="default" className="w-80">
|
|
144
151
|
<EmptyStateIcon>
|
|
@@ -153,6 +160,7 @@ export const Size_Default: Story = {
|
|
|
153
160
|
}
|
|
154
161
|
|
|
155
162
|
export const Size_Lg: Story = {
|
|
163
|
+
parameters: { controls: { disable: true } },
|
|
156
164
|
render: () => (
|
|
157
165
|
<EmptyState size="lg" className="w-96">
|
|
158
166
|
<EmptyStateIcon className="size-16 [&>svg]:size-8">
|
|
@@ -167,6 +175,7 @@ export const Size_Lg: Story = {
|
|
|
167
175
|
}
|
|
168
176
|
|
|
169
177
|
export const RealisticUse: Story = {
|
|
178
|
+
parameters: { controls: { disable: true } },
|
|
170
179
|
render: () => (
|
|
171
180
|
<div className="w-[400px] rounded-xl border border-border bg-card overflow-hidden">
|
|
172
181
|
{/* Card header */}
|