@dodopayments/ui 1.4.0 → 1.6.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 +1258 -257
- package/ai/component-registry.md +5 -1
- package/ai/components/area-chart.md +4 -4
- package/ai/components/avatar.md +1 -1
- package/ai/components/badge.md +24 -0
- package/ai/components/bar-chart.md +18 -18
- package/ai/components/brand-logos.md +1 -1
- package/ai/components/button.md +24 -1
- 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 +1 -1
- package/ai/components/composed-chart.md +7 -7
- package/ai/components/copyable-id.md +1 -0
- package/ai/components/country-select.md +1 -0
- package/ai/components/currency-select.md +1 -0
- package/ai/components/data-grid.md +92 -2
- package/ai/components/date-picker.md +1 -1
- package/ai/components/dialog.md +4 -2
- package/ai/components/drawer.md +292 -0
- package/ai/components/featured-icon.md +1 -0
- package/ai/components/field.md +1 -1
- package/ai/components/file-upload.md +1 -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/icon-morph.md +1 -1
- package/ai/components/image-crop.md +89 -0
- package/ai/components/input-group.md +1 -1
- package/ai/components/input.md +43 -2
- package/ai/components/invoice-document.md +182 -0
- package/ai/components/line-chart.md +2 -2
- package/ai/components/load-more.md +1 -1
- package/ai/components/logo.md +1 -1
- package/ai/components/menu.md +10 -9
- package/ai/components/milestone.md +1 -1
- package/ai/components/money.md +3 -3
- package/ai/components/new-items-pill.md +1 -1
- package/ai/components/payment-logos.md +1 -1
- package/ai/components/pie-chart.md +11 -2
- package/ai/components/popover.md +2 -1
- package/ai/components/reorder-list.md +46 -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 +1 -1
- package/ai/components/select.md +29 -2
- package/ai/components/setup-guide.md +1 -1
- package/ai/components/sidebar.md +2 -2
- package/ai/components/stat-card.md +32 -5
- package/ai/components/sunburst-chart.md +7 -4
- package/ai/components/tabs.md +39 -0
- package/ai/components/test-mode-banner.md +6 -3
- package/ai/components/timestamp.md +11 -2
- package/ai/components/timezone-select.md +1 -0
- package/ai/skills/dodo-charts/SKILL.md +12 -7
- package/ai/skills/dodo-design/SKILL.md +17 -7
- 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/badge/badge.d.ts +12 -0
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +23 -4
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/brand-logos/brand-artwork.d.ts +30 -1
- package/dist/components/brand-logos/brand-artwork.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-artwork.js +30 -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 +11 -1
- package/dist/components/brand-logos/brand-logos.js.map +1 -1
- package/dist/components/button/button.d.ts +12 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +8 -0
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/card/card-notice.d.ts.map +1 -1
- package/dist/components/card/card-notice.js +1 -1
- package/dist/components/card/card-notice.js.map +1 -1
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +3 -1
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/comparison-bars/comparison-bars.js +2 -2
- package/dist/components/comparison-bars/comparison-bars.js.map +1 -1
- 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/country-select/country-select.d.ts +6 -1
- package/dist/components/country-select/country-select.d.ts.map +1 -1
- package/dist/components/country-select/country-select.js +2 -2
- package/dist/components/country-select/country-select.js.map +1 -1
- package/dist/components/currency-select/currency-select.d.ts +6 -1
- package/dist/components/currency-select/currency-select.d.ts.map +1 -1
- package/dist/components/currency-select/currency-select.js +2 -2
- package/dist/components/currency-select/currency-select.js.map +1 -1
- package/dist/components/data-grid/bulk-actions.js +2 -2
- package/dist/components/data-grid/bulk-actions.js.map +1 -1
- package/dist/components/data-grid/data-grid.d.ts +17 -2
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.js +111 -9
- package/dist/components/data-grid/data-grid.js.map +1 -1
- package/dist/components/data-grid/table.d.ts.map +1 -1
- package/dist/components/data-grid/table.js +5 -0
- package/dist/components/data-grid/table.js.map +1 -1
- package/dist/components/date-picker/date-picker.js +2 -2
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +12 -4
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +46 -7
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +73 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/drawer.js +56 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/featured-icon/featured-icon.d.ts +103 -1
- package/dist/components/featured-icon/featured-icon.d.ts.map +1 -1
- package/dist/components/featured-icon/featured-icon.js +61 -3
- package/dist/components/featured-icon/featured-icon.js.map +1 -1
- package/dist/components/featured-icon/index.d.ts +1 -1
- package/dist/components/featured-icon/index.d.ts.map +1 -1
- package/dist/components/featured-icon/index.js +1 -1
- package/dist/components/featured-icon/index.js.map +1 -1
- package/dist/components/featured-icon/sphere.d.ts +7 -0
- package/dist/components/featured-icon/sphere.d.ts.map +1 -0
- package/dist/components/featured-icon/sphere.js +29 -0
- package/dist/components/featured-icon/sphere.js.map +1 -0
- package/dist/components/file-upload/file-upload.js +1 -1
- package/dist/components/file-upload/file-upload.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/image-crop/crop-math.d.ts +28 -0
- package/dist/components/image-crop/crop-math.d.ts.map +1 -0
- package/dist/components/image-crop/crop-math.js +53 -0
- package/dist/components/image-crop/crop-math.js.map +1 -0
- package/dist/components/image-crop/image-crop.d.ts +31 -0
- package/dist/components/image-crop/image-crop.d.ts.map +1 -0
- package/dist/components/image-crop/image-crop.js +165 -0
- package/dist/components/image-crop/image-crop.js.map +1 -0
- package/dist/components/image-crop/index.d.ts +2 -0
- package/dist/components/image-crop/index.d.ts.map +1 -0
- package/dist/components/image-crop/index.js +2 -0
- package/dist/components/image-crop/index.js.map +1 -0
- package/dist/components/input/input.d.ts +8 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +12 -3
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input-group/input-group.d.ts +1 -1
- package/dist/components/input-group/input-group.js +1 -1
- package/dist/components/input-group/input-group.js.map +1 -1
- package/dist/components/invoice-document/index.d.ts +2 -0
- package/dist/components/invoice-document/index.d.ts.map +1 -0
- package/dist/components/invoice-document/index.js +2 -0
- package/dist/components/invoice-document/index.js.map +1 -0
- package/dist/components/invoice-document/invoice-document.d.ts +180 -0
- package/dist/components/invoice-document/invoice-document.d.ts.map +1 -0
- package/dist/components/invoice-document/invoice-document.js +58 -0
- package/dist/components/invoice-document/invoice-document.js.map +1 -0
- package/dist/components/list-item/list-item.d.ts +2 -2
- package/dist/components/list-item/list-item.d.ts.map +1 -1
- package/dist/components/list-item/list-item.js +3 -3
- package/dist/components/list-item/list-item.js.map +1 -1
- package/dist/components/list-toolbar/list-toolbar-date-range.js +1 -1
- package/dist/components/list-toolbar/list-toolbar-date-range.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 +7 -3
- package/dist/components/logo/logo.js.map +1 -1
- package/dist/components/menu/menu.d.ts +10 -9
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/menu/menu.js +5 -4
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/page-header/page-header.d.ts.map +1 -1
- package/dist/components/page-header/page-header.js +6 -6
- package/dist/components/page-header/page-header.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +4 -2
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/payment-logos/artwork/link.d.ts +2 -0
- package/dist/components/payment-logos/artwork/link.d.ts.map +1 -0
- package/dist/components/payment-logos/artwork/link.js +5 -0
- package/dist/components/payment-logos/artwork/link.js.map +1 -0
- package/dist/components/payment-logos/payment-logos.d.ts +1 -1
- package/dist/components/payment-logos/payment-logos.d.ts.map +1 -1
- package/dist/components/payment-logos/payment-logos.js +3 -0
- package/dist/components/payment-logos/payment-logos.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/popover/popover.d.ts +7 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/quantity-stepper/quantity-stepper.js +1 -1
- package/dist/components/quantity-stepper/quantity-stepper.js.map +1 -1
- package/dist/components/radio-group/radio-group.js +2 -2
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/reorder-list/reorder-list.d.ts +11 -2
- package/dist/components/reorder-list/reorder-list.d.ts.map +1 -1
- package/dist/components/reorder-list/reorder-list.js +39 -16
- package/dist/components/reorder-list/reorder-list.js.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.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/scaled-frame.d.ts +6 -2
- package/dist/components/scaled-frame/scaled-frame.d.ts.map +1 -1
- package/dist/components/scaled-frame/scaled-frame.js +20 -1
- package/dist/components/scaled-frame/scaled-frame.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts +2 -2
- package/dist/components/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +10 -2
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.d.ts +21 -3
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +24 -9
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts +2 -2
- package/dist/components/sidebar/sidebar.js +2 -2
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +7 -7
- 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/subscription-card/subscription-card.js +1 -1
- package/dist/components/subscription-card/subscription-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/tabs/tabs.d.ts +30 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +14 -4
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/test-mode-banner/test-mode-banner.d.ts.map +1 -1
- package/dist/components/test-mode-banner/test-mode-banner.js +3 -2
- package/dist/components/test-mode-banner/test-mode-banner.js.map +1 -1
- package/dist/components/timestamp/index.d.ts +1 -1
- package/dist/components/timestamp/index.d.ts.map +1 -1
- package/dist/components/timestamp/index.js +1 -1
- package/dist/components/timestamp/index.js.map +1 -1
- package/dist/components/timestamp/timestamp.d.ts +12 -2
- package/dist/components/timestamp/timestamp.d.ts.map +1 -1
- package/dist/components/timestamp/timestamp.js +12 -2
- package/dist/components/timestamp/timestamp.js.map +1 -1
- package/dist/components/timezone-select/timezone-select.d.ts +6 -1
- package/dist/components/timezone-select/timezone-select.d.ts.map +1 -1
- package/dist/components/timezone-select/timezone-select.js +2 -2
- package/dist/components/timezone-select/timezone-select.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/icons/index.d.ts +9 -0
- package/dist/icons/index.js +9 -0
- package/dist/icons/ui/arrow-turn-right.d.ts +3 -0
- package/dist/icons/ui/arrow-turn-right.d.ts.map +1 -0
- package/dist/icons/ui/arrow-turn-right.js +5 -0
- package/dist/icons/ui/arrow-turn-right.js.map +1 -0
- package/dist/icons/ui/box-glyph.d.ts +3 -0
- package/dist/icons/ui/box-glyph.js +5 -0
- package/dist/icons/ui/circle-check-glyph.d.ts +3 -0
- package/dist/icons/ui/circle-check-glyph.js +5 -0
- package/dist/icons/ui/crop.d.ts +3 -0
- package/dist/icons/ui/crop.d.ts.map +1 -0
- package/dist/icons/ui/crop.js +5 -0
- package/dist/icons/ui/crop.js.map +1 -0
- package/dist/icons/ui/greek-temple-glyph.d.ts +3 -0
- package/dist/icons/ui/greek-temple-glyph.js +5 -0
- package/dist/icons/ui/hourglass-glyph.d.ts +3 -0
- package/dist/icons/ui/hourglass-glyph.js +5 -0
- package/dist/icons/ui/shop-glyph.d.ts +3 -0
- package/dist/icons/ui/shop-glyph.js +5 -0
- package/dist/icons/ui/triangle-warning-glyph.d.ts +3 -0
- package/dist/icons/ui/triangle-warning-glyph.js +5 -0
- package/dist/icons/ui/user-glyph.d.ts +3 -0
- package/dist/icons/ui/user-glyph.js +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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/lib/locale-messages.d.ts +8 -0
- package/dist/lib/locale-messages.d.ts.map +1 -1
- package/dist/lib/locale-messages.js +9 -0
- package/dist/lib/locale-messages.js.map +1 -1
- package/dist/locales/ar.d.ts.map +1 -1
- package/dist/locales/ar.js +6 -0
- package/dist/locales/ar.js.map +1 -1
- package/dist/locales/de.d.ts.map +1 -1
- package/dist/locales/de.js +6 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/es.d.ts.map +1 -1
- package/dist/locales/es.js +6 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.d.ts.map +1 -1
- package/dist/locales/fr.js +6 -0
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/he.d.ts.map +1 -1
- package/dist/locales/he.js +6 -0
- package/dist/locales/he.js.map +1 -1
- package/dist/locales/hi.d.ts.map +1 -1
- package/dist/locales/hi.js +6 -0
- package/dist/locales/hi.js.map +1 -1
- package/dist/locales/ja.d.ts.map +1 -1
- package/dist/locales/ja.js +6 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/locales/pt-BR.js +6 -0
- package/dist/locales/pt-BR.js.map +1 -1
- package/dist/locales/zh-CN.d.ts.map +1 -1
- package/dist/locales/zh-CN.js +6 -0
- package/dist/locales/zh-CN.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 +8 -8
- 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/hooks/use-media-query.d.ts +1 -1
- package/dist/primitives/hooks/use-media-query.js +1 -1
- package/dist/primitives/lib/mobile-sheet.d.ts +25 -0
- package/dist/primitives/lib/mobile-sheet.d.ts.map +1 -0
- package/dist/primitives/lib/mobile-sheet.js +28 -0
- package/dist/primitives/lib/mobile-sheet.js.map +1 -0
- package/dist/primitives/lib/segmented-control.d.ts +8 -2
- package/dist/primitives/lib/segmented-control.d.ts.map +1 -1
- package/dist/primitives/lib/segmented-control.js +8 -2
- package/dist/primitives/lib/segmented-control.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/button.d.ts +1 -1
- package/dist/primitives/ui/button.d.ts.map +1 -1
- package/dist/primitives/ui/button.js +3 -1
- package/dist/primitives/ui/button.js.map +1 -1
- package/dist/primitives/ui/calendar.d.ts.map +1 -1
- package/dist/primitives/ui/calendar.js +4 -2
- package/dist/primitives/ui/calendar.js.map +1 -1
- package/dist/primitives/ui/checkbox.d.ts.map +1 -1
- package/dist/primitives/ui/checkbox.js +3 -1
- package/dist/primitives/ui/checkbox.js.map +1 -1
- package/dist/primitives/ui/combobox.js +2 -2
- package/dist/primitives/ui/combobox.js.map +1 -1
- package/dist/primitives/ui/dialog.d.ts +7 -0
- package/dist/primitives/ui/dialog.d.ts.map +1 -1
- package/dist/primitives/ui/dialog.js +12 -1
- package/dist/primitives/ui/dialog.js.map +1 -1
- package/dist/primitives/ui/drawer.d.ts +1 -2
- package/dist/primitives/ui/drawer.d.ts.map +1 -1
- package/dist/primitives/ui/drawer.js +30 -14
- package/dist/primitives/ui/drawer.js.map +1 -1
- package/dist/primitives/ui/input-group.d.ts.map +1 -1
- package/dist/primitives/ui/input-group.js +4 -1
- package/dist/primitives/ui/input-group.js.map +1 -1
- package/dist/primitives/ui/input.js +1 -1
- package/dist/primitives/ui/input.js.map +1 -1
- package/dist/primitives/ui/menu.d.ts.map +1 -1
- package/dist/primitives/ui/menu.js +15 -16
- package/dist/primitives/ui/menu.js.map +1 -1
- package/dist/primitives/ui/number-field.js +1 -1
- package/dist/primitives/ui/number-field.js.map +1 -1
- package/dist/primitives/ui/otp-field.js +2 -2
- package/dist/primitives/ui/otp-field.js.map +1 -1
- package/dist/primitives/ui/popover.d.ts +3 -1
- package/dist/primitives/ui/popover.d.ts.map +1 -1
- package/dist/primitives/ui/popover.js +11 -5
- 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/radio-group.js +1 -1
- package/dist/primitives/ui/radio-group.js.map +1 -1
- package/dist/primitives/ui/select.d.ts +7 -3
- package/dist/primitives/ui/select.d.ts.map +1 -1
- package/dist/primitives/ui/select.js +14 -5
- package/dist/primitives/ui/select.js.map +1 -1
- package/dist/primitives/ui/sheet.d.ts.map +1 -1
- package/dist/primitives/ui/sheet.js +5 -4
- package/dist/primitives/ui/sheet.js.map +1 -1
- package/dist/primitives/ui/sidebar.js +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/tabs.d.ts.map +1 -1
- package/dist/primitives/ui/tabs.js +1 -1
- package/dist/primitives/ui/tabs.js.map +1 -1
- package/dist/primitives/ui/textarea.js +1 -1
- package/dist/primitives/ui/textarea.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/motion.test.tsx +15 -0
- package/dist/styles/theme.css +13 -0
- package/dist/styles/tokens.css +142 -39
- package/dist/styles/tokens.test.tsx +154 -3
- 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 +33 -15
- package/dist/theme/css.js.map +1 -1
- package/package.json +1 -1
package/ai/components/input.md
CHANGED
|
@@ -4,7 +4,7 @@ The Dodo Nest Input. Lets the merchant type a value: one line (text, search, URL
|
|
|
4
4
|
(`type="textarea"`), a list of chips (`type="chips"`, typed, or picked from `suggestions`), an amount in minor
|
|
5
5
|
units (`type="money"`), a phone number with a country picker (`type="phone"`) or a GSTIN / ABN (`type="tax-id"`). A flat field on the panel: 1px Border/Primary, Radius/Medium,
|
|
6
6
|
a brand ring on focus, a red ring and placeholder when invalid, grey (Surface/Secondary) when read-only. Every Input
|
|
7
|
-
is 36 tall
|
|
7
|
+
is 36 tall; a one-line input can be the compact `size="sm"` (28). A one-line input takes icons, an inline `prefix` / `suffix`,
|
|
8
8
|
a boxed `addon`, `prefixSelect` / `suffixSelect` and a `shortcut`; read-only shows a copy button. With
|
|
9
9
|
`suggestions` it suggests values in a list while the user types (an autocomplete; the value stays free text). Inside
|
|
10
10
|
a `Field` it picks up the label, description and validation state.
|
|
@@ -19,7 +19,7 @@ The Dodo Nest Input. Lets the merchant type a value: one line (text, search, URL
|
|
|
19
19
|
(`type="textarea"`), a list of chips (`type="chips"`, typed, or picked from `suggestions`), an amount in minor
|
|
20
20
|
units (`type="money"`), a phone number with a country picker (`type="phone"`) or a GSTIN / ABN (`type="tax-id"`). A flat field on the panel: 1px Border/Primary, Radius/Medium,
|
|
21
21
|
a brand ring on focus, a red ring and placeholder when invalid, grey (Surface/Secondary) when read-only. Every Input
|
|
22
|
-
is 36 tall
|
|
22
|
+
is 36 tall; a one-line input can be the compact `size="sm"` (28). A one-line input takes icons, an inline `prefix` / `suffix`,
|
|
23
23
|
a boxed `addon`, `prefixSelect` / `suffixSelect` and a `shortcut`; read-only shows a copy button. With
|
|
24
24
|
`suggestions` it suggests values in a list while the user types (an autocomplete; the value stays free text). Inside
|
|
25
25
|
a `Field` it picks up the label, description and validation state.
|
|
@@ -219,6 +219,47 @@ export default function InputAsyncSuggestions() {
|
|
|
219
219
|
}
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
+
### input/compact
|
|
223
|
+
|
|
224
|
+
```tsx
|
|
225
|
+
"use client";
|
|
226
|
+
|
|
227
|
+
import { Button } from "@dodopayments/ui/button";
|
|
228
|
+
import { MagnifierIcon } from "@dodopayments/ui/icons";
|
|
229
|
+
import { Input } from "@dodopayments/ui/input";
|
|
230
|
+
import { Select, SelectContent, SelectTrigger, SelectValue } from "@dodopayments/ui/select";
|
|
231
|
+
|
|
232
|
+
const STATUSES = [
|
|
233
|
+
{ value: "all", label: "All statuses" },
|
|
234
|
+
{ value: "succeeded", label: "Succeeded" },
|
|
235
|
+
{ value: "failed", label: "Failed" },
|
|
236
|
+
];
|
|
237
|
+
|
|
238
|
+
export default function InputCompact() {
|
|
239
|
+
return (
|
|
240
|
+
<div className="flex w-full max-w-xl flex-wrap items-center gap-2">
|
|
241
|
+
<Input
|
|
242
|
+
size="sm"
|
|
243
|
+
type="search"
|
|
244
|
+
aria-label="Search payments"
|
|
245
|
+
placeholder="Search payments"
|
|
246
|
+
leadingIcon={<MagnifierIcon />}
|
|
247
|
+
className="min-w-40 flex-1"
|
|
248
|
+
/>
|
|
249
|
+
<Select items={STATUSES} defaultValue="all">
|
|
250
|
+
<SelectTrigger size="sm" aria-label="Status" className="w-40">
|
|
251
|
+
<SelectValue />
|
|
252
|
+
</SelectTrigger>
|
|
253
|
+
<SelectContent />
|
|
254
|
+
</Select>
|
|
255
|
+
<Button size="sm" variant="secondary">
|
|
256
|
+
Reset
|
|
257
|
+
</Button>
|
|
258
|
+
</div>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
222
263
|
### input/country-lookup
|
|
223
264
|
|
|
224
265
|
```tsx
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Invoice Document
|
|
2
|
+
|
|
3
|
+
An invoice as its PDF prints, ported from the dashboard's invoice preview: A4 at 72 dpi (595 wide,
|
|
4
|
+
at least 842 tall) with the title, status and merchant on a grey strip, the parties, the amount due,
|
|
5
|
+
the details, the lines and the totals, then Dodo's footer. It always draws light, as the PDF does.
|
|
6
|
+
Put it in a `ScaledFrame` with `width={595}` to fit it to a column.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { InvoiceDocument, InvoiceOnlinePage } from "@dodopayments/ui/invoice-document";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## InvoiceDocument
|
|
13
|
+
|
|
14
|
+
An invoice as its PDF prints, ported from the dashboard's invoice preview: A4 at 72 dpi (595 wide,
|
|
15
|
+
at least 842 tall) with the title, status and merchant on a grey strip, the parties, the amount due,
|
|
16
|
+
the details, the lines and the totals, then Dodo's footer. It always draws light, as the PDF does.
|
|
17
|
+
Put it in a `ScaledFrame` with `width={595}` to fit it to a column.
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Description |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| `customer` (required) | `InvoiceDocumentCustomer` | - | |
|
|
22
|
+
| `details` (required) | `readonly [readonly InvoiceDocumentFact[], readonly InvoiceDocumentFact[]]` | - | Invoice details in two columns: the number (and payment), then the date and currency. |
|
|
23
|
+
| `footer` (required) | `{ disclaimer: ReactNode; copyright: ReactNode; }` | - | The disclaimer and copyright in the footer. |
|
|
24
|
+
| `headline` (required) | `ReactNode` | - | The amount line above the details, e.g. "$40.00 due on Nov 26, 2026". |
|
|
25
|
+
| `issuer` (required) | `InvoiceDocumentIssuer` | - | |
|
|
26
|
+
| `merchant` (required) | `InvoiceDocumentMerchant` | - | |
|
|
27
|
+
| `rows` (required) | `readonly InvoiceDocumentRow[]` | - | |
|
|
28
|
+
| `status` (required) | `{ label: ReactNode; tone: "success" \| "error" \| "neutral"; }` | - | The status pill beside the title, e.g. Unpaid in red or Paid in green. |
|
|
29
|
+
| `totals` (required) | `readonly InvoiceDocumentTotal[]` | - | |
|
|
30
|
+
| `discount` | `{ label: ReactNode; amount: ReactNode; }` | - | The discount row under the lines, e.g. "Discounts Applied “WELCOME10”" and its amount. |
|
|
31
|
+
| `labels` | `Partial<InvoiceDocumentLabels>` | - | |
|
|
32
|
+
| `payOnline` | `ReactNode` | - | The "Pay Online" link text under the headline. Leave it out on a paid invoice. |
|
|
33
|
+
|
|
34
|
+
## InvoiceOnlinePage
|
|
35
|
+
|
|
36
|
+
The invoice email or the hosted invoice page, ported from the dashboard's invoice preview: the
|
|
37
|
+
merchant over a 480-wide card with the amount due, the customer (email) or the parties (hosted), a
|
|
38
|
+
Pay button, the order summary and the contact line. It always draws light. Put it in a
|
|
39
|
+
`ScaledFrame` with `width={480}` to fit it to a column.
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default | Description |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| `amount` (required) | `ReactNode` | - | The amount due, large. |
|
|
44
|
+
| `due` (required) | `ReactNode` | - | The line under the amount, e.g. "Due Nov 26, 2026". |
|
|
45
|
+
| `merchant` (required) | `InvoiceDocumentMerchant` | - | |
|
|
46
|
+
| `rows` (required) | `readonly InvoiceOnlineRow[]` | - | |
|
|
47
|
+
| `supportEmail` (required) | `ReactNode` | - | The address after `labels.contact`. |
|
|
48
|
+
| `total` (required) | `{ label: ReactNode; value: ReactNode; }` | - | The last line of the summary, e.g. "Total Due" and its amount. |
|
|
49
|
+
| `variant` (required) | `"email" \| "hosted"` | - | `email` is the email the customer gets; `hosted` the page where they pay. |
|
|
50
|
+
| `customer` | `InvoiceDocumentCustomer` | - | Email only: the customer block, as on the PDF. |
|
|
51
|
+
| `discount` | `{ label: ReactNode; amount: ReactNode; }` | - | |
|
|
52
|
+
| `facts` | `readonly InvoiceDocumentFact[]` | - | Hosted page only: label / value lines such as "Invoice to :" and "From :". |
|
|
53
|
+
| `from` | `ReactNode` | - | The email's line above the amount, e.g. "Invoice from Acme". Email only. |
|
|
54
|
+
| `labels` | `Partial<InvoiceOnlineLabels>` | - | |
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
### invoice-document/online
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
"use client";
|
|
62
|
+
|
|
63
|
+
import { InvoiceOnlinePage } from "@dodopayments/ui/invoice-document";
|
|
64
|
+
import { ScaledFrame } from "@dodopayments/ui/scaled-frame";
|
|
65
|
+
|
|
66
|
+
const rows = [
|
|
67
|
+
{ amount: "$100.00 / mo", id: "plan", name: "Growth plan", quantity: "Qty : 1" },
|
|
68
|
+
{ amount: "$25.00", id: "seat", name: "Extra seat", quantity: "Qty : 1" },
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
export default function InvoiceDocumentOnline() {
|
|
72
|
+
return (
|
|
73
|
+
<div className="light grid w-full max-w-3xl gap-4 rounded-xl bg-muted px-4 py-8 sm:grid-cols-2">
|
|
74
|
+
<ScaledFrame width={480}>
|
|
75
|
+
<InvoiceOnlinePage
|
|
76
|
+
amount="$125.00"
|
|
77
|
+
customer={{ address: ["Berlin", "DE"], email: "ada@example.com", name: "Ada Lovelace" }}
|
|
78
|
+
due="Due Nov 16, 2026"
|
|
79
|
+
from="Invoice from Acme Labs"
|
|
80
|
+
merchant={{ name: "Acme Labs" }}
|
|
81
|
+
rows={rows}
|
|
82
|
+
supportEmail="support@dodopayments.com"
|
|
83
|
+
total={{ label: "Total Due", value: "$125.00" }}
|
|
84
|
+
variant="email"
|
|
85
|
+
/>
|
|
86
|
+
</ScaledFrame>
|
|
87
|
+
<ScaledFrame width={480}>
|
|
88
|
+
<InvoiceOnlinePage
|
|
89
|
+
amount="$125.00"
|
|
90
|
+
due="Due Nov 16, 2026"
|
|
91
|
+
facts={[
|
|
92
|
+
{ label: "Invoice to :", value: "Ada Lovelace" },
|
|
93
|
+
{ label: "From :", value: "Acme Labs" },
|
|
94
|
+
{ label: "Invoice Number :", value: "inv_0NrmhsTUbGRG" },
|
|
95
|
+
]}
|
|
96
|
+
merchant={{ name: "Acme Labs" }}
|
|
97
|
+
rows={rows}
|
|
98
|
+
supportEmail="support@dodopayments.com"
|
|
99
|
+
total={{ label: "Total Due", value: "$125.00" }}
|
|
100
|
+
variant="hosted"
|
|
101
|
+
/>
|
|
102
|
+
</ScaledFrame>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### invoice-document/pdf
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
"use client";
|
|
112
|
+
|
|
113
|
+
import { InvoiceDocument } from "@dodopayments/ui/invoice-document";
|
|
114
|
+
import { ScaledFrame } from "@dodopayments/ui/scaled-frame";
|
|
115
|
+
|
|
116
|
+
export default function InvoiceDocumentPdf() {
|
|
117
|
+
return (
|
|
118
|
+
<div className="w-full max-w-xl">
|
|
119
|
+
<ScaledFrame width={595}>
|
|
120
|
+
<InvoiceDocument
|
|
121
|
+
customer={{
|
|
122
|
+
address: ["Main St 1, Berlin, 10115", "DE"],
|
|
123
|
+
email: "ada@example.com",
|
|
124
|
+
name: "Ada Lovelace",
|
|
125
|
+
}}
|
|
126
|
+
details={[
|
|
127
|
+
[{ label: "Invoice Number :", value: "inv_0NrmhsTUbGRG" }],
|
|
128
|
+
[
|
|
129
|
+
{ label: "Invoice Date :", value: "Nov 2, 2026" },
|
|
130
|
+
{ label: "Currency Code :", value: "USD" },
|
|
131
|
+
],
|
|
132
|
+
]}
|
|
133
|
+
discount={{ amount: "$10.00", label: "Discounts Applied “WELCOME10”" }}
|
|
134
|
+
footer={{
|
|
135
|
+
copyright: "© 2026 Dodo Payments Inc. All rights reserved.",
|
|
136
|
+
disclaimer:
|
|
137
|
+
"If you have a problem with your order (example: don’t recognize the charge, suspect a fraudulent transaction, etc,) please visit dodopayments.com",
|
|
138
|
+
}}
|
|
139
|
+
headline="$115.00 due on Nov 16, 2026"
|
|
140
|
+
issuer={{
|
|
141
|
+
address: "8 The Green, STE A, Dover, Country of Kent, Delaware, 19901 United States",
|
|
142
|
+
name: "Dodo Payments Inc",
|
|
143
|
+
taxId: "993486577",
|
|
144
|
+
}}
|
|
145
|
+
merchant={{ name: "Acme Labs" }}
|
|
146
|
+
payOnline="Pay Online"
|
|
147
|
+
rows={[
|
|
148
|
+
{
|
|
149
|
+
amount: "$100.00",
|
|
150
|
+
details: ["Nov 2 - Dec 2, 2026"],
|
|
151
|
+
id: "plan",
|
|
152
|
+
name: "Growth plan",
|
|
153
|
+
quantity: 1,
|
|
154
|
+
tax: "$0.00",
|
|
155
|
+
taxPercent: "-",
|
|
156
|
+
unitPrice: "$100.00 / mo",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
addOn: true,
|
|
160
|
+
amount: "$25.00",
|
|
161
|
+
id: "seat",
|
|
162
|
+
name: "Extra seat",
|
|
163
|
+
quantity: 1,
|
|
164
|
+
tax: "$0.00",
|
|
165
|
+
taxPercent: "-",
|
|
166
|
+
unitPrice: "$25.00",
|
|
167
|
+
},
|
|
168
|
+
]}
|
|
169
|
+
status={{ label: "Unpaid", tone: "error" }}
|
|
170
|
+
totals={[
|
|
171
|
+
{ label: "Subtotal", value: "$115.00" },
|
|
172
|
+
{ label: "Total Tax", value: "$0.00" },
|
|
173
|
+
{ label: "Total", value: "$115.00" },
|
|
174
|
+
{ label: "Amount Due", strong: true, value: "$115.00" },
|
|
175
|
+
]}
|
|
176
|
+
/>
|
|
177
|
+
</ScaledFrame>
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
@@ -71,7 +71,7 @@ the chart loads it draws the loading pulse or sweep.
|
|
|
71
71
|
| `onLoadingPulseCycleComplete` | `(() => void)` | - | Called when a loop-mode pulse cycle completes. |
|
|
72
72
|
| `showHighlight` | `boolean` | - | Whether to show highlight segment on hover. Default: true, false for `variant="comparison"` |
|
|
73
73
|
| `showMarkers` | `boolean` | - | Render scatter-style circle markers at each data point. Default: false |
|
|
74
|
-
| `stroke` | `string` | - | Stroke color. Default: var(--chart-1), or var(--chart-comparison) for `variant="comparison"` |
|
|
74
|
+
| `stroke` | `string` | - | Stroke color. Default: var(--chart-solid-1), or var(--chart-comparison) for `variant="comparison"` |
|
|
75
75
|
| `strokeWidth` | `number` | - | Stroke width. Default: 2 |
|
|
76
76
|
| `variant` | `"default" \| "comparison"` | - | `"default"` draws the metric as a solid line. `"comparison"` draws the period it is compared with (the previous period) as a dashed `--chart-comparison` line with no hover highlight, as the dashboard does. Default: `"default"`. |
|
|
77
77
|
| `yAxisId` | `string \| number` | - | Y-scale group id (Recharts `yAxisId`). Default: `"left"`. |
|
|
@@ -381,7 +381,7 @@ export default function LineChartDefault() {
|
|
|
381
381
|
title="Gross volume"
|
|
382
382
|
rows={(point) => [
|
|
383
383
|
{
|
|
384
|
-
color: "var(--chart-1)",
|
|
384
|
+
color: "var(--chart-solid-1)",
|
|
385
385
|
label: shortDate.format(point.date as Date),
|
|
386
386
|
value: money.format(point.current as number),
|
|
387
387
|
},
|
|
@@ -31,7 +31,7 @@ without animation.
|
|
|
31
31
|
| `onError` | `((error: unknown) => void)` | - | Called with the error when `onLoad` fails. |
|
|
32
32
|
| `rootMargin` | `string` | `"600px 0px"` | How far ahead of the viewport an automatic load starts (IntersectionObserver `rootMargin`). |
|
|
33
33
|
| `rootRef` | `RefObject<Element \| null>` | - | The scroll container to observe. Defaults to the viewport. |
|
|
34
|
-
| `size` | `"default" \| "icon" \| "xs" \| "lg" \| "icon-xs" \| "icon-lg" \| null` | - | |
|
|
34
|
+
| `size` | `"default" \| "sm" \| "icon" \| "xs" \| "lg" \| "icon-sm" \| "icon-xs" \| "icon-lg" \| null` | - | |
|
|
35
35
|
| `variant` | `"link" \| "default" \| "warning" \| "secondary" \| "ghost" \| "destructive" \| "wallet" \| "destructive-outline" \| null` | - | |
|
|
36
36
|
|
|
37
37
|
## useLoadMore
|
package/ai/components/logo.md
CHANGED
|
@@ -19,7 +19,7 @@ image named "Dodo Payments" unless `decorative` hides it from assistive technolo
|
|
|
19
19
|
| `aria-label` | `string` | `"Dodo Payments"` | Accessible name. An empty or whitespace-only value falls back to the default. |
|
|
20
20
|
| `className` | `string` | - | Layout utilities only: margin, position, inset and translate, z-index, display (`hidden`, `block`, `flex`, `inline-block`, `inline-flex`), visibility, order, self-alignment and grid placement, with any responsive or state variant. Every other class (padding, colour, size, opacity, filters) is dropped, and so is any class behind a `*:`, `**:` or arbitrary `[...]:` variant, so the clear space, colours and artwork size stay intact. |
|
|
21
21
|
| `decorative` | `boolean` | `false` | Hides the logo from assistive technology. Use it when visible text next to the logo already says "Dodo Payments". Cannot be combined with `aria-label`. |
|
|
22
|
-
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` | `
|
|
22
|
+
| `size` | `"2xs" \| "xs" \| "sm" \| "md" \| "lg"` | `"md"` | `2xs`: 12px tall artwork with 2px clear space on every side. Only for print-sized text, such as an invoice footer.<br>`xs`: 16px tall artwork with 4px clear space on every side. For a line of small text such as "Secure checkout by".<br>`sm`: 24px tall artwork with 6px clear space on every side.<br>`md`: 32px tall artwork with 8px clear space on every side.<br>`lg`: 48px tall artwork with 12px clear space on every side. |
|
|
23
23
|
| `tone` | `"auto" \| "light" \| "dark"` | `"auto"` | `auto`: Follows the theme: near-black wordmark in light mode, white under `.dark`.<br>`light`: Near-black wordmark in every theme, for surfaces that stay light (a white card, a light photo).<br>`dark`: White wordmark in every theme, for surfaces that stay dark (a black share card, a dark photo). |
|
|
24
24
|
| `variant` | `"lockup" \| "mark" \| "wordmark"` | `"lockup"` | `lockup`: Mark and wordmark side by side. The default for headers, sign-in screens and footers.<br>`mark`: The lime disc with the dodo on its own, for tight spaces such as a collapsed sidebar or an avatar.<br>`wordmark`: The "Dodo Payments" lettering without the mark. Use it only when the mark is already visible nearby. |
|
|
25
25
|
|
package/ai/components/menu.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Menu
|
|
2
2
|
|
|
3
3
|
The floating list of actions (the `MenuPopup` primitive: portal + positioner + popup): Surface/Overlay,
|
|
4
|
-
Radius/Large, 160 to 320 wide, scrolls past 320 tall.
|
|
5
|
-
full width, with the same items. Holds `MenuItem`, `MenuLinkItem`, `MenuCheckboxItem`, `MenuRadioGroup`,
|
|
4
|
+
Radius/Large, 160 to 320 wide, scrolls past 320 tall. With `mobileSheet` it opens below 640px as a bottom sheet
|
|
5
|
+
over a scrim, full width, with the same items. Holds `MenuItem`, `MenuLinkItem`, `MenuCheckboxItem`, `MenuRadioGroup`,
|
|
6
6
|
`MenuGroup`, `MenuSeparator` and `MenuSub`.
|
|
7
7
|
|
|
8
8
|
```tsx
|
|
@@ -12,8 +12,8 @@ import { MenuContent, Menu, MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuIte
|
|
|
12
12
|
## MenuContent
|
|
13
13
|
|
|
14
14
|
The floating list of actions (the `MenuPopup` primitive: portal + positioner + popup): Surface/Overlay,
|
|
15
|
-
Radius/Large, 160 to 320 wide, scrolls past 320 tall.
|
|
16
|
-
full width, with the same items. Holds `MenuItem`, `MenuLinkItem`, `MenuCheckboxItem`, `MenuRadioGroup`,
|
|
15
|
+
Radius/Large, 160 to 320 wide, scrolls past 320 tall. With `mobileSheet` it opens below 640px as a bottom sheet
|
|
16
|
+
over a scrim, full width, with the same items. Holds `MenuItem`, `MenuLinkItem`, `MenuCheckboxItem`, `MenuRadioGroup`,
|
|
17
17
|
`MenuGroup`, `MenuSeparator` and `MenuSub`.
|
|
18
18
|
|
|
19
19
|
| Prop | Type | Default | Description |
|
|
@@ -23,7 +23,7 @@ full width, with the same items. Holds `MenuItem`, `MenuLinkItem`, `MenuCheckbox
|
|
|
23
23
|
| `anchor` | `Element \| VirtualElement \| RefObject<Element \| null> \| (() => Element \| VirtualElement \| null) \| null` | - | Element to position against instead of the trigger. |
|
|
24
24
|
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
25
25
|
| `collisionAvoidance` | `CollisionAvoidance` | - | How the menu avoids the viewport edges (flip, shift); `{ side: "none", align: "none" }` keeps it in place. |
|
|
26
|
-
| `mobileSheet` | `boolean` | `
|
|
26
|
+
| `mobileSheet` | `boolean` | `false` | Below 640px, open the menu as a bottom sheet over a scrim, full width (Figma Menu › Responsive). Off by default: the menu stays a popover on its trigger at every width. |
|
|
27
27
|
| `portalProps` | `MenuPortalProps` | - | Props of the portal, e.g. `container` to render the menu inside an element. |
|
|
28
28
|
| `positionMethod` | `"fixed" \| "absolute"` | - | How the popup is positioned: `fixed` to the viewport (default) or `absolute` inside its portal container. |
|
|
29
29
|
| `positionerStyle` | `CSSProperties` | - | Style of the positioner, applied over the computed position: e.g. `{ position: "relative", transform: "none" }` lays a menu that is always open into the page flow (as the docs show one). |
|
|
@@ -142,18 +142,19 @@ Also accepts Base UI props: `actionsRef`, `closeParentOnEsc`, `defaultOpen`, `di
|
|
|
142
142
|
|
|
143
143
|
## MenuSubContent
|
|
144
144
|
|
|
145
|
-
The nested list. Opens beside its `MenuSubTrigger`, aligned with the trigger row.
|
|
146
|
-
sheet over its parent, with a Back row (`backLabel`)
|
|
145
|
+
The nested list. Opens beside its `MenuSubTrigger`, aligned with the trigger row. With `mobileSheet` (set it on the
|
|
146
|
+
parent `MenuContent` too) it opens below 640px as a bottom sheet over its parent, with a Back row (`backLabel`)
|
|
147
|
+
that closes only the submenu.
|
|
147
148
|
|
|
148
149
|
| Prop | Type | Default | Description |
|
|
149
150
|
| --- | --- | --- | --- |
|
|
150
151
|
| `align` | `Align` | `"center" (submenus `"start"`)` | Alignment against the trigger. |
|
|
151
152
|
| `alignOffset` | `number` | - | Offset along the alignment axis in px. |
|
|
152
153
|
| `anchor` | `Element \| VirtualElement \| RefObject<Element \| null> \| (() => Element \| VirtualElement \| null) \| null` | - | Element to position against instead of the trigger. |
|
|
153
|
-
| `backLabel` | `string` | - | Text of the row that returns to the parent menu.
|
|
154
|
+
| `backLabel` | `string` | - | Text of the row that returns to the parent menu. With `mobileSheet`, the submenu opens below 640px as a bottom sheet over its parent and starts with this row. Defaults to the `back` message of the `LocaleProvider` ("Back" in English). |
|
|
154
155
|
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
155
156
|
| `collisionAvoidance` | `CollisionAvoidance` | - | How the menu avoids the viewport edges (flip, shift); `{ side: "none", align: "none" }` keeps it in place. |
|
|
156
|
-
| `mobileSheet` | `boolean` | `
|
|
157
|
+
| `mobileSheet` | `boolean` | `false` | Below 640px, open the menu as a bottom sheet over a scrim, full width (Figma Menu › Responsive). Off by default: the menu stays a popover on its trigger at every width. |
|
|
157
158
|
| `portalProps` | `MenuPortalProps` | - | Props of the portal, e.g. `container` to render the menu inside an element. |
|
|
158
159
|
| `positionMethod` | `"fixed" \| "absolute"` | - | How the popup is positioned: `fixed` to the viewport (default) or `absolute` inside its portal container. |
|
|
159
160
|
| `positionerStyle` | `CSSProperties` | - | Style of the positioner, applied over the computed position: e.g. `{ position: "relative", transform: "none" }` lays a menu that is always open into the page flow (as the docs show one). |
|
|
@@ -122,7 +122,7 @@ export default function MilestoneCelebration() {
|
|
|
122
122
|
const [open, setOpen] = useState(true);
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
|
-
<div className="flex flex-col items-center gap-6">
|
|
125
|
+
<div className="flex w-full flex-col items-center gap-6">
|
|
126
126
|
<SegmentedControl
|
|
127
127
|
aria-label="Milestone category"
|
|
128
128
|
value={category}
|
package/ai/components/money.md
CHANGED
|
@@ -59,7 +59,7 @@ const rows = [
|
|
|
59
59
|
|
|
60
60
|
export default function MoneyBasic() {
|
|
61
61
|
return (
|
|
62
|
-
<ul className="flex w-full max-w-sm flex-col divide-y divide-border text-
|
|
62
|
+
<ul className="flex w-full max-w-sm flex-col divide-y divide-border text-body-primary">
|
|
63
63
|
{rows.map((row) => (
|
|
64
64
|
<li key={row.label} className="flex items-baseline justify-between gap-4 py-2">
|
|
65
65
|
<span className="text-muted-foreground">{row.label}</span>
|
|
@@ -68,13 +68,13 @@ export default function MoneyBasic() {
|
|
|
68
68
|
currency={row.currency}
|
|
69
69
|
locale={"locale" in row ? row.locale : undefined}
|
|
70
70
|
display={"display" in row ? row.display : undefined}
|
|
71
|
-
className="
|
|
71
|
+
className="text-label-primary"
|
|
72
72
|
/>
|
|
73
73
|
</li>
|
|
74
74
|
))}
|
|
75
75
|
<li className="flex items-baseline justify-between gap-4 py-2">
|
|
76
76
|
<span className="text-muted-foreground">Failed charge</span>
|
|
77
|
-
<Money minor={8900} currency="USD" status="failed" className="
|
|
77
|
+
<Money minor={8900} currency="USD" status="failed" className="text-label-primary" />
|
|
78
78
|
</li>
|
|
79
79
|
</ul>
|
|
80
80
|
);
|
|
@@ -26,7 +26,7 @@ With reduced motion it only fades.
|
|
|
26
26
|
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
27
27
|
| `formatLabel` | `((count: number) => string)` | `(count) => `${count} new items`` | Builds the text from the count. |
|
|
28
28
|
| `max` | `number` | `99` | Counts above this show as `${max}+`. |
|
|
29
|
-
| `size` | `"default" \| "icon" \| "xs" \| "lg" \| "icon-xs" \| "icon-lg" \| null` | - | |
|
|
29
|
+
| `size` | `"default" \| "sm" \| "icon" \| "xs" \| "lg" \| "icon-sm" \| "icon-xs" \| "icon-lg" \| null` | - | |
|
|
30
30
|
| `variant` | `"link" \| "default" \| "warning" \| "secondary" \| "ghost" \| "destructive" \| "wallet" \| "destructive-outline" \| null` | - | |
|
|
31
31
|
|
|
32
32
|
## useNewItems
|
|
@@ -18,7 +18,7 @@ after the brand unless `decorative`. Each logo loads on first use; until then it
|
|
|
18
18
|
|
|
19
19
|
| Prop | Type | Default | Description |
|
|
20
20
|
| --- | --- | --- | --- |
|
|
21
|
-
| `brand` (required) | `"card" \| "visa" \| "mastercard" \| "amex" \| "discover" \| "diners" \| "jcb" \| "unionpay" \| "maestro" \| "rupay" \| "cartes-bancaires" \| "apple-pay" \| "gpay" \| "amazon-pay" \| "cash-app" \| "paypal" \| "revolut-pay" \| "satispay" \| "wechat-pay" \| "alipay-hk" \| "kakao-pay" \| "naver-pay" \| "payco" \| "gcash" \| "touch-n-go" \| "twint" \| "bizum" \| "upi" \| "ideal" \| "bancontact" \| "eps" \| "multibanco" \| "pix" \| "blik" \| "przelewy24" \| "fps" \| "ach" \| "sepa" \| "bacs" \| "klarna" \| "afterpay" \| "affirm" \| "zip" \| "billie" \| "stablecoins" \| "unknown"` | - | The payment method. `unknown` draws a credit card icon for methods without artwork. |
|
|
21
|
+
| `brand` (required) | `"link" \| "card" \| "visa" \| "mastercard" \| "amex" \| "discover" \| "diners" \| "jcb" \| "unionpay" \| "maestro" \| "rupay" \| "cartes-bancaires" \| "apple-pay" \| "gpay" \| "amazon-pay" \| "cash-app" \| "paypal" \| "revolut-pay" \| "satispay" \| "wechat-pay" \| "alipay-hk" \| "kakao-pay" \| "naver-pay" \| "payco" \| "gcash" \| "touch-n-go" \| "twint" \| "bizum" \| "upi" \| "ideal" \| "bancontact" \| "eps" \| "multibanco" \| "pix" \| "blik" \| "przelewy24" \| "fps" \| "ach" \| "sepa" \| "bacs" \| "klarna" \| "afterpay" \| "affirm" \| "zip" \| "billie" \| "stablecoins" \| "unknown"` | - | The payment method. `unknown` draws a credit card icon for methods without artwork. |
|
|
22
22
|
| `decorative` | `boolean` | - | Hide from assistive technology when the text next to it already names the method. |
|
|
23
23
|
|
|
24
24
|
## Flag
|
|
@@ -56,7 +56,7 @@ fade. The hover index drives `PieCenter` and a linked `Legend`.
|
|
|
56
56
|
| `hoverEffect` | `PieSliceHoverEffect` | - | Hover effect type. Default: "translate" - "translate": Slice moves outward along its radial axis - "grow": Slice extends its outer radius (gets longer) - "none": No hover animation |
|
|
57
57
|
| `hoverOffset` | `number` | - | Distance in pixels for hover effect (translate distance or grow amount). Defaults to PieChart's hoverOffset |
|
|
58
58
|
| `showGlow` | `boolean` | - | Show glow effect on hover. Default: true |
|
|
59
|
-
| `variant` | `"tint" \| "solid"` | - | `"
|
|
59
|
+
| `variant` | `"tint" \| "solid"` | - | `"solid"`: the full colour, as the bars. `"tint"`: an opaque 20% wash of the colour (mixed into the card) with a solid 3px arc on the outer rim. A gradient or pattern `fill` stays solid. Default: "solid" |
|
|
60
60
|
|
|
61
61
|
## PieCenter
|
|
62
62
|
|
|
@@ -193,11 +193,20 @@ const revenue: PieData[] = [
|
|
|
193
193
|
const total = revenue.reduce((sum, row) => sum + row.value, 0);
|
|
194
194
|
const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 });
|
|
195
195
|
|
|
196
|
+
// The pie's default slice colours, in order: the bars' solid series, then the chart palette.
|
|
197
|
+
const sliceColors = [
|
|
198
|
+
"var(--chart-solid-1)",
|
|
199
|
+
"var(--chart-solid-2)",
|
|
200
|
+
"var(--chart-solid-3)",
|
|
201
|
+
"var(--chart-4)",
|
|
202
|
+
"var(--chart-5)",
|
|
203
|
+
];
|
|
204
|
+
|
|
196
205
|
const legendItems: LegendItemData[] = revenue.map((row, index) => ({
|
|
197
206
|
label: row.label,
|
|
198
207
|
value: row.value,
|
|
199
208
|
maxValue: total,
|
|
200
|
-
color:
|
|
209
|
+
color: sliceColors[index % sliceColors.length] ?? "var(--chart-solid-1)",
|
|
201
210
|
}));
|
|
202
211
|
|
|
203
212
|
export default function PieChartDonut() {
|
package/ai/components/popover.md
CHANGED
|
@@ -24,6 +24,7 @@ name. It rises from the trigger side as it opens.
|
|
|
24
24
|
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
25
25
|
| `collisionAvoidance` | `CollisionAvoidance` | - | How the popover avoids the viewport edges (Base UI). Pass `{ side: "none" }` to never flip. |
|
|
26
26
|
| `collisionPadding` | `Padding` | `5` | Space in px to keep between the popover and the edges of the viewport. When the popover does not fit on `side`, it flips to the opposite side and then shifts along the edge. |
|
|
27
|
+
| `mobileSheet` | `boolean` | `false` | Below 640px, open as a bottom sheet over a scrim, full width, as Menu and Select can. Off by default: turn it on for a panel without text fields (notifications, a list of choices). A sheet sits at the bottom edge, where the software keyboard would cover a field; for a form on a phone, use a `Dialog` or a `Drawer`. |
|
|
27
28
|
| `portalProps` | `PopoverPortalProps` | - | Props of the portal, e.g. `container` to render the popover inside an element. |
|
|
28
29
|
| `positionMethod` | `"fixed" \| "absolute"` | - | How the popover is positioned: `absolute` (default) or `fixed` (Base UI). |
|
|
29
30
|
| `side` | `Side` | `"bottom"` | |
|
|
@@ -253,7 +254,7 @@ export default function PopoverNotifications() {
|
|
|
253
254
|
>
|
|
254
255
|
<BellIcon aria-hidden="true" />
|
|
255
256
|
</PopoverTrigger>
|
|
256
|
-
<PopoverContent size="lg">
|
|
257
|
+
<PopoverContent size="lg" mobileSheet>
|
|
257
258
|
<PopoverHeader
|
|
258
259
|
actions={
|
|
259
260
|
<>
|
|
@@ -29,6 +29,7 @@ move without animation.
|
|
|
29
29
|
| `value` (required) | `readonly T[]` | - | The items in their current order. |
|
|
30
30
|
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
31
31
|
| `disabled` | `boolean` | - | Turns off dragging and keyboard moves. |
|
|
32
|
+
| `interactive` | `boolean` | - | Rows hold their own controls, such as a switch or a menu. Their content stays readable by assistive technology, a key pressed on a control does not grab the row, and a row drags only from its handle, so a click on a control never starts a drag. |
|
|
32
33
|
| `onValueCommitted` | `((next: T[]) => void)` | - | Called with the final order when a drag or a keyboard move ends. |
|
|
33
34
|
|
|
34
35
|
## useReorderList
|
|
@@ -90,7 +91,7 @@ export default function ReorderListBasic() {
|
|
|
90
91
|
>
|
|
91
92
|
{(m) => (
|
|
92
93
|
<div className="flex items-center justify-between gap-3">
|
|
93
|
-
<span className="
|
|
94
|
+
<span className="text-label-primary">{m.name}</span>
|
|
94
95
|
<span className="truncate text-body-secondary text-muted-foreground">{m.detail}</span>
|
|
95
96
|
</div>
|
|
96
97
|
)}
|
|
@@ -144,3 +145,47 @@ export default function ReorderListCommit() {
|
|
|
144
145
|
}
|
|
145
146
|
```
|
|
146
147
|
|
|
148
|
+
### reorder-list/interactive
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
"use client";
|
|
152
|
+
|
|
153
|
+
import { ReorderList } from "@dodopayments/ui/reorder-list";
|
|
154
|
+
import { Switch } from "@dodopayments/ui/switch";
|
|
155
|
+
import { useState } from "react";
|
|
156
|
+
|
|
157
|
+
const PLANS = [
|
|
158
|
+
{ id: "monthly", name: "Pro monthly", on: true },
|
|
159
|
+
{ id: "annual", name: "Pro annual", on: true },
|
|
160
|
+
{ id: "lifetime", name: "Lifetime", on: false },
|
|
161
|
+
];
|
|
162
|
+
|
|
163
|
+
export default function ReorderListInteractive() {
|
|
164
|
+
const [plans, setPlans] = useState(PLANS);
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<ReorderList
|
|
168
|
+
aria-label="Plans at checkout"
|
|
169
|
+
className="max-w-sm"
|
|
170
|
+
interactive
|
|
171
|
+
value={plans}
|
|
172
|
+
getKey={(p) => p.id}
|
|
173
|
+
getLabel={(p) => p.name}
|
|
174
|
+
onValueChange={setPlans}
|
|
175
|
+
>
|
|
176
|
+
{(p) => (
|
|
177
|
+
<label className="flex items-center justify-between gap-3">
|
|
178
|
+
<span className="text-label-primary">{p.name}</span>
|
|
179
|
+
<Switch
|
|
180
|
+
checked={p.on}
|
|
181
|
+
onCheckedChange={(on) => {
|
|
182
|
+
setPlans((all) => all.map((x) => (x.id === p.id ? { ...x, on } : x)));
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
</label>
|
|
186
|
+
)}
|
|
187
|
+
</ReorderList>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
@@ -42,9 +42,9 @@ loads. Without `size` the chart is a square as wide as its container. Link a `Le
|
|
|
42
42
|
|
|
43
43
|
## Ring
|
|
44
44
|
|
|
45
|
-
One ring of a `RingChart`: a grey track and a progress arc for the data row at `index` (by default a
|
|
46
|
-
track and a
|
|
47
|
-
|
|
45
|
+
One ring of a `RingChart`: a grey track and a progress arc for the data row at `index` (by default a `--border`
|
|
46
|
+
track and a solid arc, as the bars; `variant="tint"` for a light `--muted` track and a 25% wash of the ring's colour
|
|
47
|
+
with a solid end cap). The
|
|
48
48
|
track scales in, then the arc fills. On hover the ring grows a little, the outer rings move out and
|
|
49
49
|
the other rings fade; the hover index drives `RingCenter` and a linked `Legend`.
|
|
50
50
|
|
|
@@ -52,10 +52,10 @@ the other rings fade; the hover index drives `RingCenter` and a linked `Legend`.
|
|
|
52
52
|
| --- | --- | --- | --- |
|
|
53
53
|
| `index` (required) | `number` | - | Index of the ring in the `RingChart` data, 0 = innermost. |
|
|
54
54
|
| `animate` | `boolean` | - | Animate the ring on mount. Default: true |
|
|
55
|
-
| `color` | `string` | - | Color override. Falls back to the row's `color`, then to `--chart-1..5`. |
|
|
55
|
+
| `color` | `string` | - | Color override. Falls back to the row's `color`, then to `--chart-solid-1..3` and `--chart-4..5`. |
|
|
56
56
|
| `lineCap` | `RingLineCap` | - | End cap of the progress arc (`variant="solid"`). Default: "round" |
|
|
57
57
|
| `showGlow` | `boolean` | - | Show a glow in the ring color on hover. Default: true |
|
|
58
|
-
| `variant` | `"tint" \| "solid"` | - | `"
|
|
58
|
+
| `variant` | `"tint" \| "solid"` | - | `"solid"`: a `--border` track and a solid arc, as the bars. `"tint"`: a light grey `--muted` track for what is not covered yet, the progress as a 25% wash of the ring's colour (mixed into the card) and a solid 3px cap where it ends. Default: "solid" |
|
|
59
59
|
|
|
60
60
|
## RingCenter
|
|
61
61
|
|
|
@@ -191,11 +191,20 @@ const countries: RingData[] = [
|
|
|
191
191
|
|
|
192
192
|
const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", notation: "compact" });
|
|
193
193
|
|
|
194
|
+
// The ring's default colours, in order: the bars' solid series, then the chart palette.
|
|
195
|
+
const ringColors = [
|
|
196
|
+
"var(--chart-solid-1)",
|
|
197
|
+
"var(--chart-solid-2)",
|
|
198
|
+
"var(--chart-solid-3)",
|
|
199
|
+
"var(--chart-4)",
|
|
200
|
+
"var(--chart-5)",
|
|
201
|
+
];
|
|
202
|
+
|
|
194
203
|
const legendItems: LegendItemData[] = countries.map((row, index) => ({
|
|
195
204
|
label: row.label,
|
|
196
205
|
value: row.value,
|
|
197
206
|
maxValue: row.maxValue,
|
|
198
|
-
color:
|
|
207
|
+
color: ringColors[index % ringColors.length] ?? "var(--chart-solid-1)",
|
|
199
208
|
}));
|
|
200
209
|
|
|
201
210
|
export default function RingChartLegend() {
|
|
@@ -224,11 +233,11 @@ export default function RingChartLegend() {
|
|
|
224
233
|
className="w-full max-w-64"
|
|
225
234
|
>
|
|
226
235
|
<LegendItem className="grid grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-1">
|
|
227
|
-
<LegendMarker
|
|
236
|
+
<LegendMarker />
|
|
228
237
|
<LegendLabel />
|
|
229
238
|
<LegendValue formatValue={(value) => usd.format(value)} showPercentage />
|
|
230
239
|
<div className="col-span-full">
|
|
231
|
-
<LegendProgress
|
|
240
|
+
<LegendProgress />
|
|
232
241
|
</div>
|
|
233
242
|
</LegendItem>
|
|
234
243
|
</Legend>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Sale share card
|
|
2
|
+
|
|
3
|
+
A new sale as an image to share (the dashboard's payments list, Share): 720 by 400, the artwork behind, the
|
|
4
|
+
business chip, a headline and the amount in the brand lime with a dark outline. Always light, whatever the theme,
|
|
5
|
+
so the saved picture looks the same. Capture this element at its own size, and preview it in a `ScaledFrame`.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SaleShareCard } from "@dodopayments/ui/sale-share-card";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## SaleShareCard
|
|
12
|
+
|
|
13
|
+
A new sale as an image to share (the dashboard's payments list, Share): 720 by 400, the artwork behind, the
|
|
14
|
+
business chip, a headline and the amount in the brand lime with a dark outline. Always light, whatever the theme,
|
|
15
|
+
so the saved picture looks the same. Capture this element at its own size, and preview it in a `ScaledFrame`.
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Default | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `amount` (required) | `string` | - | The sale, formatted, e.g. "$1,234.56". It shrinks to fit the card. |
|
|
20
|
+
| `background` (required) | `string` | - | The artwork behind the card, an image URL. Decorative. |
|
|
21
|
+
| `headline` (required) | `ReactNode` | - | The line above the amount, e.g. "Cha-ching! A new sale is in". |
|
|
22
|
+
| `business` | `SaleShareBusiness` | - | The business chip at the top. Leave it out when the merchant turns off "Include business and logo"; the card keeps its size so the shared image is always 720 by 400. |
|
|
23
|
+
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
### sale-share-card/master
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
"use client";
|
|
31
|
+
|
|
32
|
+
import { SaleShareCard } from "@dodopayments/ui/sale-share-card";
|
|
33
|
+
import { ScaledFrame } from "@dodopayments/ui/scaled-frame";
|
|
34
|
+
|
|
35
|
+
export default function SaleShareCardDemo() {
|
|
36
|
+
return (
|
|
37
|
+
<ScaledFrame width={720} height={400} className="max-w-180">
|
|
38
|
+
<SaleShareCard
|
|
39
|
+
amount="$1,234.56"
|
|
40
|
+
headline="Cha-ching! A new sale is in"
|
|
41
|
+
background="/samples/sale-share-lagoon.webp"
|
|
42
|
+
business={{ name: "Incubix" }}
|
|
43
|
+
/>
|
|
44
|
+
</ScaledFrame>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|