@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 @@
|
|
|
1
|
+
{"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../../src/components/ui/rating.tsx"],"names":[],"mappings":"AAYA,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,GAAO,EACP,IAAQ,EACR,IAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,QAAgB,EAChB,KAAgB,EAChB,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAyEA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Star } from "lucide-react";
|
|
4
|
+
import { useId, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
/* A rating out of `max` stars, in whole or half steps (`step`). A slider to
|
|
7
|
+
assistive technology ("3.5 of 5 stars"). Click or tap a star (its left half for
|
|
8
|
+
a half step); the arrow keys move by a step, Home and End to none and all, and
|
|
9
|
+
the number keys set a whole rating. Hovering with a mouse previews. Clicking the
|
|
10
|
+
current rating again clears it, unless `required`. `readOnly` draws a rating
|
|
11
|
+
without taking one (a list of films). */
|
|
12
|
+
export function Rating({ value, onChange, max = 5, step = 1, size = "md", readOnly = false, required = false, disabled = false, label = "Rating", className, }) {
|
|
13
|
+
const [preview, setPreview] = useState(null);
|
|
14
|
+
const id = useId();
|
|
15
|
+
const shown = preview ?? value ?? 0;
|
|
16
|
+
const sizes = { sm: "size-3.5", md: "size-5", lg: "size-6 [@media(pointer:coarse)]:size-7" }[size];
|
|
17
|
+
const live = !readOnly && !disabled;
|
|
18
|
+
const words = value == null ? "Not rated" : `${value} of ${max} star${max === 1 ? "" : "s"}`;
|
|
19
|
+
const set = (next) => {
|
|
20
|
+
if (!live)
|
|
21
|
+
return;
|
|
22
|
+
const clamped = next == null ? null : Math.max(step, Math.min(max, Math.round(next / step) * step));
|
|
23
|
+
onChange?.(clamped === value && !required ? null : clamped);
|
|
24
|
+
};
|
|
25
|
+
const at = (e, index) => {
|
|
26
|
+
if (step === 1)
|
|
27
|
+
return index + 1;
|
|
28
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
29
|
+
return index + (e.clientX - r.left < r.width / 2 ? 0.5 : 1);
|
|
30
|
+
};
|
|
31
|
+
const onKeyDown = (e) => {
|
|
32
|
+
if (!live)
|
|
33
|
+
return;
|
|
34
|
+
const now = value ?? 0;
|
|
35
|
+
const keys = {
|
|
36
|
+
ArrowRight: now + step,
|
|
37
|
+
ArrowUp: now + step,
|
|
38
|
+
ArrowLeft: now - step,
|
|
39
|
+
ArrowDown: now - step,
|
|
40
|
+
Home: 0,
|
|
41
|
+
End: max,
|
|
42
|
+
};
|
|
43
|
+
let next = keys[e.key];
|
|
44
|
+
if (/^[0-9]$/.test(e.key) && Number(e.key) <= max)
|
|
45
|
+
next = Number(e.key);
|
|
46
|
+
if (next === undefined)
|
|
47
|
+
return;
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
const clamped = Math.max(0, Math.min(max, next));
|
|
50
|
+
onChange?.(clamped === 0 ? (required ? step : null) : clamped);
|
|
51
|
+
};
|
|
52
|
+
if (readOnly)
|
|
53
|
+
return (_jsx("span", { role: "img", "aria-label": words, className: cn("inline-flex items-center gap-0.5", className), children: Array.from({ length: max }, (_, i) => (_jsx(StarShape, { fill: Math.max(0, Math.min(1, shown - i)), className: sizes }, i))) }));
|
|
54
|
+
return (_jsx("div", { role: "slider", tabIndex: disabled ? -1 : 0, "aria-label": label, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": value ?? 0, "aria-valuetext": words, "aria-disabled": disabled || undefined, onKeyDown: onKeyDown, onPointerLeave: () => setPreview(null), className: cn("inline-flex items-center rounded-control outline-offset-2", disabled && "opacity-50", className), children: Array.from({ length: max }, (_, i) => (_jsx("span", { "aria-hidden": true, onPointerMove: (e) => e.pointerType === "mouse" && live && setPreview(at(e, i)), onClick: (e) => set(at(e, i)), className: cn("p-0.5 [@media(pointer:coarse)]:p-1", live && "cursor-pointer"), children: _jsx(StarShape, { fill: Math.max(0, Math.min(1, shown - i)), className: cn(sizes, preview !== null && "opacity-90") }) }, `${id}-${i}`))) }));
|
|
55
|
+
}
|
|
56
|
+
/* One star, filled by `fill` (0, 0.5 or 1): the outline in the control's edge, the
|
|
57
|
+
fill in the warning ink (the kit's yellow, AA on both themes). */
|
|
58
|
+
function StarShape({ fill, className }) {
|
|
59
|
+
return (_jsxs("span", { className: cn("inline-block relative", className), children: [_jsx(Star, { className: "absolute inset-0 size-full text-control-edge", strokeWidth: 1.5 }), _jsx("span", { className: "absolute inset-y-0 left-0 overflow-hidden", style: { width: `${fill * 100}%` }, children: _jsx(Star, { className: cn("max-w-none text-warning fill-current", className), strokeWidth: 1.5 }) })] }));
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=rating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rating.js","sourceRoot":"","sources":["../../../src/components/ui/rating.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAyC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;2CAK2C;AAC3C,MAAM,UAAU,MAAM,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,GAAG,GAAG,CAAC,EACP,IAAI,GAAG,CAAC,EACR,IAAI,GAAG,IAAI,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB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,gBAAgB,CAAC,YAE7E,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,IAAI,YAAY,CAAC,GAAI,IAN3G,GAAG,EAAE,IAAI,CAAC,EAAE,CAOd,CACV,CAAC,GACA,CACT,CAAC;AACN,CAAC;AAED;oEACoE;AACpE,SAAS,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAwC;IACxE,OAAO,CACH,gBAAM,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,aACnD,KAAC,IAAI,IAAC,SAAS,EAAC,8CAA8C,EAAC,WAAW,EAAE,GAAG,GAAI,EACnF,eAAM,SAAS,EAAC,2CAA2C,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,YAC1F,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,EAAE,WAAW,EAAE,GAAG,GAAI,GACzF,IACJ,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type SaveState = "idle" | "saving" | "saved" | "offline" | "error";
|
|
2
|
+
export declare function SaveStatus({ state, onRetry, savedAt, className }: {
|
|
3
|
+
state: SaveState;
|
|
4
|
+
onRetry?: () => void;
|
|
5
|
+
savedAt?: Date | null;
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=save-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-status.d.ts","sourceRoot":"","sources":["../../../src/components/ui/save-status.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1E,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAqCvJ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, CircleAlert, CloudOff } from "lucide-react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Spinner } from "./spinner.js";
|
|
8
|
+
export function SaveStatus({ state, onRetry, savedAt, className }) {
|
|
9
|
+
// "Saved" shows, then settles to its quiet resting form.
|
|
10
|
+
const [fresh, setFresh] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (state !== "saved")
|
|
13
|
+
return;
|
|
14
|
+
setFresh(true);
|
|
15
|
+
const t = setTimeout(() => setFresh(false), 2000);
|
|
16
|
+
return () => clearTimeout(t);
|
|
17
|
+
}, [state, savedAt]);
|
|
18
|
+
const when = savedAt ? savedAt.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" }) : null;
|
|
19
|
+
return (_jsxs("span", { className: cn("inline-flex items-center gap-1.5 text-caption", state === "error" ? "text-danger" : "text-ink-tertiary", className), children: [state === "saving" && _jsx(Spinner, { size: "sm" }), state === "saved" && _jsx(Check, { className: cn("size-3.5 transition-opacity duration-(--duration-slow)", fresh ? "opacity-100" : "opacity-0") }), state === "offline" && _jsx(CloudOff, { className: "size-3.5" }), state === "error" && _jsx(CircleAlert, { className: "size-3.5" }), _jsx("span", { role: "status", "aria-live": state === "error" ? "assertive" : "polite", children: state === "saving"
|
|
20
|
+
? "Saving…"
|
|
21
|
+
: state === "saved"
|
|
22
|
+
? fresh || !when
|
|
23
|
+
? "Saved"
|
|
24
|
+
: `Saved at ${when}`
|
|
25
|
+
: state === "offline"
|
|
26
|
+
? _jsxs(_Fragment, { children: ["Offline", _jsx("span", { className: "sr-only", children: ": changes will save when you reconnect" })] })
|
|
27
|
+
: state === "error"
|
|
28
|
+
? "Couldn't save"
|
|
29
|
+
: "" }), state === "error" && onRetry && (_jsx(Button, { variant: "link", size: "sm", onClick: onRetry, className: "text-caption", children: "Try again" }))] }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=save-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-status.js","sourceRoot":"","sources":["../../../src/components/ui/save-status.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AASxC,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAyF;IACpJ,yDAAyD;IACzD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,KAAK,KAAK,OAAO;YAAE,OAAO;QAC9B,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EA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8C,IAAG;4BACrF,CAAC,CAAC,KAAK,KAAK,OAAO;gCACjB,CAAC,CAAC,eAAe;gCACjB,CAAC,CAAC,EAAE,GACX,EACN,KAAK,KAAK,OAAO,IAAI,OAAO,IAAI,CAC7B,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,cAAc,0BAElE,CACZ,IACE,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type SegmentedOption<T extends string> = {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
iconOnly?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function Segmented<T extends string>({ options, value, onChange, label, size, disabled, name, className, }: {
|
|
10
|
+
options: readonly SegmentedOption<T>[];
|
|
11
|
+
value: T;
|
|
12
|
+
onChange: (value: T) => void;
|
|
13
|
+
/** What is being chosen, for screen readers. */
|
|
14
|
+
label: string;
|
|
15
|
+
size?: "sm" | "md";
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Sends the choice with a form. */
|
|
18
|
+
name?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=segmented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented.d.ts","sourceRoot":"","sources":["../../../src/components/ui/segmented.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAOtI,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,IAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,GACZ,EAAE;IACC,OAAO,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAgCA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
const sizes = {
|
|
6
|
+
sm: "h-control-sm text-caption [&_svg]:size-3.5",
|
|
7
|
+
md: "h-control-md text-sm [&_svg]:size-4",
|
|
8
|
+
};
|
|
9
|
+
export function Segmented({ options, value, onChange, label, size = "sm", disabled, name, className, }) {
|
|
10
|
+
return (_jsx(RadioGroupPrimitive.Root, { "aria-label": label, value: value, onValueChange: (v) => onChange(v), orientation: "horizontal", disabled: disabled, name: name, className: cn("flex gap-0.5 bg-tint-hover p-0.5 rounded-control", className), children: options.map((option) => (_jsxs(RadioGroupPrimitive.Item, { value: option.value, disabled: option.disabled, "aria-label": option.iconOnly ? option.label : undefined, className: cn("inline-flex flex-1 justify-center items-center gap-1.5 px-3 rounded-small font-medium whitespace-nowrap outline-offset-1", "text-ink-secondary hover:text-ink transition-[background-color,box-shadow,color] duration-(--duration-fast)", "data-[state=checked]:bg-surface-overlay data-[state=checked]:text-ink data-[state=checked]:shadow-[inset_0_0_0_1px_var(--control-edge)]", "disabled:text-ink-disabled disabled:cursor-not-allowed", option.iconOnly && "px-0 aspect-square flex-none", sizes[size]), children: [option.icon, !option.iconOnly && option.label] }, option.value))) }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=segmented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented.js","sourceRoot":"","sources":["../../../src/components/ui/segmented.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAYxC,MAAM,KAAK,GAAG;IACV,EAAE,EAAE,4CAA4C;IAChD,EAAE,EAAE,qCAAqC;CAC5C,CAAC;AAEF,MAAM,UAAU,SAAS,CAAmB,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,IAAI,GAAG,IAAI,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,GAYZ;IACG,OAAO,CACH,KAAC,mBAAmB,CAAC,IAAI,kBACT,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAM,CAAC,EACtC,WAAW,EAAC,YAAY,EACxB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CAAC,kDAAkD,EAAE,SAAS,CAAC,YAE3E,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,MAAC,mBAAmB,CAAC,IAAI,IAErB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,gBACb,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EACtD,SAAS,EAAE,EAAE,CACT,0HAA0H,EAC1H,6GAA6G,EAC7G,yIAAyI,EACzI,wDAAwD,EACxD,MAAM,CAAC,QAAQ,IAAI,8BAA8B,EACjD,KAAK,CAAC,IAAI,CAAC,CACd,aAEA,MAAM,CAAC,IAAI,EACX,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,KAd5B,MAAM,CAAC,KAAK,CAeM,CAC9B,CAAC,GACqB,CAC9B,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function SelectMenu<T extends string>({ value, options, onChange, render, label, disabled, className, }: {
|
|
3
|
+
value: T;
|
|
4
|
+
options: readonly T[];
|
|
5
|
+
onChange: (value: T) => void;
|
|
6
|
+
render?: (value: T) => ReactNode;
|
|
7
|
+
/** What is being chosen. A screen reader hears it with the value: "Status, Buy". */
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=select-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAiB,EACjB,KAAK,EACL,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC;IACjC,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BA4BA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Pick one of a fixed set. The trigger is whatever shows the current value, a badge
|
|
6
|
+
or plain text, so a property reads the same at rest as it does in a table. */
|
|
7
|
+
export function SelectMenu({ value, options, onChange, render = (v) => v, label, disabled, className, }) {
|
|
8
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, disabled: disabled, children: _jsx("button", { type: "button", "aria-label": `${label}, ${typeof render(value) === "string" ? render(value) : value}`, className: cn("flex min-h-control-sm items-center rounded-control px-1.5 text-left text-sm transition-colors duration-(--duration-fast) hover:bg-tint-hover", "data-[state=open]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:bg-transparent", className), children: render(value) }) }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-80 overflow-y-auto", children: _jsx(DropdownMenuRadioGroup, { value: value, onValueChange: (v) => onChange(v), children: options.map((option) => (_jsx(DropdownMenuRadioItem, { value: option, children: render(option) }, option))) }) })] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=select-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-menu.js","sourceRoot":"","sources":["../../../src/components/ui/select-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAqB,CAAC;AAC5I,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;mFACmF;AACnF,MAAM,UAAU,UAAU,CAAmB,EACzC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,SAAS,GAUZ;IACG,OAAO,CACH,MAAC,YAAY,eACT,KAAC,mBAAmB,IAAC,OAAO,QAAC,QAAQ,EAAE,QAAQ,YAC3C,iBACI,IAAI,EAAC,QAAQ,gBAED,GAAG,KAAK,KAAK,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EACpF,SAAS,EAAE,EAAE,CACT,8IAA8I,EAC9I,+GAA+G,EAC/G,SAAS,CACZ,YAEA,MAAM,CAAC,KAAK,CAAC,GACT,GACS,EACtB,KAAC,mBAAmB,IAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,YACnE,KAAC,sBAAsB,IAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAM,CAAC,YACvE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,KAAC,qBAAqB,IAAc,KAAK,EAAE,MAAM,YAC5C,MAAM,CAAC,MAAM,CAAC,IADS,MAAM,CAEV,CAC3B,CAAC,GACmB,GACP,IACX,CAClB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import type { ComponentProps, ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export declare const Select: import("react").FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
export declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const SelectValue: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export declare function SelectTrigger({ className, children, size, ...props }: ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function SelectContent({ className, children, sideOffset, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Content>): import("react").JSX.Element;
|
|
10
|
+
export declare function SelectItem({ className, children, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Item>): import("react").JSX.Element;
|
|
11
|
+
export declare function SelectLabel({ className, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Label>): import("react").JSX.Element;
|
|
12
|
+
export declare function SelectSeparator({ className, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>): import("react").JSX.Element;
|
|
13
|
+
export declare function NativeSelect({ className, children, size, ...props }: Omit<ComponentProps<"select">, "size"> & {
|
|
14
|
+
size?: "sm" | "md" | "lg";
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAWtE,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAC3C,eAAO,MAAM,WAAW,6HAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,8HAAwB,CAAC;AAEjD,wBAAgB,aAAa,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,+BAqBhF;AAED,wBAAgB,aAAa,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,UAAc,EACd,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,+BAuB1D;AAED,wBAAgB,UAAU,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,+BAqBvD;AAED,wBAAgB,WAAW,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,+BAOxD;AAED,wBAAgB,eAAe,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,+BAO5D;AASD,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,+BAW3I"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import { Check, ChevronDown } from "lucide-react";
|
|
5
|
+
import { fieldVariants, fromField, useField } from "./input.js";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
/* Pick one of a list, in a form. The trigger is the same sunken well as Input and
|
|
8
|
+
the list is the same surface as a menu, so it belongs to both. For a value shown
|
|
9
|
+
as plain text or a badge that opens a list when pressed, see SelectMenu.
|
|
10
|
+
|
|
11
|
+
An option's value cannot be the empty string: Radix keeps that for "nothing
|
|
12
|
+
chosen". Give "none" a name of its own. */
|
|
13
|
+
export const Select = SelectPrimitive.Root;
|
|
14
|
+
export const SelectGroup = SelectPrimitive.Group;
|
|
15
|
+
export const SelectValue = SelectPrimitive.Value;
|
|
16
|
+
export function SelectTrigger({ className, children, size, ...props }) {
|
|
17
|
+
// Inside a Field: its id (so the label names this), description and invalid.
|
|
18
|
+
const own = fromField(useField(), props);
|
|
19
|
+
return (_jsxs(SelectPrimitive.Trigger, { ...own, className: cn(fieldVariants({ size }), "flex items-center justify-between gap-2 text-left cursor-pointer", "data-[placeholder]:text-ink-placeholder", "data-[state=open]:bg-surface data-[state=open]:shadow-[inset_0_0_0_1px_var(--accent),0_0_0_3px_var(--accent-tint)]", "[&>span]:min-w-0 [&>span]:truncate", className), children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "size-4 shrink-0 text-ink-tertiary" }) })] }));
|
|
20
|
+
}
|
|
21
|
+
export function SelectContent({ className, children, sideOffset = 6, ...props }) {
|
|
22
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Content, { position: "popper", sideOffset: sideOffset, collisionPadding: 8, className: cn("z-(--z-overlay) overflow-hidden bg-surface-overlay shadow-popover rounded-overlay", "min-w-[max(var(--radix-select-trigger-width),8rem)] max-h-[min(var(--radix-select-content-available-height),20rem)]", "data-[state=open]:animate-slide-in data-[state=closed]:animate-fade-out", "origin-[--radix-select-content-transform-origin]", className), ...props, children: _jsx(SelectPrimitive.Viewport, { className: "p-1.5", children: children }) }) }));
|
|
23
|
+
}
|
|
24
|
+
export function SelectItem({ className, children, ...props }) {
|
|
25
|
+
return (_jsxs(SelectPrimitive.Item, { className: cn("relative flex items-center gap-2 cursor-default select-none", "min-h-control-sm py-1 pr-8 pl-2 rounded-control text-sm text-ink outline-none", "transition-colors duration-(--duration-instant)", "data-[highlighted]:bg-tint-hover", "data-[disabled]:pointer-events-none data-[disabled]:text-ink-disabled", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx("span", { className: "right-2 absolute flex justify-center items-center size-4", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4 text-ink-secondary" }) }) })] }));
|
|
26
|
+
}
|
|
27
|
+
export function SelectLabel({ className, ...props }) {
|
|
28
|
+
return (_jsx(SelectPrimitive.Label, { className: cn("px-2 pt-1.5 pb-1 font-medium text-ink-tertiary text-caption", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
export function SelectSeparator({ className, ...props }) {
|
|
31
|
+
return (_jsx(SelectPrimitive.Separator, { className: cn("-mx-1.5 my-1.5 bg-hairline h-px", className), ...props }));
|
|
32
|
+
}
|
|
33
|
+
/* The browser's own select, dressed as the same field. On a phone it opens the
|
|
34
|
+
system's picker, which is the better one there; it needs no script to work and
|
|
35
|
+
sends its value with a form like any field. The browser's arrow sits flush
|
|
36
|
+
against the edge and cannot be padded, so it is hidden and one is drawn where it
|
|
37
|
+
belongs. Options are plain <option> elements.
|
|
38
|
+
|
|
39
|
+
From endgame, 2026-12-05. */
|
|
40
|
+
export function NativeSelect({ className, children, size, ...props }) {
|
|
41
|
+
// 16px on a phone (from the field's size), or iOS zooms into it like an input.
|
|
42
|
+
const own = fromField(useField(), props);
|
|
43
|
+
return (_jsxs("div", { className: "relative", children: [_jsx("select", { className: cn(fieldVariants({ size }), "appearance-none pr-8", className), ...own, children: children }), _jsx(ChevronDown, { className: "top-1/2 right-2.5 absolute size-4 text-ink-tertiary -translate-y-1/2 pointer-events-none" })] }));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAAA,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AAE,KAAK,CAAC,CAAC;IACzC,OAAO,CACH,eAAK,SAAS,EAAC,UAAU,aACrB,iBAAQ,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,sBAAsB,EAAE,SAAS,CAAC,KAAM,GAAG,YACrF,QAAQ,GACJ,EACT,KAAC,WAAW,IAAC,SAAS,EAAC,0FAA0F,GAAG,IAClH,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function SelectionBar({ count, noun, empty, onDone, children, className, }: {
|
|
3
|
+
count: number;
|
|
4
|
+
/** Singular; an "s" is added for any count but one. */
|
|
5
|
+
noun?: string;
|
|
6
|
+
/** Said while nothing is picked yet. */
|
|
7
|
+
empty?: string;
|
|
8
|
+
onDone: () => void;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=selection-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-bar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/selection-bar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,IAAa,EACb,KAAmB,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAoBA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
/* What can be done to the things picked: a bar that rises from the bottom of
|
|
7
|
+
the window while a selection is being made, saying how many and offering
|
|
8
|
+
the actions as its children (ghost buttons, small).
|
|
9
|
+
|
|
10
|
+
It centres on the page, not the window: if the app sets `--sidebar-w` (as
|
|
11
|
+
`AppShell` does) it clears the sidebar. Pair it with `useSelection`. */
|
|
12
|
+
export function SelectionBar({ count, noun = "item", empty = "Pick some", onDone, children, className, }) {
|
|
13
|
+
return (_jsxs("div", { role: "toolbar", "aria-label": "Selection", className: cn("fixed bottom-5 left-[calc(50%+var(--sidebar-w,0px)/2)] z-(--z-sticky) flex max-w-[calc(100vw-var(--sidebar-w,0px)-2rem)] -translate-x-1/2 animate-slide-in items-center gap-1", "rounded-overlay bg-surface-overlay py-1.5 pr-1.5 pl-4 shadow-popover", className), children: [_jsx("span", { className: "mr-2 text-sm font-medium whitespace-nowrap text-ink tabular-nums", "aria-live": "polite", children: count === 0 ? empty : `${count.toLocaleString()} ${noun}${count === 1 ? "" : "s"} selected` }), children, _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Stop selecting", onClick: onDone, className: "ml-1", children: _jsx(X, {}) })] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=selection-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-bar.js","sourceRoot":"","sources":["../../../src/components/ui/selection-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;0EAK0E;AAC1E,MAAM,UAAU,YAAY,CAAC,EACzB,KAAK,EACL,IAAI,GAAG,MAAM,EACb,KAAK,GAAG,WAAW,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,GAUZ;IACG,OAAO,CACH,eACI,IAAI,EAAC,SAAS,gBACH,WAAW,EACtB,SAAS,EAAE,EAAE,CACT,+KAA+K,EAC/K,sEAAsE,EACtE,SAAS,CACZ,aAED,eAAM,SAAS,EAAC,kEAAkE,eAAW,QAAQ,YAChG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW,GACzF,EACN,QAAQ,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,gBAAY,gBAAgB,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,YAChG,KAAC,CAAC,KAAG,GACA,IACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export declare function Separator({ className, orientation, decorative, ...props }: ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAMtD,wBAAgB,SAAS,CAAC,EACtB,SAAS,EACT,WAA0B,EAC1B,UAAiB,EACjB,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,+BAe1D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Dividers whisper. 1px at 9% ink — if you can see it clearly from
|
|
6
|
+
across the room, it is too strong. */
|
|
7
|
+
export function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
8
|
+
return (_jsx(SeparatorPrimitive.Root, { decorative: decorative, orientation: orientation, className: cn("bg-hairline shrink-0", orientation === "horizontal"
|
|
9
|
+
? "w-full h-px"
|
|
10
|
+
: "w-px h-full self-stretch", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;wCACwC;AAExC,MAAM,UAAU,SAAS,CAAC,EACtB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,IAAI,EACjB,GAAG,KAAK,EAC+C;IACvD,OAAO,CACH,KAAC,kBAAkB,CAAC,IAAI,IACpB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACT,sBAAsB,EACtB,WAAW,KAAK,YAAY;YACxB,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,0BAA0B,EAChC,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export type SettingsSectionLink = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: LucideIcon;
|
|
7
|
+
};
|
|
8
|
+
export declare function SettingsLayout({ title, sections, current, onSelect, onBack, children, className, }: {
|
|
9
|
+
title?: string;
|
|
10
|
+
sections: readonly SettingsSectionLink[];
|
|
11
|
+
/** The open section, or null for the menu (on a narrow screen). */
|
|
12
|
+
current: string | null;
|
|
13
|
+
onSelect: (id: string) => void;
|
|
14
|
+
/** Back to the menu, on a narrow screen. */
|
|
15
|
+
onBack: () => void;
|
|
16
|
+
/** The open section's content. */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
/** A titled group of settings, with a line under the title. */
|
|
21
|
+
export declare function SettingsSection({ title, description, children, className, }: {
|
|
22
|
+
title: ReactNode;
|
|
23
|
+
description?: ReactNode;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
/** One setting: its name and what it does on the left, its control on the right (under them when it does not fit beside). */
|
|
28
|
+
export declare function SettingsRow({ label, description, children, htmlFor }: {
|
|
29
|
+
label: ReactNode;
|
|
30
|
+
description?: ReactNode;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
htmlFor?: string;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=settings-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-layout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/settings-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC3B,KAAkB,EAClB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACzC,mEAAmE;IACnE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,4CAA4C;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAkCA;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAQA;AAED,6HAA6H;AAC7H,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,+BAoB1J"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { ListDetail } from "./list-detail.js";
|
|
5
|
+
export function SettingsLayout({ title = "Settings", sections, current, onSelect, onBack, children, className, }) {
|
|
6
|
+
return (_jsx(ListDetail, { className: className, listWidth: "15rem", listLabel: title, detailLabel: sections.find((s) => s.id === current)?.label ?? title, showDetail: current !== null, onBack: onBack, backLabel: title, list: _jsxs("nav", { "aria-label": title, className: "flex flex-col gap-px p-3", children: [_jsx("h2", { className: "px-2 pt-1 pb-2 font-semibold text-h3", children: title }), sections.map(({ id, label, icon: Icon }) => (_jsxs("button", { type: "button", "data-list-item": true, "aria-current": id === current ? "page" : undefined, onClick: () => onSelect(id), className: cn("flex items-center gap-2 px-2 rounded-control h-control-sm [@media(pointer:coarse)]:h-11 text-sm text-left transition-colors duration-(--duration-instant)", id === current ? "bg-tint-active font-medium text-ink" : "text-ink-secondary hover:bg-tint-hover hover:text-ink"), children: [Icon && _jsx(Icon, { className: "size-4 text-ink-tertiary shrink-0" }), _jsx("span", { className: "truncate", children: label })] }, id)))] }), detail: _jsx("div", { className: "mx-auto px-5 @xl:px-8 py-6 @xl:py-8 w-full max-w-measure", children: children }) }));
|
|
7
|
+
}
|
|
8
|
+
/** A titled group of settings, with a line under the title. */
|
|
9
|
+
export function SettingsSection({ title, description, children, className, }) {
|
|
10
|
+
return (_jsxs("section", { className: cn("mb-10 last:mb-0", className), children: [_jsx("h3", { className: "font-semibold text-h3", children: title }), description !== undefined && _jsx("p", { className: "mt-1 text-ink-secondary text-sm", children: description }), _jsx("div", { className: "mt-3 border-hairline border-t", children: children })] }));
|
|
11
|
+
}
|
|
12
|
+
/** One setting: its name and what it does on the left, its control on the right (under them when it does not fit beside). */
|
|
13
|
+
export function SettingsRow({ label, description, children, htmlFor }) {
|
|
14
|
+
return (_jsx("div", { className: "py-3.5 border-hairline border-b", children: _jsxs("div", { className: "flex flex-wrap items-center gap-x-6 gap-y-2.5", children: [_jsxs("div", { className: "flex-1 min-w-[min(12rem,100%)]", children: [htmlFor ? (_jsx("label", { htmlFor: htmlFor, className: "font-medium text-ink text-sm", children: label })) : (_jsx("div", { className: "font-medium text-ink text-sm", children: label })), description !== undefined && _jsx("p", { className: "mt-0.5 text-ink-secondary text-sm", children: description })] }), _jsx("div", { className: "flex items-center gap-2 max-w-full", children: children })] }) }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=settings-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-layout.js","sourceRoot":"","sources":["../../../src/components/ui/settings-layout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAmB,CAAC;AAc/C,MAAM,UAAU,cAAc,CAAC,EAC3B,KAAK,GAAG,UAAU,EAClB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,GAYZ;IACG,OAAO,CACH,KAAC,UAAU,IACP,SAAS,EAAE,SAAS,EACpB,SAAS,EAAC,OAAO,EACjB,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,EACnE,UAAU,EAAE,OAAO,KAAK,IAAI,EAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EACA,6BAAiB,KAAK,EAAE,SAAS,EAAC,0BAA0B,aACxD,aAAI,SAAS,EAAC,sCAAsC,YAAE,KAAK,GAAM,EAChE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACzC,kBAEI,IAAI,EAAC,QAAQ,0CAEC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAC3B,SAAS,EAAE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,YAAE,QAAQ,GAAO,IAClE,GACJ,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function ShareLink({ url, enabled, onEnabledChange, title, description, privateText, busy, children, className, }: {
|
|
3
|
+
url: string | null;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
onEnabledChange: (enabled: boolean) => void;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
privateText?: ReactNode;
|
|
9
|
+
/** Turning it on or off is saving: the switch is held. */
|
|
10
|
+
busy?: boolean;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=share-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-link.d.ts","sourceRoot":"","sources":["../../../src/components/ui/share-link.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS9C,wBAAgB,SAAS,CAAC,EACtB,GAAG,EACH,OAAO,EACP,eAAe,EACf,KAA0B,EAC1B,WAA8C,EAC9C,WAAsC,EACtC,IAAY,EACZ,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAgCA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Globe, Lock } from "lucide-react";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { CopyButton } from "./copy-button.js";
|
|
7
|
+
import { Switch } from "./switch.js";
|
|
8
|
+
/* Sharing one thing by a public link (a trip, a vault): a switch that turns the
|
|
9
|
+
link on, and while on, the link itself, selectable and copied with a press. Off,
|
|
10
|
+
it says who can see the thing instead. `children` for anything more (who has
|
|
11
|
+
opened it, an expiry). */
|
|
12
|
+
export function ShareLink({ url, enabled, onEnabledChange, title = "Share to the web", description = "Anyone with the link can view.", privateText = "Only you can see this.", busy = false, children, className, }) {
|
|
13
|
+
const field = useId();
|
|
14
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("span", { "aria-hidden": true, className: cn("flex justify-center items-center rounded-full size-8 shrink-0", enabled ? "bg-accent-tint text-accent-text" : "bg-tint-hover text-ink-tertiary"), children: enabled ? _jsx(Globe, { className: "size-4" }) : _jsx(Lock, { className: "size-4" }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsx(Switch, { checked: enabled, onCheckedChange: onEnabledChange, disabled: busy, label: title, description: enabled ? description : privateText }) })] }), enabled && url && (_jsxs("div", { className: "flex items-center gap-1 bg-surface-sunken p-1 pl-3 rounded-control", children: [_jsx("label", { htmlFor: field, className: "sr-only", children: "Link" }), _jsx("input", { id: field, readOnly: true, value: url, onFocus: (e) => e.currentTarget.select(), className: "flex-1 bg-transparent outline-none min-w-0 text-ink-secondary text-sm truncate" }), _jsx(CopyButton, { value: url, variant: "secondary", label: "Copy link", children: "Copy link" })] })), children] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=share-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-link.js","sourceRoot":"","sources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AAC,oEAAoE,aAC/E,gBAAO,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,SAAS,qBAElC,EACR,gBACI,EAAE,EAAE,KAAK,EACT,QAAQ,QACR,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,EACxC,SAAS,EAAC,gFAAgF,GAC5F,EACF,KAAC,UAAU,IAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,WAAW,0BAEhD,IACX,CACT,EACA,QAAQ,IACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export declare const Sheet: import("react").FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
export declare const SheetTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const SheetClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const SIDES: {
|
|
7
|
+
readonly right: "inset-y-0 right-0 w-[min(28rem,100vw)] max-sm:w-full rounded-l-overlay max-sm:rounded-none";
|
|
8
|
+
readonly left: "inset-y-0 left-0 w-[min(28rem,100vw)] max-sm:w-full rounded-r-overlay max-sm:rounded-none";
|
|
9
|
+
readonly bottom: "inset-x-0 bottom-0 max-h-[85dvh] rounded-t-overlay pb-[env(safe-area-inset-bottom)]";
|
|
10
|
+
};
|
|
11
|
+
export declare function SheetContent({ side, showClose, className, style, children, onOpenAutoFocus, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
|
|
12
|
+
side?: keyof typeof SIDES;
|
|
13
|
+
showClose?: boolean;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function SheetHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
16
|
+
export declare function SheetTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react").JSX.Element;
|
|
17
|
+
export declare function SheetDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react").JSX.Element;
|
|
18
|
+
export declare function SheetBody({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
19
|
+
export declare function SheetFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAW3D,eAAO,MAAM,KAAK,iDAAuB,CAAC;AAC1C,eAAO,MAAM,YAAY,kIAA0B,CAAC;AACpD,eAAO,MAAM,UAAU,gIAAwB,CAAC;AAEhD,QAAA,MAAM,KAAK;;;;CAID,CAAC;AAEX,wBAAgB,YAAY,CAAC,EACzB,IAAc,EACd,SAAgB,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,eAAe,EACf,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,+BAoCrG;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAEzE;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,+BAE/F;AAED,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,+BAE3G;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAEvE;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAEzE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { finePointer } from "../../lib/pointer.js";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { DialogOverlay } from "./dialog.js";
|
|
8
|
+
/* A panel that slides in from an edge over the page: details beside a list,
|
|
9
|
+
filters, settings for one thing. A dialog underneath (focus held inside, Escape
|
|
10
|
+
and a press outside close it, focus goes back to what opened it), over the
|
|
11
|
+
scrim. From the right by default, or the left; `bottom` for a tray. On a phone
|
|
12
|
+
a side sheet takes the whole width. Its parts are Dialog's: SheetTitle names it. */
|
|
13
|
+
export const Sheet = DialogPrimitive.Root;
|
|
14
|
+
export const SheetTrigger = DialogPrimitive.Trigger;
|
|
15
|
+
export const SheetClose = DialogPrimitive.Close;
|
|
16
|
+
const SIDES = {
|
|
17
|
+
right: "inset-y-0 right-0 w-[min(28rem,100vw)] max-sm:w-full rounded-l-overlay max-sm:rounded-none",
|
|
18
|
+
left: "inset-y-0 left-0 w-[min(28rem,100vw)] max-sm:w-full rounded-r-overlay max-sm:rounded-none",
|
|
19
|
+
bottom: "inset-x-0 bottom-0 max-h-[85dvh] rounded-t-overlay pb-[env(safe-area-inset-bottom)]",
|
|
20
|
+
};
|
|
21
|
+
export function SheetContent({ side = "right", showClose = true, className, style, children, onOpenAutoFocus, ...props }) {
|
|
22
|
+
return (_jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content
|
|
23
|
+
// As a Dialog: on a touch screen the sheet itself takes focus, so the
|
|
24
|
+
// keyboard does not come up over a panel nobody has looked at yet.
|
|
25
|
+
, {
|
|
26
|
+
// As a Dialog: on a touch screen the sheet itself takes focus, so the
|
|
27
|
+
// keyboard does not come up over a panel nobody has looked at yet.
|
|
28
|
+
onOpenAutoFocus: (event) => {
|
|
29
|
+
onOpenAutoFocus?.(event);
|
|
30
|
+
if (event.defaultPrevented || finePointer())
|
|
31
|
+
return;
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event.currentTarget.focus({ preventScroll: true });
|
|
34
|
+
}, style: { "--drawer-from": side === "left" ? "-100%" : "100%", ...style }, className: cn("z-(--z-overlay) fixed flex flex-col bg-surface-overlay shadow-dialog overflow-y-auto overscroll-contain outline-none", SIDES[side], side === "bottom"
|
|
35
|
+
? "data-[state=open]:animate-sheet-in data-[state=closed]:animate-sheet-out"
|
|
36
|
+
: "data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out", className), ...props, children: [children, showClose && (_jsx(DialogPrimitive.Close, { "aria-label": "Close", className: "top-3 right-3 absolute inline-flex justify-center items-center hover:bg-tint-hover rounded-control size-7 text-ink-tertiary hover:text-ink transition-colors duration-(--duration-fast)", children: _jsx(X, { className: "size-4" }) }))] })] }));
|
|
37
|
+
}
|
|
38
|
+
export function SheetHeader({ className, ...props }) {
|
|
39
|
+
return _jsx("div", { className: cn("px-5 pt-5 pr-12", className), ...props });
|
|
40
|
+
}
|
|
41
|
+
export function SheetTitle({ className, ...props }) {
|
|
42
|
+
return _jsx(DialogPrimitive.Title, { className: cn("font-semibold text-h3 text-ink", className), ...props });
|
|
43
|
+
}
|
|
44
|
+
export function SheetDescription({ className, ...props }) {
|
|
45
|
+
return _jsx(DialogPrimitive.Description, { className: cn("mt-1.5 text-ink-secondary text-sm", className), ...props });
|
|
46
|
+
}
|
|
47
|
+
export function SheetBody({ className, ...props }) {
|
|
48
|
+
return _jsx("div", { className: cn("flex-1 px-5 py-4", className), ...props });
|
|
49
|
+
}
|
|
50
|
+
export function SheetFooter({ className, ...props }) {
|
|
51
|
+
return _jsx("div", { className: cn("flex flex-wrap justify-end items-center gap-2 px-5 py-3.5 border-hairline border-t", className), ...props });
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAc,CAAC;AAE7C;;;;sFAIsF;AAEtF,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC;AAEhD,MAAM,KAAK,GAAG;IACV,KAAK,EAAE,4FAA4F;IACnG,IAAI,EAAE,2FAA2F;IACjG,MAAM,EAAE,qFAAqF;CACvF,CAAC;AAEX,MAAM,UAAU,YAAY,CAAC,EACzB,IAAI,GAAG,OAAO,EACd,SAAS,GAAG,IAAI,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,eAAe,EACf,GAAG,KAAK,EAC0F;IAClG,OAAO,CACH,MAAC,eAAe,CAAC,MAAM,eACnB,KAAC,aAAa,K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