@kujoforall/paper-ui 0.0.0-stage → 0.2.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 +93 -0
- package/LICENSE +21 -0
- package/README.md +295 -2
- package/dist/components/editor/block-text.d.ts +8 -0
- package/dist/components/editor/block-text.d.ts.map +1 -0
- package/dist/components/editor/block-text.js +248 -0
- package/dist/components/editor/block-text.js.map +1 -0
- package/dist/components/editor/blocks.d.ts +33 -0
- package/dist/components/editor/blocks.d.ts.map +1 -0
- package/dist/components/editor/blocks.js +191 -0
- package/dist/components/editor/blocks.js.map +1 -0
- package/dist/components/editor/document-editor.d.ts +27 -0
- package/dist/components/editor/document-editor.d.ts.map +1 -0
- package/dist/components/editor/document-editor.js +42 -0
- package/dist/components/editor/document-editor.js.map +1 -0
- package/dist/components/editor/document-view.d.ts +22 -0
- package/dist/components/editor/document-view.d.ts.map +1 -0
- package/dist/components/editor/document-view.js +110 -0
- package/dist/components/editor/document-view.js.map +1 -0
- package/dist/components/editor/editor-state.d.ts +107 -0
- package/dist/components/editor/editor-state.d.ts.map +1 -0
- package/dist/components/editor/editor-state.js +217 -0
- package/dist/components/editor/editor-state.js.map +1 -0
- 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 +8 -0
- package/dist/components/editor/extensions/spoiler.d.ts.map +1 -0
- package/dist/components/editor/extensions/spoiler.js +36 -0
- package/dist/components/editor/extensions/spoiler.js.map +1 -0
- package/dist/components/editor/index.d.ts +10 -0
- package/dist/components/editor/index.d.ts.map +1 -0
- package/dist/components/editor/index.js +10 -0
- package/dist/components/editor/index.js.map +1 -0
- package/dist/components/editor/kinds.d.ts +99 -0
- package/dist/components/editor/kinds.d.ts.map +1 -0
- package/dist/components/editor/kinds.js +74 -0
- package/dist/components/editor/kinds.js.map +1 -0
- 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/sketch/rough.d.ts +38 -0
- package/dist/components/sketch/rough.d.ts.map +1 -0
- package/dist/components/sketch/rough.js +57 -0
- package/dist/components/sketch/rough.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.d.ts +2 -0
- package/dist/components/ui/accent-picker.d.ts.map +1 -0
- package/dist/components/ui/accent-picker.js +44 -0
- package/dist/components/ui/accent-picker.js.map +1 -0
- package/dist/components/ui/address-field.d.ts +10 -0
- package/dist/components/ui/address-field.d.ts.map +1 -0
- package/dist/components/ui/address-field.js +24 -0
- package/dist/components/ui/address-field.js.map +1 -0
- 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 +26 -0
- package/dist/components/ui/app-shell.d.ts.map +1 -0
- package/dist/components/ui/app-shell.js +71 -0
- package/dist/components/ui/app-shell.js.map +1 -0
- 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 +19 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +62 -0
- package/dist/components/ui/badge.js.map +1 -0
- 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.d.ts +10 -0
- package/dist/components/ui/breadcrumbs.d.ts.map +1 -0
- package/dist/components/ui/breadcrumbs.js +9 -0
- package/dist/components/ui/breadcrumbs.js.map +1 -0
- package/dist/components/ui/button.d.ts +15 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +110 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +5 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +65 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/callout.d.ts +32 -0
- package/dist/components/ui/callout.d.ts.map +1 -0
- package/dist/components/ui/callout.js +40 -0
- package/dist/components/ui/callout.js.map +1 -0
- package/dist/components/ui/card.d.ts +18 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +28 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +11 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +30 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- 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 +18 -0
- package/dist/components/ui/command-menu.d.ts.map +1 -0
- package/dist/components/ui/command-menu.js +49 -0
- package/dist/components/ui/command-menu.js.map +1 -0
- 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 +40 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +64 -0
- package/dist/components/ui/date-picker.js.map +1 -0
- package/dist/components/ui/date-time-picker.d.ts +21 -0
- package/dist/components/ui/date-time-picker.d.ts.map +1 -0
- package/dist/components/ui/date-time-picker.js +34 -0
- package/dist/components/ui/date-time-picker.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +21 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +63 -0
- package/dist/components/ui/dialog.js.map +1 -0
- 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 +24 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +65 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/editable-text.d.ts +24 -0
- package/dist/components/ui/editable-text.d.ts.map +1 -0
- package/dist/components/ui/editable-text.js +85 -0
- package/dist/components/ui/editable-text.js.map +1 -0
- 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 +15 -0
- package/dist/components/ui/field-button.d.ts.map +1 -0
- package/dist/components/ui/field-button.js +18 -0
- package/dist/components/ui/field-button.js.map +1 -0
- package/dist/components/ui/file-preview.d.ts +5 -0
- package/dist/components/ui/file-preview.d.ts.map +1 -0
- package/dist/components/ui/file-preview.js +66 -0
- package/dist/components/ui/file-preview.js.map +1 -0
- package/dist/components/ui/file-uploader.d.ts +39 -0
- package/dist/components/ui/file-uploader.d.ts.map +1 -0
- package/dist/components/ui/file-uploader.js +111 -0
- package/dist/components/ui/file-uploader.js.map +1 -0
- 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 +25 -0
- package/dist/components/ui/handle-row.d.ts.map +1 -0
- package/dist/components/ui/handle-row.js +110 -0
- package/dist/components/ui/handle-row.js.map +1 -0
- 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.d.ts +31 -0
- package/dist/components/ui/image-block.d.ts.map +1 -0
- package/dist/components/ui/image-block.js +103 -0
- package/dist/components/ui/image-block.js.map +1 -0
- package/dist/components/ui/image-card.d.ts +17 -0
- package/dist/components/ui/image-card.d.ts.map +1 -0
- package/dist/components/ui/image-card.js +39 -0
- package/dist/components/ui/image-card.js.map +1 -0
- 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 +31 -0
- package/dist/components/ui/image-viewer.d.ts.map +1 -0
- package/dist/components/ui/image-viewer.js +114 -0
- package/dist/components/ui/image-viewer.js.map +1 -0
- package/dist/components/ui/image.d.ts +33 -0
- package/dist/components/ui/image.d.ts.map +1 -0
- package/dist/components/ui/image.js +61 -0
- package/dist/components/ui/image.js.map +1 -0
- package/dist/components/ui/index.d.ts +92 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +92 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/input.d.ts +75 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +245 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/link-block.d.ts +13 -0
- package/dist/components/ui/link-block.d.ts.map +1 -0
- package/dist/components/ui/link-block.js +21 -0
- package/dist/components/ui/link-block.js.map +1 -0
- 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.d.ts +15 -0
- package/dist/components/ui/mac-card.d.ts.map +1 -0
- package/dist/components/ui/mac-card.js +9 -0
- package/dist/components/ui/mac-card.js.map +1 -0
- 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 +16 -0
- package/dist/components/ui/nav-tree.d.ts.map +1 -0
- package/dist/components/ui/nav-tree.js +41 -0
- package/dist/components/ui/nav-tree.js.map +1 -0
- package/dist/components/ui/page.d.ts +23 -0
- package/dist/components/ui/page.d.ts.map +1 -0
- package/dist/components/ui/page.js +28 -0
- package/dist/components/ui/page.js.map +1 -0
- 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 +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +18 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +19 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +22 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/property.d.ts +11 -0
- package/dist/components/ui/property.d.ts.map +1 -0
- package/dist/components/ui/property.js +18 -0
- package/dist/components/ui/property.js.map +1 -0
- 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 +21 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +12 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select-menu.d.ts +12 -0
- package/dist/components/ui/select-menu.d.ts.map +1 -0
- package/dist/components/ui/select-menu.js +10 -0
- package/dist/components/ui/select-menu.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +45 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/selection-bar.d.ts +12 -0
- package/dist/components/ui/selection-bar.d.ts.map +1 -0
- package/dist/components/ui/selection-bar.js +15 -0
- package/dist/components/ui/selection-bar.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +12 -0
- package/dist/components/ui/separator.js.map +1 -0
- 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 +23 -0
- package/dist/components/ui/spotlight.d.ts.map +1 -0
- package/dist/components/ui/spotlight.js +110 -0
- package/dist/components/ui/spotlight.js.map +1 -0
- package/dist/components/ui/stat-tile.d.ts +8 -0
- package/dist/components/ui/stat-tile.d.ts.map +1 -0
- package/dist/components/ui/stat-tile.js +9 -0
- package/dist/components/ui/stat-tile.js.map +1 -0
- package/dist/components/ui/step-dialog.d.ts +20 -0
- package/dist/components/ui/step-dialog.d.ts.map +1 -0
- package/dist/components/ui/step-dialog.js +36 -0
- package/dist/components/ui/step-dialog.js.map +1 -0
- 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 +16 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +76 -0
- package/dist/components/ui/table.js.map +1 -0
- 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 +16 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/theme-toggle.js +65 -0
- package/dist/components/ui/theme-toggle.js.map +1 -0
- 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 +47 -0
- package/dist/components/ui/time-picker.d.ts.map +1 -0
- package/dist/components/ui/time-picker.js +141 -0
- package/dist/components/ui/time-picker.js.map +1 -0
- 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 +15 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +32 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- 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 +40 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/components/ui/typography.js +98 -0
- package/dist/components/ui/typography.js.map +1 -0
- package/dist/components/ui/video-block.d.ts +14 -0
- package/dist/components/ui/video-block.d.ts.map +1 -0
- package/dist/components/ui/video-block.js +22 -0
- package/dist/components/ui/video-block.js.map +1 -0
- 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 +13 -0
- package/dist/hooks/use-save-queue.d.ts.map +1 -0
- package/dist/hooks/use-save-queue.js +57 -0
- package/dist/hooks/use-save-queue.js.map +1 -0
- package/dist/hooks/use-selection.d.ts +10 -0
- package/dist/hooks/use-selection.d.ts.map +1 -0
- package/dist/hooks/use-selection.js +52 -0
- package/dist/hooks/use-selection.js.map +1 -0
- package/dist/hooks/use-shared-transition.d.ts +3 -0
- package/dist/hooks/use-shared-transition.d.ts.map +1 -0
- package/dist/hooks/use-shared-transition.js +38 -0
- package/dist/hooks/use-shared-transition.js.map +1 -0
- package/dist/hooks/use-upload-queue.d.ts +22 -0
- package/dist/hooks/use-upload-queue.d.ts.map +1 -0
- package/dist/hooks/use-upload-queue.js +78 -0
- package/dist/hooks/use-upload-queue.js.map +1 -0
- package/dist/lib/accent.d.ts +5 -0
- package/dist/lib/accent.d.ts.map +1 -0
- package/dist/lib/accent.js +10 -0
- package/dist/lib/accent.js.map +1 -0
- package/dist/lib/bento.d.ts +17 -0
- package/dist/lib/bento.d.ts.map +1 -0
- package/dist/lib/bento.js +92 -0
- package/dist/lib/bento.js.map +1 -0
- 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 +30 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +61 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/document.d.ts +79 -0
- package/dist/lib/document.d.ts.map +1 -0
- package/dist/lib/document.js +11 -0
- package/dist/lib/document.js.map +1 -0
- package/dist/lib/embed.d.ts +14 -0
- package/dist/lib/embed.d.ts.map +1 -0
- package/dist/lib/embed.js +63 -0
- package/dist/lib/embed.js.map +1 -0
- package/dist/lib/files.d.ts +23 -0
- package/dist/lib/files.d.ts.map +1 -0
- package/dist/lib/files.js +69 -0
- package/dist/lib/files.js.map +1 -0
- package/dist/lib/justified.d.ts +50 -0
- package/dist/lib/justified.d.ts.map +1 -0
- package/dist/lib/justified.js +78 -0
- package/dist/lib/justified.js.map +1 -0
- 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 +16 -0
- package/dist/lib/rich-text-dom.d.ts.map +1 -0
- package/dist/lib/rich-text-dom.js +145 -0
- package/dist/lib/rich-text-dom.js.map +1 -0
- package/dist/lib/rich-text.d.ts +15 -0
- package/dist/lib/rich-text.d.ts.map +1 -0
- package/dist/lib/rich-text.js +35 -0
- package/dist/lib/rich-text.js.map +1 -0
- package/dist/lib/spotlight.d.ts +22 -0
- package/dist/lib/spotlight.d.ts.map +1 -0
- package/dist/lib/spotlight.js +66 -0
- package/dist/lib/spotlight.js.map +1 -0
- 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/tree.d.ts +17 -0
- package/dist/lib/tree.d.ts.map +1 -0
- package/dist/lib/tree.js +35 -0
- package/dist/lib/tree.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +24 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles/notion.css +817 -0
- package/package.json +129 -5
- package/src/components/editor/block-text.tsx +271 -0
- package/src/components/editor/blocks.tsx +373 -0
- package/src/components/editor/document-editor.tsx +106 -0
- package/src/components/editor/document-view.tsx +205 -0
- package/src/components/editor/editor-state.tsx +298 -0
- package/src/components/editor/extensions/kit-blocks.tsx +452 -0
- package/src/components/editor/extensions/spoiler.tsx +81 -0
- package/src/components/editor/index.ts +10 -0
- package/src/components/editor/kinds.ts +158 -0
- package/src/components/editor/look.tsx +36 -0
- package/src/components/sketch/rough.tsx +90 -0
- package/src/components/three/model-viewer.tsx +514 -0
- package/src/components/ui/accent-picker.tsx +72 -0
- package/src/components/ui/address-field.tsx +57 -0
- 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 +140 -0
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +81 -0
- package/src/components/ui/banner.tsx +53 -0
- package/src/components/ui/breadcrumbs.tsx +25 -0
- package/src/components/ui/button.tsx +147 -0
- package/src/components/ui/calendar.tsx +101 -0
- package/src/components/ui/callout.tsx +61 -0
- package/src/components/ui/card.tsx +59 -0
- package/src/components/ui/checkbox.tsx +66 -0
- 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 +102 -0
- 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 +208 -0
- package/src/components/ui/date-time-picker.tsx +123 -0
- package/src/components/ui/dialog.tsx +151 -0
- package/src/components/ui/document-layout.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +185 -0
- package/src/components/ui/editable-text.tsx +142 -0
- 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 +70 -0
- package/src/components/ui/file-preview.tsx +80 -0
- package/src/components/ui/file-uploader.tsx +375 -0
- 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 +252 -0
- 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 +238 -0
- package/src/components/ui/image-card.tsx +95 -0
- package/src/components/ui/image-framer.tsx +160 -0
- package/src/components/ui/image-viewer.tsx +230 -0
- package/src/components/ui/image.tsx +200 -0
- package/src/components/ui/index.ts +178 -0
- package/src/components/ui/input.tsx +471 -0
- package/src/components/ui/link-block.tsx +85 -0
- package/src/components/ui/list-detail.tsx +115 -0
- package/src/components/ui/listbox.ts +26 -0
- package/src/components/ui/mac-card.tsx +46 -0
- 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 +92 -0
- package/src/components/ui/page.tsx +73 -0
- package/src/components/ui/pagination.tsx +143 -0
- package/src/components/ui/picker-panel.tsx +69 -0
- package/src/components/ui/popover.tsx +42 -0
- package/src/components/ui/progress.tsx +76 -0
- package/src/components/ui/property.tsx +33 -0
- 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 +74 -0
- package/src/components/ui/select-menu.tsx +54 -0
- package/src/components/ui/select.tsx +147 -0
- package/src/components/ui/selection-bar.tsx +50 -0
- package/src/components/ui/separator.tsx +30 -0
- 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 +222 -0
- package/src/components/ui/stat-tile.tsx +25 -0
- package/src/components/ui/step-dialog.tsx +104 -0
- package/src/components/ui/steps-layout.tsx +91 -0
- package/src/components/ui/switch.tsx +55 -0
- package/src/components/ui/table.tsx +99 -0
- package/src/components/ui/tabs.tsx +41 -0
- package/src/components/ui/theme-toggle.tsx +80 -0
- package/src/components/ui/time-list.tsx +106 -0
- package/src/components/ui/time-picker.tsx +344 -0
- package/src/components/ui/toast.tsx +132 -0
- package/src/components/ui/toggle.tsx +76 -0
- package/src/components/ui/tooltip.tsx +78 -0
- package/src/components/ui/top-bar.tsx +118 -0
- package/src/components/ui/typography.tsx +204 -0
- package/src/components/ui/video-block.tsx +66 -0
- 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 +78 -0
- package/src/hooks/use-selection.ts +51 -0
- package/src/hooks/use-shared-transition.ts +40 -0
- package/src/hooks/use-upload-queue.ts +111 -0
- package/src/lib/accent.ts +11 -0
- package/src/lib/bento.ts +87 -0
- package/src/lib/database.ts +322 -0
- package/src/lib/dates.ts +75 -0
- package/src/lib/document.ts +55 -0
- package/src/lib/embed.ts +62 -0
- package/src/lib/files.ts +73 -0
- package/src/lib/justified.ts +106 -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 +138 -0
- package/src/lib/rich-text.ts +50 -0
- package/src/lib/spotlight.ts +78 -0
- package/src/lib/theme.ts +18 -0
- package/src/lib/time.ts +83 -0
- package/src/lib/tree.ts +41 -0
- package/src/lib/utils.ts +25 -0
- package/src/styles/notion.css +817 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
import { useId, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Input } from "./input.js";
|
|
7
|
+
import { useEscapeFirst } from "../../hooks/use-escape-first.js";
|
|
8
|
+
import { listSurfaceClasses, optionClasses, stepActive } from "./listbox.js";
|
|
9
|
+
/* A text field that suggests as you type. Anything may be typed; the list under it,
|
|
10
|
+
as wide as the field, offers the options that contain it, those that start with
|
|
11
|
+
it first. Arrow keys move through the list, Enter takes the highlighted one,
|
|
12
|
+
Escape closes the list (and not the dialog around it).
|
|
13
|
+
|
|
14
|
+
The list opens in a layer of its own (a popover in the overlay layer), so a
|
|
15
|
+
dialog's scrolling body or a card's overflow cannot clip it. The cursor stays in
|
|
16
|
+
the field throughout.
|
|
17
|
+
|
|
18
|
+
For a free value with suggestions (a shop, a city typed before). To choose only
|
|
19
|
+
from a list, use Select; to choose several, MultiSelect.
|
|
20
|
+
|
|
21
|
+
From endgame, 2026-12-05. */
|
|
22
|
+
export function Combobox({ value, onChange, options, onEnter, limit = 6, className, onFocus, onBlur, onKeyDown, ...props }) {
|
|
23
|
+
const listId = useId();
|
|
24
|
+
const [open, setOpen] = useState(false);
|
|
25
|
+
const [at, setAt] = useState(-1);
|
|
26
|
+
const typed = value.trim().toLowerCase();
|
|
27
|
+
const starts = options.filter((o) => o.toLowerCase().startsWith(typed));
|
|
28
|
+
const contains = options.filter((o) => !o.toLowerCase().startsWith(typed) && o.toLowerCase().includes(typed));
|
|
29
|
+
const found = (typed === "" ? [...options] : [...starts, ...contains]).filter((o) => o.toLowerCase() !== typed).slice(0, limit);
|
|
30
|
+
const showing = open && found.length > 0;
|
|
31
|
+
// The options can change under the highlight (loaded late, filtered by someone
|
|
32
|
+
// else): one past the end is no highlight, never an undefined choice.
|
|
33
|
+
const active = at < found.length ? at : -1;
|
|
34
|
+
const optionId = (i) => `${listId}-${i}`;
|
|
35
|
+
const field = useRef(null);
|
|
36
|
+
const take = (option) => {
|
|
37
|
+
onChange(option);
|
|
38
|
+
setOpen(false);
|
|
39
|
+
setAt(-1);
|
|
40
|
+
};
|
|
41
|
+
/* Escape with the list open closes the list and nothing else. A dialog around the
|
|
42
|
+
field listens for Escape on the document as the key goes down the tree, before
|
|
43
|
+
the field hears it, so stopping it in the field's own handler is too late. The
|
|
44
|
+
window hears it first of all. (Endgame's copy closed the dialog too.) */
|
|
45
|
+
useEscapeFirst(showing, field, () => setOpen(false));
|
|
46
|
+
return (_jsxs(PopoverPrimitive.Root, { open: showing, children: [_jsx(PopoverPrimitive.Anchor, { asChild: true, children: _jsx("div", { className: "relative", children: _jsx(Input, { ...props, ref: field, role: "combobox", "aria-expanded": showing, "aria-controls": showing ? listId : undefined, "aria-autocomplete": "list", "aria-activedescendant": showing && active >= 0 ? optionId(active) : undefined, autoComplete: "off", value: value, className: className, onChange: (e) => {
|
|
47
|
+
onChange(e.target.value);
|
|
48
|
+
setOpen(true);
|
|
49
|
+
setAt(-1);
|
|
50
|
+
}, onFocus: (e) => {
|
|
51
|
+
setOpen(true);
|
|
52
|
+
onFocus?.(e);
|
|
53
|
+
},
|
|
54
|
+
// A click in the list keeps the focus here (it is mousedown,
|
|
55
|
+
// prevented), so a blur means the field really was left.
|
|
56
|
+
onBlur: (e) => {
|
|
57
|
+
setOpen(false);
|
|
58
|
+
onBlur?.(e);
|
|
59
|
+
}, onKeyDown: (e) => {
|
|
60
|
+
onKeyDown?.(e);
|
|
61
|
+
// The Enter that finishes composing belongs to the input method.
|
|
62
|
+
if (e.defaultPrevented || e.nativeEvent.isComposing || e.keyCode === 229)
|
|
63
|
+
return;
|
|
64
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
setOpen(true);
|
|
67
|
+
const next = stepActive(active, found.length, e.key);
|
|
68
|
+
if (next !== null)
|
|
69
|
+
setAt(next);
|
|
70
|
+
}
|
|
71
|
+
else if (e.key === "Enter") {
|
|
72
|
+
if (showing && active >= 0) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
take(found[active]);
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
onEnter?.();
|
|
78
|
+
}
|
|
79
|
+
} }) }) }), _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content
|
|
80
|
+
// The cursor stays in the field: nothing in the list takes focus.
|
|
81
|
+
, {
|
|
82
|
+
// The cursor stays in the field: nothing in the list takes focus.
|
|
83
|
+
onOpenAutoFocus: (e) => e.preventDefault(), onMouseDown: (e) => e.preventDefault(), onCloseAutoFocus: (e) => e.preventDefault(), onInteractOutside: (e) => {
|
|
84
|
+
if (e.target instanceof Node && field.current?.contains(e.target))
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
}, align: "start", sideOffset: 4, collisionPadding: 8, className: cn("z-(--z-overlay) w-(--radix-popper-anchor-width) max-h-(--radix-popper-available-height) animate-slide-in", listSurfaceClasses), children: _jsx("ul", { id: listId, role: "listbox", children: found.map((option, i) => (_jsx("li", { id: optionId(i), role: "option", "aria-selected": i === active, "data-active": i === active,
|
|
87
|
+
// mousedown, so the choice lands before the field's blur closes the list.
|
|
88
|
+
onMouseDown: (e) => {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
take(option);
|
|
91
|
+
}, onMouseEnter: () => setAt(i), className: optionClasses, children: _jsx("span", { className: "truncate", children: option }) }, option))) }) }) })] }));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.js","sourceRoot":"","sources":["../../../src/components/ui/combobox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAmB,MAAM,YAAa,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,M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 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
export type Command = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
icon: LucideIcon;
|
|
7
|
+
};
|
|
8
|
+
/** The id of a CommandMenu's option, for the field's aria-activedescendant. */
|
|
9
|
+
export declare const commandOptionId: (menuId: string, index: number) => string;
|
|
10
|
+
export declare function CommandMenu({ id, rect, commands, index, onPick, title, }: {
|
|
11
|
+
id?: string;
|
|
12
|
+
rect: DOMRect;
|
|
13
|
+
commands: Command[];
|
|
14
|
+
index: number;
|
|
15
|
+
onPick: (command: Command) => void;
|
|
16
|
+
title?: string;
|
|
17
|
+
}): import("react").ReactPortal | null;
|
|
18
|
+
//# sourceMappingURL=command-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/command-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,MAAM,OAAO,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAOtF,+EAA+E;AAC/E,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,WAAgC,CAAC;AAgB9F,wBAAgB,WAAW,CAAC,EACxB,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,GACR,EAAE;IACC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,sCAuDA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { listSurfaceClasses, optionClasses } from "./listbox.js";
|
|
7
|
+
const HEIGHT = 320;
|
|
8
|
+
const WIDTH = 288;
|
|
9
|
+
const GAP = 6;
|
|
10
|
+
const MARGIN = 8;
|
|
11
|
+
/** The id of a CommandMenu's option, for the field's aria-activedescendant. */
|
|
12
|
+
export const commandOptionId = (menuId, index) => `${menuId}-option-${index}`;
|
|
13
|
+
/* A list of commands anchored to a point on screen, usually the text caret: the "/"
|
|
14
|
+
menu. It never takes focus. Whatever is being typed in keeps the keyboard and
|
|
15
|
+
drives the highlight, so the owner holds `index`, moves it on the arrow keys and
|
|
16
|
+
calls `onPick` on Enter. `caretRect()` in lib/rich-text-dom gives the anchor.
|
|
17
|
+
|
|
18
|
+
For a screen reader to follow the highlight, give it an `id` and put on the
|
|
19
|
+
field: aria-controls={id}, aria-expanded, and
|
|
20
|
+
aria-activedescendant={commandOptionId(id, index)}.
|
|
21
|
+
|
|
22
|
+
It is drawn at the foot of the page (a portal), so a dialog's transform or
|
|
23
|
+
overflow does not move or clip it, and kept on screen: it opens upward when
|
|
24
|
+
there is more room above, and shifts left at the window's right edge.
|
|
25
|
+
|
|
26
|
+
Filtering is the owner's too: pass the commands that match what was typed. */
|
|
27
|
+
export function CommandMenu({ id, rect, commands, index, onPick, title, }) {
|
|
28
|
+
const list = useRef(null);
|
|
29
|
+
const [mounted, setMounted] = useState(false);
|
|
30
|
+
useLayoutEffect(() => setMounted(true), []);
|
|
31
|
+
// The keyboard moves the highlight, so the list follows it out of view.
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
list.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
34
|
+
}, [index]);
|
|
35
|
+
if (!mounted)
|
|
36
|
+
return null;
|
|
37
|
+
const below = window.innerHeight - rect.bottom - GAP - MARGIN;
|
|
38
|
+
const aboveRoom = rect.top - GAP - MARGIN;
|
|
39
|
+
const above = below < Math.min(HEIGHT, 200) && aboveRoom > below;
|
|
40
|
+
const room = Math.max(120, Math.min(HEIGHT, above ? aboveRoom : below));
|
|
41
|
+
const width = Math.min(WIDTH, window.innerWidth - MARGIN * 2);
|
|
42
|
+
const left = Math.max(MARGIN, Math.min(rect.left, window.innerWidth - width - MARGIN));
|
|
43
|
+
return createPortal(_jsxs("div", { ref: list, style: { left, width, maxHeight: room, ...(above ? { bottom: window.innerHeight - rect.top + GAP } : { top: rect.bottom + GAP }) }, className: cn("fixed z-(--z-overlay) flex flex-col animate-slide-in", listSurfaceClasses),
|
|
44
|
+
// Keeps the caret where it is when an entry is clicked.
|
|
45
|
+
onMouseDown: (e) => e.preventDefault(), children: [title && (_jsx("div", { "aria-hidden": true, className: "px-2 pt-1.5 pb-1 text-caption font-medium text-ink-tertiary", children: title })), _jsx("div", { role: "listbox", id: id, "aria-label": title ?? "Commands", children: commands.map((command, i) => (_jsxs("div", { id: id ? commandOptionId(id, i) : undefined, role: "option", "aria-selected": i === index, "data-active": i === index, onClick: () => onPick(command),
|
|
46
|
+
// A taller row: an icon tile and a line of hint under the name.
|
|
47
|
+
className: cn(optionClasses, "h-auto gap-2.5 py-1.5 hover:bg-tint-hover"), children: [_jsx("span", { "aria-hidden": true, className: "flex size-9 shrink-0 items-center justify-center rounded-control bg-surface shadow-xs", children: _jsx(command.icon, { className: "size-4 text-ink-secondary" }) }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "block text-sm", children: command.label }), command.hint && _jsx("span", { className: "block truncate text-caption text-ink-tertiary", children: command.hint })] })] }, command.key))) })] }), document.body);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=command-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-menu.js","sourceRoot":"","sources":["../../../src/components/ui/command-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIjE,MAAM,MAAM,GAAG,GAAG,CAAC;AACnB,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,MAAM,GAAG,CAAC,CAAC;AAEjB,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,MAAM,WAAW,KAAK,EAAE,CAAC;AAE9F;;;;;;;;;;;;;gFAagF;AAChF,MAAM,UAAU,WAAW,CAAC,EACxB,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,GAQR;IACG,MAAM,IAAI,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,eAAe,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,wEAAwE;IACxE,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,wBAAwB,CAAC,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAChG,CAAC,EAAE,CAAC,KAAK,CAAC,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CAAC,CAAC,CAAC,cAAc,EAAE,aAErC,KAAK,IAAI,CACN,mCAAiB,SAAS,EAAC,6DAA6D,YACnF,KAAK,GACJ,CACT,EACD,cAAK,IAAI,EAAC,SAAS,EAAC,EAAE,EAAE,EAAE,gBAAc,KAAK,IAAI,UAAU,YACtD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAC1B,eAEI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC3C,IAAI,EAAC,QAAQ,mBACE,CAAC,KAAK,KAAK,iBACb,CAAC,KAAK,KAAK,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;oBAC9B,gEAAgE;oBAChE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,2CAA2C,CAAC,aAEzE,oCAAkB,SAAS,EAAC,uFAAuF,YAC/G,KAAC,OAAO,CAAC,IAAI,IAAC,SAAS,EAAC,2BAA2B,GAAG,GACnD,EACP,gBAAM,SAAS,EAAC,SAAS,aACrB,eAAM,SAAS,EAAC,eAAe,YAAE,OAAO,CAAC,KAAK,GAAQ,EACrD,OAAO,CAAC,IAAI,IAAI,eAAM,SAAS,EAAC,+CAA+C,YAAE,OAAO,CAAC,IAAI,GAAQ,IACnG,KAfF,OAAO,CAAC,GAAG,CAgBd,CACT,CAAC,GACA,IACJ,EACN,QAAQ,CAAC,IAAI,CAChB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export declare const ContextMenu: import("react").FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
|
+
export declare const ContextMenuTrigger: import("react").ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
export declare const ContextMenuGroup: import("react").ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const ContextMenuSub: import("react").FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
7
|
+
export declare const ContextMenuRadioGroup: import("react").ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare function ContextMenuContent({ className, ...props }: ComponentProps<typeof ContextMenuPrimitive.Content>): import("react").JSX.Element;
|
|
9
|
+
export declare function ContextMenuItem({ className, danger, ...props }: ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
10
|
+
danger?: boolean;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export declare function ContextMenuCheckboxItem({ className, children, ...props }: ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): import("react").JSX.Element;
|
|
13
|
+
export declare function ContextMenuRadioItem({ className, children, ...props }: ComponentProps<typeof ContextMenuPrimitive.RadioItem>): import("react").JSX.Element;
|
|
14
|
+
export declare function ContextMenuLabel({ className, ...props }: ComponentProps<typeof ContextMenuPrimitive.Label>): import("react").JSX.Element;
|
|
15
|
+
export declare function ContextMenuSeparator({ className, ...props }: ComponentProps<typeof ContextMenuPrimitive.Separator>): import("react").JSX.Element;
|
|
16
|
+
export declare function ContextMenuSubTrigger({ className, children, ...props }: ComponentProps<typeof ContextMenuPrimitive.SubTrigger>): import("react").JSX.Element;
|
|
17
|
+
export declare function ContextMenuSubContent({ className, ...props }: ComponentProps<typeof ContextMenuPrimitive.SubContent>): import("react").JSX.Element;
|
|
18
|
+
export { DropdownMenuShortcut as ContextMenuShortcut } from "./dropdown-menu.js";
|
|
19
|
+
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/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,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,UAAU,CAAC,+BAO9H;AAED,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,UAAU,CAAC,+BAMpH;AAED,OAAO,EAAE,oBAAoB,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
|
+
import { Check, ChevronRight } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { menuItemClasses, menuSurfaceClasses } from "./dropdown-menu.js";
|
|
7
|
+
/* The menu for a right click, or a long press on a touch screen, on the thing it
|
|
8
|
+
is about: a row, a card, a picture. The same look as DropdownMenu, from the same
|
|
9
|
+
classes. Its items should also be reachable another way (a row's "⋯" button),
|
|
10
|
+
because a right click is invisible to anyone who does not know to try it, and
|
|
11
|
+
a keyboard can only open it with the Menu key or Shift+F10. */
|
|
12
|
+
export const ContextMenu = ContextMenuPrimitive.Root;
|
|
13
|
+
export const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
14
|
+
export const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
15
|
+
export const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
16
|
+
export const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
17
|
+
export function ContextMenuContent({ className, ...props }) {
|
|
18
|
+
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { collisionPadding: 8, className: cn(menuSurfaceClasses, "origin-[--radix-context-menu-content-transform-origin]", className), ...props }) }));
|
|
19
|
+
}
|
|
20
|
+
export function ContextMenuItem({ className, danger, ...props }) {
|
|
21
|
+
return (_jsx(ContextMenuPrimitive.Item, { className: cn(menuItemClasses, danger && "text-danger data-[highlighted]:bg-danger-tint [&_svg]:text-danger", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
export function ContextMenuCheckboxItem({ className, children, ...props }) {
|
|
24
|
+
return (_jsxs(ContextMenuPrimitive.CheckboxItem, { className: cn(menuItemClasses, "pl-7", className), ...props, children: [_jsx("span", { className: "left-2 absolute flex justify-center items-center size-4", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-3.5 !text-ink" }) }) }), children] }));
|
|
25
|
+
}
|
|
26
|
+
export function ContextMenuRadioItem({ className, children, ...props }) {
|
|
27
|
+
return (_jsxs(ContextMenuPrimitive.RadioItem, { className: cn(menuItemClasses, "pl-7", className), ...props, children: [_jsx("span", { className: "left-2 absolute flex justify-center items-center size-4", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx("span", { className: "block bg-ink rounded-full size-1.5" }) }) }), children] }));
|
|
28
|
+
}
|
|
29
|
+
export function ContextMenuLabel({ className, ...props }) {
|
|
30
|
+
return _jsx(ContextMenuPrimitive.Label, { className: cn("px-2 pt-1.5 pb-1 font-medium text-caption text-ink-tertiary", className), ...props });
|
|
31
|
+
}
|
|
32
|
+
export function ContextMenuSeparator({ className, ...props }) {
|
|
33
|
+
return _jsx(ContextMenuPrimitive.Separator, { className: cn("-mx-1.5 my-1.5 bg-hairline h-px", className), ...props });
|
|
34
|
+
}
|
|
35
|
+
export function ContextMenuSubTrigger({ className, children, ...props }) {
|
|
36
|
+
return (_jsxs(ContextMenuPrimitive.SubTrigger, { className: cn(menuItemClasses, "data-[state=open]:bg-tint-hover", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto size-3.5" })] }));
|
|
37
|
+
}
|
|
38
|
+
export function ContextMenuSubContent({ className, ...props }) {
|
|
39
|
+
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.SubContent, { className: cn(menuSurfaceClasses, className), ...props }) }));
|
|
40
|
+
}
|
|
41
|
+
export { DropdownMenuShortcut as ContextMenuShortcut } from "./dropdown-menu.js";
|
|
42
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../../src/components/ui/context-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAqB,CAAC;AAE1E;;;;iEAIiE;AAEjE,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,OAAO,CAAC;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,KAAK,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAAC;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,UAAU,CAAC;AAErE,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAuD;IAC3G,OAAO,CACH,KAAC,oBAAoB,CAAC,MAAM,cACxB,KAAC,oBAAoB,CAAC,OAAO,IAAC,gBAAgB,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,wDAAwD,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,GAC9I,CACjC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAA2E;IACpI,OAAO,CACH,KAAC,oBAAoB,CAAC,IAAI,IACtB,SAAS,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AACtH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA0D;IAC3H,OAAO,CACH,MAAC,oBAAoB,CAAC,UAAU,IAAC,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,iCAAiC,EAAE,SAAS,CAAC,KAAM,KAAK,aACnH,QAAQ,EACT,KAAC,YAAY,IAAC,SAAS,EAAC,kBAAkB,GAAG,IACf,CACrC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA0D;IACjH,OAAO,CACH,KAAC,oBAAoB,CAAC,MAAM,cACxB,KAAC,oBAAoB,CAAC,UAAU,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,GAClE,CACjC,CAAC;AACN,CAAC;AAED,OAAO,EAAE,oBAAoB,IAAI,mBAAmB,EAAE,MAAM,oBAAqB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ButtonProps } from "./button.js";
|
|
3
|
+
/** Writes text to the clipboard; true if it worked. Falls back to a hidden field where the Clipboard API is missing or refused. */
|
|
4
|
+
export declare function copyText(text: string): Promise<boolean>;
|
|
5
|
+
export declare function CopyButton({ value, label, children, size, variant, className, onCopied, ...props }: Omit<ButtonProps, "value" | "onClick" | "children"> & {
|
|
6
|
+
value: string | (() => string);
|
|
7
|
+
label?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
onCopied?: () => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=copy-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/copy-button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAExD,mIAAmI;AACnI,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAoB7D;AAKD,wBAAgB,UAAU,CAAC,EACvB,KAAK,EACL,KAAc,EACd,QAAQ,EACR,IAAI,EACJ,OAAiB,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG;IACrD,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,+BAgCA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Copy } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
/** Writes text to the clipboard; true if it worked. Falls back to a hidden field where the Clipboard API is missing or refused. */
|
|
8
|
+
export async function copyText(text) {
|
|
9
|
+
try {
|
|
10
|
+
await navigator.clipboard.writeText(text);
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
try {
|
|
15
|
+
const area = document.createElement("textarea");
|
|
16
|
+
area.value = text;
|
|
17
|
+
area.setAttribute("readonly", "");
|
|
18
|
+
area.style.position = "fixed";
|
|
19
|
+
area.style.opacity = "0";
|
|
20
|
+
document.body.appendChild(area);
|
|
21
|
+
area.select();
|
|
22
|
+
const ok = document.execCommand("copy");
|
|
23
|
+
area.remove();
|
|
24
|
+
return ok;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/* Copies `value`. The icon turns to a tick for a moment and a screen reader hears
|
|
32
|
+
"Copied"; if copying fails it says so instead. Icon-only by default (named
|
|
33
|
+
"Copy …" with `label`); give `children` for words beside the icon. */
|
|
34
|
+
export function CopyButton({ value, label = "Copy", children, size, variant = "ghost", className, onCopied, ...props }) {
|
|
35
|
+
const [state, setState] = useState("idle");
|
|
36
|
+
const timer = useRef(undefined);
|
|
37
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
38
|
+
const iconOnly = children === undefined;
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Button, { ...props, variant: variant, size: size ?? (iconOnly ? "icon-sm" : "sm"), "aria-label": iconOnly ? label : undefined, className: cn(className), onClick: async () => {
|
|
40
|
+
const ok = await copyText(typeof value === "function" ? value() : value);
|
|
41
|
+
setState(ok ? "copied" : "failed");
|
|
42
|
+
if (ok)
|
|
43
|
+
onCopied?.();
|
|
44
|
+
clearTimeout(timer.current);
|
|
45
|
+
timer.current = setTimeout(() => setState("idle"), 1600);
|
|
46
|
+
}, children: [_jsxs("span", { className: "inline-grid [&>svg]:col-start-1 [&>svg]:row-start-1", children: [_jsx(Copy, { className: cn("transition-[opacity,scale] duration-(--duration-fast)", state === "copied" ? "opacity-0 scale-50" : "opacity-100 scale-100") }), _jsx(Check, { className: cn("text-success transition-[opacity,scale] duration-(--duration-fast)", state === "copied" ? "opacity-100 scale-100" : "opacity-0 scale-50") })] }), children] }), _jsx("span", { role: "status", className: "sr-only", children: state === "copied" ? "Copied" : state === "failed" ? "Couldn't copy" : "" })] }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=copy-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../../src/components/ui/copy-button.tsx"],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AC,uBAAuB,CAAC,GAAI,EACrJ,KAAC,KAAK,IAAC,SAAS,EAAE,EAAE,CAAC,oEAAoE,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAI,IAChK,EACN,QAAQ,IACJ,EACT,eAAM,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,SAAS,YAClC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,GACvE,IACR,CACN,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Property, type Row, type Value, type View } from "../../../lib/database.js";
|
|
2
|
+
export declare function CalendarView({ properties, rows, view, onSetValue, onAddRow, onOpenRow }: {
|
|
3
|
+
properties: readonly Property[];
|
|
4
|
+
rows: readonly Row[];
|
|
5
|
+
view: View;
|
|
6
|
+
onSetValue: (row: Row, property: Property, value: Value) => void;
|
|
7
|
+
onAddRow: (values?: Record<string, Value>) => void;
|
|
8
|
+
onOpenRow?: (row: Row) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=calendar-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-view.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/database/calendar-view.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAsE5G,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IACtF,UAAU,EAAE,SAAS,QAAQ,EAAE,CAAC;IAChC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC,+BAgGA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DndContext, MouseSensor, pointerWithin, TouchSensor, useDraggable, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
4
|
+
import { ChevronLeft, ChevronRight, Plus } from "lucide-react";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { daysIn, formatMonth, fromISODate, monthOf, shiftMonth, today, toISODate } from "../../../lib/dates.js";
|
|
7
|
+
import { isEmpty, titleOf } from "../../../lib/database.js";
|
|
8
|
+
import { cn } from "../../../lib/utils.js";
|
|
9
|
+
import { Button } from "../button.js";
|
|
10
|
+
import { EmptyState } from "../empty-state.js";
|
|
11
|
+
/* The calendar view: a month, each row on the day of the view's date property
|
|
12
|
+
(`dateProperty`). A row is dragged to another day to move it (a short press on
|
|
13
|
+
a touch screen); "+" on a day adds a row there. Under 40rem of room the grid
|
|
14
|
+
becomes the month's days that have something, as a list, since seven columns
|
|
15
|
+
of chips cannot be read on a phone. */
|
|
16
|
+
const WEEKDAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
17
|
+
/** The days a month grid shows: from the Monday on or before the 1st, whole weeks. */
|
|
18
|
+
function gridDays(month) {
|
|
19
|
+
const first = fromISODate(`${month}-01`);
|
|
20
|
+
const lead = (first.getDay() + 6) % 7;
|
|
21
|
+
const count = Math.ceil((lead + daysIn(month)) / 7) * 7;
|
|
22
|
+
return Array.from({ length: count }, (_, i) => toISODate(new Date(first.getFullYear(), first.getMonth(), 1 - lead + i)));
|
|
23
|
+
}
|
|
24
|
+
function Chip({ row, title, onOpenRow }) {
|
|
25
|
+
const drag = useDraggable({ id: row.id });
|
|
26
|
+
return (_jsx("button", { ref: drag.setNodeRef, ...drag.listeners, type: "button", onClick: () => onOpenRow?.(row), className: cn("bg-surface shadow-xs hover:shadow-sm px-1.5 py-0.5 rounded-small w-full text-caption text-left truncate touch-manipulation", drag.isDragging && "opacity-40"), style: drag.transform ? { transform: `translate(${drag.transform.x}px, ${drag.transform.y}px)`, position: "relative", zIndex: 10 } : undefined, children: title || _jsx("span", { className: "text-ink-tertiary", children: "Untitled" }) }));
|
|
27
|
+
}
|
|
28
|
+
function Day({ day, month, rows, titleOf, onOpenRow, onAdd }) {
|
|
29
|
+
const drop = useDroppable({ id: day });
|
|
30
|
+
const date = fromISODate(day);
|
|
31
|
+
const isToday = day === today();
|
|
32
|
+
return (_jsxs("div", { ref: drop.setNodeRef, role: "gridcell", "aria-label": date.toLocaleDateString(undefined, { weekday: "long", day: "numeric", month: "long" }) + (rows.length ? `, ${rows.length} item${rows.length === 1 ? "" : "s"}` : ""), className: cn("group group/day flex flex-col gap-0.5 p-1 border-hairline border-r border-b min-h-24 transition-colors duration-(--duration-fast)", monthOf(day) !== month && "bg-surface-sunken/60", drop.isOver && "bg-accent-tint"), children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("button", { type: "button", "aria-label": `Add on ${date.toLocaleDateString()}`, onClick: onAdd, className: "flex justify-center items-center hover:bg-tint-hover rounded-small size-5 text-ink-tertiary affordance", children: _jsx(Plus, { className: "size-3.5" }) }), _jsx("span", { className: cn("flex justify-center items-center rounded-full size-6 tabular-nums text-caption", isToday ? "bg-accent-solid text-accent-ink font-medium" : monthOf(day) === month ? "text-ink-secondary" : "text-ink-tertiary"), children: date.getDate() })] }), rows.map((row) => (_jsx(Chip, { row: row, title: titleOf(row), onOpenRow: onOpenRow }, row.id)))] }));
|
|
33
|
+
}
|
|
34
|
+
export function CalendarView({ properties, rows, view, onSetValue, onAddRow, onOpenRow }) {
|
|
35
|
+
const dateBy = properties.find((p) => p.id === view.dateProperty && p.type === "date");
|
|
36
|
+
const [month, setMonth] = useState(() => monthOf(today()));
|
|
37
|
+
const sensors = useSensors(useSensor(MouseSensor, { activationConstraint: { distance: 4 } }), useSensor(TouchSensor, { activationConstraint: { delay: 220, tolerance: 6 } }));
|
|
38
|
+
if (!dateBy)
|
|
39
|
+
return _jsx(EmptyState, { compact: true, title: "Choose what the calendar dates by", description: "A calendar needs a date property to place rows on days. Choose one in the view's options." });
|
|
40
|
+
const title = titleOf(properties);
|
|
41
|
+
const nameOf = (row) => (title && !isEmpty(row.values[title.id] ?? null) ? String(row.values[title.id]) : "");
|
|
42
|
+
const onDay = new Map();
|
|
43
|
+
for (const row of rows) {
|
|
44
|
+
const v = row.values[dateBy.id];
|
|
45
|
+
if (typeof v !== "string" || v === "")
|
|
46
|
+
continue;
|
|
47
|
+
const day = v.slice(0, 10);
|
|
48
|
+
onDay.set(day, [...(onDay.get(day) ?? []), row]);
|
|
49
|
+
}
|
|
50
|
+
const days = gridDays(month);
|
|
51
|
+
const inMonth = days.filter((d) => monthOf(d) === month && onDay.has(d));
|
|
52
|
+
const undated = rows.filter((r) => isEmpty(r.values[dateBy.id] ?? null)).length;
|
|
53
|
+
return (_jsxs("div", { className: "@container", children: [_jsxs("div", { className: "flex items-center gap-1 mb-2", children: [_jsx("h3", { className: "mr-auto font-semibold text-h3", "aria-live": "polite", children: formatMonth(month) }), _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Previous month", onClick: () => setMonth(shiftMonth(month, -1)), children: _jsx(ChevronLeft, {}) }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setMonth(monthOf(today())), children: "Today" }), _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Next month", onClick: () => setMonth(shiftMonth(month, 1)), children: _jsx(ChevronRight, {}) })] }), _jsx(DndContext, { sensors: sensors, collisionDetection: pointerWithin, onDragEnd: (e) => {
|
|
54
|
+
const row = rows.find((r) => r.id === e.active.id);
|
|
55
|
+
if (!row || !e.over)
|
|
56
|
+
return;
|
|
57
|
+
const day = String(e.over.id);
|
|
58
|
+
const before = row.values[dateBy.id];
|
|
59
|
+
// A time the date had stays with it.
|
|
60
|
+
const time = typeof before === "string" && before.length > 10 ? before.slice(10) : "";
|
|
61
|
+
if (typeof before !== "string" || before.slice(0, 10) !== day)
|
|
62
|
+
onSetValue(row, dateBy, day + time);
|
|
63
|
+
}, accessibility: { screenReaderInstructions: { draggable: "Open the item to change its date." } }, children: _jsxs("div", { role: "grid", "aria-label": formatMonth(month), className: "@max-xl:hidden border-hairline border-t border-l rounded-surface overflow-hidden", children: [_jsx("div", { role: "row", className: "grid grid-cols-7", children: WEEKDAYS.map((d) => (_jsx("div", { role: "columnheader", className: "px-2 py-1 border-hairline border-r border-b text-caption text-ink-tertiary", children: d }, d))) }), Array.from({ length: days.length / 7 }, (_, w) => (_jsx("div", { role: "row", className: "grid grid-cols-7", children: days.slice(w * 7, w * 7 + 7).map((day) => (_jsx(Day, { day: day, month: month, rows: onDay.get(day) ?? [], titleOf: nameOf, onOpenRow: onOpenRow, onAdd: () => onAddRow({ [dateBy.id]: day }) }, day))) }, w)))] }) }), _jsx("div", { className: "@xl:hidden", children: inMonth.length === 0 ? (_jsx(EmptyState, { compact: true, title: `Nothing in ${formatMonth(month)}` })) : (_jsx("ol", { className: "flex flex-col", children: inMonth.map((day) => (_jsxs("li", { className: "py-2 border-hairline border-b", children: [_jsx("p", { className: "mb-1 font-medium text-caption text-ink-secondary", children: fromISODate(day).toLocaleDateString(undefined, { weekday: "long", day: "numeric", month: "long" }) }), _jsx("div", { className: "flex flex-col gap-1", children: onDay.get(day).map((row) => (_jsx("button", { type: "button", onClick: () => onOpenRow?.(row), className: "hover:bg-tint-hover px-2 py-1.5 rounded-control text-sm text-left", children: nameOf(row) || _jsx("span", { className: "text-ink-tertiary", children: "Untitled" }) }, row.id))) })] }, day))) })) }), undated > 0 && (_jsxs("p", { className: "mt-2 text-caption text-ink-tertiary", children: [undated, " with no ", dateBy.name, ", not shown."] }))] }));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=calendar-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-view.js","sourceRoot":"","sources":["../../../../src/components/ui/database/calendar-view.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvI,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAkD,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAoB,CAAC;AAEhD;;;;yCAIyC;AAEzC,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEnE,sFAAsF;AACtF,SAAS,QAAQ,CAAC,KAAa;IAC3B,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,KAAK,KAAK,CAAE,CAAC;IAC1C,M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Gb,cAAK,SAAS,EAAC,YAAY,YACtB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACpB,KAAC,UAAU,IAAC,OAAO,QAAC,KAAK,EAAE,cAAc,WAAW,CAAC,KAAK,CAAC,EAAE,GAAI,CACpE,CAAC,CAAC,CAAC,CACA,aAAI,SAAS,EAAC,eAAe,YACxB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAClB,cAAc,SAAS,EAAC,+BAA+B,aACnD,YAAG,SAAS,EAAC,kDAAkD,YAAE,WAAW,CAAC,GAAG,CAAE,CAAC,kBAAkB,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAK,EACzK,cAAK,SAAS,EAAC,qBAAqB,YAC/B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC1B,iBAAqB,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,SAAS,EAAC,mEAAmE,YAC5I,MAAM,CAAC,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,mBAAmB,yBAAgB,IAD1D,GAAG,CAAC,EAAE,CAEV,CACZ,CAAC,GACA,KARD,GAAG,CASP,CACR,CAAC,GACD,CACR,GACC,EACL,OAAO,GAAG,CAAC,IAAI,CACZ,aAAG,SAAS,EAAC,qCAAqC,aAC7C,OAAO,eAAW,MAAM,CAAC,IAAI,oBAC9B,CACP,IACC,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Property, type Row, type Value, type View } from "../../../lib/database.js";
|
|
2
|
+
export declare function BoardView({ properties, rows, view, onSetValue, onAddRow, onOpenRow }: {
|
|
3
|
+
properties: readonly Property[];
|
|
4
|
+
rows: readonly Row[];
|
|
5
|
+
view: View;
|
|
6
|
+
onSetValue: (row: Row, property: Property, value: Value) => void;
|
|
7
|
+
onAddRow: (values?: Record<string, Value>) => void;
|
|
8
|
+
onOpenRow?: (row: Row) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function GalleryView({ properties, rows, view, onOpenRow }: {
|
|
11
|
+
properties: readonly Property[];
|
|
12
|
+
rows: readonly Row[];
|
|
13
|
+
view: View;
|
|
14
|
+
onOpenRow?: (row: Row) => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function ListView({ properties, rows, view, onOpenRow }: {
|
|
17
|
+
properties: readonly Property[];
|
|
18
|
+
rows: readonly Row[];
|
|
19
|
+
view: View;
|
|
20
|
+
onOpenRow?: (row: Row) => void;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=card-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-views.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/database/card-views.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA4D,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AA6GpJ,wBAAgB,SAAS,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IACnF,UAAU,EAAE,SAAS,QAAQ,EAAE,CAAC;IAChC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC,+BAkDA;AAMD,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,UAAU,EAAE,SAAS,QAAQ,EAAE,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,+BAiBvK;AAMD,wBAAgB,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,UAAU,EAAE,SAAS,QAAQ,EAAE,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,+BAoBpK"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DndContext, DragOverlay, MouseSensor, pointerWithin, TouchSensor, useDraggable, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
4
|
+
import { ArrowRightLeft, MoreHorizontal, Plus } from "lucide-react";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { groupRows, isEmpty, shownProperties, titleOf } from "../../../lib/database.js";
|
|
7
|
+
import { cn } from "../../../lib/utils.js";
|
|
8
|
+
import { Badge } from "../badge.js";
|
|
9
|
+
import { Button } from "../button.js";
|
|
10
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "../dropdown-menu.js";
|
|
11
|
+
import { EmptyState } from "../empty-state.js";
|
|
12
|
+
import { Image } from "../image.js";
|
|
13
|
+
import { CellValue } from "./cells.js";
|
|
14
|
+
/* The views made of cards and lines: board, gallery and list. A card or a line
|
|
15
|
+
opens its row (onOpenRow); the properties shown under its title are the view's
|
|
16
|
+
own (hidden ones left out, empty ones skipped). */
|
|
17
|
+
function Title({ row, properties }) {
|
|
18
|
+
const title = titleOf(properties);
|
|
19
|
+
const v = title ? row.values[title.id] : null;
|
|
20
|
+
return isEmpty(v ?? null) ? _jsx("span", { className: "text-ink-tertiary", children: "Untitled" }) : _jsx(_Fragment, { children: String(v) });
|
|
21
|
+
}
|
|
22
|
+
function Facts({ row, properties, skip }) {
|
|
23
|
+
const facts = properties.filter((p) => p.type !== "title" && p.id !== skip && !isEmpty(row.values[p.id] ?? null) && !(p.type === "checkbox" && row.values[p.id] !== true));
|
|
24
|
+
if (facts.length === 0)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsx("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 mt-1.5 text-caption text-ink-secondary", children: facts.map((p) => (_jsxs("span", { className: "inline-flex items-center gap-1 max-w-full", children: [p.type === "checkbox" && _jsx("span", { children: p.name }), _jsx(CellValue, { property: p, value: row.values[p.id], plain: true })] }, p.id))) }));
|
|
27
|
+
}
|
|
28
|
+
/* ── Board ─────────────────────────────────────────────────────────────────
|
|
29
|
+
A column for each option of the view's select (`groupBy`), and one for no
|
|
30
|
+
value. Cards are dragged between columns (a short press on a touch screen); a
|
|
31
|
+
card's menu moves it from the keyboard. "New" in a column adds a row there.
|
|
32
|
+
On a phone the columns scroll sideways, a column at a time. */
|
|
33
|
+
function BoardCard({ row, properties, view, groups, onOpenRow, onMoveTo, overlay = false }) {
|
|
34
|
+
const drag = useDraggable({ id: row.id, disabled: overlay });
|
|
35
|
+
const groupBy = properties.find((p) => p.id === view.groupBy);
|
|
36
|
+
return (_jsxs("div", { ref: drag.setNodeRef, ...drag.listeners, className: cn("group group/card relative bg-surface shadow-sm hover:shadow-md p-2.5 rounded-surface text-sm transition-[opacity,box-shadow] duration-(--duration-fast) touch-manipulation", drag.isDragging && "opacity-40", overlay && "shadow-popover rotate-1 cursor-grabbing"), children: [_jsx("button", { type: "button", onClick: () => onOpenRow?.(row), className: "pr-6 w-full font-medium text-left break-words after:absolute after:inset-0 after:content-['']", children: _jsx(Title, { row: row, properties: properties }) }), _jsx(Facts, { row: row, properties: shownProperties(properties, view), skip: view.groupBy }), !overlay && groupBy && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Move to another column", className: "top-1.5 right-1.5 z-1 absolute size-6 affordance", children: _jsx(MoreHorizontal, {}) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuLabel, { children: "Move to" }), groups.map((g) => (_jsxs(DropdownMenuItem, { disabled: row.values[groupBy.id] === g.key || (g.key === null && isEmpty(row.values[groupBy.id] ?? null)), onSelect: () => onMoveTo(row, g.key), children: [_jsx(ArrowRightLeft, {}), " ", g.option?.name ?? `No ${groupBy.name}`] }, g.key ?? "none")))] })] }))] }));
|
|
37
|
+
}
|
|
38
|
+
function BoardColumn({ group, label, children, onAdd, count }) {
|
|
39
|
+
const drop = useDroppable({ id: group.key ?? "__none" });
|
|
40
|
+
return (_jsxs("section", { ref: drop.setNodeRef, "aria-label": typeof label === "string" ? label : group.option?.name, className: cn("flex flex-col gap-2 bg-surface-sunken p-2 rounded-surface w-68 transition-colors duration-(--duration-fast) snap-start shrink-0", drop.isOver && "bg-accent-tint"), children: [_jsxs("h3", { className: "flex items-center gap-2 px-1 h-control-sm text-sm", children: [label, _jsx("span", { className: "tabular-nums text-ink-tertiary", children: count })] }), children, _jsxs(Button, { variant: "ghost", size: "sm", onClick: onAdd, className: "justify-start text-ink-tertiary", children: [_jsx(Plus, {}), " New"] })] }));
|
|
41
|
+
}
|
|
42
|
+
export function BoardView({ properties, rows, view, onSetValue, onAddRow, onOpenRow }) {
|
|
43
|
+
const groupBy = properties.find((p) => p.id === view.groupBy && p.type === "select");
|
|
44
|
+
const sensors = useSensors(useSensor(MouseSensor, { activationConstraint: { distance: 4 } }), useSensor(TouchSensor, { activationConstraint: { delay: 220, tolerance: 6 } }));
|
|
45
|
+
const [dragging, setDragging] = useState(null);
|
|
46
|
+
if (!groupBy)
|
|
47
|
+
return _jsx(EmptyState, { compact: true, title: "Choose what the board groups by", description: "A board needs a select property: its options become the columns. Choose one in the view's options." });
|
|
48
|
+
const groups = groupRows(rows, groupBy);
|
|
49
|
+
const moveTo = (row, key) => onSetValue(row, groupBy, key);
|
|
50
|
+
return (_jsxs(DndContext, { sensors: sensors, collisionDetection: pointerWithin, onDragStart: (e) => setDragging(rows.find((r) => r.id === e.active.id) ?? null), onDragCancel: () => setDragging(null), onDragEnd: (e) => {
|
|
51
|
+
setDragging(null);
|
|
52
|
+
const row = rows.find((r) => r.id === e.active.id);
|
|
53
|
+
if (!row || !e.over)
|
|
54
|
+
return;
|
|
55
|
+
const key = e.over.id === "__none" ? null : String(e.over.id);
|
|
56
|
+
if ((row.values[groupBy.id] ?? null) !== key)
|
|
57
|
+
moveTo(row, key);
|
|
58
|
+
}, accessibility: { screenReaderInstructions: { draggable: "Open a card's menu to move it to another column." } }, children: [_jsx("div", { className: "flex items-start gap-3 pb-2 overflow-x-auto overscroll-x-contain snap-x snap-mandatory sm:snap-none", children: groups.map((g) => (_jsx(BoardColumn, { group: g, count: g.rows.length, label: g.option ? _jsx(Badge, { color: g.option.color, children: g.option.name }) : _jsxs("span", { className: "text-ink-secondary", children: ["No ", groupBy.name] }), onAdd: () => onAddRow({ [groupBy.id]: g.key }), children: g.rows.map((row) => (_jsx(BoardCard, { row: row, properties: properties, view: view, groups: groups, onOpenRow: onOpenRow, onMoveTo: moveTo }, row.id))) }, g.key ?? "none"))) }), _jsx(DragOverlay, { dropAnimation: null, children: dragging && (_jsxs("div", { className: "bg-surface shadow-popover p-2.5 rounded-surface text-sm rotate-1 cursor-grabbing", children: [_jsx("div", { className: "font-medium break-words", children: _jsx(Title, { row: dragging, properties: properties }) }), _jsx(Facts, { row: dragging, properties: shownProperties(properties, view), skip: view.groupBy })] })) })] }));
|
|
59
|
+
}
|
|
60
|
+
/* ── Gallery ───────────────────────────────────────────────────────────────
|
|
61
|
+
Cards with the row's cover picture (row.cover) over its title. As many columns
|
|
62
|
+
as fit, one on a small phone. */
|
|
63
|
+
export function GalleryView({ properties, rows, view, onOpenRow }) {
|
|
64
|
+
const shown = shownProperties(properties, view);
|
|
65
|
+
return (_jsx("ul", { className: "gap-3 grid grid-cols-[repeat(auto-fill,minmax(min(14rem,100%),1fr))]", children: rows.map((row) => (_jsxs("li", { className: "group/card relative bg-surface shadow-sm hover:shadow-md rounded-surface overflow-hidden transition-shadow duration-(--duration-fast)", children: [_jsx(Image, { src: row.cover ?? null, alt: "", ratio: "landscape", className: "rounded-none" }), _jsxs("div", { className: "p-2.5 text-sm", children: [_jsx("button", { type: "button", onClick: () => onOpenRow?.(row), className: "w-full font-medium text-left break-words after:absolute after:inset-0 after:content-['']", children: _jsx(Title, { row: row, properties: properties }) }), _jsx(Facts, { row: row, properties: shown })] })] }, row.id))) }));
|
|
66
|
+
}
|
|
67
|
+
/* ── List ──────────────────────────────────────────────────────────────────
|
|
68
|
+
A line per row: its title, and its shown properties at the end (under it on a
|
|
69
|
+
phone). The quietest view. */
|
|
70
|
+
export function ListView({ properties, rows, view, onOpenRow }) {
|
|
71
|
+
const shown = shownProperties(properties, view).filter((p) => p.type !== "title");
|
|
72
|
+
return (_jsx("ul", { className: "@container flex flex-col", children: rows.map((row) => (_jsx("li", { className: "border-hairline border-b", children: _jsxs("button", { type: "button", onClick: () => onOpenRow?.(row), className: "flex @max-md:flex-col @md:items-center gap-x-4 gap-y-1 hover:bg-tint-hover px-2 py-2 rounded-control w-full text-sm text-left", children: [_jsx("span", { className: "flex-1 min-w-0 font-medium truncate", children: _jsx(Title, { row: row, properties: properties }) }), _jsx("span", { className: "flex flex-wrap items-center gap-2 text-caption text-ink-secondary", children: shown.map((p) => (_jsx(CellValue, { property: p, value: row.values[p.id], plain: true }, p.id))) })] }) }, row.id))) }));
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=card-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-views.js","sourceRoot":"","sources":["../../../../src/components/ui/database/card-views.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACpJ,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAA8D,MAAM,0BAA0B,CAAC;AACpJ,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAc,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,qBAAsB,CAAC;AACnI,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAc,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAa,CAAC;AAExC;;qDAEqD;AAErD,SAAS,KAAK,CAAC,EAAE,GAAG,EAAE,UAAU,EAAiD;IAC7E,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK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