@kujoforall/paper-ui 0.1.0 → 0.2.1
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 +94 -0
- package/README.md +50 -7
- package/dist/components/editor/block-text.d.ts.map +1 -1
- package/dist/components/editor/block-text.js +52 -17
- package/dist/components/editor/block-text.js.map +1 -1
- package/dist/components/editor/blocks.d.ts.map +1 -1
- package/dist/components/editor/blocks.js +17 -13
- package/dist/components/editor/blocks.js.map +1 -1
- package/dist/components/editor/document-editor.d.ts.map +1 -1
- package/dist/components/editor/document-editor.js +4 -2
- package/dist/components/editor/document-editor.js.map +1 -1
- package/dist/components/editor/document-view.d.ts.map +1 -1
- package/dist/components/editor/document-view.js +17 -12
- package/dist/components/editor/document-view.js.map +1 -1
- package/dist/components/editor/editor-state.d.ts +7 -0
- package/dist/components/editor/editor-state.d.ts.map +1 -1
- package/dist/components/editor/editor-state.js +28 -3
- package/dist/components/editor/editor-state.js.map +1 -1
- package/dist/components/editor/extensions/kit-blocks.d.ts +34 -0
- package/dist/components/editor/extensions/kit-blocks.d.ts.map +1 -0
- package/dist/components/editor/extensions/kit-blocks.js +201 -0
- package/dist/components/editor/extensions/kit-blocks.js.map +1 -0
- package/dist/components/editor/extensions/spoiler.d.ts.map +1 -1
- package/dist/components/editor/extensions/spoiler.js +2 -2
- package/dist/components/editor/extensions/spoiler.js.map +1 -1
- package/dist/components/editor/index.d.ts +1 -0
- package/dist/components/editor/index.d.ts.map +1 -1
- package/dist/components/editor/index.js +1 -0
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/editor/kinds.js +1 -1
- package/dist/components/editor/kinds.js.map +1 -1
- package/dist/components/editor/look.d.ts +18 -0
- package/dist/components/editor/look.d.ts.map +1 -0
- package/dist/components/editor/look.js +21 -0
- package/dist/components/editor/look.js.map +1 -0
- package/dist/components/three/model-viewer.d.ts +36 -0
- package/dist/components/three/model-viewer.d.ts.map +1 -0
- package/dist/components/three/model-viewer.js +338 -0
- package/dist/components/three/model-viewer.js.map +1 -0
- package/dist/components/ui/accent-picker.js +1 -1
- package/dist/components/ui/accent-picker.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +29 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +72 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/animated-height.d.ts +6 -0
- package/dist/components/ui/animated-height.d.ts.map +1 -0
- package/dist/components/ui/animated-height.js +26 -0
- package/dist/components/ui/animated-height.js.map +1 -0
- package/dist/components/ui/app-shell.d.ts +1 -0
- package/dist/components/ui/app-shell.d.ts.map +1 -1
- package/dist/components/ui/app-shell.js +5 -3
- package/dist/components/ui/app-shell.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +30 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/banner.d.ts +33 -0
- package/dist/components/ui/banner.d.ts.map +1 -0
- package/dist/components/ui/banner.js +21 -0
- package/dist/components/ui/banner.js.map +1 -0
- package/dist/components/ui/breadcrumbs.js +1 -1
- package/dist/components/ui/breadcrumbs.js.map +1 -1
- package/dist/components/ui/button.d.ts +8 -6
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +91 -26
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +6 -5
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/callout.d.ts +23 -4
- package/dist/components/ui/callout.d.ts.map +1 -1
- package/dist/components/ui/callout.js +28 -15
- package/dist/components/ui/callout.js.map +1 -1
- package/dist/components/ui/card.d.ts +13 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +10 -9
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +9 -4
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +25 -5
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/choice-label.d.ts +13 -0
- package/dist/components/ui/choice-label.d.ts.map +1 -0
- package/dist/components/ui/choice-label.js +17 -0
- package/dist/components/ui/choice-label.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +10 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +21 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/collection-layout.d.ts +24 -0
- package/dist/components/ui/collection-layout.d.ts.map +1 -0
- package/dist/components/ui/collection-layout.js +16 -0
- package/dist/components/ui/collection-layout.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +10 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +93 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command-menu.d.ts +5 -2
- package/dist/components/ui/command-menu.d.ts.map +1 -1
- package/dist/components/ui/command-menu.js +31 -6
- package/dist/components/ui/command-menu.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +19 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +42 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/copy-button.d.ts +11 -0
- package/dist/components/ui/copy-button.d.ts.map +1 -0
- package/dist/components/ui/copy-button.js +48 -0
- package/dist/components/ui/copy-button.js.map +1 -0
- package/dist/components/ui/database/calendar-view.d.ts +10 -0
- package/dist/components/ui/database/calendar-view.d.ts.map +1 -0
- package/dist/components/ui/database/calendar-view.js +65 -0
- package/dist/components/ui/database/calendar-view.js.map +1 -0
- package/dist/components/ui/database/card-views.d.ts +22 -0
- package/dist/components/ui/database/card-views.d.ts.map +1 -0
- package/dist/components/ui/database/card-views.js +74 -0
- package/dist/components/ui/database/card-views.js.map +1 -0
- package/dist/components/ui/database/cells.d.ts +20 -0
- package/dist/components/ui/database/cells.d.ts.map +1 -0
- package/dist/components/ui/database/cells.js +132 -0
- package/dist/components/ui/database/cells.js.map +1 -0
- package/dist/components/ui/database/database.d.ts +19 -0
- package/dist/components/ui/database/database.d.ts.map +1 -0
- package/dist/components/ui/database/database.js +102 -0
- package/dist/components/ui/database/database.js.map +1 -0
- package/dist/components/ui/database/icons.d.ts +5 -0
- package/dist/components/ui/database/icons.d.ts.map +1 -0
- package/dist/components/ui/database/icons.js +13 -0
- package/dist/components/ui/database/icons.js.map +1 -0
- package/dist/components/ui/database/table-view.d.ts +11 -0
- package/dist/components/ui/database/table-view.d.ts.map +1 -0
- package/dist/components/ui/database/table-view.js +157 -0
- package/dist/components/ui/database/table-view.js.map +1 -0
- package/dist/components/ui/date-picker.d.ts +6 -1
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/date-picker.js +20 -12
- package/dist/components/ui/date-picker.js.map +1 -1
- package/dist/components/ui/date-time-picker.d.ts +3 -1
- package/dist/components/ui/date-time-picker.d.ts.map +1 -1
- package/dist/components/ui/date-time-picker.js +17 -15
- package/dist/components/ui/date-time-picker.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +13 -9
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +33 -3
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/document-layout.d.ts +15 -0
- package/dist/components/ui/document-layout.d.ts.map +1 -0
- package/dist/components/ui/document-layout.js +15 -0
- package/dist/components/ui/document-layout.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +14 -10
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +22 -13
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/editable-text.d.ts +9 -2
- package/dist/components/ui/editable-text.d.ts.map +1 -1
- package/dist/components/ui/editable-text.js +27 -10
- package/dist/components/ui/editable-text.js.map +1 -1
- package/dist/components/ui/empty-state.d.ts +11 -0
- package/dist/components/ui/empty-state.d.ts.map +1 -0
- package/dist/components/ui/empty-state.js +9 -0
- package/dist/components/ui/empty-state.js.map +1 -0
- package/dist/components/ui/error-state.d.ts +20 -0
- package/dist/components/ui/error-state.d.ts.map +1 -0
- package/dist/components/ui/error-state.js +17 -0
- package/dist/components/ui/error-state.js.map +1 -0
- package/dist/components/ui/field-button.d.ts +2 -1
- package/dist/components/ui/field-button.d.ts.map +1 -1
- package/dist/components/ui/field-button.js +7 -5
- package/dist/components/ui/field-button.js.map +1 -1
- package/dist/components/ui/file-preview.js +1 -1
- package/dist/components/ui/file-preview.js.map +1 -1
- package/dist/components/ui/file-uploader.d.ts.map +1 -1
- package/dist/components/ui/file-uploader.js +5 -4
- package/dist/components/ui/file-uploader.js.map +1 -1
- package/dist/components/ui/filter-builder.d.ts +18 -0
- package/dist/components/ui/filter-builder.d.ts.map +1 -0
- package/dist/components/ui/filter-builder.js +98 -0
- package/dist/components/ui/filter-builder.js.map +1 -0
- package/dist/components/ui/focus-shell.d.ts +14 -0
- package/dist/components/ui/focus-shell.d.ts.map +1 -0
- package/dist/components/ui/focus-shell.js +13 -0
- package/dist/components/ui/focus-shell.js.map +1 -0
- package/dist/components/ui/handle-row.d.ts +11 -1
- package/dist/components/ui/handle-row.d.ts.map +1 -1
- package/dist/components/ui/handle-row.js +101 -32
- package/dist/components/ui/handle-row.js.map +1 -1
- package/dist/components/ui/header-bar.d.ts +5 -0
- package/dist/components/ui/header-bar.d.ts.map +1 -0
- package/dist/components/ui/header-bar.js +10 -0
- package/dist/components/ui/header-bar.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +13 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/image-block.js +4 -4
- package/dist/components/ui/image-block.js.map +1 -1
- package/dist/components/ui/image-card.d.ts.map +1 -1
- package/dist/components/ui/image-card.js +5 -4
- package/dist/components/ui/image-card.js.map +1 -1
- package/dist/components/ui/image-framer.d.ts +24 -0
- package/dist/components/ui/image-framer.d.ts.map +1 -0
- package/dist/components/ui/image-framer.js +89 -0
- package/dist/components/ui/image-framer.js.map +1 -0
- package/dist/components/ui/image-viewer.d.ts.map +1 -1
- package/dist/components/ui/image-viewer.js +38 -5
- package/dist/components/ui/image-viewer.js.map +1 -1
- package/dist/components/ui/image.d.ts +25 -3
- package/dist/components/ui/image.d.ts.map +1 -1
- package/dist/components/ui/image.js +50 -21
- package/dist/components/ui/image.js.map +1 -1
- package/dist/components/ui/index.d.ts +54 -11
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +53 -10
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/input.d.ts +71 -12
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +236 -23
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/link-block.d.ts.map +1 -1
- package/dist/components/ui/link-block.js +1 -1
- package/dist/components/ui/link-block.js.map +1 -1
- package/dist/components/ui/list-detail.d.ts +23 -0
- package/dist/components/ui/list-detail.d.ts.map +1 -0
- package/dist/components/ui/list-detail.js +33 -0
- package/dist/components/ui/list-detail.js.map +1 -0
- package/dist/components/ui/listbox.d.ts +7 -0
- package/dist/components/ui/listbox.d.ts.map +1 -0
- package/dist/components/ui/listbox.js +29 -0
- package/dist/components/ui/listbox.js.map +1 -0
- package/dist/components/ui/mac-card.js +1 -1
- package/dist/components/ui/mac-card.js.map +1 -1
- package/dist/components/ui/month-picker.d.ts +13 -0
- package/dist/components/ui/month-picker.d.ts.map +1 -0
- package/dist/components/ui/month-picker.js +53 -0
- package/dist/components/ui/month-picker.js.map +1 -0
- package/dist/components/ui/multi-select.d.ts +22 -0
- package/dist/components/ui/multi-select.d.ts.map +1 -0
- package/dist/components/ui/multi-select.js +88 -0
- package/dist/components/ui/multi-select.js.map +1 -0
- package/dist/components/ui/nav-tree.d.ts.map +1 -1
- package/dist/components/ui/nav-tree.js +10 -3
- package/dist/components/ui/nav-tree.js.map +1 -1
- package/dist/components/ui/page.d.ts +16 -5
- package/dist/components/ui/page.d.ts.map +1 -1
- package/dist/components/ui/page.js +23 -10
- package/dist/components/ui/page.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +26 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +54 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/picker-panel.d.ts +13 -0
- package/dist/components/ui/picker-panel.d.ts.map +1 -0
- package/dist/components/ui/picker-panel.js +19 -0
- package/dist/components/ui/picker-panel.js.map +1 -0
- package/dist/components/ui/popover.d.ts +2 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +11 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +17 -4
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/property.d.ts +2 -6
- package/dist/components/ui/property.d.ts.map +1 -1
- package/dist/components/ui/property.js +6 -22
- package/dist/components/ui/property.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +8 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +18 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/rating.d.ts +14 -0
- package/dist/components/ui/rating.d.ts.map +1 -0
- package/dist/components/ui/rating.js +61 -0
- package/dist/components/ui/rating.js.map +1 -0
- package/dist/components/ui/save-status.d.ts +8 -0
- package/dist/components/ui/save-status.d.ts.map +1 -0
- package/dist/components/ui/save-status.js +31 -0
- package/dist/components/ui/save-status.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +15 -7
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +8 -6
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select-menu.d.ts +3 -1
- package/dist/components/ui/select-menu.d.ts.map +1 -1
- package/dist/components/ui/select-menu.js +2 -2
- package/dist/components/ui/select-menu.js.map +1 -1
- package/dist/components/ui/select.d.ts +7 -2
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +19 -5
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/selection-bar.js +1 -1
- package/dist/components/ui/selection-bar.js.map +1 -1
- package/dist/components/ui/settings-layout.d.ts +34 -0
- package/dist/components/ui/settings-layout.d.ts.map +1 -0
- package/dist/components/ui/settings-layout.js +16 -0
- package/dist/components/ui/settings-layout.js.map +1 -0
- package/dist/components/ui/share-link.d.ts +14 -0
- package/dist/components/ui/share-link.d.ts.map +1 -0
- package/dist/components/ui/share-link.js +16 -0
- package/dist/components/ui/share-link.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +21 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +53 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +82 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +258 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +8 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +15 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +12 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +14 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/spotlight.d.ts.map +1 -1
- package/dist/components/ui/spotlight.js +14 -11
- package/dist/components/ui/spotlight.js.map +1 -1
- package/dist/components/ui/step-dialog.js +3 -3
- package/dist/components/ui/step-dialog.js.map +1 -1
- package/dist/components/ui/steps-layout.d.ts +20 -0
- package/dist/components/ui/steps-layout.d.ts.map +1 -0
- package/dist/components/ui/steps-layout.js +26 -0
- package/dist/components/ui/steps-layout.js.map +1 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +13 -5
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +65 -12
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +19 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/theme-toggle.d.ts +14 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme-toggle.js +69 -41
- package/dist/components/ui/theme-toggle.js.map +1 -1
- package/dist/components/ui/time-list.d.ts +16 -0
- package/dist/components/ui/time-list.d.ts.map +1 -0
- package/dist/components/ui/time-list.js +49 -0
- package/dist/components/ui/time-list.js.map +1 -0
- package/dist/components/ui/time-picker.d.ts +37 -11
- package/dist/components/ui/time-picker.d.ts.map +1 -1
- package/dist/components/ui/time-picker.js +130 -52
- package/dist/components/ui/time-picker.js.map +1 -1
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +77 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +15 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +55 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/top-bar.d.ts +25 -0
- package/dist/components/ui/top-bar.d.ts.map +1 -0
- package/dist/components/ui/top-bar.js +23 -0
- package/dist/components/ui/top-bar.js.map +1 -0
- package/dist/components/ui/typography.d.ts +11 -5
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/components/ui/typography.js +31 -5
- package/dist/components/ui/typography.js.map +1 -1
- package/dist/components/ui/video-block.d.ts.map +1 -1
- package/dist/components/ui/video-block.js +5 -1
- package/dist/components/ui/video-block.js.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +5 -0
- package/dist/hooks/use-dismiss.d.ts.map +1 -0
- package/dist/hooks/use-dismiss.js +23 -0
- package/dist/hooks/use-dismiss.js.map +1 -0
- package/dist/hooks/use-escape-first.d.ts +3 -0
- package/dist/hooks/use-escape-first.d.ts.map +1 -0
- package/dist/hooks/use-escape-first.js +27 -0
- package/dist/hooks/use-escape-first.js.map +1 -0
- package/dist/hooks/use-media-query.d.ts +5 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +16 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-save-queue.d.ts.map +1 -1
- package/dist/hooks/use-save-queue.js +19 -7
- package/dist/hooks/use-save-queue.js.map +1 -1
- package/dist/hooks/use-selection.d.ts.map +1 -1
- package/dist/hooks/use-selection.js +10 -1
- package/dist/hooks/use-selection.js.map +1 -1
- package/dist/lib/database.d.ts +92 -0
- package/dist/lib/database.d.ts.map +1 -0
- package/dist/lib/database.js +272 -0
- package/dist/lib/database.js.map +1 -0
- package/dist/lib/dates.d.ts +16 -0
- package/dist/lib/dates.d.ts.map +1 -1
- package/dist/lib/dates.js +27 -0
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/keys.d.ts +18 -0
- package/dist/lib/keys.d.ts.map +1 -0
- package/dist/lib/keys.js +66 -0
- package/dist/lib/keys.js.map +1 -0
- package/dist/lib/number.d.ts +4 -0
- package/dist/lib/number.d.ts.map +1 -0
- package/dist/lib/number.js +33 -0
- package/dist/lib/number.js.map +1 -0
- package/dist/lib/pointer.d.ts +2 -0
- package/dist/lib/pointer.d.ts.map +1 -0
- package/dist/lib/pointer.js +4 -0
- package/dist/lib/pointer.js.map +1 -0
- package/dist/lib/prepare-image.d.ts +43 -0
- package/dist/lib/prepare-image.d.ts.map +1 -0
- package/dist/lib/prepare-image.js +105 -0
- package/dist/lib/prepare-image.js.map +1 -0
- package/dist/lib/rich-text-dom.d.ts +2 -0
- package/dist/lib/rich-text-dom.d.ts.map +1 -1
- package/dist/lib/rich-text-dom.js +5 -3
- package/dist/lib/rich-text-dom.js.map +1 -1
- package/dist/lib/theme.d.ts +6 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +15 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/time.d.ts +19 -0
- package/dist/lib/time.d.ts.map +1 -0
- package/dist/lib/time.js +91 -0
- package/dist/lib/time.js.map +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +20 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles/notion.css +342 -51
- package/package.json +27 -4
- package/src/components/editor/block-text.tsx +58 -17
- package/src/components/editor/blocks.tsx +19 -14
- package/src/components/editor/document-editor.tsx +7 -2
- package/src/components/editor/document-view.tsx +37 -24
- package/src/components/editor/editor-state.tsx +31 -3
- package/src/components/editor/extensions/kit-blocks.tsx +452 -0
- package/src/components/editor/extensions/spoiler.tsx +9 -4
- package/src/components/editor/index.ts +1 -0
- package/src/components/editor/kinds.ts +1 -1
- package/src/components/editor/look.tsx +36 -0
- package/src/components/three/model-viewer.tsx +514 -0
- package/src/components/ui/accent-picker.tsx +2 -2
- package/src/components/ui/alert-dialog.tsx +136 -0
- package/src/components/ui/animated-height.tsx +34 -0
- package/src/components/ui/app-shell.tsx +9 -7
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +4 -4
- package/src/components/ui/banner.tsx +53 -0
- package/src/components/ui/breadcrumbs.tsx +1 -1
- package/src/components/ui/button.tsx +115 -41
- package/src/components/ui/calendar.tsx +8 -7
- package/src/components/ui/callout.tsx +41 -42
- package/src/components/ui/card.tsx +27 -58
- package/src/components/ui/checkbox.tsx +53 -19
- package/src/components/ui/choice-label.tsx +43 -0
- package/src/components/ui/collapsible.tsx +58 -0
- package/src/components/ui/collection-layout.tsx +69 -0
- package/src/components/ui/combobox.tsx +155 -0
- package/src/components/ui/command-menu.tsx +61 -31
- package/src/components/ui/context-menu.tsx +89 -0
- package/src/components/ui/copy-button.tsx +80 -0
- package/src/components/ui/database/calendar-view.tsx +180 -0
- package/src/components/ui/database/card-views.tsx +221 -0
- package/src/components/ui/database/cells.tsx +237 -0
- package/src/components/ui/database/database.tsx +279 -0
- package/src/components/ui/database/icons.ts +15 -0
- package/src/components/ui/database/table-view.tsx +311 -0
- package/src/components/ui/date-picker.tsx +99 -61
- package/src/components/ui/date-time-picker.tsx +68 -62
- package/src/components/ui/dialog.tsx +48 -21
- package/src/components/ui/document-layout.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +33 -31
- package/src/components/ui/editable-text.tsx +40 -7
- package/src/components/ui/empty-state.tsx +35 -0
- package/src/components/ui/error-state.tsx +67 -0
- package/src/components/ui/field-button.tsx +11 -9
- package/src/components/ui/file-preview.tsx +1 -1
- package/src/components/ui/file-uploader.tsx +23 -24
- package/src/components/ui/filter-builder.tsx +304 -0
- package/src/components/ui/focus-shell.tsx +48 -0
- package/src/components/ui/handle-row.tsx +176 -40
- package/src/components/ui/header-bar.tsx +15 -0
- package/src/components/ui/hover-card.tsx +30 -0
- package/src/components/ui/image-block.tsx +6 -6
- package/src/components/ui/image-card.tsx +18 -25
- package/src/components/ui/image-framer.tsx +160 -0
- package/src/components/ui/image-viewer.tsx +53 -10
- package/src/components/ui/image.tsx +133 -29
- package/src/components/ui/index.ts +106 -11
- package/src/components/ui/input.tsx +437 -65
- package/src/components/ui/link-block.tsx +5 -2
- package/src/components/ui/list-detail.tsx +115 -0
- package/src/components/ui/listbox.ts +26 -0
- package/src/components/ui/mac-card.tsx +5 -5
- package/src/components/ui/month-picker.tsx +119 -0
- package/src/components/ui/multi-select.tsx +221 -0
- package/src/components/ui/nav-tree.tsx +11 -5
- package/src/components/ui/page.tsx +63 -15
- package/src/components/ui/pagination.tsx +143 -0
- package/src/components/ui/picker-panel.tsx +69 -0
- package/src/components/ui/popover.tsx +3 -3
- package/src/components/ui/progress.tsx +56 -16
- package/src/components/ui/property.tsx +6 -37
- package/src/components/ui/radio-group.tsx +61 -0
- package/src/components/ui/rating.tsx +122 -0
- package/src/components/ui/save-status.tsx +53 -0
- package/src/components/ui/segmented.tsx +48 -16
- package/src/components/ui/select-menu.tsx +11 -3
- package/src/components/ui/select.tsx +33 -10
- package/src/components/ui/selection-bar.tsx +1 -1
- package/src/components/ui/settings-layout.tsx +117 -0
- package/src/components/ui/share-link.tsx +66 -0
- package/src/components/ui/sheet.tsx +90 -0
- package/src/components/ui/sidebar.tsx +627 -0
- package/src/components/ui/skeleton.tsx +22 -0
- package/src/components/ui/spinner.tsx +28 -0
- package/src/components/ui/spotlight.tsx +21 -21
- package/src/components/ui/step-dialog.tsx +6 -6
- package/src/components/ui/steps-layout.tsx +91 -0
- package/src/components/ui/switch.tsx +55 -0
- package/src/components/ui/table.tsx +75 -18
- package/src/components/ui/tabs.tsx +41 -0
- package/src/components/ui/theme-toggle.tsx +74 -83
- package/src/components/ui/time-list.tsx +106 -0
- package/src/components/ui/time-picker.tsx +305 -134
- package/src/components/ui/toast.tsx +132 -0
- package/src/components/ui/toggle.tsx +76 -0
- package/src/components/ui/tooltip.tsx +20 -6
- package/src/components/ui/top-bar.tsx +118 -0
- package/src/components/ui/typography.tsx +45 -9
- package/src/components/ui/video-block.tsx +9 -3
- package/src/hooks/use-dismiss.ts +24 -0
- package/src/hooks/use-escape-first.ts +25 -0
- package/src/hooks/use-media-query.ts +23 -0
- package/src/hooks/use-save-queue.ts +19 -7
- package/src/hooks/use-selection.ts +8 -1
- package/src/lib/database.ts +322 -0
- package/src/lib/dates.ts +36 -0
- package/src/lib/keys.ts +72 -0
- package/src/lib/number.ts +29 -0
- package/src/lib/pointer.ts +3 -0
- package/src/lib/prepare-image.ts +141 -0
- package/src/lib/rich-text-dom.ts +5 -3
- package/src/lib/theme.ts +18 -0
- package/src/lib/time.ts +83 -0
- package/src/lib/utils.ts +21 -2
- package/src/styles/notion.css +342 -51
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowDownWideNarrow, ArrowLeft, ArrowRight, ArrowUpNarrowWide, EyeOff, Maximize2, Plus } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import { isEmpty, shownProperties } from "../../../lib/database.js";
|
|
6
|
+
import { cn } from "../../../lib/utils.js";
|
|
7
|
+
import { Button } from "../button.js";
|
|
8
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../dropdown-menu.js";
|
|
9
|
+
import { Popover, PopoverAnchor, PopoverContent } from "../popover.js";
|
|
10
|
+
import { CellEditor, CellValue, editsInPopover } from "./cells.js";
|
|
11
|
+
import { PROPERTY_ICONS } from "./icons.js";
|
|
12
|
+
/* The table view: a spreadsheet of the rows. One cell is current (the arrows move
|
|
13
|
+
it, Home and End to a row's ends); Enter, F2 or typing changes it, Escape puts
|
|
14
|
+
it back, Tab keeps and moves along. Space ticks a checkbox; Delete empties a
|
|
15
|
+
cell. A row's title has Open beside it. Columns are resized by their edge and
|
|
16
|
+
sorted, hidden and moved from their name's menu. It scrolls sideways inside
|
|
17
|
+
itself on a narrow screen. */
|
|
18
|
+
const MIN_WIDTH = 96;
|
|
19
|
+
const widthOf = (view, property) => view.widths?.[property.id] ?? (property.type === "title" ? 260 : property.type === "checkbox" ? 110 : 180);
|
|
20
|
+
export function TableView({ properties, rows, view, onViewChange, onSetValue, onAddRow, onOpenRow, }) {
|
|
21
|
+
const columns = shownProperties(properties, view);
|
|
22
|
+
const [at, setAt] = useState({ r: 0, c: 0 });
|
|
23
|
+
// The cell being changed, by its row's id and its column: a row that moves (the
|
|
24
|
+
// change re-sorts it, or filters it out) takes the change with it, or ends it.
|
|
25
|
+
const [editingCell, setEditing] = useState(null);
|
|
26
|
+
const editingR = editingCell ? rows.findIndex((row) => row.id === editingCell.id) : -1;
|
|
27
|
+
const editing = editingCell && editingR !== -1 ? { r: editingR, c: editingCell.c, seed: editingCell.seed } : null;
|
|
28
|
+
const grid = useRef(null);
|
|
29
|
+
const r0 = Math.min(at.r, Math.max(0, rows.length - 1));
|
|
30
|
+
const c0 = Math.min(at.c, columns.length - 1);
|
|
31
|
+
// At once, so a second key pressed quickly comes from the new cell; a frame
|
|
32
|
+
// later as well, for a cell that is only now being drawn (a row just added).
|
|
33
|
+
// When a change ends without a move (Escape, a click elsewhere), focus comes
|
|
34
|
+
// back to the cell only if it has nowhere else to be: a click on the search or
|
|
35
|
+
// another cell keeps it there.
|
|
36
|
+
const focusCell = (r, c, onlyIfLost = false) => {
|
|
37
|
+
setAt({ r, c });
|
|
38
|
+
const find = () => grid.current?.querySelector(`[data-cell="${r}-${c}"]`);
|
|
39
|
+
if (!onlyIfLost)
|
|
40
|
+
find()?.focus();
|
|
41
|
+
requestAnimationFrame(() => {
|
|
42
|
+
const cell = find();
|
|
43
|
+
const active = document.activeElement;
|
|
44
|
+
const lost = active === null || active === document.body || (onlyIfLost ? false : !cell?.contains(active));
|
|
45
|
+
if (cell && lost)
|
|
46
|
+
cell.focus();
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const done = (move) => {
|
|
50
|
+
const from = editing ?? { r: r0, c: c0 };
|
|
51
|
+
setEditing(null);
|
|
52
|
+
if (move === "down")
|
|
53
|
+
focusCell(Math.min(rows.length - 1, from.r + 1), from.c);
|
|
54
|
+
else if (move === "right")
|
|
55
|
+
focusCell(from.r, Math.min(columns.length - 1, from.c + 1));
|
|
56
|
+
else if (move === "left")
|
|
57
|
+
focusCell(from.r, Math.max(0, from.c - 1));
|
|
58
|
+
else
|
|
59
|
+
focusCell(from.r, from.c, true);
|
|
60
|
+
};
|
|
61
|
+
const startEditing = (r, c, seed) => setEditing({ id: rows[r].id, c, seed });
|
|
62
|
+
const onKeyDown = (e, r, c) => {
|
|
63
|
+
// Keys on what is inside the cell (Open, a link) are theirs.
|
|
64
|
+
if (editing || e.target !== e.currentTarget)
|
|
65
|
+
return;
|
|
66
|
+
const row = rows[r];
|
|
67
|
+
const property = columns[c];
|
|
68
|
+
const moves = { ArrowUp: [-1, 0], ArrowDown: [1, 0], ArrowLeft: [0, -1], ArrowRight: [0, 1] };
|
|
69
|
+
if (moves[e.key]) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
const [dr, dc] = moves[e.key];
|
|
72
|
+
focusCell(Math.max(0, Math.min(rows.length - 1, r + dr)), Math.max(0, Math.min(columns.length - 1, c + dc)));
|
|
73
|
+
}
|
|
74
|
+
else if (e.key === "Home" || e.key === "End") {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
focusCell(r, e.key === "Home" ? 0 : columns.length - 1);
|
|
77
|
+
}
|
|
78
|
+
else if (e.key === " " && property.type === "checkbox") {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
onSetValue(row, property, row.values[property.id] !== true);
|
|
81
|
+
}
|
|
82
|
+
else if (e.key === "Enter" || e.key === "F2") {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
if (property.type === "checkbox")
|
|
85
|
+
onSetValue(row, property, row.values[property.id] !== true);
|
|
86
|
+
else
|
|
87
|
+
startEditing(r, c);
|
|
88
|
+
}
|
|
89
|
+
else if ((e.key === "Delete" || e.key === "Backspace") && property.type !== "title") {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
onSetValue(row, property, property.type === "checkbox" ? false : property.type === "multiSelect" ? [] : null);
|
|
92
|
+
}
|
|
93
|
+
else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && !editsInPopover(property) && property.type !== "checkbox") {
|
|
94
|
+
// Typing starts a change with what was typed, as in a spreadsheet.
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
startEditing(r, c, e.key);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const resize = (e, property) => {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
const startX = e.clientX;
|
|
103
|
+
const start = widthOf(view, property);
|
|
104
|
+
const el = e.currentTarget;
|
|
105
|
+
el.setPointerCapture(e.pointerId);
|
|
106
|
+
let width = start;
|
|
107
|
+
const th = el.closest("th");
|
|
108
|
+
const move = (ev) => {
|
|
109
|
+
width = Math.max(MIN_WIDTH, Math.round(start + ev.clientX - startX));
|
|
110
|
+
th.style.width = `${width}px`;
|
|
111
|
+
};
|
|
112
|
+
const up = () => {
|
|
113
|
+
el.removeEventListener("pointermove", move);
|
|
114
|
+
el.removeEventListener("pointerup", up);
|
|
115
|
+
el.removeEventListener("pointercancel", up);
|
|
116
|
+
if (width !== start)
|
|
117
|
+
onViewChange({ ...view, widths: { ...view.widths, [property.id]: width } });
|
|
118
|
+
};
|
|
119
|
+
el.addEventListener("pointermove", move);
|
|
120
|
+
el.addEventListener("pointerup", up);
|
|
121
|
+
el.addEventListener("pointercancel", up);
|
|
122
|
+
};
|
|
123
|
+
// Swaps two shown columns within the order of all of them, so a hidden column
|
|
124
|
+
// keeps its place for when it is shown again.
|
|
125
|
+
const moveColumn = (index, by) => {
|
|
126
|
+
const to = index + by;
|
|
127
|
+
if (to < 0 || to >= columns.length)
|
|
128
|
+
return;
|
|
129
|
+
const all = shownProperties(properties, { ...view, hidden: [] }).map((p) => p.id);
|
|
130
|
+
const a = all.indexOf(columns[index].id);
|
|
131
|
+
const b = all.indexOf(columns[to].id);
|
|
132
|
+
[all[a], all[b]] = [all[b], all[a]];
|
|
133
|
+
onViewChange({ ...view, order: all });
|
|
134
|
+
};
|
|
135
|
+
return (_jsxs("div", { children: [_jsx("div", { ref: grid, className: "pb-1.5 overflow-x-auto overscroll-x-contain", children: _jsxs("table", { role: "grid", "aria-label": view.name, "aria-rowcount": rows.length + 1, className: "border-collapse text-sm table-fixed", style: { width: columns.reduce((w, p) => w + widthOf(view, p), 0) }, children: [_jsx("thead", { children: _jsx("tr", { children: columns.map((property, c) => {
|
|
136
|
+
const Icon = PROPERTY_ICONS[property.type];
|
|
137
|
+
const sorted = view.sort.find((s) => s.property === property.id);
|
|
138
|
+
return (_jsxs("th", { scope: "col", "aria-sort": sorted ? (sorted.direction === "asc" ? "ascending" : "descending") : undefined, style: { width: widthOf(view, property) }, className: "relative p-0 border-hairline border-y border-r last:border-r-0 font-normal text-ink-secondary text-left", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "flex items-center gap-1.5 hover:bg-tint-hover px-2 w-full h-control-md text-left", children: [_jsx(Icon, { className: "size-3.5 text-ink-tertiary shrink-0", "aria-hidden": true }), _jsx("span", { className: "truncate", children: property.name }), sorted &&
|
|
139
|
+
(sorted.direction === "asc" ? (_jsx(ArrowUpNarrowWide, { className: "ml-auto size-3.5", "aria-hidden": true })) : (_jsx(ArrowDownWideNarrow, { className: "ml-auto size-3.5", "aria-hidden": true })))] }) }), _jsxs(DropdownMenuContent, { align: "start", children: [_jsxs(DropdownMenuItem, { onSelect: () => onViewChange({ ...view, sort: [{ property: property.id, direction: "asc" }] }), children: [_jsx(ArrowUpNarrowWide, {}), " Sort ascending"] }), _jsxs(DropdownMenuItem, { onSelect: () => onViewChange({ ...view, sort: [{ property: property.id, direction: "desc" }] }), children: [_jsx(ArrowDownWideNarrow, {}), " Sort descending"] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { disabled: c === 0, onSelect: () => moveColumn(c, -1), children: [_jsx(ArrowLeft, {}), " Move left"] }), _jsxs(DropdownMenuItem, { disabled: c === columns.length - 1, onSelect: () => moveColumn(c, 1), children: [_jsx(ArrowRight, {}), " Move right"] }), property.type !== "title" && (_jsxs(DropdownMenuItem, { onSelect: () => onViewChange({ ...view, hidden: [...view.hidden, property.id] }), children: [_jsx(EyeOff, {}), " Hide"] }))] })] }), _jsx("span", { "aria-hidden": true, onPointerDown: (e) => resize(e, property), className: "top-0 -right-1 z-1 absolute hover:bg-accent/40 w-2 h-full cursor-col-resize touch-none" })] }, property.id));
|
|
140
|
+
}) }) }), _jsx("tbody", { children: rows.map((row, r) => (_jsx("tr", { className: "group/tr", children: columns.map((property, c) => {
|
|
141
|
+
const current = r === r0 && c === c0;
|
|
142
|
+
const isEditing = editing?.r === r && editing.c === c;
|
|
143
|
+
const value = row.values[property.id];
|
|
144
|
+
const popover = editsInPopover(property);
|
|
145
|
+
return (_jsx("td", { "data-cell": `${r}-${c}`, role: "gridcell", tabIndex: current && !isEditing ? 0 : -1, "aria-label": property.type === "checkbox" ? `${property.name}: ${value ? "yes" : "no"}` : undefined, onKeyDown: (e) => onKeyDown(e, r, c), onClick: () => {
|
|
146
|
+
setAt({ r, c });
|
|
147
|
+
if (property.type === "checkbox")
|
|
148
|
+
onSetValue(row, property, value !== true);
|
|
149
|
+
}, onDoubleClick: () => property.type !== "checkbox" && startEditing(r, c), className: cn("relative p-0 border-hairline border-y border-r last:border-r-0 h-control-md align-middle outline-none", "focus-visible:shadow-[inset_0_0_0_2px_var(--accent)]", property.type === "number" && "text-right"), children: isEditing && !popover ? (_jsx("div", { className: "absolute inset-0 z-1 shadow-[inset_0_0_0_2px_var(--accent)]", children: _jsx(CellEditor, { property: property, value: value, seed: editing.seed, onChange: (v) => onSetValue(row, property, v), onDone: done }) })) : (_jsxs(Popover, { open: isEditing && popover, onOpenChange: (open) => !open && done(), children: [_jsx(PopoverAnchor, { asChild: true, children: _jsxs("div", { className: "flex items-center gap-1 px-2 py-1 min-h-control-md overflow-hidden", children: [_jsx(CellValue, { property: property, value: value,
|
|
150
|
+
// A link in a cell is clicked, not tabbed to: the grid is one stop.
|
|
151
|
+
linkTabIndex: -1, className: cn(property.type === "number" && "ml-auto") }), property.type === "title" && isEmpty(value ?? null) && (_jsx("span", { className: "text-ink-tertiary", children: "Untitled" })), property.type === "title" && onOpenRow && (_jsxs(Button, { variant: "secondary", size: "sm", tabIndex: current ? 0 : -1, onClick: (e) => {
|
|
152
|
+
e.stopPropagation();
|
|
153
|
+
onOpenRow(row);
|
|
154
|
+
}, className: "ml-auto h-6 text-caption affordance group-hover/tr:opacity-100 [@media(hover:none)]:opacity-100", children: [_jsx(Maximize2, {}), " Open"] }))] }) }), isEditing && popover && (_jsx(PopoverContent, { align: "start", className: "p-0 w-auto", children: _jsx(CellEditor, { property: property, value: value, onChange: (v) => onSetValue(row, property, v), onDone: done }) }))] })) }, property.id));
|
|
155
|
+
}) }, row.id))) })] }) }), _jsxs(Button, { variant: "ghost", size: "sm", onClick: onAddRow, className: "text-ink-tertiary", children: [_jsx(Plus, {}), " New"] })] }));
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=table-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-view.js","sourceRoot":"","sources":["../../../../src/components/ui/database/table-view.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACtH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAyC,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAkD,MAAM,0BAA0B,CAAC;AACpH,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE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AAS,IAAI,CACvC,MAAC,MAAM,IACH,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,IAAI,EACT,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oEACX,CAAC,CAAC,eAAe,EAAE,CAAC;oEACpB,SAAS,CAAC,GAAG,CAAC,CAAC;gEACnB,CAAC,EACD,SAAS,EAAC,iGAAiG,aAE3G,KAAC,SAAS,KAAG,aACR,CACZ,IACC,GACM,EACf,SAAS,IAAI,OAAO,IAAI,CACrB,KAAC,cAAc,IAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,YAChD,KAAC,UAAU,IACP,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,EAC7C,MAAM,EAAE,IAAI,GACd,GACW,CACpB,IACK,CACb,IApEI,QAAQ,CAAC,EAAE,CAqEf,CACR,CAAC;gCACN,CAAC,CAAC,IA/EG,GAAG,CAAC,EAAE,CAgFV,CACR,CAAC,GACE,IACJ,GACN,EACN,MAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,mBAAmB,aAC9E,KAAC,IAAI,KAAG,YACH,IACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -14,8 +14,13 @@ export interface DatePickerProps extends Shared {
|
|
|
14
14
|
openTo?: string | null;
|
|
15
15
|
/** Sends the value with a form, as a hidden field of this name. */
|
|
16
16
|
name?: string;
|
|
17
|
+
/** Quick choices beside the calendar: [{ label: "Today", value: today() }, …]. */
|
|
18
|
+
shortcuts?: readonly {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
17
22
|
}
|
|
18
|
-
export declare function DatePicker({ value, onChange, min, max, openTo, clearable, placeholder, name, ...props }: DatePickerProps): import("react").JSX.Element;
|
|
23
|
+
export declare function DatePicker({ value, onChange, min, max, openTo, clearable, placeholder, name, shortcuts, ...props }: DatePickerProps): import("react").JSX.Element;
|
|
19
24
|
export type DateRange = {
|
|
20
25
|
from: string | null;
|
|
21
26
|
to: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/date-picker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/date-picker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKxE,KAAK,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG;IAC3F,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAaF,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC3C,sCAAsC;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC3D;AAID,wBAAgB,UAAU,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,MAAM,EACN,SAAgB,EAChB,WAA2B,EAC3B,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACX,EAAE,eAAe,+BAmEjB;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEnE,MAAM,WAAW,oBAAqB,SAAQ,MAAM;IAChD,0EAA0E;IAC1E,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,uEAAuE;IACvE,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC;AAKD,wBAAgB,eAAe,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,SAAgB,EAChB,WAA0B,EAC1B,KAAK,EACL,GAAG,KAAK,EACX,EAAE,oBAAoB,+BA8DtB"}
|
|
@@ -4,8 +4,9 @@ import { CalendarDays } from "lucide-react";
|
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { Calendar, focusCalendarDay } from "./calendar.js";
|
|
6
6
|
import { FieldButton } from "./field-button.js";
|
|
7
|
-
import {
|
|
7
|
+
import { PickerPanel } from "./picker-panel.js";
|
|
8
8
|
import { formatDay, formatShortDay, fromISODate, toISODate } from "../../lib/dates.js";
|
|
9
|
+
import { cn } from "../../lib/utils.js";
|
|
9
10
|
/** What react-day-picker needs to grey out days outside `min` and `max`. */
|
|
10
11
|
function bounds(min, max) {
|
|
11
12
|
const from = fromISODate(min);
|
|
@@ -18,15 +19,22 @@ function bounds(min, max) {
|
|
|
18
19
|
}
|
|
19
20
|
/* One day. The value is a string, `YYYY-MM-DD`: a calendar day, not an instant, so
|
|
20
21
|
it means the same day in every time zone. Choosing a day closes the calendar. */
|
|
21
|
-
export function DatePicker({ value, onChange, min, max, openTo, clearable = true, placeholder = "Pick a date", name, ...props }) {
|
|
22
|
+
export function DatePicker({ value, onChange, min, max, openTo, clearable = true, placeholder = "Pick a date", name, shortcuts, ...props }) {
|
|
22
23
|
const [open, setOpen] = useState(false);
|
|
23
24
|
const selected = fromISODate(value);
|
|
24
|
-
return (_jsxs(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(PickerPanel, { open: open, onOpenChange: setOpen, title: props["aria-label"] ?? "Pick a date", onOpenAutoFocus: focusCalendarDay, trigger: _jsx(FieldButton, { icon: CalendarDays, placeholder: placeholder, onClear: clearable ? () => onChange(null) : undefined, clearLabel: "Clear the date", ...props, children: selected === undefined ? null : formatDay(selected) }), children: _jsxs("div", { className: "flex max-sm:flex-col", children: [shortcuts !== undefined && shortcuts.length > 0 && (_jsx("div", { className: "flex sm:flex-col gap-1 sm:shadow-edge-r max-sm:shadow-edge-b p-2 max-sm:overflow-x-auto", children: shortcuts.map((s) => {
|
|
26
|
+
const day = fromISODate(s.value);
|
|
27
|
+
const outside = (min && s.value < min) || (max && s.value > max) || day === undefined;
|
|
28
|
+
return (_jsx("button", { type: "button", disabled: !!outside, onClick: () => {
|
|
29
|
+
onChange(s.value);
|
|
30
|
+
setOpen(false);
|
|
31
|
+
}, className: cn("flex items-center px-2.5 rounded-control h-control-sm [@media(pointer:coarse)]:h-10 text-sm text-left whitespace-nowrap", "hover:bg-tint-hover disabled:text-ink-disabled disabled:pointer-events-none", s.value === value && "bg-tint-active font-medium"), children: s.label }, s.label));
|
|
32
|
+
}) })), _jsx(Calendar, { mode: "single",
|
|
33
|
+
// Required, so pressing the chosen day again keeps it. The cross is how it is emptied.
|
|
34
|
+
required: true, selected: selected, onSelect: (day) => {
|
|
35
|
+
onChange(toISODate(day));
|
|
36
|
+
setOpen(false);
|
|
37
|
+
}, defaultMonth: selected ?? fromISODate(openTo) ?? fromISODate(min), ...bounds(min, max) })] }) }), name !== undefined && _jsx("input", { type: "hidden", name: name, value: selected === undefined ? "" : (value ?? "") })] }));
|
|
30
38
|
}
|
|
31
39
|
/* A first and a last day, in one field. The first press sets the start and the
|
|
32
40
|
second the end, whichever order they come in; pressing again starts over. The
|
|
@@ -48,9 +56,9 @@ export function DateRangePicker({ value, onChange, min, max, clearable = true, p
|
|
|
48
56
|
: to === undefined
|
|
49
57
|
? `${formatShortDay(from)} –`
|
|
50
58
|
: `${formatShortDay(from)} – ${formatShortDay(to)}`;
|
|
51
|
-
return (_jsxs(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsx(PickerPanel, { open: open, onOpenChange: setOpen, title: props["aria-label"] ?? "Pick dates", onOpenAutoFocus: focusCalendarDay, trigger: _jsx(FieldButton, { icon: CalendarDays, placeholder: placeholder, onClear: clearable ? () => onChange({ from: null, to: null }) : undefined, clearLabel: "Clear the dates", ...props, children: label }), children: _jsxs("div", { children: [_jsx(Calendar, { mode: "range", selected: { from, to },
|
|
60
|
+
// The library's own idea of what a press does to a range is ignored;
|
|
61
|
+
// only the day pressed is taken from it.
|
|
62
|
+
onSelect: (_range, pressed) => press(pressed), defaultMonth: from ?? fromISODate(min), ...bounds(min, max) }), _jsx("p", { "aria-live": "polite", className: "px-3 py-2 border-hairline border-t text-caption text-ink-tertiary", children: from !== undefined && to === undefined ? "Now the last day." : "Pick the first day, then the last." })] }) }), names !== undefined && (_jsxs(_Fragment, { children: [_jsx("input", { type: "hidden", name: names.from, value: from === undefined ? "" : toISODate(from) }), _jsx("input", { type: "hidden", name: names.to, value: to === undefined ? "" : toISODate(to) })] }))] }));
|
|
55
63
|
}
|
|
56
64
|
//# sourceMappingURL=date-picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../src/components/ui/date-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAgB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAoB,CAAC;AACxE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../src/components/ui/date-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAgB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAoB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAUxC,4EAA4E;AAC5E,SAAS,MAAM,CAAC,GAAmB,EAAE,GAAmB;IACpD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO;QACH,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC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,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,GAAI,IACtF,CACN,IACF,CACN,CAAC;AACN,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type HourCycle } from "../../lib/time.js";
|
|
1
2
|
import { type FieldButtonProps } from "./field-button.js";
|
|
2
3
|
export interface DateTimePickerProps extends Omit<FieldButtonProps, "value" | "onChange" | "children" | "onClear" | "icon"> {
|
|
3
4
|
/** `YYYY-MM-DDTHH:MM`, local, or null for none. What a `datetime-local` input holds. */
|
|
@@ -11,9 +12,10 @@ export interface DateTimePickerProps extends Omit<FieldButtonProps, "value" | "o
|
|
|
11
12
|
/** The time a day gets when it is chosen before any time is. */
|
|
12
13
|
defaultTime?: string;
|
|
13
14
|
minuteStep?: number;
|
|
15
|
+
hourCycle?: HourCycle;
|
|
14
16
|
clearable?: boolean;
|
|
15
17
|
/** Sends the value with a form, as a hidden field of this name. */
|
|
16
18
|
name?: string;
|
|
17
19
|
}
|
|
18
|
-
export declare function DateTimePicker({ value, onChange, min, max, openTo, defaultTime, minuteStep, clearable, placeholder, name, ...props }: DateTimePickerProps): import("react").JSX.Element;
|
|
20
|
+
export declare function DateTimePicker({ value, onChange, min, max, openTo, defaultTime, minuteStep, hourCycle, clearable, placeholder, name, ...props }: DateTimePickerProps): import("react").JSX.Element;
|
|
19
21
|
//# sourceMappingURL=date-time-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/date-time-picker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/date-time-picker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIxE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IACvH,wFAAwF;IACxF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAKD,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,MAAM,EACN,WAAqB,EACrB,UAAe,EACf,SAAS,EACT,SAAgB,EAChB,WAAoC,EACpC,IAAI,EACJ,GAAG,KAAK,EACX,EAAE,mBAAmB,+BA4ErB"}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { CalendarClock } from "lucide-react";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
+
import { formatDay, fromISODate, isTime, splitDateTime, toISODate } from "../../lib/dates.js";
|
|
6
|
+
import { formatTime, localHourCycle } from "../../lib/time.js";
|
|
5
7
|
import { Button } from "./button.js";
|
|
6
8
|
import { Calendar, focusCalendarDay } from "./calendar.js";
|
|
7
9
|
import { FieldButton } from "./field-button.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export function DateTimePicker({ value, onChange, min, max, openTo, defaultTime = "12:00", minuteStep = 5, clearable = true, placeholder = "Pick a date and time", name, ...props }) {
|
|
10
|
+
import { PickerPanel } from "./picker-panel.js";
|
|
11
|
+
import { TimeList } from "./time-list.js";
|
|
12
|
+
/* A day and a time of day, in one field: the calendar with the day's times beside
|
|
13
|
+
it (under it, in a sheet, on a phone). There is no value until there is a day. A
|
|
14
|
+
time chosen first is held and joins the day when one is picked. */
|
|
15
|
+
export function DateTimePicker({ value, onChange, min, max, openTo, defaultTime = "12:00", minuteStep = 15, hourCycle, clearable = true, placeholder = "Pick a date and time", name, ...props }) {
|
|
15
16
|
const [open, setOpen] = useState(false);
|
|
16
17
|
/** A time chosen while there is still no day to attach it to. */
|
|
17
18
|
const [heldTime, setHeldTime] = useState(null);
|
|
19
|
+
const cycle = hourCycle ?? localHourCycle();
|
|
18
20
|
const { date, time } = splitDateTime(value);
|
|
19
21
|
const selected = fromISODate(date);
|
|
20
22
|
// Shown even before there is a day: it is the time the day will get.
|
|
21
23
|
const shownTime = date === null ? (heldTime ?? defaultTime) : (time ?? defaultTime);
|
|
22
24
|
const from = fromISODate(min);
|
|
23
25
|
const to = fromISODate(max);
|
|
24
|
-
return (_jsxs(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(PickerPanel, { open: open, onOpenChange: (next) => {
|
|
27
|
+
setOpen(next);
|
|
28
|
+
if (!next)
|
|
29
|
+
setHeldTime(null);
|
|
30
|
+
}, title: props["aria-label"] ?? "Pick a date and time", onOpenAutoFocus: focusCalendarDay, trigger: _jsx(FieldButton, { icon: CalendarClock, placeholder: placeholder, onClear: clearable ? () => onChange(null) : undefined, clearLabel: "Clear the date and time", ...props, children: selected === undefined ? null : (_jsxs(_Fragment, { children: [formatDay(selected), _jsx("span", { className: "ml-2 text-ink-secondary tabular-nums", children: formatTime(time ?? defaultTime, cycle) })] })) }), children: _jsxs("div", { className: "max-sm:w-full", children: [_jsxs("div", { className: "flex max-sm:flex-col sm:divide-x sm:divide-hairline", children: [_jsx(Calendar, { mode: "single", required: true, selected: selected, onSelect: (day) => onChange(`${toISODate(day)}T${shownTime}`), defaultMonth: selected ?? fromISODate(openTo) ?? from, disabled: [...(from === undefined ? [] : [{ before: from }]), ...(to === undefined ? [] : [{ after: to }])], startMonth: from, endMonth: to, className: "max-sm:mx-auto" }), _jsx(TimeList, { label: "Time", value: isTime(shownTime) ? shownTime : null, onChange: (next) => (date === null ? setHeldTime(next) : onChange(`${date}T${next}`)), step: minuteStep, hourCycle: cycle,
|
|
31
|
+
// Beside the calendar, as tall as it; under it, on a phone, short.
|
|
32
|
+
className: "sm:h-auto sm:max-h-[18.5rem] sm:w-36 max-sm:h-40 max-sm:border-hairline max-sm:border-t" })] }), _jsxs("div", { className: "flex justify-between items-center gap-3 p-1.5 pl-3 border-hairline border-t", children: [_jsx("p", { "aria-live": "polite", className: "text-caption text-ink-tertiary", children: date === null ? "Pick a day to set it." : " " }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setOpen(false), children: "Done" })] })] }) }), name !== undefined && _jsx("input", { type: "hidden", name: name, value: date === null ? "" : `${date}T${time ?? defaultTime}` })] }));
|
|
31
33
|
}
|
|
32
34
|
//# sourceMappingURL=date-time-picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-picker.js","sourceRoot":"","sources":["../../../src/components/ui/date-time-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"date-time-picker.js","sourceRoot":"","sources":["../../../src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EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,WAAW,EAAE,GAAI,IACzH,CACN,CAAC;AACN,CAAC"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps>;
|
|
4
4
|
export declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
export declare const DialogClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
export declare const DialogPortal: import("react").FC<DialogPrimitive.DialogPortalProps>;
|
|
7
|
-
export declare
|
|
8
|
-
export
|
|
7
|
+
export declare const overlayClasses = "z-(--z-overlay) fixed inset-0 bg-scrim data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out";
|
|
8
|
+
export declare const dialogPanelClasses: string[];
|
|
9
|
+
export declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>): import("react").JSX.Element;
|
|
10
|
+
export interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Content> {
|
|
9
11
|
showClose?: boolean;
|
|
12
|
+
/** sm 24rem (a question), md 32rem (a form; the default), lg 42rem (more to read or compare). */
|
|
13
|
+
size?: "sm" | "md" | "lg";
|
|
10
14
|
}
|
|
11
|
-
export declare function DialogContent({ className, children, showClose, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
12
|
-
export declare function DialogHeader({ className, ...props }:
|
|
13
|
-
export declare function DialogTitle({ className, ...props }:
|
|
14
|
-
export declare function DialogDescription({ className, ...props }:
|
|
15
|
-
export declare function DialogBody({ className, ...props }:
|
|
16
|
-
export declare function DialogFooter({ className, ...props }:
|
|
15
|
+
export declare function DialogContent({ className, children, showClose, size, onOpenAutoFocus, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
16
|
+
export declare function DialogHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
17
|
+
export declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react").JSX.Element;
|
|
18
|
+
export declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react").JSX.Element;
|
|
19
|
+
export declare function DialogBody({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
20
|
+
export declare function DialogFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
17
21
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAC3C,eAAO,MAAM,aAAa,kIAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,gIAAwB,CAAC;AACjD,eAAO,MAAM,YAAY,uDAAyB,CAAC;AAInD,eAAO,MAAM,cAAc,kHAAkH,CAAC;AAI9I,eAAO,MAAM,kBAAkB,UAQ9B,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,+BAOhD;AAED,MAAM,WAAW,kBACb,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iGAAiG;IACjG,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC7B;AAcD,wBAAgB,aAAa,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,SAAgB,EAChB,IAAW,EACX,eAAe,EACf,GAAG,KAAK,EACX,EAAE,kBAAkB,+BA8BpB;AAED,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,KAAK,CAAC,+BAEvB;AAED,wBAAgB,WAAW,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,+BAO9C;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,+BAOpD;AAED,wBAAgB,UAAU,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,KAAK,CAAC,+BAEvB;AAED,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,KAAK,CAAC,+BAUvB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
4
|
import { X } from "lucide-react";
|
|
5
|
+
import { finePointer } from "../../lib/pointer.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
export const Dialog = DialogPrimitive.Root;
|
|
7
8
|
export const DialogTrigger = DialogPrimitive.Trigger;
|
|
@@ -9,11 +10,40 @@ export const DialogClose = DialogPrimitive.Close;
|
|
|
9
10
|
export const DialogPortal = DialogPrimitive.Portal;
|
|
10
11
|
/* The scrim is light — 32%, not 60%. The page behind stays legible, so
|
|
11
12
|
a dialog reads as a layer rather than a mode switch. */
|
|
13
|
+
export const overlayClasses = "z-(--z-overlay) fixed inset-0 bg-scrim data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out";
|
|
14
|
+
/* A dialog's panel, centred, or on a phone a sheet from the bottom edge (below).
|
|
15
|
+
Shared with AlertDialog, so the two never drift apart. */
|
|
16
|
+
export const dialogPanelClasses = [
|
|
17
|
+
"z-(--z-overlay) fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
18
|
+
"w-[calc(100vw-2rem)] max-h-[85dvh] overflow-y-auto overscroll-contain outline-none",
|
|
19
|
+
"bg-surface-overlay shadow-dialog rounded-overlay",
|
|
20
|
+
"data-[state=open]:animate-scale-in data-[state=closed]:animate-scale-out",
|
|
21
|
+
"max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:translate-x-0 max-sm:translate-y-0",
|
|
22
|
+
"max-sm:w-full max-sm:max-w-none max-sm:max-h-[92dvh] max-sm:rounded-b-none max-sm:pb-[env(safe-area-inset-bottom)]",
|
|
23
|
+
"max-sm:data-[state=open]:animate-sheet-in max-sm:data-[state=closed]:animate-sheet-out",
|
|
24
|
+
];
|
|
12
25
|
export function DialogOverlay({ className, ...props }) {
|
|
13
|
-
return (_jsx(DialogPrimitive.Overlay, { className: cn(
|
|
26
|
+
return (_jsx(DialogPrimitive.Overlay, { className: cn(overlayClasses, className), ...props }));
|
|
14
27
|
}
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
const DIALOG_WIDTH = { sm: "max-w-sm", md: "max-w-lg", lg: "max-w-2xl" };
|
|
29
|
+
/* On a phone a dialog is a sheet that rises from the bottom edge, full width. Centred
|
|
30
|
+
in the window it jumped when the keyboard opened, because the window's height
|
|
31
|
+
changed under it; anchored to the bottom it has nowhere to jump to. Its height is
|
|
32
|
+
measured in dvh, which follows the browser's bars as they come and go, and its
|
|
33
|
+
scrolling is kept from carrying on into the page behind (overscroll-contain).
|
|
34
|
+
|
|
35
|
+
Opening a dialog does not put the cursor in its first field on a touch screen:
|
|
36
|
+
that would bring the keyboard up over a form nobody has looked at yet.
|
|
37
|
+
|
|
38
|
+
From endgame and triptrack, 2026-12-02. */
|
|
39
|
+
export function DialogContent({ className, children, showClose = true, size = "md", onOpenAutoFocus, ...props }) {
|
|
40
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { onOpenAutoFocus: (event) => {
|
|
41
|
+
onOpenAutoFocus?.(event);
|
|
42
|
+
if (event.defaultPrevented || finePointer())
|
|
43
|
+
return;
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
event.currentTarget.focus({ preventScroll: true });
|
|
46
|
+
}, className: cn(dialogPanelClasses, DIALOG_WIDTH[size], className), ...props, children: [children, showClose && (_jsx(DialogPrimitive.Close, { className: cn("top-3 right-3 absolute inline-flex justify-center items-center", "rounded-control size-7 text-ink-tertiary hover:text-ink", "hover:bg-tint-hover transition-colors duration-(--duration-fast)"), "aria-label": "Close", children: _jsx(X, { className: "size-4" }) }))] })] }));
|
|
17
47
|
}
|
|
18
48
|
export function DialogHeader({ className, ...props }) {
|
|
19
49
|
return _jsx("div", { className: cn("px-5 pt-5 pb-0 pr-12", className), ...props });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;AACrD,MAAM,CAAC,MAAM,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,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACyC;IACjD,OAAO,CACH,KAAC,eAAe,CAAC,WAAW,IACxB,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,SAAS,CAAC,KACzD,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACY;IACpB,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACY;IACpB,OAAO,CACH,cACI,SAAS,EAAE,EAAE,CACT,0EAA0E,EAC1E,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export declare function DocumentLayout({ cover, icon, title, meta, children, className, }: {
|
|
3
|
+
/** A picture across the top, full width (an Image with fit cover, usually). */
|
|
4
|
+
cover?: ReactNode;
|
|
5
|
+
/** An emoji or an icon, large, above the title. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** Under the title: properties, a byline, a date. */
|
|
9
|
+
meta?: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/** In a DocumentLayout's body, something wider than the reading column (a table, a picture): it spans the page's reading width. */
|
|
14
|
+
export declare function Breakout({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=document-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-layout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/document-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvD,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAqBA;AAED,mIAAmI;AACnI,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAEtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
/* A page that is mostly to be read: Notion's page. An optional cover across the
|
|
4
|
+
top, an icon that sits half over it, the title, a line of properties, then the
|
|
5
|
+
body in one reading column (44rem). A wide thing in the body (a table, a
|
|
6
|
+
picture) may break out of the column to the page's reading width with
|
|
7
|
+
`<Breakout>`. Margins step with the room, as Page's do. */
|
|
8
|
+
export function DocumentLayout({ cover, icon, title, meta, children, className, }) {
|
|
9
|
+
return (_jsxs("article", { className: cn("pb-24", className), children: [cover !== undefined && _jsx("div", { className: "w-full h-[min(30vh,16rem)] overflow-hidden [&>*]:w-full [&>*]:h-full", children: cover }), _jsx("div", { className: "mx-auto px-5 @xl:px-8 @4xl:px-12 w-full max-w-reading", children: _jsxs("div", { className: "grid grid-cols-[1fr_min(var(--container-measure),100%)_1fr] [&>*]:col-start-2", children: [_jsxs("header", { className: cn(cover !== undefined ? (icon !== undefined ? "-mt-9" : "pt-8") : "pt-12 @xl:pt-16"), children: [icon !== undefined && (_jsx("div", { "aria-hidden": true, className: "mb-3 text-display [&_svg]:size-14 leading-none", children: icon })), _jsx("h1", { className: "text-title text-ink text-balance", children: title }), meta !== undefined && _jsx("div", { className: "mt-3 text-ink-secondary text-sm", children: meta })] }), _jsx("div", { className: "contents [&>*]:col-start-2 [&>*]:mt-4", children: children })] }) })] }));
|
|
10
|
+
}
|
|
11
|
+
/** In a DocumentLayout's body, something wider than the reading column (a table, a picture): it spans the page's reading width. */
|
|
12
|
+
export function Breakout({ className, ...props }) {
|
|
13
|
+
return _jsx("div", { className: cn("col-span-full! col-start-1! min-w-0", className), ...props });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=document-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-layout.js","sourceRoot":"","sources":["../../../src/components/ui/document-layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;6DAI6D;AAC7D,MAAM,UAAU,cAAc,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,GAWZ;IACG,OAAO,CACH,mBAAS,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,aACrC,KAAK,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,sEAAsE,YAAE,KAAK,GAAO,EAC3H,cAAK,SAAS,EAAC,uDAAuD,YAElE,eAAK,SAAS,EAAC,+EAA+E,aAC1F,kBAAQ,SAAS,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,aACnG,IAAI,KAAK,SAAS,IAAI,CACnB,mCAAiB,SAAS,EAAC,gDAAgD,YACtE,IAAI,GACH,CACT,EACD,aAAI,SAAS,EAAC,kCAAkC,YAAE,KAAK,GAAM,EAC5D,IAAI,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,iCAAiC,YAAE,IAAI,GAAO,IAC/E,EACT,cAAK,SAAS,EAAC,uCAAuC,YAAE,QAAQ,GAAO,IACrE,GACJ,IACA,CACb,CAAC;AACN,CAAC;AAED,mIAAmI;AACnI,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IACnE,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC/F,CAAC"}
|