@dodopayments/ui 1.5.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 +912 -52
- package/ai/component-registry.md +4 -1
- package/ai/components/badge.md +24 -0
- package/ai/components/brand-logos.md +1 -1
- package/ai/components/button.md +24 -1
- package/ai/components/collapsible.md +1 -1
- package/ai/components/color-input.md +1 -1
- 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/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/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/new-items-pill.md +1 -1
- package/ai/components/payment-logos.md +1 -1
- package/ai/components/popover.md +2 -1
- package/ai/components/reorder-list.md +45 -0
- 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/tabs.md +39 -0
- package/ai/components/test-mode-banner.md +4 -1
- package/ai/components/timestamp.md +11 -2
- package/ai/components/timezone-select.md +1 -0
- package/ai/skills/dodo-design/SKILL.md +15 -6
- 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/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 +101 -11
- package/dist/components/data-grid/data-grid.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/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/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 -7
- 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/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/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/subscription-card/subscription-card.js +1 -1
- package/dist/components/subscription-card/subscription-card.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 +11 -1
- 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/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/gauge.js +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/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 +11 -0
- 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/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 +4 -3
- package/dist/primitives/ui/sheet.js.map +1 -1
- package/dist/primitives/ui/sidebar.js +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/styles/motion.test.tsx +15 -0
- package/dist/styles/theme.css +4 -0
- package/dist/styles/tokens.css +56 -13
- package/dist/styles/tokens.test.tsx +137 -4
- package/dist/theme/css.js +4 -4
- package/dist/theme/css.js.map +1 -1
- package/package.json +1 -1
package/ai/component-registry.md
CHANGED
|
@@ -40,12 +40,14 @@
|
|
|
40
40
|
- **Collapsible** (`@dodopayments/ui/collapsible`, Layout): Shows and hides a section of content: the `Collapsible` primitive on Base UI `Collapsible`. Compose it
|
|
41
41
|
- **Scaled frame** (`@dodopayments/ui/scaled-frame`, Layout): Shows content laid out at a fixed size, scaled down to the width the frame has, e.g. a live checkout
|
|
42
42
|
- **Dialog** (`@dodopayments/ui/dialog`, Overlays): The dialog (Dodo Nest Dialog): portal + scrim + a grey tray around a white panel, with the close button
|
|
43
|
+
- **Drawer** (`@dodopayments/ui/drawer`, Overlays): The drawer: portal + scrim + popup, docked to the bottom edge with a drag handle and a close button. A grey tray
|
|
43
44
|
- **Direction Provider** (`@dodopayments/ui/direction-provider`, Utilities): Sets the reading direction for every component inside: keyboard navigation (arrow keys in menus,
|
|
44
45
|
- **Empty** (`@dodopayments/ui/empty`, Feedback): What a page, card or table shows when there is nothing yet (Dodo Nest Empty state): an optional Featured icon
|
|
45
46
|
- **Field** (`@dodopayments/ui/field`, Forms): Groups a label, description, control and error message and wires them together: the label and
|
|
46
47
|
- **Form** (`@dodopayments/ui/form`, Forms): Native `<form>` (the `Form` primitive on Base UI `Form`) that validates the `Field`s inside it on submit.
|
|
47
48
|
- **Form field** (`@dodopayments/ui/form-field`, Forms): react-hook-form adapter for `Field`. Registers the field through RHF's `Controller` and renders
|
|
48
49
|
- **File Upload** (`@dodopayments/ui/file-upload`, Forms): Dropzone for picking files: click (or Enter / Space) opens the file picker, and files can be
|
|
50
|
+
- **Image Crop** (`@dodopayments/ui/image-crop`, Forms): Crops a picked image before it is uploaded, as the dashboard's image fields do (main's ImageUpload): the
|
|
49
51
|
- **Grid** (`@dodopayments/ui/grid`, Layout): Composite (the primitives have no Grid): layout only, on the Tailwind spacing scale.
|
|
50
52
|
- **Copyable ID** (`@dodopayments/ui/copyable-id`, Data display): An ID or secret the merchant can copy, in Geist Mono 12: the Dodo Nest Copyable ID. `inline` (default) for rails,
|
|
51
53
|
- **Money** (`@dodopayments/ui/money`, Data display): A formatted amount from integer minor units and an ISO 4217 code: the decimals follow the
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
- **Pagination** (`@dodopayments/ui/pagination`, Navigation): Moves through the rows of a table (Dodo Nest Pagination): an optional "Rows per page" select, the
|
|
65
67
|
- **App top bar** (`@dodopayments/ui/app-top-bar`, Navigation): The bar at the top of every dashboard page (Dodo Nest App top bar): search on the left (opens the Command
|
|
66
68
|
- **Radio Group** (`@dodopayments/ui/radio-group`, Forms): A set of mutually exclusive options: exactly one `Radio` can be selected. Built on the primitives
|
|
67
|
-
- **Select** (`@dodopayments/ui/select`, Forms): The field (Figma `container`) that opens the list: put a `SelectValue` inside.
|
|
69
|
+
- **Select** (`@dodopayments/ui/select`, Forms): The field (Figma `container`) that opens the list: put a `SelectValue` inside. 36 tall, or 28 with `size="sm"`; the caret turns up
|
|
68
70
|
- **Sheet** (`@dodopayments/ui/sheet`, Overlays): The sheet (Dodo Nest Sheet): portal + scrim + popup + close button, sliding in from the end of the reading
|
|
69
71
|
- **Sidebar** (`@dodopayments/ui/sidebar`, Navigation): The app sidebar (Dodo Nest Sidebar), on the `Sidebar` primitive. From 1024px it docks to the start edge (the
|
|
70
72
|
- **Skeleton** (`@dodopayments/ui/skeleton`, Feedback): A grey placeholder shown while content loads (Dodo Nest Skeleton), sized like the thing it replaces: `shape="line"`
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
- **Page header** (`@dodopayments/ui/page-header`, Navigation): The title row at the top of every dashboard page (Dodo Nest Page header). `size="sm"` shrinks the title and
|
|
101
103
|
- **Order Summary** (`@dodopayments/ui/order-summary`, Blocks): Checkout order summary, ported from the checkout and the customer portal: product rows
|
|
102
104
|
- **Details Panel** (`@dodopayments/ui/details-panel`, Blocks): Read-only facts of a record as labelled values grouped in sections, ported from the dashboard's
|
|
105
|
+
- **Invoice Document** (`@dodopayments/ui/invoice-document`, Blocks): An invoice as its PDF prints, ported from the dashboard's invoice preview: A4 at 72 dpi (595 wide,
|
|
103
106
|
- **Payment Result** (`@dodopayments/ui/payment-result`, Blocks): Receipt card for the page a customer lands on after paying, ported from the checkout status page:
|
|
104
107
|
- **Subscription Card** (`@dodopayments/ui/subscription-card`, Blocks): A customer's subscription in the customer portal: name, add-ons and business, the payment method in the top
|
|
105
108
|
- **Payment Method List** (`@dodopayments/ui/payment-method-list`, Blocks): Card listing saved payment methods or bank accounts, after the customer portal's payment methods
|
package/ai/components/badge.md
CHANGED
|
@@ -23,6 +23,7 @@ icon come from the status map, and a later status change swaps the label in with
|
|
|
23
23
|
| `labels` | `Readonly<Record<string, string \| undefined>>` | - | Labels keyed by raw status, e.g. translations: `{ succeeded: "Erfolgreich" }`. Only with `status`. |
|
|
24
24
|
| `layout` | `"default" \| "icon"` | `"default"` | `default`: Text pill, optionally with a status dot or a trailing icon.<br>`icon`: Square pill wrapping a single icon. |
|
|
25
25
|
| `leadingIcon` | `ReactNode` | - | An icon before the label (Figma "Show leading icon"), 12px, e.g. a clock on a session timer or a card on a payment method chip. Decorative: the label names the badge. Replaces the `dot`. |
|
|
26
|
+
| `size` | `"md" \| "sm"` | `"md"` | `md`: 22px tall, as in Figma. The default.<br>`sm`: 18px tall with 6px inline padding: a compact pill for a dense table row or next to `sm` controls. Not a Figma size. |
|
|
26
27
|
| `status` | `"succeeded" \| "failed" \| "cancelled" \| "expired" \| "processing" \| "requires_customer_action" \| "requires_payment_method" \| "requires_merchant_action" \| "requires_confirmation" \| "requires_capture" \| "partially_captured" \| "partially_captured_and_capturable" \| "active" \| "pending" \| "on_hold" \| "paused" \| "scheduled_for_cancellation" \| "review" \| "partial" \| "full" \| "pre_dispute" \| "dispute" \| "pre_arbitration" \| "dispute_opened" \| "dispute_expired" \| "dispute_accepted" \| "dispute_cancelled" \| "dispute_challenged" \| "dispute_won" \| "dispute_lost" \| (string & Record<never, never>) \| null` | - | Raw status from the Dodo Payments API, e.g. `succeeded`, `on_hold` or `partial`. Picks the tone and the label (`children` replaces the label, e.g. with a translation). Unknown statuses render neutral with a readable label; `null`, `""` and a passed `undefined` (`status={row.status}` with no status yet) render "No status". When it changes, the tone crossfades and the new label swaps in. |
|
|
27
28
|
| `tone` | `"neutral" \| "success" \| "warning" \| "error" \| "info" \| "orange" \| "pink" \| "violet"` | `"neutral"` | `neutral`: Neutral status or metadata (draft, test mode), and category labels in a table column.<br>`success`: Success states: paid, active, succeeded.<br>`warning`: Pending or attention states: processing, requires action, on hold.<br>`error`: Failure states: failed, declined, cancelled.<br>`info`: Informational states: scheduled, upcoming, in review.<br>`orange`: A category or highlight whose meaning the label already carries. Not a status.<br>`pink`: A category or highlight whose meaning the label already carries. Not a status.<br>`violet`: A category or highlight, such as a product or plan type. Not a status. |
|
|
28
29
|
| `trailingIcon` | `"info"` | - | An icon after the label. `info` is a circle-info icon; wrap the badge in a `Tooltip` to explain it. |
|
|
@@ -60,6 +61,29 @@ neutral tone, no icon and its prettified raw value.
|
|
|
60
61
|
|
|
61
62
|
## Examples
|
|
62
63
|
|
|
64
|
+
### badge/compact
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
"use client";
|
|
68
|
+
|
|
69
|
+
import { Badge } from "@dodopayments/ui/badge";
|
|
70
|
+
|
|
71
|
+
export default function BadgeCompact() {
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
<Badge size="sm" tone="success">
|
|
75
|
+
Active
|
|
76
|
+
</Badge>
|
|
77
|
+
<Badge size="sm" tone="warning" dot>
|
|
78
|
+
Past due
|
|
79
|
+
</Badge>
|
|
80
|
+
<Badge size="sm">Test mode</Badge>
|
|
81
|
+
<Badge tone="success">Active</Badge>
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
63
87
|
### badge/icon
|
|
64
88
|
|
|
65
89
|
```tsx
|
|
@@ -16,7 +16,7 @@ marks keep their brand colours.
|
|
|
16
16
|
|
|
17
17
|
| Prop | Type | Default | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
|
-
| `brand` (required) | `"meta" \| "github" \| "gitlab" \| "terraform" \| "vercel" \| "google-cloud" \| "aws" \| "kubernetes" \| "google-analytics" \| "google-tag-manager" \| "stripe" \| "adyen" \| "dodo-payments"` | - | Which brand's mark to draw. |
|
|
19
|
+
| `brand` (required) | `"meta" \| "github" \| "gitlab" \| "terraform" \| "vercel" \| "google-cloud" \| "aws" \| "kubernetes" \| "google-analytics" \| "google-tag-manager" \| "stripe" \| "adyen" \| "dodo-payments" \| "discord" \| "telegram" \| "notion" \| "framer" \| "figma"` | - | Which brand's mark to draw. |
|
|
20
20
|
| `label` | `string` | - | Names the mark for screen readers (`role="img"`). Leave it out when the brand's name is already next to the mark: the mark is then decorative. |
|
|
21
21
|
|
|
22
22
|
## Examples
|
package/ai/components/button.md
CHANGED
|
@@ -30,7 +30,7 @@ and announces it.
|
|
|
30
30
|
| `loadingText` | `ReactNode` | - | Label shown while `loading` or `progress` is set. Defaults to `children`. |
|
|
31
31
|
| `progress` | `number \| null` | - | Determinate progress (0-100). A fill sweeps across the button and the percentage is shown next to `loadingText`. `null`/`undefined` falls back to `loading`. |
|
|
32
32
|
| `result` | `"success" \| "error" \| null` | - | Outcome of the last action, after interior.dev's loading button. `"success"` swaps the label for a check and `successText`, `"error"` for a warning icon and `errorText`; `null` shows the label. The outcome is announced through a polite live region. Pass it (even `null`) on buttons that report an outcome, so every face shares one cell from the first render. Clear it yourself, e.g. after 1.4s. With `result`, `Button` renders the button and a sibling status element, so do not pass a `Button` with `result` as the `render` element of another component. |
|
|
33
|
-
| `size` | `"xs" \| "default" \| "lg" \| "icon" \| "icon-xs" \| "icon-lg"` | `"lg"` | `xs`: 28px tall (24px from `sm`), Figma `sm`: dense toolbars, strip actions and inline actions.<br>`default`: 36px tall (32px from `sm`): a compact control when a design asks for one. Not a Figma size; prefer `lg`.<br>`lg`: 40px tall (36px from `sm`), Figma `lg`, the default: page, form, dialog and card actions, next to an Input.<br>`icon`: Square icon-only button at the default height. Requires `aria-label`.<br>`icon-xs`: Square icon-only button at `xs` height. Requires `aria-label`.<br>`icon-lg`: Square icon-only button at `lg` height. Requires `aria-label`. |
|
|
33
|
+
| `size` | `"xs" \| "sm" \| "default" \| "lg" \| "icon" \| "icon-sm" \| "icon-xs" \| "icon-lg"` | `"lg"` | `xs`: 28px tall (24px from `sm`), Figma `sm`: dense toolbars, strip actions and inline actions.<br>`sm`: 32px tall (28px from `sm`): a compact action in a dense toolbar, a table filter row or next to an `sm` Input. Not a Figma size.<br>`default`: 36px tall (32px from `sm`): a compact control when a design asks for one. Not a Figma size; prefer `lg`.<br>`lg`: 40px tall (36px from `sm`), Figma `lg`, the default: page, form, dialog and card actions, next to an Input.<br>`icon`: Square icon-only button at the default height. Requires `aria-label`.<br>`icon-sm`: Square icon-only button at `sm` height. Requires `aria-label`.<br>`icon-xs`: Square icon-only button at `xs` height. Requires `aria-label`.<br>`icon-lg`: Square icon-only button at `lg` height. Requires `aria-label`. |
|
|
34
34
|
| `successText` | `ReactNode` | `"Done"` | Label shown while `result` is `"success"`. |
|
|
35
35
|
| `variant` | `"default" \| "secondary" \| "ghost" \| "destructive" \| "warning" \| "wallet" \| "destructive-outline" \| "link"` | `"default"` | `default`: Primary action (Figma Button primary): a dark gradient with white text, white in dark mode. Use it for the one main action of a view, form or dialog.<br>`secondary`: Tactile light button (Figma Button secondary). The default for most actions in forms, toolbars and dialogs.<br>`ghost`: No chrome until hover (Figma Button ghost). Use for icon buttons and dense UI.<br>`destructive`: Irreversible or dangerous actions such as delete or revoke (Figma Button destructive): a red gradient with white text.<br>`warning`: Confirms an action that needs attention but can be undone, such as pause (Figma Button warning): an amber gradient with white text.<br>`wallet`: Express checkout (Apple Pay, Google Pay): the wallet brands' black button, white in dark mode, holding the wallet's `WalletLogo` (20 tall). Name it with `aria-label` ("Pay with Apple Pay"). `WalletButtons` lays out a row of them.<br>`destructive-outline`: Bordered destructive action where a solid red button is too loud, e.g. in a row of actions.<br>`link`: Looks like an inline link (link colour, underlined; the underline turns solid on hover) but behaves as a button. |
|
|
36
36
|
|
|
@@ -55,6 +55,29 @@ export default function ButtonAsLink() {
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
### button/compact
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
"use client";
|
|
62
|
+
|
|
63
|
+
import { Button } from "@dodopayments/ui/button";
|
|
64
|
+
import { FilterIcon, PlusIcon } from "@dodopayments/ui/icons";
|
|
65
|
+
|
|
66
|
+
export default function ButtonCompact() {
|
|
67
|
+
return (
|
|
68
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
69
|
+
<Button size="sm" variant="secondary" icon={<FilterIcon aria-hidden />} iconPlacement="left">
|
|
70
|
+
Filter
|
|
71
|
+
</Button>
|
|
72
|
+
<Button size="sm">Export</Button>
|
|
73
|
+
<Button size="icon-sm" variant="secondary" aria-label="Add a column">
|
|
74
|
+
<PlusIcon />
|
|
75
|
+
</Button>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
58
81
|
### button/copy-with-text
|
|
59
82
|
|
|
60
83
|
```tsx
|
|
@@ -77,7 +77,7 @@ animation.
|
|
|
77
77
|
| `moreLabel` | `string` | `"Show more"` | Button text while collapsed. |
|
|
78
78
|
| `onOpenChange` | `((open: boolean) => void)` | - | Called with the next state when the user toggles it. |
|
|
79
79
|
| `open` | `boolean` | - | Whether the text is expanded. Pass it to control the component. |
|
|
80
|
-
| `size` | `"default" \| "icon" \| "xs" \| "lg" \| "icon-xs" \| "icon-lg" \| null` | - | |
|
|
80
|
+
| `size` | `"default" \| "sm" \| "icon" \| "xs" \| "lg" \| "icon-sm" \| "icon-xs" \| "icon-lg" \| null` | - | |
|
|
81
81
|
| `variant` | `"link" \| "default" \| "warning" \| "secondary" \| "ghost" \| "destructive" \| "wallet" \| "destructive-outline" \| null` | - | |
|
|
82
82
|
|
|
83
83
|
## useShowMore
|
|
@@ -24,7 +24,7 @@ picking black from empty fires no change: type it instead.
|
|
|
24
24
|
| `nativeInput` | `boolean` | - | |
|
|
25
25
|
| `onValueChange` | `((value: string) => void)` | - | Called with the typed text, or with the `#rrggbb` the native picker chose. |
|
|
26
26
|
| `pickerLabel` | `string` | - | Accessible name of the native colour picker behind the swatch. |
|
|
27
|
-
| `size` | `"lg"` | `"lg"` | Input height, as `Input` (`DODO_INPUT_VARIANTS`):
|
|
27
|
+
| `size` | `"sm" \| "lg"` | `"lg"` | Input height, as `Input` (`DODO_INPUT_VARIANTS`): `lg` 36 or the compact `sm` 28. |
|
|
28
28
|
| `unstyled` | `boolean` | - | |
|
|
29
29
|
|
|
30
30
|
Also accepts Base UI props: `render`.
|
|
@@ -36,6 +36,7 @@ field), with the search `ComboboxInput` inside the `ComboboxPopup`.
|
|
|
36
36
|
| `placeholder` | `string` | `"Select a country"` | Trigger text while nothing is selected. |
|
|
37
37
|
| `required` | `boolean` | - | |
|
|
38
38
|
| `searchPlaceholder` | `string` | `"Search countries"` | Placeholder and accessible name of the search input in the popup. |
|
|
39
|
+
| `size` | `"default" \| "sm"` | `"default"` | Trigger height: 36, or the compact 28 of `SelectTrigger` `size="sm"`. |
|
|
39
40
|
| `value` | `string \| null` | - | Selected ISO 3166-1 alpha-2 code (controlled). `null` clears the selection. |
|
|
40
41
|
|
|
41
42
|
## Examples
|
|
@@ -40,5 +40,6 @@ field), with the search `ComboboxInput` inside the `ComboboxPopup`.
|
|
|
40
40
|
| `placeholder` | `string` | `"Select a currency"` | Trigger text while nothing is selected. |
|
|
41
41
|
| `required` | `boolean` | - | |
|
|
42
42
|
| `searchPlaceholder` | `string` | `"Search currencies"` | Placeholder and accessible name of the search input in the popup. |
|
|
43
|
+
| `size` | `"default" \| "sm"` | `"default"` | Trigger height: 36, or the compact 28 of `SelectTrigger` `size="sm"`. |
|
|
43
44
|
| `value` | `string \| null` | - | Selected ISO 4217 code (controlled). `null` clears the selection. |
|
|
44
45
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,
|
|
4
4
|
the rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and
|
|
5
5
|
`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:
|
|
6
|
-
a table wider than its container scrolls sideways (the container is then a tab stop).
|
|
6
|
+
a table wider than its container scrolls sideways (the container is then a tab stop). For a phone, give the
|
|
7
|
+
less important columns `meta.priority` 2 or 3 so they hide while the table is narrow, and set `pinFirstColumn`
|
|
8
|
+
to keep the first column in view. It sets
|
|
7
9
|
`aria-sort` on sortable headers and marks selected rows `data-state="selected"`, tinted
|
|
8
10
|
Surface/Secondary as on hover. Sorting, selection and pagination stay in the table
|
|
9
11
|
instance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`
|
|
@@ -20,7 +22,9 @@ import { DataGrid, DataGridColumnHeader, DataGridPagination, DataGridRowSelect,
|
|
|
20
22
|
The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,
|
|
21
23
|
the rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and
|
|
22
24
|
`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:
|
|
23
|
-
a table wider than its container scrolls sideways (the container is then a tab stop).
|
|
25
|
+
a table wider than its container scrolls sideways (the container is then a tab stop). For a phone, give the
|
|
26
|
+
less important columns `meta.priority` 2 or 3 so they hide while the table is narrow, and set `pinFirstColumn`
|
|
27
|
+
to keep the first column in view. It sets
|
|
24
28
|
`aria-sort` on sortable headers and marks selected rows `data-state="selected"`, tinted
|
|
25
29
|
Surface/Secondary as on hover. Sorting, selection and pagination stay in the table
|
|
26
30
|
instance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`
|
|
@@ -44,6 +48,7 @@ the selected rows.
|
|
|
44
48
|
| `loadingRows` | `number` | - | Number of skeleton rows while loading. Defaults to the current page size. |
|
|
45
49
|
| `onRowClick` | `((row: TData) => void)` | - | Called with the row's original data when a row is clicked or activated with Enter/Space. Makes rows focusable. Clicks on buttons, links, inputs, checkboxes and `[data-no-row-click]` elements inside the row are ignored. |
|
|
46
50
|
| `onRowNavigate` | `((href: string, row: TData) => void)` | `Assigns the URL to `window.location`` | Follows a row's link in the same tab, e.g. `(href) => router.push(href)` for client-side routing. |
|
|
51
|
+
| `pinFirstColumn` | `boolean` | `false` | Keep the first data column in view while a wide table scrolls sideways, next to the checkboxes if there are any, so each row stays identifiable on a phone. The columns passing under it fade. |
|
|
47
52
|
| `size` | `"md" \| "lg"` | `"md"` | `md`: 48 rows, for one-line cells (the default).<br>`lg`: 64 rows, for a primary cell with a subtitle, a date with its time or an avatar. |
|
|
48
53
|
|
|
49
54
|
## DataGridColumnHeader
|
|
@@ -1700,6 +1705,91 @@ export default function DataGridLoadingEmpty() {
|
|
|
1700
1705
|
}
|
|
1701
1706
|
```
|
|
1702
1707
|
|
|
1708
|
+
### data-grid/phone
|
|
1709
|
+
|
|
1710
|
+
```tsx
|
|
1711
|
+
"use client";
|
|
1712
|
+
|
|
1713
|
+
import { Badge } from "@dodopayments/ui/badge";
|
|
1714
|
+
import { DataGrid } from "@dodopayments/ui/data-grid";
|
|
1715
|
+
import { type ColumnDef, getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
|
1716
|
+
|
|
1717
|
+
interface Payment {
|
|
1718
|
+
id: string;
|
|
1719
|
+
customer: string;
|
|
1720
|
+
method: string;
|
|
1721
|
+
created: string;
|
|
1722
|
+
status: "succeeded" | "failed" | "processing";
|
|
1723
|
+
amount: string;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
const payments: Payment[] = [
|
|
1727
|
+
{
|
|
1728
|
+
id: "pay_8Hq2Xa",
|
|
1729
|
+
customer: "ada@lovelace.dev",
|
|
1730
|
+
method: "Visa •••• 4242",
|
|
1731
|
+
created: "Nov 26, 09:14",
|
|
1732
|
+
status: "succeeded",
|
|
1733
|
+
amount: "$49.00",
|
|
1734
|
+
},
|
|
1735
|
+
{
|
|
1736
|
+
id: "pay_3Kd9Pm",
|
|
1737
|
+
customer: "grace@hopper.io",
|
|
1738
|
+
method: "UPI",
|
|
1739
|
+
created: "Nov 26, 08:51",
|
|
1740
|
+
status: "processing",
|
|
1741
|
+
amount: "$120.00",
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
id: "pay_7Tn4Ws",
|
|
1745
|
+
customer: "alan@turing.org",
|
|
1746
|
+
method: "Mastercard •••• 4444",
|
|
1747
|
+
created: "Nov 25, 22:07",
|
|
1748
|
+
status: "failed",
|
|
1749
|
+
amount: "$19.00",
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
id: "pay_1Bz6Lc",
|
|
1753
|
+
customer: "katherine@johnson.space",
|
|
1754
|
+
method: "Apple Pay",
|
|
1755
|
+
created: "Nov 25, 18:30",
|
|
1756
|
+
status: "succeeded",
|
|
1757
|
+
amount: "$240.00",
|
|
1758
|
+
},
|
|
1759
|
+
];
|
|
1760
|
+
|
|
1761
|
+
const columns: ColumnDef<Payment>[] = [
|
|
1762
|
+
{ accessorKey: "id", header: "Payment", meta: { cellClassName: "font-mono" } },
|
|
1763
|
+
{
|
|
1764
|
+
accessorKey: "status",
|
|
1765
|
+
header: "Status",
|
|
1766
|
+
cell: ({ row }) => <Badge status={row.original.status} kind="payment" />,
|
|
1767
|
+
},
|
|
1768
|
+
{ accessorKey: "amount", header: "Amount", meta: { cellClassName: "tabular-nums" } },
|
|
1769
|
+
// Hidden while the table is under 448px wide: a phone.
|
|
1770
|
+
{ accessorKey: "customer", header: "Customer", meta: { priority: 2 } },
|
|
1771
|
+
// Hidden while it is under 672px wide: a phone or a narrow panel.
|
|
1772
|
+
{ accessorKey: "method", header: "Method", meta: { priority: 3 } },
|
|
1773
|
+
{ accessorKey: "created", header: "Created", meta: { priority: 3 } },
|
|
1774
|
+
];
|
|
1775
|
+
|
|
1776
|
+
export default function DataGridPhone() {
|
|
1777
|
+
// eslint-disable-next-line react-hooks/incompatible-library -- TanStack Table returns a mutable instance by design.
|
|
1778
|
+
const table = useReactTable({
|
|
1779
|
+
data: payments,
|
|
1780
|
+
columns,
|
|
1781
|
+
getRowId: (row) => row.id,
|
|
1782
|
+
getCoreRowModel: getCoreRowModel(),
|
|
1783
|
+
});
|
|
1784
|
+
|
|
1785
|
+
return (
|
|
1786
|
+
<div className="w-full min-w-0">
|
|
1787
|
+
<DataGrid table={table} aria-label="Payments" pinFirstColumn />
|
|
1788
|
+
</div>
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1791
|
+
```
|
|
1792
|
+
|
|
1703
1793
|
### data-grid/row-hover
|
|
1704
1794
|
|
|
1705
1795
|
```tsx
|
|
@@ -66,7 +66,7 @@ A named shortcut in a range picker's preset list. `range` is evaluated against "
|
|
|
66
66
|
| --- | --- | --- | --- |
|
|
67
67
|
| `label` (required) | `string` | - | Text on the preset button, e.g. "Last 7 days". |
|
|
68
68
|
| `range` (required) | `(today: Date) => CompleteDateRange` | - | Returns the range for the given day. |
|
|
69
|
-
| `messageKey` | `"search" \| "clear" \| "loading" \| "next" \| "cardFieldLabel" \| "cardFieldNumber" \| "cardFieldExpiry" \| "cardFieldCvc" \| "cardFieldName" \| "cardFieldNumberError" \| "cardFieldExpiryError" \| "cardFieldCvcError" \| "cardFieldNameError" \| "billingActionFailed" \| "close" \| "dismiss" \| "spinnerLabel" \| "remove" \| "removeItem" \| "confirm" \| "cancel" \| "retry" \| "tryAgain" \| "back" \| "more" \| "showMore" \| "showLess" \| "selectEmpty" \| "copied" \| "copyFailed" \| "copyToClipboard" \| "loadMoreError" \| "activityTimelineLoading" \| "activityTimelineEmptyTitle" \| "activityTimelineEmptyDescription" \| "activityTimelineErrorTitle" \| "activityTimelineErrorDescription" \| "activityTimelineEnd" \| "autocompleteShowSuggestions" \| "comboboxShowOptions" \| "breadcrumbLabel" \| "codeBlockCopy" \| "codeBlockLabel" \| "dataGridSelectRow" \| "dataGridSelectAll" \| "dataGridSortBy" \| "dataGridSortAscending" \| "dataGridSortDescending" \| "dataGridTime" \| "datePresetToday" \| "datePresetYesterday" \| "datePresetLast7Days" \| "datePresetLast30Days" \| "datePresetThisWeek" \| "datePresetThisMonth" \| "datePresetLastMonth" \| "datePresetMonthToDate" \| "datePresetYearToDate" \| "datePresetLastYear" \| "dateRangeTitle" \| "dateRangePresets" \| "datePickerTitle" \| "datePickerReset" \| "datePickerApply" \| "datePickerStartDate" \| "datePickerEndDate" \| "dateFilterPlaceholder" \| "dateFilterClear" \| "loadMore" \| "loadMoreEnd" \| "paginationLabel" \| "paginationPrevious" \| "paginationNext" \| "paginationFirst" \| "paginationLast" \| "paginationPage" \| "tablePaginationRowsPerPage" \| "tablePaginationViewing" \| "secretFieldReveal" \| "secretFieldCopy" \| "secretFieldRemasked" \| "showMoreLabel" \| "sidebarTitle" \| "sidebarToggle" \| "sidebarCollapse" \| "sidebarExpand" \| "sidebarMode" \| "sidebarModeTest" \| "sidebarModeLive" \| "sidebarSwitchToLive" \| "sidebarSwitchToTest" \| "inputCopy" \| "sheetProgress" \| "statCardIncreased" \| "statCardDecreased" \| "statCardInfo" \| "statCardError" \| "statCardEmpty" \| "statCardNoChange" \| "timestampUtc" \| "timestampRelative" \| "timestampTimestamp" \| "wizardStepsLabel" \| "wizardStepsPosition" \| "progressStep" \| "wizardStepsFinish" \| "wizardStepsComplete" \| "wizardStepsCompleteHint" \| "prorationPreviewLabel" \| "prorationPreviewCurrentPlan" \| "prorationPreviewNewPlan" \| "prorationPreviewCredit" \| "prorationPreviewCharge" \| "prorationPreviewDueToday" \| "prorationPreviewNextInvoice" \| "prorationPreviewEffectiveNow" \| "prorationPreviewEffectivePeriodEnd" \| "codeTabsLabel" \| "walletButtonsPayWith" \| "walletButtonsDivider"` | - | Built-in message that translates `label` under a `LocaleProvider` while `label` is still that message's English default. Custom presets leave it out and show `label` as given; a built-in preset you relabel (`{ ...preset, label: "Past week" }`) shows its new `label` too. |
|
|
69
|
+
| `messageKey` | `"search" \| "clear" \| "loading" \| "next" \| "cardFieldLabel" \| "cardFieldNumber" \| "cardFieldExpiry" \| "cardFieldCvc" \| "cardFieldName" \| "cardFieldNumberError" \| "cardFieldExpiryError" \| "cardFieldCvcError" \| "cardFieldNameError" \| "billingActionFailed" \| "close" \| "dismiss" \| "spinnerLabel" \| "remove" \| "removeItem" \| "confirm" \| "cancel" \| "retry" \| "tryAgain" \| "back" \| "more" \| "showMore" \| "showLess" \| "selectEmpty" \| "copied" \| "copyFailed" \| "copyToClipboard" \| "loadMoreError" \| "activityTimelineLoading" \| "activityTimelineEmptyTitle" \| "activityTimelineEmptyDescription" \| "activityTimelineErrorTitle" \| "activityTimelineErrorDescription" \| "activityTimelineEnd" \| "autocompleteShowSuggestions" \| "comboboxShowOptions" \| "breadcrumbLabel" \| "codeBlockCopy" \| "codeBlockLabel" \| "dataGridSelectRow" \| "dataGridSelectAll" \| "dataGridSortBy" \| "dataGridSortAscending" \| "dataGridSortDescending" \| "dataGridTime" \| "datePresetToday" \| "datePresetYesterday" \| "datePresetLast7Days" \| "datePresetLast30Days" \| "datePresetThisWeek" \| "datePresetThisMonth" \| "datePresetLastMonth" \| "datePresetMonthToDate" \| "datePresetYearToDate" \| "datePresetLastYear" \| "dateRangeTitle" \| "dateRangePresets" \| "datePickerTitle" \| "datePickerReset" \| "datePickerApply" \| "datePickerStartDate" \| "datePickerEndDate" \| "dateFilterPlaceholder" \| "dateFilterClear" \| "loadMore" \| "loadMoreEnd" \| "paginationLabel" \| "paginationPrevious" \| "paginationNext" \| "paginationFirst" \| "paginationLast" \| "paginationPage" \| "tablePaginationRowsPerPage" \| "tablePaginationViewing" \| "secretFieldReveal" \| "secretFieldCopy" \| "secretFieldRemasked" \| "showMoreLabel" \| "sidebarTitle" \| "sidebarToggle" \| "sidebarCollapse" \| "sidebarExpand" \| "sidebarMode" \| "sidebarModeTest" \| "sidebarModeLive" \| "sidebarSwitchToLive" \| "sidebarSwitchToTest" \| "imageCropTitle" \| "imageCropArea" \| "imageCropApply" \| "imageCropKeyboardHint" \| "imageCropFailed" \| "imageCropUnreadable" \| "inputCopy" \| "sheetProgress" \| "statCardIncreased" \| "statCardDecreased" \| "statCardInfo" \| "statCardError" \| "statCardEmpty" \| "statCardNoChange" \| "timestampUtc" \| "timestampRelative" \| "timestampTimestamp" \| "wizardStepsLabel" \| "wizardStepsPosition" \| "progressStep" \| "wizardStepsFinish" \| "wizardStepsComplete" \| "wizardStepsCompleteHint" \| "prorationPreviewLabel" \| "prorationPreviewCurrentPlan" \| "prorationPreviewNewPlan" \| "prorationPreviewCredit" \| "prorationPreviewCharge" \| "prorationPreviewDueToday" \| "prorationPreviewNextInvoice" \| "prorationPreviewEffectiveNow" \| "prorationPreviewEffectivePeriodEnd" \| "codeTabsLabel" \| "walletButtonsPayWith" \| "walletButtonsDivider"` | - | Built-in message that translates `label` under a `LocaleProvider` while `label` is still that message's English default. Custom presets leave it out and show `label` as given; a built-in preset you relabel (`{ ...preset, label: "Past week" }`) shows its new `label` too. |
|
|
70
70
|
|
|
71
71
|
## Examples
|
|
72
72
|
|
package/ai/components/dialog.md
CHANGED
|
@@ -28,12 +28,13 @@ Also accepts Base UI props: `finalFocus`, `initialFocus`, `render`.
|
|
|
28
28
|
|
|
29
29
|
## Dialog
|
|
30
30
|
|
|
31
|
-
Root of a modal dialog, centred on the screen
|
|
32
|
-
`alert` makes it an alert dialog for confirmations.
|
|
31
|
+
Root of a modal dialog, centred on the screen; with `mobileSheet` it is a bottom drawer on a phone. Controls open
|
|
32
|
+
state (`open`/`onOpenChange` or `defaultOpen`). `alert` makes it an alert dialog for confirmations.
|
|
33
33
|
|
|
34
34
|
| Prop | Type | Default | Description |
|
|
35
35
|
| --- | --- | --- | --- |
|
|
36
36
|
| `alert` | `boolean` | `false` | An alert dialog: it interrupts to confirm or acknowledge something (`role="alertdialog"`). Clicking the backdrop does not close it and `DialogContent` has no close button, so always offer an explicit Cancel in the footer. Escape still closes it. `ConfirmDialog` is a ready-made one. |
|
|
37
|
+
| `mobileSheet` | `boolean` | `false` | Below 640px, show the dialog as a bottom drawer: docked to the bottom edge at full width, closed with a swipe down as well as the scrim, Escape and the close button, with the actions sharing the footer row. Off by default: the dialog stays centred at every width. Do not set it when the body has its own drag gesture. An alert dialog is always centred. |
|
|
37
38
|
|
|
38
39
|
Also accepts Base UI props: `actionsRef`, `defaultOpen`, `defaultTriggerId`, `disablePointerDismissal`, `handle`, `modal`, `onOpenChange`, `onOpenChangeComplete`, `open`, `triggerId`.
|
|
39
40
|
|
|
@@ -80,6 +81,7 @@ button), `neutral` or `warning` with the black primary. Decorative: the title sa
|
|
|
80
81
|
| Prop | Type | Default | Description |
|
|
81
82
|
| --- | --- | --- | --- |
|
|
82
83
|
| `icon` (required) | `ReactNode` | - | The icon in the tile, a Nucleo icon (16px at `md`, 12px at `sm`): `<FeaturedIcon icon={<KeyIcon />} />`. |
|
|
84
|
+
| `look` | `"tile" \| "sphere"` | - | `tile`: The rounded square with a soft fill and two borders (the default). `sphere`: The dashboard's glossy round badge in the tone, a white icon on it (44px at `md`, 28px at `sm`), as the verification checklist shows each step. |
|
|
83
85
|
| `size` | `"sm" \| "md" \| null` | - | |
|
|
84
86
|
| `tone` | `"info" \| "success" \| "warning" \| "error" \| "violet" \| "neutral" \| "pink" \| "orange" \| null` | - | |
|
|
85
87
|
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
The drawer: portal + scrim + popup, docked to the bottom edge with a drag handle and a close button. A grey tray
|
|
4
|
+
with rounded top corners, like Dialog: the title and body in a white panel, the actions on the grey strip. It is
|
|
5
|
+
as tall as its content, up to the screen minus 48, and pads the bottom safe area; a focused field stays above the
|
|
6
|
+
software keyboard. Always include a `DrawerTitle`; lay it out as `DrawerHeader`, `DrawerPanel` and `DrawerFooter`.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { DrawerContent, Drawer, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPanel, DrawerTitle, DrawerTrigger } from "@dodopayments/ui/drawer";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## DrawerContent
|
|
13
|
+
|
|
14
|
+
The drawer: portal + scrim + popup, docked to the bottom edge with a drag handle and a close button. A grey tray
|
|
15
|
+
with rounded top corners, like Dialog: the title and body in a white panel, the actions on the grey strip. It is
|
|
16
|
+
as tall as its content, up to the screen minus 48, and pads the bottom safe area; a focused field stays above the
|
|
17
|
+
software keyboard. Always include a `DrawerTitle`; lay it out as `DrawerHeader`, `DrawerPanel` and `DrawerFooter`.
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Description |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
22
|
+
| `closeLabel` | `string` | `"Close"` | Accessible label for the close button. |
|
|
23
|
+
| `hideCloseButton` | `boolean` | `false` | Hide the close button. The scrim, Escape and a swipe down still close the drawer. |
|
|
24
|
+
| `hideHandle` | `boolean` | `false` | Hide the drag handle on top. The drawer still closes with a swipe down. |
|
|
25
|
+
| `portalProps` | `DrawerPortalProps` | - | Props for the portal, e.g. a `container` to render the drawer into instead of `document.body`. |
|
|
26
|
+
|
|
27
|
+
Also accepts Base UI props: `finalFocus`, `initialFocus`, `render`.
|
|
28
|
+
|
|
29
|
+
## Drawer
|
|
30
|
+
|
|
31
|
+
Root of a drawer: a modal panel that slides up from the bottom edge and closes with a swipe down, a tap on the
|
|
32
|
+
scrim or Escape (the `Drawer` primitive on Base UI Drawer). Controls open state (`open` / `onOpenChange` or
|
|
33
|
+
`defaultOpen`). `snapPoints` (fractions of the viewport, or px / rem lengths) let it rest at several heights.
|
|
34
|
+
Built for phones: on wide screens use a `Dialog` or a `Sheet`.
|
|
35
|
+
|
|
36
|
+
Also accepts Base UI props: `actionsRef`, `defaultOpen`, `defaultSnapPoint`, `defaultTriggerId`, `disablePointerDismissal`, `handle`, `modal`, `onOpenChange`, `onOpenChangeComplete`, `onSnapPointChange`, `open`, `snapPoint`, `snapPoints`, `snapToSequentialPoints`, `triggerId`.
|
|
37
|
+
|
|
38
|
+
## DrawerClose
|
|
39
|
+
|
|
40
|
+
Closes the drawer. Use `render={<Button variant="secondary" />}` for a footer action.
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Description |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
45
|
+
|
|
46
|
+
Also accepts Base UI props: `nativeButton`, `render`.
|
|
47
|
+
|
|
48
|
+
## DrawerDescription
|
|
49
|
+
|
|
50
|
+
One or two lines under the title; becomes the drawer's accessible description.
|
|
51
|
+
|
|
52
|
+
| Prop | Type | Default | Description |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
55
|
+
|
|
56
|
+
Also accepts Base UI props: `render`.
|
|
57
|
+
|
|
58
|
+
## DrawerFooter
|
|
59
|
+
|
|
60
|
+
The actions, on the grey strip under the panel. They share the row: cancel first, the primary action last.
|
|
61
|
+
|
|
62
|
+
## DrawerHeader
|
|
63
|
+
|
|
64
|
+
The top of the white panel: `DrawerTitle` and an optional `DrawerDescription`.
|
|
65
|
+
|
|
66
|
+
## DrawerPanel
|
|
67
|
+
|
|
68
|
+
The body of the white panel. It scrolls inside the drawer, under the header and above the footer.
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
| --- | --- | --- | --- |
|
|
72
|
+
| `scrollFade` | `boolean` | `true` | Fade the content at the edges it scrolls under. |
|
|
73
|
+
|
|
74
|
+
## DrawerTitle
|
|
75
|
+
|
|
76
|
+
The drawer's accessible name. Required.
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Description |
|
|
79
|
+
| --- | --- | --- | --- |
|
|
80
|
+
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
81
|
+
|
|
82
|
+
Also accepts Base UI props: `render`.
|
|
83
|
+
|
|
84
|
+
## DrawerTrigger
|
|
85
|
+
|
|
86
|
+
Opens the drawer. Use `render={<Button />}` to style it as a Dodo button.
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Description |
|
|
89
|
+
| --- | --- | --- | --- |
|
|
90
|
+
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
91
|
+
|
|
92
|
+
Also accepts Base UI props: `handle`, `id`, `nativeButton`, `payload`, `render`.
|
|
93
|
+
|
|
94
|
+
## Examples
|
|
95
|
+
|
|
96
|
+
### drawer/basic
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
"use client";
|
|
100
|
+
|
|
101
|
+
import { Button } from "@dodopayments/ui/button";
|
|
102
|
+
import {
|
|
103
|
+
Drawer,
|
|
104
|
+
DrawerClose,
|
|
105
|
+
DrawerContent,
|
|
106
|
+
DrawerDescription,
|
|
107
|
+
DrawerFooter,
|
|
108
|
+
DrawerHeader,
|
|
109
|
+
DrawerPanel,
|
|
110
|
+
DrawerTitle,
|
|
111
|
+
DrawerTrigger,
|
|
112
|
+
} from "@dodopayments/ui/drawer";
|
|
113
|
+
import { Field, FieldDescription, FieldLabel } from "@dodopayments/ui/field";
|
|
114
|
+
import { Input } from "@dodopayments/ui/input";
|
|
115
|
+
|
|
116
|
+
export default function DrawerBasic() {
|
|
117
|
+
return (
|
|
118
|
+
<Drawer>
|
|
119
|
+
<DrawerTrigger render={<Button variant="secondary" />}>Initiate refund</DrawerTrigger>
|
|
120
|
+
<DrawerContent>
|
|
121
|
+
<DrawerHeader>
|
|
122
|
+
<DrawerTitle>Initiate refund</DrawerTitle>
|
|
123
|
+
<DrawerDescription>Payment pay_7Hq2Xa…Lm3d · $49.00 · Visa •••• 4242</DrawerDescription>
|
|
124
|
+
</DrawerHeader>
|
|
125
|
+
<DrawerPanel>
|
|
126
|
+
<div className="flex flex-col gap-4">
|
|
127
|
+
<Field>
|
|
128
|
+
<FieldLabel>Amount</FieldLabel>
|
|
129
|
+
<Input type="money" currency="USD" defaultValue={4900} />
|
|
130
|
+
</Field>
|
|
131
|
+
<Field>
|
|
132
|
+
<FieldLabel>Reason</FieldLabel>
|
|
133
|
+
<FieldDescription>Shown to the customer on the refund receipt.</FieldDescription>
|
|
134
|
+
<Input placeholder="Duplicate charge" />
|
|
135
|
+
</Field>
|
|
136
|
+
</div>
|
|
137
|
+
</DrawerPanel>
|
|
138
|
+
<DrawerFooter>
|
|
139
|
+
<DrawerClose render={<Button variant="secondary" />}>Cancel</DrawerClose>
|
|
140
|
+
<DrawerClose render={<Button />}>Refund $49.00</DrawerClose>
|
|
141
|
+
</DrawerFooter>
|
|
142
|
+
</DrawerContent>
|
|
143
|
+
</Drawer>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### drawer/master
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
"use client";
|
|
152
|
+
|
|
153
|
+
import { Button } from "@dodopayments/ui/button";
|
|
154
|
+
import {
|
|
155
|
+
Drawer,
|
|
156
|
+
DrawerClose,
|
|
157
|
+
DrawerContent,
|
|
158
|
+
DrawerDescription,
|
|
159
|
+
DrawerFooter,
|
|
160
|
+
DrawerHeader,
|
|
161
|
+
DrawerTitle,
|
|
162
|
+
DrawerTrigger,
|
|
163
|
+
} from "@dodopayments/ui/drawer";
|
|
164
|
+
|
|
165
|
+
export default function DrawerMaster() {
|
|
166
|
+
return (
|
|
167
|
+
<Drawer>
|
|
168
|
+
<DrawerTrigger render={<Button variant="secondary" />}>Open drawer</DrawerTrigger>
|
|
169
|
+
<DrawerContent>
|
|
170
|
+
<DrawerHeader>
|
|
171
|
+
<DrawerTitle>Pause subscription?</DrawerTitle>
|
|
172
|
+
<DrawerDescription>
|
|
173
|
+
Billing stops today. The customer keeps access until 14 December.
|
|
174
|
+
</DrawerDescription>
|
|
175
|
+
</DrawerHeader>
|
|
176
|
+
<DrawerFooter>
|
|
177
|
+
<DrawerClose render={<Button variant="secondary" />}>Cancel</DrawerClose>
|
|
178
|
+
<DrawerClose render={<Button variant="warning" />}>Pause</DrawerClose>
|
|
179
|
+
</DrawerFooter>
|
|
180
|
+
</DrawerContent>
|
|
181
|
+
</Drawer>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### drawer/nested
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
"use client";
|
|
190
|
+
|
|
191
|
+
import { Button } from "@dodopayments/ui/button";
|
|
192
|
+
import {
|
|
193
|
+
Drawer,
|
|
194
|
+
DrawerClose,
|
|
195
|
+
DrawerContent,
|
|
196
|
+
DrawerDescription,
|
|
197
|
+
DrawerFooter,
|
|
198
|
+
DrawerHeader,
|
|
199
|
+
DrawerTitle,
|
|
200
|
+
DrawerTrigger,
|
|
201
|
+
} from "@dodopayments/ui/drawer";
|
|
202
|
+
|
|
203
|
+
export default function DrawerNested() {
|
|
204
|
+
return (
|
|
205
|
+
<Drawer>
|
|
206
|
+
<DrawerTrigger render={<Button variant="secondary" />}>Cancel subscription</DrawerTrigger>
|
|
207
|
+
<DrawerContent>
|
|
208
|
+
<DrawerHeader>
|
|
209
|
+
<DrawerTitle>Cancel subscription</DrawerTitle>
|
|
210
|
+
<DrawerDescription>
|
|
211
|
+
Pro plan · $49.00 a month. The customer keeps access until 14 December.
|
|
212
|
+
</DrawerDescription>
|
|
213
|
+
</DrawerHeader>
|
|
214
|
+
<DrawerFooter>
|
|
215
|
+
<DrawerClose render={<Button variant="secondary" />}>Keep it</DrawerClose>
|
|
216
|
+
<Drawer>
|
|
217
|
+
<DrawerTrigger render={<Button variant="destructive" />}>Cancel now</DrawerTrigger>
|
|
218
|
+
<DrawerContent>
|
|
219
|
+
<DrawerHeader>
|
|
220
|
+
<DrawerTitle>Cancel right away?</DrawerTitle>
|
|
221
|
+
<DrawerDescription>
|
|
222
|
+
Access ends now and the unused days are not refunded.
|
|
223
|
+
</DrawerDescription>
|
|
224
|
+
</DrawerHeader>
|
|
225
|
+
<DrawerFooter>
|
|
226
|
+
<DrawerClose render={<Button variant="secondary" />}>Back</DrawerClose>
|
|
227
|
+
<DrawerClose render={<Button variant="destructive" />}>Cancel now</DrawerClose>
|
|
228
|
+
</DrawerFooter>
|
|
229
|
+
</DrawerContent>
|
|
230
|
+
</Drawer>
|
|
231
|
+
</DrawerFooter>
|
|
232
|
+
</DrawerContent>
|
|
233
|
+
</Drawer>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### drawer/snap-points
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
"use client";
|
|
242
|
+
|
|
243
|
+
import { Button } from "@dodopayments/ui/button";
|
|
244
|
+
import {
|
|
245
|
+
Drawer,
|
|
246
|
+
DrawerContent,
|
|
247
|
+
DrawerDescription,
|
|
248
|
+
DrawerHeader,
|
|
249
|
+
DrawerPanel,
|
|
250
|
+
DrawerTitle,
|
|
251
|
+
DrawerTrigger,
|
|
252
|
+
} from "@dodopayments/ui/drawer";
|
|
253
|
+
|
|
254
|
+
const EVENTS = [
|
|
255
|
+
"payment.succeeded",
|
|
256
|
+
"payment.failed",
|
|
257
|
+
"refund.succeeded",
|
|
258
|
+
"subscription.active",
|
|
259
|
+
"subscription.on_hold",
|
|
260
|
+
"subscription.renewed",
|
|
261
|
+
"subscription.cancelled",
|
|
262
|
+
"dispute.opened",
|
|
263
|
+
"dispute.won",
|
|
264
|
+
"dispute.lost",
|
|
265
|
+
"license_key.created",
|
|
266
|
+
"payout.succeeded",
|
|
267
|
+
];
|
|
268
|
+
|
|
269
|
+
export default function DrawerSnapPoints() {
|
|
270
|
+
return (
|
|
271
|
+
<Drawer snapPoints={[0.5, 1]}>
|
|
272
|
+
<DrawerTrigger render={<Button variant="secondary" />}>Webhook events</DrawerTrigger>
|
|
273
|
+
<DrawerContent>
|
|
274
|
+
<DrawerHeader>
|
|
275
|
+
<DrawerTitle>Webhook events</DrawerTitle>
|
|
276
|
+
<DrawerDescription>Drag up to see the full list.</DrawerDescription>
|
|
277
|
+
</DrawerHeader>
|
|
278
|
+
<DrawerPanel>
|
|
279
|
+
<ul className="flex flex-col gap-3">
|
|
280
|
+
{EVENTS.map((event) => (
|
|
281
|
+
<li key={event} className="text-mono-primary text-foreground">
|
|
282
|
+
{event}
|
|
283
|
+
</li>
|
|
284
|
+
))}
|
|
285
|
+
</ul>
|
|
286
|
+
</DrawerPanel>
|
|
287
|
+
</DrawerContent>
|
|
288
|
+
</Drawer>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
@@ -17,6 +17,7 @@ pass `role="img"`, `aria-label` and `aria-hidden={false}`.
|
|
|
17
17
|
| Prop | Type | Default | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| `icon` (required) | `ReactNode` | - | The icon in the tile, a Nucleo icon (16px at `md`, 12px at `sm`): `<FeaturedIcon icon={<KeyIcon />} />`. |
|
|
20
|
+
| `look` | `"tile" \| "sphere"` | - | `tile`: The rounded square with a soft fill and two borders (the default). `sphere`: The dashboard's glossy round badge in the tone, a white icon on it (44px at `md`, 28px at `sm`), as the verification checklist shows each step. |
|
|
20
21
|
| `size` | `"md" \| "sm"` | `"md"` | `md`: 32px tile with a 16px icon, for cards, dialogs and empty states (the default).<br>`sm`: 20px tile with a 12px icon, the height of a text line, e.g. the events of an `ActivityTimeline`. |
|
|
21
22
|
| `tone` | `"neutral" \| "success" \| "warning" \| "error" \| "info" \| "orange" \| "pink" \| "violet"` | `"neutral"` | `neutral`: Settings link cards, empty states and invite or refund dialogs (the default).<br>`success`: A finished or verified state.<br>`warning`: Something that needs action.<br>`error`: The top of a destructive confirm, or a failure.<br>`info`: Under review, or an archive notice.<br>`orange`: A category or highlight whose meaning the label already carries. Not a status.<br>`pink`: A category or highlight whose meaning the label already carries. Not a status.<br>`violet`: A category or highlight whose meaning the label already carries. Not a status. |
|
|
22
23
|
|