@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Check } from "lucide-react";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
5
6
|
/* A picture as a card: the image is the whole card, and anything else sits on
|
|
6
7
|
top of it in a corner. Rounded, with a slight dim on hover.
|
|
7
8
|
|
|
@@ -13,7 +14,7 @@ import { cn } from "../../lib/utils.js";
|
|
|
13
14
|
Put `group` to use: children can react to `group-hover`, and the corner
|
|
14
15
|
controls made with `ImageCardButton` stay hidden until then. */
|
|
15
16
|
export function ImageCard({ children, topRight, bottomLeft, selecting = false, selected = false, onSelect, className, ...props }) {
|
|
16
|
-
return (_jsxs("div", { className: cn("group relative overflow-hidden rounded-
|
|
17
|
+
return (_jsxs("div", { className: cn("group relative overflow-hidden rounded-overlay bg-surface-sunken transition-[scale,box-shadow] duration-(--duration-base) ease-out-notion", "[&_img]:transition-[filter,opacity,scale] hover:[&_img]:brightness-[0.94]", selecting && selected && "scale-[0.94] shadow-[0_0_0_3px_var(--accent)]", selecting && !selected && "shadow-[0_0_0_0px_var(--accent)]", className),
|
|
17
18
|
// Capture, so the press never reaches a link or button inside.
|
|
18
19
|
onClickCapture: selecting
|
|
19
20
|
? (event) => {
|
|
@@ -21,18 +22,18 @@ export function ImageCard({ children, topRight, bottomLeft, selecting = false, s
|
|
|
21
22
|
event.stopPropagation();
|
|
22
23
|
onSelect?.({ range: event.shiftKey });
|
|
23
24
|
}
|
|
24
|
-
: undefined, "aria-selected": selecting ? selected : undefined, ...props, children: [children,
|
|
25
|
+
: undefined, "aria-selected": selecting ? selected : undefined, ...props, children: [children, _jsx("span", { "aria-hidden": true, className: cn("pointer-events-none absolute top-2 left-2 z-10 flex size-6 items-center justify-center rounded-full shadow-sm", "transition-[opacity,scale,background-color] duration-(--duration-base) ease-out-notion", selecting ? "opacity-100 scale-100" : "opacity-0 scale-50", selected ? "bg-accent-solid text-accent-ink" : "bg-on-media-edge text-transparent backdrop-blur-sm"), children: _jsx(Check, { className: cn("size-4 transition-[scale] duration-(--duration-base) ease-out-notion", selected ? "scale-100" : "scale-0") }) }), bottomLeft !== undefined && _jsx("div", { className: "pointer-events-none absolute bottom-2 left-2 flex gap-1", children: bottomLeft }), topRight !== undefined && !selecting && _jsx("div", { className: "absolute top-2 right-2 flex gap-1", children: topRight })] }));
|
|
25
26
|
}
|
|
26
27
|
/* A control on top of a picture. White on a soft dark disc in both themes,
|
|
27
28
|
because it has to read against the picture, not the page: a bright sky as
|
|
28
29
|
well as a dark one. Hidden until the card is hovered or it takes focus,
|
|
29
30
|
unless `always` is set (for a state that is on, like a favourite). */
|
|
30
31
|
export function ImageCardButton({ always = false, className, ...props }) {
|
|
31
|
-
return
|
|
32
|
+
return _jsx(Button, { variant: "on-media", size: "icon-sm", className: cn("[&_svg]:size-4", !always && "affordance", className), ...props });
|
|
32
33
|
}
|
|
33
34
|
/* A marker on top of a picture that is always shown: a fact about it that
|
|
34
35
|
should not take a hover to find out. */
|
|
35
36
|
export function ImageCardBadge({ className, ...props }) {
|
|
36
|
-
return (_jsx("span", { className: cn("flex size-6 items-center justify-center rounded-full bg-
|
|
37
|
+
return (_jsx("span", { className: cn("flex size-6 items-center justify-center rounded-full bg-on-media text-on-media-ink backdrop-blur-sm [&_svg]:size-3.5", className), ...props }));
|
|
37
38
|
}
|
|
38
39
|
//# sourceMappingURL=image-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-card.js","sourceRoot":"","sources":["../../../src/components/ui/image-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"image-card.js","sourceRoot":"","sources":["../../../src/components/ui/image-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AAEtC;;;;;;;;;kEASkE;AAClE,MAAM,UAAU,SAAS,CAAC,EACtB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EASX;IACG,OAAO,CACH,eACI,SAAS,EAAE,EAAE,CACT,2IAA2I,EAC3I,2EAA2E,EAC3E,SAAS,IAAI,QAAQ,IAAI,+CAA+C,EACxE,SAAS,IAAI,CAAC,QAAQ,IAAI,kCAAkC,EAC5D,SAAS,CACZ;QACD,+DAA+D;QAC/D,cAAc,EACV,SAAS;YACL,CAAC,CAAC,CAAC,KAAiB,EAAE,EAAE;gBAClB,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;gBACxB,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC;YACH,CAAC,CAAC,SAAS,mBAEJ,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,KAC3C,KAAK,aAER,QAAQ,EAGT,oCAEI,SAAS,EAAE,EAAE,CACT,+GAA+G,EAC/G,wFAAwF,EACxF,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,oBAAoB,EAC1D,QAAQ,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,oDAAoD,CACtG,YAED,KAAC,KAAK,IAAC,SAAS,EAAE,EAAE,CAAC,sEAAsE,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,GAAI,GACjI,EACN,UAAU,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,yDAAyD,YAAE,UAAU,GAAO,EACvH,QAAQ,KAAK,SAAS,IAAI,CAAC,SAAS,IAAI,cAAK,SAAS,EAAC,mCAAmC,YAAE,QAAQ,GAAO,IAC1G,CACT,CAAC;AACN,CAAC;AAED;;;wEAGwE;AACxE,MAAM,UAAU,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAA6D;IAC9H,OAAO,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,CAAC,MAAM,IAAI,YAAY,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACxI,CAAC;AAED;0CAC0C;AAC1C,MAAM,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC;IACpF,OAAO,CACH,eACI,SAAS,EAAE,EAAE,CAAC,sHAAsH,EAAE,SAAS,CAAC,KAC5I,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ImageFocus, type ImageRatio } from "./image.js";
|
|
2
|
+
export declare const ZOOMS: readonly [1, 1.5, 2, 3];
|
|
3
|
+
/** Keeps a focus within 0 and 1, and its zoom one of the steps. */
|
|
4
|
+
export declare function clampFocus(focus: ImageFocus): Required<ImageFocus>;
|
|
5
|
+
export declare function dragFocus(focus: Required<ImageFocus>, drag: {
|
|
6
|
+
dx: number;
|
|
7
|
+
dy: number;
|
|
8
|
+
}, frame: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}, natural: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}): Required<ImageFocus>;
|
|
15
|
+
export declare function ImageFramer({ src, alt, ratio, value, onChange, className, }: {
|
|
16
|
+
src: string;
|
|
17
|
+
alt: string;
|
|
18
|
+
/** The shape it will be shown in. */
|
|
19
|
+
ratio?: ImageRatio;
|
|
20
|
+
value: ImageFocus;
|
|
21
|
+
onChange: (focus: Required<ImageFocus>) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=image-framer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-framer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/image-framer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAuB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAWpF,eAAO,MAAM,KAAK,yBAA0B,CAAC;AAE7C,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,CAGlE;AAMD,wBAAgB,SAAS,CACrB,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC3B,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAChC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACxC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C,QAAQ,CAAC,UAAU,CAAC,CAStB;AAED,wBAAgB,WAAW,CAAC,EACxB,GAAG,EACH,GAAG,EACH,KAAgB,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAmGA"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Minus, Move, Plus } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { focusStyle, ratioOf } from "./image.js";
|
|
8
|
+
/* Choosing which part of a picture shows when its shape is not the frame's: a
|
|
9
|
+
portrait shown square, a wide photo as a tall card. The picture fills the frame
|
|
10
|
+
(`ratio`) and is dragged within it, by mouse or finger, or moved with the arrow
|
|
11
|
+
keys (Shift for bigger steps); the zoom goes in steps, 1× to 3×, with its
|
|
12
|
+
buttons or + and −. A rule-of-thirds grid shows while it moves.
|
|
13
|
+
|
|
14
|
+
It hands back `{ x, y, zoom }`: x and y from 0 to 1 across and down, the point
|
|
15
|
+
kept in view. Give the same to Image's `focus` and it shows exactly this. */
|
|
16
|
+
export const ZOOMS = [1, 1.5, 2, 3];
|
|
17
|
+
/** Keeps a focus within 0 and 1, and its zoom one of the steps. */
|
|
18
|
+
export function clampFocus(focus) {
|
|
19
|
+
const zoom = ZOOMS.reduce((best, z) => (Math.abs(z - (focus.zoom ?? 1)) < Math.abs(best - (focus.zoom ?? 1)) ? z : best), 1);
|
|
20
|
+
return { x: Math.min(1, Math.max(0, focus.x)), y: Math.min(1, Math.max(0, focus.y)), zoom };
|
|
21
|
+
}
|
|
22
|
+
/* How far the focus moves for a drag of (dx, dy) pixels. A covering picture overflows
|
|
23
|
+
the frame along one axis (more with zoom); dragging by the whole overflow moves the
|
|
24
|
+
focus from one edge to the other. Dragging right shows more of the left, so the
|
|
25
|
+
focus moves the other way. With no overflow on an axis, that axis does not move. */
|
|
26
|
+
export function dragFocus(focus, drag, frame, natural) {
|
|
27
|
+
const cover = Math.max(frame.width / natural.width, frame.height / natural.height);
|
|
28
|
+
const overflowX = natural.width * cover * focus.zoom - frame.width;
|
|
29
|
+
const overflowY = natural.height * cover * focus.zoom - frame.height;
|
|
30
|
+
return clampFocus({
|
|
31
|
+
x: overflowX > 0.5 ? focus.x - drag.dx / overflowX : focus.x,
|
|
32
|
+
y: overflowY > 0.5 ? focus.y - drag.dy / overflowY : focus.y,
|
|
33
|
+
zoom: focus.zoom,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function ImageFramer({ src, alt, ratio = "square", value, onChange, className, }) {
|
|
37
|
+
const focus = clampFocus(value);
|
|
38
|
+
const frame = useRef(null);
|
|
39
|
+
const img = useRef(null);
|
|
40
|
+
const drag = useRef(null);
|
|
41
|
+
const [moving, setMoving] = useState(false);
|
|
42
|
+
const measure = () => {
|
|
43
|
+
const f = frame.current?.getBoundingClientRect();
|
|
44
|
+
const i = img.current;
|
|
45
|
+
if (!f || !i || !i.naturalWidth)
|
|
46
|
+
return null;
|
|
47
|
+
return { frame: { width: f.width, height: f.height }, natural: { width: i.naturalWidth, height: i.naturalHeight } };
|
|
48
|
+
};
|
|
49
|
+
const onPointerDown = (e) => {
|
|
50
|
+
if (e.button !== 0)
|
|
51
|
+
return;
|
|
52
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
53
|
+
drag.current = { x: e.clientX, y: e.clientY, start: focus };
|
|
54
|
+
setMoving(true);
|
|
55
|
+
};
|
|
56
|
+
const onPointerMove = (e) => {
|
|
57
|
+
const d = drag.current;
|
|
58
|
+
const m = measure();
|
|
59
|
+
if (!d || !m)
|
|
60
|
+
return;
|
|
61
|
+
onChange(dragFocus(d.start, { dx: e.clientX - d.x, dy: e.clientY - d.y }, m.frame, m.natural));
|
|
62
|
+
};
|
|
63
|
+
const onPointerUp = () => {
|
|
64
|
+
drag.current = null;
|
|
65
|
+
setMoving(false);
|
|
66
|
+
};
|
|
67
|
+
const zoomBy = (step) => {
|
|
68
|
+
const at = ZOOMS.indexOf(focus.zoom);
|
|
69
|
+
onChange({ ...focus, zoom: ZOOMS[Math.min(ZOOMS.length - 1, Math.max(0, at + step))] });
|
|
70
|
+
};
|
|
71
|
+
const onKeyDown = (e) => {
|
|
72
|
+
const by = e.shiftKey ? 0.1 : 0.02;
|
|
73
|
+
const moves = { ArrowLeft: [-by, 0], ArrowRight: [by, 0], ArrowUp: [0, -by], ArrowDown: [0, by] };
|
|
74
|
+
if (moves[e.key]) {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
onChange(clampFocus({ ...focus, x: focus.x + moves[e.key][0], y: focus.y + moves[e.key][1] }));
|
|
77
|
+
}
|
|
78
|
+
else if (e.key === "+" || e.key === "=") {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
zoomBy(1);
|
|
81
|
+
}
|
|
82
|
+
else if (e.key === "-" || e.key === "_") {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
zoomBy(-1);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-2", className), children: [_jsxs("div", { ref: frame, tabIndex: 0, role: "slider", "aria-label": `Position of ${alt}`, "aria-roledescription": "picture framer", "aria-valuetext": `${Math.round(focus.x * 100)}% across, ${Math.round(focus.y * 100)}% down, ${focus.zoom}× zoom`, "aria-keyshortcuts": "ArrowLeft ArrowRight ArrowUp ArrowDown + -", onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, onPointerCancel: onPointerUp, onKeyDown: onKeyDown, style: { aspectRatio: ratioOf(ratio) }, className: cn("relative bg-surface-sunken rounded-surface overflow-hidden outline-offset-2 select-none touch-none", moving ? "cursor-grabbing" : "cursor-grab"), children: [_jsx("img", { ref: img, src: src, alt: alt, draggable: false, style: focusStyle(focus), className: "w-full h-full object-cover pointer-events-none" }), _jsxs("span", { "aria-hidden": true, className: cn("absolute inset-0 transition-opacity duration-(--duration-fast) pointer-events-none", moving ? "opacity-100" : "opacity-0"), children: [_jsx("span", { className: "top-0 bottom-0 left-1/3 absolute bg-on-media-edge w-px" }), _jsx("span", { className: "top-0 bottom-0 left-2/3 absolute bg-on-media-edge w-px" }), _jsx("span", { className: "top-1/3 right-0 left-0 absolute bg-on-media-edge h-px" }), _jsx("span", { className: "top-2/3 right-0 left-0 absolute bg-on-media-edge h-px" })] }), _jsxs("span", { "aria-hidden": true, className: cn("bottom-2 left-2 absolute flex items-center gap-1 bg-on-media-strong px-1.5 py-0.5 rounded-control text-caption text-on-media-ink transition-opacity duration-(--duration-fast)", moving && "opacity-0"), children: [_jsx(Move, { className: "size-3.5" }), " Drag to frame"] })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": "Zoom out", disabled: focus.zoom === ZOOMS[0], onClick: () => zoomBy(-1), children: _jsx(Minus, {}) }), _jsxs("span", { className: "w-10 tabular-nums text-ink-secondary text-sm text-center", "aria-live": "polite", children: [focus.zoom, "\u00D7"] }), _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": "Zoom in", disabled: focus.zoom === ZOOMS[ZOOMS.length - 1], onClick: () => zoomBy(1), children: _jsx(Plus, {}) }), _jsx(Button, { size: "sm", variant: "ghost", className: "ml-auto", onClick: () => onChange({ x: 0.5, y: 0.5, zoom: 1 }), children: "Centre" })] })] }));
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=image-framer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-framer.js","sourceRoot":"","sources":["../../../src/components/ui/image-framer.tsx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C,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,uBAEjG,IACP,IACJ,CACT,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/image-viewer.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"image-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/image-viewer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIxF,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAiBF,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,EAAE,EACF,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAiB,EACjB,OAAO,EACP,KAAY,EACZ,cAAc,EACd,MAAM,EACN,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAmKA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
-
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
5
|
-
import { useEffect, useRef } from "react";
|
|
4
|
+
import { ChevronLeft, ChevronRight, ImageOff, X } from "lucide-react";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { Button } from "./button.js";
|
|
7
7
|
import { cn } from "../../lib/utils.js";
|
|
8
8
|
/* One picture at a time, as large as the room allows, with a way to the next:
|
|
@@ -32,6 +32,13 @@ export function ImageViewer({ items, id, onShow, onClose, title, toolbar, panel,
|
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
last.current = index;
|
|
34
34
|
}, [index]);
|
|
35
|
+
// Opening: the first picture grows into place, unless a view transition is
|
|
36
|
+
// already carrying it in from a thumbnail (then that is the animation).
|
|
37
|
+
const opening = useRef(true);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
opening.current = false;
|
|
40
|
+
}, []);
|
|
41
|
+
const growIn = opening.current && !stepped && transitionName === undefined;
|
|
35
42
|
useEffect(() => {
|
|
36
43
|
const onKey = (event) => {
|
|
37
44
|
const target = event.target;
|
|
@@ -45,6 +52,10 @@ export function ImageViewer({ items, id, onShow, onClose, title, toolbar, panel,
|
|
|
45
52
|
onShow(before.id);
|
|
46
53
|
else if (event.key === "ArrowRight" && after !== undefined)
|
|
47
54
|
onShow(after.id);
|
|
55
|
+
else if (event.key === "Home" && index > 0)
|
|
56
|
+
onShow(items[0].id);
|
|
57
|
+
else if (event.key === "End" && index !== -1 && index < items.length - 1)
|
|
58
|
+
onShow(items[items.length - 1].id);
|
|
48
59
|
};
|
|
49
60
|
window.addEventListener("keydown", onKey);
|
|
50
61
|
return () => window.removeEventListener("keydown", onKey);
|
|
@@ -55,7 +66,12 @@ export function ImageViewer({ items, id, onShow, onClose, title, toolbar, panel,
|
|
|
55
66
|
if (next !== undefined)
|
|
56
67
|
new window.Image().src = next.src;
|
|
57
68
|
}, [before, after]);
|
|
58
|
-
|
|
69
|
+
// A swipe across the picture steps, on a touch screen: 48px sideways, more
|
|
70
|
+
// sideways than down, within half a second.
|
|
71
|
+
const swipe = useRef(null);
|
|
72
|
+
const [failed, setFailed] = useState(null);
|
|
73
|
+
// Shown on hover or focus; always where there is no hover (phones and tablets).
|
|
74
|
+
const arrow = "affordance absolute top-1/2 -translate-y-1/2 rounded-full bg-surface-overlay shadow-sm hover:bg-surface-overlay [@media(hover:none)]:opacity-100";
|
|
59
75
|
return (_jsx(DialogPrimitive.Root, { open: true, modal: modal, onOpenChange: (open) => !open && onClose(), children: _jsx(DialogPrimitive.Portal, { children: _jsxs(DialogPrimitive.Content, { "aria-describedby": undefined,
|
|
60
76
|
// Focus the sheet, not its first button: a focused button shows its
|
|
61
77
|
// tooltip, and the picture should be all there is to look at.
|
|
@@ -65,7 +81,24 @@ export function ImageViewer({ items, id, onShow, onClose, title, toolbar, panel,
|
|
|
65
81
|
},
|
|
66
82
|
// Not modal means a sidebar, a menu or a tray outside it may be
|
|
67
83
|
// used; using them must not close it.
|
|
68
|
-
onInteractOutside: (event) => !modal && event.preventDefault(), className: cn("fixed inset-0 z-
|
|
84
|
+
onInteractOutside: (event) => !modal && event.preventDefault(), className: cn("fixed inset-0 z-(--z-overlay) flex flex-col bg-surface text-ink outline-none",
|
|
85
|
+
// The viewer's ground fades in as it opens.
|
|
86
|
+
transitionName === undefined && "data-[state=open]:animate-fade-in", className), children: [_jsx(DialogPrimitive.Title, { className: "sr-only", children: title ?? item?.alt ?? "Picture" }), _jsxs("header", { className: "flex h-12 shrink-0 items-center gap-1 px-2", children: [_jsx(Button, { variant: "ghost", size: "icon", "aria-label": "Close", onClick: onClose, children: _jsx(X, {}) }), _jsx("span", { "aria-live": "polite", className: "min-w-0 flex-1 truncate px-1 text-sm text-ink-secondary tabular-nums", children: index !== -1 && `${(index + 1).toLocaleString()} of ${items.length.toLocaleString()}` }), toolbar] }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col md:flex-row", children: [_jsxs("div", { className: "group relative flex min-h-0 min-w-0 flex-1 items-center justify-center p-3 [container-type:size] md:p-6 touch-pan-y", onPointerDown: (e) => {
|
|
87
|
+
if (e.pointerType !== "mouse")
|
|
88
|
+
swipe.current = { x: e.clientX, y: e.clientY, at: Date.now() };
|
|
89
|
+
}, onPointerUp: (e) => {
|
|
90
|
+
const s = swipe.current;
|
|
91
|
+
swipe.current = null;
|
|
92
|
+
if (!s || Date.now() - s.at > 500)
|
|
93
|
+
return;
|
|
94
|
+
const dx = e.clientX - s.x;
|
|
95
|
+
if (Math.abs(dx) < 48 || Math.abs(dx) < Math.abs(e.clientY - s.y))
|
|
96
|
+
return;
|
|
97
|
+
if (dx < 0 && after !== undefined)
|
|
98
|
+
onShow(after.id);
|
|
99
|
+
if (dx > 0 && before !== undefined)
|
|
100
|
+
onShow(before.id);
|
|
101
|
+
}, onPointerCancel: () => (swipe.current = null), children: [item !== undefined && failed === item.src && (_jsxs("span", { role: "img", "aria-label": `${item.alt} (could not be loaded)`, className: "flex flex-col items-center gap-2 text-ink-tertiary text-sm", children: [_jsx(ImageOff, { className: "size-6" }), "This picture couldn't be loaded"] })), item !== undefined && failed !== item.src && (_jsx("img", { src: item.src, alt: item.alt, draggable: false, onError: () => setFailed(item.src), style: {
|
|
69
102
|
width: `min(100cqw, calc(100cqh * ${item.aspect}))`,
|
|
70
103
|
aspectRatio: item.aspect,
|
|
71
104
|
backgroundImage: item.placeholder !== undefined ? `url(${item.placeholder})` : undefined,
|
|
@@ -76,6 +109,6 @@ export function ImageViewer({ items, id, onShow, onClose, title, toolbar, panel,
|
|
|
76
109
|
},
|
|
77
110
|
// Only a step slides in. The first picture may arrive by a
|
|
78
111
|
// view transition, and must not also slide.
|
|
79
|
-
className: cn("rounded-
|
|
112
|
+
className: cn("rounded-surface shadow-md transition-[filter] duration-(--duration-base) ease-out-notion", stepped ? "animate-step-in" : growIn && "animate-viewer-in") }, item.id)), overlay, before !== undefined && (_jsx(Button, { variant: "subtle", size: "icon", "aria-label": "Previous", onClick: () => onShow(before.id), className: cn(arrow, "left-3"), children: _jsx(ChevronLeft, {}) })), after !== undefined && (_jsx(Button, { variant: "subtle", size: "icon", "aria-label": "Next", onClick: () => onShow(after.id), className: cn(arrow, "right-3"), children: _jsx(ChevronRight, {}) }))] }), panel !== undefined && (_jsx("aside", { inert: !panelOpen, className: cn("shrink-0 overflow-hidden bg-surface-sunken transition-[width,max-height] duration-(--duration-base) ease-out-notion", "max-md:shadow-edge-t md:shadow-edge-l", panelOpen ? "max-md:max-h-[46dvh] md:w-80" : "max-md:max-h-0 md:w-0"), children: _jsx("div", { className: "h-full overflow-y-auto md:w-80", children: panel }) }))] })] }) }) }));
|
|
80
113
|
}
|
|
81
114
|
//# sourceMappingURL=image-viewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../../../src/components/ui/image-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../../../src/components/ui/image-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE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
|
2
|
-
export
|
|
1
|
+
import { type ComponentProps, type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
export type ImageRatio = "square" | "portrait" | "landscape" | "wide" | "tall" | number;
|
|
3
|
+
export type ImageFocus = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
zoom?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const ratioOf: (ratio: ImageRatio | undefined) => number | undefined;
|
|
9
|
+
/** The CSS that shows `focus` in a covering image: the same in Image and ImageFramer, so what is framed is what shows. */
|
|
10
|
+
export declare function focusStyle(focus: ImageFocus | undefined): CSSProperties | undefined;
|
|
11
|
+
export declare function Image({ src, alt, placeholder, ratio, aspect, fit, focus, icon, emptyLabel, backdrop, pending, className, imgClassName, style, onLoad, ...props }: Omit<ComponentProps<"img">, "placeholder" | "src"> & {
|
|
12
|
+
src?: string | null;
|
|
3
13
|
/** A very small version of the same picture, shown blurred while the real one loads. */
|
|
4
14
|
placeholder?: string;
|
|
5
|
-
|
|
15
|
+
ratio?: ImageRatio;
|
|
16
|
+
/** Width over height; the same as a numeric `ratio`. */
|
|
6
17
|
aspect?: number;
|
|
7
18
|
fit?: "cover" | "contain";
|
|
19
|
+
/** Which part of a covering picture stays in view, 0 to 1 across and down; `zoom` from 1. */
|
|
20
|
+
focus?: ImageFocus;
|
|
21
|
+
/** Shown in the middle while loading (with no placeholder) and when there is no picture. */
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
/** Words under the icon when there is no picture. */
|
|
24
|
+
emptyLabel?: ReactNode;
|
|
25
|
+
/** With `contain`, fill the room beside the picture with a blur of it. */
|
|
26
|
+
backdrop?: boolean;
|
|
27
|
+
/** A picture is on its way but its `src` is not known yet (still uploading,
|
|
28
|
+
still being fetched): shows the loading state, not the empty one. */
|
|
29
|
+
pending?: boolean;
|
|
8
30
|
/** Extra classes for the <img> itself; `className` goes on the box. */
|
|
9
31
|
imgClassName?: string;
|
|
10
32
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/ui/image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAwBlG,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACxF,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIjE,eAAO,MAAM,OAAO,GAAI,OAAO,UAAU,GAAG,SAAS,KAAG,MAAM,GAAG,SAAgE,CAAC;AAElI,0HAA0H;AAC1H,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAMnF;AAED,wBAAgB,KAAK,CAAC,EAClB,GAAG,EACH,GAAG,EACH,WAAW,EACX,KAAK,EACL,MAAM,EACN,GAAa,EACb,KAAK,EACL,IAAI,EACJ,UAAU,EACV,QAAe,EACf,OAAe,EACf,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,KAAK,CAAC,GAAG;IACpD,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,6FAA6F;IAC7F,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;4EACwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,+BAsHA"}
|
|
@@ -1,32 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ImageIcon, ImageOff } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
const RATIOS = { square: 1, portrait: 3 / 4, landscape: 4 / 3, wide: 16 / 9, tall: 9 / 16 };
|
|
7
|
+
export const ratioOf = (ratio) => (typeof ratio === "string" ? RATIOS[ratio] : ratio);
|
|
8
|
+
/** The CSS that shows `focus` in a covering image: the same in Image and ImageFramer, so what is framed is what shows. */
|
|
9
|
+
export function focusStyle(focus) {
|
|
10
|
+
if (!focus)
|
|
11
|
+
return undefined;
|
|
12
|
+
const x = `${(focus.x * 100).toFixed(2)}%`;
|
|
13
|
+
const y = `${(focus.y * 100).toFixed(2)}%`;
|
|
14
|
+
const zoom = focus.zoom ?? 1;
|
|
15
|
+
return { objectPosition: `${x} ${y}`, ...(zoom !== 1 ? { transform: `scale(${zoom})`, transformOrigin: `${x} ${y}` } : null) };
|
|
16
|
+
}
|
|
17
|
+
export function Image({ src, alt, placeholder, ratio, aspect, fit = "cover", focus, icon, emptyLabel, backdrop = true, pending = false, className, imgClassName, style, onLoad, ...props }) {
|
|
18
|
+
const [loaded, setLoaded] = useState(null);
|
|
17
19
|
// A picture on someone else's site can vanish; say so rather than leave an empty box.
|
|
18
20
|
const [failed, setFailed] = useState(null);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
// The picture this Image first appeared with. Only that one, if the browser
|
|
22
|
+
// already has it, shows at once (scrolling back to a list); a picture that
|
|
23
|
+
// arrives later (an upload finishing, a new src) always sharpens in.
|
|
24
|
+
const first = useRef(src);
|
|
25
|
+
const shape = ratioOf(ratio) ?? aspect;
|
|
26
|
+
const box = { ...(shape !== undefined ? { aspectRatio: shape } : null), ...style };
|
|
27
|
+
const isLoaded = !!src && loaded === src;
|
|
28
|
+
// Nothing to show and nothing coming: the empty state. A placeholder, or
|
|
29
|
+
// `pending`, means a picture is on its way, which is the loading state.
|
|
30
|
+
if (!src && placeholder === undefined && !pending) {
|
|
31
|
+
return (_jsxs("span", { role: alt ? "img" : undefined, "aria-label": alt || undefined, className: cn("@container flex flex-col justify-center items-center gap-1.5 bg-surface-sunken p-1 text-caption text-center text-ink-tertiary", className), style: box, children: [_jsx("span", { "aria-hidden": true, className: "[&_svg]:size-5", children: icon ?? _jsx(ImageIcon, {}) }), emptyLabel !== undefined && _jsx("span", { className: "hidden @min-[9rem]:inline px-2", children: emptyLabel })] }));
|
|
32
|
+
}
|
|
33
|
+
if (src && failed === src) {
|
|
34
|
+
return (_jsxs("span", { role: "img", "aria-label": alt ? `${alt} (could not be loaded)` : "A picture that could not be loaded", className: cn("@container flex flex-col justify-center items-center gap-1.5 bg-surface-sunken p-1 text-caption text-center text-ink-tertiary", className), style: box, children: [_jsx(ImageOff, { className: "size-5 shrink-0" }), _jsx("span", { className: "hidden @min-[9rem]:inline px-2", children: "This picture couldn't be loaded" })] }));
|
|
21
35
|
}
|
|
22
|
-
|
|
36
|
+
const objectFit = fit === "cover" ? "object-cover" : "object-contain";
|
|
37
|
+
return (_jsxs("span", { className: cn("block relative bg-surface-sunken overflow-hidden", className), style: box, "data-loaded": isLoaded || undefined, children: [placeholder === undefined && (
|
|
38
|
+
// The loading pulse fades out as the picture comes in, rather than vanishing.
|
|
39
|
+
_jsx("span", { "aria-hidden": true, className: cn("absolute inset-0 flex justify-center items-center bg-tint-hover text-ink-tertiary [&_svg]:size-5", "transition-opacity duration-(--duration-reveal) ease-out-notion", isLoaded ? "opacity-0" : "animate-pulse motion-reduce:animate-none"), children: icon })), fit === "contain" && backdrop && (
|
|
40
|
+
// The same picture, blurred and dimmed, filling the room beside it.
|
|
41
|
+
_jsx("img", { src: placeholder ?? src ?? undefined, alt: "", "aria-hidden": true, draggable: false, className: cn("absolute inset-0 opacity-0 brightness-90 blur-xl w-full h-full object-cover scale-125 transition-opacity duration-(--duration-slow)", (isLoaded || placeholder) && "opacity-60") })), placeholder !== undefined && (
|
|
23
42
|
// Scaled up a touch so the blur's soft edge falls outside the box.
|
|
24
|
-
_jsx("img", { src: placeholder, alt: "", "aria-hidden": true, draggable: false,
|
|
25
|
-
|
|
26
|
-
|
|
43
|
+
_jsx("img", { src: placeholder, alt: "", "aria-hidden": true, draggable: false,
|
|
44
|
+
// Fades out as the picture sharpens over it, a little behind it, so
|
|
45
|
+
// the blur hands over to the picture instead of a gap between them.
|
|
46
|
+
className: cn("absolute inset-0 w-full h-full scale-110 blur-lg transition-opacity duration-(--duration-reveal) ease-in-notion", objectFit, isLoaded && "opacity-0 delay-100") })), src && (_jsx("img", { ref: (img) => {
|
|
47
|
+
if (img?.complete && img.naturalWidth > 0 && img.getAttribute("src") === first.current)
|
|
48
|
+
setLoaded(img.getAttribute("src"));
|
|
27
49
|
}, src: src, alt: alt, decoding: "async", onLoad: (event) => {
|
|
28
|
-
|
|
50
|
+
// Two frames on, so the blurred starting state is painted first: a
|
|
51
|
+
// picture that loads before its first paint (a fast or local one)
|
|
52
|
+
// would otherwise jump straight to sharp, with nothing to ease from.
|
|
53
|
+
requestAnimationFrame(() => requestAnimationFrame(() => setLoaded(src)));
|
|
29
54
|
onLoad?.(event);
|
|
30
|
-
}, onError: () => setFailed(
|
|
55
|
+
}, onError: () => setFailed(src), style: fit === "cover" ? focusStyle(focus) : undefined,
|
|
56
|
+
// It arrives blurred and a touch large, and sharpens into place as it
|
|
57
|
+
// fades up: the stand-in's blur clearing into the picture. (scale is its
|
|
58
|
+
// own property, so it does not disturb a focus's transform.)
|
|
59
|
+
className: cn("relative w-full h-full transition-[opacity,scale,filter] duration-(--duration-reveal) ease-out-notion", objectFit, isLoaded ? "opacity-100 blur-none scale-100" : "opacity-0 blur-lg scale-[1.04]", imgClassName), ...props }))] }));
|
|
31
60
|
}
|
|
32
61
|
//# sourceMappingURL=image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/ui/image.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/ui/image.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAA2D,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AA0BxC,MAAM,MAAM,GAAgD,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;AAEzI,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAA6B,EAAsB,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CA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AC,KAAK,EAAE,EAAE;oBACd,mEAAmE;oBACnE,kEAAkE;oBAClE,qEAAqE;oBACrE,qBAAqB,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACzE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;gBACpB,CAAC,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAC7B,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;gBACtD,sEAAsE;gBACtE,yEAAyE;gBACzE,6DAA6D;gBAC7D,SAAS,EAAE,EAAE,CACT,uGAAuG,EACvG,SAAS,EACT,QAAQ,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,gCAAgC,EAC/E,YAAY,CACf,KACG,KAAK,GACX,CACD,IACE,CACV,CAAC;AACN,CAAC"}
|
|
@@ -4,11 +4,11 @@ export { Callout } from "./callout.js";
|
|
|
4
4
|
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "./card.js";
|
|
5
5
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose, } from "./dialog.js";
|
|
6
6
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./dropdown-menu.js";
|
|
7
|
-
export { Input, Textarea, Label, Field } from "./input.js";
|
|
7
|
+
export { Input, Textarea, Label, Field, SearchField, useField, fieldVariants, type InputProps } from "./input.js";
|
|
8
8
|
export { Separator } from "./separator.js";
|
|
9
9
|
export { Tooltip, TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent, } from "./tooltip.js";
|
|
10
|
-
export { Heading, Text, Code, Kbd, Prose } from "./typography.js";
|
|
11
|
-
export { ThemeToggle } from "./theme-toggle.js";
|
|
10
|
+
export { Heading, Text, Code, Kbd, Prose, Shortcut, usePlatform } from "./typography.js";
|
|
11
|
+
export { ThemeProvider, ThemeToggle, useTheme } from "./theme-toggle.js";
|
|
12
12
|
export { MacCard, MacWindowHeader } from "./mac-card.js";
|
|
13
13
|
export { DropdownMenuRadioGroup, DropdownMenuRadioItem } from "./dropdown-menu.js";
|
|
14
14
|
export { Checkbox } from "./checkbox.js";
|
|
@@ -16,34 +16,77 @@ export { SelectMenu } from "./select-menu.js";
|
|
|
16
16
|
export { AccentPicker } from "./accent-picker.js";
|
|
17
17
|
export { Property, PropertyList, QuietInput, NumberInput, quietField } from "./property.js";
|
|
18
18
|
export { StatTile } from "./stat-tile.js";
|
|
19
|
-
export { Progress } from "./progress.js";
|
|
20
|
-
export { Table, Th, Td, ClickableRow } from "./table.js";
|
|
19
|
+
export { Progress, ProgressBar } from "./progress.js";
|
|
20
|
+
export { Table, TableCaption, Th, Td, ClickableRow } from "./table.js";
|
|
21
21
|
export { Breadcrumbs, type Crumb } from "./breadcrumbs.js";
|
|
22
22
|
export { NavTree, type NavNode } from "./nav-tree.js";
|
|
23
23
|
export { AppShell, SidebarFrame, SidebarSection, type ShellControls } from "./app-shell.js";
|
|
24
24
|
export { EditableText } from "./editable-text.js";
|
|
25
25
|
export { CommandMenu, type Command } from "./command-menu.js";
|
|
26
|
-
export { HandleRow, type DropSide } from "./handle-row.js";
|
|
26
|
+
export { DragRows, HandleRow, type DropSide } from "./handle-row.js";
|
|
27
27
|
export { toggleSidebar } from "./app-shell.js";
|
|
28
|
-
export { Image } from "./image.js";
|
|
28
|
+
export { Image, focusStyle, ratioOf, type ImageFocus, type ImageRatio } from "./image.js";
|
|
29
|
+
export { ImageFramer, clampFocus, dragFocus, ZOOMS } from "./image-framer.js";
|
|
29
30
|
export { ImageCard, ImageCardButton, ImageCardBadge } from "./image-card.js";
|
|
30
31
|
export { ImageViewer, type ViewerItem } from "./image-viewer.js";
|
|
31
32
|
export { Stepper, StepDialog } from "./step-dialog.js";
|
|
32
33
|
export { SelectionBar } from "./selection-bar.js";
|
|
33
|
-
export { Segmented } from "./segmented.js";
|
|
34
|
-
export { Page, PageHeader } from "./page.js";
|
|
34
|
+
export { Segmented, type SegmentedOption } from "./segmented.js";
|
|
35
|
+
export { Page, PageHeader, Section } from "./page.js";
|
|
35
36
|
export { FilePreview } from "./file-preview.js";
|
|
36
37
|
export { FileDropArea, FileUploader } from "./file-uploader.js";
|
|
37
38
|
export { Popover, PopoverTrigger, PopoverAnchor, PopoverClose, PopoverContent } from "./popover.js";
|
|
38
39
|
export { FieldButton, type FieldButtonProps } from "./field-button.js";
|
|
39
|
-
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectLabel, SelectSeparator } from "./select.js";
|
|
40
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectLabel, SelectSeparator, NativeSelect } from "./select.js";
|
|
40
41
|
export { Calendar, focusCalendarDay } from "./calendar.js";
|
|
41
42
|
export { DatePicker, DateRangePicker, type DatePickerProps, type DateRangePickerProps, type DateRange } from "./date-picker.js";
|
|
42
|
-
export { TimePicker,
|
|
43
|
+
export { TimePicker, TimeRangePicker, type TimePickerProps } from "./time-picker.js";
|
|
44
|
+
export { TimeList } from "./time-list.js";
|
|
45
|
+
export { MonthPicker, type MonthPickerProps } from "./month-picker.js";
|
|
46
|
+
export { PickerPanel } from "./picker-panel.js";
|
|
43
47
|
export { DateTimePicker, type DateTimePickerProps } from "./date-time-picker.js";
|
|
44
48
|
export { ImageBlock, MIN_IMAGE_WIDTH } from "./image-block.js";
|
|
45
49
|
export { VideoBlock } from "./video-block.js";
|
|
46
50
|
export { LinkBlock } from "./link-block.js";
|
|
47
51
|
export { AddressField } from "./address-field.js";
|
|
48
52
|
export { Spotlight, useSpotlightShortcut, type SpotlightItem } from "./spotlight.js";
|
|
53
|
+
export { ToastProvider, useToast, type Toast, type ToastTone } from "./toast.js";
|
|
54
|
+
export { Combobox } from "./combobox.js";
|
|
55
|
+
export { AnimatedHeight } from "./animated-height.js";
|
|
56
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, } from "./sidebar.js";
|
|
57
|
+
export { Spinner } from "./spinner.js";
|
|
58
|
+
export { Toggle, ToggleGroup, ToggleGroupItem, toggleVariants } from "./toggle.js";
|
|
59
|
+
export { Switch } from "./switch.js";
|
|
60
|
+
export { RadioGroup, RadioGroupItem } from "./radio-group.js";
|
|
61
|
+
export { MultiSelect, type MultiSelectOption } from "./multi-select.js";
|
|
62
|
+
export { Avatar, AvatarStack, initials, type AvatarProps } from "./avatar.js";
|
|
63
|
+
export { Skeleton, SkeletonText } from "./skeleton.js";
|
|
64
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent, Disclosure } from "./collapsible.js";
|
|
65
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent } from "./tabs.js";
|
|
66
|
+
export { EmptyState } from "./empty-state.js";
|
|
67
|
+
export { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, ConfirmProvider, useConfirm, type ConfirmOptions, } from "./alert-dialog.js";
|
|
68
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuRadioGroup, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuSub, ContextMenuSubTrigger, ContextMenuSubContent, } from "./context-menu.js";
|
|
69
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetTitle, SheetDescription, SheetBody, SheetFooter } from "./sheet.js";
|
|
70
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent } from "./hover-card.js";
|
|
71
|
+
export { HeaderBar } from "./header-bar.js";
|
|
72
|
+
export { TopBarShell, type TopBarLink } from "./top-bar.js";
|
|
73
|
+
export { FocusShell } from "./focus-shell.js";
|
|
74
|
+
export { DocumentLayout, Breakout } from "./document-layout.js";
|
|
75
|
+
export { CollectionLayout, CollectionToolbar } from "./collection-layout.js";
|
|
76
|
+
export { ListDetail, ListItem } from "./list-detail.js";
|
|
77
|
+
export { SettingsLayout, SettingsSection, SettingsRow, type SettingsSectionLink } from "./settings-layout.js";
|
|
78
|
+
export { StepsLayout } from "./steps-layout.js";
|
|
79
|
+
export { Rating } from "./rating.js";
|
|
80
|
+
export { CopyButton, copyText } from "./copy-button.js";
|
|
81
|
+
export { ShareLink } from "./share-link.js";
|
|
82
|
+
export { Banner } from "./banner.js";
|
|
83
|
+
export { SaveStatus, type SaveState } from "./save-status.js";
|
|
84
|
+
export { ErrorState, NotFound } from "./error-state.js";
|
|
85
|
+
export { Pagination, LoadMore, pageWindow } from "./pagination.js";
|
|
86
|
+
export { FilterBuilder, SortBuilder, FilterButton, SortButton } from "./filter-builder.js";
|
|
87
|
+
export { Database, VIEW_ICONS } from "./database/database.js";
|
|
88
|
+
export { TableView } from "./database/table-view.js";
|
|
89
|
+
export { BoardView, GalleryView, ListView } from "./database/card-views.js";
|
|
90
|
+
export { CalendarView } from "./database/calendar-view.js";
|
|
91
|
+
export { CellEditor, CellValue } from "./database/cells.js";
|
|
49
92
|
//# sourceMappingURL=index.d.ts.map
|