@kujoforall/paper-ui 0.1.0 → 0.2.1
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 +94 -0
- package/README.md +50 -7
- package/dist/components/editor/block-text.d.ts.map +1 -1
- package/dist/components/editor/block-text.js +52 -17
- package/dist/components/editor/block-text.js.map +1 -1
- package/dist/components/editor/blocks.d.ts.map +1 -1
- package/dist/components/editor/blocks.js +17 -13
- package/dist/components/editor/blocks.js.map +1 -1
- package/dist/components/editor/document-editor.d.ts.map +1 -1
- package/dist/components/editor/document-editor.js +4 -2
- package/dist/components/editor/document-editor.js.map +1 -1
- package/dist/components/editor/document-view.d.ts.map +1 -1
- package/dist/components/editor/document-view.js +17 -12
- package/dist/components/editor/document-view.js.map +1 -1
- package/dist/components/editor/editor-state.d.ts +7 -0
- package/dist/components/editor/editor-state.d.ts.map +1 -1
- package/dist/components/editor/editor-state.js +28 -3
- package/dist/components/editor/editor-state.js.map +1 -1
- 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.map +1 -1
- package/dist/components/editor/extensions/spoiler.js +2 -2
- package/dist/components/editor/extensions/spoiler.js.map +1 -1
- package/dist/components/editor/index.d.ts +1 -0
- package/dist/components/editor/index.d.ts.map +1 -1
- package/dist/components/editor/index.js +1 -0
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/editor/kinds.js +1 -1
- package/dist/components/editor/kinds.js.map +1 -1
- 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/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.js +1 -1
- package/dist/components/ui/accent-picker.js.map +1 -1
- 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 +1 -0
- package/dist/components/ui/app-shell.d.ts.map +1 -1
- package/dist/components/ui/app-shell.js +5 -3
- package/dist/components/ui/app-shell.js.map +1 -1
- 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 +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/badge.js.map +1 -1
- 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.js +1 -1
- package/dist/components/ui/breadcrumbs.js.map +1 -1
- package/dist/components/ui/button.d.ts +8 -6
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +91 -26
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +6 -5
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/callout.d.ts +23 -4
- package/dist/components/ui/callout.d.ts.map +1 -1
- package/dist/components/ui/callout.js +28 -15
- package/dist/components/ui/callout.js.map +1 -1
- package/dist/components/ui/card.d.ts +13 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +10 -9
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +9 -4
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +25 -5
- package/dist/components/ui/checkbox.js.map +1 -1
- 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 +5 -2
- package/dist/components/ui/command-menu.d.ts.map +1 -1
- package/dist/components/ui/command-menu.js +31 -6
- package/dist/components/ui/command-menu.js.map +1 -1
- 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 +6 -1
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/date-picker.js +20 -12
- package/dist/components/ui/date-picker.js.map +1 -1
- package/dist/components/ui/date-time-picker.d.ts +3 -1
- package/dist/components/ui/date-time-picker.d.ts.map +1 -1
- package/dist/components/ui/date-time-picker.js +17 -15
- package/dist/components/ui/date-time-picker.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +13 -9
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +33 -3
- package/dist/components/ui/dialog.js.map +1 -1
- 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 +14 -10
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +22 -13
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/editable-text.d.ts +9 -2
- package/dist/components/ui/editable-text.d.ts.map +1 -1
- package/dist/components/ui/editable-text.js +27 -10
- package/dist/components/ui/editable-text.js.map +1 -1
- 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 +2 -1
- package/dist/components/ui/field-button.d.ts.map +1 -1
- package/dist/components/ui/field-button.js +7 -5
- package/dist/components/ui/field-button.js.map +1 -1
- package/dist/components/ui/file-preview.js +1 -1
- package/dist/components/ui/file-preview.js.map +1 -1
- package/dist/components/ui/file-uploader.d.ts.map +1 -1
- package/dist/components/ui/file-uploader.js +5 -4
- package/dist/components/ui/file-uploader.js.map +1 -1
- 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 +11 -1
- package/dist/components/ui/handle-row.d.ts.map +1 -1
- package/dist/components/ui/handle-row.js +101 -32
- package/dist/components/ui/handle-row.js.map +1 -1
- 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.js +4 -4
- package/dist/components/ui/image-block.js.map +1 -1
- package/dist/components/ui/image-card.d.ts.map +1 -1
- package/dist/components/ui/image-card.js +5 -4
- package/dist/components/ui/image-card.js.map +1 -1
- 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.map +1 -1
- package/dist/components/ui/image-viewer.js +38 -5
- package/dist/components/ui/image-viewer.js.map +1 -1
- package/dist/components/ui/image.d.ts +25 -3
- package/dist/components/ui/image.d.ts.map +1 -1
- package/dist/components/ui/image.js +50 -21
- package/dist/components/ui/image.js.map +1 -1
- package/dist/components/ui/index.d.ts +54 -11
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +53 -10
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/input.d.ts +71 -12
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +236 -23
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/link-block.d.ts.map +1 -1
- package/dist/components/ui/link-block.js +1 -1
- package/dist/components/ui/link-block.js.map +1 -1
- 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.js +1 -1
- package/dist/components/ui/mac-card.js.map +1 -1
- 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.map +1 -1
- package/dist/components/ui/nav-tree.js +10 -3
- package/dist/components/ui/nav-tree.js.map +1 -1
- package/dist/components/ui/page.d.ts +16 -5
- package/dist/components/ui/page.d.ts.map +1 -1
- package/dist/components/ui/page.js +23 -10
- package/dist/components/ui/page.js.map +1 -1
- 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 +2 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +11 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +17 -4
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/property.d.ts +2 -6
- package/dist/components/ui/property.d.ts.map +1 -1
- package/dist/components/ui/property.js +6 -22
- package/dist/components/ui/property.js.map +1 -1
- 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 +15 -7
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +8 -6
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select-menu.d.ts +3 -1
- package/dist/components/ui/select-menu.d.ts.map +1 -1
- package/dist/components/ui/select-menu.js +2 -2
- package/dist/components/ui/select-menu.js.map +1 -1
- package/dist/components/ui/select.d.ts +7 -2
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +19 -5
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/selection-bar.js +1 -1
- package/dist/components/ui/selection-bar.js.map +1 -1
- 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.map +1 -1
- package/dist/components/ui/spotlight.js +14 -11
- package/dist/components/ui/spotlight.js.map +1 -1
- package/dist/components/ui/step-dialog.js +3 -3
- package/dist/components/ui/step-dialog.js.map +1 -1
- 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 +13 -5
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +65 -12
- package/dist/components/ui/table.js.map +1 -1
- 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 +14 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme-toggle.js +69 -41
- package/dist/components/ui/theme-toggle.js.map +1 -1
- 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 +37 -11
- package/dist/components/ui/time-picker.d.ts.map +1 -1
- package/dist/components/ui/time-picker.js +130 -52
- package/dist/components/ui/time-picker.js.map +1 -1
- 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 +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- 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 +11 -5
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/components/ui/typography.js +31 -5
- package/dist/components/ui/typography.js.map +1 -1
- package/dist/components/ui/video-block.d.ts.map +1 -1
- package/dist/components/ui/video-block.js +5 -1
- package/dist/components/ui/video-block.js.map +1 -1
- 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.map +1 -1
- package/dist/hooks/use-save-queue.js +19 -7
- package/dist/hooks/use-save-queue.js.map +1 -1
- package/dist/hooks/use-selection.d.ts.map +1 -1
- package/dist/hooks/use-selection.js +10 -1
- package/dist/hooks/use-selection.js.map +1 -1
- 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 +16 -0
- package/dist/lib/dates.d.ts.map +1 -1
- package/dist/lib/dates.js +27 -0
- package/dist/lib/dates.js.map +1 -1
- 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 +2 -0
- package/dist/lib/rich-text-dom.d.ts.map +1 -1
- package/dist/lib/rich-text-dom.js +5 -3
- package/dist/lib/rich-text-dom.js.map +1 -1
- 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/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +20 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles/notion.css +342 -51
- package/package.json +27 -4
- package/src/components/editor/block-text.tsx +58 -17
- package/src/components/editor/blocks.tsx +19 -14
- package/src/components/editor/document-editor.tsx +7 -2
- package/src/components/editor/document-view.tsx +37 -24
- package/src/components/editor/editor-state.tsx +31 -3
- package/src/components/editor/extensions/kit-blocks.tsx +452 -0
- package/src/components/editor/extensions/spoiler.tsx +9 -4
- package/src/components/editor/index.ts +1 -0
- package/src/components/editor/kinds.ts +1 -1
- package/src/components/editor/look.tsx +36 -0
- package/src/components/three/model-viewer.tsx +514 -0
- package/src/components/ui/accent-picker.tsx +2 -2
- 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 +9 -7
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +4 -4
- package/src/components/ui/banner.tsx +53 -0
- package/src/components/ui/breadcrumbs.tsx +1 -1
- package/src/components/ui/button.tsx +115 -41
- package/src/components/ui/calendar.tsx +8 -7
- package/src/components/ui/callout.tsx +41 -42
- package/src/components/ui/card.tsx +27 -58
- package/src/components/ui/checkbox.tsx +53 -19
- 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 +61 -31
- 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 +99 -61
- package/src/components/ui/date-time-picker.tsx +68 -62
- package/src/components/ui/dialog.tsx +48 -21
- package/src/components/ui/document-layout.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +33 -31
- package/src/components/ui/editable-text.tsx +40 -7
- 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 +11 -9
- package/src/components/ui/file-preview.tsx +1 -1
- package/src/components/ui/file-uploader.tsx +23 -24
- 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 +176 -40
- 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 +6 -6
- package/src/components/ui/image-card.tsx +18 -25
- package/src/components/ui/image-framer.tsx +160 -0
- package/src/components/ui/image-viewer.tsx +53 -10
- package/src/components/ui/image.tsx +133 -29
- package/src/components/ui/index.ts +106 -11
- package/src/components/ui/input.tsx +437 -65
- package/src/components/ui/link-block.tsx +5 -2
- package/src/components/ui/list-detail.tsx +115 -0
- package/src/components/ui/listbox.ts +26 -0
- package/src/components/ui/mac-card.tsx +5 -5
- 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 +11 -5
- package/src/components/ui/page.tsx +63 -15
- package/src/components/ui/pagination.tsx +143 -0
- package/src/components/ui/picker-panel.tsx +69 -0
- package/src/components/ui/popover.tsx +3 -3
- package/src/components/ui/progress.tsx +56 -16
- package/src/components/ui/property.tsx +6 -37
- 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 +48 -16
- package/src/components/ui/select-menu.tsx +11 -3
- package/src/components/ui/select.tsx +33 -10
- package/src/components/ui/selection-bar.tsx +1 -1
- 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 +21 -21
- package/src/components/ui/step-dialog.tsx +6 -6
- package/src/components/ui/steps-layout.tsx +91 -0
- package/src/components/ui/switch.tsx +55 -0
- package/src/components/ui/table.tsx +75 -18
- package/src/components/ui/tabs.tsx +41 -0
- package/src/components/ui/theme-toggle.tsx +74 -83
- package/src/components/ui/time-list.tsx +106 -0
- package/src/components/ui/time-picker.tsx +305 -134
- package/src/components/ui/toast.tsx +132 -0
- package/src/components/ui/toggle.tsx +76 -0
- package/src/components/ui/tooltip.tsx +20 -6
- package/src/components/ui/top-bar.tsx +118 -0
- package/src/components/ui/typography.tsx +45 -9
- package/src/components/ui/video-block.tsx +9 -3
- 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 +19 -7
- package/src/hooks/use-selection.ts +8 -1
- package/src/lib/database.ts +322 -0
- package/src/lib/dates.ts +36 -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 +5 -3
- package/src/lib/theme.ts +18 -0
- package/src/lib/time.ts +83 -0
- package/src/lib/utils.ts +21 -2
- package/src/styles/notion.css +342 -51
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect, useRef, useState, type ReactNode } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.ts";
|
|
5
|
+
|
|
6
|
+
/* Holds content whose height changes all at once (a filtered list, say) and eases
|
|
7
|
+
between the old height and the new one, so what is below it glides instead of
|
|
8
|
+
jumping. The content sizes itself; this only follows it. Still for anyone who
|
|
9
|
+
asks for less motion.
|
|
10
|
+
|
|
11
|
+
From endgame and medialogue, 2026-12-05. */
|
|
12
|
+
export function AnimatedHeight({ children, className }: { children: ReactNode; className?: string }) {
|
|
13
|
+
const inner = useRef<HTMLDivElement>(null);
|
|
14
|
+
const [height, setHeight] = useState<number>();
|
|
15
|
+
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
const el = inner.current;
|
|
18
|
+
if (!el) return;
|
|
19
|
+
const measure = () => setHeight(el.offsetHeight);
|
|
20
|
+
measure();
|
|
21
|
+
const observer = new ResizeObserver(measure);
|
|
22
|
+
observer.observe(el);
|
|
23
|
+
return () => observer.disconnect();
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
style={{ height }}
|
|
29
|
+
className={cn("overflow-hidden transition-[height] duration-(--duration-slow) ease-out-notion motion-reduce:transition-none", className)}
|
|
30
|
+
>
|
|
31
|
+
<div ref={inner}>{children}</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState, type ReactNode } from "react";
|
|
4
4
|
import { cn } from "../../lib/utils.ts";
|
|
5
|
+
import { matchShortcut } from "../../lib/keys.ts";
|
|
5
6
|
|
|
6
7
|
const TOGGLE_SIDEBAR = "ui:toggle-sidebar";
|
|
7
8
|
|
|
@@ -26,6 +27,7 @@ export type ShellControls = {
|
|
|
26
27
|
|
|
27
28
|
`main` is a container: size content to the room it actually has with container
|
|
28
29
|
variants (`@6xl:max-w-…`), which account for the sidebar being open or shut. */
|
|
30
|
+
/** @deprecated Use SidebarProvider, Sidebar and SidebarInset (docs/layouts/sidebar.md). AppShell goes at 1.0. */
|
|
29
31
|
export function AppShell({
|
|
30
32
|
sidebar,
|
|
31
33
|
topbar,
|
|
@@ -44,7 +46,7 @@ export function AppShell({
|
|
|
44
46
|
|
|
45
47
|
useEffect(() => {
|
|
46
48
|
const onKey = (e: KeyboardEvent) => {
|
|
47
|
-
if ((e
|
|
49
|
+
if (matchShortcut(e, "mod+\\")) {
|
|
48
50
|
e.preventDefault();
|
|
49
51
|
setOpen((o) => !o);
|
|
50
52
|
}
|
|
@@ -79,7 +81,7 @@ export function AppShell({
|
|
|
79
81
|
<div className="flex h-dvh">
|
|
80
82
|
<div
|
|
81
83
|
className={cn(
|
|
82
|
-
"hidden shrink-0 overflow-hidden transition-[width] duration-
|
|
84
|
+
"hidden shrink-0 overflow-hidden transition-[width] duration-(--duration-base) ease-out-notion md:block",
|
|
83
85
|
open ? "w-60" : "w-0",
|
|
84
86
|
)}
|
|
85
87
|
inert={!open}
|
|
@@ -87,14 +89,14 @@ export function AppShell({
|
|
|
87
89
|
{sidebar(desktop)}
|
|
88
90
|
</div>
|
|
89
91
|
|
|
90
|
-
<div className={cn("fixed inset-0 z-
|
|
92
|
+
<div className={cn("fixed inset-0 z-(--z-overlay) md:hidden", !drawer && "pointer-events-none")} inert={!drawer}>
|
|
91
93
|
<div
|
|
92
|
-
className={cn("absolute inset-0 bg-
|
|
94
|
+
className={cn("absolute inset-0 bg-scrim transition-opacity duration-(--duration-base)", drawer ? "opacity-100" : "opacity-0")}
|
|
93
95
|
onClick={() => setDrawer(false)}
|
|
94
96
|
/>
|
|
95
97
|
<div
|
|
96
98
|
className={cn(
|
|
97
|
-
"absolute inset-y-0 left-0 transition-transform duration-
|
|
99
|
+
"absolute inset-y-0 left-0 transition-transform duration-(--duration-base) ease-out-notion",
|
|
98
100
|
// The shadow would otherwise spill onto the page from off-screen.
|
|
99
101
|
drawer ? "translate-x-0 shadow-dialog" : "-translate-x-full",
|
|
100
102
|
)}
|
|
@@ -119,10 +121,10 @@ export function AppShell({
|
|
|
119
121
|
in the header can stay hidden until the sidebar is hovered. */
|
|
120
122
|
export function SidebarFrame({ header, footer, children, label }: { header?: ReactNode; footer?: ReactNode; children: ReactNode; label: string }) {
|
|
121
123
|
return (
|
|
122
|
-
<nav aria-label={label} className="group/sidebar flex h-full w-60 flex-col bg-surface-sunken shadow-
|
|
124
|
+
<nav aria-label={label} className="group/sidebar flex h-full w-60 flex-col bg-surface-sunken shadow-edge-r">
|
|
123
125
|
{header && <div className="flex h-11 shrink-0 items-center gap-2 pr-2 pl-3">{header}</div>}
|
|
124
126
|
<div className="min-h-0 flex-1 overflow-y-auto px-1 pb-6">{children}</div>
|
|
125
|
-
{footer && <div className="shrink-0 p-1 shadow-
|
|
127
|
+
{footer && <div className="shrink-0 p-1 shadow-edge-t">{footer}</div>}
|
|
126
128
|
</nav>
|
|
127
129
|
);
|
|
128
130
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, type ComponentProps } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.ts";
|
|
5
|
+
import { tagColorFor, type TagColor } from "./badge.tsx";
|
|
6
|
+
|
|
7
|
+
/* A person (or a workspace) as a small round picture, or their initials on one of
|
|
8
|
+
the nine when there is no picture or it fails to load. The colour comes from the
|
|
9
|
+
name (tagColorFor), so a person keeps theirs everywhere. Named for a screen
|
|
10
|
+
reader by `name`; pass `decorative` when the name is written right beside it. */
|
|
11
|
+
|
|
12
|
+
const SIZES = {
|
|
13
|
+
xs: "size-5 text-micro",
|
|
14
|
+
sm: "size-6 text-micro",
|
|
15
|
+
md: "size-8 text-caption",
|
|
16
|
+
lg: "size-10 text-sm",
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
const TAG_CLASS: Record<TagColor, string> = {
|
|
20
|
+
gray: "bg-tag-gray-bg text-tag-gray-ink",
|
|
21
|
+
brown: "bg-tag-brown-bg text-tag-brown-ink",
|
|
22
|
+
orange: "bg-tag-orange-bg text-tag-orange-ink",
|
|
23
|
+
yellow: "bg-tag-yellow-bg text-tag-yellow-ink",
|
|
24
|
+
green: "bg-tag-green-bg text-tag-green-ink",
|
|
25
|
+
blue: "bg-tag-blue-bg text-tag-blue-ink",
|
|
26
|
+
purple: "bg-tag-purple-bg text-tag-purple-ink",
|
|
27
|
+
pink: "bg-tag-pink-bg text-tag-pink-ink",
|
|
28
|
+
red: "bg-tag-red-bg text-tag-red-ink",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** "Ada Lovelace" → "AL"; "ada@example.com" → "A"; "" → "?". */
|
|
32
|
+
export function initials(name: string): string {
|
|
33
|
+
const words = name.replace(/@.*/, "").split(/[\s._-]+/).filter(Boolean);
|
|
34
|
+
if (words.length === 0) return "?";
|
|
35
|
+
const letters = words.length === 1 ? words[0].slice(0, 1) : words[0].slice(0, 1) + words[words.length - 1].slice(0, 1);
|
|
36
|
+
return letters.toUpperCase();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type AvatarProps = Omit<ComponentProps<"span">, "children"> & {
|
|
40
|
+
name: string;
|
|
41
|
+
src?: string | null;
|
|
42
|
+
size?: keyof typeof SIZES;
|
|
43
|
+
/** A workspace or a thing: a rounded square, not a circle. */
|
|
44
|
+
square?: boolean;
|
|
45
|
+
/** The name is written beside it, so a screen reader need not hear it twice. */
|
|
46
|
+
decorative?: boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function Avatar({ name, src, size = "md", square = false, decorative = false, className, ...props }: AvatarProps) {
|
|
50
|
+
const [failed, setFailed] = useState<string | null>(null);
|
|
51
|
+
const showPicture = src && failed !== src;
|
|
52
|
+
return (
|
|
53
|
+
<span
|
|
54
|
+
role={decorative ? undefined : "img"}
|
|
55
|
+
aria-label={decorative ? undefined : name}
|
|
56
|
+
aria-hidden={decorative || undefined}
|
|
57
|
+
className={cn(
|
|
58
|
+
"inline-flex relative justify-center items-center overflow-hidden font-semibold leading-none select-none shrink-0",
|
|
59
|
+
square ? "rounded-small" : "rounded-full",
|
|
60
|
+
SIZES[size],
|
|
61
|
+
!showPicture && TAG_CLASS[tagColorFor(name)],
|
|
62
|
+
className,
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
{showPicture ? (
|
|
67
|
+
<img src={src} alt="" draggable={false} onError={() => setFailed(src)} className="size-full object-cover" />
|
|
68
|
+
) : (
|
|
69
|
+
initials(name)
|
|
70
|
+
)}
|
|
71
|
+
</span>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Several people at once, overlapping, each ringed in the page's colour so the
|
|
76
|
+
edges read. More than `max` and the rest become "+n". Named as a whole: "Ada,
|
|
77
|
+
Grace and 3 others". */
|
|
78
|
+
export function AvatarStack({
|
|
79
|
+
people,
|
|
80
|
+
max = 4,
|
|
81
|
+
size = "sm",
|
|
82
|
+
className,
|
|
83
|
+
}: {
|
|
84
|
+
people: readonly { name: string; src?: string | null }[];
|
|
85
|
+
max?: number;
|
|
86
|
+
size?: keyof typeof SIZES;
|
|
87
|
+
className?: string;
|
|
88
|
+
}) {
|
|
89
|
+
const shown = people.slice(0, people.length > max ? max - 1 : max);
|
|
90
|
+
const rest = people.length - shown.length;
|
|
91
|
+
const names = shown.map((p) => p.name.split(" ")[0]);
|
|
92
|
+
const label =
|
|
93
|
+
rest > 0 ? `${names.join(", ")} and ${rest} other${rest === 1 ? "" : "s"}` : names.length > 1 ? `${names.slice(0, -1).join(", ")} and ${names.at(-1)}` : (names[0] ?? "");
|
|
94
|
+
return (
|
|
95
|
+
<span role="img" aria-label={label} className={cn("inline-flex items-center", className)}>
|
|
96
|
+
{shown.map((p, i) => (
|
|
97
|
+
<Avatar key={`${p.name}-${i}`} name={p.name} src={p.src} size={size} decorative className={cn("ring-2 ring-surface", i > 0 && "-ml-1.5")} />
|
|
98
|
+
))}
|
|
99
|
+
{rest > 0 && (
|
|
100
|
+
<span aria-hidden 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])}>
|
|
101
|
+
+{rest}
|
|
102
|
+
</span>
|
|
103
|
+
)}
|
|
104
|
+
</span>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
import { cn } from "../../lib/utils.ts";
|
|
4
4
|
|
|
5
5
|
/* ────────────────────────────────────────────────────────────────────────
|
|
@@ -28,7 +28,7 @@ export const TAG_COLORS = [
|
|
|
28
28
|
export type TagColor = (typeof TAG_COLORS)[number];
|
|
29
29
|
|
|
30
30
|
const badgeVariants = cva(
|
|
31
|
-
"inline-flex items-center gap-1 rounded-
|
|
31
|
+
"inline-flex items-center gap-1 rounded-small font-medium whitespace-nowrap [&_svg]:size-3 [&_svg]:shrink-0",
|
|
32
32
|
{
|
|
33
33
|
variants: {
|
|
34
34
|
color: {
|
|
@@ -43,7 +43,7 @@ const badgeVariants = cva(
|
|
|
43
43
|
red: "bg-tag-red-bg text-tag-red-ink",
|
|
44
44
|
},
|
|
45
45
|
size: {
|
|
46
|
-
sm: "h-
|
|
46
|
+
sm: "h-4.5 px-1.5 text-micro",
|
|
47
47
|
md: "h-5 px-2 text-caption",
|
|
48
48
|
},
|
|
49
49
|
},
|
|
@@ -52,7 +52,7 @@ const badgeVariants = cva(
|
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
export interface BadgeProps
|
|
55
|
-
extends Omit<
|
|
55
|
+
extends Omit<ComponentProps<"span">, "color">,
|
|
56
56
|
VariantProps<typeof badgeVariants> {}
|
|
57
57
|
|
|
58
58
|
export function Badge({ className, color, size, ...props }: BadgeProps) {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { CircleAlert, Info, TriangleAlert, WifiOff, X } from "lucide-react";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.ts";
|
|
6
|
+
import { Button } from "./button.tsx";
|
|
7
|
+
|
|
8
|
+
/* A message about the whole page, across its top: you are offline, this is
|
|
9
|
+
read-only, a trial ends soon. Not a Toast (that passes) nor a Callout (that is
|
|
10
|
+
part of the content). One line, an action at the end, and a close if it may be
|
|
11
|
+
dismissed. A status to a screen reader (`alert` for danger). */
|
|
12
|
+
const TONES = {
|
|
13
|
+
info: { bg: "bg-tag-blue-bg", icon: Info, ink: "text-info" },
|
|
14
|
+
warning: { bg: "bg-tag-yellow-bg", icon: TriangleAlert, ink: "text-warning" },
|
|
15
|
+
danger: { bg: "bg-tag-red-bg", icon: CircleAlert, ink: "text-danger" },
|
|
16
|
+
offline: { bg: "bg-tag-gray-bg", icon: WifiOff, ink: "text-ink-secondary" },
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export function Banner({
|
|
20
|
+
tone = "info",
|
|
21
|
+
children,
|
|
22
|
+
action,
|
|
23
|
+
onDismiss,
|
|
24
|
+
icon,
|
|
25
|
+
className,
|
|
26
|
+
}: {
|
|
27
|
+
tone?: keyof typeof TONES;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
action?: ReactNode;
|
|
30
|
+
onDismiss?: () => void;
|
|
31
|
+
icon?: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}) {
|
|
34
|
+
const t = TONES[tone];
|
|
35
|
+
const Icon = t.icon;
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
role={tone === "danger" ? "alert" : "status"}
|
|
39
|
+
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)}
|
|
40
|
+
>
|
|
41
|
+
<span aria-hidden className={cn("[&_svg]:size-4 shrink-0", t.ink)}>
|
|
42
|
+
{icon ?? <Icon />}
|
|
43
|
+
</span>
|
|
44
|
+
<div className="flex-1 min-w-[min(12rem,70%)]">{children}</div>
|
|
45
|
+
{action !== undefined && <div className="flex items-center gap-1 shrink-0">{action}</div>}
|
|
46
|
+
{onDismiss && (
|
|
47
|
+
<Button variant="ghost" size="icon-sm" aria-label="Dismiss" onClick={onDismiss} className="-mr-2 shrink-0">
|
|
48
|
+
<X />
|
|
49
|
+
</Button>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -12,7 +12,7 @@ export function Breadcrumbs({ crumbs, link: Link = "a" }: { crumbs: Crumb[]; lin
|
|
|
12
12
|
<Fragment key={i}>
|
|
13
13
|
{i > 0 && <span className="px-0.5 text-ink-tertiary">/</span>}
|
|
14
14
|
{crumb.href ? (
|
|
15
|
-
<Link href={crumb.href} className="truncate rounded-control px-1.5 py-0.5 transition-colors duration-
|
|
15
|
+
<Link href={crumb.href} className="truncate rounded-control px-1.5 py-0.5 transition-colors duration-(--duration-fast) hover:bg-tint-hover">
|
|
16
16
|
{crumb.title}
|
|
17
17
|
</Link>
|
|
18
18
|
) : (
|
|
@@ -2,71 +2,145 @@
|
|
|
2
2
|
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
-
import type
|
|
5
|
+
import { Children, isValidElement, type ComponentProps, type ReactNode } from "react";
|
|
6
6
|
import { cn } from "../../lib/utils.ts";
|
|
7
|
+
import { Spinner } from "./spinner.tsx";
|
|
7
8
|
|
|
8
|
-
/* Buttons are small (28–
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/* Buttons are small (28–40px), lightly weighted and 4px-rounded. The loudest thing a
|
|
10
|
+
Notion button ever does is fill with the accent, and only one button per view
|
|
11
|
+
earns that. Everything else is a tint.
|
|
12
|
+
|
|
13
|
+
Every variant has its rest, hover, pressed, focus (the kit's ring) and disabled
|
|
14
|
+
look; a filled one's white text passes WCAG AA on every colour theme because it
|
|
15
|
+
sits on the deeper `-solid` fill. A link styled as a button is disabled with
|
|
16
|
+
aria-disabled, which looks and behaves the same. */
|
|
11
17
|
|
|
12
18
|
const buttonVariants = cva(
|
|
13
19
|
[
|
|
14
|
-
"inline-flex items-center justify-center gap-1.5 shrink-0",
|
|
20
|
+
"inline-flex items-center justify-center gap-1.5 shrink-0 min-w-0 max-w-full relative",
|
|
15
21
|
"rounded-control font-medium whitespace-nowrap select-none",
|
|
16
|
-
"transition-[background-color,box-shadow,
|
|
17
|
-
|
|
22
|
+
"transition-[background-color,box-shadow,color] duration-(--duration-fast) ease-out-notion",
|
|
23
|
+
// Written out in full, so Tailwind finds them.
|
|
24
|
+
"disabled:pointer-events-none disabled:text-ink-disabled aria-disabled:pointer-events-none aria-disabled:text-ink-disabled",
|
|
18
25
|
"[&_svg]:shrink-0 [&_svg]:pointer-events-none",
|
|
19
26
|
],
|
|
20
27
|
{
|
|
21
28
|
variants: {
|
|
22
29
|
variant: {
|
|
23
|
-
/** The one loud option.
|
|
24
|
-
primary:
|
|
25
|
-
"bg-accent text-accent-ink hover:bg-accent-hover
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
/** The one loud option. At most one per view. */
|
|
31
|
+
primary: [
|
|
32
|
+
"bg-accent-solid text-accent-ink hover:bg-accent-solid-hover active:bg-accent-solid-active",
|
|
33
|
+
"disabled:bg-tint-active aria-disabled:bg-tint-active",
|
|
34
|
+
],
|
|
35
|
+
/** The workhorse: the page's surface, a hairline ring, a whisper of lift. */
|
|
36
|
+
secondary: "bg-surface text-ink shadow-xs hover:bg-tint-hover active:bg-tint-active",
|
|
37
|
+
/** Invisible until hovered: toolbars, a row's actions. */
|
|
38
|
+
ghost: "text-ink hover:bg-tint-hover active:bg-tint-active",
|
|
39
|
+
/** Already tinted, for a second action that needs weight. */
|
|
40
|
+
subtle: "bg-tint-hover text-ink hover:bg-tint-active active:bg-tint-active active:shadow-edge",
|
|
41
|
+
/** Cannot be undone. Filled, like primary, so it is never the quiet choice. */
|
|
42
|
+
danger: [
|
|
43
|
+
"bg-danger-solid text-danger-ink hover:bg-danger-solid-hover active:bg-danger-solid-active",
|
|
44
|
+
"disabled:bg-tint-active aria-disabled:bg-tint-active",
|
|
45
|
+
],
|
|
46
|
+
/** Cannot be undone, in a menu or a row where a fill would shout. */
|
|
47
|
+
"danger-ghost": "text-danger hover:bg-danger-tint active:bg-danger-tint active:shadow-edge",
|
|
48
|
+
/** Over a picture: round, dark and blurred, so it reads against a bright sky as well as a dark one. */
|
|
49
|
+
"on-media": "rounded-full bg-on-media text-on-media-ink backdrop-blur-sm hover:bg-on-media-strong active:scale-90 transition-[opacity,scale,background-color]",
|
|
50
|
+
/** Words in a sentence that act. */
|
|
51
|
+
link: "link text-ink px-0! h-auto!",
|
|
37
52
|
},
|
|
38
53
|
size: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
/* A leading icon carries its own empty margin, so the left of the
|
|
55
|
+
button reads as roomier than the right. A little more on the right
|
|
56
|
+
evens the two out. */
|
|
57
|
+
sm: "h-control-sm px-2 text-sm [&_svg]:size-3.5 has-[>svg:first-child]:pr-2.5",
|
|
58
|
+
md: "h-control-md px-3 text-sm [&_svg]:size-4 has-[>svg:first-child]:pr-3.5",
|
|
59
|
+
lg: "h-control-lg px-4 text-body [&_svg]:size-4 has-[>svg:first-child]:pr-5",
|
|
60
|
+
/** Icon only, at each control height. Name it with aria-label. */
|
|
61
|
+
"icon-sm": "size-control-sm [&_svg]:size-3.5",
|
|
62
|
+
icon: "size-control-md [&_svg]:size-4",
|
|
63
|
+
"icon-lg": "size-control-lg [&_svg]:size-5",
|
|
44
64
|
},
|
|
45
65
|
},
|
|
46
66
|
defaultVariants: { variant: "secondary", size: "md" },
|
|
47
67
|
},
|
|
48
68
|
);
|
|
49
69
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
/* The colour a spinner takes in place of the label, per variant. */
|
|
71
|
+
const SPINNER_INK: Record<string, string> = {
|
|
72
|
+
primary: "text-accent-ink",
|
|
73
|
+
danger: "text-danger-ink",
|
|
74
|
+
"danger-ghost": "text-danger",
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export interface ButtonProps extends ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
78
|
+
/** Render as the single child element (a router's link) instead of a <button>. */
|
|
54
79
|
asChild?: boolean;
|
|
80
|
+
/** Working: a spinner in place of the label, the width kept, presses ignored. */
|
|
81
|
+
loading?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* A label is wrapped so a long one can shorten with an ellipsis instead of pushing
|
|
85
|
+
out of its container; icons stay direct children for the padding rule above.
|
|
86
|
+
Neighbouring words ("Upload", 3, "photos") share one span: as separate flex
|
|
87
|
+
items the spaces between them would collapse. */
|
|
88
|
+
function labelled(children: ReactNode): ReactNode {
|
|
89
|
+
const out: ReactNode[] = [];
|
|
90
|
+
let words: (string | number)[] = [];
|
|
91
|
+
const flush = () => {
|
|
92
|
+
if (words.length) out.push(<span key={`label-${out.length}`} className="min-w-0 truncate">{words.join("")}</span>);
|
|
93
|
+
words = [];
|
|
94
|
+
};
|
|
95
|
+
// toArray drops empty children and keys the rest, so the list needs no keys of its own.
|
|
96
|
+
for (const child of Children.toArray(children)) {
|
|
97
|
+
if (typeof child === "string" || typeof child === "number") words.push(child);
|
|
98
|
+
else {
|
|
99
|
+
flush();
|
|
100
|
+
out.push(child);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
flush();
|
|
104
|
+
return out;
|
|
55
105
|
}
|
|
56
106
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
size
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
107
|
+
declare const process: { env: { NODE_ENV?: string } };
|
|
108
|
+
|
|
109
|
+
export function Button({ className, variant, size, asChild = false, loading = false, type, children, onClick, ...props }: ButtonProps) {
|
|
110
|
+
const iconOnly = typeof size === "string" && size.startsWith("icon");
|
|
111
|
+
if (process.env.NODE_ENV !== "production" && iconOnly && !props["aria-label"] && !props["aria-labelledby"] && !props.title) {
|
|
112
|
+
console.warn("paper-ui: an icon-only Button needs an aria-label (or aria-labelledby, or title) so a screen reader can name it.");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const classes = cn(buttonVariants({ variant, size }), loading && "text-transparent! [&>svg]:invisible", className);
|
|
116
|
+
|
|
117
|
+
if (asChild) {
|
|
118
|
+
const child = Children.only(children);
|
|
119
|
+
return (
|
|
120
|
+
<Slot className={classes} aria-busy={loading || undefined} onClick={onClick} {...props}>
|
|
121
|
+
{isValidElement(child) ? child : children}
|
|
122
|
+
</Slot>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
65
126
|
return (
|
|
66
|
-
<
|
|
67
|
-
|
|
127
|
+
<button
|
|
128
|
+
type={type ?? "button"}
|
|
129
|
+
className={classes}
|
|
130
|
+
aria-busy={loading || undefined}
|
|
131
|
+
data-loading={loading || undefined}
|
|
132
|
+
// Not `disabled` while loading: that would drop focus from the button the
|
|
133
|
+
// person just pressed, and grey it. It ignores presses instead.
|
|
134
|
+
onClick={loading ? (e) => e.preventDefault() : onClick}
|
|
68
135
|
{...props}
|
|
69
|
-
|
|
136
|
+
>
|
|
137
|
+
{labelled(children)}
|
|
138
|
+
{loading && (
|
|
139
|
+
<span className="absolute inset-0 flex justify-center items-center">
|
|
140
|
+
<Spinner className={cn("size-4", SPINNER_INK[variant ?? "secondary"] ?? "text-ink")} />
|
|
141
|
+
</span>
|
|
142
|
+
)}
|
|
143
|
+
</button>
|
|
70
144
|
);
|
|
71
145
|
}
|
|
72
146
|
|
|
@@ -6,7 +6,8 @@ import { DayPicker, type DayButton } from "react-day-picker";
|
|
|
6
6
|
import { cn } from "../../lib/utils.ts";
|
|
7
7
|
|
|
8
8
|
/* A month of days, on react-day-picker: it supplies the grid, the keyboard and the
|
|
9
|
-
screen-reader labels; everything visible is here.
|
|
9
|
+
screen-reader labels; everything visible is here. Days are 32px with a mouse and
|
|
10
|
+
40px on a touch screen (seven of them still fit a 320px phone). Its own stylesheet is not
|
|
10
11
|
imported, so every part it draws has a class below.
|
|
11
12
|
|
|
12
13
|
The week starts on Monday. Pass `weekStartsOn={0}` for Sunday. */
|
|
@@ -28,8 +29,8 @@ export function Calendar({ className, classNames, components, ...props }: Compon
|
|
|
28
29
|
button_previous: NAV_BUTTON,
|
|
29
30
|
button_next: NAV_BUTTON,
|
|
30
31
|
month_grid: "border-collapse",
|
|
31
|
-
weekday: "size-8 p-0 text-caption font-normal text-ink-tertiary",
|
|
32
|
-
day: "size-8 p-0 text-center",
|
|
32
|
+
weekday: "size-8 [@media(pointer:coarse)]:size-10 p-0 text-caption font-normal text-ink-tertiary",
|
|
33
|
+
day: "size-8 [@media(pointer:coarse)]:size-10 p-0 text-center",
|
|
33
34
|
range_start: "rounded-l-control bg-accent-tint",
|
|
34
35
|
range_middle: "bg-accent-tint",
|
|
35
36
|
range_end: "rounded-r-control bg-accent-tint",
|
|
@@ -52,7 +53,7 @@ export function Calendar({ className, classNames, components, ...props }: Compon
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
const NAV_BUTTON =
|
|
55
|
-
"pointer-events-auto inline-flex size-7 items-center justify-center rounded-control text-ink-secondary transition-colors duration-
|
|
56
|
+
"pointer-events-auto inline-flex size-7 [@media(pointer:coarse)]:size-10 items-center justify-center rounded-control text-ink-secondary transition-colors duration-(--duration-fast) hover:bg-tint-hover hover:text-ink aria-disabled:pointer-events-none aria-disabled:text-ink-disabled";
|
|
56
57
|
|
|
57
58
|
/* The day itself. The states are resolved here, in order, rather than as classes on
|
|
58
59
|
the cell, because several hold at once (today, outside the month, chosen) and the
|
|
@@ -73,12 +74,12 @@ function CalendarDayButton({ className, day: _day, modifiers, ...props }: Compon
|
|
|
73
74
|
ref={ref}
|
|
74
75
|
type="button"
|
|
75
76
|
className={cn(
|
|
76
|
-
"inline-flex size-8 items-center justify-center rounded-control text-sm text-ink tabular-nums cursor-pointer",
|
|
77
|
-
"transition-colors duration-
|
|
77
|
+
"inline-flex size-8 [@media(pointer:coarse)]:size-10 items-center justify-center rounded-control text-sm text-ink tabular-nums cursor-pointer",
|
|
78
|
+
"transition-colors duration-(--duration-instant) hover:bg-tint-hover",
|
|
78
79
|
modifiers.outside && "text-ink-tertiary",
|
|
79
80
|
modifiers.today && "font-semibold shadow-[inset_0_0_0_1px_var(--hairline-strong)]",
|
|
80
81
|
inRange && "rounded-none hover:bg-accent-tint",
|
|
81
|
-
chosen && "bg-accent font-medium text-accent-ink shadow-none hover:bg-accent-hover",
|
|
82
|
+
chosen && "bg-accent-solid font-medium text-accent-ink shadow-none hover:bg-accent-solid-hover",
|
|
82
83
|
modifiers.disabled && "pointer-events-none text-ink-disabled shadow-none",
|
|
83
84
|
className,
|
|
84
85
|
)}
|
|
@@ -1,59 +1,58 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import
|
|
2
|
+
import { CircleAlert, CircleCheck, Info, TriangleAlert } from "lucide-react";
|
|
3
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
4
|
import { cn } from "../../lib/utils.ts";
|
|
4
5
|
|
|
5
|
-
/* Notion's callout block
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/* Notion's callout block: a tinted panel with an emoji or icon in the gutter. It
|
|
7
|
+
borrows one of the nine, so a callout never brings a new colour to the page. The
|
|
8
|
+
words are in the page's own ink (on a tinted ground the secondary ink read at
|
|
9
|
+
3.9:1); the icon is decoration and is hidden from assistive technology.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
`tone` is the short way to a status: success, warning, info or danger, each its
|
|
12
|
+
colour and an icon. `color` and `icon` choose freely. A callout is a note
|
|
13
|
+
(role="note"); for something that must be heard at once, a Toast. */
|
|
14
|
+
|
|
15
|
+
const calloutVariants = cva("flex gap-3 p-4 rounded-surface text-ink text-sm leading-prose", {
|
|
16
|
+
variants: {
|
|
17
|
+
color: {
|
|
18
|
+
gray: "bg-tag-gray-bg",
|
|
19
|
+
brown: "bg-tag-brown-bg",
|
|
20
|
+
orange: "bg-tag-orange-bg",
|
|
21
|
+
yellow: "bg-tag-yellow-bg",
|
|
22
|
+
green: "bg-tag-green-bg",
|
|
23
|
+
blue: "bg-tag-blue-bg",
|
|
24
|
+
purple: "bg-tag-purple-bg",
|
|
25
|
+
pink: "bg-tag-pink-bg",
|
|
26
|
+
red: "bg-tag-red-bg",
|
|
24
27
|
},
|
|
25
|
-
defaultVariants: { color: "gray" },
|
|
26
28
|
},
|
|
27
|
-
|
|
29
|
+
defaultVariants: { color: "gray" },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const TONES = {
|
|
33
|
+
success: { color: "green", icon: <CircleCheck className="text-success" /> },
|
|
34
|
+
warning: { color: "yellow", icon: <TriangleAlert className="text-warning" /> },
|
|
35
|
+
info: { color: "blue", icon: <Info className="text-info" /> },
|
|
36
|
+
danger: { color: "red", icon: <CircleAlert className="text-danger" /> },
|
|
37
|
+
} as const;
|
|
28
38
|
|
|
29
|
-
export interface CalloutProps
|
|
30
|
-
|
|
31
|
-
VariantProps<typeof calloutVariants> {
|
|
32
|
-
/** An emoji string or a lucide icon element. */
|
|
39
|
+
export interface CalloutProps extends Omit<ComponentProps<"div">, "color" | "title">, VariantProps<typeof calloutVariants> {
|
|
40
|
+
/** An emoji or an icon. */
|
|
33
41
|
icon?: ReactNode;
|
|
34
42
|
title?: ReactNode;
|
|
43
|
+
tone?: keyof typeof TONES;
|
|
35
44
|
}
|
|
36
45
|
|
|
37
|
-
export function Callout({
|
|
38
|
-
|
|
39
|
-
color,
|
|
40
|
-
icon = "💡",
|
|
41
|
-
title,
|
|
42
|
-
children,
|
|
43
|
-
...props
|
|
44
|
-
}: CalloutProps) {
|
|
46
|
+
export function Callout({ className, color, tone, icon, title, children, ...props }: CalloutProps) {
|
|
47
|
+
const t = tone ? TONES[tone] : undefined;
|
|
45
48
|
return (
|
|
46
|
-
<div className={cn(calloutVariants({ color }), className)} {...props}>
|
|
47
|
-
<span className="flex-shrink-0 mt-px text-
|
|
48
|
-
{icon}
|
|
49
|
+
<div role="note" className={cn(calloutVariants({ color: color ?? t?.color }), className)} {...props}>
|
|
50
|
+
<span aria-hidden className="flex-shrink-0 mt-px text-body leading-snug [&_svg]:size-4 [&_svg]:mt-0.5">
|
|
51
|
+
{icon ?? t?.icon ?? "💡"}
|
|
49
52
|
</span>
|
|
50
53
|
<div className="min-w-0">
|
|
51
|
-
{title &&
|
|
52
|
-
|
|
53
|
-
)}
|
|
54
|
-
<div className="text-ink-secondary [&_p+p]:mt-2">
|
|
55
|
-
{children}
|
|
56
|
-
</div>
|
|
54
|
+
{title && <p className="mb-1 font-semibold">{title}</p>}
|
|
55
|
+
<div className="[&_p+p]:mt-2">{children}</div>
|
|
57
56
|
</div>
|
|
58
57
|
</div>
|
|
59
58
|
);
|