@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
|
@@ -154,6 +154,7 @@ const COLOR_KEY = storageKey("primaryColor");
|
|
|
154
154
|
const CUSTOMS_KEY = storageKey("customPrimaryColors");
|
|
155
155
|
// First brand color (if any) wins as the default; otherwise fall back to shadcn neutral.
|
|
156
156
|
const DEFAULT = brand.colors[0]?.id ?? "neutral";
|
|
157
|
+
export const DEFAULT_PRIMARY_COLOR = DEFAULT;
|
|
157
158
|
|
|
158
159
|
const PRIMARY_OVERRIDE_VARIABLES = [
|
|
159
160
|
"--primary",
|
|
@@ -47,6 +47,7 @@ import { storageKey, readMigrated } from "@behavioral-agentic-design-system/core
|
|
|
47
47
|
const STORAGE_KEY = storageKey("sansFont");
|
|
48
48
|
// First brand font (if any) wins as the default; otherwise Hyperlegible.
|
|
49
49
|
const DEFAULT: SansFontKey = SANS_BRAND_FONTS[0]?.id ?? "hyperlegible";
|
|
50
|
+
export const DEFAULT_SANS_FONT = DEFAULT;
|
|
50
51
|
|
|
51
52
|
function isValidKey(value: string | null): value is SansFontKey {
|
|
52
53
|
return !!value && value in SANS_FONT_OPTIONS;
|
|
@@ -35,7 +35,7 @@ const STORAGE_KEY = storageKey("typeScale");
|
|
|
35
35
|
|
|
36
36
|
/** The Tailwind text-* utilities this design system exposes, mapped to their
|
|
37
37
|
* step offset from base. Steps are exponents on the ratio. */
|
|
38
|
-
const STEPS: Record<string, number> = {
|
|
38
|
+
export const STEPS: Record<string, number> = {
|
|
39
39
|
"text-xs": -2,
|
|
40
40
|
"text-sm": -1,
|
|
41
41
|
"text-base": 0,
|
|
@@ -53,8 +53,23 @@ export function computeSizes(scale: TypeScale): Record<string, number> {
|
|
|
53
53
|
return out;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function applyScale(
|
|
56
|
+
function applyScale(requested: TypeScale) {
|
|
57
57
|
if (typeof document === "undefined") return;
|
|
58
|
+
// Enforce the 14px text-xs floor (WCAG 1.4.4) at the single choke point so
|
|
59
|
+
// no caller can bypass it. Base 18 with ratio 1.4 used to render text-xs at
|
|
60
|
+
// 9.2px (18 / 1.4^2). text-xs is two steps down: base / ratio^2. Raise base
|
|
61
|
+
// to 14 * ratio^2 when under (ratio is lowered first, as clampTypeScale does).
|
|
62
|
+
// Mirrors clampTypeScale in components/studio/types.ts,
|
|
63
|
+
// inlined because hooks/ must not import from components/.
|
|
64
|
+
const FLOOR = 14;
|
|
65
|
+
const ratio = Math.max(
|
|
66
|
+
TYPE_SCALE_RANGES.ratio.min,
|
|
67
|
+
Math.min(requested.ratio, TYPE_SCALE_RANGES.ratio.max, Math.sqrt(requested.base / FLOOR)),
|
|
68
|
+
);
|
|
69
|
+
const scale: TypeScale = {
|
|
70
|
+
base: Math.min(TYPE_SCALE_RANGES.base.max, Math.max(requested.base, FLOOR * ratio ** 2)),
|
|
71
|
+
ratio,
|
|
72
|
+
};
|
|
58
73
|
const sizes = computeSizes(scale);
|
|
59
74
|
const root = document.documentElement.style;
|
|
60
75
|
// The CSS variables that Tailwind's text-* utilities resolve to are named
|
package/src/hooks/use-mobile.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useLayoutEffect } from "react";
|
|
4
|
-
import { TYPE_SCALE_DEFAULTS } from "./use-global-type-scale";
|
|
4
|
+
import { TYPE_SCALE_DEFAULTS, STEPS } from "./use-global-type-scale";
|
|
5
5
|
import { readMigrated } from "@behavioral-agentic-design-system/core/lib/storage";
|
|
6
6
|
|
|
7
|
-
const STEPS = {
|
|
8
|
-
"text-xs": -2,
|
|
9
|
-
"text-sm": -1,
|
|
10
|
-
"text-base": 0,
|
|
11
|
-
"text-lg": 1,
|
|
12
|
-
"text-xl": 2,
|
|
13
|
-
"text-2xl": 3,
|
|
14
|
-
"text-3xl": 4,
|
|
15
|
-
} as const;
|
|
16
|
-
|
|
17
7
|
function applyTypeScale() {
|
|
18
8
|
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
19
9
|
|
|
@@ -33,6 +23,12 @@ function applyTypeScale() {
|
|
|
33
23
|
// Use defaults
|
|
34
24
|
}
|
|
35
25
|
|
|
26
|
+
// Enforce the 14px text-xs floor (WCAG 1.4.4) on the persisted value.
|
|
27
|
+
// Mirrors applyScale() in use-global-type-scale.ts and the layout.tsx boot
|
|
28
|
+
// script. Lower ratio first, then raise base.
|
|
29
|
+
ratio = Math.max(1.05, Math.min(ratio, 1.4, Math.sqrt(base / 14)));
|
|
30
|
+
base = Math.min(22, Math.max(base, 14 * ratio * ratio));
|
|
31
|
+
|
|
36
32
|
// Apply computed sizes as CSS variables
|
|
37
33
|
for (const [name, step] of Object.entries(STEPS)) {
|
|
38
34
|
const size = base * Math.pow(ratio, step);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart entrance timing, derived from the BADS motion tokens.
|
|
3
|
+
*
|
|
4
|
+
* Recharts takes its animation timing as plain numbers, so the motion custom
|
|
5
|
+
* properties are resolved on a mounted element at runtime. Reading the live
|
|
6
|
+
* CSS (rather than copying numbers in) means a fork that retunes
|
|
7
|
+
* --duration-slow or --ease-in-out retunes its charts too.
|
|
8
|
+
*
|
|
9
|
+
* Used by ChartContainer (chart.tsx) and Sparkline (sparkline.tsx) so line,
|
|
10
|
+
* area and radar series draw at one pace and their point dots wait for the
|
|
11
|
+
* stroke instead of popping in ahead of it.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// A chart draw is a long-form entrance: CHART_DRAW_BEATS slow beats. At the
|
|
15
|
+
// default 300ms --duration-slow that is 1500ms, the pace Recharts drew at
|
|
16
|
+
// before this was token-driven.
|
|
17
|
+
const CHART_DRAW_BEATS = 5;
|
|
18
|
+
|
|
19
|
+
export type ChartMotion = {
|
|
20
|
+
/** How long a line / area / radar series takes to draw in, in ms. */
|
|
21
|
+
drawMs: number;
|
|
22
|
+
/** Easing for the draw, as a cubic-bezier() string Recharts accepts. */
|
|
23
|
+
drawEasing: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function readDurationMs(el: Element, name: string, fallbackMs: number): number {
|
|
27
|
+
const raw = getComputedStyle(el).getPropertyValue(name).trim();
|
|
28
|
+
const value = parseFloat(raw);
|
|
29
|
+
if (!Number.isFinite(value)) return fallbackMs;
|
|
30
|
+
if (raw.endsWith("ms")) return value;
|
|
31
|
+
if (raw.endsWith("s")) return value * 1000;
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function readChartMotion(el: Element): ChartMotion {
|
|
36
|
+
const easing = getComputedStyle(el).getPropertyValue("--ease-in-out").trim();
|
|
37
|
+
return {
|
|
38
|
+
drawMs: readDurationMs(el, "--duration-slow", 300) * CHART_DRAW_BEATS,
|
|
39
|
+
drawEasing: easing.startsWith("cubic-bezier(") ? easing : "ease-in-out",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* getIconColor — map a semantic icon *role* to the Tailwind class bound to the
|
|
3
3
|
* matching `--icon-*` token. This is the pattern for giving a custom icon set
|
|
4
4
|
* semantic colors instead of leaving everything to `currentColor`
|
|
5
|
-
* (see
|
|
5
|
+
* (see AGENTS.md → Icons, and the `icon-*` token family in tokens.json).
|
|
6
6
|
*
|
|
7
7
|
* Adapted from web-common's `get-icon-color.ts`. Their failure mode: passing a
|
|
8
8
|
* token name (`"icon-brand-primary"`) or a raw Tailwind class (`"text-brand-…"`)
|
package/src/lib/svg-sanitize.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { Element as XmlElement } from "@xmldom/xmldom";
|
|
|
15
15
|
* are intentional brand color choices.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const ALLOWED_TAGS_RAW = [
|
|
19
19
|
"svg",
|
|
20
20
|
"g",
|
|
21
21
|
"path",
|
|
@@ -48,9 +48,12 @@ const ALLOWED_TAGS = new Set([
|
|
|
48
48
|
"feMerge",
|
|
49
49
|
"feMergeNode",
|
|
50
50
|
"feColorMatrix",
|
|
51
|
-
]
|
|
51
|
+
];
|
|
52
|
+
// Compared lowercased below. The raw lists keep SVG's camelCase spelling for readability; a lookup of
|
|
53
|
+
// "viewbox" in a Set holding "viewBox" misses, which used to strip viewBox, gradients and clipPaths.
|
|
54
|
+
const ALLOWED_TAGS = new Set(ALLOWED_TAGS_RAW.map((t) => t.toLowerCase()));
|
|
52
55
|
|
|
53
|
-
const
|
|
56
|
+
const ALLOWED_ATTRS_RAW = [
|
|
54
57
|
"id",
|
|
55
58
|
"class",
|
|
56
59
|
"viewBox",
|
|
@@ -107,7 +110,8 @@ const ALLOWED_ATTRS = new Set([
|
|
|
107
110
|
"color-interpolation-filters",
|
|
108
111
|
"patternUnits",
|
|
109
112
|
"patternContentUnits",
|
|
110
|
-
]
|
|
113
|
+
];
|
|
114
|
+
const ALLOWED_ATTRS = new Set(ALLOWED_ATTRS_RAW.map((a) => a.toLowerCase()));
|
|
111
115
|
|
|
112
116
|
const URL_ATTRS = new Set(["href", "xlink:href"]);
|
|
113
117
|
|
|
@@ -129,12 +133,15 @@ function stripDangerous(node: XmlElement): boolean {
|
|
|
129
133
|
node.removeAttribute(attr.name);
|
|
130
134
|
continue;
|
|
131
135
|
}
|
|
132
|
-
//
|
|
136
|
+
// href / xlink:href may only point inside the document (#id). An external URL on <use> or a
|
|
137
|
+
// gradient would make the browser fetch it, and javascript:/data: are never safe.
|
|
133
138
|
if (URL_ATTRS.has(an)) {
|
|
134
|
-
const v = (attr.value || "").trim()
|
|
135
|
-
if (v.startsWith("
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
const v = (attr.value || "").trim();
|
|
140
|
+
if (!v.startsWith("#")) node.removeAttribute(attr.name);
|
|
141
|
+
}
|
|
142
|
+
// style may reference only in-document url(#id); anything else is a remote fetch.
|
|
143
|
+
if (an === "style" && /url\(\s*(?!['"]?#)/i.test(attr.value || "")) {
|
|
144
|
+
node.removeAttribute(attr.name);
|
|
138
145
|
}
|
|
139
146
|
}
|
|
140
147
|
|
|
@@ -153,6 +160,9 @@ function normalizeColor(raw: string): string | null {
|
|
|
153
160
|
const v = raw.trim().toLowerCase();
|
|
154
161
|
if (!v) return null;
|
|
155
162
|
if (v === "none" || v === "transparent" || v === "inherit" || v === "currentcolor") return null;
|
|
163
|
+
// A paint server (gradient, pattern) is not a flat colour. Counting it as one made a gradient-only mark
|
|
164
|
+
// look monotone and rewrote fill="url(#g)" to currentColor.
|
|
165
|
+
if (v.startsWith("url(")) return null;
|
|
156
166
|
// Expand 3-char hex (#abc) to 6-char (#aabbcc) so matches across formats.
|
|
157
167
|
if (/^#[0-9a-f]{3}$/.test(v)) {
|
|
158
168
|
return `#${v[1]}${v[1]}${v[2]}${v[2]}${v[3]}${v[3]}`;
|
|
@@ -24,6 +24,7 @@ export default meta;
|
|
|
24
24
|
type Story = StoryObj<typeof meta>;
|
|
25
25
|
|
|
26
26
|
export const Default: Story = {
|
|
27
|
+
parameters: { controls: { disable: true } },
|
|
27
28
|
render: () => (
|
|
28
29
|
<Accordion type="single" collapsible className="w-[400px]">
|
|
29
30
|
<AccordionItem value="item-1">
|
|
@@ -56,6 +57,7 @@ export const Default: Story = {
|
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
export const Variant_Multiple: Story = {
|
|
60
|
+
parameters: { controls: { disable: true } },
|
|
59
61
|
render: () => (
|
|
60
62
|
<Accordion type="multiple" className="w-[400px]">
|
|
61
63
|
<AccordionItem value="item-1">
|
|
@@ -87,6 +89,7 @@ export const Variant_Multiple: Story = {
|
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
export const Variant_Contained: Story = {
|
|
92
|
+
parameters: { controls: { disable: true } },
|
|
90
93
|
render: () => (
|
|
91
94
|
<Accordion type="single" collapsible variant="contained" className="w-[400px]">
|
|
92
95
|
<AccordionItem value="item-1">
|
|
@@ -128,6 +131,7 @@ export const Variant_Contained: Story = {
|
|
|
128
131
|
};
|
|
129
132
|
|
|
130
133
|
export const Variant_Separated: Story = {
|
|
134
|
+
parameters: { controls: { disable: true } },
|
|
131
135
|
render: () => (
|
|
132
136
|
<Accordion type="single" collapsible variant="separated" className="w-[400px]">
|
|
133
137
|
<AccordionItem value="item-1">
|
|
@@ -204,6 +208,7 @@ export const Size_Full: Story = {
|
|
|
204
208
|
};
|
|
205
209
|
|
|
206
210
|
export const Disabled: Story = {
|
|
211
|
+
parameters: { controls: { disable: true } },
|
|
207
212
|
render: () => (
|
|
208
213
|
<Accordion type="single" collapsible className="w-[400px]">
|
|
209
214
|
<AccordionItem value="item-1">
|
|
@@ -230,6 +235,7 @@ export const Disabled: Story = {
|
|
|
230
235
|
|
|
231
236
|
export const Interaction_Opens: Story = {
|
|
232
237
|
tags: ["test"],
|
|
238
|
+
parameters: { controls: { disable: true } },
|
|
233
239
|
render: () => (
|
|
234
240
|
<Accordion type="single" collapsible className="w-[400px]">
|
|
235
241
|
<AccordionItem value="item-1">
|
|
@@ -249,6 +255,7 @@ export const Interaction_Opens: Story = {
|
|
|
249
255
|
};
|
|
250
256
|
|
|
251
257
|
export const RealisticUse: Story = {
|
|
258
|
+
parameters: { controls: { disable: true } },
|
|
252
259
|
render: () => (
|
|
253
260
|
<div className="w-[480px] rounded-lg border bg-card p-6">
|
|
254
261
|
<h3 className="mb-4 text-2xl font-semibold">Frequently asked questions</h3>
|
|
@@ -49,6 +49,7 @@ function DemoActions({ disabled = false }: { disabled?: boolean }) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export const Default: Story = {
|
|
52
|
+
parameters: { controls: { disable: true } },
|
|
52
53
|
render: () => (
|
|
53
54
|
<Frame>
|
|
54
55
|
<p className="text-sm text-muted-foreground">
|
|
@@ -67,6 +68,7 @@ export const Default: Story = {
|
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
export const ManySelected: Story = {
|
|
71
|
+
parameters: { controls: { disable: true } },
|
|
70
72
|
render: () => (
|
|
71
73
|
<Frame>
|
|
72
74
|
<p className="text-sm text-muted-foreground">
|
|
@@ -85,6 +87,7 @@ export const ManySelected: Story = {
|
|
|
85
87
|
};
|
|
86
88
|
|
|
87
89
|
export const ZeroSelected: Story = {
|
|
90
|
+
parameters: { controls: { disable: true } },
|
|
88
91
|
render: () => (
|
|
89
92
|
<Frame>
|
|
90
93
|
<p className="text-sm text-muted-foreground">
|
|
@@ -104,6 +107,7 @@ export const ZeroSelected: Story = {
|
|
|
104
107
|
};
|
|
105
108
|
|
|
106
109
|
export const Disabled: Story = {
|
|
110
|
+
parameters: { controls: { disable: true } },
|
|
107
111
|
render: () => (
|
|
108
112
|
<Frame>
|
|
109
113
|
<p className="text-sm text-muted-foreground">
|
|
@@ -131,6 +135,7 @@ const REVIEWERS = [
|
|
|
131
135
|
];
|
|
132
136
|
|
|
133
137
|
export const RealisticUse: Story = {
|
|
138
|
+
parameters: { controls: { disable: true } },
|
|
134
139
|
render: () => {
|
|
135
140
|
const [selected, setSelected] = React.useState<Set<string>>(
|
|
136
141
|
() => new Set(["seoyun", "anika"])
|
|
@@ -45,6 +45,7 @@ function DemoFrame({ children }: { children: React.ReactNode }) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export const Default: Story = {
|
|
48
|
+
parameters: { controls: { disable: true } },
|
|
48
49
|
render: () => (
|
|
49
50
|
<DemoFrame>
|
|
50
51
|
<Affix withinPortal={false} position={{ bottom: 20, right: 20 }}>
|
|
@@ -57,6 +58,7 @@ export const Default: Story = {
|
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
export const TopRight: Story = {
|
|
61
|
+
parameters: { controls: { disable: true } },
|
|
60
62
|
render: () => (
|
|
61
63
|
<DemoFrame>
|
|
62
64
|
<Affix withinPortal={false} position={{ top: 16, right: 16 }}>
|
|
@@ -67,6 +69,7 @@ export const TopRight: Story = {
|
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
export const TopLeft: Story = {
|
|
72
|
+
parameters: { controls: { disable: true } },
|
|
70
73
|
render: () => (
|
|
71
74
|
<DemoFrame>
|
|
72
75
|
<Affix withinPortal={false} position={{ top: 16, left: 16 }}>
|
|
@@ -77,6 +80,7 @@ export const TopLeft: Story = {
|
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
export const CustomZIndex: Story = {
|
|
83
|
+
parameters: { controls: { disable: true } },
|
|
80
84
|
render: () => (
|
|
81
85
|
<DemoFrame>
|
|
82
86
|
{/* The zIndex prop controls stacking: the FAB (zIndex 50, default tier)
|
|
@@ -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: () => (
|
|
16
17
|
<div className="flex items-center gap-2">
|
|
17
18
|
<AiBadge />
|
|
@@ -22,34 +23,35 @@ export const Default: Story = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const Variant_Subtle: Story = {
|
|
25
|
-
|
|
26
|
+
args: { variant: "subtle" },
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export const Variant_Solid: Story = {
|
|
29
|
-
|
|
30
|
+
args: { variant: "solid" },
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
export const Variant_Outline: Story = {
|
|
33
|
-
|
|
34
|
+
args: { variant: "outline" },
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export const Size_Sm: Story = {
|
|
37
|
-
|
|
38
|
+
args: { size: "sm" },
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export const Size_Default: Story = {
|
|
41
|
-
|
|
42
|
+
args: { size: "default" },
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
export const NoIcon: Story = {
|
|
45
|
-
|
|
46
|
+
args: { showIcon: false },
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
export const CustomLabel: Story = {
|
|
49
|
-
|
|
50
|
+
args: { children: "AI summary" },
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export const RealisticUse: Story = {
|
|
54
|
+
parameters: { controls: { disable: true } },
|
|
53
55
|
render: () => (
|
|
54
56
|
<div className="max-w-sm space-y-2 rounded-lg border border-border bg-card p-4">
|
|
55
57
|
<div className="flex items-center gap-2">
|
|
@@ -27,6 +27,7 @@ export default meta;
|
|
|
27
27
|
type Story = StoryObj<typeof meta>;
|
|
28
28
|
|
|
29
29
|
export const Default: Story = {
|
|
30
|
+
parameters: { controls: { disable: true } },
|
|
30
31
|
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
31
32
|
<Alert>
|
|
32
33
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -42,6 +43,7 @@ export const Default: Story = {
|
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
export const Variant_Default: Story = {
|
|
46
|
+
parameters: { controls: { disable: true } },
|
|
45
47
|
render: () => (<div className="w-[420px]">
|
|
46
48
|
<Alert variant="default">
|
|
47
49
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -52,6 +54,7 @@ export const Variant_Default: Story = {
|
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
export const Variant_Destructive: Story = {
|
|
57
|
+
parameters: { controls: { disable: true } },
|
|
55
58
|
render: () => (<div className="w-[420px]">
|
|
56
59
|
<Alert variant="destructive">
|
|
57
60
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -62,6 +65,7 @@ export const Variant_Destructive: Story = {
|
|
|
62
65
|
};
|
|
63
66
|
|
|
64
67
|
export const Variant_Success: Story = {
|
|
68
|
+
parameters: { controls: { disable: true } },
|
|
65
69
|
render: () => (<div className="w-[420px]">
|
|
66
70
|
<Alert variant="success">
|
|
67
71
|
<CheckCircle2Icon className="h-5 w-5" />
|
|
@@ -72,6 +76,7 @@ export const Variant_Success: Story = {
|
|
|
72
76
|
};
|
|
73
77
|
|
|
74
78
|
export const Variant_Warning: Story = {
|
|
79
|
+
parameters: { controls: { disable: true } },
|
|
75
80
|
render: () => (<div className="w-[420px]">
|
|
76
81
|
<Alert variant="warning">
|
|
77
82
|
<TriangleAlertIcon className="h-5 w-5" />
|
|
@@ -82,6 +87,7 @@ export const Variant_Warning: Story = {
|
|
|
82
87
|
};
|
|
83
88
|
|
|
84
89
|
export const Variant_Info: Story = {
|
|
90
|
+
parameters: { controls: { disable: true } },
|
|
85
91
|
render: () => (<div className="w-[420px]">
|
|
86
92
|
<Alert variant="info">
|
|
87
93
|
<InfoIcon className="h-5 w-5" />
|
|
@@ -95,6 +101,7 @@ export const Variant_Info: Story = {
|
|
|
95
101
|
// Card must remain visually distinct. Pre-fix, both surfaces used bg-card and
|
|
96
102
|
// the alert disappeared into the card.
|
|
97
103
|
export const NestedInCard: Story = {
|
|
104
|
+
parameters: { controls: { disable: true } },
|
|
98
105
|
render: () => (
|
|
99
106
|
<Card className="w-[460px]">
|
|
100
107
|
<CardHeader>
|
|
@@ -121,6 +128,7 @@ export const NestedInCard: Story = {
|
|
|
121
128
|
};
|
|
122
129
|
|
|
123
130
|
export const Size_Sm: Story = {
|
|
131
|
+
parameters: { controls: { disable: true } },
|
|
124
132
|
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
125
133
|
<Alert size="sm">
|
|
126
134
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -141,6 +149,7 @@ export const Size_Sm: Story = {
|
|
|
141
149
|
};
|
|
142
150
|
|
|
143
151
|
export const Sizes: Story = {
|
|
152
|
+
parameters: { controls: { disable: true } },
|
|
144
153
|
render: () => (<div className="w-[420px] flex flex-col gap-4">
|
|
145
154
|
<Alert>
|
|
146
155
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -156,6 +165,7 @@ export const Sizes: Story = {
|
|
|
156
165
|
};
|
|
157
166
|
|
|
158
167
|
export const RealisticUse: Story = {
|
|
168
|
+
parameters: { controls: { disable: true } },
|
|
159
169
|
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
160
170
|
<Alert>
|
|
161
171
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -171,6 +181,7 @@ export const RealisticUse: Story = {
|
|
|
171
181
|
};
|
|
172
182
|
|
|
173
183
|
export const Dismissible: Story = {
|
|
184
|
+
parameters: { controls: { disable: true } },
|
|
174
185
|
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
175
186
|
<Alert onDismiss={() => {}}>
|
|
176
187
|
<AlertCircleIcon className="h-5 w-5" />
|
|
@@ -186,6 +197,7 @@ export const Dismissible: Story = {
|
|
|
186
197
|
};
|
|
187
198
|
|
|
188
199
|
export const WithAction: Story = {
|
|
200
|
+
parameters: { controls: { disable: true } },
|
|
189
201
|
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
190
202
|
<Alert
|
|
191
203
|
action={<Button size="sm" variant="outline">Resend link</Button>}
|
|
@@ -206,6 +218,7 @@ export const WithAction: Story = {
|
|
|
206
218
|
};
|
|
207
219
|
|
|
208
220
|
export const DismissibleWithAction: Story = {
|
|
221
|
+
parameters: { controls: { disable: true } },
|
|
209
222
|
render: () => (<div className="w-[420px]">
|
|
210
223
|
<Alert
|
|
211
224
|
onDismiss={() => {}}
|
|
@@ -26,6 +26,7 @@ export default meta;
|
|
|
26
26
|
type Story = StoryObj<typeof meta>;
|
|
27
27
|
|
|
28
28
|
export const Default: Story = {
|
|
29
|
+
parameters: { controls: { disable: true } },
|
|
29
30
|
render: () => (
|
|
30
31
|
<AlertDialog>
|
|
31
32
|
<AlertDialogTrigger asChild>
|
|
@@ -51,6 +52,7 @@ export const Default: Story = {
|
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
export const Variant_Destructive: Story = {
|
|
55
|
+
parameters: { controls: { disable: true } },
|
|
54
56
|
render: () => (
|
|
55
57
|
<AlertDialog>
|
|
56
58
|
<AlertDialogTrigger asChild>
|
|
@@ -76,6 +78,7 @@ export const Variant_Destructive: Story = {
|
|
|
76
78
|
};
|
|
77
79
|
|
|
78
80
|
export const Variant_Confirm: Story = {
|
|
81
|
+
parameters: { controls: { disable: true } },
|
|
79
82
|
render: () => (
|
|
80
83
|
<AlertDialog>
|
|
81
84
|
<AlertDialogTrigger asChild>
|
|
@@ -99,6 +102,7 @@ export const Variant_Confirm: Story = {
|
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
export const RealisticUse: Story = {
|
|
105
|
+
parameters: { controls: { disable: true } },
|
|
102
106
|
render: () => (
|
|
103
107
|
<AlertDialog>
|
|
104
108
|
<AlertDialogTrigger asChild>
|
|
@@ -33,6 +33,7 @@ function DemoSection({
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export const Default: Story = {
|
|
36
|
+
parameters: { controls: { disable: true } },
|
|
36
37
|
render: () => (
|
|
37
38
|
<div className="flex w-[640px] max-w-full gap-8">
|
|
38
39
|
<div className="h-72 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5" tabIndex={0}>
|
|
@@ -71,6 +72,7 @@ export const Default: Story = {
|
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
export const WithGroups: Story = {
|
|
75
|
+
parameters: { controls: { disable: true } },
|
|
74
76
|
render: () => (
|
|
75
77
|
<div className="flex w-[640px] max-w-full gap-8">
|
|
76
78
|
<div className="h-72 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5" tabIndex={0}>
|
|
@@ -111,6 +113,7 @@ export const WithGroups: Story = {
|
|
|
111
113
|
};
|
|
112
114
|
|
|
113
115
|
export const Sticky: Story = {
|
|
116
|
+
parameters: { controls: { disable: true } },
|
|
114
117
|
render: () => (
|
|
115
118
|
<div className="h-80 w-[640px] max-w-full overflow-y-auto rounded-lg border border-border">
|
|
116
119
|
<div className="flex gap-8 p-5">
|
|
@@ -150,6 +153,7 @@ export const Sticky: Story = {
|
|
|
150
153
|
};
|
|
151
154
|
|
|
152
155
|
export const Customized: Story = {
|
|
156
|
+
parameters: { controls: { disable: true } },
|
|
153
157
|
render: () => (
|
|
154
158
|
<div className="flex w-[640px] max-w-full gap-8">
|
|
155
159
|
<div className="h-64 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5" tabIndex={0}>
|
|
@@ -234,6 +238,7 @@ export const Controlled: Story = {
|
|
|
234
238
|
};
|
|
235
239
|
|
|
236
240
|
export const RealisticUse: Story = {
|
|
241
|
+
parameters: { controls: { disable: true } },
|
|
237
242
|
render: () => (
|
|
238
243
|
<div className="w-[720px] max-w-full rounded-lg border border-border bg-card p-6">
|
|
239
244
|
<div className="mb-4 space-y-1">
|
|
@@ -41,30 +41,35 @@ function ControlledAngleSlider(
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const Default: Story = {
|
|
44
|
+
parameters: { controls: { disable: true } },
|
|
44
45
|
render: () => (
|
|
45
46
|
<ControlledAngleSlider defaultValue={45} aria-label="Angle" />
|
|
46
47
|
),
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
export const Size_Sm: Story = {
|
|
51
|
+
parameters: { controls: { disable: true } },
|
|
50
52
|
render: () => (
|
|
51
53
|
<ControlledAngleSlider size="sm" defaultValue={45} aria-label="Angle" />
|
|
52
54
|
),
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
export const Size_Md: Story = {
|
|
58
|
+
parameters: { controls: { disable: true } },
|
|
56
59
|
render: () => (
|
|
57
60
|
<ControlledAngleSlider size="md" defaultValue={45} aria-label="Angle" />
|
|
58
61
|
),
|
|
59
62
|
};
|
|
60
63
|
|
|
61
64
|
export const Size_Lg: Story = {
|
|
65
|
+
parameters: { controls: { disable: true } },
|
|
62
66
|
render: () => (
|
|
63
67
|
<ControlledAngleSlider size="lg" defaultValue={45} aria-label="Angle" />
|
|
64
68
|
),
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
export const Sizes: Story = {
|
|
72
|
+
parameters: { controls: { disable: true } },
|
|
68
73
|
render: () => (
|
|
69
74
|
<div className="flex items-end gap-8">
|
|
70
75
|
<ControlledAngleSlider size="sm" defaultValue={45} aria-label="Small angle" />
|
|
@@ -75,9 +80,7 @@ export const Sizes: Story = {
|
|
|
75
80
|
};
|
|
76
81
|
|
|
77
82
|
export const Disabled: Story = {
|
|
78
|
-
|
|
79
|
-
<AngleSlider disabled defaultValue={135} aria-label="Angle (disabled)" />
|
|
80
|
-
),
|
|
83
|
+
args: { disabled: true, defaultValue: 135, "aria-label": "Angle (disabled)" },
|
|
81
84
|
};
|
|
82
85
|
|
|
83
86
|
export const RealisticUse: Story = {
|
|
@@ -27,6 +27,7 @@ const PlaceholderImage = ({
|
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
export const Default: Story = {
|
|
30
|
+
parameters: { controls: { disable: true } },
|
|
30
31
|
render: () => (
|
|
31
32
|
<div className="w-[400px]">
|
|
32
33
|
<AspectRatio ratio={16 / 9}>
|
|
@@ -37,6 +38,7 @@ export const Default: Story = {
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const Square: Story = {
|
|
41
|
+
parameters: { controls: { disable: true } },
|
|
40
42
|
render: () => (
|
|
41
43
|
<div className="w-[300px]">
|
|
42
44
|
<AspectRatio ratio={1}>
|
|
@@ -47,6 +49,7 @@ export const Square: Story = {
|
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
export const Portrait: Story = {
|
|
52
|
+
parameters: { controls: { disable: true } },
|
|
50
53
|
render: () => (
|
|
51
54
|
<div className="w-[200px]">
|
|
52
55
|
<AspectRatio ratio={2 / 3}>
|
|
@@ -57,6 +60,7 @@ export const Portrait: Story = {
|
|
|
57
60
|
};
|
|
58
61
|
|
|
59
62
|
export const RealisticUse: Story = {
|
|
63
|
+
parameters: { controls: { disable: true } },
|
|
60
64
|
render: () => (
|
|
61
65
|
<div className="grid w-[560px] grid-cols-3 gap-3">
|
|
62
66
|
{[
|