@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":"address-field.js","sourceRoot":"","sources":["../../../src/components/ui/address-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;qCAEqC;AACrC,MAAM,UAAU,YAAY,CAAC,EACz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2
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
3
|
+
export declare const AlertDialog: import("react").FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
|
+
export declare const AlertDialogTrigger: import("react").ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare function AlertDialogContent({ className, children, ...props }: ComponentProps<typeof AlertDialogPrimitive.Content>): import("react").JSX.Element;
|
|
6
|
+
export declare function AlertDialogHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
7
|
+
export declare function AlertDialogTitle({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Title>): import("react").JSX.Element;
|
|
8
|
+
export declare function AlertDialogDescription({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Description>): import("react").JSX.Element;
|
|
9
|
+
export declare function AlertDialogFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
10
|
+
/** The safe answer. Takes focus when the question opens. */
|
|
11
|
+
export declare function AlertDialogCancel({ children, ...props }: ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react").JSX.Element;
|
|
12
|
+
/** The answer that goes ahead. `danger` when it cannot be undone. */
|
|
13
|
+
export declare function AlertDialogAction({ children, danger, ...props }: ComponentProps<typeof AlertDialogPrimitive.Action> & {
|
|
14
|
+
danger?: boolean;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export type ConfirmOptions = {
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
confirmLabel?: string;
|
|
20
|
+
cancelLabel?: string;
|
|
21
|
+
/** It cannot be undone: the confirm button is the danger fill. */
|
|
22
|
+
danger?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Asks a question and resolves true (confirmed) or false (cancelled, Escape). Needs a ConfirmProvider above. */
|
|
25
|
+
export declare function useConfirm(): (options: ConfirmOptions) => Promise<boolean>;
|
|
26
|
+
export declare function ConfirmProvider({ children }: {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAA4D,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAetH,eAAO,MAAM,WAAW,2DAA4B,CAAC;AACrD,eAAO,MAAM,kBAAkB,4IAA+B,CAAC;AAE/D,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,+BAYxH;AAED,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAE/E;AAED,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,+BAE1G;AAED,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,+BAEtH;AAED,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAE/E;AAED,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,EAAE,QAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,+BAMtH;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,EAAE,QAAoB,EAAE,MAAc,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,+BAM9J;AAID,MAAM,MAAM,cAAc,GAAG;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF,iHAAiH;AACjH,wBAAgB,UAAU,IAAI,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAI1E;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BA8CpE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { dialogPanelClasses, overlayClasses } from "./dialog.js";
|
|
8
|
+
/* A question that must be answered before anything else: "Delete these 3 pages?"
|
|
9
|
+
Unlike a Dialog it has no close button and a press outside does not dismiss it;
|
|
10
|
+
Escape answers no. Focus starts on Cancel, the safe answer. It looks like a
|
|
11
|
+
Dialog, a bottom sheet on a phone.
|
|
12
|
+
|
|
13
|
+
Most of the time, `useConfirm()` is all an app needs:
|
|
14
|
+
const confirm = useConfirm();
|
|
15
|
+
if (await confirm({ title: "Delete 3 pages?", confirmLabel: "Delete", danger: true })) …
|
|
16
|
+
with a ConfirmProvider somewhere above. */
|
|
17
|
+
export const AlertDialog = AlertDialogPrimitive.Root;
|
|
18
|
+
export const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
19
|
+
export function AlertDialogContent({ className, children, ...props }) {
|
|
20
|
+
return (_jsxs(AlertDialogPrimitive.Portal, { children: [_jsx(AlertDialogPrimitive.Overlay, { className: overlayClasses }), _jsx(AlertDialogPrimitive.Content, { className: cn(dialogPanelClasses, "max-w-md", className), ...props, children: children })] }));
|
|
21
|
+
}
|
|
22
|
+
export function AlertDialogHeader({ className, ...props }) {
|
|
23
|
+
return _jsx("div", { className: cn("px-5 pt-5", className), ...props });
|
|
24
|
+
}
|
|
25
|
+
export function AlertDialogTitle({ className, ...props }) {
|
|
26
|
+
return _jsx(AlertDialogPrimitive.Title, { className: cn("font-semibold text-h3 text-ink", className), ...props });
|
|
27
|
+
}
|
|
28
|
+
export function AlertDialogDescription({ className, ...props }) {
|
|
29
|
+
return _jsx(AlertDialogPrimitive.Description, { className: cn("mt-1.5 text-ink-secondary text-sm", className), ...props });
|
|
30
|
+
}
|
|
31
|
+
export function AlertDialogFooter({ className, ...props }) {
|
|
32
|
+
return _jsx("div", { className: cn("flex flex-wrap justify-end items-center gap-2 px-5 pt-5 pb-5", className), ...props });
|
|
33
|
+
}
|
|
34
|
+
/** The safe answer. Takes focus when the question opens. */
|
|
35
|
+
export function AlertDialogCancel({ children = "Cancel", ...props }) {
|
|
36
|
+
return (_jsx(AlertDialogPrimitive.Cancel, { asChild: true, ...props, children: _jsx(Button, { variant: "ghost", children: children }) }));
|
|
37
|
+
}
|
|
38
|
+
/** The answer that goes ahead. `danger` when it cannot be undone. */
|
|
39
|
+
export function AlertDialogAction({ children = "Confirm", danger = false, ...props }) {
|
|
40
|
+
return (_jsx(AlertDialogPrimitive.Action, { asChild: true, ...props, children: _jsx(Button, { variant: danger ? "danger" : "primary", children: children }) }));
|
|
41
|
+
}
|
|
42
|
+
const ConfirmContext = createContext(null);
|
|
43
|
+
/** Asks a question and resolves true (confirmed) or false (cancelled, Escape). Needs a ConfirmProvider above. */
|
|
44
|
+
export function useConfirm() {
|
|
45
|
+
const confirm = useContext(ConfirmContext);
|
|
46
|
+
if (confirm === null)
|
|
47
|
+
throw new Error("useConfirm must be used inside ConfirmProvider");
|
|
48
|
+
return confirm;
|
|
49
|
+
}
|
|
50
|
+
export function ConfirmProvider({ children }) {
|
|
51
|
+
const [asking, setAsking] = useState(null);
|
|
52
|
+
const [open, setOpen] = useState(false);
|
|
53
|
+
const answer = useRef(() => { });
|
|
54
|
+
const confirm = useCallback((options) => new Promise((resolve) => {
|
|
55
|
+
answer.current(false); // a question still open is answered no
|
|
56
|
+
answer.current = resolve;
|
|
57
|
+
setAsking(options);
|
|
58
|
+
setOpen(true);
|
|
59
|
+
}), []);
|
|
60
|
+
const settle = (yes) => {
|
|
61
|
+
answer.current(yes);
|
|
62
|
+
answer.current = () => { };
|
|
63
|
+
setOpen(false);
|
|
64
|
+
};
|
|
65
|
+
return (_jsxs(ConfirmContext.Provider, { value: confirm, children: [children, _jsx(AlertDialog, { open: open, onOpenChange: (o) => !o && settle(false), children: asking && (
|
|
66
|
+
// Focus goes to Cancel on every screen. (A dialog with a text field keeps
|
|
67
|
+
// it off on a touch screen so the keyboard stays down, but here there are
|
|
68
|
+
// only buttons, and leaving focus behind on the page would leave a screen
|
|
69
|
+
// reader outside the question, and Enter on the page asking it again.)
|
|
70
|
+
_jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: asking.title }), asking.description && _jsx(AlertDialogDescription, { children: asking.description })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { onClick: () => settle(false), children: asking.cancelLabel ?? "Cancel" }), _jsx(AlertDialogAction, { danger: asking.danger, onClick: () => settle(true), children: asking.confirmLabel ?? "Confirm" })] })] })) })] }));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","sourceRoot":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M,CAAC,WAAW,IAAI,KAAC,sBAAsB,cAAE,MAAM,CAAC,WAAW,GAA0B,IAC5E,EACpB,MAAC,iBAAiB,eACd,KAAC,iBAAiB,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,YAAG,MAAM,CAAC,WAAW,IAAI,QAAQ,GAAqB,EACrG,KAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAChE,MAAM,CAAC,YAAY,IAAI,SAAS,GACjB,IACJ,IACH,CACxB,GACS,IACQ,CAC7B,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-height.d.ts","sourceRoot":"","sources":["../../../src/components/ui/animated-height.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS1E,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAsBlG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Holds content whose height changes all at once (a filtered list, say) and eases
|
|
6
|
+
between the old height and the new one, so what is below it glides instead of
|
|
7
|
+
jumping. The content sizes itself; this only follows it. Still for anyone who
|
|
8
|
+
asks for less motion.
|
|
9
|
+
|
|
10
|
+
From endgame and medialogue, 2026-12-05. */
|
|
11
|
+
export function AnimatedHeight({ children, className }) {
|
|
12
|
+
const inner = useRef(null);
|
|
13
|
+
const [height, setHeight] = useState();
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
const el = inner.current;
|
|
16
|
+
if (!el)
|
|
17
|
+
return;
|
|
18
|
+
const measure = () => setHeight(el.offsetHeight);
|
|
19
|
+
measure();
|
|
20
|
+
const observer = new ResizeObserver(measure);
|
|
21
|
+
observer.observe(el);
|
|
22
|
+
return () => observer.disconnect();
|
|
23
|
+
}, []);
|
|
24
|
+
return (_jsx("div", { style: { height }, className: cn("overflow-hidden transition-[height] duration-(--duration-slow) ease-out-notion motion-reduce:transition-none", className), children: _jsx("div", { ref: inner, children: children }) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=animated-height.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-height.js","sourceRoot":"","sources":["../../../src/components/ui/animated-height.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;8CAK8C;AAC9C,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA+C;IAC/F,MAAM,KAAK,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAAU,CAAC;IAE/C,eAAe,CAAC,GAAG,EAAE;QACjB,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;QACzB,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QACjD,OAAO,EAAE,CAAC;QACV,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,cACI,KAAK,EAAE,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,EAAE,CAAC,8GAA8G,EAAE,SAAS,CAAC,YAExI,cAAK,GAAG,EAAE,KAAK,YAAG,QAAQ,GAAO,GAC/B,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Opens or closes the sidebar from anywhere, as the shortcut does. */
|
|
3
|
+
export declare const toggleSidebar: () => void;
|
|
4
|
+
export type ShellControls = {
|
|
5
|
+
sidebarOpen: boolean;
|
|
6
|
+
openSidebar: () => void;
|
|
7
|
+
closeSidebar: () => void;
|
|
8
|
+
};
|
|
9
|
+
/** @deprecated Use SidebarProvider, Sidebar and SidebarInset (docs/layouts/sidebar.md). AppShell goes at 1.0. */
|
|
10
|
+
export declare function AppShell({ sidebar, topbar, children, routeKey, }: {
|
|
11
|
+
sidebar: (controls: ShellControls) => ReactNode;
|
|
12
|
+
topbar: (controls: ShellControls) => ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
routeKey?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function SidebarFrame({ header, footer, children, label }: {
|
|
17
|
+
header?: ReactNode;
|
|
18
|
+
footer?: ReactNode;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
label: string;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export declare function SidebarSection({ title, children }: {
|
|
23
|
+
title: string;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=app-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/ui/app-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5D,uEAAuE;AACvE,eAAO,MAAM,aAAa,QAAO,IAA4D,CAAC;AAE9F,MAAM,MAAM,aAAa,GAAG;IAExB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAaF,iHAAiH;AACjH,wBAAgB,QAAQ,CAAC,EACrB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,GACX,EAAE;IACC,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC;IAChD,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,+BA4EA;AAKD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAQ/I;AAGD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAOzF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { matchShortcut } from "../../lib/keys.js";
|
|
6
|
+
const TOGGLE_SIDEBAR = "ui:toggle-sidebar";
|
|
7
|
+
/** Opens or closes the sidebar from anywhere, as the shortcut does. */
|
|
8
|
+
export const toggleSidebar = () => void window.dispatchEvent(new Event(TOGGLE_SIDEBAR));
|
|
9
|
+
/* The frame of a Notion-like app: a sidebar beside a top bar and a scrolling main
|
|
10
|
+
area. On a wide screen the sidebar is a column that collapses to nothing (⌘\ or
|
|
11
|
+
Ctrl-\ toggles it). Below the `md` breakpoint it is a drawer over a scrim, closed
|
|
12
|
+
until asked for.
|
|
13
|
+
|
|
14
|
+
`sidebar` and `topbar` are functions so they can render their own open and close
|
|
15
|
+
buttons. Pass something that changes on navigation as `routeKey` (the pathname)
|
|
16
|
+
and the drawer closes when a destination is chosen from it.
|
|
17
|
+
|
|
18
|
+
`main` is a container: size content to the room it actually has with container
|
|
19
|
+
variants (`@6xl:max-w-…`), which account for the sidebar being open or shut. */
|
|
20
|
+
/** @deprecated Use SidebarProvider, Sidebar and SidebarInset (docs/layouts/sidebar.md). AppShell goes at 1.0. */
|
|
21
|
+
export function AppShell({ sidebar, topbar, children, routeKey, }) {
|
|
22
|
+
const [open, setOpen] = useState(true);
|
|
23
|
+
const [drawer, setDrawer] = useState(false);
|
|
24
|
+
useEffect(() => setDrawer(false), [routeKey]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const onKey = (e) => {
|
|
27
|
+
if (matchShortcut(e, "mod+\\")) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
setOpen((o) => !o);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
// Anything outside the shell may ask for the sidebar: a full-window view
|
|
33
|
+
// with its own button for it. On a small screen that means the drawer.
|
|
34
|
+
const onToggle = () => {
|
|
35
|
+
if (window.matchMedia("(min-width: 768px)").matches)
|
|
36
|
+
setOpen((o) => !o);
|
|
37
|
+
else
|
|
38
|
+
setDrawer((d) => !d);
|
|
39
|
+
};
|
|
40
|
+
window.addEventListener("keydown", onKey);
|
|
41
|
+
window.addEventListener(TOGGLE_SIDEBAR, onToggle);
|
|
42
|
+
return () => {
|
|
43
|
+
window.removeEventListener("keydown", onKey);
|
|
44
|
+
window.removeEventListener(TOGGLE_SIDEBAR, onToggle);
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
// How much of the window the sidebar takes, published as `--sidebar-w` for
|
|
48
|
+
// anything laid over the page that should leave the sidebar showing or
|
|
49
|
+
// centre itself on what is left (an image viewer, a selection bar).
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
document.documentElement.style.setProperty("--sidebar-w", open ? "15rem" : "0px");
|
|
52
|
+
return () => void document.documentElement.style.removeProperty("--sidebar-w");
|
|
53
|
+
}, [open]);
|
|
54
|
+
const desktop = { sidebarOpen: open, openSidebar: () => setOpen(true), closeSidebar: () => setOpen(false) };
|
|
55
|
+
// On a small screen the bar always offers to open the drawer.
|
|
56
|
+
const mobile = { sidebarOpen: false, openSidebar: () => setDrawer(true), closeSidebar: () => setDrawer(false) };
|
|
57
|
+
return (_jsxs("div", { className: "flex h-dvh", children: [_jsx("div", { className: cn("hidden shrink-0 overflow-hidden transition-[width] duration-(--duration-base) ease-out-notion md:block", open ? "w-60" : "w-0"), inert: !open, children: sidebar(desktop) }), _jsxs("div", { className: cn("fixed inset-0 z-(--z-overlay) md:hidden", !drawer && "pointer-events-none"), inert: !drawer, children: [_jsx("div", { className: cn("absolute inset-0 bg-scrim transition-opacity duration-(--duration-base)", drawer ? "opacity-100" : "opacity-0"), onClick: () => setDrawer(false) }), _jsx("div", { className: cn("absolute inset-y-0 left-0 transition-transform duration-(--duration-base) ease-out-notion",
|
|
58
|
+
// The shadow would otherwise spill onto the page from off-screen.
|
|
59
|
+
drawer ? "translate-x-0 shadow-dialog" : "-translate-x-full"), children: sidebar(mobile) })] }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("div", { className: "md:hidden", children: topbar(mobile) }), _jsx("div", { className: "hidden md:block", children: topbar(desktop) }), _jsx("main", { className: "@container flex-1 overflow-y-auto", children: children })] })] }));
|
|
60
|
+
}
|
|
61
|
+
/* The sidebar's own frame: a fixed-width sunken column with a header, a scrolling
|
|
62
|
+
middle and an optional footer. It is a named group, `group/sidebar`, so controls
|
|
63
|
+
in the header can stay hidden until the sidebar is hovered. */
|
|
64
|
+
export function SidebarFrame({ header, footer, children, label }) {
|
|
65
|
+
return (_jsxs("nav", { "aria-label": label, className: "group/sidebar flex h-full w-60 flex-col bg-surface-sunken shadow-edge-r", children: [header && _jsx("div", { className: "flex h-11 shrink-0 items-center gap-2 pr-2 pl-3", children: header }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-1 pb-6", children: children }), footer && _jsx("div", { className: "shrink-0 p-1 shadow-edge-t", children: footer })] }));
|
|
66
|
+
}
|
|
67
|
+
/* A labelled group of entries inside the sidebar. */
|
|
68
|
+
export function SidebarSection({ title, children }) {
|
|
69
|
+
return (_jsxs("section", { className: "mt-4 first:mt-1", children: [_jsx("h2", { className: "truncate px-2 pb-1 text-caption font-medium text-accent-text/80", children: title }), children] }));
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=app-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../../../src/components/ui/app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAE3C,uEAAuE;AACvE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAS,EAAE,CAAC,KAAK,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAS9F;;;;;;;;;;kFAUkF;AAClF,iHAAiH;AACjH,MAAM,UAAU,QAAQ,CAAC,EACrB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,GAMX;IACG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,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AAC,mBAAmB,CAC/D,YAEA,OAAO,CAAC,MAAM,CAAC,GACd,IACJ,EAEN,eAAK,SAAS,EAAC,8BAA8B,aAGzC,cAAK,SAAS,EAAC,WAAW,YAAE,MAAM,CAAC,MAAM,CAAC,GAAO,EACjD,cAAK,SAAS,EAAC,iBAAiB,YAAE,MAAM,CAAC,OAAO,CAAC,GAAO,EACxD,eAAM,SAAS,EAAC,mCAAmC,YAAE,QAAQ,GAAQ,IACnE,IACJ,CACT,CAAC;AACN,CAAC;AAED;;iEAEiE;AACjE,MAAM,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAkF;IAC5I,OAAO,CACH,6BAAiB,KAAK,EAAE,SAAS,EAAC,yEAAyE,aACtG,MAAM,IAAI,cAAK,SAAS,EAAC,iDAAiD,YAAE,MAAM,GAAO,EAC1F,cAAK,SAAS,EAAC,0CAA0C,YAAE,QAAQ,GAAO,EACzE,MAAM,IAAI,cAAK,SAAS,EAAC,4BAA4B,YAAE,MAAM,GAAO,IACnE,CACT,CAAC;AACN,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA0C;IACtF,OAAO,CACH,mBAAS,SAAS,EAAC,iBAAiB,aAChC,aAAI,SAAS,EAAC,iEAAiE,YAAE,KAAK,GAAM,EAC3F,QAAQ,IACH,CACb,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
declare const SIZES: {
|
|
3
|
+
readonly xs: "size-5 text-micro";
|
|
4
|
+
readonly sm: "size-6 text-micro";
|
|
5
|
+
readonly md: "size-8 text-caption";
|
|
6
|
+
readonly lg: "size-10 text-sm";
|
|
7
|
+
};
|
|
8
|
+
/** "Ada Lovelace" → "AL"; "ada@example.com" → "A"; "" → "?". */
|
|
9
|
+
export declare function initials(name: string): string;
|
|
10
|
+
export type AvatarProps = Omit<ComponentProps<"span">, "children"> & {
|
|
11
|
+
name: string;
|
|
12
|
+
src?: string | null;
|
|
13
|
+
size?: keyof typeof SIZES;
|
|
14
|
+
/** A workspace or a thing: a rounded square, not a circle. */
|
|
15
|
+
square?: boolean;
|
|
16
|
+
/** The name is written beside it, so a screen reader need not hear it twice. */
|
|
17
|
+
decorative?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function Avatar({ name, src, size, square, decorative, className, ...props }: AvatarProps): import("react").JSX.Element;
|
|
20
|
+
export declare function AvatarStack({ people, max, size, className, }: {
|
|
21
|
+
people: readonly {
|
|
22
|
+
name: string;
|
|
23
|
+
src?: string | null;
|
|
24
|
+
}[];
|
|
25
|
+
max?: number;
|
|
26
|
+
size?: keyof typeof SIZES;
|
|
27
|
+
className?: string;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAStD,QAAA,MAAM,KAAK;;;;;CAKD,CAAC;AAcX,gEAAgE;AAChE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAW,EAAE,MAAc,EAAE,UAAkB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BAwBtH;AAKD,wBAAgB,WAAW,CAAC,EACxB,MAAM,EACN,GAAO,EACP,IAAW,EACX,SAAS,GACZ,EAAE;IACC,MAAM,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAkBA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { tagColorFor } from "./badge.js";
|
|
6
|
+
/* A person (or a workspace) as a small round picture, or their initials on one of
|
|
7
|
+
the nine when there is no picture or it fails to load. The colour comes from the
|
|
8
|
+
name (tagColorFor), so a person keeps theirs everywhere. Named for a screen
|
|
9
|
+
reader by `name`; pass `decorative` when the name is written right beside it. */
|
|
10
|
+
const SIZES = {
|
|
11
|
+
xs: "size-5 text-micro",
|
|
12
|
+
sm: "size-6 text-micro",
|
|
13
|
+
md: "size-8 text-caption",
|
|
14
|
+
lg: "size-10 text-sm",
|
|
15
|
+
};
|
|
16
|
+
const TAG_CLASS = {
|
|
17
|
+
gray: "bg-tag-gray-bg text-tag-gray-ink",
|
|
18
|
+
brown: "bg-tag-brown-bg text-tag-brown-ink",
|
|
19
|
+
orange: "bg-tag-orange-bg text-tag-orange-ink",
|
|
20
|
+
yellow: "bg-tag-yellow-bg text-tag-yellow-ink",
|
|
21
|
+
green: "bg-tag-green-bg text-tag-green-ink",
|
|
22
|
+
blue: "bg-tag-blue-bg text-tag-blue-ink",
|
|
23
|
+
purple: "bg-tag-purple-bg text-tag-purple-ink",
|
|
24
|
+
pink: "bg-tag-pink-bg text-tag-pink-ink",
|
|
25
|
+
red: "bg-tag-red-bg text-tag-red-ink",
|
|
26
|
+
};
|
|
27
|
+
/** "Ada Lovelace" → "AL"; "ada@example.com" → "A"; "" → "?". */
|
|
28
|
+
export function initials(name) {
|
|
29
|
+
const words = name.replace(/@.*/, "").split(/[\s._-]+/).filter(Boolean);
|
|
30
|
+
if (words.length === 0)
|
|
31
|
+
return "?";
|
|
32
|
+
const letters = words.length === 1 ? words[0].slice(0, 1) : words[0].slice(0, 1) + words[words.length - 1].slice(0, 1);
|
|
33
|
+
return letters.toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
export function Avatar({ name, src, size = "md", square = false, decorative = false, className, ...props }) {
|
|
36
|
+
const [failed, setFailed] = useState(null);
|
|
37
|
+
const showPicture = src && failed !== src;
|
|
38
|
+
return (_jsx("span", { role: decorative ? undefined : "img", "aria-label": decorative ? undefined : name, "aria-hidden": decorative || undefined, className: cn("inline-flex relative justify-center items-center overflow-hidden font-semibold leading-none select-none shrink-0", square ? "rounded-small" : "rounded-full", SIZES[size], !showPicture && TAG_CLASS[tagColorFor(name)], className), ...props, children: showPicture ? (_jsx("img", { src: src, alt: "", draggable: false, onError: () => setFailed(src), className: "size-full object-cover" })) : (initials(name)) }));
|
|
39
|
+
}
|
|
40
|
+
/* Several people at once, overlapping, each ringed in the page's colour so the
|
|
41
|
+
edges read. More than `max` and the rest become "+n". Named as a whole: "Ada,
|
|
42
|
+
Grace and 3 others". */
|
|
43
|
+
export function AvatarStack({ people, max = 4, size = "sm", className, }) {
|
|
44
|
+
const shown = people.slice(0, people.length > max ? max - 1 : max);
|
|
45
|
+
const rest = people.length - shown.length;
|
|
46
|
+
const names = shown.map((p) => p.name.split(" ")[0]);
|
|
47
|
+
const label = rest > 0 ? `${names.join(", ")} and ${rest} other${rest === 1 ? "" : "s"}` : names.length > 1 ? `${names.slice(0, -1).join(", ")} and ${names.at(-1)}` : (names[0] ?? "");
|
|
48
|
+
return (_jsxs("span", { role: "img", "aria-label": label, className: cn("inline-flex items-center", className), children: [shown.map((p, i) => (_jsx(Avatar, { name: p.name, src: p.src, size: size, decorative: true, className: cn("ring-2 ring-surface", i > 0 && "-ml-1.5") }, `${p.name}-${i}`))), rest > 0 && (_jsxs("span", { "aria-hidden": true, className: cn("inline-flex justify-center items-center -ml-1.5 rounded-full ring-2 ring-surface bg-tint-active font-semibold text-ink-secondary", SIZES[size]), children: ["+", rest] }))] }));
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAiB,MAAM,YAAa,CAAC;AAEzD;;;mFAGmF;AAEnF,MAAM,KAAK,GAAG;IACV,EAAE,EAAE,mBAAmB;IACvB,EAAE,EAAE,mBAAmB;IACvB,EAAE,EAAE,qBAAqB;IACzB,EAAE,EAAE,iBAAiB;CACf,CAAC;AAEX,MAAM,SAAS,GAA6B;IACxC,IAAI,EAAE,kCAAkC;IACxC,KAAK,EAAE,oCAAoC;IAC3C,MAAM,EAAE,sCAAsC;IAC9C,MAAM,EAAE,sCAAsC;IAC9C,KAAK,EAAE,oCAAoC;IAC3C,IAAI,EAAE,kCAAkC;IACxC,MAAM,EAAE,sCAAsC;IAC9C,IAAI,EAAE,kCAAkC;IACxC,GAAG,EAAE,gCAAgC;CACxC,CAAC;AAEF,gEAAgE;AAChE,MAAM,UAAU,QAAQ,CAAC,IAAY;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CA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CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9K,OAAO,CACH,gBAAM,IAAI,EAAC,KAAK,gBAAa,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,aACnF,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACjB,KAAC,MAAM,IAAwB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,QAAC,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,IAA3H,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE,CAA+G,CAC/I,CAAC,EACD,IAAI,GAAG,CAAC,IAAI,CACT,qCAAkB,SAAS,EAAE,EAAE,CAAC,kIAAkI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,kBAC1K,IAAI,IACH,CACV,IACE,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export declare const TAG_COLORS: readonly ["gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
|
|
4
|
+
export type TagColor = (typeof TAG_COLORS)[number];
|
|
5
|
+
declare const badgeVariants: (props?: ({
|
|
6
|
+
color?: "blue" | "brown" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | null | undefined;
|
|
7
|
+
size?: "md" | "sm" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface BadgeProps extends Omit<ComponentProps<"span">, "color">, VariantProps<typeof badgeVariants> {
|
|
10
|
+
}
|
|
11
|
+
export declare function Badge({ className, color, size, ...props }: BadgeProps): import("react").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Deterministically maps any string to one of the nine. Use it for tags,
|
|
14
|
+
* owners, labels — anything user-generated that needs a stable colour
|
|
15
|
+
* without anyone choosing one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tagColorFor(value: string): TagColor;
|
|
18
|
+
export { badgeVariants };
|
|
19
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAc5C,eAAO,MAAM,UAAU,0FAUb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,QAAA,MAAM,aAAa;;;8EAsBlB,CAAC;AAEF,MAAM,WAAW,UACb,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EACzC,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAE7C,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAOrE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAOnD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* ────────────────────────────────────────────────────────────────────────
|
|
5
|
+
The nine.
|
|
6
|
+
|
|
7
|
+
This is the highest-leverage idea borrowed from Notion: there is no
|
|
8
|
+
colour picker. Nine desaturated pairs, each a tinted background with
|
|
9
|
+
same-hue ink. Because every pair is pre-harmonised at low chroma, a
|
|
10
|
+
board with forty tags on it still reads calm — and a user cannot
|
|
11
|
+
produce an ugly combination, because they cannot produce an arbitrary
|
|
12
|
+
one. Resist adding a tenth.
|
|
13
|
+
──────────────────────────────────────────────────────────────────────── */
|
|
14
|
+
export const TAG_COLORS = [
|
|
15
|
+
"gray",
|
|
16
|
+
"brown",
|
|
17
|
+
"orange",
|
|
18
|
+
"yellow",
|
|
19
|
+
"green",
|
|
20
|
+
"blue",
|
|
21
|
+
"purple",
|
|
22
|
+
"pink",
|
|
23
|
+
"red",
|
|
24
|
+
];
|
|
25
|
+
const badgeVariants = cva("inline-flex items-center gap-1 rounded-small font-medium whitespace-nowrap [&_svg]:size-3 [&_svg]:shrink-0", {
|
|
26
|
+
variants: {
|
|
27
|
+
color: {
|
|
28
|
+
gray: "bg-tag-gray-bg text-tag-gray-ink",
|
|
29
|
+
brown: "bg-tag-brown-bg text-tag-brown-ink",
|
|
30
|
+
orange: "bg-tag-orange-bg text-tag-orange-ink",
|
|
31
|
+
yellow: "bg-tag-yellow-bg text-tag-yellow-ink",
|
|
32
|
+
green: "bg-tag-green-bg text-tag-green-ink",
|
|
33
|
+
blue: "bg-tag-blue-bg text-tag-blue-ink",
|
|
34
|
+
purple: "bg-tag-purple-bg text-tag-purple-ink",
|
|
35
|
+
pink: "bg-tag-pink-bg text-tag-pink-ink",
|
|
36
|
+
red: "bg-tag-red-bg text-tag-red-ink",
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
sm: "h-4.5 px-1.5 text-micro",
|
|
40
|
+
md: "h-5 px-2 text-caption",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: { color: "gray", size: "md" },
|
|
44
|
+
});
|
|
45
|
+
export function Badge({ className, color, size, ...props }) {
|
|
46
|
+
return (_jsx("span", { className: cn(badgeVariants({ color, size }), className), ...props }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Deterministically maps any string to one of the nine. Use it for tags,
|
|
50
|
+
* owners, labels — anything user-generated that needs a stable colour
|
|
51
|
+
* without anyone choosing one.
|
|
52
|
+
*/
|
|
53
|
+
export function tagColorFor(value) {
|
|
54
|
+
let hash = 0;
|
|
55
|
+
for (let i = 0; i < value.length; i++) {
|
|
56
|
+
hash = (hash << 5) - hash + value.charCodeAt(i);
|
|
57
|
+
hash |= 0;
|
|
58
|
+
}
|
|
59
|
+
return TAG_COLORS[Math.abs(hash) % TAG_COLORS.length];
|
|
60
|
+
}
|
|
61
|
+
export { badgeVariants };
|
|
62
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;;;;;8EAS8E;AAE9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,MAAM;IACN,KAAK;CACC,CAAC;AAIX,MAAM,aAAa,GAAG,GAAG,CACrB,4GAA4G,EAC5G;IACI,QAAQ,EAAE;QACN,KAAK,EAAE;YACH,IAAI,EAAE,kCAAkC;YACxC,KAAK,EAAE,oCAAoC;YAC3C,MAAM,EAAE,sCAAsC;YAC9C,MAAM,EAAE,sCAAsC;YAC9C,KAAK,EAAE,oCAAoC;YAC3C,IAAI,EAAE,kCAAkC;YACxC,MAAM,EAAE,sCAAsC;YAC9C,IAAI,EAAE,kCAAkC;YACxC,GAAG,EAAE,gCAAgC;SACxC;QACD,IAAI,EAAE;YACF,EAAE,EAAE,yBAAyB;YAC7B,EAAE,EAAE,uBAAuB;SAC9B;KACJ;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;CACjD,CACJ,CAAC;AAMF,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAc;IAClE,OAAO,CACH,eACI,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KACpD,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACrC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,CAAC;IACd,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
declare const TONES: {
|
|
3
|
+
readonly info: {
|
|
4
|
+
readonly bg: "bg-tag-blue-bg";
|
|
5
|
+
readonly icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
6
|
+
readonly ink: "text-info";
|
|
7
|
+
};
|
|
8
|
+
readonly warning: {
|
|
9
|
+
readonly bg: "bg-tag-yellow-bg";
|
|
10
|
+
readonly icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
readonly ink: "text-warning";
|
|
12
|
+
};
|
|
13
|
+
readonly danger: {
|
|
14
|
+
readonly bg: "bg-tag-red-bg";
|
|
15
|
+
readonly icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
16
|
+
readonly ink: "text-danger";
|
|
17
|
+
};
|
|
18
|
+
readonly offline: {
|
|
19
|
+
readonly bg: "bg-tag-gray-bg";
|
|
20
|
+
readonly icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
21
|
+
readonly ink: "text-ink-secondary";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare function Banner({ tone, children, action, onDismiss, icon, className, }: {
|
|
25
|
+
tone?: keyof typeof TONES;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
action?: ReactNode;
|
|
28
|
+
onDismiss?: () => void;
|
|
29
|
+
icon?: ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/components/ui/banner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;CAKD,CAAC;AAEX,wBAAgB,MAAM,CAAC,EACnB,IAAa,EACb,QAAQ,EACR,MAAM,EACN,SAAS,EACT,IAAI,EACJ,SAAS,GACZ,EAAE;IACC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAoBA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CircleAlert, Info, TriangleAlert, WifiOff, X } from "lucide-react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
/* A message about the whole page, across its top: you are offline, this is
|
|
7
|
+
read-only, a trial ends soon. Not a Toast (that passes) nor a Callout (that is
|
|
8
|
+
part of the content). One line, an action at the end, and a close if it may be
|
|
9
|
+
dismissed. A status to a screen reader (`alert` for danger). */
|
|
10
|
+
const TONES = {
|
|
11
|
+
info: { bg: "bg-tag-blue-bg", icon: Info, ink: "text-info" },
|
|
12
|
+
warning: { bg: "bg-tag-yellow-bg", icon: TriangleAlert, ink: "text-warning" },
|
|
13
|
+
danger: { bg: "bg-tag-red-bg", icon: CircleAlert, ink: "text-danger" },
|
|
14
|
+
offline: { bg: "bg-tag-gray-bg", icon: WifiOff, ink: "text-ink-secondary" },
|
|
15
|
+
};
|
|
16
|
+
export function Banner({ tone = "info", children, action, onDismiss, icon, className, }) {
|
|
17
|
+
const t = TONES[tone];
|
|
18
|
+
const Icon = t.icon;
|
|
19
|
+
return (_jsxs("div", { role: tone === "danger" ? "alert" : "status", className: cn("flex flex-wrap items-center gap-x-3 gap-y-1 px-4 py-2 min-h-control-lg text-ink text-sm", t.bg, className), children: [_jsx("span", { "aria-hidden": true, className: cn("[&_svg]:size-4 shrink-0", t.ink), children: icon ?? _jsx(Icon, {}) }), _jsx("div", { className: "flex-1 min-w-[min(12rem,70%)]", children: children }), action !== undefined && _jsx("div", { className: "flex items-center gap-1 shrink-0", children: action }), onDismiss && (_jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Dismiss", onClick: onDismiss, className: "-mr-2 shrink-0", children: _jsx(X, {}) }))] }));
|
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B,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,CAAC,CAAC,GAAG,CAAC,YAC5D,IAAI,IAAI,KAAC,IAAI,KAAG,GACd,EACP,cAAK,SAAS,EAAC,+BAA+B,YAAE,QAAQ,GAAO,EAC9D,MAAM,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,kCAAkC,YAAE,MAAM,GAAO,EACxF,SAAS,IAAI,CACV,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,gBAAY,SAAS,EAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAC,gBAAgB,YACtG,KAAC,CAAC,KAAG,GACA,CACZ,IACC,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ElementType } from "react";
|
|
2
|
+
export type Crumb = {
|
|
3
|
+
title: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function Breadcrumbs({ crumbs, link: Link }: {
|
|
7
|
+
crumbs: Crumb[];
|
|
8
|
+
link?: ElementType;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAKrD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAU,EAAE,EAAE;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,+BAiBhG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
/* Where you are. A crumb with an href is a link; the last one usually has none.
|
|
4
|
+
Pass your router's link as `link` (next/link, react-router's Link); it gets
|
|
5
|
+
`href`, `className` and children. */
|
|
6
|
+
export function Breadcrumbs({ crumbs, link: Link = "a" }) {
|
|
7
|
+
return (_jsx("nav", { "aria-label": "Breadcrumb", className: "flex min-w-0 items-center text-sm", children: crumbs.map((crumb, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "px-0.5 text-ink-tertiary", children: "/" }), crumb.href ? (_jsx(Link, { href: crumb.href, className: "truncate rounded-control px-1.5 py-0.5 transition-colors duration-(--duration-fast) hover:bg-tint-hover", children: crumb.title })) : (_jsx("span", { className: "truncate px-1.5 py-0.5 text-ink-secondary", children: crumb.title }))] }, i))) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/ui/breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,OAAO,CAAC;AAInD;;uCAEuC;AACvC,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,EAA2C;IAC7F,OAAO,CACH,4BAAgB,YAAY,EAAC,SAAS,EAAC,mCAAmC,YACrE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,QAAQ,eACJ,CAAC,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,0BAA0B,kBAAS,EAC5D,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACV,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAC,yGAAyG,YACtI,KAAK,CAAC,KAAK,GACT,CACV,CAAC,CAAC,CAAC,CACA,eAAM,SAAS,EAAC,2CAA2C,YAAE,KAAK,CAAC,KAAK,GAAQ,CACnF,KARU,CAAC,CASL,CACd,CAAC,GACA,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "secondary" | "danger" | "primary" | "ghost" | "subtle" | "danger-ghost" | "on-media" | null | undefined;
|
|
5
|
+
size?: "md" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
8
|
+
/** Render as the single child element (a router's link) instead of a <button>. */
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
/** Working: a spinner in place of the label, the width kept, presses ignored. */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function Button({ className, variant, size, asChild, loading, type, children, onClick, ...props }: ButtonProps): import("react").JSX.Element;
|
|
14
|
+
export { buttonVariants };
|
|
15
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAA4B,KAAK,cAAc,EAAkB,MAAM,OAAO,CAAC;AAatF,QAAA,MAAM,cAAc;;;8EAkDnB,CAAC;AASF,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IAC9F,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AA2BD,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAe,EAAE,OAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BAoCpI;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|