@major-tech/ui 0.0.0-stage → 1.0.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/CHANGELOG.md +101 -0
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/components/accordion.d.ts +33 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +51 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/activity-chart.d.ts +26 -0
- package/dist/components/activity-chart.d.ts.map +1 -0
- package/dist/components/activity-chart.js +56 -0
- package/dist/components/activity-chart.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +28 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +51 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +34 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +59 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/ask-user-question.d.ts +103 -0
- package/dist/components/ask-user-question.d.ts.map +1 -0
- package/dist/components/ask-user-question.js +401 -0
- package/dist/components/ask-user-question.js.map +1 -0
- package/dist/components/attachment-gallery.d.ts +137 -0
- package/dist/components/attachment-gallery.d.ts.map +1 -0
- package/dist/components/attachment-gallery.js +317 -0
- package/dist/components/attachment-gallery.js.map +1 -0
- package/dist/components/avatar.d.ts +37 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +62 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +29 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +50 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/brand-tile.d.ts +33 -0
- package/dist/components/brand-tile.d.ts.map +1 -0
- package/dist/components/brand-tile.js +36 -0
- package/dist/components/brand-tile.js.map +1 -0
- package/dist/components/button.d.ts +51 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +90 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +18 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +78 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +18 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +34 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +48 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +227 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/catalog-card.d.ts +29 -0
- package/dist/components/catalog-card.d.ts.map +1 -0
- package/dist/components/catalog-card.js +20 -0
- package/dist/components/catalog-card.js.map +1 -0
- package/dist/components/chart.d.ts +118 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +209 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +14 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/chip.d.ts +68 -0
- package/dist/components/chip.d.ts.map +1 -0
- package/dist/components/chip.js +100 -0
- package/dist/components/chip.js.map +1 -0
- package/dist/components/code-block.d.ts +99 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +144 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +17 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +25 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +51 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +120 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/composer.d.ts +211 -0
- package/dist/components/composer.d.ts.map +1 -0
- package/dist/components/composer.js +605 -0
- package/dist/components/composer.js.map +1 -0
- package/dist/components/connector-request.d.ts +63 -0
- package/dist/components/connector-request.d.ts.map +1 -0
- package/dist/components/connector-request.js +57 -0
- package/dist/components/connector-request.js.map +1 -0
- package/dist/components/context-menu.d.ts +26 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +33 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +61 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +79 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +54 -0
- package/dist/components/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker.js +451 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +46 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +75 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +85 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +166 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +77 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +112 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/editor-tabs.d.ts +49 -0
- package/dist/components/editor-tabs.d.ts.map +1 -0
- package/dist/components/editor-tabs.js +157 -0
- package/dist/components/editor-tabs.js.map +1 -0
- package/dist/components/empty-state.d.ts +21 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +14 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/entity-card.d.ts +301 -0
- package/dist/components/entity-card.d.ts.map +1 -0
- package/dist/components/entity-card.js +392 -0
- package/dist/components/entity-card.js.map +1 -0
- package/dist/components/entity-row.d.ts +37 -0
- package/dist/components/entity-row.d.ts.map +1 -0
- package/dist/components/entity-row.js +65 -0
- package/dist/components/entity-row.js.map +1 -0
- package/dist/components/env-var-request.d.ts +51 -0
- package/dist/components/env-var-request.d.ts.map +1 -0
- package/dist/components/env-var-request.js +50 -0
- package/dist/components/env-var-request.js.map +1 -0
- package/dist/components/field.d.ts +30 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +48 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-upload.d.ts +108 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +217 -0
- package/dist/components/file-upload.js.map +1 -0
- package/dist/components/hover-card.d.ts +18 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +84 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +29 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +9 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +13 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/island.d.ts +18 -0
- package/dist/components/island.d.ts.map +1 -0
- package/dist/components/island.js +30 -0
- package/dist/components/island.js.map +1 -0
- package/dist/components/kbd.d.ts +7 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +11 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +8 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +12 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/markdown.d.ts +24 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +38 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/message.d.ts +38 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +25 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +94 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +22 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +36 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/password-input.d.ts +5 -0
- package/dist/components/password-input.d.ts.map +1 -0
- package/dist/components/password-input.js +12 -0
- package/dist/components/password-input.js.map +1 -0
- package/dist/components/pepper.d.ts +92 -0
- package/dist/components/pepper.d.ts.map +1 -0
- package/dist/components/pepper.js +1279 -0
- package/dist/components/pepper.js.map +1 -0
- package/dist/components/permission-request.d.ts +53 -0
- package/dist/components/permission-request.d.ts.map +1 -0
- package/dist/components/permission-request.js +54 -0
- package/dist/components/permission-request.js.map +1 -0
- package/dist/components/popover.d.ts +42 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +76 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +9 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +12 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/progressive-blur.d.ts +31 -0
- package/dist/components/progressive-blur.d.ts.map +1 -0
- package/dist/components/progressive-blur.js +44 -0
- package/dist/components/progressive-blur.js.map +1 -0
- package/dist/components/radio-group.d.ts +8 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +15 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/request-card.d.ts +34 -0
- package/dist/components/request-card.d.ts.map +1 -0
- package/dist/components/request-card.js +50 -0
- package/dist/components/request-card.js.map +1 -0
- package/dist/components/resizable.d.ts +24 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +40 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/responsive-overlay.d.ts +136 -0
- package/dist/components/responsive-overlay.d.ts.map +1 -0
- package/dist/components/responsive-overlay.js +302 -0
- package/dist/components/responsive-overlay.js.map +1 -0
- package/dist/components/scroll-shadows.d.ts +11 -0
- package/dist/components/scroll-shadows.d.ts.map +1 -0
- package/dist/components/scroll-shadows.js +53 -0
- package/dist/components/scroll-shadows.js.map +1 -0
- package/dist/components/search-field.d.ts +16 -0
- package/dist/components/search-field.d.ts.map +1 -0
- package/dist/components/search-field.js +50 -0
- package/dist/components/search-field.js.map +1 -0
- package/dist/components/searchable-select.d.ts +43 -0
- package/dist/components/searchable-select.d.ts.map +1 -0
- package/dist/components/searchable-select.js +39 -0
- package/dist/components/searchable-select.js.map +1 -0
- package/dist/components/select.d.ts +60 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +94 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +7 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +12 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/settings-section.d.ts +41 -0
- package/dist/components/settings-section.d.ts.map +1 -0
- package/dist/components/settings-section.js +50 -0
- package/dist/components/settings-section.js.map +1 -0
- package/dist/components/sidebar-item.d.ts +41 -0
- package/dist/components/sidebar-item.d.ts.map +1 -0
- package/dist/components/sidebar-item.js +59 -0
- package/dist/components/sidebar-item.js.map +1 -0
- package/dist/components/skeleton.d.ts +7 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +11 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +10 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +36 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +8 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +21 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +7 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +12 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat-strip.d.ts +20 -0
- package/dist/components/stat-strip.d.ts.map +1 -0
- package/dist/components/stat-strip.js +11 -0
- package/dist/components/stat-strip.js.map +1 -0
- package/dist/components/status-dot.d.ts +25 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot.js +31 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/subagent-run.d.ts +27 -0
- package/dist/components/subagent-run.d.ts.map +1 -0
- package/dist/components/subagent-run.js +38 -0
- package/dist/components/subagent-run.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +13 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/system-notice.d.ts +34 -0
- package/dist/components/system-notice.d.ts.map +1 -0
- package/dist/components/system-notice.js +52 -0
- package/dist/components/system-notice.js.map +1 -0
- package/dist/components/table.d.ts +27 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +37 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +40 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +52 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +9 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/thinking-indicator.d.ts +21 -0
- package/dist/components/thinking-indicator.d.ts.map +1 -0
- package/dist/components/thinking-indicator.js +136 -0
- package/dist/components/thinking-indicator.js.map +1 -0
- package/dist/components/thread-status.d.ts +25 -0
- package/dist/components/thread-status.d.ts.map +1 -0
- package/dist/components/thread-status.js +41 -0
- package/dist/components/thread-status.js.map +1 -0
- package/dist/components/todo-list.d.ts +52 -0
- package/dist/components/todo-list.d.ts.map +1 -0
- package/dist/components/todo-list.js +137 -0
- package/dist/components/todo-list.js.map +1 -0
- package/dist/components/toggle-group.d.ts +17 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +26 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +27 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +44 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tool-call.d.ts +60 -0
- package/dist/components/tool-call.d.ts.map +1 -0
- package/dist/components/tool-call.js +94 -0
- package/dist/components/tool-call.js.map +1 -0
- package/dist/components/tool-result.d.ts +127 -0
- package/dist/components/tool-result.d.ts.map +1 -0
- package/dist/components/tool-result.js +155 -0
- package/dist/components/tool-result.js.map +1 -0
- package/dist/components/tooltip.d.ts +18 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +38 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/trace.d.ts +38 -0
- package/dist/components/trace.d.ts.map +1 -0
- package/dist/components/trace.js +52 -0
- package/dist/components/trace.js.map +1 -0
- package/dist/components/turn-summary.d.ts +17 -0
- package/dist/components/turn-summary.d.ts.map +1 -0
- package/dist/components/turn-summary.js +19 -0
- package/dist/components/turn-summary.js.map +1 -0
- package/dist/components/usage-meter.d.ts +16 -0
- package/dist/components/usage-meter.d.ts.map +1 -0
- package/dist/components/usage-meter.js +10 -0
- package/dist/components/usage-meter.js.map +1 -0
- package/dist/components/view-switcher.d.ts +25 -0
- package/dist/components/view-switcher.d.ts.map +1 -0
- package/dist/components/view-switcher.js +196 -0
- package/dist/components/view-switcher.js.map +1 -0
- package/dist/docs/components/accordion.md +151 -0
- package/dist/docs/components/activity-chart.md +104 -0
- package/dist/docs/components/alert-dialog.md +216 -0
- package/dist/docs/components/alert.md +203 -0
- package/dist/docs/components/ask-user-question.md +429 -0
- package/dist/docs/components/attachment-gallery.md +377 -0
- package/dist/docs/components/avatar.md +197 -0
- package/dist/docs/components/badge.md +162 -0
- package/dist/docs/components/brand-tile.md +138 -0
- package/dist/docs/components/button.md +392 -0
- package/dist/docs/components/calendar.md +113 -0
- package/dist/docs/components/card.md +157 -0
- package/dist/docs/components/carousel.md +144 -0
- package/dist/docs/components/catalog-card.md +136 -0
- package/dist/docs/components/chart.md +608 -0
- package/dist/docs/components/checkbox.md +164 -0
- package/dist/docs/components/chip.md +411 -0
- package/dist/docs/components/code-block.md +389 -0
- package/dist/docs/components/collapsible.md +93 -0
- package/dist/docs/components/command.md +276 -0
- package/dist/docs/components/composer.md +1092 -0
- package/dist/docs/components/connector-request.md +497 -0
- package/dist/docs/components/context-menu.md +127 -0
- package/dist/docs/components/data-table.md +462 -0
- package/dist/docs/components/date-range-picker.md +425 -0
- package/dist/docs/components/dialog.md +263 -0
- package/dist/docs/components/drawer.md +505 -0
- package/dist/docs/components/dropdown-menu.md +336 -0
- package/dist/docs/components/editor-tabs.md +283 -0
- package/dist/docs/components/empty-state.md +134 -0
- package/dist/docs/components/entity-card.md +640 -0
- package/dist/docs/components/entity-row.md +291 -0
- package/dist/docs/components/env-var-request.md +223 -0
- package/dist/docs/components/field.md +272 -0
- package/dist/docs/components/file-upload.md +255 -0
- package/dist/docs/components/hover-card.md +335 -0
- package/dist/docs/components/input-group.md +134 -0
- package/dist/docs/components/input.md +97 -0
- package/dist/docs/components/island.md +97 -0
- package/dist/docs/components/kbd.md +91 -0
- package/dist/docs/components/markdown.md +180 -0
- package/dist/docs/components/message.md +336 -0
- package/dist/docs/components/page-header.md +203 -0
- package/dist/docs/components/pagination.md +211 -0
- package/dist/docs/components/password-input.md +68 -0
- package/dist/docs/components/pepper.md +238 -0
- package/dist/docs/components/permission-request.md +265 -0
- package/dist/docs/components/popover.md +206 -0
- package/dist/docs/components/progress.md +142 -0
- package/dist/docs/components/progressive-blur.md +195 -0
- package/dist/docs/components/radio-group.md +129 -0
- package/dist/docs/components/request-card.md +305 -0
- package/dist/docs/components/resizable.md +318 -0
- package/dist/docs/components/responsive-overlay.md +449 -0
- package/dist/docs/components/scroll-shadows.md +161 -0
- package/dist/docs/components/search-field.md +86 -0
- package/dist/docs/components/searchable-select.md +144 -0
- package/dist/docs/components/select.md +331 -0
- package/dist/docs/components/separator.md +80 -0
- package/dist/docs/components/settings-section.md +246 -0
- package/dist/docs/components/sidebar-item.md +307 -0
- package/dist/docs/components/skeleton.md +107 -0
- package/dist/docs/components/slider.md +171 -0
- package/dist/docs/components/sonner.md +122 -0
- package/dist/docs/components/spinner.md +112 -0
- package/dist/docs/components/stat-strip.md +85 -0
- package/dist/docs/components/status-dot.md +190 -0
- package/dist/docs/components/subagent-run.md +196 -0
- package/dist/docs/components/switch.md +91 -0
- package/dist/docs/components/system-notice.md +144 -0
- package/dist/docs/components/table.md +201 -0
- package/dist/docs/components/tabs.md +233 -0
- package/dist/docs/components/textarea.md +89 -0
- package/dist/docs/components/thinking-indicator.md +164 -0
- package/dist/docs/components/thread-status.md +143 -0
- package/dist/docs/components/todo-list.md +225 -0
- package/dist/docs/components/toggle-group.md +117 -0
- package/dist/docs/components/toggle.md +132 -0
- package/dist/docs/components/tool-call.md +237 -0
- package/dist/docs/components/tool-result.md +418 -0
- package/dist/docs/components/tooltip.md +136 -0
- package/dist/docs/components/trace.md +319 -0
- package/dist/docs/components/turn-summary.md +218 -0
- package/dist/docs/components/usage-meter.md +69 -0
- package/dist/docs/components/view-switcher.md +193 -0
- package/dist/docs/foundations/colors.md +83 -0
- package/dist/docs/foundations/elevation.md +19 -0
- package/dist/docs/foundations/iconography.md +34 -0
- package/dist/docs/foundations/layout.md +42 -0
- package/dist/docs/foundations/logo.md +111 -0
- package/dist/docs/foundations/motion.md +91 -0
- package/dist/docs/foundations/radius.md +13 -0
- package/dist/docs/foundations/spacing.md +23 -0
- package/dist/docs/foundations/typography.md +42 -0
- package/dist/docs/getting-started/installation.md +116 -0
- package/dist/docs/getting-started/releases.md +59 -0
- package/dist/docs/getting-started/theming.md +58 -0
- package/dist/docs/guidelines/accessibility.md +28 -0
- package/dist/docs/guidelines/content.md +36 -0
- package/dist/docs/guidelines/forms.md +36 -0
- package/dist/docs/guidelines/principles.md +30 -0
- package/dist/docs/hooks/use-is-mobile.md +134 -0
- package/dist/docs/index.md +182 -0
- package/dist/docs/overview.md +35 -0
- package/dist/docs/patterns/chat.md +477 -0
- package/dist/docs/patterns/index.md +13 -0
- package/dist/docs/patterns/login.md +311 -0
- package/dist/docs/patterns/share.md +415 -0
- package/dist/hooks/use-is-mobile.d.ts +9 -0
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +26 -0
- package/dist/hooks/use-is-mobile.js.map +1 -0
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +31 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/code-language.d.ts +8 -0
- package/dist/lib/code-language.d.ts.map +1 -0
- package/dist/lib/code-language.js +48 -0
- package/dist/lib/code-language.js.map +1 -0
- package/dist/lib/date-range.d.ts +122 -0
- package/dist/lib/date-range.d.ts.map +1 -0
- package/dist/lib/date-range.js +281 -0
- package/dist/lib/date-range.js.map +1 -0
- package/dist/lib/major-tokens.d.ts +40 -0
- package/dist/lib/major-tokens.d.ts.map +1 -0
- package/dist/lib/major-tokens.js +602 -0
- package/dist/lib/major-tokens.js.map +1 -0
- package/dist/lib/markdown.d.ts +25 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/markdown.js +87 -0
- package/dist/lib/markdown.js.map +1 -0
- package/dist/lib/overlay-portal-branch.d.ts +6 -0
- package/dist/lib/overlay-portal-branch.d.ts.map +1 -0
- package/dist/lib/overlay-portal-branch.js +15 -0
- package/dist/lib/overlay-portal-branch.js.map +1 -0
- package/dist/lib/pepper-matcap.d.ts +2 -0
- package/dist/lib/pepper-matcap.d.ts.map +1 -0
- package/dist/lib/pepper-matcap.js +4 -0
- package/dist/lib/pepper-matcap.js.map +1 -0
- package/dist/lib/scroll-fade.d.ts +28 -0
- package/dist/lib/scroll-fade.d.ts.map +1 -0
- package/dist/lib/scroll-fade.js +57 -0
- package/dist/lib/scroll-fade.js.map +1 -0
- package/dist/tailwind.css +7 -0
- package/dist/theme.css +428 -0
- package/package.json +145 -3
- package/tokens.json +841 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range-picker.js","sourceRoot":"","sources":["../../src/components/date-range-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,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AK,GAAQ,EAC7D,OAAO,IAAI,KAAK,CAAC,QAAQ,KAAK,UAAU,CAAC,GAAG,IAAI,KAAC,KAAK,IAAC,OAAO,EAAE,cAAc,CAAC,OAAO,oBAAa,EACpG,KAAC,WAAW,IAAC,SAAS,EAAC,sCAAsC,GAAG,IACjD,EACjB,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,gBACA,YAAY,IAAI,CAAC,WAAW,EAAE,EAAE,EAC5C,YAAY,EAAE,KAAK;gBACnB,iHAAiH;gBACjH,gHAAgH;gBAChH,+GAA+G;gBAC/G,6FAA6F;gBAC7F,SAAS,EAAE,EAAE,CACX,uGAAuG,EACvG,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAC9B,YAGD,KAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,iBAAiB,EAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,GAChC,GACa,IACT,CACX,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport { useId, useState, useSyncExternalStore, type ChangeEvent, type FocusEvent, type KeyboardEvent, type ReactNode } from \"react\";\nimport { CalendarDays, Check, ChevronDown, CircleAlert, Clock, Globe, Info } from \"lucide-react\";\nimport { dateMatchModifiers } from \"react-day-picker\";\nimport { cn } from \"../lib/cn.ts\";\nimport {\n DATE_PICKER_PRESETS,\n DATE_RANGE_MODES,\n LAST_MINUTE_OF_DAY,\n MINUTES_PER_DAY,\n TIME_ZONES,\n addDays,\n checkIfSameDay,\n createDayPreset,\n createLastDaysPreset,\n createRollingPreset,\n formatDay,\n formatDuration,\n formatRange,\n formatTime,\n fromWallTime,\n fromWallTimeEnd,\n getClockMinutes,\n getLocalTimeZoneLabel,\n getToday,\n getWholeDays,\n parseDate,\n parseTime,\n startOfDay,\n startOfMonth,\n toWallTime,\n type DateRangeMode,\n type DateRangePreset,\n type DateRangeValue,\n type TimeZone,\n type WallTime,\n} from \"../lib/date-range.ts\";\nimport { BADGE_VARIANTS, Badge } from \"./badge.tsx\";\nimport { BUTTON_SIZES, BUTTON_VARIANTS, Button } from \"./button.tsx\";\nimport { Calendar, type CalendarProps } from \"./calendar.tsx\";\nimport { Input } from \"./input.tsx\";\nimport { INPUT_GROUP_ADDON_ALIGNS, InputGroup, InputGroupAddon, InputGroupInput } from \"./input-group.tsx\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover.tsx\";\nimport { SELECT_TRIGGER_SIZES, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, getSelectTriggerClassName } from \"./select.tsx\";\nimport { Separator } from \"./separator.tsx\";\n\n// The helpers products build quick ranges and values with, so the component is all a page imports.\nexport {\n DATE_PICKER_PRESETS,\n DATE_RANGE_MODES,\n TIME_ZONES,\n addDays,\n createDayPreset,\n createLastDaysPreset,\n createRollingPreset,\n formatRange,\n fromWallTime,\n getToday,\n getWholeDays,\n toWallTime,\n};\nexport type { DateRange, DateRangeMode, DateRangePreset, DateRangeValue, TimeZone, WallTime } from \"../lib/date-range.ts\";\n\nexport const DATE_RANGE_PICKER_ALIGNS = { START: \"start\", END: \"end\" } as const;\n\n/** Steps of a time field's arrows: 15 minutes, an hour with Shift; its list's spacing: every half hour. */\nconst TIME_STEP_MINUTES = 15;\nconst TIME_STEP_SHIFT_MINUTES = 60;\nconst TIME_OPTION_MINUTES = 30;\nconst TIME_OPTIONS = Array.from({ length: MINUTES_PER_DAY / TIME_OPTION_MINUTES }, (_, index) => index * TIME_OPTION_MINUTES);\nconst LAST_TIME_OPTION = TIME_OPTIONS[TIME_OPTIONS.length - 1];\nconst DEFAULT_LIST_MINUTES = 9 * 60;\n/** A range picked on one day whose end isn't after its start ends this much later. */\nconst SAME_DAY_SPAN_MINUTES = 60;\nconst NO_PRESETS: DateRangePreset[] = [];\n\n// ── The typed ends ──\n\ninterface FieldProps<TValue> {\n value: TValue | null;\n /** A value it could read; `null` from a date field emptied. */\n onValueChange: (value: TValue | null) => void;\n /** Whether the text in it can't be read. */\n onInvalidChange: (isInvalid: boolean) => void;\n /** Enter on a value it could read: the picker applies, with that value. */\n onSubmit: (value: TValue | null) => void;\n /** Marked invalid from outside: a day that can't be picked, an end not after the start. */\n isInvalid: boolean;\n \"aria-label\": string;\n className?: string;\n}\n\n/**\n * Reads \"Nov 18\", \"2026-11-18\" or \"11/18\" on Enter or blur; keeps text it can't read, marked, so it can be fixed. A\n * missing year is `reference`'s, or with `isOnOrAfterReference` the first that keeps the day on or after it.\n */\nfunction DateField({\n value,\n onValueChange,\n onInvalidChange,\n onSubmit,\n isInvalid,\n reference,\n isOnOrAfterReference = false,\n placeholder,\n today,\n className,\n ...props\n}: FieldProps<Date> & { reference: Date; isOnOrAfterReference?: boolean; placeholder: string; today: Date }) {\n const [text, setText] = useState<string | null>(null);\n const [isUnreadable, setIsUnreadable] = useState(false);\n const [lastValue, setLastValue] = useState(value);\n\n // A day set from outside (a calendar pick, another zone) replaces text that was typed and not taken.\n if (value?.getTime() !== lastValue?.getTime()) {\n setLastValue(value);\n setText(null);\n setIsUnreadable(false);\n }\n const shownText = text ?? (value ? formatDay(value, { hasYear: true }) : \"\");\n\n const take = (day: Date | null) => {\n setText(null);\n setIsUnreadable(false);\n onInvalidChange(false);\n onValueChange(day);\n };\n\n /** Takes the text; whether it could be read. */\n const commit = () => {\n if (text === null) {\n return true;\n }\n\n if (text.trim() === \"\") {\n take(null);\n return true;\n }\n\n const day = parseDate(text, reference, { isOnOrAfterReference, today });\n\n if (!day) {\n setIsUnreadable(true);\n onInvalidChange(true);\n return false;\n }\n\n take(day);\n return true;\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n event.preventDefault();\n const current = (text !== null && parseDate(text, reference, { isOnOrAfterReference, today })) || value || today;\n take(addDays(current, event.key === \"ArrowUp\" ? 1 : -1));\n }\n\n if (event.key === \"Enter\") {\n event.preventDefault();\n const isUnchanged = text === null;\n\n if (commit() && isUnchanged) {\n onSubmit(value);\n }\n }\n };\n\n return (\n <Input\n type=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n aria-label={props[\"aria-label\"]}\n aria-invalid={isUnreadable || isInvalid || undefined}\n placeholder={placeholder}\n value={shownText}\n onChange={(event) => setText(event.target.value)}\n onFocus={(event) => event.currentTarget.select()}\n onBlur={commit}\n onKeyDown={handleKeyDown}\n className={cn(\"tabular-nums\", className)}\n />\n );\n}\n\nconst clampMinutes = (minutes: number) => Math.min(LAST_MINUTE_OF_DAY, Math.max(0, minutes));\n\n/** The next multiple of `step` above or below `minutes`. */\nfunction stepMinutes(minutes: number, step: number, direction: 1 | -1) {\n const snapped = direction > 0 ? Math.floor(minutes / step) * step + step : Math.ceil(minutes / step) * step - step;\n\n return clampMinutes(snapped);\n}\n\n/** Reads \"930\", \"9:30pm\" or \"14:00\", lists every half hour under it, and steps with ↑ ↓ (Shift: an hour). */\nfunction TimeField({ value, onValueChange, onInvalidChange, onSubmit, isInvalid, className, ...props }: FieldProps<number>) {\n const [text, setText] = useState<string | null>(null);\n const [isUnreadable, setIsUnreadable] = useState(false);\n const [isListVisible, setIsListVisible] = useState(false);\n const shownText = text ?? (value === null ? \"\" : formatTime(value));\n const typedMinutes = text === null ? null : parseTime(text);\n const highlightedMinutes = Math.min(\n LAST_TIME_OPTION,\n Math.round((typedMinutes ?? value ?? DEFAULT_LIST_MINUTES) / TIME_OPTION_MINUTES) * TIME_OPTION_MINUTES\n );\n const listId = useId();\n // Announced only when it is the time in the field: 2:21 AM rounds to the 2:30 AM option, which isn't it.\n const activeOptionId =\n isListVisible && highlightedMinutes === (typedMinutes ?? value) ? `${listId}-${highlightedMinutes}` : undefined;\n\n const choose = (minutes: number) => {\n setText(null);\n setIsUnreadable(false);\n onInvalidChange(false);\n onValueChange(minutes);\n };\n\n /** Takes the text; the time the field holds after, or null when the text can't be read. */\n const commit = () => {\n if (text === null) {\n return value;\n }\n\n const minutes = parseTime(text);\n\n if (minutes === null) {\n setIsUnreadable(true);\n onInvalidChange(true);\n return null;\n }\n\n choose(minutes);\n return minutes;\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n event.preventDefault();\n const step = event.shiftKey ? TIME_STEP_SHIFT_MINUTES : TIME_STEP_MINUTES;\n choose(stepMinutes(typedMinutes ?? value ?? DEFAULT_LIST_MINUTES, step, event.key === \"ArrowUp\" ? 1 : -1));\n setIsListVisible(true);\n }\n\n if (event.key === \"Enter\") {\n event.preventDefault();\n const wasListVisible = isListVisible;\n const minutes = commit();\n setIsListVisible(false);\n\n // The first Enter closes the list; the next one, on a time it could read, applies with that time: the picker's\n // draft only has it on the next render.\n if (!wasListVisible && minutes !== null) {\n onSubmit(minutes);\n }\n }\n\n // Escape closes an open time list first. The popover or sheet around the field listens for Escape on the document,\n // so the key goes no further and it stays open. React may listen on the document too (Next hydrates the whole\n // document), where stopping propagation doesn't stop the overlay's listener beside it: stopping it immediately does,\n // since React's was added first.\n if (event.key === \"Escape\" && isListVisible) {\n event.stopPropagation();\n event.nativeEvent.stopImmediatePropagation();\n setIsListVisible(false);\n }\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setText(event.target.value);\n setIsListVisible(true);\n };\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n setIsListVisible(true);\n };\n\n const handleBlur = () => {\n commit();\n setIsListVisible(false);\n };\n\n // Keeps the highlighted time in the middle of the list as it changes.\n const scrollToHighlighted = (option: HTMLDivElement | null) => {\n const list = option?.parentElement;\n\n if (option && list) {\n list.scrollTop = option.offsetTop - list.clientHeight / 2 + option.offsetHeight / 2;\n }\n };\n\n return (\n <div className={cn(\"relative min-w-0\", className)}>\n <InputGroup>\n <InputGroupInput\n type=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n role=\"combobox\"\n aria-label={props[\"aria-label\"]}\n aria-expanded={isListVisible}\n aria-controls={listId}\n aria-autocomplete=\"none\"\n aria-activedescendant={activeOptionId}\n aria-invalid={isUnreadable || isInvalid || undefined}\n value={shownText}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n className=\"tabular-nums\"\n />\n <InputGroupAddon align={INPUT_GROUP_ADDON_ALIGNS.INLINE_END}>\n <Clock />\n </InputGroupAddon>\n </InputGroup>\n {isListVisible && (\n <div\n id={listId}\n role=\"listbox\"\n aria-label={`${props[\"aria-label\"]} suggestions`}\n // The input keeps focus while a time is clicked.\n onMouseDown={(event) => event.preventDefault()}\n // Opens upward, over the calendar: below it would hang out of the popover, over Apply.\n className=\"absolute right-0 bottom-full z-50 mb-space-4 flex max-h-49 w-32 flex-col overflow-y-auto overscroll-contain rounded-xl border border-panel-edge bg-surface p-space-4 shadow-pop\"\n >\n {TIME_OPTIONS.map((minutes) => {\n const isHighlighted = minutes === highlightedMinutes;\n\n return (\n <div\n key={minutes}\n ref={isHighlighted ? scrollToHighlighted : undefined}\n id={`${listId}-${minutes}`}\n role=\"option\"\n aria-selected={minutes === value}\n onClick={() => {\n choose(minutes);\n setIsListVisible(false);\n }}\n className={cn(\n \"flex h-7 shrink-0 cursor-pointer items-center justify-between rounded-row px-space-8 text-ui tabular-nums text-ink hover:bg-hover\",\n isHighlighted && \"bg-hover\"\n )}\n >\n {formatTime(minutes)}\n {minutes === value && <Check className=\"size-3.5 text-link\" />}\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n\n// ── The picker ──\n\n/** What the popover edits until Apply: each end's day and time, read in its time zone. */\ninterface DateRangeDraft {\n fromDay: Date | null;\n fromMinutes: number;\n toDay: Date | null;\n toMinutes: number;\n timeZone: TimeZone;\n /** The quick range picked, until an end is changed by hand. */\n presetId: string | null;\n /** The first day is picked: the next pick on the calendar ends the range. */\n isAwaitingEnd: boolean;\n}\n\nconst INVALID_FIELDS = { FROM_DAY: \"fromDay\", FROM_TIME: \"fromTime\", TO_DAY: \"toDay\", TO_TIME: \"toTime\" } as const;\n\ntype InvalidFields = Partial<Record<(typeof INVALID_FIELDS)[keyof typeof INVALID_FIELDS], boolean>>;\n\nconst MESSAGE_KINDS = { HINT: \"hint\", ERROR: \"error\", ORDER: \"order\", SPAN: \"span\" } as const;\n\ninterface DraftMessage {\n kind: (typeof MESSAGE_KINDS)[keyof typeof MESSAGE_KINDS];\n text: string;\n}\n\nconst RANGE_ENDS = { START: \"start\", END: \"end\" } as const;\n\ntype RangeEnd = (typeof RANGE_ENDS)[keyof typeof RANGE_ENDS];\n\nfunction getDraft(value: DateRangeValue): DateRangeDraft {\n const from = toWallTime(value.range.from, value.timeZone);\n const to = toWallTime(value.range.to, value.timeZone);\n\n return {\n fromDay: from.day,\n fromMinutes: from.minutes,\n toDay: to.day,\n toMinutes: to.minutes,\n timeZone: value.timeZone,\n presetId: value.presetId,\n isAwaitingEnd: false,\n };\n}\n\n/** The same instants, read in another zone. */\nfunction convertDraft(draft: DateRangeDraft, timeZone: TimeZone): DateRangeDraft {\n const convert = (day: Date | null, minutes: number) =>\n day ? toWallTime(fromWallTime({ day, minutes }, draft.timeZone), timeZone) : { day, minutes };\n const from = convert(draft.fromDay, draft.fromMinutes);\n const to = convert(draft.toDay, draft.toMinutes);\n\n return { ...draft, fromDay: from.day, fromMinutes: from.minutes, toDay: to.day, toMinutes: to.minutes, timeZone };\n}\n\n/**\n * A range picked on one day whose end isn't after its start ends an hour after the start; from 11 PM, at 11:59 PM; from\n * 11:59 PM, at the next midnight.\n */\nfunction fitSameDayEnd(draft: DateRangeDraft): DateRangeDraft {\n const isSameDay = !draft.isAwaitingEnd && checkIfSameDay(draft.fromDay, draft.toDay);\n\n if (!draft.fromDay || !isSameDay || draft.toMinutes > draft.fromMinutes) {\n return draft;\n }\n\n if (draft.fromMinutes + SAME_DAY_SPAN_MINUTES <= LAST_MINUTE_OF_DAY) {\n return { ...draft, toMinutes: draft.fromMinutes + SAME_DAY_SPAN_MINUTES };\n }\n\n if (draft.fromMinutes < LAST_MINUTE_OF_DAY) {\n return { ...draft, toMinutes: LAST_MINUTE_OF_DAY };\n }\n\n return { ...draft, toDay: addDays(draft.fromDay, 1), toMinutes: 0 };\n}\n\ninterface DraftReading {\n /** The last day, once it is picked. */\n toDay: Date | null;\n from: WallTime | null;\n to: WallTime | null;\n message: DraftMessage;\n /** The end is before the start: \"Swap them\" fixes it. */\n isSwappable: boolean;\n /** The end is before or at the start. */\n isOutOfOrder: boolean;\n isFromDayDisabled: boolean;\n isToDayDisabled: boolean;\n isApplicable: boolean;\n}\n\n/** What a draft says: its ends, the message under the fields, and whether Apply takes it. */\nfunction readDraft(\n draft: DateRangeDraft,\n invalid: InvalidFields,\n { hasTime, checkIfDayDisabled }: { hasTime: boolean; checkIfDayDisabled: (day: Date) => boolean }\n): DraftReading {\n // The last day counts only once it is picked.\n const toDay = draft.isAwaitingEnd ? null : draft.toDay;\n // In date mode a range is whole days, whatever the times held.\n const from = draft.fromDay && { day: draft.fromDay, minutes: hasTime ? draft.fromMinutes : 0 };\n const to = toDay && { day: toDay, minutes: hasTime ? draft.toMinutes : LAST_MINUTE_OF_DAY };\n // A quick range is the page's, its days whatever it says: only ends picked or typed are checked.\n const isCustom = draft.presetId === null;\n const isFromDayDisabled = isCustom && draft.fromDay !== null && checkIfDayDisabled(draft.fromDay);\n const isToDayDisabled = isCustom && toDay !== null && checkIfDayDisabled(toDay);\n const order = from && to ? Math.sign(getClockMinutes(to) - getClockMinutes(from)) : 1;\n const isOutOfOrder = order <= 0;\n\n const getMessage = (): DraftMessage => {\n if (invalid.fromDay || invalid.toDay) {\n return { kind: MESSAGE_KINDS.ERROR, text: \"Type a date like Nov 18, 2026 or 2026-11-18.\" };\n }\n\n if (invalid.fromTime || invalid.toTime) {\n return { kind: MESSAGE_KINDS.ERROR, text: \"Type a time like 9:30 AM, 930 or 14:00.\" };\n }\n\n if (!from) {\n return { kind: MESSAGE_KINDS.HINT, text: \"Pick the first day, then the last.\" };\n }\n\n if (!to) {\n return { kind: MESSAGE_KINDS.HINT, text: \"Now pick the last day.\" };\n }\n\n const disabledDay = isFromDayDisabled ? from.day : isToDayDisabled ? to.day : null;\n\n if (disabledDay) {\n return { kind: MESSAGE_KINDS.ERROR, text: `${formatDay(disabledDay, { hasYear: true })} can't be picked.` };\n }\n\n if (isOutOfOrder) {\n return { kind: MESSAGE_KINDS.ORDER, text: order < 0 ? \"The end is before the start.\" : \"The end is the same as the start.\" };\n }\n\n return { kind: MESSAGE_KINDS.SPAN, text: formatDuration(from, to) };\n };\n\n const message = getMessage();\n const isUnreadable = Object.values(invalid).some(Boolean);\n\n return {\n toDay,\n from,\n to,\n message,\n isSwappable: message.kind === MESSAGE_KINDS.ORDER && order < 0,\n isOutOfOrder: message.kind === MESSAGE_KINDS.ORDER,\n isFromDayDisabled,\n isToDayDisabled,\n isApplicable: message.kind === MESSAGE_KINDS.SPAN || (draft.presetId !== null && !isUnreadable),\n };\n}\n\n/** A preset's own icon, in a 14px box: an SVG icon at that size, or a dot centred in it. */\nfunction PresetIcon({ icon }: { icon: ReactNode }) {\n return <span className=\"flex size-3.5 shrink-0 items-center justify-center text-muted [&_svg]:size-3.5\">{icon}</span>;\n}\n\nconst subscribeToNothing = () => () => {};\n\n/** False while the server renders and the page hydrates, true after: what reads the browser's zone waits for it. */\nconst useIsHydrated = () =>\n useSyncExternalStore(\n subscribeToNothing,\n () => true,\n () => false\n );\n\ninterface DateRangeFieldsProps {\n value: DateRangeValue;\n /** A quick range picked, or a custom range applied. */\n onValueChange: (value: DateRangeValue) => void;\n /**\n * The page's quick ranges: ready ones from `DATE_PICKER_PRESETS`, or built with the helpers exported beside them.\n * None: the calendar and the typed ends alone.\n */\n presets?: DateRangePreset[];\n /** `date-time` (default): a time for each end and a time zone. `date`: whole days. */\n mode?: DateRangeMode;\n /**\n * Days that can't be picked or typed, as Calendar's `disabled` reads them: `{ before: firstDay }`, a function, a list.\n * Days are the picker's, in its time zone. Unset: days after today. `false`: every day can be picked.\n */\n disabledDays?: CalendarProps[\"disabled\"];\n}\n\nexport interface DateRangePickerPanelProps extends DateRangeFieldsProps {\n /** Cancel, beside Apply: the overlay around the panel closes. No Cancel without it. */\n onCancel?: () => void;\n className?: string;\n}\n\n/**\n * What DateRangePicker's popover holds, for an overlay of the page's own: the quick ranges, a month's Calendar, the\n * typed From and To, then the time zone, Cancel and Apply. It starts from `value` when it mounts, as an overlay's\n * content does each time it opens, and reports a quick range picked or a custom range applied through\n * `onValueChange`; the overlay closes itself. 456px from 768px up (312px with no quick ranges), the full width below,\n * where ResponsiveOverlay is a sheet: give a popover around it `w-auto p-0`.\n */\nexport function DateRangePickerPanel({\n value,\n onValueChange,\n presets = NO_PRESETS,\n mode = DATE_RANGE_MODES.DATE_TIME,\n disabledDays,\n onCancel,\n className,\n}: DateRangePickerPanelProps) {\n const hasTime = mode === DATE_RANGE_MODES.DATE_TIME;\n const [draft, setDraft] = useState<DateRangeDraft>(() => getDraft(value));\n const [month, setMonth] = useState(() => startOfMonth(draft.toDay ?? new Date()));\n const [hoveredDay, setHoveredDay] = useState<Date | null>(null);\n const [invalid, setInvalid] = useState<InvalidFields>({});\n const hasPresets = presets.length > 0;\n const today = getToday(new Date(), draft.timeZone);\n const disabledMatcher = disabledDays ?? { after: today };\n const checkIfDayDisabled = (day: Date) => dateMatchModifiers(day, disabledMatcher);\n\n const getEditedDraft = (current: DateRangeDraft, changes: Partial<DateRangeDraft>) => ({ ...current, ...changes, presetId: null });\n\n const editDraft = (changes: Partial<DateRangeDraft>) => setDraft((current) => getEditedDraft(current, changes));\n\n // A day picked or typed can leave the range on one day with no time in it: its end moves after the start.\n const editDays = (changes: Partial<DateRangeDraft>) =>\n setDraft((current) => {\n const next = getEditedDraft(current, changes);\n\n return hasTime ? fitSameDayEnd(next) : next;\n });\n\n const markInvalid = (field: keyof InvalidFields) => (isInvalid: boolean) =>\n setInvalid((current) => ({ ...current, [field]: isInvalid }));\n\n const applyPreset = (preset: DateRangePreset) => {\n onValueChange({ range: preset.getRange(new Date(), draft.timeZone), presetId: preset.id, timeZone: draft.timeZone });\n };\n\n const reading = readDraft(draft, invalid, { hasTime, checkIfDayDisabled });\n const { message, isSwappable, isOutOfOrder, isApplicable } = reading;\n\n /** Applies `target`: the draft, or the draft with a value its field has taken but this render doesn't hold yet. */\n const apply = (target = draft, targetInvalid = invalid) => {\n const preset = presets.find((item) => item.id === target.presetId);\n\n if (preset) {\n applyPreset(preset);\n return;\n }\n\n const { from, to, isApplicable: isTargetApplicable } = readDraft(target, targetInvalid, { hasTime, checkIfDayDisabled });\n\n if (!from || !to || !isTargetApplicable) {\n return;\n }\n\n onValueChange({\n range: { from: fromWallTime(from, target.timeZone), to: fromWallTimeEnd(to, target.timeZone) },\n presetId: null,\n timeZone: target.timeZone,\n });\n };\n\n const submitTime = (end: RangeEnd) => (minutes: number | null) => {\n const field = end === RANGE_ENDS.START ? INVALID_FIELDS.FROM_TIME : INVALID_FIELDS.TO_TIME;\n const current = end === RANGE_ENDS.START ? draft.fromMinutes : draft.toMinutes;\n\n if (minutes === null || minutes === current) {\n apply();\n return;\n }\n\n apply(getEditedDraft(draft, end === RANGE_ENDS.START ? { fromMinutes: minutes } : { toMinutes: minutes }), {\n ...invalid,\n [field]: false,\n });\n };\n\n const pickDay = (day: Date) => {\n if (!draft.isAwaitingEnd || !draft.fromDay) {\n editDays({ fromDay: day, toDay: null, isAwaitingEnd: true });\n } else if (day < draft.fromDay) {\n editDays({ fromDay: day, toDay: draft.fromDay, isAwaitingEnd: false });\n } else {\n editDays({ toDay: day, isAwaitingEnd: false });\n }\n\n setInvalid((current) => ({ ...current, fromDay: false, toDay: false }));\n };\n\n const setEndDay = (end: RangeEnd) => (day: Date | null) => {\n const fromDay = end === RANGE_ENDS.START ? day : draft.fromDay;\n const toDay = end === RANGE_ENDS.END ? day : draft.toDay;\n editDays({ fromDay, toDay, isAwaitingEnd: fromDay !== null && toDay === null });\n\n if (day) {\n setMonth(startOfMonth(day));\n }\n };\n\n // A custom range keeps its instants, read in the other zone. A quick range is read again there (Today in UTC), so the\n // fields show what Apply applies.\n const changeTimeZone = (timeZone: TimeZone) => {\n const preset = presets.find((item) => item.id === draft.presetId);\n\n setDraft(\n preset ? getDraft({ range: preset.getRange(new Date(), timeZone), presetId: preset.id, timeZone }) : convertDraft(draft, timeZone)\n );\n };\n\n const swapEnds = () =>\n editDraft({ fromDay: draft.toDay, fromMinutes: draft.toMinutes, toDay: draft.fromDay, toMinutes: draft.fromMinutes });\n\n // While the end is being chosen, the band runs to the hovered day, whichever side of the start it is.\n const previewDay = draft.isAwaitingEnd && draft.fromDay !== null ? hoveredDay : null;\n const getSelectedRange = () => {\n if (previewDay && draft.fromDay) {\n return previewDay < draft.fromDay ? { from: previewDay, to: draft.fromDay } : { from: draft.fromDay, to: previewDay };\n }\n\n return { from: draft.fromDay ?? undefined, to: reading.toDay ?? undefined };\n };\n\n const handleRailKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const items = [...event.currentTarget.querySelectorAll<HTMLButtonElement>(\"button\")];\n const index = items.indexOf(event.target as HTMLButtonElement);\n const isNext = event.key === \"ArrowDown\" || event.key === \"ArrowRight\";\n const isPrevious = event.key === \"ArrowUp\" || event.key === \"ArrowLeft\";\n\n if (index < 0 || (!isNext && !isPrevious)) {\n return;\n }\n\n event.preventDefault();\n items[(index + (isNext ? 1 : -1) + items.length) % items.length]?.focus();\n };\n\n const getMessageIcon = () => {\n if (message.kind === MESSAGE_KINDS.SPAN) {\n return <Clock />;\n }\n\n return message.kind === MESSAGE_KINDS.HINT ? <Info /> : <CircleAlert />;\n };\n\n const ends = [\n {\n end: RANGE_ENDS.START,\n title: \"From\",\n placeholder: \"First day\",\n day: draft.fromDay,\n minutes: draft.fromMinutes,\n reference: draft.fromDay ?? today,\n isOnOrAfterReference: false,\n isPending: !draft.fromDay,\n isDayInvalid: reading.isFromDayDisabled,\n },\n {\n end: RANGE_ENDS.END,\n title: \"To\",\n placeholder: \"Last day\",\n day: reading.toDay,\n minutes: draft.toMinutes,\n // A year left out is the first that keeps the end on or after the start.\n reference: draft.fromDay ?? draft.toDay ?? today,\n isOnOrAfterReference: draft.fromDay !== null,\n isPending: draft.isAwaitingEnd,\n isDayInvalid: reading.isToDayDisabled || isOutOfOrder,\n },\n ];\n\n return (\n <div\n data-slot=\"date-range-picker-panel\"\n className={cn(\"flex w-full flex-col\", hasPresets ? \"md:w-114\" : \"md:w-78\", className)}\n >\n <div className=\"flex max-sm:flex-col\">\n {hasPresets && (\n <div\n role=\"group\"\n aria-label=\"Quick ranges\"\n onKeyDown={handleRailKeyDown}\n className=\"flex w-36 shrink-0 flex-col gap-space-2 border-r border-line p-space-6 max-sm:w-auto max-sm:flex-row max-sm:overflow-x-auto max-sm:border-r-0 max-sm:border-b\"\n >\n {presets.map((preset) => {\n const isActive = draft.presetId === preset.id;\n\n return (\n <div key={preset.id} className=\"contents\">\n {preset.isGroupStart && <Separator className=\"my-space-4 max-sm:hidden\" />}\n <button\n type=\"button\"\n aria-pressed={isActive}\n onClick={() => applyPreset(preset)}\n className={cn(\n \"flex min-h-7.5 shrink-0 cursor-pointer items-center justify-between gap-space-6 whitespace-nowrap rounded-row px-space-8 text-left font-sans text-ui text-ink outline-none hover:bg-hover focus-visible:ring-2 focus-visible:ring-faint\",\n isActive && \"font-medium\"\n )}\n >\n <span className=\"flex min-w-0 items-center gap-space-6\">\n {preset.icon && <PresetIcon icon={preset.icon} />}\n {preset.label}\n </span>\n {isActive && <Check className=\"size-3.5 shrink-0 text-link\" />}\n </button>\n </div>\n );\n })}\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-space-10 px-space-14 pt-space-10 pb-space-12\">\n <div onMouseLeave={() => setHoveredDay(null)}>\n <Calendar\n mode=\"range\"\n selected={getSelectedRange()}\n onSelect={(_, day) => pickDay(startOfDay(day))}\n disabled={disabledMatcher}\n month={month}\n onMonthChange={setMonth}\n onDayMouseEnter={(day) => setHoveredDay(startOfDay(day))}\n modifiers={{ preview: previewDay && draft.fromDay && previewDay.getTime() !== draft.fromDay.getTime() ? previewDay : [] }}\n // The end being previewed is outlined, not filled: it isn't picked yet. It is the hovered day, so its ring wins over\n // the hover's.\n modifiersClassNames={{\n preview:\n \"[&>button]:font-normal [&>button]:text-ink [&>button>span]:bg-transparent! [&>button>span]:ring-2! [&>button>span]:ring-ink/70!\",\n }}\n today={today}\n autoFocus\n className=\"w-full\"\n />\n </div>\n <div className=\"flex flex-col gap-space-6 border-t border-line pt-space-10\">\n {ends.map(({ end, title, placeholder, day, minutes, reference, isOnOrAfterReference, isPending, isDayInvalid }) => (\n <div key={end} className=\"flex items-center gap-space-8\">\n <span aria-hidden className={cn(\"w-8.5 shrink-0 text-small text-muted\", isPending && \"font-medium text-ink\")}>\n {title}\n </span>\n <DateField\n aria-label={`${title} date`}\n placeholder={placeholder}\n value={day}\n reference={reference}\n isOnOrAfterReference={isOnOrAfterReference}\n today={today}\n onValueChange={setEndDay(end)}\n onInvalidChange={markInvalid(end === RANGE_ENDS.START ? INVALID_FIELDS.FROM_DAY : INVALID_FIELDS.TO_DAY)}\n onSubmit={() => apply()}\n isInvalid={isDayInvalid}\n className={cn(\"min-w-0 flex-1\", isPending && \"border-dashed border-faint\")}\n />\n {hasTime && (\n <TimeField\n aria-label={`${title} time`}\n value={minutes}\n onValueChange={(next) => next !== null && editDraft(end === RANGE_ENDS.START ? { fromMinutes: next } : { toMinutes: next })}\n onInvalidChange={markInvalid(end === RANGE_ENDS.START ? INVALID_FIELDS.FROM_TIME : INVALID_FIELDS.TO_TIME)}\n onSubmit={submitTime(end)}\n isInvalid={end === RANGE_ENDS.END && isOutOfOrder}\n className=\"w-28 shrink-0\"\n />\n )}\n </div>\n ))}\n <div\n aria-live=\"polite\"\n className={cn(\n \"flex min-h-4.5 items-center gap-space-6 text-small text-muted [&_svg]:size-3.5 [&_svg]:shrink-0\",\n (message.kind === MESSAGE_KINDS.ERROR || isOutOfOrder) && \"text-danger\"\n )}\n >\n {getMessageIcon()}\n <span>{message.text}</span>\n {isSwappable && (\n <Button variant={BUTTON_VARIANTS.LINK} className=\"h-auto text-small\" onClick={swapEnds}>\n Swap them\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n <div className=\"flex flex-wrap items-center gap-space-8 border-t border-line px-space-12 py-space-10\">\n {hasTime && (\n <Select\n items={{ [TIME_ZONES.LOCAL]: getLocalTimeZoneLabel(), [TIME_ZONES.UTC]: \"UTC\" }}\n value={draft.timeZone}\n onValueChange={(next) => changeTimeZone(next as TimeZone)}\n >\n <SelectTrigger size={SELECT_TRIGGER_SIZES.SM} aria-label=\"Time zone\" className=\"min-w-0 max-w-60\">\n <Globe className=\"size-3.5 shrink-0 text-muted\" />\n <SelectValue />\n </SelectTrigger>\n <SelectContent data-overlay-portal-branch=\"\">\n <SelectItem value={TIME_ZONES.LOCAL}>{getLocalTimeZoneLabel()}</SelectItem>\n <SelectItem value={TIME_ZONES.UTC}>UTC</SelectItem>\n </SelectContent>\n </Select>\n )}\n {!hasTime && (\n <span className=\"text-small text-muted\">\n {value.timeZone === TIME_ZONES.UTC ? \"Whole days, in UTC\" : \"Whole days, in your time zone\"}\n </span>\n )}\n <div className=\"ml-auto flex gap-space-6\">\n {onCancel && (\n <Button variant={BUTTON_VARIANTS.GHOST} size={BUTTON_SIZES.SM} onClick={onCancel}>\n Cancel\n </Button>\n )}\n <Button size={BUTTON_SIZES.SM} disabled={!isApplicable} onClick={() => apply()}>\n Apply\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\nexport interface DateRangePickerProps extends DateRangeFieldsProps {\n /** Which edge of the trigger the popover lines up with. */\n align?: (typeof DATE_RANGE_PICKER_ALIGNS)[keyof typeof DATE_RANGE_PICKER_ALIGNS];\n defaultOpen?: boolean;\n className?: string;\n}\n\n/**\n * A field-like trigger naming the range (\"Last 7 days\", \"Nov 18, 9:00 AM – Nov 20, 5:30 PM\") that opens one popover:\n * the page's quick ranges if it has any, a month's Calendar for the span, and a typed From and To. A quick range applies\n * in one click; a custom range waits for Apply, which stays off while an end can't be read, falls on a day that can't be\n * picked (after today, unless `disabledDays` says otherwise), or isn't after the start. In `date-time` mode each end\n * has a time and the range a time zone (local or UTC); in `date` mode a range is whole days. The popover holds a\n * DateRangePickerPanel; put the panel in an overlay of your own for another trigger or a sheet on a phone.\n */\nexport function DateRangePicker({\n value,\n onValueChange,\n presets = NO_PRESETS,\n mode = DATE_RANGE_MODES.DATE_TIME,\n disabledDays,\n align = DATE_RANGE_PICKER_ALIGNS.START,\n defaultOpen = false,\n className,\n}: DateRangePickerProps) {\n const hasTime = mode === DATE_RANGE_MODES.DATE_TIME;\n const isHydrated = useIsHydrated();\n const [isOpen, setIsOpen] = useState(defaultOpen);\n const hasPresets = presets.length > 0;\n const activePreset = presets.find((preset) => preset.id === value.presetId);\n // A custom range is written in the browser's zone, which the server doesn't know: it is written once hydrated.\n const rangeText = isHydrated ? formatRange(value.range, { timeZone: value.timeZone, hasTime }) : \"\";\n const label = activePreset?.label ?? rangeText;\n const kind = hasTime ? \"Time range\" : \"Date range\";\n\n const handleValueChange = (next: DateRangeValue) => {\n onValueChange(next);\n setIsOpen(false);\n };\n\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger\n render={\n <button\n type=\"button\"\n data-slot=\"date-range-picker-trigger\"\n aria-label={label ? `${kind}: ${label}` : kind}\n title={rangeText || undefined}\n className={cn(getSelectTriggerClassName(), \"min-w-0 max-w-full justify-start\", className)}\n />\n }\n >\n {activePreset?.icon ? <PresetIcon icon={activePreset.icon} /> : <CalendarDays className=\"size-3.5 shrink-0 text-muted\" />}\n <span className=\"min-w-0 truncate tabular-nums\">{label}</span>\n {hasTime && value.timeZone === TIME_ZONES.UTC && <Badge variant={BADGE_VARIANTS.OUTLINE}>UTC</Badge>}\n <ChevronDown className=\"ml-auto size-3.5 shrink-0 text-muted\" />\n </PopoverTrigger>\n <PopoverContent\n align={align}\n aria-label={`Choose a ${kind.toLowerCase()}`}\n initialFocus={false}\n // Scrolls inside itself when the window is too short for it, on either side of the trigger. From 768px the panel\n // sets the width and the popover's border sits outside it: a fixed width here as well would leave the panel 2px\n // wider than the room inside the border, and the popover would scroll sideways. Below, the popover sets it and\n // the panel fills it. With no quick ranges, as wide as the calendar's column is beside them.\n className={cn(\n \"max-h-(--available-height) max-w-(--available-width) overflow-y-auto overscroll-contain p-0 md:w-auto\",\n hasPresets ? \"w-114\" : \"w-78\"\n )}\n >\n {/* The popover unmounts it when it closes, so each opening starts from the value. */}\n <DateRangePickerPanel\n value={value}\n onValueChange={handleValueChange}\n presets={presets}\n mode={mode}\n disabledDays={disabledDays}\n onCancel={() => setIsOpen(false)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
3
|
+
/** The three dialog widths. Never invent another. */
|
|
4
|
+
export declare const DIALOG_SIZES: {
|
|
5
|
+
/** 420px: invite members, short forms. */
|
|
6
|
+
readonly DEFAULT: "default";
|
|
7
|
+
/** 460px: the connect dialog. */
|
|
8
|
+
readonly LG: "lg";
|
|
9
|
+
/** 540px: the share sheet. */
|
|
10
|
+
readonly XL: "xl";
|
|
11
|
+
};
|
|
12
|
+
type DialogSize = (typeof DIALOG_SIZES)[keyof typeof DIALOG_SIZES];
|
|
13
|
+
/**
|
|
14
|
+
* Root. Controlled with `open` / `onOpenChange`, or uncontrolled with a `DialogTrigger`. A click inside an element
|
|
15
|
+
* marked `data-overlay-portal-branch` (a list portaled out of it), or focus moving there, doesn't close it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Dialog({ onOpenChange, ...props }: DialogPrimitive.Root.Props): import("react").JSX.Element;
|
|
18
|
+
/** Pass the opening control as `render`: `<DialogTrigger render={<Button />}>Invite</DialogTrigger>`. */
|
|
19
|
+
export declare function DialogTrigger(props: DialogPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
20
|
+
export declare function DialogPortal(props: DialogPrimitive.Portal.Props): import("react").JSX.Element;
|
|
21
|
+
/** Closes the dialog: pass the secondary footer button as `render`. */
|
|
22
|
+
export declare function DialogClose(props: DialogPrimitive.Close.Props): import("react").JSX.Element;
|
|
23
|
+
/** The page dims behind a dialog and fades in over 160ms. A dialog opened from another dims the page again. */
|
|
24
|
+
export declare function DialogOverlay({ className, forceRender, ...props }: DialogPrimitive.Backdrop.Props): import("react").JSX.Element;
|
|
25
|
+
type DialogContentProps = DialogPrimitive.Popup.Props & {
|
|
26
|
+
/** 420 (default), 460 (connect) or 540px (share). */
|
|
27
|
+
size?: DialogSize;
|
|
28
|
+
/** The × in the top-right corner. */
|
|
29
|
+
showCloseButton?: boolean;
|
|
30
|
+
overlayClassName?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The sheet, with its portal and overlay: `surface`, `rounded-xl`, `panel-edge` border, `shadow-pop`,
|
|
34
|
+
* 20 × 18px padding and 14px between its parts. Pops in over 160ms.
|
|
35
|
+
*/
|
|
36
|
+
export declare function DialogContent({ className, children, size, showCloseButton, overlayClassName, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
37
|
+
/** Title and optional description, at least 28px tall. Leaves room on the right for the close button. */
|
|
38
|
+
export declare function DialogHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
39
|
+
/** Actions on the right: the secondary first, then the one green or danger action. */
|
|
40
|
+
export declare function DialogFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
41
|
+
/** 16px semibold. Name the task: "Invite members", "Connect GitHub". Required for screen readers. */
|
|
42
|
+
export declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): import("react").JSX.Element;
|
|
43
|
+
/** One `muted` sentence under the title. */
|
|
44
|
+
export declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): import("react").JSX.Element;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMlE,qDAAqD;AACrD,eAAO,MAAM,YAAY;IACvB,0CAA0C;;IAE1C,iCAAiC;;IAEjC,8BAA8B;;CAEtB,CAAC;AAEX,KAAK,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAQnE;;;GAGG;AACH,wBAAgB,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,+BAa5E;AAED,yGAAyG;AACzG,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,+BAEjE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,+BAE/D;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,+BAE7D;AAED,+GAA+G;AAC/G,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,WAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,+BASxG;AAED,KAAK,kBAAkB,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG;IACtD,qDAAqD;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,qCAAqC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,IAA2B,EAC3B,eAAsB,EACtB,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,kBAAkB,+BA4BpB;AAED,yGAAyG;AACzG,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAQ1E;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAE1E;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,+BAQ/E;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,+BAQ3F"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { eventTargetsOverlayPortalBranch } from "../lib/overlay-portal-branch.js";
|
|
7
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "./button.js";
|
|
8
|
+
/** The three dialog widths. Never invent another. */
|
|
9
|
+
export const DIALOG_SIZES = {
|
|
10
|
+
/** 420px: invite members, short forms. */
|
|
11
|
+
DEFAULT: "default",
|
|
12
|
+
/** 460px: the connect dialog. */
|
|
13
|
+
LG: "lg",
|
|
14
|
+
/** 540px: the share sheet. */
|
|
15
|
+
XL: "xl",
|
|
16
|
+
};
|
|
17
|
+
const DIALOG_SIZE_CLASSES = {
|
|
18
|
+
[DIALOG_SIZES.DEFAULT]: "w-105",
|
|
19
|
+
[DIALOG_SIZES.LG]: "w-115",
|
|
20
|
+
[DIALOG_SIZES.XL]: "w-135",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Root. Controlled with `open` / `onOpenChange`, or uncontrolled with a `DialogTrigger`. A click inside an element
|
|
24
|
+
* marked `data-overlay-portal-branch` (a list portaled out of it), or focus moving there, doesn't close it.
|
|
25
|
+
*/
|
|
26
|
+
export function Dialog({ onOpenChange, ...props }) {
|
|
27
|
+
const handleOpenChange = (open, eventDetails) => {
|
|
28
|
+
const isOutsideReason = eventDetails.reason === "outside-press" || eventDetails.reason === "focus-out";
|
|
29
|
+
if (!open && isOutsideReason && eventTargetsOverlayPortalBranch(eventDetails.event)) {
|
|
30
|
+
eventDetails.cancel();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
onOpenChange?.(open, eventDetails);
|
|
34
|
+
};
|
|
35
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", onOpenChange: handleOpenChange, ...props });
|
|
36
|
+
}
|
|
37
|
+
/** Pass the opening control as `render`: `<DialogTrigger render={<Button />}>Invite</DialogTrigger>`. */
|
|
38
|
+
export function DialogTrigger(props) {
|
|
39
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
40
|
+
}
|
|
41
|
+
export function DialogPortal(props) {
|
|
42
|
+
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
43
|
+
}
|
|
44
|
+
/** Closes the dialog: pass the secondary footer button as `render`. */
|
|
45
|
+
export function DialogClose(props) {
|
|
46
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
47
|
+
}
|
|
48
|
+
/** The page dims behind a dialog and fades in over 160ms. A dialog opened from another dims the page again. */
|
|
49
|
+
export function DialogOverlay({ className, forceRender = true, ...props }) {
|
|
50
|
+
return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", forceRender: forceRender, className: cn("fixed inset-0 z-50 bg-dim data-open:animate-fade-in", className), ...props }));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The sheet, with its portal and overlay: `surface`, `rounded-xl`, `panel-edge` border, `shadow-pop`,
|
|
54
|
+
* 20 × 18px padding and 14px between its parts. Pops in over 160ms.
|
|
55
|
+
*/
|
|
56
|
+
export function DialogContent({ className, children, size = DIALOG_SIZES.DEFAULT, showCloseButton = true, overlayClassName, ...props }) {
|
|
57
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, { className: overlayClassName }), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 flex max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-space-14 rounded-xl border border-panel-edge bg-surface px-5 py-4.5 text-ink shadow-pop outline-none data-open:animate-pop-in", DIALOG_SIZE_CLASSES[size], className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", "aria-label": "Close", render: _jsx(Button, { variant: BUTTON_VARIANTS.GHOST, size: BUTTON_SIZES.ICON, className: "absolute top-3.5 right-3" }), children: _jsx(X, {}) }))] })] }));
|
|
58
|
+
}
|
|
59
|
+
/** Title and optional description, at least 28px tall. Leaves room on the right for the close button. */
|
|
60
|
+
export function DialogHeader({ className, ...props }) {
|
|
61
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex min-h-7 flex-col justify-center gap-space-4 pr-space-32", className), ...props }));
|
|
62
|
+
}
|
|
63
|
+
/** Actions on the right: the secondary first, then the one green or danger action. */
|
|
64
|
+
export function DialogFooter({ className, ...props }) {
|
|
65
|
+
return _jsx("div", { "data-slot": "dialog-footer", className: cn("flex justify-end gap-space-8", className), ...props });
|
|
66
|
+
}
|
|
67
|
+
/** 16px semibold. Name the task: "Invite members", "Connect GitHub". Required for screen readers. */
|
|
68
|
+
export function DialogTitle({ className, ...props }) {
|
|
69
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("m-0 font-sans text-[16px] font-semibold leading-auto", className), ...props }));
|
|
70
|
+
}
|
|
71
|
+
/** One `muted` sentence under the title. */
|
|
72
|
+
export function DialogDescription({ className, ...props }) {
|
|
73
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("m-0 text-ui text-muted", className), ...props }));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AAErE,qDAAqD;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,0CAA0C;IAC1C,OAAO,EAAE,SAAS;IAClB,iCAAiC;IACjC,EAAE,EAAE,IAAI;IACR,8BAA8B;IAC9B,EAAE,EAAE,IAAI;CACA,CAAC;AAIX,MAAM,mBAAmB,GAAG;IAC1B,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO;IAC/B,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO;IAC1B,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO;CACU,CAAC;AAEvC;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,KAAK,EAA8B;IAC3E,MAAM,gBAAgB,GAA+C,CAAC,IAAI,EAAE,YAAY,EAAE,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M,UAAU,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAqC;IAC1F,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,iBAChB,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,KAC9C,KAAK,GACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { eventTargetsOverlayPortalBranch } from \"../lib/overlay-portal-branch.ts\";\nimport { BUTTON_SIZES, BUTTON_VARIANTS, Button } from \"./button.tsx\";\n\n/** The three dialog widths. Never invent another. */\nexport const DIALOG_SIZES = {\n /** 420px: invite members, short forms. */\n DEFAULT: \"default\",\n /** 460px: the connect dialog. */\n LG: \"lg\",\n /** 540px: the share sheet. */\n XL: \"xl\",\n} as const;\n\ntype DialogSize = (typeof DIALOG_SIZES)[keyof typeof DIALOG_SIZES];\n\nconst DIALOG_SIZE_CLASSES = {\n [DIALOG_SIZES.DEFAULT]: \"w-105\",\n [DIALOG_SIZES.LG]: \"w-115\",\n [DIALOG_SIZES.XL]: \"w-135\",\n} satisfies Record<DialogSize, string>;\n\n/**\n * Root. Controlled with `open` / `onOpenChange`, or uncontrolled with a `DialogTrigger`. A click inside an element\n * marked `data-overlay-portal-branch` (a list portaled out of it), or focus moving there, doesn't close it.\n */\nexport function Dialog({ onOpenChange, ...props }: DialogPrimitive.Root.Props) {\n const handleOpenChange: DialogPrimitive.Root.Props[\"onOpenChange\"] = (open, eventDetails) => {\n const isOutsideReason = eventDetails.reason === \"outside-press\" || eventDetails.reason === \"focus-out\";\n\n if (!open && isOutsideReason && eventTargetsOverlayPortalBranch(eventDetails.event)) {\n eventDetails.cancel();\n return;\n }\n\n onOpenChange?.(open, eventDetails);\n };\n\n return <DialogPrimitive.Root data-slot=\"dialog\" onOpenChange={handleOpenChange} {...props} />;\n}\n\n/** Pass the opening control as `render`: `<DialogTrigger render={<Button />}>Invite</DialogTrigger>`. */\nexport function DialogTrigger(props: DialogPrimitive.Trigger.Props) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function DialogPortal(props: DialogPrimitive.Portal.Props) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Closes the dialog: pass the secondary footer button as `render`. */\nexport function DialogClose(props: DialogPrimitive.Close.Props) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** The page dims behind a dialog and fades in over 160ms. A dialog opened from another dims the page again. */\nexport function DialogOverlay({ className, forceRender = true, ...props }: DialogPrimitive.Backdrop.Props) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n forceRender={forceRender}\n className={cn(\"fixed inset-0 z-50 bg-dim data-open:animate-fade-in\", className)}\n {...props}\n />\n );\n}\n\ntype DialogContentProps = DialogPrimitive.Popup.Props & {\n /** 420 (default), 460 (connect) or 540px (share). */\n size?: DialogSize;\n /** The × in the top-right corner. */\n showCloseButton?: boolean;\n overlayClassName?: string;\n};\n\n/**\n * The sheet, with its portal and overlay: `surface`, `rounded-xl`, `panel-edge` border, `shadow-pop`,\n * 20 × 18px padding and 14px between its parts. Pops in over 160ms.\n */\nexport function DialogContent({\n className,\n children,\n size = DIALOG_SIZES.DEFAULT,\n showCloseButton = true,\n overlayClassName,\n ...props\n}: DialogContentProps) {\n return (\n <DialogPortal>\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-1/2 left-1/2 z-50 flex max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-space-14 rounded-xl border border-panel-edge bg-surface px-5 py-4.5 text-ink shadow-pop outline-none data-open:animate-pop-in\",\n DIALOG_SIZE_CLASSES[size],\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n aria-label=\"Close\"\n render={\n <Button variant={BUTTON_VARIANTS.GHOST} size={BUTTON_SIZES.ICON} className=\"absolute top-3.5 right-3\" />\n }\n >\n <X />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n );\n}\n\n/** Title and optional description, at least 28px tall. Leaves room on the right for the close button. */\nexport function DialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex min-h-7 flex-col justify-center gap-space-4 pr-space-32\", className)}\n {...props}\n />\n );\n}\n\n/** Actions on the right: the secondary first, then the one green or danger action. */\nexport function DialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n return <div data-slot=\"dialog-footer\" className={cn(\"flex justify-end gap-space-8\", className)} {...props} />;\n}\n\n/** 16px semibold. Name the task: \"Invite members\", \"Connect GitHub\". Required for screen readers. */\nexport function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"m-0 font-sans text-[16px] font-semibold leading-auto\", className)}\n {...props}\n />\n );\n}\n\n/** One `muted` sentence under the title. */\nexport function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"m-0 text-ui text-muted\", className)}\n {...props}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
3
|
+
/**
|
|
4
|
+
* The edge a drawer comes from, which is also the way it swipes closed. The product picks it; the drawer never
|
|
5
|
+
* switches by itself.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DRAWER_SWIPE_DIRECTIONS: {
|
|
8
|
+
/** A side panel: a member's details, the workflow inspector. The default. */
|
|
9
|
+
readonly RIGHT: "right";
|
|
10
|
+
/** The phone's navigation. */
|
|
11
|
+
readonly LEFT: "left";
|
|
12
|
+
/** Phones only: a sheet from the bottom with a handle on top, in place of a dialog or menu. */
|
|
13
|
+
readonly DOWN: "down";
|
|
14
|
+
};
|
|
15
|
+
type DrawerSwipeDirection = (typeof DRAWER_SWIPE_DIRECTIONS)[keyof typeof DRAWER_SWIPE_DIRECTIONS];
|
|
16
|
+
/** The two side widths. Each is a maximum: on a narrow screen a side drawer is full width. A down drawer always is. */
|
|
17
|
+
export declare const DRAWER_SIZES: {
|
|
18
|
+
/** 24rem: the workflow node inspector. The default. */
|
|
19
|
+
readonly SM: "sm";
|
|
20
|
+
/** 46rem: a member's details. */
|
|
21
|
+
readonly LG: "lg";
|
|
22
|
+
};
|
|
23
|
+
type DrawerSize = (typeof DRAWER_SIZES)[keyof typeof DRAWER_SIZES];
|
|
24
|
+
export type DrawerProps = Omit<DrawerPrimitive.Root.Props, "swipeDirection"> & {
|
|
25
|
+
/** `right` (default), `left` or `down`. */
|
|
26
|
+
swipeDirection?: DrawerSwipeDirection;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Root. Controlled with `open` / `onOpenChange`, or uncontrolled with a `DrawerTrigger`. Modal by default: the page
|
|
30
|
+
* dims and an outside click closes it. `modal={false}` floats it as a card over a page that stays usable: an outside
|
|
31
|
+
* click doesn't close it (`disablePointerDismissal` defaults to true) and opening it doesn't move focus. A Drawer
|
|
32
|
+
* inside another's content nests over it, and the page dims once; a down drawer behind it steps back. A click inside
|
|
33
|
+
* an element marked `data-overlay-portal-branch` doesn't close it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function Drawer({ swipeDirection, modal, disablePointerDismissal, onOpenChange, ...props }: DrawerProps): import("react").JSX.Element;
|
|
36
|
+
/** Pass the opening control as `render`: `<DrawerTrigger render={<Button />}>Details</DrawerTrigger>`. */
|
|
37
|
+
export declare function DrawerTrigger(props: DrawerPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
38
|
+
export declare function DrawerPortal(props: DrawerPrimitive.Portal.Props): import("react").JSX.Element;
|
|
39
|
+
/** Closes the drawer: pass a footer button as `render`. */
|
|
40
|
+
export declare function DrawerClose(props: DrawerPrimitive.Close.Props): import("react").JSX.Element;
|
|
41
|
+
/**
|
|
42
|
+
* The page dims behind a modal drawer, fading in over 200ms and out over 150ms, and lightens as the drawer is
|
|
43
|
+
* swiped away. A nested drawer doesn't dim it again.
|
|
44
|
+
*/
|
|
45
|
+
export declare function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props): import("react").JSX.Element;
|
|
46
|
+
/** The 36 × 4px grab handle on top of a down drawer, in a 12px strip a mouse can drag. DrawerContent adds it. */
|
|
47
|
+
export declare function DrawerSwipeHandle({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
48
|
+
type DrawerContentProps = DrawerPrimitive.Popup.Props & {
|
|
49
|
+
/** A side drawer's maximum width: 24rem (`sm`, default) or 46rem (`lg`). A down drawer is always full width. */
|
|
50
|
+
size?: DrawerSize;
|
|
51
|
+
/** The grab handle on top. On by default for a down drawer, off for a side one. */
|
|
52
|
+
showSwipeHandle?: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The sheet, with its portal, viewport and (modal only) dimmed overlay: `surface`, `panel-edge` border, `shadow-pop`.
|
|
56
|
+
* Modal: full height and flush with its edge. Non-modal: a floating card that leaves focus where it was. Down: full
|
|
57
|
+
* width, as tall as its content up to the viewport minus 6rem, rounded on top. Slides in over 200ms ease-out and out
|
|
58
|
+
* over 150ms ease-in, or follows the finger and closes on a swipe toward its edge. Its className styles the sheet.
|
|
59
|
+
*/
|
|
60
|
+
export declare function DrawerContent({ className, children, size, showSwipeHandle, initialFocus, ...props }: DrawerContentProps): import("react").JSX.Element;
|
|
61
|
+
type DrawerHeaderProps = ComponentProps<"div"> & {
|
|
62
|
+
/** A small label above the title, such as the node's type tag ("Router"). */
|
|
63
|
+
label?: ReactNode;
|
|
64
|
+
/** The × on the right, named "Close". */
|
|
65
|
+
showCloseButton?: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** The optional label, then the title and description on the left; the × on the right. Doesn't scroll. */
|
|
68
|
+
export declare function DrawerHeader({ className, label, showCloseButton, children, ...props }: DrawerHeaderProps): import("react").JSX.Element;
|
|
69
|
+
/** 17px semibold, 14.5px in a down drawer. Required: it names the drawer for screen readers. */
|
|
70
|
+
export declare function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props): import("react").JSX.Element;
|
|
71
|
+
/** One `muted` line under the title: the member's email, what the node does. */
|
|
72
|
+
export declare function DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props): import("react").JSX.Element;
|
|
73
|
+
/** The part that scrolls, between the header and the footer: a column of its content, 16px apart. */
|
|
74
|
+
export declare function DrawerBody({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
75
|
+
type DrawerFooterProps = ComponentProps<"div"> & {
|
|
76
|
+
/** Actions on the left, such as Run node; the children sit on the right. */
|
|
77
|
+
start?: ReactNode;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Actions under a `line` rule, at the bottom: `start` on the left, the children on the right, 8px apart. In a down
|
|
81
|
+
* drawer they stack full width, with no rule.
|
|
82
|
+
*/
|
|
83
|
+
export declare function DrawerFooter({ className, start, children, ...props }: DrawerFooterProps): import("react").JSX.Element;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMlE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;IAClC,6EAA6E;;I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
import { createContext, useContext } from "react";
|
|
4
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
import { cn } from "../lib/cn.js";
|
|
7
|
+
import { eventTargetsOverlayPortalBranch } from "../lib/overlay-portal-branch.js";
|
|
8
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "./button.js";
|
|
9
|
+
/**
|
|
10
|
+
* The edge a drawer comes from, which is also the way it swipes closed. The product picks it; the drawer never
|
|
11
|
+
* switches by itself.
|
|
12
|
+
*/
|
|
13
|
+
export const DRAWER_SWIPE_DIRECTIONS = {
|
|
14
|
+
/** A side panel: a member's details, the workflow inspector. The default. */
|
|
15
|
+
RIGHT: "right",
|
|
16
|
+
/** The phone's navigation. */
|
|
17
|
+
LEFT: "left",
|
|
18
|
+
/** Phones only: a sheet from the bottom with a handle on top, in place of a dialog or menu. */
|
|
19
|
+
DOWN: "down",
|
|
20
|
+
};
|
|
21
|
+
/** The two side widths. Each is a maximum: on a narrow screen a side drawer is full width. A down drawer always is. */
|
|
22
|
+
export const DRAWER_SIZES = {
|
|
23
|
+
/** 24rem: the workflow node inspector. The default. */
|
|
24
|
+
SM: "sm",
|
|
25
|
+
/** 46rem: a member's details. */
|
|
26
|
+
LG: "lg",
|
|
27
|
+
};
|
|
28
|
+
const DRAWER_SIZE_CLASSES = {
|
|
29
|
+
[DRAWER_SIZES.SM]: "max-w-96",
|
|
30
|
+
[DRAWER_SIZES.LG]: "max-w-184",
|
|
31
|
+
};
|
|
32
|
+
const DrawerContext = createContext({ modal: true, swipeDirection: DRAWER_SWIPE_DIRECTIONS.RIGHT });
|
|
33
|
+
/**
|
|
34
|
+
* Root. Controlled with `open` / `onOpenChange`, or uncontrolled with a `DrawerTrigger`. Modal by default: the page
|
|
35
|
+
* dims and an outside click closes it. `modal={false}` floats it as a card over a page that stays usable: an outside
|
|
36
|
+
* click doesn't close it (`disablePointerDismissal` defaults to true) and opening it doesn't move focus. A Drawer
|
|
37
|
+
* inside another's content nests over it, and the page dims once; a down drawer behind it steps back. A click inside
|
|
38
|
+
* an element marked `data-overlay-portal-branch` doesn't close it.
|
|
39
|
+
*/
|
|
40
|
+
export function Drawer({ swipeDirection = DRAWER_SWIPE_DIRECTIONS.RIGHT, modal = true, disablePointerDismissal = modal === false, onOpenChange, ...props }) {
|
|
41
|
+
const handleOpenChange = (open, eventDetails) => {
|
|
42
|
+
const isOutsideReason = eventDetails.reason === "outside-press" || eventDetails.reason === "focus-out";
|
|
43
|
+
if (!open && isOutsideReason && eventTargetsOverlayPortalBranch(eventDetails.event)) {
|
|
44
|
+
eventDetails.cancel();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
onOpenChange?.(open, eventDetails);
|
|
48
|
+
};
|
|
49
|
+
return (_jsx(DrawerContext.Provider, { value: { modal, swipeDirection }, children: _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", swipeDirection: swipeDirection, modal: modal, disablePointerDismissal: disablePointerDismissal, onOpenChange: handleOpenChange, ...props }) }));
|
|
50
|
+
}
|
|
51
|
+
/** Pass the opening control as `render`: `<DrawerTrigger render={<Button />}>Details</DrawerTrigger>`. */
|
|
52
|
+
export function DrawerTrigger(props) {
|
|
53
|
+
return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
54
|
+
}
|
|
55
|
+
export function DrawerPortal(props) {
|
|
56
|
+
return _jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
57
|
+
}
|
|
58
|
+
/** Closes the drawer: pass a footer button as `render`. */
|
|
59
|
+
export function DrawerClose(props) {
|
|
60
|
+
return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The page dims behind a modal drawer, fading in over 200ms and out over 150ms, and lightens as the drawer is
|
|
64
|
+
* swiped away. A nested drawer doesn't dim it again.
|
|
65
|
+
*/
|
|
66
|
+
export function DrawerOverlay({ className, ...props }) {
|
|
67
|
+
return (_jsx(DrawerPrimitive.Backdrop, { "data-slot": "drawer-overlay", className: cn("fixed inset-0 z-50 min-h-dvh bg-dim opacity-[calc(1-var(--drawer-swipe-progress,0))] transition-opacity duration-200 ease-out", "data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength,1)*150ms)] data-ending-style:ease-in data-swiping:duration-0", "supports-[-webkit-touch-callout:none]:absolute", className), ...props }));
|
|
68
|
+
}
|
|
69
|
+
/** The 36 × 4px grab handle on top of a down drawer, in a 12px strip a mouse can drag. DrawerContent adds it. */
|
|
70
|
+
export function DrawerSwipeHandle({ className, ...props }) {
|
|
71
|
+
return (_jsx("div", { "data-slot": "drawer-swipe-handle", "aria-hidden": true, className: cn("flex h-3 shrink-0 cursor-grab items-end justify-center transition-opacity duration-200 active:cursor-grabbing after:h-1 after:w-9 after:rounded-full after:bg-line", "group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100", className), ...props }));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The sheet and its motion. It sits `--drawer-inset` from its edge (0 flush, 12px floating), slides by its own size
|
|
75
|
+
* plus that inset, and follows `--drawer-swipe-movement-*` (set by Base UI) while swiped.
|
|
76
|
+
*/
|
|
77
|
+
const POPUP_CLASSES = [
|
|
78
|
+
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset) flex min-h-0 flex-col border-panel-edge bg-surface font-sans text-ink shadow-pop outline-none select-none",
|
|
79
|
+
"transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale,1))] will-change-transform [interpolate-size:allow-keywords]",
|
|
80
|
+
"transition-[transform,height,opacity] duration-200 ease-out",
|
|
81
|
+
"data-starting-style:transform-(--closed-transform) data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength,1)*150ms)] data-ending-style:ease-in data-ending-style:data-swipe-dismiss:ease-out",
|
|
82
|
+
"data-swiping:duration-0 data-nested-drawer-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength,1)*150ms)] data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength,1)*150ms)]",
|
|
83
|
+
"[--drawer-inset:0px] [--bleed:var(--spacing-space-48)]",
|
|
84
|
+
];
|
|
85
|
+
/**
|
|
86
|
+
* A down drawer behind an open nested one steps back, as on iOS: it takes the front one's height, scales back by 5%
|
|
87
|
+
* per level and peeks out 16px above it, and comes forward as the front one is swiped away. Side drawers stay put
|
|
88
|
+
* (a nested side drawer covers its parent), so a bottom sheet opened from the phone's navigation doesn't move it.
|
|
89
|
+
*/
|
|
90
|
+
const STACK_CLASSES = [
|
|
91
|
+
"[--peek:var(--spacing-space-16)] [--stack-step:0.05] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))]",
|
|
92
|
+
"[--stack-progress:clamp(0,var(--drawer-swipe-progress,0),1)] [--stack-peek-offset:max(0px,calc((var(--nested-drawers,0)-var(--stack-progress))*var(--peek)))]",
|
|
93
|
+
"[--stack-scale-base:max(0,calc(1-(var(--nested-drawers,0)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)]",
|
|
94
|
+
"[--stack-shrink:calc(1-var(--stack-scale))]",
|
|
95
|
+
"data-nested-drawer-open:h-(--stack-height) data-nested-drawer-open:overflow-hidden",
|
|
96
|
+
];
|
|
97
|
+
const DIRECTION_CLASSES = {
|
|
98
|
+
[DRAWER_SWIPE_DIRECTIONS.RIGHT]: [
|
|
99
|
+
"inset-y-0 right-0 border-l",
|
|
100
|
+
"[--closed-transform:translate3d(calc(100%+var(--drawer-inset)+2px),0,0)]",
|
|
101
|
+
"[--translate-x:var(--drawer-swipe-movement-x,0px)]",
|
|
102
|
+
],
|
|
103
|
+
[DRAWER_SWIPE_DIRECTIONS.LEFT]: [
|
|
104
|
+
"inset-y-0 left-0 border-r",
|
|
105
|
+
"[--closed-transform:translate3d(calc(-100%-var(--drawer-inset)-2px),0,0)]",
|
|
106
|
+
"[--translate-x:var(--drawer-swipe-movement-x,0px)]",
|
|
107
|
+
],
|
|
108
|
+
[DRAWER_SWIPE_DIRECTIONS.DOWN]: [
|
|
109
|
+
"inset-x-0 bottom-0 h-[var(--drawer-height,auto)] max-h-[calc(100dvh-6rem)] origin-bottom rounded-t-xl border-t pb-[env(safe-area-inset-bottom)]",
|
|
110
|
+
STACK_CLASSES,
|
|
111
|
+
"[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset)+2px),0)]",
|
|
112
|
+
"[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
|
|
113
|
+
],
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Flush with its edge: rounded on the inner corners (from md up; a phone's panel is square), with a strip of the
|
|
117
|
+
* sheet's fill past the edge, so swiping it the wrong way never shows the page behind.
|
|
118
|
+
*/
|
|
119
|
+
const FLUSH_CLASSES = {
|
|
120
|
+
[DRAWER_SWIPE_DIRECTIONS.RIGHT]: "w-full md:rounded-l-xl after:inset-y-0 after:left-full after:w-(--bleed)",
|
|
121
|
+
[DRAWER_SWIPE_DIRECTIONS.LEFT]: "w-full md:rounded-r-xl after:inset-y-0 after:right-full after:w-(--bleed)",
|
|
122
|
+
[DRAWER_SWIPE_DIRECTIONS.DOWN]: "after:inset-x-0 after:top-full after:h-(--bleed)",
|
|
123
|
+
};
|
|
124
|
+
const BLEED_CLASSES = "after:pointer-events-none after:absolute after:bg-inherit";
|
|
125
|
+
/** Non-modal: a card inset 12px from the viewport's edges, rounded all round. */
|
|
126
|
+
const FLOATING_CLASSES = "w-[calc(100%-2*var(--drawer-inset))] rounded-xl border [--drawer-inset:var(--spacing-space-12)]";
|
|
127
|
+
/**
|
|
128
|
+
* The sheet, with its portal, viewport and (modal only) dimmed overlay: `surface`, `panel-edge` border, `shadow-pop`.
|
|
129
|
+
* Modal: full height and flush with its edge. Non-modal: a floating card that leaves focus where it was. Down: full
|
|
130
|
+
* width, as tall as its content up to the viewport minus 6rem, rounded on top. Slides in over 200ms ease-out and out
|
|
131
|
+
* over 150ms ease-in, or follows the finger and closes on a swipe toward its edge. Its className styles the sheet.
|
|
132
|
+
*/
|
|
133
|
+
export function DrawerContent({ className, children, size = DRAWER_SIZES.SM, showSwipeHandle, initialFocus, ...props }) {
|
|
134
|
+
const { modal, swipeDirection } = useContext(DrawerContext);
|
|
135
|
+
const isFloating = modal === false;
|
|
136
|
+
const isSideDrawer = swipeDirection !== DRAWER_SWIPE_DIRECTIONS.DOWN;
|
|
137
|
+
const isSwipeHandleVisible = showSwipeHandle ?? !isSideDrawer;
|
|
138
|
+
return (_jsxs(DrawerPortal, { children: [modal === true && _jsx(DrawerOverlay, {}), _jsx(DrawerPrimitive.Viewport, { "data-slot": "drawer-viewport", className: cn("fixed inset-0 z-50", modal !== true && "pointer-events-none"), children: _jsxs(DrawerPrimitive.Popup, { "data-slot": "drawer-popup", initialFocus: initialFocus ?? (isFloating ? false : undefined), className: cn(POPUP_CLASSES, DIRECTION_CLASSES[swipeDirection], isFloating ? FLOATING_CLASSES : [BLEED_CLASSES, FLUSH_CLASSES[swipeDirection]], isSideDrawer && DRAWER_SIZE_CLASSES[size], className), ...props, children: [isSwipeHandleVisible && _jsx(DrawerSwipeHandle, {}), _jsx(DrawerPrimitive.Content, { "data-slot": "drawer-content", className: cn("flex min-h-0 flex-1 flex-col select-text transition-opacity duration-200 ease-out group-data-swiping/drawer-popup:select-none",
|
|
139
|
+
// A down drawer behind a nested one keeps only its outline: the front one's content is what reads.
|
|
140
|
+
!isSideDrawer &&
|
|
141
|
+
"group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100"), children: children })] }) })] }));
|
|
142
|
+
}
|
|
143
|
+
/** The optional label, then the title and description on the left; the × on the right. Doesn't scroll. */
|
|
144
|
+
export function DrawerHeader({ className, label, showCloseButton = true, children, ...props }) {
|
|
145
|
+
return (_jsxs("div", { "data-slot": "drawer-header", className: cn("flex shrink-0 items-start gap-space-12 px-5 pt-4.5 pb-space-12 group-data-[swipe-direction=down]/drawer-popup:pt-3", className), ...props, children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-space-2", children: [label && (_jsx("div", { "data-slot": "drawer-label", className: "mb-space-6 flex items-center", children: label })), children] }), showCloseButton && (_jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", "aria-label": "Close", render: _jsx(Button, { variant: BUTTON_VARIANTS.GHOST, size: BUTTON_SIZES.ICON, className: "-mt-space-4 -mr-space-8" }), children: _jsx(X, {}) }))] }));
|
|
146
|
+
}
|
|
147
|
+
/** 17px semibold, 14.5px in a down drawer. Required: it names the drawer for screen readers. */
|
|
148
|
+
export function DrawerTitle({ className, ...props }) {
|
|
149
|
+
return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("m-0 font-sans text-title-sm text-ink group-data-[swipe-direction=down]/drawer-popup:text-card-title", className), ...props }));
|
|
150
|
+
}
|
|
151
|
+
/** One `muted` line under the title: the member's email, what the node does. */
|
|
152
|
+
export function DrawerDescription({ className, ...props }) {
|
|
153
|
+
return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("m-0 text-ui text-muted", className), ...props }));
|
|
154
|
+
}
|
|
155
|
+
/** The part that scrolls, between the header and the footer: a column of its content, 16px apart. */
|
|
156
|
+
export function DrawerBody({ className, ...props }) {
|
|
157
|
+
return (_jsx("div", { "data-slot": "drawer-body", className: cn("flex min-h-0 flex-1 flex-col gap-space-16 overflow-y-auto overscroll-contain px-5 pt-space-4 pb-5", className), ...props }));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Actions under a `line` rule, at the bottom: `start` on the left, the children on the right, 8px apart. In a down
|
|
161
|
+
* drawer they stack full width, with no rule.
|
|
162
|
+
*/
|
|
163
|
+
export function DrawerFooter({ className, start, children, ...props }) {
|
|
164
|
+
return (_jsxs("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex shrink-0 items-center justify-end gap-space-8 border-t border-line px-5 py-space-12", "group-data-[swipe-direction=down]/drawer-popup:flex-col group-data-[swipe-direction=down]/drawer-popup:items-stretch group-data-[swipe-direction=down]/drawer-popup:border-t-0 group-data-[swipe-direction=down]/drawer-popup:pt-3 group-data-[swipe-direction=down]/drawer-popup:pb-5", className), ...props, children: [start && (_jsx("div", { "data-slot": "drawer-footer-start", className: "mr-auto flex items-center gap-space-8 group-data-[swipe-direction=down]/drawer-popup:mr-0 group-data-[swipe-direction=down]/drawer-popup:flex-col group-data-[swipe-direction=down]/drawer-popup:items-stretch", children: start })), children] }));
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=drawer.js.map
|