@dodopayments/ui 1.5.0 → 1.7.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 +1595 -133
- package/ai/component-registry.md +6 -1
- package/ai/components/activity-timeline.md +1 -1
- package/ai/components/alert.md +1 -1
- package/ai/components/app-top-bar.md +51 -1
- package/ai/components/auth-card.md +2 -0
- package/ai/components/badge.md +24 -0
- package/ai/components/bar-chart.md +4 -2
- package/ai/components/brand-logos.md +1 -1
- package/ai/components/button.md +110 -12
- package/ai/components/card.md +6 -3
- package/ai/components/chart-share-card.md +25 -0
- package/ai/components/chart.md +27 -1
- package/ai/components/code-block.md +1 -1
- package/ai/components/collapsible.md +3 -3
- package/ai/components/color-input.md +1 -1
- package/ai/components/command.md +4 -1
- package/ai/components/comparison-bars.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 +94 -3
- package/ai/components/date-picker.md +1 -1
- package/ai/components/details-panel.md +5 -3
- package/ai/components/dialog.md +5 -2
- package/ai/components/drawer.md +292 -0
- package/ai/components/empty.md +1 -1
- package/ai/components/featured-icon.md +1 -0
- package/ai/components/field.md +15 -5
- 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 +72 -6
- package/ai/components/invoice-document.md +182 -0
- package/ai/components/leaderboard.md +5 -2
- package/ai/components/link.md +1 -1
- package/ai/components/list-item.md +5 -4
- 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/navigation-progress.md +55 -0
- package/ai/components/new-items-pill.md +1 -1
- package/ai/components/page-header.md +4 -4
- package/ai/components/payment-logos.md +1 -1
- package/ai/components/popover.md +4 -1
- package/ai/components/quantity-stepper.md +3 -3
- package/ai/components/record-header.md +5 -5
- package/ai/components/reorder-list.md +45 -0
- package/ai/components/rich-text-editor.md +2 -0
- package/ai/components/scaled-frame.md +5 -3
- package/ai/components/select.md +33 -3
- package/ai/components/settings-section.md +3 -0
- package/ai/components/setup-guide.md +1 -1
- package/ai/components/sheet.md +10 -10
- package/ai/components/sidebar.md +15 -7
- package/ai/components/stat-card.md +7 -6
- package/ai/components/tabs.md +54 -4
- 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/activity-timeline/activity-timeline.d.ts +1 -1
- package/dist/components/activity-timeline/activity-timeline.js +2 -2
- package/dist/components/activity-timeline/activity-timeline.js.map +1 -1
- package/dist/components/alert/alert.d.ts +2 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/app-top-bar/app-top-bar.d.ts +27 -1
- package/dist/components/app-top-bar/app-top-bar.d.ts.map +1 -1
- package/dist/components/app-top-bar/app-top-bar.js +37 -11
- package/dist/components/app-top-bar/app-top-bar.js.map +1 -1
- package/dist/components/app-top-bar/index.d.ts +1 -1
- package/dist/components/app-top-bar/index.d.ts.map +1 -1
- package/dist/components/app-top-bar/index.js +1 -1
- package/dist/components/app-top-bar/index.js.map +1 -1
- package/dist/components/auth-card/auth-card.d.ts +13 -1
- package/dist/components/auth-card/auth-card.d.ts.map +1 -1
- package/dist/components/auth-card/auth-card.js +5 -5
- package/dist/components/auth-card/auth-card.js.map +1 -1
- package/dist/components/badge/badge-status.d.ts +3 -3
- package/dist/components/badge/badge-status.js +3 -3
- package/dist/components/badge/badge-status.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/bar-chart/bar-chart.d.ts +2 -1
- package/dist/components/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/components/bar-chart/bar-chart.js +2 -1
- package/dist/components/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/brand-logos/brand-artwork.d.ts +116 -1
- package/dist/components/brand-logos/brand-artwork.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-artwork.js +116 -1
- package/dist/components/brand-logos/brand-artwork.js.map +1 -1
- package/dist/components/brand-logos/brand-logos.d.ts +5 -2
- package/dist/components/brand-logos/brand-logos.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-logos.js +52 -2
- package/dist/components/brand-logos/brand-logos.js.map +1 -1
- package/dist/components/button/button-narrow-label.d.ts +11 -0
- package/dist/components/button/button-narrow-label.d.ts.map +1 -0
- package/dist/components/button/button-narrow-label.js +22 -0
- package/dist/components/button/button-narrow-label.js.map +1 -0
- package/dist/components/button/button.d.ts +41 -6
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +79 -14
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.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/card/card.d.ts +16 -5
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +13 -4
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/chart-share-card/chart-share-card.d.ts +31 -0
- package/dist/components/chart-share-card/chart-share-card.d.ts.map +1 -0
- package/dist/components/chart-share-card/chart-share-card.js +15 -0
- package/dist/components/chart-share-card/chart-share-card.js.map +1 -0
- package/dist/components/chart-share-card/index.d.ts +2 -0
- package/dist/components/chart-share-card/index.d.ts.map +1 -0
- package/dist/components/chart-share-card/index.js +2 -0
- package/dist/components/chart-share-card/index.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +1 -1
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +23 -4
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-block/highlight-shell.d.ts +9 -0
- package/dist/components/code-block/highlight-shell.d.ts.map +1 -0
- package/dist/components/code-block/highlight-shell.js +53 -0
- package/dist/components/code-block/highlight-shell.js.map +1 -0
- package/dist/components/collapsible/collapsible.d.ts +2 -2
- package/dist/components/collapsible/collapsible.js +4 -4
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/command/command-palette.d.ts +15 -2
- package/dist/components/command/command-palette.d.ts.map +1 -1
- package/dist/components/command/command-palette.js +8 -5
- package/dist/components/command/command-palette.js.map +1 -1
- package/dist/components/comparison-bars/comparison-bars.d.ts +13 -2
- package/dist/components/comparison-bars/comparison-bars.d.ts.map +1 -1
- package/dist/components/comparison-bars/comparison-bars.js +3 -3
- 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 +32 -2
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.js +193 -13
- package/dist/components/data-grid/data-grid.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +5 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +4 -4
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/details-panel/details-panel.d.ts +11 -4
- package/dist/components/details-panel/details-panel.d.ts.map +1 -1
- package/dist/components/details-panel/details-panel.js +13 -12
- package/dist/components/details-panel/details-panel.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/empty/empty.d.ts +3 -2
- package/dist/components/empty/empty.d.ts.map +1 -1
- package/dist/components/empty/empty.js.map +1 -1
- 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/field/field.d.ts +8 -6
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +15 -7
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/index.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -0
- package/dist/components/field/index.js.map +1 -1
- package/dist/components/field/label.d.ts +2 -1
- package/dist/components/field/label.d.ts.map +1 -1
- package/dist/components/field/label.js +2 -1
- package/dist/components/field/label.js.map +1 -1
- package/dist/components/file-upload/file-upload.d.ts +1 -1
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +1 -1
- package/dist/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/icon-morph/icon-morph.d.ts +1 -1
- package/dist/components/icon-morph/icon-morph.d.ts.map +1 -1
- package/dist/components/icon-morph/icon-morph.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-suggestions.d.ts +1 -1
- package/dist/components/input/input-suggestions.d.ts.map +1 -1
- package/dist/components/input/input-suggestions.js +21 -4
- package/dist/components/input/input-suggestions.js.map +1 -1
- package/dist/components/input/input.d.ts +27 -8
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +28 -9
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input-group/input-group.d.ts +2 -2
- package/dist/components/input-group/input-group.d.ts.map +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/leaderboard/leaderboard.d.ts +3 -1
- package/dist/components/leaderboard/leaderboard.d.ts.map +1 -1
- package/dist/components/leaderboard/leaderboard.js +7 -5
- package/dist/components/leaderboard/leaderboard.js.map +1 -1
- package/dist/components/link/link.d.ts +4 -3
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/link/link.js +21 -2
- package/dist/components/link/link.js.map +1 -1
- package/dist/components/list-item/list-item.d.ts +12 -6
- package/dist/components/list-item/list-item.d.ts.map +1 -1
- package/dist/components/list-item/list-item.js +5 -5
- 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/list-toolbar/list-toolbar.js +1 -1
- package/dist/components/list-toolbar/list-toolbar.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/milestone/milestone.js +1 -1
- package/dist/components/milestone/milestone.js.map +1 -1
- package/dist/components/money/money.d.ts.map +1 -1
- package/dist/components/money/money.js +3 -3
- package/dist/components/money/money.js.map +1 -1
- package/dist/components/navigation-progress/index.d.ts +2 -0
- package/dist/components/navigation-progress/index.d.ts.map +1 -0
- package/dist/components/navigation-progress/index.js +2 -0
- package/dist/components/navigation-progress/index.js.map +1 -0
- package/dist/components/navigation-progress/navigation-progress.d.ts +23 -0
- package/dist/components/navigation-progress/navigation-progress.d.ts.map +1 -0
- package/dist/components/navigation-progress/navigation-progress.js +53 -0
- package/dist/components/navigation-progress/navigation-progress.js.map +1 -0
- package/dist/components/page-header/page-header.d.ts +3 -3
- package/dist/components/page-header/page-header.d.ts.map +1 -1
- package/dist/components/page-header/page-header.js +9 -13
- 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 +12 -1
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +4 -2
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/quantity-stepper/quantity-stepper.d.ts +3 -3
- package/dist/components/quantity-stepper/quantity-stepper.js +3 -3
- package/dist/components/quantity-stepper/quantity-stepper.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +7 -5
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/record-header/record-header.d.ts +7 -3
- package/dist/components/record-header/record-header.d.ts.map +1 -1
- package/dist/components/record-header/record-header.js +11 -3
- package/dist/components/record-header/record-header.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.d.ts +13 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +17 -9
- package/dist/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/components/rich-text-editor/rich-text-extensions.d.ts +5 -2
- package/dist/components/rich-text-editor/rich-text-extensions.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-extensions.js +43 -5
- package/dist/components/rich-text-editor/rich-text-extensions.js.map +1 -1
- package/dist/components/rich-text-editor/rich-text-markdown.d.ts +9 -3
- package/dist/components/rich-text-editor/rich-text-markdown.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-markdown.js +134 -44
- package/dist/components/rich-text-editor/rich-text-markdown.js.map +1 -1
- package/dist/components/scaled-frame/scaled-frame.d.ts +8 -3
- package/dist/components/scaled-frame/scaled-frame.d.ts.map +1 -1
- package/dist/components/scaled-frame/scaled-frame.js +27 -2
- 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 +25 -4
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +34 -14
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/settings-section/settings-section.d.ts +8 -1
- package/dist/components/settings-section/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section/settings-section.js +8 -8
- package/dist/components/settings-section/settings-section.js.map +1 -1
- package/dist/components/setup-guide/setup-guide.d.ts +2 -2
- package/dist/components/setup-guide/setup-guide.js +2 -2
- package/dist/components/setup-guide/setup-guide.js.map +1 -1
- package/dist/components/sheet/sheet.d.ts +16 -5
- package/dist/components/sheet/sheet.d.ts.map +1 -1
- package/dist/components/sheet/sheet.js +9 -5
- package/dist/components/sheet/sheet.js.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts +32 -12
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar.js +38 -19
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/skeleton/page-skeleton.js +1 -1
- package/dist/components/skeleton/page-skeleton.js.map +1 -1
- 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/stat-card/stat-card.d.ts +24 -10
- package/dist/components/stat-card/stat-card.d.ts.map +1 -1
- package/dist/components/stat-card/stat-card.js +27 -18
- 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/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.d.ts.map +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tabs/tabs.d.ts +47 -6
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +108 -9
- 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/flags/basque.d.ts.map +1 -0
- package/dist/icons/flags/basque.js.map +1 -0
- package/dist/icons/flags/canary-islands.d.ts.map +1 -0
- package/dist/icons/flags/canary-islands.js.map +1 -0
- package/dist/icons/flags/england.d.ts.map +1 -0
- package/dist/icons/flags/england.js.map +1 -0
- package/dist/icons/flags/hawaii.d.ts.map +1 -0
- package/dist/icons/flags/hawaii.js.map +1 -0
- package/dist/icons/flags/kurdistan.d.ts.map +1 -0
- package/dist/icons/flags/kurdistan.js.map +1 -0
- package/dist/icons/flags/netherlands-antilles.d.ts.map +1 -0
- package/dist/icons/flags/netherlands-antilles.js.map +1 -0
- package/dist/icons/flags/northen-ireland.d.ts.map +1 -0
- package/dist/icons/flags/northen-ireland.js.map +1 -0
- package/dist/icons/flags/scotland.d.ts.map +1 -0
- package/dist/icons/flags/scotland.js.map +1 -0
- package/dist/icons/flags/wales.d.ts.map +1 -0
- package/dist/icons/flags/wales.js.map +1 -0
- package/dist/icons/index.d.ts +21 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +21 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/ui/ai-agents.d.ts +3 -0
- package/dist/icons/ui/ai-agents.d.ts.map +1 -0
- package/dist/icons/ui/ai-agents.js +5 -0
- package/dist/icons/ui/ai-agents.js.map +1 -0
- package/dist/icons/ui/archive.d.ts.map +1 -0
- package/dist/icons/ui/archive.js.map +1 -0
- package/dist/icons/ui/arrow-door-out-3.d.ts.map +1 -0
- package/dist/icons/ui/arrow-door-out-3.js.map +1 -0
- package/dist/icons/ui/arrow-door-out.d.ts.map +1 -0
- package/dist/icons/ui/arrow-door-out.js.map +1 -0
- package/dist/icons/ui/arrow-left.d.ts.map +1 -0
- package/dist/icons/ui/arrow-left.js.map +1 -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/arrows-transaction.d.ts.map +1 -0
- package/dist/icons/ui/arrows-transaction.js.map +1 -0
- package/dist/icons/ui/bell-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/bell-outline-duo.js.map +1 -0
- package/dist/icons/ui/bolt.d.ts.map +1 -0
- package/dist/icons/ui/bolt.js.map +1 -0
- package/dist/icons/ui/book-open.d.ts +3 -0
- package/dist/icons/ui/book-open.d.ts.map +1 -0
- package/dist/icons/ui/book-open.js +5 -0
- package/dist/icons/ui/book-open.js.map +1 -0
- package/dist/icons/ui/box-glyph.d.ts +3 -0
- package/dist/icons/ui/box-glyph.d.ts.map +1 -0
- package/dist/icons/ui/box-glyph.js +5 -0
- package/dist/icons/ui/box-glyph.js.map +1 -0
- package/dist/icons/ui/box-plus.d.ts.map +1 -0
- package/dist/icons/ui/box-plus.js.map +1 -0
- package/dist/icons/ui/chart-pie.d.ts.map +1 -0
- package/dist/icons/ui/chart-pie.js.map +1 -0
- package/dist/icons/ui/chat-bubble-writing.d.ts +3 -0
- package/dist/icons/ui/chat-bubble-writing.d.ts.map +1 -0
- package/dist/icons/ui/chat-bubble-writing.js +5 -0
- package/dist/icons/ui/chat-bubble-writing.js.map +1 -0
- package/dist/icons/ui/check-glyph-12.d.ts.map +1 -0
- package/dist/icons/ui/check-glyph-12.js.map +1 -0
- package/dist/icons/ui/circle-check-glyph.d.ts +3 -0
- package/dist/icons/ui/circle-check-glyph.d.ts.map +1 -0
- package/dist/icons/ui/circle-check-glyph.js +5 -0
- package/dist/icons/ui/circle-check-glyph.js.map +1 -0
- package/dist/icons/ui/circle-user-check.d.ts.map +1 -0
- package/dist/icons/ui/circle-user-check.js.map +1 -0
- package/dist/icons/ui/coins.d.ts.map +1 -0
- package/dist/icons/ui/coins.js.map +1 -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/dots-vertical.d.ts.map +1 -0
- package/dist/icons/ui/dots-vertical.js.map +1 -0
- package/dist/icons/ui/fingerprint.d.ts.map +1 -0
- package/dist/icons/ui/fingerprint.js.map +1 -0
- package/dist/icons/ui/flask.d.ts.map +1 -0
- package/dist/icons/ui/flask.js.map +1 -0
- package/dist/icons/ui/gear.d.ts.map +1 -0
- package/dist/icons/ui/gear.js.map +1 -0
- package/dist/icons/ui/greek-temple-glyph.d.ts +3 -0
- package/dist/icons/ui/greek-temple-glyph.d.ts.map +1 -0
- package/dist/icons/ui/greek-temple-glyph.js +5 -0
- package/dist/icons/ui/greek-temple-glyph.js.map +1 -0
- package/dist/icons/ui/greek-temple.d.ts.map +1 -0
- package/dist/icons/ui/greek-temple.js.map +1 -0
- package/dist/icons/ui/grid.d.ts +3 -0
- package/dist/icons/ui/grid.d.ts.map +1 -0
- package/dist/icons/ui/grid.js +5 -0
- package/dist/icons/ui/grid.js.map +1 -0
- package/dist/icons/ui/heart-glyph.d.ts.map +1 -0
- package/dist/icons/ui/heart-glyph.js.map +1 -0
- package/dist/icons/ui/heart.d.ts.map +1 -0
- package/dist/icons/ui/heart.js.map +1 -0
- package/dist/icons/ui/hourglass-glyph.d.ts +3 -0
- package/dist/icons/ui/hourglass-glyph.d.ts.map +1 -0
- package/dist/icons/ui/hourglass-glyph.js +5 -0
- package/dist/icons/ui/hourglass-glyph.js.map +1 -0
- package/dist/icons/ui/house.d.ts.map +1 -0
- package/dist/icons/ui/house.js.map +1 -0
- package/dist/icons/ui/key.d.ts.map +1 -0
- package/dist/icons/ui/key.js.map +1 -0
- package/dist/icons/ui/lightbulb.d.ts +3 -0
- package/dist/icons/ui/lightbulb.d.ts.map +1 -0
- package/dist/icons/ui/lightbulb.js +5 -0
- package/dist/icons/ui/lightbulb.js.map +1 -0
- package/dist/icons/ui/link.d.ts +3 -0
- package/dist/icons/ui/link.d.ts.map +1 -0
- package/dist/icons/ui/link.js +5 -0
- package/dist/icons/ui/link.js.map +1 -0
- package/dist/icons/ui/media-pause.d.ts +3 -0
- package/dist/icons/ui/media-pause.d.ts.map +1 -0
- package/dist/icons/ui/media-pause.js +5 -0
- package/dist/icons/ui/media-pause.js.map +1 -0
- package/dist/icons/ui/media-play.d.ts +3 -0
- package/dist/icons/ui/media-play.d.ts.map +1 -0
- package/dist/icons/ui/media-play.js +5 -0
- package/dist/icons/ui/media-play.js.map +1 -0
- package/dist/icons/ui/money-bill.d.ts.map +1 -0
- package/dist/icons/ui/money-bill.js.map +1 -0
- package/dist/icons/ui/money-bills.d.ts.map +1 -0
- package/dist/icons/ui/money-bills.js.map +1 -0
- package/dist/icons/ui/money-refund.d.ts.map +1 -0
- package/dist/icons/ui/money-refund.js.map +1 -0
- package/dist/icons/ui/monitor.d.ts.map +1 -0
- package/dist/icons/ui/monitor.js.map +1 -0
- package/dist/icons/ui/moon.d.ts.map +1 -0
- package/dist/icons/ui/moon.js.map +1 -0
- package/dist/icons/ui/paper-plane.d.ts +3 -0
- package/dist/icons/ui/paper-plane.d.ts.map +1 -0
- package/dist/icons/ui/paper-plane.js +5 -0
- package/dist/icons/ui/paper-plane.js.map +1 -0
- package/dist/icons/ui/pencil.d.ts.map +1 -0
- package/dist/icons/ui/pencil.js.map +1 -0
- package/dist/icons/ui/print.d.ts +3 -0
- package/dist/icons/ui/print.d.ts.map +1 -0
- package/dist/icons/ui/print.js +5 -0
- package/dist/icons/ui/print.js.map +1 -0
- package/dist/icons/ui/refresh-clockwise.d.ts.map +1 -0
- package/dist/icons/ui/refresh-clockwise.js.map +1 -0
- package/dist/icons/ui/report.d.ts.map +1 -0
- package/dist/icons/ui/report.js.map +1 -0
- package/dist/icons/ui/shield-check.d.ts.map +1 -0
- package/dist/icons/ui/shield-check.js.map +1 -0
- package/dist/icons/ui/shop-glyph.d.ts +3 -0
- package/dist/icons/ui/shop-glyph.d.ts.map +1 -0
- package/dist/icons/ui/shop-glyph.js +5 -0
- package/dist/icons/ui/shop-glyph.js.map +1 -0
- package/dist/icons/ui/sliders.d.ts.map +1 -0
- package/dist/icons/ui/sliders.js.map +1 -0
- package/dist/icons/ui/star-glyph-duo.d.ts.map +1 -0
- package/dist/icons/ui/star-glyph-duo.js.map +1 -0
- package/dist/icons/ui/star-glyph.d.ts.map +1 -0
- package/dist/icons/ui/star-glyph.js.map +1 -0
- package/dist/icons/ui/star-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/star-outline-duo.js.map +1 -0
- package/dist/icons/ui/star.d.ts.map +1 -0
- package/dist/icons/ui/star.js.map +1 -0
- package/dist/icons/ui/sun.d.ts.map +1 -0
- package/dist/icons/ui/sun.js.map +1 -0
- package/dist/icons/ui/terminal.d.ts.map +1 -0
- package/dist/icons/ui/terminal.js.map +1 -0
- package/dist/icons/ui/text-align-center.d.ts.map +1 -0
- package/dist/icons/ui/text-align-center.js.map +1 -0
- package/dist/icons/ui/text-align-left.d.ts.map +1 -0
- package/dist/icons/ui/text-align-left.js.map +1 -0
- package/dist/icons/ui/text-align-right.d.ts.map +1 -0
- package/dist/icons/ui/text-align-right.js.map +1 -0
- package/dist/icons/ui/ticket.d.ts.map +1 -0
- package/dist/icons/ui/ticket.js.map +1 -0
- package/dist/icons/ui/trash-2.d.ts.map +1 -0
- package/dist/icons/ui/trash-2.js.map +1 -0
- package/dist/icons/ui/triangle-warning-glyph.d.ts +3 -0
- package/dist/icons/ui/triangle-warning-glyph.d.ts.map +1 -0
- package/dist/icons/ui/triangle-warning-glyph.js +5 -0
- package/dist/icons/ui/triangle-warning-glyph.js.map +1 -0
- package/dist/icons/ui/user-glyph.d.ts +3 -0
- package/dist/icons/ui/user-glyph.d.ts.map +1 -0
- package/dist/icons/ui/user-glyph.js +5 -0
- package/dist/icons/ui/user-glyph.js.map +1 -0
- package/dist/icons/ui/user-plus.d.ts +3 -0
- package/dist/icons/ui/user-plus.d.ts.map +1 -0
- package/dist/icons/ui/user-plus.js +5 -0
- package/dist/icons/ui/user-plus.js.map +1 -0
- package/dist/icons/ui/users.d.ts.map +1 -0
- package/dist/icons/ui/users.js.map +1 -0
- package/dist/icons/ui/wallet-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/wallet-outline-duo.js.map +1 -0
- package/dist/icons/ui/wallet.d.ts.map +1 -0
- package/dist/icons/ui/wallet.js.map +1 -0
- package/dist/icons/ui/wand-sparkle.d.ts.map +1 -0
- package/dist/icons/ui/wand-sparkle.js.map +1 -0
- package/dist/icons/ui/wifi-off.d.ts +3 -0
- package/dist/icons/ui/wifi-off.d.ts.map +1 -0
- package/dist/icons/ui/wifi-off.js +5 -0
- package/dist/icons/ui/wifi-off.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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/bar-chart.d.ts.map +1 -1
- package/dist/primitives/charts/bar-chart.js +33 -3
- package/dist/primitives/charts/bar-chart.js.map +1 -1
- package/dist/primitives/charts/gauge.js +1 -1
- package/dist/primitives/charts/line.d.ts.map +1 -1
- package/dist/primitives/charts/line.js +14 -11
- package/dist/primitives/charts/line.js.map +1 -1
- package/dist/primitives/charts/x-axis.d.ts +12 -1
- package/dist/primitives/charts/x-axis.d.ts.map +1 -1
- package/dist/primitives/charts/x-axis.js +96 -20
- package/dist/primitives/charts/x-axis.js.map +1 -1
- package/dist/primitives/charts/y-axis-scales.d.ts +3 -1
- package/dist/primitives/charts/y-axis-scales.d.ts.map +1 -1
- package/dist/primitives/charts/y-axis-scales.js +2 -2
- package/dist/primitives/charts/y-axis-scales.js.map +1 -1
- package/dist/primitives/charts/y-axis.d.ts +5 -0
- package/dist/primitives/charts/y-axis.d.ts.map +1 -1
- package/dist/primitives/charts/y-axis.js +6 -2
- package/dist/primitives/charts/y-axis.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/button.d.ts +1 -1
- package/dist/primitives/ui/button.d.ts.map +1 -1
- package/dist/primitives/ui/button.js +7 -3
- 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/card.d.ts.map +1 -1
- package/dist/primitives/ui/card.js +9 -7
- package/dist/primitives/ui/card.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 +10 -1
- package/dist/primitives/ui/dialog.d.ts.map +1 -1
- package/dist/primitives/ui/dialog.js +14 -3
- 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 +2 -2
- 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 +16 -7
- 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/switch.d.ts +2 -2
- package/dist/primitives/ui/switch.d.ts.map +1 -1
- package/dist/primitives/ui/switch.js +2 -2
- 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 +2 -2
- package/dist/primitives/ui/textarea.js.map +1 -1
- package/dist/styles/motion.test.tsx +15 -0
- package/dist/styles/theme.css +5 -1
- package/dist/styles/tokens.css +72 -39
- package/dist/styles/tokens.test.tsx +137 -7
- package/dist/theme/css.js +4 -4
- package/dist/theme/css.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Image Crop
|
|
2
|
+
|
|
3
|
+
Crops a picked image before it is uploaded, as the dashboard's image fields do (main's ImageUpload): the
|
|
4
|
+
whole image with a box of `aspect` over it, 90% of the image and centred to start. Drag the box to move it,
|
|
5
|
+
a corner to resize it, or move it with the arrow keys. Crop draws the boxed area to a canvas, shrinks it so
|
|
6
|
+
its longer side is at most `maxDimension`, and calls `onCrop` with the new file. Put it beside a
|
|
7
|
+
`FileUpload`: open it with the picked file, and upload what `onCrop` returns. It stays mounted and toggles
|
|
8
|
+
`open`; its state starts fresh for every file.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ImageCropDialog } from "@dodopayments/ui/image-crop";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## ImageCropDialog
|
|
15
|
+
|
|
16
|
+
Crops a picked image before it is uploaded, as the dashboard's image fields do (main's ImageUpload): the
|
|
17
|
+
whole image with a box of `aspect` over it, 90% of the image and centred to start. Drag the box to move it,
|
|
18
|
+
a corner to resize it, or move it with the arrow keys. Crop draws the boxed area to a canvas, shrinks it so
|
|
19
|
+
its longer side is at most `maxDimension`, and calls `onCrop` with the new file. Put it beside a
|
|
20
|
+
`FileUpload`: open it with the picked file, and upload what `onCrop` returns. It stays mounted and toggles
|
|
21
|
+
`open`; its state starts fresh for every file.
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| `file` (required) | `File \| null` | - | The picked image. The dialog shows it while `open`. |
|
|
26
|
+
| `onCrop` (required) | `(file: File) => void` | - | Called with the cropped image: the same name, and the same type when it is JPEG, PNG or WebP (else PNG). |
|
|
27
|
+
| `onOpenChange` (required) | `(open: boolean) => void` | - | |
|
|
28
|
+
| `open` (required) | `boolean` | - | |
|
|
29
|
+
| `aspect` | `number` | `1` | Width over height of the crop, e.g. `1` for a product image or `16 / 9` for a banner. |
|
|
30
|
+
| `maxDimension` | `number` | `1920` | The longest side of the output in pixels; a larger crop is shrunk to it, a smaller one kept. |
|
|
31
|
+
| `title` | `string` | `the locale's `imageCropTitle` ("Crop image")` | Accessible title. |
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
### image-crop/master
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
"use client";
|
|
39
|
+
|
|
40
|
+
import { FileUpload } from "@dodopayments/ui/file-upload";
|
|
41
|
+
import { ImageCropDialog } from "@dodopayments/ui/image-crop";
|
|
42
|
+
import { useEffect, useState } from "react";
|
|
43
|
+
|
|
44
|
+
export default function ImageCropMaster() {
|
|
45
|
+
const [picked, setPicked] = useState<File | null>(null);
|
|
46
|
+
const [open, setOpen] = useState(false);
|
|
47
|
+
const [preview, setPreview] = useState<string | null>(null);
|
|
48
|
+
|
|
49
|
+
useEffect(
|
|
50
|
+
() => () => {
|
|
51
|
+
if (preview) URL.revokeObjectURL(preview);
|
|
52
|
+
},
|
|
53
|
+
[preview],
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div className="flex w-full max-w-120 flex-col gap-4">
|
|
58
|
+
<FileUpload
|
|
59
|
+
accept="image/png,image/jpeg,image/webp"
|
|
60
|
+
description="PNG, JPG or WebP, up to 3 MB. Cropped to a square."
|
|
61
|
+
maxSize={3 * 1024 * 1024}
|
|
62
|
+
onFilesAdded={([file]) => {
|
|
63
|
+
if (!file) return;
|
|
64
|
+
setPicked(file);
|
|
65
|
+
setOpen(true);
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
{preview ? (
|
|
69
|
+
// biome-ignore lint/performance/noImgElement: a local object URL in a demo.
|
|
70
|
+
<img
|
|
71
|
+
alt="Cropped"
|
|
72
|
+
className="size-24 rounded-lg border border-border object-cover"
|
|
73
|
+
src={preview}
|
|
74
|
+
/>
|
|
75
|
+
) : null}
|
|
76
|
+
<ImageCropDialog
|
|
77
|
+
file={picked}
|
|
78
|
+
open={open}
|
|
79
|
+
onOpenChange={setOpen}
|
|
80
|
+
onCrop={(file: File) => {
|
|
81
|
+
setPreview(URL.createObjectURL(file));
|
|
82
|
+
setOpen(false);
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
@@ -51,7 +51,7 @@ several in one group for joined inputs; they share the width equally, and `style
|
|
|
51
51
|
| --- | --- | --- | --- |
|
|
52
52
|
| `className` | `string` | - | Classes for the input's control wrapper (rendered `display: contents` inside the group). |
|
|
53
53
|
| `nativeInput` | `boolean` | - | |
|
|
54
|
-
| `size` | `"lg"` | `"lg"` | Input height, as `Input` (`DODO_INPUT_VARIANTS`):
|
|
54
|
+
| `size` | `"sm" \| "lg"` | `"lg"` | Input height, as `Input` (`DODO_INPUT_VARIANTS`): `lg` 36 or the compact `sm` 28. |
|
|
55
55
|
| `unstyled` | `boolean` | - | |
|
|
56
56
|
|
|
57
57
|
Also accepts Base UI props: `defaultValue`, `onValueChange`, `render`, `value`.
|
package/ai/components/input.md
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
The Dodo Nest Input. Lets the merchant type a value: one line (text, search, URLs, phone), several lines
|
|
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
|
-
a brand ring on focus, a red ring
|
|
7
|
-
is 36 tall
|
|
8
|
-
a boxed `addon`, `prefixSelect` / `suffixSelect` and a `shortcut`; read-only shows a copy button
|
|
6
|
+
a brand ring on focus, a red ring when invalid (the placeholder stays muted), grey (Surface/Secondary) when read-only. Every Input
|
|
7
|
+
is 36 tall; a one-line input can be the compact `size="sm"` (28), or `size="code"` (56, large centred monospace) for one code read off another screen. A one-line input takes icons, an inline `prefix` / `suffix`,
|
|
8
|
+
a boxed `addon`, `prefixSelect` / `suffixSelect` and a `shortcut`; read-only shows a copy button (`copyable={false}` hides it,
|
|
9
|
+
when the page already offers its own copy action). With
|
|
9
10
|
`suggestions` it suggests values in a list while the user types (an autocomplete; the value stays free text). Inside
|
|
10
11
|
a `Field` it picks up the label, description and validation state.
|
|
11
12
|
|
|
@@ -18,9 +19,10 @@ import { Input, formatTaxId, isValidAbn, isValidGstin, isValidTaxId, normalizeTa
|
|
|
18
19
|
The Dodo Nest Input. Lets the merchant type a value: one line (text, search, URLs, phone), several lines
|
|
19
20
|
(`type="textarea"`), a list of chips (`type="chips"`, typed, or picked from `suggestions`), an amount in minor
|
|
20
21
|
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
|
-
a brand ring on focus, a red ring
|
|
22
|
-
is 36 tall
|
|
23
|
-
a boxed `addon`, `prefixSelect` / `suffixSelect` and a `shortcut`; read-only shows a copy button
|
|
22
|
+
a brand ring on focus, a red ring when invalid (the placeholder stays muted), grey (Surface/Secondary) when read-only. Every Input
|
|
23
|
+
is 36 tall; a one-line input can be the compact `size="sm"` (28), or `size="code"` (56, large centred monospace) for one code read off another screen. A one-line input takes icons, an inline `prefix` / `suffix`,
|
|
24
|
+
a boxed `addon`, `prefixSelect` / `suffixSelect` and a `shortcut`; read-only shows a copy button (`copyable={false}` hides it,
|
|
25
|
+
when the page already offers its own copy action). With
|
|
24
26
|
`suggestions` it suggests values in a list while the user types (an autocomplete; the value stays free text). Inside
|
|
25
27
|
a `Field` it picks up the label, description and validation state.
|
|
26
28
|
|
|
@@ -219,6 +221,70 @@ export default function InputAsyncSuggestions() {
|
|
|
219
221
|
}
|
|
220
222
|
```
|
|
221
223
|
|
|
224
|
+
### input/code
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
"use client";
|
|
228
|
+
|
|
229
|
+
import { Input } from "@dodopayments/ui/input";
|
|
230
|
+
|
|
231
|
+
export default function InputCode() {
|
|
232
|
+
return (
|
|
233
|
+
<div className="w-full max-w-sm">
|
|
234
|
+
<Input
|
|
235
|
+
size="code"
|
|
236
|
+
aria-label="Device code"
|
|
237
|
+
placeholder="XXXX-XXXX"
|
|
238
|
+
autoCapitalize="characters"
|
|
239
|
+
autoComplete="off"
|
|
240
|
+
spellCheck={false}
|
|
241
|
+
/>
|
|
242
|
+
</div>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### input/compact
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
"use client";
|
|
251
|
+
|
|
252
|
+
import { Button } from "@dodopayments/ui/button";
|
|
253
|
+
import { MagnifierIcon } from "@dodopayments/ui/icons";
|
|
254
|
+
import { Input } from "@dodopayments/ui/input";
|
|
255
|
+
import { Select, SelectContent, SelectTrigger, SelectValue } from "@dodopayments/ui/select";
|
|
256
|
+
|
|
257
|
+
const STATUSES = [
|
|
258
|
+
{ value: "all", label: "All statuses" },
|
|
259
|
+
{ value: "succeeded", label: "Succeeded" },
|
|
260
|
+
{ value: "failed", label: "Failed" },
|
|
261
|
+
];
|
|
262
|
+
|
|
263
|
+
export default function InputCompact() {
|
|
264
|
+
return (
|
|
265
|
+
<div className="flex w-full max-w-xl flex-wrap items-center gap-2">
|
|
266
|
+
<Input
|
|
267
|
+
size="sm"
|
|
268
|
+
type="search"
|
|
269
|
+
aria-label="Search payments"
|
|
270
|
+
placeholder="Search payments"
|
|
271
|
+
leadingIcon={<MagnifierIcon />}
|
|
272
|
+
className="min-w-40 flex-1"
|
|
273
|
+
/>
|
|
274
|
+
<Select items={STATUSES} defaultValue="all">
|
|
275
|
+
<SelectTrigger size="sm" aria-label="Status" className="w-40">
|
|
276
|
+
<SelectValue />
|
|
277
|
+
</SelectTrigger>
|
|
278
|
+
<SelectContent />
|
|
279
|
+
</Select>
|
|
280
|
+
<Button size="sm" variant="secondary">
|
|
281
|
+
Reset
|
|
282
|
+
</Button>
|
|
283
|
+
</div>
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
222
288
|
### input/country-lookup
|
|
223
289
|
|
|
224
290
|
```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
|
+
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Top customers by spend (Dodo Nest Leaderboard): a podium of the top three (one joined block of white cells
|
|
4
4
|
with a gold, silver or bronze glow and a ribbon medal, in rank order 1 · 2 · 3), then a ranked list from 4
|
|
5
|
-
down, 12 below.
|
|
5
|
+
down, 12 below. Under 24rem (384px) wide the podium stacks, each place a row with its medal beside the text, so
|
|
6
|
+
the amounts and names read whole. With two customers the third cell is hidden and there is no list; with none it shows the
|
|
6
7
|
empty state; `loading` shows the skeleton. Put it in a `Card`. Compose `LeaderboardPodium`,
|
|
7
8
|
`LeaderboardPodiumCell`, `LeaderboardList` and `LeaderboardRow` for a custom layout.
|
|
8
9
|
|
|
@@ -14,7 +15,8 @@ import { Leaderboard, LeaderboardList, LeaderboardMedal, LeaderboardPodium, Lead
|
|
|
14
15
|
|
|
15
16
|
Top customers by spend (Dodo Nest Leaderboard): a podium of the top three (one joined block of white cells
|
|
16
17
|
with a gold, silver or bronze glow and a ribbon medal, in rank order 1 · 2 · 3), then a ranked list from 4
|
|
17
|
-
down, 12 below.
|
|
18
|
+
down, 12 below. Under 24rem (384px) wide the podium stacks, each place a row with its medal beside the text, so
|
|
19
|
+
the amounts and names read whole. With two customers the third cell is hidden and there is no list; with none it shows the
|
|
18
20
|
empty state; `loading` shows the skeleton. Put it in a `Card`. Compose `LeaderboardPodium`,
|
|
19
21
|
`LeaderboardPodiumCell`, `LeaderboardList` and `LeaderboardRow` for a custom layout.
|
|
20
22
|
|
|
@@ -43,6 +45,7 @@ fixed colours in both modes. Decorative (`alt=""`) unless you pass an `alt`.
|
|
|
43
45
|
|
|
44
46
|
The podium block: one `<ol>` with a 1px Border/Primary ring and Radius/Large that clips its
|
|
45
47
|
`LeaderboardPodiumCell`s, equal width, with 1px dividers between them. Put two or three cells in rank order.
|
|
48
|
+
In a `Leaderboard` under 24rem (384px) wide the cells stack, each a row with its medal beside the text.
|
|
46
49
|
|
|
47
50
|
## LeaderboardPodiumCell
|
|
48
51
|
|
package/ai/components/link.md
CHANGED
|
@@ -24,7 +24,7 @@ keep client-side navigation.
|
|
|
24
24
|
|
|
25
25
|
| Prop | Type | Default | Description |
|
|
26
26
|
| --- | --- | --- | --- |
|
|
27
|
-
| `external` | `boolean` | `false` | Open the link in a new tab (`target="_blank"`, `rel="noopener noreferrer"`), end it with an up-right arrow (it replaces the entity arrow) and append `externalLabel` for screen readers (also appended to `aria-label` when set). |
|
|
27
|
+
| `external` | `boolean` | `false` | Open the link in a new tab (`target="_blank"`, `rel="noopener noreferrer"`), end it with an up-right arrow (it replaces the entity arrow; in running text it wraps with the last word, never alone) and append `externalLabel` for screen readers (also appended to `aria-label` when set). |
|
|
28
28
|
| `externalLabel` | `string` | `"(opens in a new tab)"` | Visually hidden text appended to external links. |
|
|
29
29
|
| `tone` | `"accent" \| "error"` | `"accent"` | `accent`: Content/Accent (Blue 600, Blue 400 in dark). The default.<br>`error`: Content/Error (Red 600, Red 400 in dark), only next to a destructive or warning message. |
|
|
30
30
|
| `variant` | `"inline" \| "entity"` | `"inline"` | `inline`: Underlined words inside a sentence. Takes the sentence's size and line height (Link/Primary in 14, Link/Secondary in 12) and wraps with it. The underline is the link colour at 40% and turns solid on hover.<br>`entity`: Labels/Primary (14) and a 16 trailing arrow, for “View all” and IDs that open a page. No underline until hover, when it fades in under the label. Keeps one line and truncates. |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# List item
|
|
2
2
|
|
|
3
3
|
One line of a list or one small card (Dodo Nest List item): a leading part, the title and description (one line
|
|
4
|
-
each, with an ellipsis) and a trailing part. `layout` is `row` (order lines, settings rows, sessions, saved
|
|
4
|
+
each, with an ellipsis, or whole with `wrap`) and a trailing part. `layout` is `row` (order lines, settings rows, sessions, saved
|
|
5
5
|
payment methods inside a panel; a divider under every row but the last), `card` (side-by-side portal cards, 12
|
|
6
6
|
apart), `tile` (a bordered row tile: add-ons with a quantity, or with `href` / `render` a link with a chevron for a settings index) or `add` (a dashed “Add …” tile that is a button; pass `onClick`). Renders a `<div>` (an `<li>` with
|
|
7
7
|
`render={<li />}`, a link with `render={<a href="…" />}`); the add tile renders a `<button>`. It has no hover or
|
|
@@ -14,7 +14,7 @@ import { ListItem, ListItemPrice, ListItemThumbnail } from "@dodopayments/ui/lis
|
|
|
14
14
|
## ListItem
|
|
15
15
|
|
|
16
16
|
One line of a list or one small card (Dodo Nest List item): a leading part, the title and description (one line
|
|
17
|
-
each, with an ellipsis) and a trailing part. `layout` is `row` (order lines, settings rows, sessions, saved
|
|
17
|
+
each, with an ellipsis, or whole with `wrap`) and a trailing part. `layout` is `row` (order lines, settings rows, sessions, saved
|
|
18
18
|
payment methods inside a panel; a divider under every row but the last), `card` (side-by-side portal cards, 12
|
|
19
19
|
apart), `tile` (a bordered row tile: add-ons with a quantity, or with `href` / `render` a link with a chevron for a settings index) or `add` (a dashed “Add …” tile that is a button; pass `onClick`). Renders a `<div>` (an `<li>` with
|
|
20
20
|
`render={<li />}`, a link with `render={<a href="…" />}`); the add tile renders a `<button>`. It has no hover or
|
|
@@ -22,15 +22,16 @@ selected state: for a choice, use a Radio card.
|
|
|
22
22
|
|
|
23
23
|
| Prop | Type | Default | Description |
|
|
24
24
|
| --- | --- | --- | --- |
|
|
25
|
-
| `title` (required) | `ReactNode` | - | The title, one line with an ellipsis (Labels/Primary)
|
|
25
|
+
| `title` (required) | `ReactNode` | - | The title, one line with an ellipsis (Labels/Primary), or whole with `wrap`. With `layout="add"`, the tile's label. |
|
|
26
26
|
| `corner` | `ReactNode` | - | Card only: a `Badge` or a small `Button` at the top right, opposite the leading part. |
|
|
27
|
-
| `description` | `ReactNode` | - | One line under the title with an ellipsis (Body/Secondary, Content/Secondary)
|
|
27
|
+
| `description` | `ReactNode` | - | One line under the title with an ellipsis (Body/Secondary, Content/Secondary), or whole with `wrap`. |
|
|
28
28
|
| `disabled` | `boolean` | `false` | Tile only: drop the link and the chevron and render a plain `<div>` tile, e.g. for a page that is not available yet. Say why in the description. |
|
|
29
29
|
| `divider` | `boolean` | `true` | Row only: the 1px Border/Primary line under the row. It is always hidden on the last row of its list. |
|
|
30
30
|
| `href` | `string` | - | Tile only: where the tile links to; renders an `<a href>` and adds the chevron. Pass `render` instead for a router link (on a tile, `render` is always the link). |
|
|
31
31
|
| `layout` | `"row" \| "card" \| "tile" \| "add"` | `"row"` | `row`: One line of a list inside a panel or order card: leading · title and description · trailing, padding 12 top and bottom, a divider under it (off on the last row, also when the row sits inside the last `<li>`, e.g. a link row).<br>`card`: A small card for side-by-side portal cards (add-on, saved payment method, offer): leading and corner on top, the text, then the trailing part spread across the bottom.<br>`tile`: A bordered tile laid out as a row: leading · title and description · trailing (add-ons with a quantity). With `href` or `render` the whole tile is one link and ends with a chevron (a settings index); with `disabled` it stays a plain tile.<br>`add`: A dashed “Add …” tile next to cards: a plus icon over the label, the whole tile a button. |
|
|
32
32
|
| `leading` | `ReactNode` | - | The leading part: a `ListItemThumbnail`, a `FeaturedIcon`, an `Avatar` or a payment logo. In a card it sits top left. |
|
|
33
33
|
| `trailing` | `ReactNode` | - | The trailing part: a `ListItemPrice`, a quantity stepper, a `Badge`, a `Button` or a chevron, 8 apart. In a card it spreads across the bottom (e.g. the price and an Add button). |
|
|
34
|
+
| `wrap` | `boolean` | `false` | Wrap the title and description to more lines instead of cutting them with an ellipsis, for text that must read whole (a settings index or a report tile). |
|
|
34
35
|
|
|
35
36
|
Also accepts Base UI props: `render`.
|
|
36
37
|
|
|
@@ -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}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Navigation progress
|
|
2
|
+
|
|
3
|
+
Navigation progress: a 2px bar in the brand green (Content/Brand-primary) fixed across the very top
|
|
4
|
+
of the viewport, above the sidebar, the top bar and any overlay, that tells the user a page is on its
|
|
5
|
+
way. Mount it once in the app shell and drive `active` from the router. It shows only after `delay`,
|
|
6
|
+
creeps towards the end while the page loads, then fills the track and fades out. It is decorative
|
|
7
|
+
(`aria-hidden`), takes no pointer events and never takes focus; under reduced motion it is a still,
|
|
8
|
+
full-width bar.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { NavigationProgress } from "@dodopayments/ui/navigation-progress";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## NavigationProgress
|
|
15
|
+
|
|
16
|
+
Navigation progress: a 2px bar in the brand green (Content/Brand-primary) fixed across the very top
|
|
17
|
+
of the viewport, above the sidebar, the top bar and any overlay, that tells the user a page is on its
|
|
18
|
+
way. Mount it once in the app shell and drive `active` from the router. It shows only after `delay`,
|
|
19
|
+
creeps towards the end while the page loads, then fills the track and fades out. It is decorative
|
|
20
|
+
(`aria-hidden`), takes no pointer events and never takes focus; under reduced motion it is a still,
|
|
21
|
+
full-width bar.
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| `active` (required) | `boolean` | - | A navigation is in flight. Set it when one starts (a link click, a router push, back or forward) and clear it when the new page has rendered. |
|
|
26
|
+
| `delay` | `number` | `150` | Milliseconds a navigation must run before the bar shows, so an instant one never flashes. |
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### navigation-progress/basic
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
"use client";
|
|
34
|
+
|
|
35
|
+
import { Button } from "@dodopayments/ui/button";
|
|
36
|
+
import { NavigationProgress } from "@dodopayments/ui/navigation-progress";
|
|
37
|
+
import { useState } from "react";
|
|
38
|
+
|
|
39
|
+
/** Start a navigation to see the bar at the top of the window; finish it to see it fill and fade. */
|
|
40
|
+
export default function NavigationProgressBasic() {
|
|
41
|
+
const [active, setActive] = useState(false);
|
|
42
|
+
return (
|
|
43
|
+
<div className="flex flex-wrap gap-2">
|
|
44
|
+
<NavigationProgress active={active} />
|
|
45
|
+
<Button variant="secondary" disabled={active} onClick={() => setActive(true)}>
|
|
46
|
+
Start navigation
|
|
47
|
+
</Button>
|
|
48
|
+
<Button variant="secondary" disabled={!active} onClick={() => setActive(false)}>
|
|
49
|
+
Finish navigation
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
@@ -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
|
|
@@ -5,8 +5,8 @@ raises the description for list and settings pages. Navigation is none (top-leve
|
|
|
5
5
|
`back` (one level up: a secondary 36px icon button before the title) or `breadcrumb` (two or more levels, above
|
|
6
6
|
the title). The title is Heading/Secondary with an optional `help` question icon and a `meta` slot for a status
|
|
7
7
|
Badge or Copyable ID; `actions` holds up to two large Buttons on the right; the `description` sits under the title,
|
|
8
|
-
indented past the back button. Rows are 4 apart. Below 576px (or with `breakpoint="mobile"`) the back button
|
|
9
|
-
|
|
8
|
+
indented past the back button. Rows are 4 apart. Below 576px (or with `breakpoint="mobile"`) the back button stays
|
|
9
|
+
beside the title and the actions move 8 below the description. No fill: put it first on the
|
|
10
10
|
main panel, 24 above the first section.
|
|
11
11
|
|
|
12
12
|
```tsx
|
|
@@ -20,8 +20,8 @@ raises the description for list and settings pages. Navigation is none (top-leve
|
|
|
20
20
|
`back` (one level up: a secondary 36px icon button before the title) or `breadcrumb` (two or more levels, above
|
|
21
21
|
the title). The title is Heading/Secondary with an optional `help` question icon and a `meta` slot for a status
|
|
22
22
|
Badge or Copyable ID; `actions` holds up to two large Buttons on the right; the `description` sits under the title,
|
|
23
|
-
indented past the back button. Rows are 4 apart. Below 576px (or with `breakpoint="mobile"`) the back button
|
|
24
|
-
|
|
23
|
+
indented past the back button. Rows are 4 apart. Below 576px (or with `breakpoint="mobile"`) the back button stays
|
|
24
|
+
beside the title and the actions move 8 below the description. No fill: put it first on the
|
|
25
25
|
main panel, 24 above the first section.
|
|
26
26
|
|
|
27
27
|
| Prop | Type | Default | Description |
|