@dodopayments/ui 1.3.0 → 1.5.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/ai/component-registry.json +642 -99
- package/ai/component-registry.md +4 -0
- package/ai/components/activity-timeline.md +3 -1
- package/ai/components/area-chart.md +4 -4
- package/ai/components/avatar.md +1 -1
- package/ai/components/bar-chart.md +18 -18
- package/ai/components/brand-logos.md +1 -1
- package/ai/components/button-group.md +65 -0
- package/ai/components/chart-tooltip.md +3 -3
- package/ai/components/chart.md +6 -6
- package/ai/components/checkout-page.md +1 -1
- package/ai/components/collapsible.md +1 -1
- package/ai/components/color-input.md +56 -0
- package/ai/components/composed-chart.md +7 -7
- package/ai/components/copyable-id.md +1 -0
- package/ai/components/data-grid.md +8 -5
- package/ai/components/file-upload.md +25 -1
- package/ai/components/filter-grid.md +4 -7
- package/ai/components/funnel-chart.md +14 -12
- package/ai/components/gauge-chart.md +9 -11
- package/ai/components/line-chart.md +2 -2
- package/ai/components/list-toolbar.md +3 -3
- package/ai/components/logo.md +3 -1
- package/ai/components/money.md +3 -3
- package/ai/components/pagination.md +1 -0
- package/ai/components/pie-chart.md +11 -2
- package/ai/components/product-card.md +2 -1
- package/ai/components/radio-group.md +85 -6
- package/ai/components/reorder-list.md +1 -1
- package/ai/components/ring-chart.md +17 -8
- package/ai/components/sale-share-card.md +48 -0
- package/ai/components/sankey-chart.md +23 -23
- package/ai/components/scaled-frame.md +41 -0
- package/ai/components/skeleton.md +1 -1
- package/ai/components/stat-card.md +32 -5
- package/ai/components/sunburst-chart.md +7 -4
- package/ai/components/test-mode-banner.md +3 -3
- package/ai/skills/dodo-charts/SKILL.md +12 -7
- package/ai/skills/dodo-design/SKILL.md +4 -2
- package/dist/components/activity-timeline/activity-timeline.d.ts +22 -2
- package/dist/components/activity-timeline/activity-timeline.d.ts.map +1 -1
- package/dist/components/activity-timeline/activity-timeline.js +11 -5
- package/dist/components/activity-timeline/activity-timeline.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +9 -7
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +9 -7
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/brand-logos/brand-artwork.d.ts +16 -1
- package/dist/components/brand-logos/brand-artwork.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-artwork.js +16 -1
- package/dist/components/brand-logos/brand-artwork.js.map +1 -1
- package/dist/components/brand-logos/brand-logos.d.ts +2 -2
- package/dist/components/brand-logos/brand-logos.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-logos.js +7 -1
- package/dist/components/brand-logos/brand-logos.js.map +1 -1
- package/dist/components/button-group/button-group.d.ts +21 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -0
- package/dist/components/button-group/button-group.js +16 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.d.ts.map +1 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/color-input/color-input.d.ts +21 -0
- package/dist/components/color-input/color-input.d.ts.map +1 -0
- package/dist/components/color-input/color-input.js +28 -0
- package/dist/components/color-input/color-input.js.map +1 -0
- package/dist/components/color-input/index.d.ts +2 -0
- package/dist/components/color-input/index.d.ts.map +1 -0
- package/dist/components/color-input/index.js +2 -0
- package/dist/components/color-input/index.js.map +1 -0
- package/dist/components/copyable-id/copyable-id.d.ts +7 -1
- package/dist/components/copyable-id/copyable-id.d.ts.map +1 -1
- package/dist/components/copyable-id/copyable-id.js +21 -3
- package/dist/components/copyable-id/copyable-id.js.map +1 -1
- package/dist/components/data-grid/bulk-actions.d.ts +4 -2
- package/dist/components/data-grid/bulk-actions.d.ts.map +1 -1
- package/dist/components/data-grid/bulk-actions.js +65 -4
- package/dist/components/data-grid/bulk-actions.js.map +1 -1
- package/dist/components/data-grid/data-grid.d.ts +15 -4
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.js +57 -16
- package/dist/components/data-grid/data-grid.js.map +1 -1
- package/dist/components/data-grid/table.d.ts +1 -1
- package/dist/components/data-grid/table.d.ts.map +1 -1
- package/dist/components/data-grid/table.js +6 -1
- package/dist/components/data-grid/table.js.map +1 -1
- package/dist/components/file-upload/file-upload.d.ts +21 -0
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +42 -20
- package/dist/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/filter-grid/filter-grid.d.ts +7 -2
- package/dist/components/filter-grid/filter-grid.d.ts.map +1 -1
- package/dist/components/filter-grid/filter-grid.js +3 -2
- package/dist/components/filter-grid/filter-grid.js.map +1 -1
- package/dist/components/funnel-chart/funnel-chart.d.ts +3 -2
- package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -1
- package/dist/components/funnel-chart/funnel-chart.js +3 -2
- package/dist/components/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/gauge-chart/gauge-chart.d.ts +3 -4
- package/dist/components/gauge-chart/gauge-chart.d.ts.map +1 -1
- package/dist/components/gauge-chart/gauge-chart.js +3 -4
- package/dist/components/gauge-chart/gauge-chart.js.map +1 -1
- package/dist/components/list-toolbar/list-toolbar.d.ts +3 -3
- package/dist/components/list-toolbar/list-toolbar.js +4 -4
- package/dist/components/list-toolbar/list-toolbar.js.map +1 -1
- package/dist/components/live-activity/live-activity.d.ts.map +1 -1
- package/dist/components/live-activity/live-activity.js +8 -3
- package/dist/components/live-activity/live-activity.js.map +1 -1
- package/dist/components/logo/logo.d.ts +5 -1
- package/dist/components/logo/logo.d.ts.map +1 -1
- package/dist/components/logo/logo.js +6 -2
- package/dist/components/logo/logo.js.map +1 -1
- package/dist/components/page-header/page-header.d.ts.map +1 -1
- package/dist/components/page-header/page-header.js +4 -2
- package/dist/components/page-header/page-header.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts +7 -1
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +7 -4
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/payment-method-list/payment-method-list.d.ts.map +1 -1
- package/dist/components/payment-method-list/payment-method-list.js +4 -1
- package/dist/components/payment-method-list/payment-method-list.js.map +1 -1
- package/dist/components/product-card/product-card.d.ts +8 -2
- package/dist/components/product-card/product-card.d.ts.map +1 -1
- package/dist/components/product-card/product-card.js +2 -2
- package/dist/components/product-card/product-card.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +28 -6
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +37 -4
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/sale-share-card/index.d.ts +2 -0
- package/dist/components/sale-share-card/index.d.ts.map +1 -0
- package/dist/components/sale-share-card/index.js +2 -0
- package/dist/components/sale-share-card/index.js.map +1 -0
- package/dist/components/sale-share-card/sale-share-card.d.ts +27 -0
- package/dist/components/sale-share-card/sale-share-card.d.ts.map +1 -0
- package/dist/components/sale-share-card/sale-share-card.js +46 -0
- package/dist/components/sale-share-card/sale-share-card.js.map +1 -0
- package/dist/components/sankey-chart/sankey-chart.d.ts +4 -4
- package/dist/components/sankey-chart/sankey-chart.js +4 -4
- package/dist/components/scaled-frame/index.d.ts +2 -0
- package/dist/components/scaled-frame/index.d.ts.map +1 -0
- package/dist/components/scaled-frame/index.js +2 -0
- package/dist/components/scaled-frame/index.js.map +1 -0
- package/dist/components/scaled-frame/scaled-frame.d.ts +17 -0
- package/dist/components/scaled-frame/scaled-frame.d.ts.map +1 -0
- package/dist/components/scaled-frame/scaled-frame.js +43 -0
- package/dist/components/scaled-frame/scaled-frame.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +13 -9
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/slider/slider-thumb.d.ts +2 -2
- package/dist/components/slider/slider-thumb.d.ts.map +1 -1
- package/dist/components/slider/slider-thumb.js +2 -2
- package/dist/components/slider/slider-thumb.js.map +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/stat-card/index.d.ts +1 -1
- package/dist/components/stat-card/index.d.ts.map +1 -1
- package/dist/components/stat-card/index.js +1 -1
- package/dist/components/stat-card/index.js.map +1 -1
- package/dist/components/stat-card/stat-card.d.ts +47 -7
- package/dist/components/stat-card/stat-card.d.ts.map +1 -1
- package/dist/components/stat-card/stat-card.js +72 -12
- package/dist/components/stat-card/stat-card.js.map +1 -1
- package/dist/components/sunburst-chart/sunburst-chart.d.ts +2 -1
- package/dist/components/sunburst-chart/sunburst-chart.d.ts.map +1 -1
- package/dist/components/sunburst-chart/sunburst-chart.js +2 -1
- package/dist/components/sunburst-chart/sunburst-chart.js.map +1 -1
- package/dist/components/timestamp/timestamp.js +1 -1
- package/dist/components/timestamp/timestamp.js.map +1 -1
- package/dist/icons/index.d.ts +5 -2
- package/dist/icons/index.js +5 -2
- package/dist/icons/ui/coins.d.ts +3 -0
- package/dist/icons/ui/coins.js +5 -0
- package/dist/icons/ui/report.d.ts +3 -0
- package/dist/icons/ui/report.js +5 -0
- package/dist/icons/ui/ticket.d.ts +3 -0
- package/dist/icons/ui/ticket.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cn-tables.js +5 -5
- package/dist/lib/cn-tables.js.map +1 -1
- package/dist/primitives/charts/area-chart.js +1 -1
- package/dist/primitives/charts/area-chart.js.map +1 -1
- package/dist/primitives/charts/area.d.ts +1 -1
- package/dist/primitives/charts/area.d.ts.map +1 -1
- package/dist/primitives/charts/bar-chart.js +1 -1
- package/dist/primitives/charts/bar-chart.js.map +1 -1
- package/dist/primitives/charts/bar-squares.d.ts +1 -1
- package/dist/primitives/charts/bar-squares.d.ts.map +1 -1
- package/dist/primitives/charts/bar.d.ts +6 -5
- package/dist/primitives/charts/bar.d.ts.map +1 -1
- package/dist/primitives/charts/bar.js +1 -1
- package/dist/primitives/charts/bar.js.map +1 -1
- package/dist/primitives/charts/chart-context.js +2 -2
- package/dist/primitives/charts/chart-context.js.map +1 -1
- package/dist/primitives/charts/composed-chart.js +3 -3
- package/dist/primitives/charts/composed-chart.js.map +1 -1
- package/dist/primitives/charts/funnel-chart.d.ts +12 -8
- package/dist/primitives/charts/funnel-chart.d.ts.map +1 -1
- package/dist/primitives/charts/funnel-chart.js +38 -9
- package/dist/primitives/charts/funnel-chart.js.map +1 -1
- package/dist/primitives/charts/gauge.d.ts +4 -4
- package/dist/primitives/charts/gauge.js +7 -7
- package/dist/primitives/charts/gauge.js.map +1 -1
- package/dist/primitives/charts/line-chart.js +1 -1
- package/dist/primitives/charts/line-chart.js.map +1 -1
- package/dist/primitives/charts/line-series-terminal-marker.d.ts.map +1 -1
- package/dist/primitives/charts/line-series-terminal-marker.js +1 -1
- package/dist/primitives/charts/line-series-terminal-marker.js.map +1 -1
- package/dist/primitives/charts/line.d.ts +1 -1
- package/dist/primitives/charts/line.d.ts.map +1 -1
- package/dist/primitives/charts/notch-gauge-shared.d.ts.map +1 -1
- package/dist/primitives/charts/notch-gauge-shared.js +4 -3
- package/dist/primitives/charts/notch-gauge-shared.js.map +1 -1
- package/dist/primitives/charts/pie-context.d.ts +3 -2
- package/dist/primitives/charts/pie-context.d.ts.map +1 -1
- package/dist/primitives/charts/pie-context.js +7 -6
- package/dist/primitives/charts/pie-context.js.map +1 -1
- package/dist/primitives/charts/pie-slice.d.ts +2 -2
- package/dist/primitives/charts/pie-slice.js +1 -1
- package/dist/primitives/charts/pie-slice.js.map +1 -1
- package/dist/primitives/charts/ring-context.d.ts +4 -2
- package/dist/primitives/charts/ring-context.d.ts.map +1 -1
- package/dist/primitives/charts/ring-context.js +8 -6
- package/dist/primitives/charts/ring-context.js.map +1 -1
- package/dist/primitives/charts/ring.d.ts +8 -8
- package/dist/primitives/charts/ring.d.ts.map +1 -1
- package/dist/primitives/charts/ring.js +4 -4
- package/dist/primitives/charts/ring.js.map +1 -1
- package/dist/primitives/charts/sankey/sankey-link.d.ts +9 -10
- package/dist/primitives/charts/sankey/sankey-link.d.ts.map +1 -1
- package/dist/primitives/charts/sankey/sankey-link.js +14 -9
- package/dist/primitives/charts/sankey/sankey-link.js.map +1 -1
- package/dist/primitives/charts/sankey/sankey-node.d.ts +5 -5
- package/dist/primitives/charts/sankey/sankey-node.d.ts.map +1 -1
- package/dist/primitives/charts/sankey/sankey-node.js +6 -6
- package/dist/primitives/charts/sankey/sankey-node.js.map +1 -1
- package/dist/primitives/charts/series-bar.d.ts +4 -4
- package/dist/primitives/charts/series-bar.d.ts.map +1 -1
- package/dist/primitives/charts/series-bar.js +1 -1
- package/dist/primitives/charts/series-bar.js.map +1 -1
- package/dist/primitives/charts/sunburst-context.d.ts +3 -2
- package/dist/primitives/charts/sunburst-context.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-context.js +6 -5
- package/dist/primitives/charts/sunburst-context.js.map +1 -1
- package/dist/primitives/charts/sunburst-legend.d.ts +7 -2
- package/dist/primitives/charts/sunburst-legend.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-legend.js +8 -6
- package/dist/primitives/charts/sunburst-legend.js.map +1 -1
- package/dist/primitives/charts/sunburst-segment.d.ts +3 -3
- package/dist/primitives/charts/sunburst-segment.js +2 -2
- package/dist/primitives/charts/sunburst-segment.js.map +1 -1
- package/dist/primitives/charts/tooltip/date-ticker.js +2 -2
- package/dist/primitives/charts/tooltip/date-ticker.js.map +1 -1
- package/dist/primitives/charts/tooltip/tooltip-box.js +1 -1
- package/dist/primitives/charts/tooltip/tooltip-box.js.map +1 -1
- package/dist/primitives/ui/alert-dialog.js +1 -1
- package/dist/primitives/ui/alert-dialog.js.map +1 -1
- package/dist/primitives/ui/autocomplete.js +1 -1
- package/dist/primitives/ui/autocomplete.js.map +1 -1
- package/dist/primitives/ui/dialog.js +1 -1
- package/dist/primitives/ui/dialog.js.map +1 -1
- package/dist/primitives/ui/drawer.js +1 -1
- package/dist/primitives/ui/drawer.js.map +1 -1
- package/dist/primitives/ui/popover.js +1 -1
- package/dist/primitives/ui/popover.js.map +1 -1
- package/dist/primitives/ui/preview-card.js +1 -1
- package/dist/primitives/ui/preview-card.js.map +1 -1
- package/dist/primitives/ui/sheet.js +2 -2
- package/dist/primitives/ui/sheet.js.map +1 -1
- package/dist/primitives/ui/slider.js +1 -1
- package/dist/primitives/ui/slider.js.map +1 -1
- package/dist/primitives/ui/switch.d.ts +1 -1
- package/dist/primitives/ui/switch.d.ts.map +1 -1
- package/dist/primitives/ui/switch.js +1 -1
- package/dist/primitives/ui/switch.js.map +1 -1
- package/dist/primitives/ui/table.js +2 -2
- package/dist/primitives/ui/table.js.map +1 -1
- package/dist/primitives/ui/toast.js +2 -2
- package/dist/primitives/ui/toast.js.map +1 -1
- package/dist/primitives/ui/tooltip.js +1 -1
- package/dist/primitives/ui/tooltip.js.map +1 -1
- package/dist/styles/theme.css +9 -0
- package/dist/styles/tokens.css +96 -36
- package/dist/styles/tokens.test.tsx +20 -2
- package/dist/theme/color.d.ts +5 -0
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/color.js +22 -0
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/css.d.ts +3 -3
- package/dist/theme/css.d.ts.map +1 -1
- package/dist/theme/css.js +29 -11
- package/dist/theme/css.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,6 +24,18 @@ export const DODO_RADIO_VARIANTS = {
|
|
|
24
24
|
// title (4 down, centred on its 20px line, as on Plan picker) and takes no focus ring of its own: the card shows it.
|
|
25
25
|
classes: "mt-1 size-3 sm:size-3 *:data-[slot=radio-indicator]:size-3 sm:*:data-[slot=radio-indicator]:size-3 *:data-[slot=radio-indicator]:before:size-1 sm:*:data-[slot=radio-indicator]:before:size-1 focus-visible:border-input focus-visible:ring-0",
|
|
26
26
|
},
|
|
27
|
+
accordion: {
|
|
28
|
+
description: 'A row of the single page checkout\'s payment method accordion: the radio, a `logo` and the label, with `content` opening under the selected row. Rows sit in one bordered box: give the `RadioGroup` `className="gap-0 pointer-coarse:gap-0 overflow-hidden rounded-xl border"`. Needs a `label`.',
|
|
29
|
+
primitive: {},
|
|
30
|
+
// 16px radio, no focus ring of its own: the row shows it.
|
|
31
|
+
classes: "focus-visible:border-input focus-visible:ring-0",
|
|
32
|
+
},
|
|
33
|
+
tile: {
|
|
34
|
+
description: "A payment method tile, as the checkout draws them: the `logo` above the label, no visible radio. The selected tile takes the theme's primary edge and tint. Needs a `label`.",
|
|
35
|
+
primitive: {},
|
|
36
|
+
// The radio stays for keyboard and screen readers; the tile shows the selection and the focus.
|
|
37
|
+
classes: "sr-only absolute size-px sm:size-px",
|
|
38
|
+
},
|
|
27
39
|
},
|
|
28
40
|
size: {
|
|
29
41
|
default: {
|
|
@@ -89,11 +101,25 @@ const OPTION_ROW = "flex w-fit cursor-pointer items-start gap-2 text-body-second
|
|
|
89
101
|
* card turns Surface/Hover under a pointer that can hover. The card fades between them in `duration-quick`.
|
|
90
102
|
*/
|
|
91
103
|
const OPTION_CARD = "relative flex w-60 max-w-full cursor-pointer items-start gap-2 rounded-xl border border-border bg-background p-3 text-start text-foreground shadow-xs/5 ring-brand-subtle transition-[background-color,border-color,box-shadow] duration-quick ease-smooth-out not-has-data-checked:not-has-data-disabled:hover:bg-accent has-data-checked:border-brand has-data-checked:inset-ring has-data-checked:inset-ring-brand has-focus-visible:border-brand-edge has-focus-visible:shadow-none has-focus-visible:ring-2 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-64";
|
|
104
|
+
/**
|
|
105
|
+
* An accordion row, after the checkout's single page payment element: 12 of padding, the radio, logo and label 12
|
|
106
|
+
* apart (Label/Secondary, Content/Secondary, Content/Primary once selected), a rule under every row but the last,
|
|
107
|
+
* and the selected row's `content` 4 under the label. Focused (the radio, not the content), the row shows an inset ring.
|
|
108
|
+
*/
|
|
109
|
+
const OPTION_ACCORDION = "border-b border-border last:border-b-0 has-[[data-slot=radio]:focus-visible]:inset-ring-2 has-[[data-slot=radio]:focus-visible]:inset-ring-ring/24";
|
|
110
|
+
/**
|
|
111
|
+
* The tile, after the checkout's payment method tabs: 16 of padding, the logo 10 above the label (Label/Secondary,
|
|
112
|
+
* Content/Secondary). Selected, the edge turns the theme's primary over an 8% primary tint and the label
|
|
113
|
+
* Content/Primary; focused, it shows the primary edge and a 2px halo.
|
|
114
|
+
*/
|
|
115
|
+
const OPTION_TILE = "relative flex w-full cursor-pointer flex-col items-start justify-center gap-2.5 rounded-lg border border-border bg-background p-4 text-start text-label-secondary text-muted-foreground transition-[background-color,border-color,color,box-shadow] duration-quick ease-smooth-out not-has-data-checked:not-has-data-disabled:hover:bg-accent has-data-checked:border-primary has-data-checked:bg-primary/8 has-data-checked:text-foreground has-focus-visible:border-primary has-focus-visible:ring-2 has-focus-visible:ring-ring/24 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-64";
|
|
92
116
|
/**
|
|
93
117
|
* One option in a `RadioGroup`, identified by `value`. Renders the `Radio` primitive: a `<span role="radio">` plus a
|
|
94
118
|
* hidden `<input>`. On its own it is the bare radio: label it by wrapping it and its text in a `<label>`. With `label`
|
|
95
119
|
* (and `description`) it renders the whole option, a `<label>` with the text beside the radio, and
|
|
96
|
-
* `variant="card"` makes that a card with the radio before the title
|
|
120
|
+
* `variant="card"` makes that a card with the radio before the title, `variant="tile"` a checkout payment method
|
|
121
|
+
* tile with no visible radio, and `variant="accordion"` a row of the checkout's payment method accordion. It
|
|
122
|
+
* presses in while held; an option that is
|
|
97
123
|
* selected when it mounts does not animate.
|
|
98
124
|
*/
|
|
99
125
|
export function Radio({ className, size, variant, label, description, logo, note, disabledReason, content, media, icon, children, disabled, ...props }) {
|
|
@@ -102,12 +128,13 @@ export function Radio({ className, size, variant, label, description, logo, note
|
|
|
102
128
|
const contentId = React.useId();
|
|
103
129
|
const groupValue = React.useContext(RadioGroupValueContext);
|
|
104
130
|
const isCard = variant === "card";
|
|
131
|
+
const isTile = variant === "tile";
|
|
105
132
|
const present = (node) => node !== undefined && node !== null && node !== false;
|
|
106
133
|
const hasText = present(label);
|
|
107
|
-
const cardExtras = isCard && (present(note) || present(disabledReason));
|
|
134
|
+
const cardExtras = (isCard || isTile || variant === "accordion") && (present(note) || present(disabledReason));
|
|
108
135
|
const hasDescription = present(description) || cardExtras;
|
|
109
|
-
const isDisabled = disabled === true || (isCard && present(disabledReason));
|
|
110
|
-
const open = isCard &&
|
|
136
|
+
const isDisabled = disabled === true || ((isCard || isTile || variant === "accordion") && present(disabledReason));
|
|
137
|
+
const open = (isCard || variant === "accordion") &&
|
|
111
138
|
present(content) &&
|
|
112
139
|
!isDisabled &&
|
|
113
140
|
groupValue !== NO_GROUP &&
|
|
@@ -117,6 +144,12 @@ export function Radio({ className, size, variant, label, description, logo, note
|
|
|
117
144
|
if (!hasText && !hasDescription && !isCard)
|
|
118
145
|
return radio;
|
|
119
146
|
const text = (_jsxs("span", { className: cn("flex min-w-0 flex-1 flex-col", isCard ? "gap-1" : "gap-0.5"), children: [hasText ? (_jsx("span", { id: labelId, "data-slot": "radio-label", className: isCard ? "text-label-primary" : undefined, children: label })) : null, hasDescription ? (_jsx("span", { id: descriptionId, "data-slot": "radio-description", className: "flex flex-col gap-0.5 text-body-secondary text-muted-foreground", children: cardExtras ? (_jsxs(_Fragment, { children: [present(description) ? _jsx("span", { children: description }) : null, present(note) ? (_jsx("span", { "data-slot": "radio-note", className: "text-foreground", children: note })) : null, present(disabledReason) ? (_jsx("span", { "data-slot": "radio-disabled-reason", children: disabledReason })) : null] })) : (description) })) : null] }));
|
|
147
|
+
if (variant === "accordion") {
|
|
148
|
+
return (_jsxs("div", { "data-slot": "radio-accordion-item", "data-open": open ? "" : undefined, className: cn(OPTION_ACCORDION, className), children: [_jsxs("label", { className: "flex cursor-pointer items-center gap-3 p-3 text-label-secondary text-muted-foreground has-data-checked:text-foreground has-data-disabled:cursor-not-allowed has-data-disabled:opacity-64", children: [radio, present(logo) ? (_jsx("span", { "data-slot": "radio-logo", "aria-hidden": "true", className: "flex shrink-0", children: logo })) : null, text] }), open ? (_jsx("div", { id: contentId, "data-slot": "radio-content", className: "cursor-auto px-3 pt-1 pb-3", children: content })) : null] }));
|
|
149
|
+
}
|
|
150
|
+
if (isTile) {
|
|
151
|
+
return (_jsxs("label", { "data-slot": "radio-tile", className: cn(OPTION_TILE, className), children: [radio, present(logo) ? (_jsx("span", { "data-slot": "radio-logo", "aria-hidden": "true", className: "flex shrink-0", children: logo })) : null, text] }));
|
|
152
|
+
}
|
|
120
153
|
const logoNode = isCard && present(logo) ? (_jsx("span", { "data-slot": "radio-logo", "aria-hidden": "true", className: "flex shrink-0", children: logo })) : null;
|
|
121
154
|
if (isCard && (present(media) || present(icon))) {
|
|
122
155
|
// A tall card (as the dashboard's onboarding pickers): the radio sits at the end, opposite the icon or the title.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,IAAI,cAAc,EACvB,UAAU,IAAI,mBAAmB,GAClC,MAAM,oCAAqC,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE;QACP,OAAO,EAAE;YACP,WAAW,EACT,uFAAuF;YACzF,SAAS,EAAE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gEAAgE;YAChE,SAAS,EAAE,EAAE,CACX,uFAAuF,EACvF,SAAS,CACV,KAEI,KAA8B,KAC/B,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KACtC,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EACxD,aAAa,EAAE,CACb,IAAa,EACb,OAA0E,EAC1E,EAAE;gBACF,0GAA0G;gBAC1G,kDAAkD;gBACjD,aAAuD,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC1E,IAAI,CAAC,OAAO,CAAC,UAAU;oBAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC,GACD,GAC8B,CACnC,CAAC;AACJ,CAAC;AA+DD,+FAA+F;AAC/F,MAAM,UAAU,GACd,sHAAsH,CAAC;AAEzH;;;;;GAKG;AACH,MAAM,WAAW,GACf,ojBAAojB,CAAC;AAEvjB
|
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,IAAI,cAAc,EACvB,UAAU,IAAI,mBAAmB,GAClC,MAAM,oCAAqC,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE;QACP,OAAO,EAAE;YACP,WAAW,EACT,uFAAuF;YACzF,SAAS,EAAE,EAAE;SACd;QACD,IAAI,EAAE;YACJ,WAAW,EACT,qJAAqJ;YACvJ,SAAS,EAAE,EAAE;YACb,+GAA+G;YAC/G,qHA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wCAAwC,YAEjD,OAAO,GACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;IACJ,CAAC;IACD,OAAO,CACL,8BACa,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACjD,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,aAE1D,KAAK,EACL,QAAQ,EACR,IAAI,IACC,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sale-share-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/sale-share-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,GAEd,MAAM,sBAAuB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SaleShareBusiness {
|
|
3
|
+
name: string;
|
|
4
|
+
/** Logo image URL; the initials show until it loads or when it fails. */
|
|
5
|
+
imageUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SaleShareCardProps extends Omit<React.ComponentProps<"div">, "title" | "children"> {
|
|
8
|
+
className?: string;
|
|
9
|
+
/** The sale, formatted, e.g. "$1,234.56". It shrinks to fit the card. */
|
|
10
|
+
amount: string;
|
|
11
|
+
/** The line above the amount, e.g. "Cha-ching! A new sale is in". */
|
|
12
|
+
headline: React.ReactNode;
|
|
13
|
+
/** The artwork behind the card, an image URL. Decorative. */
|
|
14
|
+
background: string;
|
|
15
|
+
/**
|
|
16
|
+
* The business chip at the top. Leave it out when the merchant turns off "Include business and logo"; the card
|
|
17
|
+
* keeps its size so the shared image is always 720 by 400.
|
|
18
|
+
*/
|
|
19
|
+
business?: SaleShareBusiness;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A new sale as an image to share (the dashboard's payments list, Share): 720 by 400, the artwork behind, the
|
|
23
|
+
* business chip, a headline and the amount in the brand lime with a dark outline. Always light, whatever the theme,
|
|
24
|
+
* so the saved picture looks the same. Capture this element at its own size, and preview it in a `ScaledFrame`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SaleShareCard({ className, amount, headline, background, business, ...props }: SaleShareCardProps): React.JSX.Element;
|
|
27
|
+
//# sourceMappingURL=sale-share-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sale-share-card.d.ts","sourceRoot":"","sources":["../../../src/components/sale-share-card/sale-share-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAUD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,MAAM,EACN,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAuFpB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../avatar/avatar.js";
|
|
6
|
+
const AMOUNT_WIDTH = 720;
|
|
7
|
+
const AMOUNT_HEIGHT = 180;
|
|
8
|
+
const AMOUNT_MAX = 150;
|
|
9
|
+
/** About the width a line of digits may take inside the artwork's panel, in glyph units of the font size. */
|
|
10
|
+
const AMOUNT_FIT = 1000;
|
|
11
|
+
/** The width of the artwork's white panel, in the amount's viewBox units: the text must stay inside it. */
|
|
12
|
+
const AMOUNT_PANEL = 560;
|
|
13
|
+
/**
|
|
14
|
+
* A new sale as an image to share (the dashboard's payments list, Share): 720 by 400, the artwork behind, the
|
|
15
|
+
* business chip, a headline and the amount in the brand lime with a dark outline. Always light, whatever the theme,
|
|
16
|
+
* so the saved picture looks the same. Capture this element at its own size, and preview it in a `ScaledFrame`.
|
|
17
|
+
*/
|
|
18
|
+
export function SaleShareCard({ className, amount, headline, background, business, ...props }) {
|
|
19
|
+
// A first guess from the length; then the text is measured, since wide glyphs (full-width digits) need more room.
|
|
20
|
+
const fontSize = Math.min(AMOUNT_MAX, AMOUNT_FIT / Math.max(amount.length, 1));
|
|
21
|
+
const textRef = React.useRef(null);
|
|
22
|
+
const [zoom, setZoom] = React.useState(1);
|
|
23
|
+
React.useLayoutEffect(() => {
|
|
24
|
+
const measure = () => {
|
|
25
|
+
const width = textRef.current?.getBBox().width ?? 0;
|
|
26
|
+
setZoom(Math.max(1, width / AMOUNT_PANEL));
|
|
27
|
+
};
|
|
28
|
+
// Measure now, then again once the heading font arrives: the fallback font has other widths.
|
|
29
|
+
measure();
|
|
30
|
+
const fonts = typeof document === "undefined" ? undefined : document.fonts;
|
|
31
|
+
let live = true;
|
|
32
|
+
void fonts?.ready.then(() => {
|
|
33
|
+
if (live)
|
|
34
|
+
measure();
|
|
35
|
+
});
|
|
36
|
+
fonts?.addEventListener("loadingdone", measure);
|
|
37
|
+
return () => {
|
|
38
|
+
live = false;
|
|
39
|
+
fonts?.removeEventListener("loadingdone", measure);
|
|
40
|
+
};
|
|
41
|
+
}, [amount, fontSize]);
|
|
42
|
+
const viewWidth = AMOUNT_WIDTH * zoom;
|
|
43
|
+
const viewHeight = AMOUNT_HEIGHT * zoom;
|
|
44
|
+
return (_jsxs("div", { "data-slot": "sale-share-card", className: cn("light relative isolate flex h-100 w-180 shrink-0 flex-col items-center overflow-hidden rounded-xl pt-12 text-center", className), ...props, children: [_jsx("img", { alt: "", src: background, "data-slot": "sale-share-card-background", className: "absolute inset-0 -z-10 size-full object-cover" }), business ? (_jsxs("div", { "data-slot": "sale-share-card-business", className: "flex h-10 items-center gap-2 rounded-lg bg-background ps-2 pe-3 text-foreground", children: [_jsxs(Avatar, { children: [business.imageUrl ? _jsx(AvatarImage, { src: business.imageUrl, alt: "" }) : null, _jsx(AvatarFallback, { name: business.name })] }), _jsx("span", { className: "font-heading text-heading-quaternary", children: business.name })] })) : (_jsx("div", { "aria-hidden": "true", "data-slot": "sale-share-card-business", className: "h-10" })), _jsx("p", { "data-slot": "sale-share-card-headline", className: "mt-10 font-heading text-heading-tertiary tracking-widest text-share-ink", children: headline }), _jsx("svg", { role: "img", "aria-label": amount, "data-slot": "sale-share-card-amount", viewBox: `${(AMOUNT_WIDTH - viewWidth) / 2} ${(AMOUNT_HEIGHT - viewHeight) / 2} ${viewWidth} ${viewHeight}`, className: "mt-2 h-45 w-180", children: _jsx("text", { ref: textRef, x: AMOUNT_WIDTH / 2, y: AMOUNT_HEIGHT / 2, fontSize: fontSize, fontWeight: 800, strokeWidth: 5, paintOrder: "stroke fill", textAnchor: "middle", dominantBaseline: "middle", className: "fill-share-amount stroke-share-ink font-heading", children: amount }) })] }));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=sale-share-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AAC,CAAC,CAAC,CACF,6BAAiB,MAAM,eAAW,0BAA0B,EAAC,SAAS,EAAC,MAAM,GAAG,CACjF,EACD,yBACY,0BAA0B,EACpC,SAAS,EAAC,yEAAyE,YAElF,QAAQ,GACP,EACJ,cACE,IAAI,EAAC,KAAK,gBACE,MAAM,eACR,wBAAwB,EAClC,OAAO,EAAE,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,SAAS,IAAI,UAAU,EAAE,EAC3G,SAAS,EAAC,iBAAiB,YAE3B,eACE,GAAG,EAAE,OAAO,EACZ,CAAC,EAAE,YAAY,GAAG,CAAC,EACnB,CAAC,EAAE,aAAa,GAAG,CAAC,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,GAAG,EACf,WAAW,EAAE,CAAC,EACd,UAAU,EAAC,aAAa,EACxB,UAAU,EAAC,QAAQ,EACnB,gBAAgB,EAAC,QAAQ,EACzB,SAAS,EAAC,iDAAiD,YAE1D,MAAM,GACF,GACH,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -13,10 +13,10 @@ export interface SankeyChartProps extends PrimitiveSankeyChartProps {
|
|
|
13
13
|
* refunds and payouts. Compose it from children: `SankeyLink` (the bands), `SankeyNode` (the bars
|
|
14
14
|
* and their labels) and `SankeyTooltip`. `data` is `{ nodes, links }`: each node has a `name`, each
|
|
15
15
|
* link a `source` and `target` node index and a `value`. Nodes and bands grow in on mount over
|
|
16
|
-
* `animationDuration`. Nodes and bands
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* `animationDuration`. Nodes and bands are solid by default: nodes in full colour, each band its source node's
|
|
17
|
+
* colour at 35% opacity, so crossing bands blend; set `useGradient` on `SankeyLink` for a source-to-target gradient.
|
|
18
|
+
* `variant="tint"` on `SankeyLink` / `SankeyNode` gives the tint look of the other charts (nodes a 20% wash with a
|
|
19
|
+
* solid edge on their label side, bands a 12% wash, 24% while highlighted). The chart is as wide as its container; height comes from `aspectRatio`
|
|
20
20
|
* (default `"2 / 1"`). The default `margin` keeps 180px on each side for node labels.
|
|
21
21
|
*/
|
|
22
22
|
export declare function SankeyChart({ label, className, ...props }: SankeyChartProps): import("react").JSX.Element;
|
|
@@ -8,10 +8,10 @@ import { ChartFigure } from "../chart/chart.js";
|
|
|
8
8
|
* refunds and payouts. Compose it from children: `SankeyLink` (the bands), `SankeyNode` (the bars
|
|
9
9
|
* and their labels) and `SankeyTooltip`. `data` is `{ nodes, links }`: each node has a `name`, each
|
|
10
10
|
* link a `source` and `target` node index and a `value`. Nodes and bands grow in on mount over
|
|
11
|
-
* `animationDuration`. Nodes and bands
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* `animationDuration`. Nodes and bands are solid by default: nodes in full colour, each band its source node's
|
|
12
|
+
* colour at 35% opacity, so crossing bands blend; set `useGradient` on `SankeyLink` for a source-to-target gradient.
|
|
13
|
+
* `variant="tint"` on `SankeyLink` / `SankeyNode` gives the tint look of the other charts (nodes a 20% wash with a
|
|
14
|
+
* solid edge on their label side, bands a 12% wash, 24% while highlighted). The chart is as wide as its container; height comes from `aspectRatio`
|
|
15
15
|
* (default `"2 / 1"`). The default `margin` keeps 180px on each side for node labels.
|
|
16
16
|
*/
|
|
17
17
|
export function SankeyChart({ label, className, ...props }) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/scaled-frame/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/scaled-frame/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAoB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Props of {@link ScaledFrame}. */
|
|
3
|
+
export interface ScaledFrameProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
4
|
+
/** The width the content is laid out at, in px, e.g. 1280 for a desktop page. */
|
|
5
|
+
width: number;
|
|
6
|
+
/** The height the content is laid out at, in px. */
|
|
7
|
+
height: number;
|
|
8
|
+
/** The content, laid out at `width` by `height`: usually an `iframe` of a live page. */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shows content laid out at a fixed size, scaled down to the width the frame has, e.g. a live checkout
|
|
13
|
+
* page in an `iframe` beside its settings. The frame keeps the content's aspect ratio and never scales
|
|
14
|
+
* it up. The content stays a live page; put a cover over it when it should not take clicks.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ScaledFrame({ width, height, className, children, style, ref: callerRef, ...props }: ScaledFrameProps): React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=scaled-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaled-frame.d.ts","sourceRoot":"","sources":["../../../src/components/scaled-frame/scaled-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,oCAAoC;AACpC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IACrF,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,EAAE,SAAS,EACd,GAAG,KAAK,EACT,EAAE,gBAAgB,qBA+ClB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* Shows content laid out at a fixed size, scaled down to the width the frame has, e.g. a live checkout
|
|
7
|
+
* page in an `iframe` beside its settings. The frame keeps the content's aspect ratio and never scales
|
|
8
|
+
* it up. The content stays a live page; put a cover over it when it should not take clicks.
|
|
9
|
+
*/
|
|
10
|
+
export function ScaledFrame({ width, height, className, children, style, ref: callerRef, ...props }) {
|
|
11
|
+
const ref = React.useRef(null);
|
|
12
|
+
// The frame measures itself, so the caller's ref is set alongside its own rather than replacing
|
|
13
|
+
// it, and a React 19 callback ref's cleanup is passed back.
|
|
14
|
+
const setRef = React.useCallback((node) => {
|
|
15
|
+
ref.current = node;
|
|
16
|
+
const cleanup = typeof callerRef === "function" ? callerRef(node) : undefined;
|
|
17
|
+
if (callerRef && typeof callerRef !== "function")
|
|
18
|
+
callerRef.current = node;
|
|
19
|
+
return () => {
|
|
20
|
+
ref.current = null;
|
|
21
|
+
if (typeof cleanup === "function")
|
|
22
|
+
cleanup();
|
|
23
|
+
else if (typeof callerRef === "function")
|
|
24
|
+
callerRef(null);
|
|
25
|
+
else if (callerRef)
|
|
26
|
+
callerRef.current = null;
|
|
27
|
+
};
|
|
28
|
+
}, [callerRef]);
|
|
29
|
+
const [scale, setScale] = React.useState(1);
|
|
30
|
+
React.useLayoutEffect(() => {
|
|
31
|
+
const frame = ref.current;
|
|
32
|
+
if (!frame)
|
|
33
|
+
return;
|
|
34
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
35
|
+
if (entry)
|
|
36
|
+
setScale(Math.min(entry.contentRect.width / width, 1));
|
|
37
|
+
});
|
|
38
|
+
observer.observe(frame);
|
|
39
|
+
return () => observer.disconnect();
|
|
40
|
+
}, [width]);
|
|
41
|
+
return (_jsx("div", { ref: setRef, "data-slot": "scaled-frame", className: cn("relative w-full overflow-hidden", className), style: { ...style, height: height * scale }, ...props, children: _jsx("div", { "data-slot": "scaled-frame-stage", className: "absolute start-0 top-0 origin-top-left rtl:origin-top-right", style: { width, height, transform: `scale(${String(scale)})` }, children: children }) }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=scaled-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaled-frame.js","sourceRoot":"","sources":["../../../src/components/scaled-frame/scaled-frame.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAYrC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,EAAE,SAAS,EACd,GAAG,KAAK,EACS;IACjB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,gGAAgG;IAChG,4DAA4D;IAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAC9B,CAAC,IAA2B,EAAE,EAAE;QAC9B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;QACnB,MAAM,OAAO,GAAG,OAAO,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9E,IAAI,SAAS,IAAI,OAAO,SAAS,KAAK,UAAU;YAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3E,OAAO,GAAG,EAAE;YACV,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;YACnB,IAAI,OAAO,OAAO,KAAK,UAAU;gBAAE,OAAO,EAAE,CAAC;iBACxC,IAAI,OAAO,SAAS,KAAK,UAAU;gBAAE,SAAS,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ch
|
|
|
173
173
|
* Loading region that swaps a skeleton for its content, after interior.dev's skeleton swap. The
|
|
174
174
|
* skeleton and `children` share one grid cell, so the region keeps its height and the layout does
|
|
175
175
|
* not jump. The skeleton waits `delay` before it shows (a fast load shows no skeleton), stays for at
|
|
176
|
-
* least `minDuration`, then fades out
|
|
176
|
+
* least `minDuration`, then fades out while the content fades in, sharpens and settles to full size.
|
|
177
177
|
* The region is `aria-busy` while loading, and the content is inert while the skeleton covers it.
|
|
178
178
|
*/
|
|
179
179
|
export declare function SkeletonSwap({ loading, children, lines, skeleton, delay, minDuration, label, animation, className, ...props }: SkeletonSwapProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9E;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;CAAoD,CAAC;AAEhG,wEAAwE;AACxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAC;AAEH,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EACjC,gBAAgB,CAAC,OAAO,sBAAsB,CAAC;CAAG;AAEtD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,qBAUhF;AAED,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EACjC,IAAI,CAAC,gBAAgB,CAAC,OAAO,sBAAsB,CAAC,EAAE,WAAW,CAAC;IACpE;;;OAGG;I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K,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qGAAqG;IACrG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,KAAS,EACT,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAmFnB"}
|
|
@@ -5,7 +5,7 @@ import * as m from "motion/react-m";
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Skeleton as PrimitiveSkeleton } from "../../primitives/ui/skeleton.js";
|
|
7
7
|
import { cn } from "../../lib/cn.js";
|
|
8
|
-
import { MOTION_BLUR_PX, MOTION_DURATION_MS, MOTION_EASE_SMOOTH_OUT } from "../../lib/motion.js";
|
|
8
|
+
import { MOTION_BLUR_PX, MOTION_DURATION_MS, MOTION_EASE_SMOOTH_OUT, MOTION_SPRING } from "../../lib/motion.js";
|
|
9
9
|
import { createVariants } from "../../lib/variants.js";
|
|
10
10
|
import { loadDomAnimation } from "../../lib/motion-features.js";
|
|
11
11
|
/**
|
|
@@ -124,7 +124,7 @@ export function useSkeletonSwap({ loading, delay = 120, minDuration = 380, }) {
|
|
|
124
124
|
* Loading region that swaps a skeleton for its content, after interior.dev's skeleton swap. The
|
|
125
125
|
* skeleton and `children` share one grid cell, so the region keeps its height and the layout does
|
|
126
126
|
* not jump. The skeleton waits `delay` before it shows (a fast load shows no skeleton), stays for at
|
|
127
|
-
* least `minDuration`, then fades out
|
|
127
|
+
* least `minDuration`, then fades out while the content fades in, sharpens and settles to full size.
|
|
128
128
|
* The region is `aria-busy` while loading, and the content is inert while the skeleton covers it.
|
|
129
129
|
*/
|
|
130
130
|
export function SkeletonSwap({ loading, children, lines = 3, skeleton, delay, minDuration, label, animation, className, ...props }) {
|
|
@@ -137,17 +137,21 @@ export function SkeletonSwap({ loading, children, lines = 3, skeleton, delay, mi
|
|
|
137
137
|
setLoadEnded(!loading);
|
|
138
138
|
}
|
|
139
139
|
const reduceMotion = useReducedMotion();
|
|
140
|
-
const reveal = reduceMotion
|
|
141
|
-
? { duration: 0 }
|
|
142
|
-
: { duration: MOTION_DURATION_MS.slow / 1000, ease: MOTION_EASE_SMOOTH_OUT };
|
|
140
|
+
const reveal = reduceMotion ? { duration: 0 } : MOTION_SPRING.crossfade;
|
|
143
141
|
const exit = reduceMotion
|
|
144
142
|
? { duration: 0 }
|
|
145
143
|
: { duration: MOTION_DURATION_MS.quick / 1000, ease: MOTION_EASE_SMOOTH_OUT };
|
|
146
144
|
const count = Math.max(1, Math.floor(lines));
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
145
|
+
// Content waits faded, blurred and a touch smaller, and arrives on the cross-fade spring; the
|
|
146
|
+
// placeholder leaves with a smaller blur.
|
|
147
|
+
const hidden = reduceMotion
|
|
148
|
+
? { opacity: 0 }
|
|
149
|
+
: { opacity: 0, scale: 0.99, filter: `blur(${String(MOTION_BLUR_PX.medium)}px)` };
|
|
150
|
+
const shown = reduceMotion ? { opacity: 1 } : { opacity: 1, scale: 1, filter: "blur(0px)" };
|
|
151
|
+
const gone = reduceMotion
|
|
152
|
+
? { opacity: 0, transition: exit }
|
|
153
|
+
: { opacity: 0, filter: `blur(${String(MOTION_BLUR_PX.small)}px)`, transition: exit };
|
|
154
|
+
return (_jsxs("div", { "data-slot": "skeleton-swap", "data-loading": showSkeleton || undefined, role: label ? "group" : undefined, "aria-label": label, "aria-busy": loading, className: cn("relative grid *:col-start-1 *:row-start-1", className), ...props, children: [_jsxs(LazyMotion, { features: loadDomAnimation, strict: true, children: [_jsx(m.div, { "data-slot": "skeleton-swap-content", inert: showSkeleton, className: "min-w-0 origin-top-left", initial: false, animate: showSkeleton ? hidden : shown, transition: showSkeleton ? exit : reveal, children: children }), _jsx(AnimatePresence, { initial: false, children: showSkeleton ? (_jsx(m.div, { "data-slot": "skeleton-swap-placeholder", "aria-hidden": "true", className: "pointer-events-none w-full self-start", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: gone, transition: reveal, children: skeleton ?? (_jsx("div", { className: "flex w-full flex-col gap-2", children: Array.from({ length: count }, (_, i) => (_jsx(Skeleton
|
|
151
155
|
// biome-ignore lint/suspicious/noArrayIndexKey: static placeholder lines never reorder
|
|
152
156
|
, { shape: "line", animation: animation,
|
|
153
157
|
// A runtime width per line, so the placeholder has a ragged edge like text.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,eAAe,EAAE,UAAU,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,iCAAkC,CAAC;AACjF,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,eAAe,EAAE,UAAU,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,KAAK,KA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,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,IAJlD,CAAC,CAKN,CACH,CAAC,GACE,CACP,IAtBG,UAAU,CAuBR,CACT,CAAC,CAAC,CAAC,IAAI,GACQ,IACP,EACZ,KAAK,CAAC,CAAC,CAAC,CACP,4BAAgB,sBAAsB,EAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,SAAS,YACrE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAC9B,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Slider as BaseSlider } from "@base-ui/react/slider";
|
|
2
2
|
/**
|
|
3
|
-
* The resting look of the Dodo Nest Thumb: a 16px
|
|
3
|
+
* The resting look of the Dodo Nest Thumb: a 16px knob circle (`--knob`: white, Grey 100 in dark) with a 1px gradient rim
|
|
4
4
|
* (`--rim-knob`, white to black at 30%) and Shadow/Card. A keyboard focus swaps the rim for a 1px
|
|
5
5
|
* Border/Brand-primary ring and the 2px Shadow/Focus halo. On coarse pointers an invisible 36px touch
|
|
6
6
|
* target surrounds it. Hover has no visual change; disabled comes from the Slider control (40% opacity).
|
|
7
7
|
* Exported so static docs frames draw exactly what ships.
|
|
8
8
|
*/
|
|
9
|
-
export declare const SLIDER_THUMB_CLASSES = "group/thumb block size-4 shrink-0 rounded-full bg-
|
|
9
|
+
export declare const SLIDER_THUMB_CLASSES = "group/thumb block size-4 shrink-0 rounded-full bg-knob shadow-xs/4 outline-none transition-[box-shadow,scale] duration-quick ease-smooth-out select-none before:pointer-events-none before:absolute before:inset-0 before:rounded-full before:[--ring-gradient:var(--rim-knob)] before:gradient-ring pointer-coarse:after:absolute pointer-coarse:after:-inset-2.5 has-focus-visible:inset-ring has-focus-visible:inset-ring-brand-border has-focus-visible:ring-2 has-focus-visible:ring-brand-subtle has-focus-visible:before:hidden data-dragging:shadow-none";
|
|
10
10
|
/** The focus look of {@link SLIDER_THUMB_CLASSES}, for forcing the state in static frames. */
|
|
11
11
|
export declare const SLIDER_THUMB_FOCUS_CLASSES = "inset-ring inset-ring-brand-border ring-2 ring-brand-subtle before:hidden";
|
|
12
12
|
export interface SliderThumbProps extends Omit<BaseSlider.Thumb.Props, "className"> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-thumb.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider-thumb.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG7D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"slider-thumb.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider-thumb.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG7D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,qiBACmgB,CAAC;AAEriB,8FAA8F;AAC9F,eAAO,MAAM,0BAA0B,8EACsC,CAAC;AAE9E,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC;IACjF,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAepE"}
|
|
@@ -3,13 +3,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Slider as BaseSlider } from "@base-ui/react/slider";
|
|
4
4
|
import { cn } from "../../lib/cn.js";
|
|
5
5
|
/**
|
|
6
|
-
* The resting look of the Dodo Nest Thumb: a 16px
|
|
6
|
+
* The resting look of the Dodo Nest Thumb: a 16px knob circle (`--knob`: white, Grey 100 in dark) with a 1px gradient rim
|
|
7
7
|
* (`--rim-knob`, white to black at 30%) and Shadow/Card. A keyboard focus swaps the rim for a 1px
|
|
8
8
|
* Border/Brand-primary ring and the 2px Shadow/Focus halo. On coarse pointers an invisible 36px touch
|
|
9
9
|
* target surrounds it. Hover has no visual change; disabled comes from the Slider control (40% opacity).
|
|
10
10
|
* Exported so static docs frames draw exactly what ships.
|
|
11
11
|
*/
|
|
12
|
-
export const SLIDER_THUMB_CLASSES = "group/thumb block size-4 shrink-0 rounded-full bg-
|
|
12
|
+
export const SLIDER_THUMB_CLASSES = "group/thumb block size-4 shrink-0 rounded-full bg-knob shadow-xs/4 outline-none transition-[box-shadow,scale] duration-quick ease-smooth-out select-none before:pointer-events-none before:absolute before:inset-0 before:rounded-full before:[--ring-gradient:var(--rim-knob)] before:gradient-ring pointer-coarse:after:absolute pointer-coarse:after:-inset-2.5 has-focus-visible:inset-ring has-focus-visible:inset-ring-brand-border has-focus-visible:ring-2 has-focus-visible:ring-brand-subtle has-focus-visible:before:hidden data-dragging:shadow-none";
|
|
13
13
|
/** The focus look of {@link SLIDER_THUMB_CLASSES}, for forcing the state in static frames. */
|
|
14
14
|
export const SLIDER_THUMB_FOCUS_CLASSES = "inset-ring inset-ring-brand-border ring-2 ring-brand-subtle before:hidden";
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-thumb.js","sourceRoot":"","sources":["../../../src/components/slider/slider-thumb.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,
|
|
1
|
+
{"version":3,"file":"slider-thumb.js","sourceRoot":"","sources":["../../../src/components/slider/slider-thumb.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,kiBAAkiB,CAAC;AAEriB,8FAA8F;AAC9F,MAAM,CAAC,MAAM,0BAA0B,GACrC,2EAA2E,CAAC;AAO9E;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB;IACnE,OAAO,CACL,KAAC,UAAU,CAAC,KAAK,iBACL,cAAc,EACxB,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CACnB,EAAE,CACA,oBAAoB;QACpB,2FAA2F;QAC3F,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,gBAAgB,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,WAAW,EAC9E,SAAS,CACV,KAEC,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -25,7 +25,7 @@ export function Slider({ className, label, showValue = false, showTooltip = fals
|
|
|
25
25
|
return (_jsxs(BaseSlider.Root, { "data-slot": "slider", value: value, defaultValue: defaultValue, thumbAlignment: "edge", className: cn("flex w-full flex-col gap-3", className), ...props, children: [hasLabel || showValue ? (_jsxs("div", { "data-slot": "slider-header", className: "flex w-full items-center justify-between gap-3", children: [hasLabel ? (_jsx(BaseSlider.Label, { "data-slot": "slider-label", className: "text-foreground text-label-primary", children: label })) : null, showValue ? (_jsx(PrimitiveSliderValue, { "data-slot": "slider-value", className: "ms-auto text-foreground tabular-nums" })) : null] })) : null, _jsx(BaseSlider.Control, { "data-slot": "slider-control", className: "flex h-4 w-full touch-none items-center select-none data-disabled:pointer-events-none data-disabled:opacity-40", children: _jsxs(BaseSlider.Track, { "data-slot": "slider-track", className: "relative h-1 w-full rounded-full bg-tertiary select-none", children: [_jsx(BaseSlider.Indicator, { "data-slot": "slider-indicator", className: "rounded-full bg-brand-content inset-shadow-bar select-none before:pointer-events-none before:absolute before:inset-0 before:rounded-full before:rim-bar before:gradient-ring" }), Array.from({ length: thumbCount }, (_, index) => (_jsx(SliderThumb
|
|
26
26
|
// Thumbs are positional and never reorder, so the index is a stable key.
|
|
27
27
|
// biome-ignore lint/suspicious/noArrayIndexKey: positional thumbs
|
|
28
|
-
, { index: index, "aria-label": getAriaLabel ? undefined : ariaLabel, getAriaLabel: getAriaLabel ?? null, getAriaValueText: getAriaValueText ?? null, children: showTooltip ? (_jsx(BaseSlider.Value, { "data-slot": "slider-tooltip", "aria-hidden": "true", className: "pointer-events-none absolute bottom-full start-1/2 mb-2 -translate-x-1/2 scale-small rounded-md border bg-popover px-2 py-1 text-popover-foreground text-body-secondary whitespace-nowrap tabular-nums opacity-0 shadow-md/5 transition-[opacity,scale] duration-instant ease-smooth-out group-has-focus-visible/thumb:scale-100 group-has-focus-visible/thumb:opacity-100 group-has-focus-visible/thumb:duration-quick group-data-dragging/thumb:scale-100 group-data-dragging/thumb:opacity-100 group-data-dragging/thumb:duration-quick rtl:translate-x-1/2", children: (formattedValues, values) => {
|
|
28
|
+
, { index: index, "aria-label": getAriaLabel ? undefined : ariaLabel, getAriaLabel: getAriaLabel ?? null, getAriaValueText: getAriaValueText ?? null, children: showTooltip ? (_jsx(BaseSlider.Value, { "data-slot": "slider-tooltip", "aria-hidden": "true", className: "pointer-events-none absolute bottom-full start-1/2 mb-2 -translate-x-1/2 scale-small rounded-md border border-popover-border bg-popover px-2 py-1 text-popover-foreground text-body-secondary whitespace-nowrap tabular-nums opacity-0 shadow-md/5 transition-[opacity,scale] duration-instant ease-smooth-out group-has-focus-visible/thumb:scale-100 group-has-focus-visible/thumb:opacity-100 group-has-focus-visible/thumb:duration-quick group-data-dragging/thumb:scale-100 group-data-dragging/thumb:opacity-100 group-data-dragging/thumb:duration-quick rtl:translate-x-1/2", children: (formattedValues, values) => {
|
|
29
29
|
const thumbValue = values[index];
|
|
30
30
|
if (thumbValue === undefined)
|
|
31
31
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sourceRoot":"","sources":["../../../src/components/slider/slider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,+BAAgC,CAAC;AACrF,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAoB,CAAC;AA2BjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,SAAS,EACT,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,KAAK,EACnB,cAAc,EACd,YAAY,EAAE,SAAS,EACvB,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,GAAG,KAAK,EACI;IACZ,MAAM,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC;IACtC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;IAEvD,OAAO,CACL,MAAC,UAAU,CAAC,IAAI,iBACJ,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAC,MAAM,EACrB,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,KAClD,KAAK,aAER,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,CACvB,4BAAe,eAAe,EAAC,SAAS,EAAC,gDAAgD,aACtF,QAAQ,CAAC,CAAC,CAAC,CACV,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AAC,UAAU,CAAC,SAAS,iBACT,kBAAkB,EAC5B,SAAS,EAAC,8KAA8K,GACxL,EACD,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAChD,KAAC,WAAW;wBACV,yEAAyE;wBACzE,kEAAkE;4BAElE,KAAK,EAAE,KAAK,gBACA,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAChD,YAAY,EAAE,YAAY,IAAI,IAAI,EAClC,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,YAEzC,WAAW,CAAC,CAAC,CAAC,CAEb,KAAC,UAAU,CAAC,KAAK,iBACL,gBAAgB,iBACd,MAAM,EAClB,SAAS,EAAC,sjBAAsjB,YAE/jB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE;oCAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;oCACjC,IAAI,UAAU,KAAK,SAAS;wCAAE,OAAO,IAAI,CAAC;oCAC1C,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;gCAC9E,CAAC,GACgB,CACpB,CAAC,CAAC,CAAC,IAAI,IAnBH,KAAK,CAoBE,CACf,CAAC,IACe,GACA,IACL,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DODO_STAT_GRID_DEFAULT_VARIANTS, DODO_STAT_GRID_VARIANTS, StatCard, StatCardBreakdown, type StatCardBreakdownProps, StatCardBreakdownRow, type StatCardBreakdownRowProps, type StatCardDirection, type StatCardLabels, type StatCardProps, type StatCardTrend, StatGrid, type StatGridProps, } from "./stat-card.tsx";
|
|
1
|
+
export { DODO_STAT_CARD_DEFAULT_VARIANTS, DODO_STAT_CARD_VARIANTS, DODO_STAT_GRID_DEFAULT_VARIANTS, DODO_STAT_GRID_VARIANTS, StatCard, StatCardBreakdown, type StatCardBreakdownProps, StatCardBreakdownRow, type StatCardBreakdownRowProps, type StatCardDirection, type StatCardLabels, type StatCardLayout, type StatCardProps, type StatCardTrend, StatGrid, type StatGridProps, } from "./stat-card.tsx";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/stat-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,QAAQ,EACR,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/stat-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,+BAA+B,EAC/B,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,QAAQ,EACR,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DODO_STAT_GRID_DEFAULT_VARIANTS, DODO_STAT_GRID_VARIANTS, StatCard, StatCardBreakdown, StatCardBreakdownRow, StatGrid, } from "./stat-card.js";
|
|
1
|
+
export { DODO_STAT_CARD_DEFAULT_VARIANTS, DODO_STAT_CARD_VARIANTS, DODO_STAT_GRID_DEFAULT_VARIANTS, DODO_STAT_GRID_VARIANTS, StatCard, StatCardBreakdown, StatCardBreakdownRow, StatGrid, } from "./stat-card.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/stat-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EAEjB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/stat-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,+BAA+B,EAC/B,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EAEjB,oBAAoB,EAOpB,QAAQ,GAET,MAAM,gBAAiB,CAAC"}
|