@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
|
@@ -13,6 +13,7 @@ export default meta;
|
|
|
13
13
|
type Story = StoryObj<typeof meta>;
|
|
14
14
|
|
|
15
15
|
export const Default: Story = {
|
|
16
|
+
parameters: { controls: { disable: true } },
|
|
16
17
|
render: () => (<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
17
18
|
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="r1" /><Label htmlFor="r1">Default</Label></div>
|
|
18
19
|
<div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="r2" /><Label htmlFor="r2">Comfortable</Label></div>
|
|
@@ -21,6 +22,7 @@ export const Default: Story = {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export const Disabled: Story = {
|
|
25
|
+
parameters: { controls: { disable: true } },
|
|
24
26
|
render: () => (
|
|
25
27
|
<RadioGroup defaultValue="comfortable" disabled className="flex flex-col gap-2 w-[280px]">
|
|
26
28
|
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="rd1" /><Label htmlFor="rd1">Default</Label></div>
|
|
@@ -31,6 +33,7 @@ export const Disabled: Story = {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
export const Size_Sm: Story = {
|
|
36
|
+
parameters: { controls: { disable: true } },
|
|
34
37
|
render: () => (
|
|
35
38
|
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
36
39
|
<div className="flex items-center gap-2"><RadioGroupItem size="sm" value="default" id="rs1" /><Label htmlFor="rs1">Default</Label></div>
|
|
@@ -41,6 +44,7 @@ export const Size_Sm: Story = {
|
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
export const Size_Default: Story = {
|
|
47
|
+
parameters: { controls: { disable: true } },
|
|
44
48
|
render: () => (
|
|
45
49
|
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
46
50
|
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="rsd1" /><Label htmlFor="rsd1">Default</Label></div>
|
|
@@ -51,6 +55,7 @@ export const Size_Default: Story = {
|
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
export const Size_Lg: Story = {
|
|
58
|
+
parameters: { controls: { disable: true } },
|
|
54
59
|
render: () => (
|
|
55
60
|
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
56
61
|
<div className="flex items-center gap-2"><RadioGroupItem size="lg" value="default" id="rl1" /><Label htmlFor="rl1">Default</Label></div>
|
|
@@ -61,6 +66,7 @@ export const Size_Lg: Story = {
|
|
|
61
66
|
};
|
|
62
67
|
|
|
63
68
|
export const Horizontal: Story = {
|
|
69
|
+
parameters: { controls: { disable: true } },
|
|
64
70
|
render: () => (
|
|
65
71
|
<RadioGroup orientation="horizontal" defaultValue="comfortable">
|
|
66
72
|
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="rh1" /><Label htmlFor="rh1">Default</Label></div>
|
|
@@ -70,10 +76,44 @@ export const Horizontal: Story = {
|
|
|
70
76
|
),
|
|
71
77
|
};
|
|
72
78
|
|
|
79
|
+
// An option whose label is wider than the box. The group's single column must be allowed to shrink
|
|
80
|
+
// (minmax(0, 1fr)), or the group widens the whole page instead of the label truncating or wrapping.
|
|
81
|
+
export const LongLabelsInNarrowBox: Story = {
|
|
82
|
+
parameters: { controls: { disable: true } },
|
|
83
|
+
render: () => (
|
|
84
|
+
<div className="w-[240px] rounded-md border p-3">
|
|
85
|
+
<RadioGroup defaultValue="a" aria-label="Billing contact">
|
|
86
|
+
{["finance-operations-and-procurement@meridian-health.example", "Ana"].map((label, i) => (
|
|
87
|
+
<div key={label} className="flex min-w-0 items-center gap-3">
|
|
88
|
+
<RadioGroupItem id={`long-${i}`} value={i === 0 ? "a" : "b"} />
|
|
89
|
+
<Label htmlFor={`long-${i}`} className="min-w-0 truncate" title={label}>{label}</Label>
|
|
90
|
+
</div>
|
|
91
|
+
))}
|
|
92
|
+
</RadioGroup>
|
|
93
|
+
</div>
|
|
94
|
+
),
|
|
95
|
+
};
|
|
96
|
+
|
|
73
97
|
export const RealisticUse: Story = {
|
|
98
|
+
parameters: { controls: { disable: true } },
|
|
74
99
|
render: () => (<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
75
100
|
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="r1" /><Label htmlFor="r1">Default</Label></div>
|
|
76
101
|
<div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="r2" /><Label htmlFor="r2">Comfortable</Label></div>
|
|
77
102
|
<div className="flex items-center gap-2"><RadioGroupItem value="compact" id="r3" /><Label htmlFor="r3">Compact</Label></div>
|
|
78
103
|
</RadioGroup>),
|
|
79
104
|
};
|
|
105
|
+
|
|
106
|
+
// Regression story: the unselected radio painted solid white on dark surfaces
|
|
107
|
+
// (hard-coded bg-white), the same bug Checkbox had.
|
|
108
|
+
export const OnDarkSurface: Story = {
|
|
109
|
+
parameters: { controls: { disable: true } },
|
|
110
|
+
render: () => (
|
|
111
|
+
<div className="dark rounded-lg bg-background p-6 text-foreground">
|
|
112
|
+
<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
|
|
113
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="default" id="rd1" /><Label htmlFor="rd1">Default</Label></div>
|
|
114
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="rd2" /><Label htmlFor="rd2">Comfortable</Label></div>
|
|
115
|
+
<div className="flex items-center gap-2"><RadioGroupItem value="compact" id="rd3" disabled /><Label htmlFor="rd3">Compact (disabled)</Label></div>
|
|
116
|
+
</RadioGroup>
|
|
117
|
+
</div>
|
|
118
|
+
),
|
|
119
|
+
};
|
|
@@ -18,6 +18,7 @@ export default meta;
|
|
|
18
18
|
type Story = StoryObj<typeof meta>;
|
|
19
19
|
|
|
20
20
|
export const Default: Story = {
|
|
21
|
+
parameters: { controls: { disable: true } },
|
|
21
22
|
render: () => {
|
|
22
23
|
const [value, setValue] = React.useState(0);
|
|
23
24
|
return <RatingGroup value={value} onValueChange={setValue} label="Rate this session" />;
|
|
@@ -25,6 +26,7 @@ export const Default: Story = {
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export const Size_Small: Story = {
|
|
29
|
+
parameters: { controls: { disable: true } },
|
|
28
30
|
render: () => {
|
|
29
31
|
const [value, setValue] = React.useState(3);
|
|
30
32
|
return (
|
|
@@ -37,6 +39,7 @@ export const Size_Small: Story = {
|
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export const Size_Default: Story = {
|
|
42
|
+
parameters: { controls: { disable: true } },
|
|
40
43
|
render: () => {
|
|
41
44
|
const [value, setValue] = React.useState(3);
|
|
42
45
|
return <RatingGroup size="default" value={value} onValueChange={setValue} label="Rating" />;
|
|
@@ -44,6 +47,7 @@ export const Size_Default: Story = {
|
|
|
44
47
|
};
|
|
45
48
|
|
|
46
49
|
export const Size_Large: Story = {
|
|
50
|
+
parameters: { controls: { disable: true } },
|
|
47
51
|
render: () => {
|
|
48
52
|
const [value, setValue] = React.useState(3);
|
|
49
53
|
return <RatingGroup size="lg" value={value} onValueChange={setValue} label="Rating" />;
|
|
@@ -51,12 +55,11 @@ export const Size_Large: Story = {
|
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
export const Variant_ReadOnly: Story = {
|
|
54
|
-
|
|
55
|
-
<RatingGroup value={4} readOnly label="Average rating" />
|
|
56
|
-
),
|
|
58
|
+
args: { value: 4, readOnly: true, label: "Average rating" },
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
export const Variant_CustomMax: Story = {
|
|
62
|
+
parameters: { controls: { disable: true } },
|
|
60
63
|
render: () => {
|
|
61
64
|
const [value, setValue] = React.useState(0);
|
|
62
65
|
return <RatingGroup value={value} onValueChange={setValue} max={10} label="Rate out of 10" />;
|
|
@@ -64,10 +67,11 @@ export const Variant_CustomMax: Story = {
|
|
|
64
67
|
};
|
|
65
68
|
|
|
66
69
|
export const Disabled: Story = {
|
|
67
|
-
|
|
70
|
+
args: { value: 2, disabled: true, label: "Rating" },
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
export const RealisticUse: Story = {
|
|
74
|
+
parameters: { controls: { disable: true } },
|
|
71
75
|
render: () => {
|
|
72
76
|
const [value, setValue] = React.useState(0);
|
|
73
77
|
const [submitted, setSubmitted] = React.useState(false);
|
|
@@ -12,7 +12,8 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
|
|
14
14
|
export const Default: Story = {
|
|
15
|
-
|
|
15
|
+
parameters: { controls: { disable: true } },
|
|
16
|
+
render: () => (<ResizablePanelGroup orientation="horizontal" className="h-40 w-[420px] rounded-md border">
|
|
16
17
|
<ResizablePanel defaultSize={40}><div className="p-3 text-sm">Left</div></ResizablePanel>
|
|
17
18
|
<ResizableHandle />
|
|
18
19
|
<ResizablePanel defaultSize={60}><div className="p-3 text-sm">Right</div></ResizablePanel>
|
|
@@ -20,7 +21,8 @@ export const Default: Story = {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export const RealisticUse: Story = {
|
|
23
|
-
|
|
24
|
+
parameters: { controls: { disable: true } },
|
|
25
|
+
render: () => (<ResizablePanelGroup orientation="horizontal" className="h-40 w-[420px] rounded-md border">
|
|
24
26
|
<ResizablePanel defaultSize={40}><div className="p-3 text-sm">Left</div></ResizablePanel>
|
|
25
27
|
<ResizableHandle />
|
|
26
28
|
<ResizablePanel defaultSize={60}><div className="p-3 text-sm">Right</div></ResizablePanel>
|
|
@@ -93,6 +93,7 @@ export const WithSubtitle: Story = {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export const WithExtra: Story = {
|
|
96
|
+
parameters: { controls: { disable: true } },
|
|
96
97
|
render: () => (
|
|
97
98
|
<Result
|
|
98
99
|
status="success"
|
|
@@ -111,6 +112,7 @@ export const WithExtra: Story = {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export const WithCustomIcon: Story = {
|
|
115
|
+
parameters: { controls: { disable: true } },
|
|
114
116
|
render: () => (
|
|
115
117
|
<Result
|
|
116
118
|
status="success"
|
|
@@ -123,6 +125,7 @@ export const WithCustomIcon: Story = {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
export const RealisticUse: Story = {
|
|
128
|
+
parameters: { controls: { disable: true } },
|
|
126
129
|
render: () => (
|
|
127
130
|
// Post-checkout confirmation surface — the shape this primitive ships in
|
|
128
131
|
// most often: full-card outcome after an async operation concludes.
|
|
@@ -38,6 +38,7 @@ function DemoCard({ n }: { n: number }) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const Default: Story = {
|
|
41
|
+
parameters: { controls: { disable: true } },
|
|
41
42
|
render: () => (
|
|
42
43
|
<div className="mx-auto max-w-md space-y-6 p-6">
|
|
43
44
|
{Array.from({ length: 10 }, (_, i) => (
|
|
@@ -50,6 +51,7 @@ export const Default: Story = {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export const RealisticUse: Story = {
|
|
54
|
+
parameters: { controls: { disable: true } },
|
|
53
55
|
render: () => (
|
|
54
56
|
<div className="mx-auto max-w-2xl space-y-6 p-6">
|
|
55
57
|
<h2 className="text-2xl font-semibold">Activity</h2>
|
|
@@ -29,6 +29,7 @@ export default meta;
|
|
|
29
29
|
type Story = StoryObj<typeof meta>;
|
|
30
30
|
|
|
31
31
|
export const Default: Story = {
|
|
32
|
+
parameters: { controls: { disable: true } },
|
|
32
33
|
render: () => {
|
|
33
34
|
const [value, setValue] = React.useState(1247);
|
|
34
35
|
return (
|
|
@@ -55,6 +56,7 @@ export const Default: Story = {
|
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
export const WithPrefix: Story = {
|
|
59
|
+
parameters: { controls: { disable: true } },
|
|
58
60
|
render: () => {
|
|
59
61
|
const [value, setValue] = React.useState(24819);
|
|
60
62
|
return (
|
|
@@ -83,6 +85,7 @@ export const WithPrefix: Story = {
|
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
export const WithSuffix: Story = {
|
|
88
|
+
parameters: { controls: { disable: true } },
|
|
86
89
|
render: () => {
|
|
87
90
|
const [value, setValue] = React.useState(87);
|
|
88
91
|
return (
|
|
@@ -115,6 +118,7 @@ export const WithSuffix: Story = {
|
|
|
115
118
|
};
|
|
116
119
|
|
|
117
120
|
export const WithDecimals: Story = {
|
|
121
|
+
parameters: { controls: { disable: true } },
|
|
118
122
|
render: () => {
|
|
119
123
|
const [value, setValue] = React.useState(3.14159);
|
|
120
124
|
return (
|
|
@@ -147,6 +151,7 @@ export const WithDecimals: Story = {
|
|
|
147
151
|
};
|
|
148
152
|
|
|
149
153
|
export const RealisticUse: Story = {
|
|
154
|
+
parameters: { controls: { disable: true } },
|
|
150
155
|
render: () => {
|
|
151
156
|
const [revenue, setRevenue] = React.useState(142830);
|
|
152
157
|
const [users, setUsers] = React.useState(8471);
|
|
@@ -12,6 +12,7 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
|
|
14
14
|
export const Default: Story = {
|
|
15
|
+
parameters: { controls: { disable: true } },
|
|
15
16
|
render: () => (<ScrollArea aria-label="Tags" className="h-48 w-64 rounded-md border p-3">
|
|
16
17
|
<div className="flex flex-col gap-2 text-sm">
|
|
17
18
|
{Array.from({ length: 30 }).map((_, i) => (
|
|
@@ -22,6 +23,7 @@ export const Default: Story = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const RealisticUse: Story = {
|
|
26
|
+
parameters: { controls: { disable: true } },
|
|
25
27
|
render: () => (<ScrollArea aria-label="Tags" className="h-48 w-64 rounded-md border p-3">
|
|
26
28
|
<div className="flex flex-col gap-2 text-sm">
|
|
27
29
|
{Array.from({ length: 30 }).map((_, i) => (
|
|
@@ -46,7 +48,7 @@ export const ConstrainsWideContent: Story = {
|
|
|
46
48
|
// the rendered code sample — an accurate finding, but unrelated to the
|
|
47
49
|
// layout invariant we want to preserve. Disable axe per the test-runner
|
|
48
50
|
// opt-out pattern in .storybook/test-runner.ts.
|
|
49
|
-
parameters: {
|
|
51
|
+
parameters: { controls: { disable: true },
|
|
50
52
|
a11y: { disable: true },
|
|
51
53
|
},
|
|
52
54
|
render: () => (
|
|
@@ -21,6 +21,7 @@ export default meta;
|
|
|
21
21
|
type Story = StoryObj<typeof meta>;
|
|
22
22
|
|
|
23
23
|
export const Default: Story = {
|
|
24
|
+
parameters: { controls: { disable: true } },
|
|
24
25
|
render: () => {
|
|
25
26
|
const [value, setValue] = React.useState("");
|
|
26
27
|
return (
|
|
@@ -34,6 +35,7 @@ export const Default: Story = {
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export const WithValue: Story = {
|
|
38
|
+
parameters: { controls: { disable: true } },
|
|
37
39
|
render: () => {
|
|
38
40
|
const [value, setValue] = React.useState("button");
|
|
39
41
|
return (
|
|
@@ -48,6 +50,7 @@ export const WithValue: Story = {
|
|
|
48
50
|
|
|
49
51
|
export const Size_Sm: Story = {
|
|
50
52
|
name: "Size — sm",
|
|
53
|
+
parameters: { controls: { disable: true } },
|
|
51
54
|
render: () => {
|
|
52
55
|
const [value, setValue] = React.useState("");
|
|
53
56
|
return (
|
|
@@ -63,6 +66,7 @@ export const Size_Sm: Story = {
|
|
|
63
66
|
|
|
64
67
|
export const Size_Default: Story = {
|
|
65
68
|
name: "Size — default",
|
|
69
|
+
parameters: { controls: { disable: true } },
|
|
66
70
|
render: () => {
|
|
67
71
|
const [value, setValue] = React.useState("");
|
|
68
72
|
return (
|
|
@@ -78,6 +82,7 @@ export const Size_Default: Story = {
|
|
|
78
82
|
|
|
79
83
|
export const Size_Lg: Story = {
|
|
80
84
|
name: "Size — lg",
|
|
85
|
+
parameters: { controls: { disable: true } },
|
|
81
86
|
render: () => {
|
|
82
87
|
const [value, setValue] = React.useState("");
|
|
83
88
|
return (
|
|
@@ -92,17 +97,15 @@ export const Size_Lg: Story = {
|
|
|
92
97
|
};
|
|
93
98
|
|
|
94
99
|
export const Disabled: Story = {
|
|
95
|
-
|
|
96
|
-
<SearchInput value="accessibility" disabled placeholder="Search…" />
|
|
97
|
-
),
|
|
100
|
+
args: { value: "accessibility", disabled: true, placeholder: "Search…" },
|
|
98
101
|
};
|
|
99
102
|
|
|
100
103
|
export const Loading: Story = {
|
|
101
|
-
|
|
102
|
-
<SearchInput value="motion" loading placeholder="Searching…" />
|
|
103
|
-
),
|
|
104
|
+
args: { value: "motion", loading: true, placeholder: "Searching…" },
|
|
104
105
|
};
|
|
105
106
|
|
|
107
|
+
// Enter pressed to confirm an IME candidate (Japanese, Chinese, Korean) is ignored by this component.
|
|
108
|
+
// Not scriptable in a story; check by hand with an IME on.
|
|
106
109
|
export const RealisticUse: Story = {
|
|
107
110
|
decorators: [
|
|
108
111
|
(Story) => (
|
|
@@ -111,6 +114,7 @@ export const RealisticUse: Story = {
|
|
|
111
114
|
</div>
|
|
112
115
|
),
|
|
113
116
|
],
|
|
117
|
+
parameters: { controls: { disable: true } },
|
|
114
118
|
render: () => {
|
|
115
119
|
const [value, setValue] = React.useState("");
|
|
116
120
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -47,6 +47,7 @@ function Controlled({
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export const Default: Story = {
|
|
50
|
+
parameters: { controls: { disable: true } },
|
|
50
51
|
render: () => (
|
|
51
52
|
<Controlled defaultValue="list">
|
|
52
53
|
<SegmentedControlItem value="list">List</SegmentedControlItem>
|
|
@@ -57,6 +58,7 @@ export const Default: Story = {
|
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
export const Size_Sm: Story = {
|
|
61
|
+
parameters: { controls: { disable: true } },
|
|
60
62
|
render: () => (
|
|
61
63
|
<Controlled defaultValue="month" size="sm">
|
|
62
64
|
<SegmentedControlItem value="day">Day</SegmentedControlItem>
|
|
@@ -67,6 +69,7 @@ export const Size_Sm: Story = {
|
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
export const Size_Default: Story = {
|
|
72
|
+
parameters: { controls: { disable: true } },
|
|
70
73
|
render: () => (
|
|
71
74
|
<Controlled defaultValue="active">
|
|
72
75
|
<SegmentedControlItem value="all">All</SegmentedControlItem>
|
|
@@ -77,6 +80,7 @@ export const Size_Default: Story = {
|
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
export const Size_Lg: Story = {
|
|
83
|
+
parameters: { controls: { disable: true } },
|
|
80
84
|
render: () => (
|
|
81
85
|
<Controlled defaultValue="quarter" size="lg">
|
|
82
86
|
<SegmentedControlItem value="month">Month</SegmentedControlItem>
|
|
@@ -87,6 +91,7 @@ export const Size_Lg: Story = {
|
|
|
87
91
|
};
|
|
88
92
|
|
|
89
93
|
export const WithIcons: Story = {
|
|
94
|
+
parameters: { controls: { disable: true } },
|
|
90
95
|
render: () => (
|
|
91
96
|
<Controlled defaultValue="grid">
|
|
92
97
|
<SegmentedControlItem value="list" icon={<ListIcon strokeWidth={1.5} />}>List</SegmentedControlItem>
|
|
@@ -97,6 +102,7 @@ export const WithIcons: Story = {
|
|
|
97
102
|
};
|
|
98
103
|
|
|
99
104
|
export const IconOnly: Story = {
|
|
105
|
+
parameters: { controls: { disable: true } },
|
|
100
106
|
render: () => (
|
|
101
107
|
<Controlled defaultValue="chart">
|
|
102
108
|
<SegmentedControlItem value="chart" aria-label="Chart view">
|
|
@@ -113,6 +119,7 @@ export const IconOnly: Story = {
|
|
|
113
119
|
};
|
|
114
120
|
|
|
115
121
|
export const Disabled: Story = {
|
|
122
|
+
parameters: { controls: { disable: true } },
|
|
116
123
|
render: () => (
|
|
117
124
|
<Controlled defaultValue="month" disabled>
|
|
118
125
|
<SegmentedControlItem value="day">Day</SegmentedControlItem>
|
|
@@ -123,6 +130,7 @@ export const Disabled: Story = {
|
|
|
123
130
|
};
|
|
124
131
|
|
|
125
132
|
export const DisabledItem: Story = {
|
|
133
|
+
parameters: { controls: { disable: true } },
|
|
126
134
|
render: () => (
|
|
127
135
|
<Controlled defaultValue="list">
|
|
128
136
|
<SegmentedControlItem value="list">List</SegmentedControlItem>
|
|
@@ -133,6 +141,7 @@ export const DisabledItem: Story = {
|
|
|
133
141
|
};
|
|
134
142
|
|
|
135
143
|
export const TwoItems: Story = {
|
|
144
|
+
parameters: { controls: { disable: true } },
|
|
136
145
|
render: () => (
|
|
137
146
|
<Controlled defaultValue="on">
|
|
138
147
|
<SegmentedControlItem value="on">On</SegmentedControlItem>
|
|
@@ -142,6 +151,7 @@ export const TwoItems: Story = {
|
|
|
142
151
|
};
|
|
143
152
|
|
|
144
153
|
export const FiveItems: Story = {
|
|
154
|
+
parameters: { controls: { disable: true } },
|
|
145
155
|
render: () => (
|
|
146
156
|
<Controlled defaultValue="wed">
|
|
147
157
|
<SegmentedControlItem value="mon">Mon</SegmentedControlItem>
|
|
@@ -155,6 +165,7 @@ export const FiveItems: Story = {
|
|
|
155
165
|
|
|
156
166
|
// Realistic use: design-system release view toggle
|
|
157
167
|
export const RealisticUse: Story = {
|
|
168
|
+
parameters: { controls: { disable: true } },
|
|
158
169
|
render: () => {
|
|
159
170
|
const [view, setView] = React.useState("upcoming");
|
|
160
171
|
return (
|
|
@@ -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: () => (<Select>
|
|
23
24
|
<SelectTrigger className="w-[220px]" aria-label="Pick a fruit"><SelectValue placeholder="Pick a fruit" /></SelectTrigger>
|
|
24
25
|
<SelectContent>
|
|
@@ -33,6 +34,7 @@ export const Default: Story = {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export const Disabled: Story = {
|
|
37
|
+
parameters: { controls: { disable: true } },
|
|
36
38
|
render: () => (
|
|
37
39
|
<Select disabled>
|
|
38
40
|
<SelectTrigger className="w-[220px]" aria-label="Pick a fruit"><SelectValue placeholder="Pick a fruit" /></SelectTrigger>
|
|
@@ -49,6 +51,7 @@ export const Disabled: Story = {
|
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
export const Size_Sm: Story = {
|
|
54
|
+
parameters: { controls: { disable: true } },
|
|
52
55
|
render: () => (
|
|
53
56
|
<Select>
|
|
54
57
|
<SelectTrigger size="sm" className="w-[220px]" aria-label="Pick a fruit (small)">
|
|
@@ -67,6 +70,7 @@ export const Size_Sm: Story = {
|
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
export const Size_Default: Story = {
|
|
73
|
+
parameters: { controls: { disable: true } },
|
|
70
74
|
render: () => (
|
|
71
75
|
<Select>
|
|
72
76
|
<SelectTrigger size="default" className="w-[220px]" aria-label="Pick a fruit (default)">
|
|
@@ -85,6 +89,7 @@ export const Size_Default: Story = {
|
|
|
85
89
|
};
|
|
86
90
|
|
|
87
91
|
export const Size_Lg: Story = {
|
|
92
|
+
parameters: { controls: { disable: true } },
|
|
88
93
|
render: () => (
|
|
89
94
|
<Select>
|
|
90
95
|
<SelectTrigger size="lg" className="w-[220px]" aria-label="Pick a fruit (large)">
|
|
@@ -103,6 +108,7 @@ export const Size_Lg: Story = {
|
|
|
103
108
|
};
|
|
104
109
|
|
|
105
110
|
export const Size_Xl: Story = {
|
|
111
|
+
parameters: { controls: { disable: true } },
|
|
106
112
|
render: () => (
|
|
107
113
|
<Select>
|
|
108
114
|
<SelectTrigger size="xl" className="w-[220px]" aria-label="Pick a fruit (extra-large)">
|
|
@@ -121,6 +127,7 @@ export const Size_Xl: Story = {
|
|
|
121
127
|
};
|
|
122
128
|
|
|
123
129
|
export const RealisticUse: Story = {
|
|
130
|
+
parameters: { controls: { disable: true } },
|
|
124
131
|
render: () => (<Select>
|
|
125
132
|
<SelectTrigger className="w-[220px]" aria-label="Pick a fruit"><SelectValue placeholder="Pick a fruit" /></SelectTrigger>
|
|
126
133
|
<SelectContent>
|
|
@@ -15,6 +15,7 @@ export default meta;
|
|
|
15
15
|
type Story = StoryObj<typeof meta>;
|
|
16
16
|
|
|
17
17
|
export const Default: Story = {
|
|
18
|
+
parameters: { controls: { disable: true } },
|
|
18
19
|
render: () => (<div className="w-[280px] space-y-3">
|
|
19
20
|
<p className="text-sm">Section one.</p>
|
|
20
21
|
<Separator />
|
|
@@ -23,6 +24,7 @@ export const Default: Story = {
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export const Label_Center: Story = {
|
|
27
|
+
parameters: { controls: { disable: true } },
|
|
26
28
|
render: () => (
|
|
27
29
|
<div className="w-[280px]">
|
|
28
30
|
<Separator label="or" />
|
|
@@ -31,6 +33,7 @@ export const Label_Center: Story = {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
export const Label_Start: Story = {
|
|
36
|
+
parameters: { controls: { disable: true } },
|
|
34
37
|
render: () => (
|
|
35
38
|
<div className="w-[280px]">
|
|
36
39
|
<Separator label="Recent" labelPosition="start" />
|
|
@@ -39,6 +42,7 @@ export const Label_Start: Story = {
|
|
|
39
42
|
};
|
|
40
43
|
|
|
41
44
|
export const Label_End: Story = {
|
|
45
|
+
parameters: { controls: { disable: true } },
|
|
42
46
|
render: () => (
|
|
43
47
|
<div className="w-[280px]">
|
|
44
48
|
<Separator label="Archived" labelPosition="end" />
|
|
@@ -49,6 +53,7 @@ export const Label_End: Story = {
|
|
|
49
53
|
// Regression guard: a long / non-Latin label must clip with an ellipsis inside
|
|
50
54
|
// its container, not push the rule out (caught by the persona UX-test pass).
|
|
51
55
|
export const Label_LongTruncates: Story = {
|
|
56
|
+
parameters: { controls: { disable: true } },
|
|
52
57
|
render: () => (
|
|
53
58
|
<div className="w-[280px]">
|
|
54
59
|
<Separator label="アーカイブされたプロジェクトとドラフト — a very long divider label" />
|
|
@@ -57,6 +62,7 @@ export const Label_LongTruncates: Story = {
|
|
|
57
62
|
};
|
|
58
63
|
|
|
59
64
|
export const RealisticUse: Story = {
|
|
65
|
+
parameters: { controls: { disable: true } },
|
|
60
66
|
render: () => (
|
|
61
67
|
<div className="w-[280px] space-y-4">
|
|
62
68
|
<p className="text-sm">Continue with your work email.</p>
|
|
@@ -108,10 +108,12 @@ function EditProfileSheet({ withBio = false }: { withBio?: boolean }) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
export const Default: Story = {
|
|
111
|
+
parameters: { controls: { disable: true } },
|
|
111
112
|
render: () => <EditProfileSheet />,
|
|
112
113
|
};
|
|
113
114
|
|
|
114
115
|
export const RealisticUse: Story = {
|
|
116
|
+
parameters: { controls: { disable: true } },
|
|
115
117
|
render: () => <EditProfileSheet withBio />,
|
|
116
118
|
};
|
|
117
119
|
|
|
@@ -119,6 +121,7 @@ export const RealisticUse: Story = {
|
|
|
119
121
|
// standalone BottomSheet primitive). It picks up the rounded top, grab handle,
|
|
120
122
|
// 85svh cap + internal scroll, and safe-area padding automatically.
|
|
121
123
|
export const Side_Bottom: Story = {
|
|
124
|
+
parameters: { controls: { disable: true } },
|
|
122
125
|
render: () => (
|
|
123
126
|
<Sheet>
|
|
124
127
|
<SheetTrigger asChild>
|
|
@@ -146,6 +149,7 @@ export const Side_Bottom: Story = {
|
|
|
146
149
|
|
|
147
150
|
// Same bottom sheet with the grab handle hidden via showHandle={false}.
|
|
148
151
|
export const Side_Bottom_NoHandle: Story = {
|
|
152
|
+
parameters: { controls: { disable: true } },
|
|
149
153
|
render: () => (
|
|
150
154
|
<Sheet>
|
|
151
155
|
<SheetTrigger asChild>
|
|
@@ -174,6 +178,7 @@ export const Side_Bottom_NoHandle: Story = {
|
|
|
174
178
|
// here demonstrates the cause and effect without depending on
|
|
175
179
|
// repository-level theme classes.
|
|
176
180
|
export const WithPortalTheme: Story = {
|
|
181
|
+
parameters: { controls: { disable: true } },
|
|
177
182
|
render: () => {
|
|
178
183
|
return (
|
|
179
184
|
<PortalThemeProvider scope="dark">
|
|
@@ -18,6 +18,7 @@ export default meta;
|
|
|
18
18
|
type Story = StoryObj<typeof meta>;
|
|
19
19
|
|
|
20
20
|
export const Default: Story = {
|
|
21
|
+
parameters: { controls: { disable: true } },
|
|
21
22
|
render: () => (<SidebarProvider>
|
|
22
23
|
<Sidebar className="h-[320px] w-[240px]">
|
|
23
24
|
<SidebarContent>
|
|
@@ -37,6 +38,7 @@ export const Default: Story = {
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const RealisticUse: Story = {
|
|
41
|
+
parameters: { controls: { disable: true } },
|
|
40
42
|
render: () => (<SidebarProvider>
|
|
41
43
|
<Sidebar className="h-[320px] w-[240px]">
|
|
42
44
|
<SidebarContent>
|
|
@@ -53,4 +55,41 @@ export const RealisticUse: Story = {
|
|
|
53
55
|
</SidebarContent>
|
|
54
56
|
</Sidebar>
|
|
55
57
|
</SidebarProvider>),
|
|
56
|
-
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// SidebarMenuButton owns the CVA variants for this file, so its variant and
|
|
61
|
+
// size stories render a button inside the minimum sidebar scaffold.
|
|
62
|
+
const MenuButtonStory = ({ variant, size }: { variant?: "default" | "outline"; size?: "default" | "sm" | "lg" }) => (
|
|
63
|
+
<SidebarProvider>
|
|
64
|
+
<Sidebar className="h-[200px] w-[240px]">
|
|
65
|
+
<SidebarContent>
|
|
66
|
+
<SidebarGroup>
|
|
67
|
+
<SidebarGroupContent>
|
|
68
|
+
<SidebarMenu>
|
|
69
|
+
<SidebarMenuItem>
|
|
70
|
+
<SidebarMenuButton variant={variant} size={size}>
|
|
71
|
+
Inbox
|
|
72
|
+
</SidebarMenuButton>
|
|
73
|
+
</SidebarMenuItem>
|
|
74
|
+
</SidebarMenu>
|
|
75
|
+
</SidebarGroupContent>
|
|
76
|
+
</SidebarGroup>
|
|
77
|
+
</SidebarContent>
|
|
78
|
+
</Sidebar>
|
|
79
|
+
</SidebarProvider>
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
export const Variant_Outline: Story = {
|
|
83
|
+
parameters: { controls: { disable: true } },
|
|
84
|
+
render: () => <MenuButtonStory variant="outline" />,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const Size_Sm: Story = {
|
|
88
|
+
parameters: { controls: { disable: true } },
|
|
89
|
+
render: () => <MenuButtonStory size="sm" />,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Size_Lg: Story = {
|
|
93
|
+
parameters: { controls: { disable: true } },
|
|
94
|
+
render: () => <MenuButtonStory size="lg" />,
|
|
95
|
+
};
|
|
@@ -27,6 +27,7 @@ function Cell({ label }: { label: string }) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const Default: StoryObj = {
|
|
30
|
+
parameters: { controls: { disable: true } },
|
|
30
31
|
render: () => (
|
|
31
32
|
<SimpleGrid>
|
|
32
33
|
{Array.from({ length: 6 }, (_, i) => (
|
|
@@ -37,6 +38,7 @@ export const Default: StoryObj = {
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const FixedCols: StoryObj = {
|
|
41
|
+
parameters: { controls: { disable: true } },
|
|
40
42
|
render: () => (
|
|
41
43
|
<div className="space-y-6">
|
|
42
44
|
{([2, 3, 4] as const).map((n) => (
|
|
@@ -54,6 +56,7 @@ export const FixedCols: StoryObj = {
|
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
export const ResponsiveCols: StoryObj = {
|
|
59
|
+
parameters: { controls: { disable: true } },
|
|
57
60
|
render: () => (
|
|
58
61
|
<div>
|
|
59
62
|
<p className="mb-2 text-xs text-muted-foreground">
|
|
@@ -69,6 +72,7 @@ export const ResponsiveCols: StoryObj = {
|
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
export const GapVariants: StoryObj = {
|
|
75
|
+
parameters: { controls: { disable: true } },
|
|
72
76
|
render: () => (
|
|
73
77
|
<div className="space-y-6">
|
|
74
78
|
{(["xs", "md", "xl"] as const).map((gap) => (
|
|
@@ -86,6 +90,7 @@ export const GapVariants: StoryObj = {
|
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
export const RealisticUse: StoryObj = {
|
|
93
|
+
parameters: { controls: { disable: true } },
|
|
89
94
|
render: () => (
|
|
90
95
|
<SimpleGrid cols={{ base: 1, sm: 2, lg: 3 }}>
|
|
91
96
|
<Card>
|