@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
|
@@ -26,35 +26,34 @@ export default meta
|
|
|
26
26
|
type Story = StoryObj<typeof Meter>
|
|
27
27
|
|
|
28
28
|
export const Default: Story = {
|
|
29
|
-
|
|
29
|
+
args: { value: 62, "aria-label": "Storage used" },
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export const WithLabel: Story = {
|
|
33
|
+
parameters: { controls: { disable: true } },
|
|
33
34
|
render: () => (
|
|
34
35
|
<Meter value={12.4} min={0} max={20} label="Asset storage" showValue getValueLabel={(v, _min, max) => `${v} GB of ${max} GB`} />
|
|
35
36
|
),
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
export const Variant_Success: Story = {
|
|
40
|
+
parameters: { controls: { disable: true } },
|
|
39
41
|
render: () => (
|
|
40
42
|
<Meter value={98.4} variant="success" label="Story coverage" showValue getValueLabel={(v) => `${v}%`} />
|
|
41
43
|
),
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export const Variant_Warning: Story = {
|
|
45
|
-
|
|
46
|
-
<Meter value={78} variant="warning" label="Token budget used" showValue />
|
|
47
|
-
),
|
|
47
|
+
args: { value: 78, variant: "warning", label: "Token budget used", showValue: true },
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export const Variant_Destructive: Story = {
|
|
51
|
-
|
|
52
|
-
<Meter value={94} variant="destructive" label="Contrast failures quota" showValue />
|
|
53
|
-
),
|
|
51
|
+
args: { value: 94, variant: "destructive", label: "Contrast failures quota", showValue: true },
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
export const WithVariants: Story = {
|
|
57
55
|
name: "WithVariants (threshold walk)",
|
|
56
|
+
parameters: { controls: { disable: true } },
|
|
58
57
|
render: () => {
|
|
59
58
|
// The variant is explicit — the consumer maps value → threshold. This is
|
|
60
59
|
// the canonical mapping for a "remaining capacity" reading.
|
|
@@ -80,17 +79,15 @@ export const WithVariants: Story = {
|
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
export const Size_Sm: Story = {
|
|
83
|
-
|
|
82
|
+
args: { value: 62, size: "sm", "aria-label": "Storage used (small)" },
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
export const Size_Default: Story = {
|
|
87
|
-
|
|
88
|
-
<Meter value={62} size="default" aria-label="Storage used (default)" />
|
|
89
|
-
),
|
|
86
|
+
args: { value: 62, size: "default", "aria-label": "Storage used (default)" },
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
export const Size_Lg: Story = {
|
|
93
|
-
|
|
90
|
+
args: { value: 62, size: "lg", "aria-label": "Storage used (large)" },
|
|
94
91
|
}
|
|
95
92
|
|
|
96
93
|
export const Disabled: Story = {
|
|
@@ -99,14 +96,11 @@ export const Disabled: Story = {
|
|
|
99
96
|
// the reduced contrast is expected and acceptable for this state.
|
|
100
97
|
a11y: { config: { rules: [{ id: "color-contrast", enabled: false }] } },
|
|
101
98
|
},
|
|
102
|
-
|
|
103
|
-
// Label stays at full opacity (full contrast) when disabled — only the
|
|
104
|
-
// track bar is dimmed. Keeps the label readable at WCAG AAA 7:1.
|
|
105
|
-
<Meter value={62} disabled label="Asset storage (workspace archived)" showValue />
|
|
106
|
-
),
|
|
99
|
+
args: { value: 62, disabled: true, label: "Asset storage (workspace archived)", showValue: true },
|
|
107
100
|
}
|
|
108
101
|
|
|
109
102
|
export const RealisticUse: Story = {
|
|
103
|
+
parameters: { controls: { disable: true } },
|
|
110
104
|
render: () => {
|
|
111
105
|
// Persona content pool (content/personas/bads.json): Jordan Reeves,
|
|
112
106
|
// design.bads.com, registry/story-coverage metrics.
|
|
@@ -21,10 +21,11 @@ export default meta;
|
|
|
21
21
|
type Story = StoryObj<typeof meta>;
|
|
22
22
|
|
|
23
23
|
export const Default: Story = {
|
|
24
|
-
|
|
24
|
+
args: { className: "rounded-md border" },
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export const Selected: Story = {
|
|
28
|
+
parameters: { controls: { disable: true } },
|
|
28
29
|
render: () => {
|
|
29
30
|
// Persona pool date (content/personas/bads.json → primary.dates): 2026-05-26,
|
|
30
31
|
// normalized by the component to the first of the month.
|
|
@@ -40,6 +41,7 @@ export const Selected: Story = {
|
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
export const Disabled: Story = {
|
|
44
|
+
parameters: { controls: { disable: true } },
|
|
43
45
|
render: () => (
|
|
44
46
|
// When disabled: grid div gets tabIndex=0 (keyboard-reachable without
|
|
45
47
|
// placing tabIndex=0 on a non-focusable button); year text uses
|
|
@@ -53,6 +55,7 @@ export const Disabled: Story = {
|
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
export const WithDisabledMonths: Story = {
|
|
58
|
+
parameters: { controls: { disable: true } },
|
|
56
59
|
render: () => {
|
|
57
60
|
// Months before the engagement kickoff (persona pool date 2026-01-15)
|
|
58
61
|
// are not selectable.
|
|
@@ -70,6 +73,7 @@ export const WithDisabledMonths: Story = {
|
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
export const RealisticUse: Story = {
|
|
76
|
+
parameters: { controls: { disable: true } },
|
|
73
77
|
render: () => {
|
|
74
78
|
const [period, setPeriod] = useState<Date>(new Date(2026, 4, 1));
|
|
75
79
|
const label = period.toLocaleString("en-US", {
|
|
@@ -97,3 +101,24 @@ export const RealisticUse: Story = {
|
|
|
97
101
|
);
|
|
98
102
|
},
|
|
99
103
|
};
|
|
104
|
+
|
|
105
|
+
// Controlled from an empty state: `useState<Date>()` starts as undefined, which used to read as
|
|
106
|
+
// "uncontrolled", so a later Clear showed the first pick again.
|
|
107
|
+
export const ControlledStartsEmpty: Story = {
|
|
108
|
+
parameters: { controls: { disable: true } },
|
|
109
|
+
render: () => {
|
|
110
|
+
const [value, setValue] = useState<Date>()
|
|
111
|
+
return (
|
|
112
|
+
<div className="flex flex-col items-start gap-3">
|
|
113
|
+
<MonthPicker value={value} onChange={(v) => setValue(v)} />
|
|
114
|
+
<button
|
|
115
|
+
type="button"
|
|
116
|
+
className="min-h-11 rounded-md border px-4 text-sm font-medium"
|
|
117
|
+
onClick={() => setValue(undefined)}
|
|
118
|
+
>
|
|
119
|
+
Clear
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
)
|
|
123
|
+
},
|
|
124
|
+
}
|
|
@@ -40,6 +40,7 @@ export const Size_Lg: Story = {
|
|
|
40
40
|
// Realistic use: an Appearance settings row pairing the label + control + hint,
|
|
41
41
|
// the shape a fork drops into its own settings surface.
|
|
42
42
|
export const RealisticUse: Story = {
|
|
43
|
+
parameters: { controls: { disable: true } },
|
|
43
44
|
render: () => (
|
|
44
45
|
<div className="flex w-96 flex-col gap-4 rounded-lg border bg-card p-6">
|
|
45
46
|
<div className="flex flex-col gap-1">
|
|
@@ -39,6 +39,7 @@ export default meta
|
|
|
39
39
|
type Story = StoryObj<typeof MultiSelect>
|
|
40
40
|
|
|
41
41
|
export const Default: Story = {
|
|
42
|
+
parameters: { controls: { disable: true } },
|
|
42
43
|
render: () => {
|
|
43
44
|
const [val, setVal] = React.useState<string[]>([])
|
|
44
45
|
return (
|
|
@@ -50,6 +51,7 @@ export const Default: Story = {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export const WithPreselected: Story = {
|
|
54
|
+
parameters: { controls: { disable: true } },
|
|
53
55
|
render: () => {
|
|
54
56
|
const [val, setVal] = React.useState<string[]>(["next", "remix"])
|
|
55
57
|
return (
|
|
@@ -61,6 +63,7 @@ export const WithPreselected: Story = {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
export const WithMaxCount: Story = {
|
|
66
|
+
parameters: { controls: { disable: true } },
|
|
64
67
|
render: () => {
|
|
65
68
|
const [val, setVal] = React.useState<string[]>(["next", "remix", "astro", "nuxt"])
|
|
66
69
|
return (
|
|
@@ -77,6 +80,7 @@ export const WithMaxCount: Story = {
|
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
export const Disabled: Story = {
|
|
83
|
+
parameters: { controls: { disable: true } },
|
|
80
84
|
render: () => (
|
|
81
85
|
<div className="w-72">
|
|
82
86
|
<MultiSelect options={FRAMEWORKS} value={["next"]} disabled />
|
|
@@ -85,6 +89,7 @@ export const Disabled: Story = {
|
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
export const EmptyState: Story = {
|
|
92
|
+
parameters: { controls: { disable: true } },
|
|
88
93
|
render: () => (
|
|
89
94
|
<div className="w-72">
|
|
90
95
|
<MultiSelect options={[]} value={[]} emptyText="No frameworks found." />
|
|
@@ -94,6 +99,7 @@ export const EmptyState: Story = {
|
|
|
94
99
|
|
|
95
100
|
export const Size_Sm: Story = {
|
|
96
101
|
name: "Size — sm",
|
|
102
|
+
parameters: { controls: { disable: true } },
|
|
97
103
|
render: () => {
|
|
98
104
|
const [val, setVal] = React.useState<string[]>([])
|
|
99
105
|
return (
|
|
@@ -106,6 +112,7 @@ export const Size_Sm: Story = {
|
|
|
106
112
|
|
|
107
113
|
export const Size_Lg: Story = {
|
|
108
114
|
name: "Size — lg",
|
|
115
|
+
parameters: { controls: { disable: true } },
|
|
109
116
|
render: () => {
|
|
110
117
|
const [val, setVal] = React.useState<string[]>([])
|
|
111
118
|
return (
|
|
@@ -118,6 +125,7 @@ export const Size_Lg: Story = {
|
|
|
118
125
|
|
|
119
126
|
export const Size_Xl: Story = {
|
|
120
127
|
name: "Size — xl (CTA floor, 44 px)",
|
|
128
|
+
parameters: { controls: { disable: true } },
|
|
121
129
|
render: () => {
|
|
122
130
|
const [val, setVal] = React.useState<string[]>([])
|
|
123
131
|
return (
|
|
@@ -129,6 +137,7 @@ export const Size_Xl: Story = {
|
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
export const RealisticUse: Story = {
|
|
140
|
+
parameters: { controls: { disable: true } },
|
|
132
141
|
render: () => {
|
|
133
142
|
const [tags, setTags] = React.useState<string[]>(["next", "remix"])
|
|
134
143
|
return (
|
|
@@ -85,6 +85,7 @@ export const WithError: Story = {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
export const RealisticUse: Story = {
|
|
88
|
+
parameters: { controls: { disable: true } },
|
|
88
89
|
render: () => (
|
|
89
90
|
<div className="flex flex-col gap-3 w-64">
|
|
90
91
|
<label htmlFor="focus-area" className="text-sm font-medium text-foreground">
|
|
@@ -22,6 +22,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
22
22
|
|
|
23
23
|
/** Default inactive link — Dashboard in Jordan Reeves's BADS workspace. */
|
|
24
24
|
export const Default: Story = {
|
|
25
|
+
parameters: { controls: { disable: true } },
|
|
25
26
|
render: () => (
|
|
26
27
|
<div className="w-60">
|
|
27
28
|
<NavLink href="/dashboard" icon={<LayoutDashboard aria-hidden="true" />}>
|
|
@@ -37,6 +38,7 @@ export const Default: Story = {
|
|
|
37
38
|
* toggling: the active mark survives SSR and static export.
|
|
38
39
|
*/
|
|
39
40
|
export const Active: Story = {
|
|
41
|
+
parameters: { controls: { disable: true } },
|
|
40
42
|
render: () => (
|
|
41
43
|
<div className="w-60">
|
|
42
44
|
<NavLink
|
|
@@ -56,6 +58,7 @@ export const Active: Story = {
|
|
|
56
58
|
* Counts that lack visible label text should carry `aria-label`.
|
|
57
59
|
*/
|
|
58
60
|
export const WithBadge: Story = {
|
|
61
|
+
parameters: { controls: { disable: true } },
|
|
59
62
|
render: () => (
|
|
60
63
|
<div className="w-60 space-y-1">
|
|
61
64
|
<NavLink
|
|
@@ -97,6 +100,7 @@ export const WithBadge: Story = {
|
|
|
97
100
|
* convey hierarchy. No JavaScript state: the indent is a layout-only signal.
|
|
98
101
|
*/
|
|
99
102
|
export const Nested: Story = {
|
|
103
|
+
parameters: { controls: { disable: true } },
|
|
100
104
|
render: () => (
|
|
101
105
|
<div className="w-60 space-y-0.5">
|
|
102
106
|
<NavLink href="/reports" icon={<BarChart3 aria-hidden="true" />}>
|
|
@@ -122,6 +126,7 @@ export const Nested: Story = {
|
|
|
122
126
|
* slots are injected as children of the merged element via Slottable.
|
|
123
127
|
*/
|
|
124
128
|
export const AsChild: Story = {
|
|
129
|
+
parameters: { controls: { disable: true } },
|
|
125
130
|
render: () => (
|
|
126
131
|
<div className="w-60 space-y-0.5">
|
|
127
132
|
{/* Simulated with a plain <a> — in a Next.js app replace with <NextLink> */}
|
|
@@ -141,6 +146,7 @@ export const AsChild: Story = {
|
|
|
141
146
|
* consider whether removing the item entirely is clearer.
|
|
142
147
|
*/
|
|
143
148
|
export const Disabled: Story = {
|
|
149
|
+
parameters: { controls: { disable: true } },
|
|
144
150
|
render: () => (
|
|
145
151
|
<div className="w-60 space-y-0.5">
|
|
146
152
|
<NavLink href="/dashboard" icon={<LayoutDashboard aria-hidden="true" />}>
|
|
@@ -163,6 +169,7 @@ export const Disabled: Story = {
|
|
|
163
169
|
* nested sub-items expanded inline.
|
|
164
170
|
*/
|
|
165
171
|
export const RealisticUse: Story = {
|
|
172
|
+
parameters: { controls: { disable: true } },
|
|
166
173
|
render: () => (
|
|
167
174
|
<nav
|
|
168
175
|
aria-label="Main navigation — BADS workspace"
|
|
@@ -63,6 +63,7 @@ const ListItem = ({
|
|
|
63
63
|
);
|
|
64
64
|
|
|
65
65
|
export const Default: Story = {
|
|
66
|
+
parameters: { controls: { disable: true } },
|
|
66
67
|
render: () => (
|
|
67
68
|
<NavigationMenu>
|
|
68
69
|
<NavigationMenuList>
|
|
@@ -129,6 +130,7 @@ export const Default: Story = {
|
|
|
129
130
|
};
|
|
130
131
|
|
|
131
132
|
export const SimpleLinks: Story = {
|
|
133
|
+
parameters: { controls: { disable: true } },
|
|
132
134
|
render: () => (
|
|
133
135
|
<NavigationMenu>
|
|
134
136
|
<NavigationMenuList>
|
|
@@ -170,6 +172,7 @@ export const SimpleLinks: Story = {
|
|
|
170
172
|
};
|
|
171
173
|
|
|
172
174
|
export const WithTriggerAndLinks: Story = {
|
|
175
|
+
parameters: { controls: { disable: true } },
|
|
173
176
|
render: () => (
|
|
174
177
|
<NavigationMenu>
|
|
175
178
|
<NavigationMenuList>
|
|
@@ -211,6 +214,7 @@ export const WithTriggerAndLinks: Story = {
|
|
|
211
214
|
};
|
|
212
215
|
|
|
213
216
|
export const WithIndicator: Story = {
|
|
217
|
+
parameters: { controls: { disable: true } },
|
|
214
218
|
render: () => (
|
|
215
219
|
<NavigationMenu>
|
|
216
220
|
<NavigationMenuList>
|
|
@@ -257,6 +261,7 @@ export const WithIndicator: Story = {
|
|
|
257
261
|
};
|
|
258
262
|
|
|
259
263
|
export const RealisticUse: Story = {
|
|
264
|
+
parameters: { controls: { disable: true } },
|
|
260
265
|
render: () => (
|
|
261
266
|
<div className="w-full max-w-4xl rounded-md border bg-background p-3">
|
|
262
267
|
<div className="flex items-center justify-between">
|
|
@@ -49,6 +49,7 @@ function Frame({ children }: { children: React.ReactNode }) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export const Default: Story = {
|
|
52
|
+
parameters: { controls: { disable: true } },
|
|
52
53
|
render: () => (
|
|
53
54
|
<Frame>
|
|
54
55
|
<NavigationRail defaultValue="dashboard" label="Primary">
|
|
@@ -83,6 +84,7 @@ export const Default: Story = {
|
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
export const Expanded: Story = {
|
|
87
|
+
parameters: { controls: { disable: true } },
|
|
86
88
|
render: () => (
|
|
87
89
|
<Frame>
|
|
88
90
|
<NavigationRail defaultValue="components" expanded label="Design system">
|
|
@@ -112,6 +114,7 @@ export const Expanded: Story = {
|
|
|
112
114
|
};
|
|
113
115
|
|
|
114
116
|
export const WithBadge: Story = {
|
|
117
|
+
parameters: { controls: { disable: true } },
|
|
115
118
|
render: () => (
|
|
116
119
|
<Frame>
|
|
117
120
|
<NavigationRail defaultValue="home" label="Primary">
|
|
@@ -140,6 +143,7 @@ export const WithBadge: Story = {
|
|
|
140
143
|
};
|
|
141
144
|
|
|
142
145
|
export const Disabled: Story = {
|
|
146
|
+
parameters: { controls: { disable: true } },
|
|
143
147
|
render: () => (
|
|
144
148
|
<Frame>
|
|
145
149
|
<NavigationRail defaultValue="home" label="Primary">
|
|
@@ -165,6 +169,7 @@ export const Disabled: Story = {
|
|
|
165
169
|
};
|
|
166
170
|
|
|
167
171
|
export const WithHeader: Story = {
|
|
172
|
+
parameters: { controls: { disable: true } },
|
|
168
173
|
render: () => (
|
|
169
174
|
<Frame>
|
|
170
175
|
<NavigationRail defaultValue="components" label="Design system">
|
|
@@ -197,6 +202,7 @@ export const WithHeader: Story = {
|
|
|
197
202
|
};
|
|
198
203
|
|
|
199
204
|
export const WithFooter: Story = {
|
|
205
|
+
parameters: { controls: { disable: true } },
|
|
200
206
|
render: () => (
|
|
201
207
|
<Frame>
|
|
202
208
|
<NavigationRail defaultValue="home" label="Primary">
|
|
@@ -230,6 +236,7 @@ export const WithFooter: Story = {
|
|
|
230
236
|
// Each destination shown in its active state — the accent pill + semibold
|
|
231
237
|
// label + icon lift that signal aria-current="page" (never color alone).
|
|
232
238
|
export const ActiveItem: Story = {
|
|
239
|
+
parameters: { controls: { disable: true } },
|
|
233
240
|
render: () => (
|
|
234
241
|
<div className="flex gap-4">
|
|
235
242
|
{["home", "analytics", "team"].map((active) => (
|
|
@@ -266,6 +273,7 @@ export const ActiveItem: Story = {
|
|
|
266
273
|
*/
|
|
267
274
|
export const AllVariants: Story = {
|
|
268
275
|
tags: ["!manifest"],
|
|
276
|
+
parameters: { controls: { disable: true } },
|
|
269
277
|
render: () => (
|
|
270
278
|
<div className="flex items-start gap-6">
|
|
271
279
|
<div className="space-y-2">
|
|
@@ -317,6 +325,7 @@ export const AllVariants: Story = {
|
|
|
317
325
|
};
|
|
318
326
|
|
|
319
327
|
export const Minimal: Story = {
|
|
328
|
+
parameters: { controls: { disable: true } },
|
|
320
329
|
render: () => (
|
|
321
330
|
<Frame>
|
|
322
331
|
<NavigationRail defaultValue="home" label="Primary">
|
|
@@ -344,6 +353,7 @@ export const Minimal: Story = {
|
|
|
344
353
|
// content region beside it. Content pulled from content/personas/bads.json
|
|
345
354
|
// (design-system practitioner audience — Jordan Reeves, design.bads.com).
|
|
346
355
|
export const RealisticUse: Story = {
|
|
356
|
+
parameters: { controls: { disable: true } },
|
|
347
357
|
render: () => {
|
|
348
358
|
const [section, setSection] = React.useState("dashboard");
|
|
349
359
|
const screens: Record<string, { title: string; body: string }> = {
|
|
@@ -35,35 +35,19 @@ export default meta;
|
|
|
35
35
|
type Story = StoryObj<typeof meta>;
|
|
36
36
|
|
|
37
37
|
export const Default: Story = {
|
|
38
|
-
|
|
39
|
-
<Notification
|
|
40
|
-
title="Chromatic baseline updated"
|
|
41
|
-
description="4 visual changes are ready to review on the tokens-v2-proposal branch."
|
|
42
|
-
/>
|
|
43
|
-
),
|
|
38
|
+
args: { title: "Chromatic baseline updated", description: "4 visual changes are ready to review on the tokens-v2-proposal branch." },
|
|
44
39
|
};
|
|
45
40
|
|
|
46
41
|
export const Unread: Story = {
|
|
47
|
-
|
|
48
|
-
<Notification
|
|
49
|
-
unread
|
|
50
|
-
title="Jordan Reeves mentioned you"
|
|
51
|
-
description="“Can you confirm the 7:1 pair on the new success accent before I merge?”"
|
|
52
|
-
/>
|
|
53
|
-
),
|
|
42
|
+
args: { unread: true, title: "Jordan Reeves mentioned you", description: "“Can you confirm the 7:1 pair on the new success accent before I merge?”" },
|
|
54
43
|
};
|
|
55
44
|
|
|
56
45
|
export const WithTimestamp: Story = {
|
|
57
|
-
|
|
58
|
-
<Notification
|
|
59
|
-
title="Story coverage report ready"
|
|
60
|
-
description="Coverage is at 98.4% after last night's build pass."
|
|
61
|
-
timestamp="2 min ago"
|
|
62
|
-
/>
|
|
63
|
-
),
|
|
46
|
+
args: { title: "Story coverage report ready", description: "Coverage is at 98.4% after last night's build pass.", timestamp: "2 min ago" },
|
|
64
47
|
};
|
|
65
48
|
|
|
66
49
|
export const WithIcon: Story = {
|
|
50
|
+
parameters: { controls: { disable: true } },
|
|
67
51
|
render: () => (
|
|
68
52
|
<Notification
|
|
69
53
|
icon={<GitPullRequest strokeWidth={1.5} />}
|
|
@@ -75,16 +59,11 @@ export const WithIcon: Story = {
|
|
|
75
59
|
};
|
|
76
60
|
|
|
77
61
|
export const Loading: Story = {
|
|
78
|
-
|
|
79
|
-
<Notification
|
|
80
|
-
loading
|
|
81
|
-
title="Publishing tokens v2"
|
|
82
|
-
description="Running pnpm build:tokens and pushing to the registry."
|
|
83
|
-
/>
|
|
84
|
-
),
|
|
62
|
+
args: { loading: true, title: "Publishing tokens v2", description: "Running pnpm build:tokens and pushing to the registry." },
|
|
85
63
|
};
|
|
86
64
|
|
|
87
65
|
export const Variant_Destructive: Story = {
|
|
66
|
+
parameters: { controls: { disable: true } },
|
|
88
67
|
render: () => (
|
|
89
68
|
<Notification
|
|
90
69
|
variant="destructive"
|
|
@@ -97,6 +76,7 @@ export const Variant_Destructive: Story = {
|
|
|
97
76
|
};
|
|
98
77
|
|
|
99
78
|
export const Variant_Success: Story = {
|
|
79
|
+
parameters: { controls: { disable: true } },
|
|
100
80
|
render: () => (
|
|
101
81
|
<Notification
|
|
102
82
|
variant="success"
|
|
@@ -109,6 +89,7 @@ export const Variant_Success: Story = {
|
|
|
109
89
|
};
|
|
110
90
|
|
|
111
91
|
export const Variant_Warning: Story = {
|
|
92
|
+
parameters: { controls: { disable: true } },
|
|
112
93
|
render: () => (
|
|
113
94
|
<Notification
|
|
114
95
|
variant="warning"
|
|
@@ -121,6 +102,7 @@ export const Variant_Warning: Story = {
|
|
|
121
102
|
};
|
|
122
103
|
|
|
123
104
|
export const WithActions: Story = {
|
|
105
|
+
parameters: { controls: { disable: true } },
|
|
124
106
|
render: () => (
|
|
125
107
|
<Notification
|
|
126
108
|
unread
|
|
@@ -169,6 +151,7 @@ function WithActionsAndDismissDemo() {
|
|
|
169
151
|
// Tab order contract: the action button comes BEFORE the dismiss X (actions
|
|
170
152
|
// live in the content column, dismiss is a later DOM sibling).
|
|
171
153
|
export const WithActionsAndDismiss: Story = {
|
|
154
|
+
parameters: { controls: { disable: true } },
|
|
172
155
|
render: () => <WithActionsAndDismissDemo />,
|
|
173
156
|
};
|
|
174
157
|
|
|
@@ -199,7 +182,7 @@ function DismissibleDemo() {
|
|
|
199
182
|
|
|
200
183
|
export const Dismissible: Story = {
|
|
201
184
|
render: () => <DismissibleDemo />,
|
|
202
|
-
parameters: {
|
|
185
|
+
parameters: { controls: { disable: true },
|
|
203
186
|
a11y: {
|
|
204
187
|
config: {
|
|
205
188
|
rules: [
|
|
@@ -218,12 +201,7 @@ export const Dismissible: Story = {
|
|
|
218
201
|
};
|
|
219
202
|
|
|
220
203
|
export const NoTitle: Story = {
|
|
221
|
-
|
|
222
|
-
<Notification
|
|
223
|
-
description="Seo-yun Park accepted your invite to the design-tokens workspace."
|
|
224
|
-
timestamp="3 hrs ago"
|
|
225
|
-
/>
|
|
226
|
-
),
|
|
204
|
+
args: { description: "Seo-yun Park accepted your invite to the design-tokens workspace.", timestamp: "3 hrs ago" },
|
|
227
205
|
};
|
|
228
206
|
|
|
229
207
|
type FeedItem = {
|
|
@@ -313,5 +291,6 @@ function RealisticUseDemo() {
|
|
|
313
291
|
}
|
|
314
292
|
|
|
315
293
|
export const RealisticUse: Story = {
|
|
294
|
+
parameters: { controls: { disable: true } },
|
|
316
295
|
render: () => <RealisticUseDemo />,
|
|
317
296
|
};
|
|
@@ -21,37 +21,68 @@ function Controlled(props: Omit<React.ComponentProps<typeof NumberInput>, "value
|
|
|
21
21
|
|
|
22
22
|
// ─── Default ─────────────────────────────────────────────────────────────────
|
|
23
23
|
export const Default: Story = {
|
|
24
|
+
parameters: { controls: { disable: true } },
|
|
24
25
|
render: () => <Controlled aria-label="Quantity" />,
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
// ─── Size variants ────────────────────────────────────────────────────────────
|
|
28
29
|
export const Size_Sm: Story = {
|
|
30
|
+
parameters: { controls: { disable: true } },
|
|
29
31
|
render: () => <Controlled size="sm" aria-label="Quantity" />,
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export const Size_Default: Story = {
|
|
35
|
+
parameters: { controls: { disable: true } },
|
|
33
36
|
render: () => <Controlled size="default" aria-label="Quantity" />,
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
export const Size_Lg: Story = {
|
|
40
|
+
parameters: { controls: { disable: true } },
|
|
37
41
|
render: () => <Controlled size="lg" aria-label="Quantity" />,
|
|
38
42
|
};
|
|
39
43
|
|
|
40
44
|
// ─── With min / max ──────────────────────────────────────────────────────────
|
|
41
45
|
export const MinMax: Story = {
|
|
46
|
+
parameters: { controls: { disable: true } },
|
|
42
47
|
render: () => <Controlled min={0} max={10} defaultValue={5} aria-label="Rating (0–10)" />,
|
|
43
48
|
name: "Min / Max (0–10)",
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
// ─── With step ───────────────────────────────────────────────────────────────
|
|
47
52
|
export const Step: Story = {
|
|
53
|
+
parameters: { controls: { disable: true } },
|
|
48
54
|
render: () => <Controlled step={5} defaultValue={0} aria-label="Amount ($)" />,
|
|
49
55
|
name: "Step of 5",
|
|
50
56
|
};
|
|
51
57
|
|
|
58
|
+
// Stepping a fraction must not leak float noise (0.2 + 0.1 shows 0.3, not 0.30000000000000004).
|
|
59
|
+
export const DecimalStep: Story = {
|
|
60
|
+
render: () => <Controlled step={0.1} defaultValue={0.2} aria-label="Discount rate" />,
|
|
61
|
+
name: "Decimal step (0.1)",
|
|
62
|
+
parameters: { controls: { disable: true } },
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// A caller's onBlur runs alongside commit-on-blur instead of replacing it.
|
|
66
|
+
export const WithOnBlur: Story = {
|
|
67
|
+
parameters: { controls: { disable: true } },
|
|
68
|
+
render: () => {
|
|
69
|
+
const [seen, setSeen] = React.useState("none yet");
|
|
70
|
+
return (
|
|
71
|
+
<div className="flex flex-col gap-3">
|
|
72
|
+
<NumberInput
|
|
73
|
+
defaultValue={3}
|
|
74
|
+
aria-label="Seats"
|
|
75
|
+
onBlur={(e) => setSeen(e.currentTarget.value)}
|
|
76
|
+
/>
|
|
77
|
+
<p className="text-sm text-muted-foreground">Last blur saw: {seen}</p>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
52
83
|
// ─── Disabled ─────────────────────────────────────────────────────────────────
|
|
53
84
|
export const Disabled: Story = {
|
|
54
|
-
|
|
85
|
+
args: { value: 42, disabled: true, "aria-label": "Quantity" },
|
|
55
86
|
};
|
|
56
87
|
|
|
57
88
|
// ─── Realistic use: ticket quantity picker ───────────────────────────────────
|
|
@@ -96,6 +127,7 @@ function TicketPicker() {
|
|
|
96
127
|
}
|
|
97
128
|
|
|
98
129
|
export const RealisticUse: Story = {
|
|
130
|
+
parameters: { controls: { disable: true } },
|
|
99
131
|
render: () => <TicketPicker />,
|
|
100
132
|
};
|
|
101
133
|
|