@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,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Children, isValidElement } from "react";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { Spinner } from "./spinner.js";
|
|
8
|
+
/* Buttons are small (28–40px), lightly weighted and 4px-rounded. The loudest thing a
|
|
9
|
+
Notion button ever does is fill with the accent, and only one button per view
|
|
10
|
+
earns that. Everything else is a tint.
|
|
11
|
+
|
|
12
|
+
Every variant has its rest, hover, pressed, focus (the kit's ring) and disabled
|
|
13
|
+
look; a filled one's white text passes WCAG AA on every colour theme because it
|
|
14
|
+
sits on the deeper `-solid` fill. A link styled as a button is disabled with
|
|
15
|
+
aria-disabled, which looks and behaves the same. */
|
|
16
|
+
const buttonVariants = cva([
|
|
17
|
+
"inline-flex items-center justify-center gap-1.5 shrink-0 min-w-0 max-w-full relative",
|
|
18
|
+
"rounded-control font-medium whitespace-nowrap select-none",
|
|
19
|
+
"transition-[background-color,box-shadow,color] duration-(--duration-fast) ease-out-notion",
|
|
20
|
+
// Written out in full, so Tailwind finds them.
|
|
21
|
+
"disabled:pointer-events-none disabled:text-ink-disabled aria-disabled:pointer-events-none aria-disabled:text-ink-disabled",
|
|
22
|
+
"[&_svg]:shrink-0 [&_svg]:pointer-events-none",
|
|
23
|
+
], {
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
/** The one loud option. At most one per view. */
|
|
27
|
+
primary: [
|
|
28
|
+
"bg-accent-solid text-accent-ink hover:bg-accent-solid-hover active:bg-accent-solid-active",
|
|
29
|
+
"disabled:bg-tint-active aria-disabled:bg-tint-active",
|
|
30
|
+
],
|
|
31
|
+
/** The workhorse: the page's surface, a hairline ring, a whisper of lift. */
|
|
32
|
+
secondary: "bg-surface text-ink shadow-xs hover:bg-tint-hover active:bg-tint-active",
|
|
33
|
+
/** Invisible until hovered: toolbars, a row's actions. */
|
|
34
|
+
ghost: "text-ink hover:bg-tint-hover active:bg-tint-active",
|
|
35
|
+
/** Already tinted, for a second action that needs weight. */
|
|
36
|
+
subtle: "bg-tint-hover text-ink hover:bg-tint-active active:bg-tint-active active:shadow-edge",
|
|
37
|
+
/** Cannot be undone. Filled, like primary, so it is never the quiet choice. */
|
|
38
|
+
danger: [
|
|
39
|
+
"bg-danger-solid text-danger-ink hover:bg-danger-solid-hover active:bg-danger-solid-active",
|
|
40
|
+
"disabled:bg-tint-active aria-disabled:bg-tint-active",
|
|
41
|
+
],
|
|
42
|
+
/** Cannot be undone, in a menu or a row where a fill would shout. */
|
|
43
|
+
"danger-ghost": "text-danger hover:bg-danger-tint active:bg-danger-tint active:shadow-edge",
|
|
44
|
+
/** Over a picture: round, dark and blurred, so it reads against a bright sky as well as a dark one. */
|
|
45
|
+
"on-media": "rounded-full bg-on-media text-on-media-ink backdrop-blur-sm hover:bg-on-media-strong active:scale-90 transition-[opacity,scale,background-color]",
|
|
46
|
+
/** Words in a sentence that act. */
|
|
47
|
+
link: "link text-ink px-0! h-auto!",
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
/* A leading icon carries its own empty margin, so the left of the
|
|
51
|
+
button reads as roomier than the right. A little more on the right
|
|
52
|
+
evens the two out. */
|
|
53
|
+
sm: "h-control-sm px-2 text-sm [&_svg]:size-3.5 has-[>svg:first-child]:pr-2.5",
|
|
54
|
+
md: "h-control-md px-3 text-sm [&_svg]:size-4 has-[>svg:first-child]:pr-3.5",
|
|
55
|
+
lg: "h-control-lg px-4 text-body [&_svg]:size-4 has-[>svg:first-child]:pr-5",
|
|
56
|
+
/** Icon only, at each control height. Name it with aria-label. */
|
|
57
|
+
"icon-sm": "size-control-sm [&_svg]:size-3.5",
|
|
58
|
+
icon: "size-control-md [&_svg]:size-4",
|
|
59
|
+
"icon-lg": "size-control-lg [&_svg]:size-5",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
defaultVariants: { variant: "secondary", size: "md" },
|
|
63
|
+
});
|
|
64
|
+
/* The colour a spinner takes in place of the label, per variant. */
|
|
65
|
+
const SPINNER_INK = {
|
|
66
|
+
primary: "text-accent-ink",
|
|
67
|
+
danger: "text-danger-ink",
|
|
68
|
+
"danger-ghost": "text-danger",
|
|
69
|
+
};
|
|
70
|
+
/* A label is wrapped so a long one can shorten with an ellipsis instead of pushing
|
|
71
|
+
out of its container; icons stay direct children for the padding rule above.
|
|
72
|
+
Neighbouring words ("Upload", 3, "photos") share one span: as separate flex
|
|
73
|
+
items the spaces between them would collapse. */
|
|
74
|
+
function labelled(children) {
|
|
75
|
+
const out = [];
|
|
76
|
+
let words = [];
|
|
77
|
+
const flush = () => {
|
|
78
|
+
if (words.length)
|
|
79
|
+
out.push(_jsx("span", { className: "min-w-0 truncate", children: words.join("") }, `label-${out.length}`));
|
|
80
|
+
words = [];
|
|
81
|
+
};
|
|
82
|
+
// toArray drops empty children and keys the rest, so the list needs no keys of its own.
|
|
83
|
+
for (const child of Children.toArray(children)) {
|
|
84
|
+
if (typeof child === "string" || typeof child === "number")
|
|
85
|
+
words.push(child);
|
|
86
|
+
else {
|
|
87
|
+
flush();
|
|
88
|
+
out.push(child);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
flush();
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
export function Button({ className, variant, size, asChild = false, loading = false, type, children, onClick, ...props }) {
|
|
95
|
+
const iconOnly = typeof size === "string" && size.startsWith("icon");
|
|
96
|
+
if (process.env.NODE_ENV !== "production" && iconOnly && !props["aria-label"] && !props["aria-labelledby"] && !props.title) {
|
|
97
|
+
console.warn("paper-ui: an icon-only Button needs an aria-label (or aria-labelledby, or title) so a screen reader can name it.");
|
|
98
|
+
}
|
|
99
|
+
const classes = cn(buttonVariants({ variant, size }), loading && "text-transparent! [&>svg]:invisible", className);
|
|
100
|
+
if (asChild) {
|
|
101
|
+
const child = Children.only(children);
|
|
102
|
+
return (_jsx(Slot, { className: classes, "aria-busy": loading || undefined, onClick: onClick, ...props, children: isValidElement(child) ? child : children }));
|
|
103
|
+
}
|
|
104
|
+
return (_jsxs("button", { type: type ?? "button", className: classes, "aria-busy": loading || undefined, "data-loading": loading || undefined,
|
|
105
|
+
// Not `disabled` while loading: that would drop focus from the button the
|
|
106
|
+
// person just pressed, and grey it. It ignores presses instead.
|
|
107
|
+
onClick: loading ? (e) => e.preventDefault() : onClick, ...props, children: [labelled(children), loading && (_jsx("span", { className: "absolute inset-0 flex justify-center items-center", children: _jsx(Spinner, { className: cn("size-4", SPINNER_INK[variant ?? "secondary"] ?? "text-ink") }) }))] }));
|
|
108
|
+
}
|
|
109
|
+
export { buttonVariants };
|
|
110
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuC,MAAM,OAAO,CAAC;AACtF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAExC;;;;;;;sDAOsD;AAEtD,MAAM,cAAc,GAAG,GAAG,CACtB;IACI,sFAAsF;IACtF,2DAA2D;IAC3D,2FAA2F;IAC3F,+CAA+C;IAC/C,2HAA2H;IAC3H,8CAA8C;CACjD,EACD;IACI,QAAQ,EAAE;QACN,OAAO,EAAE;YACL,iDAAiD;YACjD,OAAO,EAAE;gBACL,2FAA2F;gBAC3F,sDAAsD;aACzD;YACD,6EAA6E;YAC7E,SAAS,EAAE,yEAAyE;YACpF,0DAA0D;YAC1D,KAAK,EAAE,oDAAoD;YAC3D,6DAA6D;YAC7D,MAAM,EAAE,sFAAsF;YAC9F,+EAA+E;YAC/E,MAAM,EAAE;gBACJ,2FAA2F;gBAC3F,sDAAsD;aACzD;YACD,qEAAqE;YACrE,cAAc,EAAE,2EAA2E;YAC3F,uGAAuG;YACvG,UAAU,EAAE,kJAAkJ;YAC9J,oCAAoC;YACpC,IAAI,EAAE,6BAA6B;SACt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KAAK,aAER,QAAQ,CAAC,QAAQ,CAAC,EAClB,OAAO,IAAI,CACR,eAAM,SAAS,EAAC,mDAAmD,YAC/D,KAAC,OAAO,IAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,IAAI,WAAW,CAAC,IAAI,UAAU,CAAC,GAAI,GACpF,CACV,IACI,CACZ,CAAC;AACN,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { DayPicker } from "react-day-picker";
|
|
3
|
+
export declare function Calendar({ className, classNames, components, ...props }: ComponentProps<typeof DayPicker>): import("react").JSX.Element;
|
|
4
|
+
export declare function focusCalendarDay(event: Event): void;
|
|
5
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAS7D,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,+BAuCzG;AA6CD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAGnD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
import { DayPicker } from "react-day-picker";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
/* A month of days, on react-day-picker: it supplies the grid, the keyboard and the
|
|
8
|
+
screen-reader labels; everything visible is here. Days are 32px with a mouse and
|
|
9
|
+
40px on a touch screen (seven of them still fit a 320px phone). Its own stylesheet is not
|
|
10
|
+
imported, so every part it draws has a class below.
|
|
11
|
+
|
|
12
|
+
The week starts on Monday. Pass `weekStartsOn={0}` for Sunday. */
|
|
13
|
+
export function Calendar({ className, classNames, components, ...props }) {
|
|
14
|
+
return (_jsx(DayPicker, { showOutsideDays: true,
|
|
15
|
+
// Always six rows, so the panel does not change height from month to month.
|
|
16
|
+
fixedWeeks: true, weekStartsOn: 1, className: cn("relative w-fit p-3 select-none", className), classNames: {
|
|
17
|
+
months: "flex flex-col gap-4 sm:flex-row",
|
|
18
|
+
month: "flex flex-col gap-2",
|
|
19
|
+
month_caption: "flex h-7 items-center justify-center px-8",
|
|
20
|
+
caption_label: "text-sm font-medium text-ink",
|
|
21
|
+
// Laid over the caption row; the buttons take the clicks, the gap between them does not.
|
|
22
|
+
nav: "absolute inset-x-3 top-3 flex h-7 items-center justify-between pointer-events-none",
|
|
23
|
+
button_previous: NAV_BUTTON,
|
|
24
|
+
button_next: NAV_BUTTON,
|
|
25
|
+
month_grid: "border-collapse",
|
|
26
|
+
weekday: "size-8 [@media(pointer:coarse)]:size-10 p-0 text-caption font-normal text-ink-tertiary",
|
|
27
|
+
day: "size-8 [@media(pointer:coarse)]:size-10 p-0 text-center",
|
|
28
|
+
range_start: "rounded-l-control bg-accent-tint",
|
|
29
|
+
range_middle: "bg-accent-tint",
|
|
30
|
+
range_end: "rounded-r-control bg-accent-tint",
|
|
31
|
+
hidden: "invisible",
|
|
32
|
+
...classNames,
|
|
33
|
+
}, components: {
|
|
34
|
+
Chevron: ({ orientation, className: chevronClass }) => orientation === "left" ? (_jsx(ChevronLeft, { className: cn("size-4", chevronClass) })) : (_jsx(ChevronRight, { className: cn("size-4", chevronClass) })),
|
|
35
|
+
DayButton: CalendarDayButton,
|
|
36
|
+
...components,
|
|
37
|
+
}, ...props }));
|
|
38
|
+
}
|
|
39
|
+
const NAV_BUTTON = "pointer-events-auto inline-flex size-7 [@media(pointer:coarse)]:size-10 items-center justify-center rounded-control text-ink-secondary transition-colors duration-(--duration-fast) hover:bg-tint-hover hover:text-ink aria-disabled:pointer-events-none aria-disabled:text-ink-disabled";
|
|
40
|
+
/* The day itself. The states are resolved here, in order, rather than as classes on
|
|
41
|
+
the cell, because several hold at once (today, outside the month, chosen) and the
|
|
42
|
+
last one named has to win whatever order the stylesheet was built in. */
|
|
43
|
+
function CalendarDayButton({ className, day: _day, modifiers, ...props }) {
|
|
44
|
+
const ref = useRef(null);
|
|
45
|
+
// The library moves focus by flag, not by calling focus, so arrow keys need this.
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (modifiers.focused)
|
|
48
|
+
ref.current?.focus();
|
|
49
|
+
}, [modifiers.focused]);
|
|
50
|
+
const inRange = modifiers.range_middle === true;
|
|
51
|
+
const chosen = modifiers.selected === true && !inRange;
|
|
52
|
+
return (_jsx("button", { ref: ref, type: "button", className: cn("inline-flex size-8 [@media(pointer:coarse)]:size-10 items-center justify-center rounded-control text-sm text-ink tabular-nums cursor-pointer", "transition-colors duration-(--duration-instant) hover:bg-tint-hover", modifiers.outside && "text-ink-tertiary", modifiers.today && "font-semibold shadow-[inset_0_0_0_1px_var(--hairline-strong)]", inRange && "rounded-none hover:bg-accent-tint", chosen && "bg-accent-solid font-medium text-accent-ink shadow-none hover:bg-accent-solid-hover", modifiers.disabled && "pointer-events-none text-ink-disabled shadow-none", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
/* For `onOpenAutoFocus` on a popover that holds a calendar: puts focus on the day
|
|
55
|
+
the arrow keys start from (the chosen one, or today) rather than on the first
|
|
56
|
+
thing in the panel, which is the previous-month arrow.
|
|
57
|
+
|
|
58
|
+
It has to happen here and not through the calendar's own `autoFocus`. Inside a
|
|
59
|
+
dialog that fires before the popover has taken over the dialog's focus trap, and
|
|
60
|
+
the dialog pulls focus straight back. */
|
|
61
|
+
export function focusCalendarDay(event) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
event.currentTarget?.querySelector('td button[tabindex="0"]')?.focus();
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/components/ui/calendar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAuB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;oEAKoE;AACpE,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,EAAoC;IACtG,OAAO,CACH,KAAC,SAAS,IACN,eAAe;QACf,4EAA4E;QAC5E,UAAU,QACV,YAAY,EAAE,CAAC,EACf,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,EAC1D,UAAU,EAAE;YACR,MAAM,EAAE,iCAAiC;YACzC,KAAK,EAAE,qBAAqB;YAC5B,aAAa,EAAE,2CAA2C;YAC1D,aAAa,EAAE,8BAA8B;YAC7C,yFAAyF;YACzF,GAAG,EAAE,oFAAoF;YACzF,eAAe,EAAE,UAAU;YAC3B,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,iBAAiB;YAC7B,OAAO,EAAE,wFAAwF;YACjG,GAAG,EAAE,yDAAyD;YAC9D,WAAW,EAAE,kCAAkC;YAC/C,YAAY,EAAE,gBAAgB;YAC9B,SAAS,EAAE,kCAAkC;YAC7C,MAAM,EAAE,WAAW;YACnB,GAAG,UAAU;SAChB,EACD,UAAU,EAAE;YACR,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,EAA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;;2CAM2C;AAC3C,MAAM,UAAU,gBAAgB,CAAC,KAAY;IACzC,KAAK,CAAC,cAAc,EAAE,CAAC;IACtB,KAAK,CAAC,aAAoC,EAAE,aAAa,CAAc,yBAAyB,CAAC,EAAE,KAAK,EAAE,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
declare const calloutVariants: (props?: ({
|
|
4
|
+
color?: "blue" | "brown" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare const TONES: {
|
|
7
|
+
readonly success: {
|
|
8
|
+
readonly color: "green";
|
|
9
|
+
readonly icon: import("react").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
readonly warning: {
|
|
12
|
+
readonly color: "yellow";
|
|
13
|
+
readonly icon: import("react").JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
readonly info: {
|
|
16
|
+
readonly color: "blue";
|
|
17
|
+
readonly icon: import("react").JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
readonly danger: {
|
|
20
|
+
readonly color: "red";
|
|
21
|
+
readonly icon: import("react").JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export interface CalloutProps extends Omit<ComponentProps<"div">, "color" | "title">, VariantProps<typeof calloutVariants> {
|
|
25
|
+
/** An emoji or an icon. */
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
title?: ReactNode;
|
|
28
|
+
tone?: keyof typeof TONES;
|
|
29
|
+
}
|
|
30
|
+
export declare function Callout({ className, color, tone, icon, title, children, ...props }: CalloutProps): import("react").JSX.Element;
|
|
31
|
+
export { calloutVariants };
|
|
32
|
+
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/callout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvD,QAAA,MAAM,eAAe;;8EAenB,CAAC;AAEH,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKD,CAAC;AAEX,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC;IACtH,2BAA2B;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;CAC7B;AAED,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAahG;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { CircleAlert, CircleCheck, Info, TriangleAlert } from "lucide-react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Notion's callout block: a tinted panel with an emoji or icon in the gutter. It
|
|
6
|
+
borrows one of the nine, so a callout never brings a new colour to the page. The
|
|
7
|
+
words are in the page's own ink (on a tinted ground the secondary ink read at
|
|
8
|
+
3.9:1); the icon is decoration and is hidden from assistive technology.
|
|
9
|
+
|
|
10
|
+
`tone` is the short way to a status: success, warning, info or danger, each its
|
|
11
|
+
colour and an icon. `color` and `icon` choose freely. A callout is a note
|
|
12
|
+
(role="note"); for something that must be heard at once, a Toast. */
|
|
13
|
+
const calloutVariants = cva("flex gap-3 p-4 rounded-surface text-ink text-sm leading-prose", {
|
|
14
|
+
variants: {
|
|
15
|
+
color: {
|
|
16
|
+
gray: "bg-tag-gray-bg",
|
|
17
|
+
brown: "bg-tag-brown-bg",
|
|
18
|
+
orange: "bg-tag-orange-bg",
|
|
19
|
+
yellow: "bg-tag-yellow-bg",
|
|
20
|
+
green: "bg-tag-green-bg",
|
|
21
|
+
blue: "bg-tag-blue-bg",
|
|
22
|
+
purple: "bg-tag-purple-bg",
|
|
23
|
+
pink: "bg-tag-pink-bg",
|
|
24
|
+
red: "bg-tag-red-bg",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { color: "gray" },
|
|
28
|
+
});
|
|
29
|
+
const TONES = {
|
|
30
|
+
success: { color: "green", icon: _jsx(CircleCheck, { className: "text-success" }) },
|
|
31
|
+
warning: { color: "yellow", icon: _jsx(TriangleAlert, { className: "text-warning" }) },
|
|
32
|
+
info: { color: "blue", icon: _jsx(Info, { className: "text-info" }) },
|
|
33
|
+
danger: { color: "red", icon: _jsx(CircleAlert, { className: "text-danger" }) },
|
|
34
|
+
};
|
|
35
|
+
export function Callout({ className, color, tone, icon, title, children, ...props }) {
|
|
36
|
+
const t = tone ? TONES[tone] : undefined;
|
|
37
|
+
return (_jsxs("div", { role: "note", className: cn(calloutVariants({ color: color ?? t?.color }), className), ...props, children: [_jsx("span", { "aria-hidden": true, className: "flex-shrink-0 mt-px text-body leading-snug [&_svg]:size-4 [&_svg]:mt-0.5", children: icon ?? t?.icon ?? "💡" }), _jsxs("div", { className: "min-w-0", children: [title && _jsx("p", { className: "mb-1 font-semibold", children: title }), _jsx("div", { className: "[&_p+p]:mt-2", children: children })] })] }));
|
|
38
|
+
}
|
|
39
|
+
export { calloutVariants };
|
|
40
|
+
//# sourceMappingURL=callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.js","sourceRoot":"","s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GAAG,KAAK,EAAgB;IAC7F,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,OAAO,CACH,eAAK,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,aAC/F,oCAAkB,SAAS,EAAC,0EAA0E,YACjG,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,IAAI,GACrB,EACP,eAAK,SAAS,EAAC,SAAS,aACnB,KAAK,IAAI,YAAG,SAAS,EAAC,oBAAoB,YAAE,KAAK,GAAK,EACvD,cAAK,SAAS,EAAC,cAAc,YAAE,QAAQ,GAAO,IAC5C,IACJ,CACT,CAAC;AACN,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentProps, ElementType } from "react";
|
|
2
|
+
export interface CardProps extends ComponentProps<"div"> {
|
|
3
|
+
interactive?: boolean;
|
|
4
|
+
/** Sit flush on a sunken surface with no lift of its own. */
|
|
5
|
+
flat?: boolean;
|
|
6
|
+
/** Render as the single child (a link, a button) instead of a div. */
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function Card({ className, interactive, flat, asChild, ...props }: CardProps): import("react").JSX.Element;
|
|
10
|
+
export declare function CardHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
11
|
+
/** The card's name. An h3 unless `as` says otherwise, to fit the page's outline. */
|
|
12
|
+
export declare function CardTitle({ className, as: Tag, ...props }: ComponentProps<"h3"> & {
|
|
13
|
+
as?: ElementType;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function CardDescription({ className, ...props }: ComponentProps<"p">): import("react").JSX.Element;
|
|
16
|
+
export declare function CardContent({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
17
|
+
export declare function CardFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAWzD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,KAAK,CAAC;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,OAAe,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAiB1F;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAExE;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,GAAU,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,WAAW,CAAA;CAAE,+BAE7G;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,GAAG,CAAC,+BAE3E;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,KAAK,CAAC,+BAExE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
export function Card({ className, interactive, flat, asChild = false, ...props }) {
|
|
5
|
+
const Comp = asChild ? Slot : "div";
|
|
6
|
+
return (_jsx(Comp, { className: cn("block bg-surface-raised rounded-surface overflow-hidden text-left", flat ? "border border-hairline" : "shadow-sm", interactive && [
|
|
7
|
+
"transition-[box-shadow,transform] duration-(--duration-base) ease-out-notion outline-offset-2",
|
|
8
|
+
"hover:shadow-md hover:-translate-y-px cursor-pointer",
|
|
9
|
+
"active:translate-y-0 active:shadow-sm",
|
|
10
|
+
], className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
export function CardHeader({ className, ...props }) {
|
|
13
|
+
return _jsx("div", { className: cn("px-4 pt-4 pb-0", className), ...props });
|
|
14
|
+
}
|
|
15
|
+
/** The card's name. An h3 unless `as` says otherwise, to fit the page's outline. */
|
|
16
|
+
export function CardTitle({ className, as: Tag = "h3", ...props }) {
|
|
17
|
+
return _jsx(Tag, { className: cn("my-0 font-semibold text-h3 text-ink", className), ...props });
|
|
18
|
+
}
|
|
19
|
+
export function CardDescription({ className, ...props }) {
|
|
20
|
+
return _jsx("p", { className: cn("mt-1 text-ink-secondary text-sm", className), ...props });
|
|
21
|
+
}
|
|
22
|
+
export function CardContent({ className, ...props }) {
|
|
23
|
+
return _jsx("div", { className: cn("p-4", className), ...props });
|
|
24
|
+
}
|
|
25
|
+
export function CardFooter({ className, ...props }) {
|
|
26
|
+
return _jsx("div", { className: cn("flex flex-wrap items-center gap-2 px-4 py-3 border-hairline border-t", className), ...props });
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAA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SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IACrE,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,sEAAsE,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAChI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
export declare const checkboxBox: string[];
|
|
4
|
+
export declare function Checkbox({ checked, onCheckedChange, label, description, className, ...props }: Omit<ComponentProps<typeof CheckboxPrimitive.Root>, "onCheckedChange" | "checked"> & {
|
|
5
|
+
checked?: boolean | "indeterminate";
|
|
6
|
+
/** Ticked or not. A partly ticked box becomes ticked when pressed. */
|
|
7
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvD,eAAO,MAAM,WAAW,UAYvB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACrB,OAAO,EACP,eAAe,EACf,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IACpF,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACpC,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;CAC3B,+BAuBA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
+
import { Check, Minus } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { ChoiceLabel } from "./choice-label.js";
|
|
7
|
+
import { fromField, useField } from "./input.js";
|
|
8
|
+
/* Notion's to-do box: a 16px square whose empty edge reads at 3:1 (--control-edge)
|
|
9
|
+
and that fills with the accent when ticked. Its pressable area is 24px. It can be
|
|
10
|
+
partly ticked ("indeterminate"), for a row that stands for several. With `name`
|
|
11
|
+
it sends its value with a form; inside a Field it takes the Field's label and
|
|
12
|
+
error. With `label` (and `description`) it draws its own words, pressable too. */
|
|
13
|
+
export const checkboxBox = [
|
|
14
|
+
"peer relative flex justify-center items-center rounded-small size-4 shrink-0 outline-offset-2",
|
|
15
|
+
"shadow-[inset_0_0_0_1.5px_var(--control-edge)] transition-[background-color,box-shadow] duration-(--duration-fast)",
|
|
16
|
+
"hover:bg-tint-hover",
|
|
17
|
+
"data-[state=checked]:bg-accent-solid data-[state=checked]:text-accent-ink data-[state=checked]:shadow-none data-[state=checked]:hover:bg-accent-solid-hover",
|
|
18
|
+
"data-[state=indeterminate]:bg-accent-solid data-[state=indeterminate]:text-accent-ink data-[state=indeterminate]:shadow-none",
|
|
19
|
+
"aria-invalid:shadow-[inset_0_0_0_1.5px_var(--danger)]",
|
|
20
|
+
"disabled:cursor-not-allowed disabled:bg-tint-hover disabled:shadow-[inset_0_0_0_1.5px_var(--hairline-strong)] disabled:text-ink-disabled",
|
|
21
|
+
// Ticked but disabled: grey, so it never looks like a choice that can be changed.
|
|
22
|
+
"disabled:data-[state=checked]:bg-tint-active disabled:data-[state=checked]:text-ink-disabled disabled:data-[state=indeterminate]:bg-tint-active disabled:data-[state=indeterminate]:text-ink-disabled",
|
|
23
|
+
// 24px to press, around the 16px box.
|
|
24
|
+
"after:absolute after:-inset-1 after:content-['']",
|
|
25
|
+
];
|
|
26
|
+
export function Checkbox({ checked, onCheckedChange, label, description, className, ...props }) {
|
|
27
|
+
const own = fromField(useField(), props);
|
|
28
|
+
return (_jsx(ChoiceLabel, { label: label, description: description, disabled: own.disabled, control: ({ labelId, descriptionId }) => (_jsx(CheckboxPrimitive.Root, { checked: checked, onCheckedChange: (next) => onCheckedChange?.(next === true), "aria-labelledby": own["aria-labelledby"] ?? labelId, ...own, "aria-describedby": [own["aria-describedby"], descriptionId].filter(Boolean).join(" ") || undefined, className: cn(checkboxBox, className), children: _jsx(CheckboxPrimitive.Indicator, { className: "flex", children: checked === "indeterminate" ? _jsx(Minus, { className: "size-3", strokeWidth: 3 }) : _jsx(Check, { className: "size-3", strokeWidth: 3 }) }) })) }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAa,CAAC;AAElD;;;;oFAIoF;AAEpF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,+FAA+F;IAC/F,oHAAoH;IACpH,qBAAqB;IACrB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from "react";
|
|
2
|
+
export declare function ChoiceLabel({ control, label, description, disabled, end, className, }: {
|
|
3
|
+
control: (ids: {
|
|
4
|
+
labelId?: string;
|
|
5
|
+
descriptionId?: string;
|
|
6
|
+
}) => ReactNode;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
end?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=choice-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choice-label.d.ts","sourceRoot":"","sources":["../../../src/components/ui/choice-label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM9C,wBAAgB,WAAW,CAAC,EACxB,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,GAAW,EACX,SAAS,GACZ,EAAE;IACC,OAAO,EAAE,CAAC,GAAG,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAsBA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* The words beside a checkbox, switch or radio: a label that is part of the
|
|
5
|
+
control (pressing it presses the control) and an optional line under it. The
|
|
6
|
+
control comes first for a checkbox or radio, last for a switch. */
|
|
7
|
+
export function ChoiceLabel({ control, label, description, disabled, end = false, className, }) {
|
|
8
|
+
const id = useId();
|
|
9
|
+
if (label === undefined)
|
|
10
|
+
return _jsx(_Fragment, { children: control({}) });
|
|
11
|
+
const labelId = `${id}-label`;
|
|
12
|
+
const descriptionId = description !== undefined ? `${id}-description` : undefined;
|
|
13
|
+
return (
|
|
14
|
+
// A <label> around both: a press anywhere on the words presses the control.
|
|
15
|
+
_jsxs("label", { className: cn("group/choice flex items-start gap-2.5 text-sm cursor-pointer", disabled && "cursor-not-allowed", end && "flex-row-reverse justify-between", className), children: [_jsx("span", { className: "flex items-center h-[1.3125rem] shrink-0", children: control({ labelId, descriptionId }) }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { id: labelId, className: cn("block text-ink", disabled && "text-ink-disabled"), children: label }), description !== undefined && (_jsx("span", { id: descriptionId, className: cn("block mt-0.5 text-caption text-ink-tertiary", disabled && "text-ink-disabled"), children: description }))] })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=choice-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choice-label.js","sourceRoot":"","sources":["../../../src/components/ui/choice-label.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;qEAEqE;AACrE,MAAM,UAAU,WAAW,CAAC,EACxB,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,GAAG,GAAG,KAAK,EACX,SAAS,GAQZ;IACG,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,4BAAG,OAAO,CAAC,EAAE,CAAC,GAAI,CAAC;IACnD,MAAM,OAAO,GAAG,GAAG,EAAE,QAAQ,CAAC;IAC9B,MAAM,aAAa,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,OAAO;IACH,4EAA4E;IAC5E,iBAAO,SAAS,EAAE,EAAE,CAAC,8DAA8D,EAAE,QAAQ,IAAI,oBAAoB,EAAE,GAAG,IAAI,kCAAkC,EAAE,SAAS,CAAC,aAExK,eAAM,SAAS,EAAC,0CAA0C,YAAE,OAAO,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,GAAQ,EACvG,gBAAM,SAAS,EAAC,SAAS,aACrB,eAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,QAAQ,IAAI,mBAAmB,CAAC,YAC9E,KAAK,GACH,EACN,WAAW,KAAK,SAAS,IAAI,CAC1B,eAAM,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAAC,6CAA6C,EAAE,QAAQ,IAAI,mBAAmB,CAAC,YACjH,WAAW,GACT,CACV,IACE,IACH,CACX,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
export declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare function CollapsibleTrigger({ className, children, ...props }: ComponentProps<typeof CollapsiblePrimitive.Trigger>): import("react").JSX.Element;
|
|
5
|
+
export declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof CollapsiblePrimitive.Content>): import("react").JSX.Element;
|
|
6
|
+
/** A titled toggle in one: closed unless `defaultOpen` (or controlled with `open`). */
|
|
7
|
+
export declare function Disclosure({ title, children, className, ...props }: Omit<ComponentProps<typeof CollapsiblePrimitive.Root>, "title"> & {
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvD,eAAO,MAAM,WAAW,kIAA4B,CAAC;AAErD,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,+BAiBxH;AAED,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,+BAO9G;AAED,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,+BASxF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
4
|
+
import { ChevronRight } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
/* Something folded away: Notion's toggle. A trigger with a chevron that turns, and
|
|
7
|
+
the content easing open to its own height. The trigger says whether it is open
|
|
8
|
+
(aria-expanded) and what it opens. The parts are Radix's; `Disclosure` is the
|
|
9
|
+
whole thing in one. */
|
|
10
|
+
export const Collapsible = CollapsiblePrimitive.Root;
|
|
11
|
+
export function CollapsibleTrigger({ className, children, ...props }) {
|
|
12
|
+
return (_jsxs(CollapsiblePrimitive.Trigger, { className: cn("group/trigger flex items-center gap-1 -ml-1 px-1 rounded-control min-h-control-sm font-medium text-ink text-sm text-left", "hover:bg-tint-hover transition-colors duration-(--duration-instant)", className), ...props, children: [_jsx(ChevronRight, { "aria-hidden": true, className: "size-4 text-ink-tertiary group-data-[state=open]/trigger:rotate-90 transition-transform duration-(--duration-fast) shrink-0" }), children] }));
|
|
13
|
+
}
|
|
14
|
+
export function CollapsibleContent({ className, ...props }) {
|
|
15
|
+
return (_jsx(CollapsiblePrimitive.Content, { className: cn("overflow-hidden data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
/** A titled toggle in one: closed unless `defaultOpen` (or controlled with `open`). */
|
|
18
|
+
export function Disclosure({ title, children, className, ...props }) {
|
|
19
|
+
return (_jsxs(Collapsible, { className: className, ...props, children: [_jsx(CollapsibleTrigger, { children: title }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "pt-1 pb-2 pl-5 text-ink-secondary text-sm", children: children }) })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;yBAGyB;AAEzB,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC;AAErD,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuD;IACrH,OAAO,CACH,MAAC,oBAAoB,CAAC,OAAO,IACzB,SAAS,EAAE,EAAE,CACT,0HAA0H,EAC1H,qEAAqE,EACrE,SAAS,CACZ,KACG,KAAK,aAET,KAAC,YAAY,yBAET,SAAS,EAAC,6HAA6H,GACzI,EACD,QAAQ,IACkB,CAClC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAuD;IAC3G,OAAO,CACH,KAAC,oBAAoB,CAAC,OAAO,IACzB,SAAS,EAAE,EAAE,CAAC,iGAAiG,EAAE,SAAS,CAAC,KACvH,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,UAAU,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EAC6E;IACrF,OAAO,CACH,MAAC,WAAW,IAAC,SAAS,EAAE,SAAS,KAAM,KAAK,aACxC,KAAC,kBAAkB,cAAE,KAAK,GAAsB,EAChD,KAAC,kBAAkB,cACf,cAAK,SAAS,EAAC,2CAA2C,YAAE,QAAQ,GAAO,GAC1D,IACX,CACjB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function CollectionLayout({ title, lead, actions, toolbar, stickyTop, width, children, className, }: {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
lead?: ReactNode;
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
toolbar?: ReactNode;
|
|
7
|
+
/** Where the toolbar sticks: `top-11` under a HeaderBar, `top-14` under a TopBarShell. */
|
|
8
|
+
stickyTop?: string;
|
|
9
|
+
width?: "reading" | "wide";
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export declare function CollectionToolbar({ search, filters, count, view, className, }: {
|
|
14
|
+
/** A SearchField. */
|
|
15
|
+
search?: ReactNode;
|
|
16
|
+
/** SelectMenus, Toggles, a Sort menu. */
|
|
17
|
+
filters?: ReactNode;
|
|
18
|
+
/** "128 photos". */
|
|
19
|
+
count?: ReactNode;
|
|
20
|
+
/** A Segmented of grid / list / table. */
|
|
21
|
+
view?: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=collection-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-layout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collection-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,wBAAgB,gBAAgB,CAAC,EAC7B,KAAK,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,SAAmB,EACnB,KAAc,EACd,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAQA;AAKD,wBAAgB,iBAAiB,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,SAAS,GACZ,EAAE;IACC,qBAAqB;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oBAAoB;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAaA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { Page, PageHeader } from "./page.js";
|
|
4
|
+
/* A page of many things to browse: a library, trips, items. The page's name and
|
|
5
|
+
its actions, then a toolbar (CollectionToolbar) that sticks under the top of the
|
|
6
|
+
page while the grid, list or table scrolls under it. Wide by default. */
|
|
7
|
+
export function CollectionLayout({ title, lead, actions, toolbar, stickyTop = "top-0", width = "wide", children, className, }) {
|
|
8
|
+
return (_jsxs(Page, { width: width, className: className, children: [_jsx(PageHeader, { title: title, lead: lead, actions: actions }), toolbar !== undefined && _jsx("div", { className: cn("z-(--z-sticky) sticky bg-surface -mx-2 mb-4 px-2 py-2", stickyTop), children: toolbar }), children] }));
|
|
9
|
+
}
|
|
10
|
+
/* What a collection is narrowed and shown by: a search, filters, a count, and the
|
|
11
|
+
view switch at the end. It wraps on a narrow screen: the search takes the row,
|
|
12
|
+
and the filters scroll sideways in theirs rather than wrapping line after line. */
|
|
13
|
+
export function CollectionToolbar({ search, filters, count, view, className, }) {
|
|
14
|
+
return (_jsxs("div", { role: "toolbar", "aria-label": "Collection", className: cn("flex flex-wrap items-center gap-2", className), children: [search !== undefined && _jsx("div", { className: "flex-1 max-w-xs min-w-[min(12rem,100%)] max-sm:max-w-none max-sm:basis-full", children: search }), filters !== undefined && (_jsx("div", { className: "flex items-center gap-1 max-sm:-mx-1 max-sm:px-1 max-sm:max-w-full overflow-x-auto [scrollbar-width:none]", children: filters })), _jsxs("div", { className: "flex items-center gap-3 ml-auto", children: [count !== undefined && _jsx("span", { className: "tabular-nums text-ink-tertiary text-sm whitespace-nowrap", children: count }), view] })] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=collection-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-layout.js","sourceRoot":"","sources":["../../../src/components/ui/collection-layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAY,CAAC;AAE9C;;2EAE2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,EAC7B,KAAK,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,SAAS,GAAG,OAAO,EACnB,KAAK,GAAG,MAAM,EACd,QAAQ,EACR,SAAS,GAWZ;IACG,OAAO,CACH,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,aACpC,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAI,EACzD,OAAO,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,EAAE,CAAC,uDAAuD,EAAE,SAAS,CAAC,YAAG,OAAO,GAAO,EAChI,QAAQ,IACN,CACV,CAAC;AACN,CAAC;AAED;;qFAEqF;AACrF,MAAM,UAAU,iBAAiB,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,SAAS,GAWZ;IACG,OAAO,CACH,eAAK,IAAI,EAAC,SAAS,gBAAY,YAAY,EAAC,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,SAAS,CAAC,aACpG,MAAM,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,6EAA6E,YAAE,MAAM,GAAO,EACnI,OAAO,KAAK,SAAS,IAAI,CACtB,cAAK,SAAS,EAAC,2GAA2G,YAAE,OAAO,GAAO,CAC7I,EACD,eAAK,SAAS,EAAC,iCAAiC,aAC3C,KAAK,KAAK,SAAS,IAAI,eAAM,SAAS,EAAC,0DAA0D,YAAE,KAAK,GAAQ,EAChH,IAAI,IACH,IACJ,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type InputProps } from "./input.js";
|
|
2
|
+
export declare function Combobox({ value, onChange, options, onEnter, limit, className, onFocus, onBlur, onKeyDown, ...props }: Omit<InputProps, "value" | "onChange"> & {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
options: readonly string[];
|
|
6
|
+
/** Enter with nothing highlighted: the field's own submit. */
|
|
7
|
+
onEnter?: () => void;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/combobox.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAiBrD,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,+BAkHA"}
|