@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,26 @@
|
|
|
1
|
+
/* The pieces every list of options shares: Combobox, MultiSelect, Spotlight, the
|
|
2
|
+
"/" CommandMenu. Kept in one place so their rows and panels stay one look (they
|
|
3
|
+
had drifted to three row heights, two paddings and two radii).
|
|
4
|
+
|
|
5
|
+
The highlight is `data-active`, not aria-selected: in a multiple choice list
|
|
6
|
+
(MultiSelect) aria-selected says chosen, and the two must not be confused. */
|
|
7
|
+
|
|
8
|
+
/** A list's panel, as a popover. */
|
|
9
|
+
export const listSurfaceClasses = "bg-surface-overlay shadow-popover p-1.5 rounded-overlay outline-none overflow-y-auto overscroll-contain";
|
|
10
|
+
|
|
11
|
+
/** One option. Set data-active on the highlighted one. Taller by className where a row carries more (Spotlight's). */
|
|
12
|
+
export const optionClasses = [
|
|
13
|
+
"flex items-center gap-2 px-2 rounded-control w-full h-control-sm text-sm text-left cursor-pointer select-none",
|
|
14
|
+
"transition-colors duration-(--duration-instant) data-[active=true]:bg-tint-hover",
|
|
15
|
+
"aria-disabled:pointer-events-none aria-disabled:text-ink-disabled",
|
|
16
|
+
].join(" ");
|
|
17
|
+
|
|
18
|
+
/** Where the highlight goes for a key: the arrows step and wrap round, Home and End jump. From nothing (-1), down is the first and up the last. Null for any other key. */
|
|
19
|
+
export function stepActive(current: number, count: number, key: string): number | null {
|
|
20
|
+
if (count === 0) return null;
|
|
21
|
+
if (key === "Home") return 0;
|
|
22
|
+
if (key === "End") return count - 1;
|
|
23
|
+
if (key === "ArrowDown") return current < 0 ? 0 : (current + 1) % count;
|
|
24
|
+
if (key === "ArrowUp") return current < 0 ? count - 1 : (current - 1 + count) % count;
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.ts";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
interface MacWindowHeaderProps {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function MacWindowHeader({ title, className }: MacWindowHeaderProps) {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
className={cn(
|
|
13
|
+
"flex items-center gap-1.5 bg-surface-sunken px-4 py-2.5 border-b",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
<span className="bg-tag-red-ink/70 rounded-full size-2.5" />
|
|
18
|
+
<span className="bg-tag-yellow-ink/70 rounded-full size-2.5" />
|
|
19
|
+
<span className="bg-tag-green-ink/70 rounded-full size-2.5" />
|
|
20
|
+
<span className="ml-auto font-mono text-ink-tertiary text-caption">
|
|
21
|
+
{title}
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface MacCardProps {
|
|
28
|
+
title: ReactNode;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
headerClassName?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function MacCard({
|
|
35
|
+
title,
|
|
36
|
+
children,
|
|
37
|
+
className,
|
|
38
|
+
headerClassName,
|
|
39
|
+
}: MacCardProps) {
|
|
40
|
+
return (
|
|
41
|
+
<div className={cn("overflow-hidden", className)}>
|
|
42
|
+
<MacWindowHeader title={title} className={headerClassName} />
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { CalendarRange, ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import { useRef, useState, type KeyboardEvent } from "react";
|
|
5
|
+
import { formatMonth, isMonth, today } from "../../lib/dates.ts";
|
|
6
|
+
import { cn } from "../../lib/utils.ts";
|
|
7
|
+
import { FieldButton, type FieldButtonProps } from "./field-button.tsx";
|
|
8
|
+
import { PickerPanel } from "./picker-panel.tsx";
|
|
9
|
+
|
|
10
|
+
const SHORT = new Intl.DateTimeFormat(undefined, { month: "short" });
|
|
11
|
+
const pad = (n: number) => String(n).padStart(2, "0");
|
|
12
|
+
|
|
13
|
+
export interface MonthPickerProps extends Omit<FieldButtonProps, "value" | "onChange" | "children" | "onClear" | "icon"> {
|
|
14
|
+
/** `YYYY-MM`, or null for none. */
|
|
15
|
+
value: string | null;
|
|
16
|
+
onChange: (value: string | null) => void;
|
|
17
|
+
/** Earliest and latest month, `YYYY-MM`. */
|
|
18
|
+
min?: string | null;
|
|
19
|
+
max?: string | null;
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
name?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* A month: a budget's, a report's, a calendar's. A year of months on a grid, the
|
|
25
|
+
year changed with the arrows beside it. The arrow keys move through the months,
|
|
26
|
+
across years; Enter chooses. */
|
|
27
|
+
export function MonthPicker({ value, onChange, min, max, clearable = true, placeholder = "Pick a month", name, ...props }: MonthPickerProps) {
|
|
28
|
+
const chosen = isMonth(value) ? value : null;
|
|
29
|
+
const [open, setOpen] = useState(false);
|
|
30
|
+
const [year, setYear] = useState(() => Number((chosen ?? today()).slice(0, 4)));
|
|
31
|
+
const [focusMonth, setFocusMonth] = useState<string>(chosen ?? today().slice(0, 7));
|
|
32
|
+
const grid = useRef<HTMLDivElement>(null);
|
|
33
|
+
const outside = (m: string) => (min != null && m < min) || (max != null && m > max);
|
|
34
|
+
|
|
35
|
+
const moveTo = (m: string) => {
|
|
36
|
+
setFocusMonth(m);
|
|
37
|
+
setYear(Number(m.slice(0, 4)));
|
|
38
|
+
requestAnimationFrame(() => grid.current?.querySelector<HTMLElement>(`[data-month="${m}"]`)?.focus());
|
|
39
|
+
};
|
|
40
|
+
const onKey = (e: KeyboardEvent) => {
|
|
41
|
+
const by = { ArrowRight: 1, ArrowLeft: -1, ArrowDown: 3, ArrowUp: -3 }[e.key];
|
|
42
|
+
if (by === undefined) return;
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
const [y, m] = focusMonth.split("-").map(Number);
|
|
45
|
+
const d = new Date(y, m - 1 + by, 1);
|
|
46
|
+
moveTo(`${d.getFullYear()}-${pad(d.getMonth() + 1)}`);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<PickerPanel
|
|
52
|
+
open={open}
|
|
53
|
+
onOpenChange={(next) => {
|
|
54
|
+
setOpen(next);
|
|
55
|
+
if (next) {
|
|
56
|
+
setYear(Number((chosen ?? today()).slice(0, 4)));
|
|
57
|
+
setFocusMonth(chosen ?? today().slice(0, 7));
|
|
58
|
+
}
|
|
59
|
+
}}
|
|
60
|
+
title={props["aria-label"] ?? "Pick a month"}
|
|
61
|
+
onOpenAutoFocus={(e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
(e.currentTarget as HTMLElement).querySelector<HTMLElement>('[data-month][tabindex="0"]')?.focus();
|
|
64
|
+
}}
|
|
65
|
+
trigger={
|
|
66
|
+
<FieldButton icon={CalendarRange} placeholder={placeholder} onClear={clearable ? () => onChange(null) : undefined} clearLabel="Clear the month" {...props}>
|
|
67
|
+
{chosen === null ? null : formatMonth(chosen)}
|
|
68
|
+
</FieldButton>
|
|
69
|
+
}
|
|
70
|
+
>
|
|
71
|
+
<div className="p-3 w-72 max-sm:w-full max-sm:max-w-sm">
|
|
72
|
+
<div className="flex justify-between items-center mb-2">
|
|
73
|
+
<button type="button" aria-label="Previous year" onClick={() => setYear((y) => y - 1)} className="inline-flex justify-center items-center hover:bg-tint-hover rounded-control size-7 [@media(pointer:coarse)]:size-10 text-ink-secondary">
|
|
74
|
+
<ChevronLeft className="size-4" />
|
|
75
|
+
</button>
|
|
76
|
+
<span aria-live="polite" className="font-medium text-sm tabular-nums">
|
|
77
|
+
{year}
|
|
78
|
+
</span>
|
|
79
|
+
<button type="button" aria-label="Next year" onClick={() => setYear((y) => y + 1)} className="inline-flex justify-center items-center hover:bg-tint-hover rounded-control size-7 [@media(pointer:coarse)]:size-10 text-ink-secondary">
|
|
80
|
+
<ChevronRight className="size-4" />
|
|
81
|
+
</button>
|
|
82
|
+
</div>
|
|
83
|
+
<div ref={grid} role="grid" aria-label={`Months of ${year}`} onKeyDown={onKey} className="gap-1 grid grid-cols-3">
|
|
84
|
+
{Array.from({ length: 12 }, (_, i) => {
|
|
85
|
+
const m = `${year}-${pad(i + 1)}`;
|
|
86
|
+
const isChosen = m === chosen;
|
|
87
|
+
return (
|
|
88
|
+
<button
|
|
89
|
+
key={m}
|
|
90
|
+
type="button"
|
|
91
|
+
role="gridcell"
|
|
92
|
+
data-month={m}
|
|
93
|
+
aria-selected={isChosen}
|
|
94
|
+
aria-label={formatMonth(m)}
|
|
95
|
+
tabIndex={m === focusMonth ? 0 : -1}
|
|
96
|
+
disabled={outside(m)}
|
|
97
|
+
onFocus={() => setFocusMonth(m)}
|
|
98
|
+
onClick={() => {
|
|
99
|
+
onChange(m);
|
|
100
|
+
setOpen(false);
|
|
101
|
+
}}
|
|
102
|
+
className={cn(
|
|
103
|
+
"rounded-control h-9 [@media(pointer:coarse)]:h-12 text-sm transition-colors duration-(--duration-instant)",
|
|
104
|
+
isChosen ? "bg-accent-solid font-medium text-accent-ink hover:bg-accent-solid-hover" : "text-ink hover:bg-tint-hover",
|
|
105
|
+
m === today().slice(0, 7) && !isChosen && "font-semibold shadow-[inset_0_0_0_1px_var(--hairline-strong)]",
|
|
106
|
+
"disabled:text-ink-disabled disabled:pointer-events-none",
|
|
107
|
+
)}
|
|
108
|
+
>
|
|
109
|
+
{SHORT.format(new Date(year, i, 1))}
|
|
110
|
+
</button>
|
|
111
|
+
);
|
|
112
|
+
})}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</PickerPanel>
|
|
116
|
+
{name !== undefined && <input type="hidden" name={name} value={chosen ?? ""} />}
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
import { Check, Plus, X } from "lucide-react";
|
|
5
|
+
import { useId, useRef, useState } from "react";
|
|
6
|
+
import { cn } from "../../lib/utils.ts";
|
|
7
|
+
import { Badge, tagColorFor, type TagColor } from "./badge.tsx";
|
|
8
|
+
import { fieldVariants, fromField, useField } from "./input.tsx";
|
|
9
|
+
import { useEscapeFirst } from "../../hooks/use-escape-first.ts";
|
|
10
|
+
import { listSurfaceClasses, optionClasses, stepActive } from "./listbox.ts";
|
|
11
|
+
|
|
12
|
+
/* Notion's tags: several of a list, chosen or made by typing. The chosen ones sit
|
|
13
|
+
in the field as badges in the nine colours, each with its own remove button.
|
|
14
|
+
Typing filters the list under the field; the arrows move through it, Enter picks
|
|
15
|
+
or drops the highlighted one (or makes a new one, with `onCreate`), Backspace in
|
|
16
|
+
an empty field drops the last tag, Escape closes the list (and not a dialog
|
|
17
|
+
around it). The list opens in a layer of its own so nothing clips it. With
|
|
18
|
+
`name` the values are sent with a form; inside a Field it takes the Field's
|
|
19
|
+
label and error.
|
|
20
|
+
|
|
21
|
+
An option without a colour takes a stable one from its value (tagColorFor), so a
|
|
22
|
+
tag keeps its colour wherever it appears. */
|
|
23
|
+
|
|
24
|
+
export type MultiSelectOption = { value: string; label: string; color?: TagColor };
|
|
25
|
+
|
|
26
|
+
export function MultiSelect({
|
|
27
|
+
options,
|
|
28
|
+
value,
|
|
29
|
+
onChange,
|
|
30
|
+
onCreate,
|
|
31
|
+
placeholder = "Add…",
|
|
32
|
+
size = "md",
|
|
33
|
+
disabled,
|
|
34
|
+
name,
|
|
35
|
+
className,
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
autoFocus,
|
|
38
|
+
}: {
|
|
39
|
+
options: readonly MultiSelectOption[];
|
|
40
|
+
value: readonly string[];
|
|
41
|
+
onChange: (value: string[]) => void;
|
|
42
|
+
/** Offers "Create …" for what was typed; return the new option (it is chosen at once). */
|
|
43
|
+
onCreate?: (label: string) => MultiSelectOption | void;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
size?: "sm" | "md" | "lg";
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
name?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
"aria-label"?: string;
|
|
50
|
+
/** Put the caret in it when it appears (in a popover opened to edit it). */
|
|
51
|
+
autoFocus?: boolean;
|
|
52
|
+
}) {
|
|
53
|
+
const listId = useId();
|
|
54
|
+
const own = fromField(useField(), { disabled, "aria-label": ariaLabel } as { disabled?: boolean; "aria-label"?: string; id?: string; "aria-describedby"?: string; "aria-invalid"?: boolean });
|
|
55
|
+
const input = useRef<HTMLInputElement>(null);
|
|
56
|
+
const [query, setQuery] = useState("");
|
|
57
|
+
const [open, setOpen] = useState(false);
|
|
58
|
+
const [at, setAt] = useState(-1);
|
|
59
|
+
|
|
60
|
+
const byValue = new Map(options.map((o) => [o.value, o]));
|
|
61
|
+
const chosen = value.map((v) => byValue.get(v) ?? { value: v, label: v });
|
|
62
|
+
const typed = query.trim();
|
|
63
|
+
const found = options.filter((o) => o.label.toLowerCase().includes(typed.toLowerCase()));
|
|
64
|
+
const canCreate = onCreate !== undefined && typed !== "" && !options.some((o) => o.label.toLowerCase() === typed.toLowerCase());
|
|
65
|
+
const rows = found.length + (canCreate ? 1 : 0);
|
|
66
|
+
const showing = open && rows > 0 && !own.disabled;
|
|
67
|
+
// One past the end (the options changed under it) is no highlight.
|
|
68
|
+
const active = at < rows ? at : -1;
|
|
69
|
+
const optionId = (i: number) => `${listId}-${i}`;
|
|
70
|
+
const colorOf = (o: MultiSelectOption) => o.color ?? tagColorFor(o.value);
|
|
71
|
+
|
|
72
|
+
const toggle = (v: string) => onChange(value.includes(v) ? value.filter((x) => x !== v) : [...value, v]);
|
|
73
|
+
const pick = (i: number) => {
|
|
74
|
+
if (i < found.length) toggle(found[i].value);
|
|
75
|
+
else if (canCreate) {
|
|
76
|
+
const made = onCreate!(typed);
|
|
77
|
+
if (made) onChange([...value, made.value]);
|
|
78
|
+
}
|
|
79
|
+
setQuery("");
|
|
80
|
+
setAt(-1);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Escape closes the list and nothing else, before a dialog around it hears it.
|
|
84
|
+
useEscapeFirst(showing, input, () => setOpen(false));
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<PopoverPrimitive.Root open={showing}>
|
|
88
|
+
<PopoverPrimitive.Anchor asChild>
|
|
89
|
+
<div
|
|
90
|
+
className={cn(
|
|
91
|
+
fieldVariants({ size }),
|
|
92
|
+
"flex flex-wrap items-center gap-1 h-auto py-1 cursor-text",
|
|
93
|
+
size === "sm" ? "min-h-control-sm" : size === "lg" ? "min-h-control-lg" : "min-h-control-md",
|
|
94
|
+
// The field shows focus while its input has it.
|
|
95
|
+
"focus-within:bg-surface focus-within:shadow-[inset_0_0_0_1px_var(--accent),0_0_0_3px_var(--accent-tint)]",
|
|
96
|
+
own["aria-invalid"] && "shadow-[inset_0_0_0_1px_var(--danger)] focus-within:shadow-[inset_0_0_0_1px_var(--danger),0_0_0_3px_var(--danger-tint)]",
|
|
97
|
+
own.disabled && "cursor-not-allowed text-ink-disabled",
|
|
98
|
+
className,
|
|
99
|
+
)}
|
|
100
|
+
onPointerDown={(e) => {
|
|
101
|
+
if (e.target === e.currentTarget) {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
input.current?.focus();
|
|
104
|
+
}
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{chosen.map((o) => (
|
|
108
|
+
<Badge key={o.value} color={colorOf(o)} className="gap-0.5 pr-0.5">
|
|
109
|
+
{o.label}
|
|
110
|
+
<button
|
|
111
|
+
type="button"
|
|
112
|
+
aria-label={`Remove ${o.label}`}
|
|
113
|
+
disabled={own.disabled}
|
|
114
|
+
onClick={() => toggle(o.value)}
|
|
115
|
+
className="relative flex justify-center items-center opacity-70 hover:opacity-100 rounded-small size-3.5 after:absolute after:-inset-1 after:content-['']"
|
|
116
|
+
>
|
|
117
|
+
<X className="size-3" />
|
|
118
|
+
</button>
|
|
119
|
+
</Badge>
|
|
120
|
+
))}
|
|
121
|
+
<input
|
|
122
|
+
ref={input}
|
|
123
|
+
autoFocus={autoFocus}
|
|
124
|
+
id={own.id}
|
|
125
|
+
role="combobox"
|
|
126
|
+
aria-label={own["aria-label"]}
|
|
127
|
+
aria-describedby={own["aria-describedby"]}
|
|
128
|
+
aria-invalid={own["aria-invalid"]}
|
|
129
|
+
aria-expanded={showing}
|
|
130
|
+
aria-controls={showing ? listId : undefined}
|
|
131
|
+
aria-autocomplete="list"
|
|
132
|
+
aria-activedescendant={showing && active >= 0 ? optionId(active) : undefined}
|
|
133
|
+
autoComplete="off"
|
|
134
|
+
disabled={own.disabled}
|
|
135
|
+
value={query}
|
|
136
|
+
placeholder={chosen.length === 0 ? placeholder : undefined}
|
|
137
|
+
onChange={(e) => {
|
|
138
|
+
setQuery(e.target.value);
|
|
139
|
+
setOpen(true);
|
|
140
|
+
setAt(e.target.value.trim() === "" ? -1 : 0);
|
|
141
|
+
}}
|
|
142
|
+
onFocus={() => setOpen(true)}
|
|
143
|
+
// A click in the list is a prevented mousedown and keeps the focus
|
|
144
|
+
// here, so a blur means the field really was left.
|
|
145
|
+
onBlur={() => setOpen(false)}
|
|
146
|
+
onKeyDown={(e) => {
|
|
147
|
+
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
148
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
setOpen(true);
|
|
151
|
+
const next = stepActive(active, rows, e.key);
|
|
152
|
+
if (next !== null) setAt(next);
|
|
153
|
+
} else if (e.key === "Enter") {
|
|
154
|
+
// Words typed are a tag being chosen, never a form to send.
|
|
155
|
+
if (query.trim() !== "" || (showing && active >= 0)) e.preventDefault();
|
|
156
|
+
if (showing && active >= 0) pick(active);
|
|
157
|
+
} else if (e.key === "Backspace" && query === "" && value.length > 0) {
|
|
158
|
+
onChange(value.slice(0, -1));
|
|
159
|
+
}
|
|
160
|
+
}}
|
|
161
|
+
className="flex-1 bg-transparent disabled:cursor-not-allowed outline-none min-w-16 h-control-sm placeholder:text-ink-placeholder"
|
|
162
|
+
/>
|
|
163
|
+
{name !== undefined && value.map((v) => <input key={v} type="hidden" name={name} value={v} />)}
|
|
164
|
+
</div>
|
|
165
|
+
</PopoverPrimitive.Anchor>
|
|
166
|
+
<PopoverPrimitive.Portal>
|
|
167
|
+
<PopoverPrimitive.Content
|
|
168
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
169
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
170
|
+
onCloseAutoFocus={(e) => e.preventDefault()}
|
|
171
|
+
onInteractOutside={(e) => {
|
|
172
|
+
if (e.target instanceof Node && input.current?.parentElement?.contains(e.target)) e.preventDefault();
|
|
173
|
+
}}
|
|
174
|
+
align="start"
|
|
175
|
+
sideOffset={4}
|
|
176
|
+
collisionPadding={8}
|
|
177
|
+
className={cn("z-(--z-overlay) w-(--radix-popper-anchor-width) max-h-[min(20rem,var(--radix-popper-available-height))] animate-slide-in", listSurfaceClasses)}
|
|
178
|
+
>
|
|
179
|
+
<ul id={listId} role="listbox" aria-multiselectable="true">
|
|
180
|
+
{found.map((o, i) => (
|
|
181
|
+
<li
|
|
182
|
+
key={o.value}
|
|
183
|
+
id={optionId(i)}
|
|
184
|
+
role="option"
|
|
185
|
+
aria-selected={value.includes(o.value)}
|
|
186
|
+
data-active={i === active}
|
|
187
|
+
onMouseDown={(e) => {
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
pick(i);
|
|
190
|
+
}}
|
|
191
|
+
onMouseEnter={() => setAt(i)}
|
|
192
|
+
className={optionClasses}
|
|
193
|
+
>
|
|
194
|
+
<Badge color={colorOf(o)}>{o.label}</Badge>
|
|
195
|
+
{value.includes(o.value) && <Check aria-hidden className="ml-auto size-4 text-ink-secondary" />}
|
|
196
|
+
</li>
|
|
197
|
+
))}
|
|
198
|
+
{canCreate && (
|
|
199
|
+
<li
|
|
200
|
+
id={optionId(found.length)}
|
|
201
|
+
role="option"
|
|
202
|
+
aria-selected={false}
|
|
203
|
+
data-active={active === found.length}
|
|
204
|
+
onMouseDown={(e) => {
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
pick(found.length);
|
|
207
|
+
}}
|
|
208
|
+
onMouseEnter={() => setAt(found.length)}
|
|
209
|
+
className={optionClasses}
|
|
210
|
+
>
|
|
211
|
+
<Plus aria-hidden className="size-4 text-ink-tertiary" />
|
|
212
|
+
<span className="text-ink-secondary">Create</span>
|
|
213
|
+
<Badge color={tagColorFor(typed)}>{typed}</Badge>
|
|
214
|
+
</li>
|
|
215
|
+
)}
|
|
216
|
+
</ul>
|
|
217
|
+
</PopoverPrimitive.Content>
|
|
218
|
+
</PopoverPrimitive.Portal>
|
|
219
|
+
</PopoverPrimitive.Root>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ChevronRight, FileText, type LucideIcon } from "lucide-react";
|
|
4
|
+
import { useEffect, useState, type ElementType } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.ts";
|
|
6
|
+
|
|
7
|
+
export type NavNode = { id: string; title: string; href: string; icon?: LucideIcon; children?: NavNode[] };
|
|
8
|
+
|
|
9
|
+
// Each entry keeps one of the nine tag colours for its icon, picked from its id, so
|
|
10
|
+
// a sidebar has some colour and an entry is recognisable by more than its name.
|
|
11
|
+
const ICON_COLORS = [
|
|
12
|
+
"text-tag-gray-ink", "text-tag-brown-ink", "text-tag-orange-ink", "text-tag-yellow-ink", "text-tag-green-ink",
|
|
13
|
+
"text-tag-blue-ink", "text-tag-purple-ink", "text-tag-pink-ink", "text-tag-red-ink",
|
|
14
|
+
];
|
|
15
|
+
function iconColor(id: string): string {
|
|
16
|
+
let hash = 0;
|
|
17
|
+
for (const ch of id) hash = (hash * 31 + ch.charCodeAt(0)) | 0;
|
|
18
|
+
return ICON_COLORS[Math.abs(hash) % ICON_COLORS.length];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const holds = (node: NavNode, id: string): boolean => (node.children ?? []).some((c) => c.id === id || holds(c, id));
|
|
22
|
+
|
|
23
|
+
function Row({ node, depth, activeId, link: Link }: { node: NavNode; depth: number; activeId?: string; link: ElementType }) {
|
|
24
|
+
const children = node.children ?? [];
|
|
25
|
+
const holdsActive = activeId !== undefined && holds(node, activeId);
|
|
26
|
+
const [open, setOpen] = useState(holdsActive);
|
|
27
|
+
// Opening a page inside this one, from anywhere, shows where it is. Closing it by
|
|
28
|
+
// hand afterwards still works.
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (holdsActive) setOpen(true);
|
|
31
|
+
}, [holdsActive]);
|
|
32
|
+
const current = node.id === activeId;
|
|
33
|
+
const Icon = node.icon ?? FileText;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<li>
|
|
37
|
+
<div
|
|
38
|
+
className={cn(
|
|
39
|
+
"group flex h-control-sm items-center rounded-control pr-2 text-sm font-medium transition-colors duration-(--duration-fast)",
|
|
40
|
+
current ? "bg-accent-tint text-accent-text" : "text-ink-secondary hover:bg-tint-hover",
|
|
41
|
+
)}
|
|
42
|
+
style={{ paddingLeft: 8 + depth * 16 }}
|
|
43
|
+
>
|
|
44
|
+
{/* The icon slot doubles as the toggle: on hover a parent's icon gives way
|
|
45
|
+
to its chevron, as in Notion. */}
|
|
46
|
+
<span className="relative mr-1.5 flex size-5 shrink-0 items-center justify-center">
|
|
47
|
+
<Icon className={cn("size-4", iconColor(node.id), children.length > 0 && "group-hover:opacity-0")} />
|
|
48
|
+
{children.length > 0 && (
|
|
49
|
+
<button
|
|
50
|
+
type="button"
|
|
51
|
+
aria-label={open ? `Collapse ${node.title}` : `Expand ${node.title}`}
|
|
52
|
+
aria-expanded={open}
|
|
53
|
+
onClick={() => setOpen(!open)}
|
|
54
|
+
className="affordance absolute inset-0 flex items-center justify-center rounded-small hover:bg-tint-active"
|
|
55
|
+
>
|
|
56
|
+
<ChevronRight className={cn("size-3.5 transition-transform duration-(--duration-fast)", open && "rotate-90")} />
|
|
57
|
+
</button>
|
|
58
|
+
)}
|
|
59
|
+
</span>
|
|
60
|
+
<Link href={node.href} aria-current={current ? "page" : undefined} className="flex h-full min-w-0 flex-1 items-center outline-offset-[-2px]">
|
|
61
|
+
<span className="truncate">{node.title}</span>
|
|
62
|
+
</Link>
|
|
63
|
+
</div>
|
|
64
|
+
{children.length > 0 && open && <NavTree nodes={children} depth={depth + 1} activeId={activeId} link={Link} />}
|
|
65
|
+
</li>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* A sidebar's tree of destinations. The entry matching `activeId` is highlighted
|
|
70
|
+
in the accent, and its ancestors start open. Pass your router's link as `link`.
|
|
71
|
+
|
|
72
|
+
Put the tree inside something that is not itself a `group`, or use a named group
|
|
73
|
+
there: the rows use `group` to reveal their chevrons. */
|
|
74
|
+
export function NavTree({
|
|
75
|
+
nodes,
|
|
76
|
+
activeId,
|
|
77
|
+
depth = 0,
|
|
78
|
+
link = "a",
|
|
79
|
+
}: {
|
|
80
|
+
nodes: NavNode[];
|
|
81
|
+
activeId?: string;
|
|
82
|
+
depth?: number;
|
|
83
|
+
link?: ElementType;
|
|
84
|
+
}) {
|
|
85
|
+
return (
|
|
86
|
+
<ul className="flex flex-col gap-px">
|
|
87
|
+
{nodes.map((node) => (
|
|
88
|
+
<Row key={node.id} node={node} depth={depth} activeId={activeId} link={link} />
|
|
89
|
+
))}
|
|
90
|
+
</ul>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { cn } from "../../lib/utils.ts";
|
|
3
|
+
|
|
4
|
+
const WIDTHS = {
|
|
5
|
+
/** A reading width, for forms, settings and pages of text (endgame's). */
|
|
6
|
+
reading: "max-w-reading",
|
|
7
|
+
/** Room for a grid of pictures or a wide table (vault's). */
|
|
8
|
+
wide: "max-w-wide",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/* Every page of an app sits in this: one width and one set of margins, so moving
|
|
12
|
+
between views does not shift the left edge. Meant for inside `SidebarInset` (or
|
|
13
|
+
any container): its margins answer to the room the page really has, sidebar
|
|
14
|
+
open or shut, not to the window. 20px on a phone, 32px from a 36rem page, 48px
|
|
15
|
+
from 56rem; checked at 360 to 2560px wide. Pick one width per app, or per kind
|
|
16
|
+
of page. */
|
|
17
|
+
export function Page({
|
|
18
|
+
width = "wide",
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}: ComponentPropsWithoutRef<"div"> & { width?: keyof typeof WIDTHS }) {
|
|
22
|
+
return <div className={cn("mx-auto w-full px-5 pt-8 pb-24 @xl:px-8 @xl:pt-12 @4xl:px-12", WIDTHS[width], className)} {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* A page's name at the display size, the line under it, and room on the right for
|
|
26
|
+
its actions. */
|
|
27
|
+
export function PageHeader({
|
|
28
|
+
title,
|
|
29
|
+
lead,
|
|
30
|
+
note,
|
|
31
|
+
actions,
|
|
32
|
+
className,
|
|
33
|
+
}: {
|
|
34
|
+
title: ReactNode;
|
|
35
|
+
lead?: ReactNode;
|
|
36
|
+
note?: ReactNode;
|
|
37
|
+
actions?: ReactNode;
|
|
38
|
+
className?: string;
|
|
39
|
+
}) {
|
|
40
|
+
return (
|
|
41
|
+
<header className={cn("flex flex-wrap items-end gap-x-4 gap-y-3 mb-8", className)}>
|
|
42
|
+
{/* min-w-min: it will not shrink below its longest word, so on a narrow
|
|
43
|
+
screen the actions wrap to the next line rather than the title
|
|
44
|
+
breaking mid-word. (endgame) */}
|
|
45
|
+
<div className="flex-1 min-w-min">
|
|
46
|
+
<h1 className="text-display text-ink text-balance">{title}</h1>
|
|
47
|
+
{lead !== undefined && <p className="mt-2 text-ink-secondary">{lead}</p>}
|
|
48
|
+
{note !== undefined && <p className="mt-2 max-w-2xl text-ink-tertiary text-sm">{note}</p>}
|
|
49
|
+
</div>
|
|
50
|
+
{actions !== undefined && <div className="flex items-center gap-1 pb-1 shrink-0">{actions}</div>}
|
|
51
|
+
</header>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* A titled part of a page, with an optional link or button beside the title.
|
|
56
|
+
From endgame, 2026-12-05. */
|
|
57
|
+
export function Section({
|
|
58
|
+
title,
|
|
59
|
+
aside,
|
|
60
|
+
children,
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: Omit<ComponentPropsWithoutRef<"section">, "title"> & { title: ReactNode; aside?: ReactNode }) {
|
|
64
|
+
return (
|
|
65
|
+
<section className={cn("min-w-0", className)} {...props}>
|
|
66
|
+
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 mb-2">
|
|
67
|
+
<h2 className="flex-1 min-w-0 text-h3">{title}</h2>
|
|
68
|
+
{aside}
|
|
69
|
+
</div>
|
|
70
|
+
{children}
|
|
71
|
+
</section>
|
|
72
|
+
);
|
|
73
|
+
}
|