@thalavaisankar/atoms 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +196 -2
- package/THIRD_PARTY_NOTICES.md +275 -0
- package/dist/blocks/index.d.mts +2 -0
- package/dist/blocks/index.mjs +1 -0
- package/dist/blocks/index.mjs.map +1 -0
- package/dist/components/ui/accordion/accordion.mjs +194 -0
- package/dist/components/ui/accordion/accordion.mjs.map +1 -0
- package/dist/components/ui/accordion/index.mjs +15 -0
- package/dist/components/ui/accordion/index.mjs.map +1 -0
- package/dist/components/ui/activity-feed/activity-feed.mjs +287 -0
- package/dist/components/ui/activity-feed/activity-feed.mjs.map +1 -0
- package/dist/components/ui/activity-feed/index.mjs +39 -0
- package/dist/components/ui/activity-feed/index.mjs.map +1 -0
- package/dist/components/ui/alert/alert.mjs +128 -0
- package/dist/components/ui/alert/alert.mjs.map +1 -0
- package/dist/components/ui/alert/index.mjs +17 -0
- package/dist/components/ui/alert/index.mjs.map +1 -0
- package/dist/components/ui/animated-label/animated-label.mjs +89 -0
- package/dist/components/ui/animated-label/animated-label.mjs.map +1 -0
- package/dist/components/ui/animated-label/index.mjs +9 -0
- package/dist/components/ui/animated-label/index.mjs.map +1 -0
- package/dist/components/ui/animated-number/animated-number.mjs +101 -0
- package/dist/components/ui/animated-number/animated-number.mjs.map +1 -0
- package/dist/components/ui/animated-number/index.mjs +5 -0
- package/dist/components/ui/animated-number/index.mjs.map +1 -0
- package/dist/components/ui/avatar/avatar.mjs +130 -0
- package/dist/components/ui/avatar/avatar.mjs.map +1 -0
- package/dist/components/ui/avatar/index.mjs +17 -0
- package/dist/components/ui/avatar/index.mjs.map +1 -0
- package/dist/components/ui/avatar-group/avatar-group.mjs +49 -0
- package/dist/components/ui/avatar-group/avatar-group.mjs.map +1 -0
- package/dist/components/ui/avatar-group/index.mjs +5 -0
- package/dist/components/ui/avatar-group/index.mjs.map +1 -0
- package/dist/components/ui/badge/badge-motion.mjs +108 -0
- package/dist/components/ui/badge/badge-motion.mjs.map +1 -0
- package/dist/components/ui/badge/badge.mjs +314 -0
- package/dist/components/ui/badge/badge.mjs.map +1 -0
- package/dist/components/ui/badge/index.mjs +27 -0
- package/dist/components/ui/badge/index.mjs.map +1 -0
- package/dist/components/ui/badge/readable-ink.mjs +36 -0
- package/dist/components/ui/badge/readable-ink.mjs.map +1 -0
- package/dist/components/ui/badge-group/badge-group.mjs +132 -0
- package/dist/components/ui/badge-group/badge-group.mjs.map +1 -0
- package/dist/components/ui/badge-group/index.mjs +5 -0
- package/dist/components/ui/badge-group/index.mjs.map +1 -0
- package/dist/components/ui/breadcrumb/breadcrumb.mjs +108 -0
- package/dist/components/ui/breadcrumb/breadcrumb.mjs.map +1 -0
- package/dist/components/ui/breadcrumb/index.mjs +19 -0
- package/dist/components/ui/breadcrumb/index.mjs.map +1 -0
- package/dist/components/ui/button/button-variants.mjs +80 -0
- package/dist/components/ui/button/button-variants.mjs.map +1 -0
- package/dist/components/ui/button/button.mjs +74 -0
- package/dist/components/ui/button/button.mjs.map +1 -0
- package/dist/components/ui/button/index.mjs +17 -0
- package/dist/components/ui/button/index.mjs.map +1 -0
- package/dist/components/ui/button/social-button.mjs +45 -0
- package/dist/components/ui/button/social-button.mjs.map +1 -0
- package/dist/components/ui/button/social-logos.mjs +179 -0
- package/dist/components/ui/button/social-logos.mjs.map +1 -0
- package/dist/components/ui/button/split-button.mjs +72 -0
- package/dist/components/ui/button/split-button.mjs.map +1 -0
- package/dist/components/ui/button-group/button-group.mjs +58 -0
- package/dist/components/ui/button-group/button-group.mjs.map +1 -0
- package/dist/components/ui/button-group/index.mjs +11 -0
- package/dist/components/ui/button-group/index.mjs.map +1 -0
- package/dist/components/ui/card/card.mjs +131 -0
- package/dist/components/ui/card/card.mjs.map +1 -0
- package/dist/components/ui/card/index.mjs +23 -0
- package/dist/components/ui/card/index.mjs.map +1 -0
- package/dist/components/ui/chart/bar-list.mjs +87 -0
- package/dist/components/ui/chart/bar-list.mjs.map +1 -0
- package/dist/components/ui/chart/chart-colors.mjs +68 -0
- package/dist/components/ui/chart/chart-colors.mjs.map +1 -0
- package/dist/components/ui/chart/chart-geometry.mjs +152 -0
- package/dist/components/ui/chart/chart-geometry.mjs.map +1 -0
- package/dist/components/ui/chart/chart-specialized.mjs +194 -0
- package/dist/components/ui/chart/chart-specialized.mjs.map +1 -0
- package/dist/components/ui/chart/chart.mjs +648 -0
- package/dist/components/ui/chart/chart.mjs.map +1 -0
- package/dist/components/ui/chart/index.mjs +88 -0
- package/dist/components/ui/chart/index.mjs.map +1 -0
- package/dist/components/ui/chart/radial-meter.mjs +142 -0
- package/dist/components/ui/chart/radial-meter.mjs.map +1 -0
- package/dist/components/ui/chart/types.mjs +1 -0
- package/dist/components/ui/chart/types.mjs.map +1 -0
- package/dist/components/ui/checkbox/checkbox.mjs +183 -0
- package/dist/components/ui/checkbox/checkbox.mjs.map +1 -0
- package/dist/components/ui/checkbox/index.mjs +11 -0
- package/dist/components/ui/checkbox/index.mjs.map +1 -0
- package/dist/components/ui/checklist/checklist.mjs +353 -0
- package/dist/components/ui/checklist/checklist.mjs.map +1 -0
- package/dist/components/ui/checklist/index.mjs +33 -0
- package/dist/components/ui/checklist/index.mjs.map +1 -0
- package/dist/components/ui/chip/chip.mjs +202 -0
- package/dist/components/ui/chip/chip.mjs.map +1 -0
- package/dist/components/ui/chip/index.mjs +13 -0
- package/dist/components/ui/chip/index.mjs.map +1 -0
- package/dist/components/ui/chip-group/chip-group.mjs +204 -0
- package/dist/components/ui/chip-group/chip-group.mjs.map +1 -0
- package/dist/components/ui/chip-group/index.mjs +11 -0
- package/dist/components/ui/chip-group/index.mjs.map +1 -0
- package/dist/components/ui/code-snippet/code-highlighter.mjs +16 -0
- package/dist/components/ui/code-snippet/code-highlighter.mjs.map +1 -0
- package/dist/components/ui/code-snippet/code-snippet.mjs +437 -0
- package/dist/components/ui/code-snippet/code-snippet.mjs.map +1 -0
- package/dist/components/ui/code-snippet/index.mjs +17 -0
- package/dist/components/ui/code-snippet/index.mjs.map +1 -0
- package/dist/components/ui/code-snippet/labels.mjs +16 -0
- package/dist/components/ui/code-snippet/labels.mjs.map +1 -0
- package/dist/components/ui/code-snippet/tokenize.mjs +715 -0
- package/dist/components/ui/code-snippet/tokenize.mjs.map +1 -0
- package/dist/components/ui/code-snippet/types.mjs +1 -0
- package/dist/components/ui/code-snippet/types.mjs.map +1 -0
- package/dist/components/ui/collapsible/collapsible.mjs +85 -0
- package/dist/components/ui/collapsible/collapsible.mjs.map +1 -0
- package/dist/components/ui/collapsible/index.mjs +15 -0
- package/dist/components/ui/collapsible/index.mjs.map +1 -0
- package/dist/components/ui/color-picker/color-picker.mjs +852 -0
- package/dist/components/ui/color-picker/color-picker.mjs.map +1 -0
- package/dist/components/ui/color-picker/index.mjs +47 -0
- package/dist/components/ui/color-picker/index.mjs.map +1 -0
- package/dist/components/ui/combobox/combobox.mjs +745 -0
- package/dist/components/ui/combobox/combobox.mjs.map +1 -0
- package/dist/components/ui/combobox/index.mjs +27 -0
- package/dist/components/ui/combobox/index.mjs.map +1 -0
- package/dist/components/ui/command/command.mjs +439 -0
- package/dist/components/ui/command/command.mjs.map +1 -0
- package/dist/components/ui/command/index.mjs +31 -0
- package/dist/components/ui/command/index.mjs.map +1 -0
- package/dist/components/ui/compare-slider/compare-slider.mjs +335 -0
- package/dist/components/ui/compare-slider/compare-slider.mjs.map +1 -0
- package/dist/components/ui/compare-slider/index.mjs +17 -0
- package/dist/components/ui/compare-slider/index.mjs.map +1 -0
- package/dist/components/ui/context-menu/context-menu.mjs +184 -0
- package/dist/components/ui/context-menu/context-menu.mjs.map +1 -0
- package/dist/components/ui/context-menu/index.mjs +37 -0
- package/dist/components/ui/context-menu/index.mjs.map +1 -0
- package/dist/components/ui/data-table/active-filters.mjs +69 -0
- package/dist/components/ui/data-table/active-filters.mjs.map +1 -0
- package/dist/components/ui/data-table/body-row.mjs +118 -0
- package/dist/components/ui/data-table/body-row.mjs.map +1 -0
- package/dist/components/ui/data-table/cards.mjs +76 -0
- package/dist/components/ui/data-table/cards.mjs.map +1 -0
- package/dist/components/ui/data-table/data-table.mjs +680 -0
- package/dist/components/ui/data-table/data-table.mjs.map +1 -0
- package/dist/components/ui/data-table/empty.mjs +26 -0
- package/dist/components/ui/data-table/empty.mjs.map +1 -0
- package/dist/components/ui/data-table/expand.mjs +70 -0
- package/dist/components/ui/data-table/expand.mjs.map +1 -0
- package/dist/components/ui/data-table/faceted-filter.mjs +112 -0
- package/dist/components/ui/data-table/faceted-filter.mjs.map +1 -0
- package/dist/components/ui/data-table/features.mjs +96 -0
- package/dist/components/ui/data-table/features.mjs.map +1 -0
- package/dist/components/ui/data-table/grip.mjs +37 -0
- package/dist/components/ui/data-table/grip.mjs.map +1 -0
- package/dist/components/ui/data-table/header-cell.mjs +85 -0
- package/dist/components/ui/data-table/header-cell.mjs.map +1 -0
- package/dist/components/ui/data-table/index.mjs +55 -0
- package/dist/components/ui/data-table/index.mjs.map +1 -0
- package/dist/components/ui/data-table/labels.mjs +55 -0
- package/dist/components/ui/data-table/labels.mjs.map +1 -0
- package/dist/components/ui/data-table/load-more.mjs +56 -0
- package/dist/components/ui/data-table/load-more.mjs.map +1 -0
- package/dist/components/ui/data-table/move-item.mjs +11 -0
- package/dist/components/ui/data-table/move-item.mjs.map +1 -0
- package/dist/components/ui/data-table/persist.mjs +65 -0
- package/dist/components/ui/data-table/persist.mjs.map +1 -0
- package/dist/components/ui/data-table/selection-bar.mjs +51 -0
- package/dist/components/ui/data-table/selection-bar.mjs.map +1 -0
- package/dist/components/ui/data-table/tabs.mjs +48 -0
- package/dist/components/ui/data-table/tabs.mjs.map +1 -0
- package/dist/components/ui/data-table/toolbar.mjs +92 -0
- package/dist/components/ui/data-table/toolbar.mjs.map +1 -0
- package/dist/components/ui/data-table/use-reorder.mjs +239 -0
- package/dist/components/ui/data-table/use-reorder.mjs.map +1 -0
- package/dist/components/ui/data-table/use-reveal.mjs +24 -0
- package/dist/components/ui/data-table/use-reveal.mjs.map +1 -0
- package/dist/components/ui/data-table/use-table-state.mjs +38 -0
- package/dist/components/ui/data-table/use-table-state.mjs.map +1 -0
- package/dist/components/ui/data-table/view-options.mjs +66 -0
- package/dist/components/ui/data-table/view-options.mjs.map +1 -0
- package/dist/components/ui/date-picker/calendar.mjs +466 -0
- package/dist/components/ui/date-picker/calendar.mjs.map +1 -0
- package/dist/components/ui/date-picker/date-picker.mjs +366 -0
- package/dist/components/ui/date-picker/date-picker.mjs.map +1 -0
- package/dist/components/ui/date-picker/index.mjs +17 -0
- package/dist/components/ui/date-picker/index.mjs.map +1 -0
- package/dist/components/ui/date-picker/presets.mjs +49 -0
- package/dist/components/ui/date-picker/presets.mjs.map +1 -0
- package/dist/components/ui/description-list/description-list.mjs +40 -0
- package/dist/components/ui/description-list/description-list.mjs.map +1 -0
- package/dist/components/ui/description-list/index.mjs +15 -0
- package/dist/components/ui/description-list/index.mjs.map +1 -0
- package/dist/components/ui/dialog/dialog-stepper.mjs +23 -0
- package/dist/components/ui/dialog/dialog-stepper.mjs.map +1 -0
- package/dist/components/ui/dialog/dialog.mjs +343 -0
- package/dist/components/ui/dialog/dialog.mjs.map +1 -0
- package/dist/components/ui/dialog/focus-return.mjs +21 -0
- package/dist/components/ui/dialog/focus-return.mjs.map +1 -0
- package/dist/components/ui/dialog/index.mjs +33 -0
- package/dist/components/ui/dialog/index.mjs.map +1 -0
- package/dist/components/ui/divider/divider.mjs +130 -0
- package/dist/components/ui/divider/divider.mjs.map +1 -0
- package/dist/components/ui/divider/index.mjs +6 -0
- package/dist/components/ui/divider/index.mjs.map +1 -0
- package/dist/components/ui/dock/dock.mjs +444 -0
- package/dist/components/ui/dock/dock.mjs.map +1 -0
- package/dist/components/ui/dock/index.mjs +19 -0
- package/dist/components/ui/dock/index.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-actions.mjs +118 -0
- package/dist/components/ui/document-editor/block-actions.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-commands.mjs +182 -0
- package/dist/components/ui/document-editor/block-commands.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-handle.mjs +387 -0
- package/dist/components/ui/document-editor/block-handle.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-morph.mjs +95 -0
- package/dist/components/ui/document-editor/block-morph.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-selection.mjs +81 -0
- package/dist/components/ui/document-editor/block-selection.mjs.map +1 -0
- package/dist/components/ui/document-editor/blocks.mjs +30 -0
- package/dist/components/ui/document-editor/blocks.mjs.map +1 -0
- package/dist/components/ui/document-editor/bubble-menu.mjs +120 -0
- package/dist/components/ui/document-editor/bubble-menu.mjs.map +1 -0
- package/dist/components/ui/document-editor/code-block.mjs +89 -0
- package/dist/components/ui/document-editor/code-block.mjs.map +1 -0
- package/dist/components/ui/document-editor/collaboration-types.mjs +9 -0
- package/dist/components/ui/document-editor/collaboration-types.mjs.map +1 -0
- package/dist/components/ui/document-editor/collaboration.mjs +198 -0
- package/dist/components/ui/document-editor/collaboration.mjs.map +1 -0
- package/dist/components/ui/document-editor/columns.mjs +52 -0
- package/dist/components/ui/document-editor/columns.mjs.map +1 -0
- package/dist/components/ui/document-editor/contents.mjs +60 -0
- package/dist/components/ui/document-editor/contents.mjs.map +1 -0
- package/dist/components/ui/document-editor/date-chip.mjs +115 -0
- package/dist/components/ui/document-editor/date-chip.mjs.map +1 -0
- package/dist/components/ui/document-editor/date-words.mjs +101 -0
- package/dist/components/ui/document-editor/date-words.mjs.map +1 -0
- package/dist/components/ui/document-editor/doc-labels.mjs +19 -0
- package/dist/components/ui/document-editor/doc-labels.mjs.map +1 -0
- package/dist/components/ui/document-editor/document-editor.mjs +496 -0
- package/dist/components/ui/document-editor/document-editor.mjs.map +1 -0
- package/dist/components/ui/document-editor/emoji-suggest.mjs +81 -0
- package/dist/components/ui/document-editor/emoji-suggest.mjs.map +1 -0
- package/dist/components/ui/document-editor/focus-mode.mjs +32 -0
- package/dist/components/ui/document-editor/focus-mode.mjs.map +1 -0
- package/dist/components/ui/document-editor/geometry.mjs +35 -0
- package/dist/components/ui/document-editor/geometry.mjs.map +1 -0
- package/dist/components/ui/document-editor/ghost-text.mjs +154 -0
- package/dist/components/ui/document-editor/ghost-text.mjs.map +1 -0
- package/dist/components/ui/document-editor/gliding-caret.mjs +118 -0
- package/dist/components/ui/document-editor/gliding-caret.mjs.map +1 -0
- package/dist/components/ui/document-editor/headings.mjs +64 -0
- package/dist/components/ui/document-editor/headings.mjs.map +1 -0
- package/dist/components/ui/document-editor/image.mjs +318 -0
- package/dist/components/ui/document-editor/image.mjs.map +1 -0
- package/dist/components/ui/document-editor/index.mjs +131 -0
- package/dist/components/ui/document-editor/index.mjs.map +1 -0
- package/dist/components/ui/document-editor/labels.mjs +96 -0
- package/dist/components/ui/document-editor/labels.mjs.map +1 -0
- package/dist/components/ui/document-editor/link-card.mjs +138 -0
- package/dist/components/ui/document-editor/link-card.mjs.map +1 -0
- package/dist/components/ui/document-editor/mentions.mjs +105 -0
- package/dist/components/ui/document-editor/mentions.mjs.map +1 -0
- package/dist/components/ui/document-editor/outline.mjs +138 -0
- package/dist/components/ui/document-editor/outline.mjs.map +1 -0
- package/dist/components/ui/document-editor/section-fold.mjs +124 -0
- package/dist/components/ui/document-editor/section-fold.mjs.map +1 -0
- package/dist/components/ui/document-editor/slash-command.mjs +210 -0
- package/dist/components/ui/document-editor/slash-command.mjs.map +1 -0
- package/dist/components/ui/document-editor/suggest-list.mjs +187 -0
- package/dist/components/ui/document-editor/suggest-list.mjs.map +1 -0
- package/dist/components/ui/document-editor/table.mjs +242 -0
- package/dist/components/ui/document-editor/table.mjs.map +1 -0
- package/dist/components/ui/document-editor/templates.mjs +66 -0
- package/dist/components/ui/document-editor/templates.mjs.map +1 -0
- package/dist/components/ui/document-editor/toggle.mjs +176 -0
- package/dist/components/ui/document-editor/toggle.mjs.map +1 -0
- package/dist/components/ui/document-editor/typography-rules.mjs +8 -0
- package/dist/components/ui/document-editor/typography-rules.mjs.map +1 -0
- package/dist/components/ui/document-editor/use-editor-value.mjs +34 -0
- package/dist/components/ui/document-editor/use-editor-value.mjs.map +1 -0
- package/dist/components/ui/drawer/drawer-nav.mjs +153 -0
- package/dist/components/ui/drawer/drawer-nav.mjs.map +1 -0
- package/dist/components/ui/drawer/drawer.mjs +334 -0
- package/dist/components/ui/drawer/drawer.mjs.map +1 -0
- package/dist/components/ui/drawer/index.mjs +37 -0
- package/dist/components/ui/drawer/index.mjs.map +1 -0
- package/dist/components/ui/drawer/use-swipe-to-close.mjs +77 -0
- package/dist/components/ui/drawer/use-swipe-to-close.mjs.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.mjs +567 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.mjs.map +1 -0
- package/dist/components/ui/dropdown-menu/index.mjs +43 -0
- package/dist/components/ui/dropdown-menu/index.mjs.map +1 -0
- package/dist/components/ui/editable-text/editable-text.mjs +148 -0
- package/dist/components/ui/editable-text/editable-text.mjs.map +1 -0
- package/dist/components/ui/editable-text/index.mjs +6 -0
- package/dist/components/ui/editable-text/index.mjs.map +1 -0
- package/dist/components/ui/emoji-picker/emoji-data.mjs +469 -0
- package/dist/components/ui/emoji-picker/emoji-data.mjs.map +1 -0
- package/dist/components/ui/emoji-picker/emoji-picker.mjs +464 -0
- package/dist/components/ui/emoji-picker/emoji-picker.mjs.map +1 -0
- package/dist/components/ui/emoji-picker/index.mjs +19 -0
- package/dist/components/ui/emoji-picker/index.mjs.map +1 -0
- package/dist/components/ui/empty-state/empty-state.mjs +110 -0
- package/dist/components/ui/empty-state/empty-state.mjs.map +1 -0
- package/dist/components/ui/empty-state/index.mjs +17 -0
- package/dist/components/ui/empty-state/index.mjs.map +1 -0
- package/dist/components/ui/event-calendar/calendar-math.mjs +256 -0
- package/dist/components/ui/event-calendar/calendar-math.mjs.map +1 -0
- package/dist/components/ui/event-calendar/context.mjs +51 -0
- package/dist/components/ui/event-calendar/context.mjs.map +1 -0
- package/dist/components/ui/event-calendar/editor.mjs +292 -0
- package/dist/components/ui/event-calendar/editor.mjs.map +1 -0
- package/dist/components/ui/event-calendar/event-block.mjs +55 -0
- package/dist/components/ui/event-calendar/event-block.mjs.map +1 -0
- package/dist/components/ui/event-calendar/event-calendar.mjs +438 -0
- package/dist/components/ui/event-calendar/event-calendar.mjs.map +1 -0
- package/dist/components/ui/event-calendar/event-keys.mjs +41 -0
- package/dist/components/ui/event-calendar/event-keys.mjs.map +1 -0
- package/dist/components/ui/event-calendar/index.mjs +37 -0
- package/dist/components/ui/event-calendar/index.mjs.map +1 -0
- package/dist/components/ui/event-calendar/month-grid.mjs +207 -0
- package/dist/components/ui/event-calendar/month-grid.mjs.map +1 -0
- package/dist/components/ui/event-calendar/narrow.mjs +193 -0
- package/dist/components/ui/event-calendar/narrow.mjs.map +1 -0
- package/dist/components/ui/event-calendar/time-grid.mjs +534 -0
- package/dist/components/ui/event-calendar/time-grid.mjs.map +1 -0
- package/dist/components/ui/expandable-search/expandable-search.mjs +174 -0
- package/dist/components/ui/expandable-search/expandable-search.mjs.map +1 -0
- package/dist/components/ui/expandable-search/index.mjs +6 -0
- package/dist/components/ui/expandable-search/index.mjs.map +1 -0
- package/dist/components/ui/field/field.mjs +444 -0
- package/dist/components/ui/field/field.mjs.map +1 -0
- package/dist/components/ui/field/index.mjs +21 -0
- package/dist/components/ui/field/index.mjs.map +1 -0
- package/dist/components/ui/file-card/file-card.mjs +198 -0
- package/dist/components/ui/file-card/file-card.mjs.map +1 -0
- package/dist/components/ui/file-card/file-icon.mjs +66 -0
- package/dist/components/ui/file-card/file-icon.mjs.map +1 -0
- package/dist/components/ui/file-card/file-types.mjs +70 -0
- package/dist/components/ui/file-card/file-types.mjs.map +1 -0
- package/dist/components/ui/file-card/index.mjs +32 -0
- package/dist/components/ui/file-card/index.mjs.map +1 -0
- package/dist/components/ui/file-preview/context.mjs +77 -0
- package/dist/components/ui/file-preview/context.mjs.map +1 -0
- package/dist/components/ui/file-preview/file-preview.mjs +865 -0
- package/dist/components/ui/file-preview/file-preview.mjs.map +1 -0
- package/dist/components/ui/file-preview/index.mjs +56 -0
- package/dist/components/ui/file-preview/index.mjs.map +1 -0
- package/dist/components/ui/file-preview/pdf.mjs +250 -0
- package/dist/components/ui/file-preview/pdf.mjs.map +1 -0
- package/dist/components/ui/file-preview/renderers.mjs +257 -0
- package/dist/components/ui/file-preview/renderers.mjs.map +1 -0
- package/dist/components/ui/file-upload/file-upload.mjs +633 -0
- package/dist/components/ui/file-upload/file-upload.mjs.map +1 -0
- package/dist/components/ui/file-upload/index.mjs +42 -0
- package/dist/components/ui/file-upload/index.mjs.map +1 -0
- package/dist/components/ui/file-upload/validate.mjs +111 -0
- package/dist/components/ui/file-upload/validate.mjs.map +1 -0
- package/dist/components/ui/flag/flag.mjs +39 -0
- package/dist/components/ui/flag/flag.mjs.map +1 -0
- package/dist/components/ui/flag/index.mjs +7 -0
- package/dist/components/ui/flag/index.mjs.map +1 -0
- package/dist/components/ui/floating-window/floating-window.mjs +255 -0
- package/dist/components/ui/floating-window/floating-window.mjs.map +1 -0
- package/dist/components/ui/floating-window/index.mjs +11 -0
- package/dist/components/ui/floating-window/index.mjs.map +1 -0
- package/dist/components/ui/form/form-section.mjs +87 -0
- package/dist/components/ui/form/form-section.mjs.map +1 -0
- package/dist/components/ui/form/form.mjs +205 -0
- package/dist/components/ui/form/form.mjs.map +1 -0
- package/dist/components/ui/form/index.mjs +29 -0
- package/dist/components/ui/form/index.mjs.map +1 -0
- package/dist/components/ui/globe/globe-data.mjs +9 -0
- package/dist/components/ui/globe/globe-data.mjs.map +1 -0
- package/dist/components/ui/globe/globe-math.mjs +269 -0
- package/dist/components/ui/globe/globe-math.mjs.map +1 -0
- package/dist/components/ui/globe/globe.mjs +719 -0
- package/dist/components/ui/globe/globe.mjs.map +1 -0
- package/dist/components/ui/globe/index.mjs +13 -0
- package/dist/components/ui/globe/index.mjs.map +1 -0
- package/dist/components/ui/highlight-match/highlight-children.mjs +13 -0
- package/dist/components/ui/highlight-match/highlight-children.mjs.map +1 -0
- package/dist/components/ui/highlight-match/highlight-match-variants.mjs +17 -0
- package/dist/components/ui/highlight-match/highlight-match-variants.mjs.map +1 -0
- package/dist/components/ui/highlight-match/highlight-match.mjs +37 -0
- package/dist/components/ui/highlight-match/highlight-match.mjs.map +1 -0
- package/dist/components/ui/highlight-match/index.mjs +15 -0
- package/dist/components/ui/highlight-match/index.mjs.map +1 -0
- package/dist/components/ui/highlight-match/match-ranges.mjs +50 -0
- package/dist/components/ui/highlight-match/match-ranges.mjs.map +1 -0
- package/dist/components/ui/histogram-slider/histogram-slider.mjs +83 -0
- package/dist/components/ui/histogram-slider/histogram-slider.mjs.map +1 -0
- package/dist/components/ui/histogram-slider/index.mjs +6 -0
- package/dist/components/ui/histogram-slider/index.mjs.map +1 -0
- package/dist/components/ui/hold-button/hold-button.mjs +258 -0
- package/dist/components/ui/hold-button/hold-button.mjs.map +1 -0
- package/dist/components/ui/hold-button/index.mjs +6 -0
- package/dist/components/ui/hold-button/index.mjs.map +1 -0
- package/dist/components/ui/hover-card/hover-card.mjs +111 -0
- package/dist/components/ui/hover-card/hover-card.mjs.map +1 -0
- package/dist/components/ui/hover-card/index.mjs +21 -0
- package/dist/components/ui/hover-card/index.mjs.map +1 -0
- package/dist/components/ui/ink-tray/index.mjs +29 -0
- package/dist/components/ui/ink-tray/index.mjs.map +1 -0
- package/dist/components/ui/ink-tray/ink-tray-art.mjs +68 -0
- package/dist/components/ui/ink-tray/ink-tray-art.mjs.map +1 -0
- package/dist/components/ui/ink-tray/ink-tray.mjs +350 -0
- package/dist/components/ui/ink-tray/ink-tray.mjs.map +1 -0
- package/dist/components/ui/input/index.mjs +41 -0
- package/dist/components/ui/input/index.mjs.map +1 -0
- package/dist/components/ui/input/input.mjs +268 -0
- package/dist/components/ui/input/input.mjs.map +1 -0
- package/dist/components/ui/input/number-input.mjs +272 -0
- package/dist/components/ui/input/number-input.mjs.map +1 -0
- package/dist/components/ui/input/password-input.mjs +49 -0
- package/dist/components/ui/input/password-input.mjs.map +1 -0
- package/dist/components/ui/input/phone-input-countries.mjs +216 -0
- package/dist/components/ui/input/phone-input-countries.mjs.map +1 -0
- package/dist/components/ui/input/phone-input.mjs +326 -0
- package/dist/components/ui/input/phone-input.mjs.map +1 -0
- package/dist/components/ui/input/use-controllable-state.mjs +24 -0
- package/dist/components/ui/input/use-controllable-state.mjs.map +1 -0
- package/dist/components/ui/input/use-hold-repeat.mjs +35 -0
- package/dist/components/ui/input/use-hold-repeat.mjs.map +1 -0
- package/dist/components/ui/input-group/index.mjs +11 -0
- package/dist/components/ui/input-group/index.mjs.map +1 -0
- package/dist/components/ui/input-group/input-group.mjs +78 -0
- package/dist/components/ui/input-group/input-group.mjs.map +1 -0
- package/dist/components/ui/island/index.mjs +23 -0
- package/dist/components/ui/island/index.mjs.map +1 -0
- package/dist/components/ui/island/island.mjs +328 -0
- package/dist/components/ui/island/island.mjs.map +1 -0
- package/dist/components/ui/kbd/index.mjs +6 -0
- package/dist/components/ui/kbd/index.mjs.map +1 -0
- package/dist/components/ui/kbd/kbd.mjs +73 -0
- package/dist/components/ui/kbd/kbd.mjs.map +1 -0
- package/dist/components/ui/keypad/index.mjs +23 -0
- package/dist/components/ui/keypad/index.mjs.map +1 -0
- package/dist/components/ui/keypad/keypad.mjs +345 -0
- package/dist/components/ui/keypad/keypad.mjs.map +1 -0
- package/dist/components/ui/label/index.mjs +7 -0
- package/dist/components/ui/label/index.mjs.map +1 -0
- package/dist/components/ui/label/label.mjs +117 -0
- package/dist/components/ui/label/label.mjs.map +1 -0
- package/dist/components/ui/lightbox/index.mjs +47 -0
- package/dist/components/ui/lightbox/index.mjs.map +1 -0
- package/dist/components/ui/lightbox/labels.mjs +23 -0
- package/dist/components/ui/lightbox/labels.mjs.map +1 -0
- package/dist/components/ui/lightbox/lightbox.mjs +1359 -0
- package/dist/components/ui/lightbox/lightbox.mjs.map +1 -0
- package/dist/components/ui/link/index.mjs +6 -0
- package/dist/components/ui/link/index.mjs.map +1 -0
- package/dist/components/ui/link/link.mjs +64 -0
- package/dist/components/ui/link/link.mjs.map +1 -0
- package/dist/components/ui/list/index.mjs +35 -0
- package/dist/components/ui/list/index.mjs.map +1 -0
- package/dist/components/ui/list/list.mjs +505 -0
- package/dist/components/ui/list/list.mjs.map +1 -0
- package/dist/components/ui/load-more/index.mjs +23 -0
- package/dist/components/ui/load-more/index.mjs.map +1 -0
- package/dist/components/ui/load-more/load-more.mjs +409 -0
- package/dist/components/ui/load-more/load-more.mjs.map +1 -0
- package/dist/components/ui/map/index.mjs +27 -0
- package/dist/components/ui/map/index.mjs.map +1 -0
- package/dist/components/ui/map/map-style.mjs +169 -0
- package/dist/components/ui/map/map-style.mjs.map +1 -0
- package/dist/components/ui/map/map.mjs +624 -0
- package/dist/components/ui/map/map.mjs.map +1 -0
- package/dist/components/ui/map-pin/index.mjs +6 -0
- package/dist/components/ui/map-pin/index.mjs.map +1 -0
- package/dist/components/ui/map-pin/map-pin.mjs +55 -0
- package/dist/components/ui/map-pin/map-pin.mjs.map +1 -0
- package/dist/components/ui/mention/index.mjs +29 -0
- package/dist/components/ui/mention/index.mjs.map +1 -0
- package/dist/components/ui/mention/mention.mjs +262 -0
- package/dist/components/ui/mention/mention.mjs.map +1 -0
- package/dist/components/ui/mention/split-mentions.mjs +24 -0
- package/dist/components/ui/mention/split-mentions.mjs.map +1 -0
- package/dist/components/ui/menubar/index.mjs +39 -0
- package/dist/components/ui/menubar/index.mjs.map +1 -0
- package/dist/components/ui/menubar/menubar.mjs +222 -0
- package/dist/components/ui/menubar/menubar.mjs.map +1 -0
- package/dist/components/ui/meter/index.mjs +21 -0
- package/dist/components/ui/meter/index.mjs.map +1 -0
- package/dist/components/ui/meter/meter.mjs +167 -0
- package/dist/components/ui/meter/meter.mjs.map +1 -0
- package/dist/components/ui/multi-select/index.mjs +25 -0
- package/dist/components/ui/multi-select/index.mjs.map +1 -0
- package/dist/components/ui/multi-select/multi-select.mjs +285 -0
- package/dist/components/ui/multi-select/multi-select.mjs.map +1 -0
- package/dist/components/ui/navigation-menu/index.mjs +41 -0
- package/dist/components/ui/navigation-menu/index.mjs.map +1 -0
- package/dist/components/ui/navigation-menu/navigation-menu.mjs +396 -0
- package/dist/components/ui/navigation-menu/navigation-menu.mjs.map +1 -0
- package/dist/components/ui/notebook-page/index.mjs +15 -0
- package/dist/components/ui/notebook-page/index.mjs.map +1 -0
- package/dist/components/ui/notebook-page/notebook-page.mjs +162 -0
- package/dist/components/ui/notebook-page/notebook-page.mjs.map +1 -0
- package/dist/components/ui/notification-inbox/index.mjs +47 -0
- package/dist/components/ui/notification-inbox/index.mjs.map +1 -0
- package/dist/components/ui/notification-inbox/notification-inbox.mjs +422 -0
- package/dist/components/ui/notification-inbox/notification-inbox.mjs.map +1 -0
- package/dist/components/ui/number-field/index.mjs +24 -0
- package/dist/components/ui/number-field/index.mjs.map +1 -0
- package/dist/components/ui/number-field/number-field.mjs +460 -0
- package/dist/components/ui/number-field/number-field.mjs.map +1 -0
- package/dist/components/ui/number-field/number-format.mjs +48 -0
- package/dist/components/ui/number-field/number-format.mjs.map +1 -0
- package/dist/components/ui/otp-input/index.mjs +9 -0
- package/dist/components/ui/otp-input/index.mjs.map +1 -0
- package/dist/components/ui/otp-input/otp-input.mjs +285 -0
- package/dist/components/ui/otp-input/otp-input.mjs.map +1 -0
- package/dist/components/ui/pager/index.mjs +7 -0
- package/dist/components/ui/pager/index.mjs.map +1 -0
- package/dist/components/ui/pager/pager.mjs +86 -0
- package/dist/components/ui/pager/pager.mjs.map +1 -0
- package/dist/components/ui/pagination/index.mjs +23 -0
- package/dist/components/ui/pagination/index.mjs.map +1 -0
- package/dist/components/ui/pagination/pagination.mjs +210 -0
- package/dist/components/ui/pagination/pagination.mjs.map +1 -0
- package/dist/components/ui/password-strength/index.mjs +21 -0
- package/dist/components/ui/password-strength/index.mjs.map +1 -0
- package/dist/components/ui/password-strength/password-rules.mjs +25 -0
- package/dist/components/ui/password-strength/password-rules.mjs.map +1 -0
- package/dist/components/ui/password-strength/password-strength.mjs +125 -0
- package/dist/components/ui/password-strength/password-strength.mjs.map +1 -0
- package/dist/components/ui/popover/index.mjs +31 -0
- package/dist/components/ui/popover/index.mjs.map +1 -0
- package/dist/components/ui/popover/popover.mjs +574 -0
- package/dist/components/ui/popover/popover.mjs.map +1 -0
- package/dist/components/ui/progress/index.mjs +15 -0
- package/dist/components/ui/progress/index.mjs.map +1 -0
- package/dist/components/ui/progress/progress.mjs +224 -0
- package/dist/components/ui/progress/progress.mjs.map +1 -0
- package/dist/components/ui/prose/index.mjs +6 -0
- package/dist/components/ui/prose/index.mjs.map +1 -0
- package/dist/components/ui/prose/prose.mjs +89 -0
- package/dist/components/ui/prose/prose.mjs.map +1 -0
- package/dist/components/ui/radio-group/index.mjs +15 -0
- package/dist/components/ui/radio-group/index.mjs.map +1 -0
- package/dist/components/ui/radio-group/radio-group.mjs +88 -0
- package/dist/components/ui/radio-group/radio-group.mjs.map +1 -0
- package/dist/components/ui/rating/index.mjs +6 -0
- package/dist/components/ui/rating/index.mjs.map +1 -0
- package/dist/components/ui/rating/rating.mjs +119 -0
- package/dist/components/ui/rating/rating.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/bubble-menu.mjs +120 -0
- package/dist/components/ui/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/image-links.mjs +63 -0
- package/dist/components/ui/rich-text-editor/image-links.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/index.mjs +37 -0
- package/dist/components/ui/rich-text-editor/index.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/labels.mjs +27 -0
- package/dist/components/ui/rich-text-editor/labels.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/rich-text-editor.mjs +149 -0
- package/dist/components/ui/rich-text-editor/rich-text-editor.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/toolbar.mjs +325 -0
- package/dist/components/ui/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/components/ui/save-bar/index.mjs +13 -0
- package/dist/components/ui/save-bar/index.mjs.map +1 -0
- package/dist/components/ui/save-bar/save-bar.mjs +59 -0
- package/dist/components/ui/save-bar/save-bar.mjs.map +1 -0
- package/dist/components/ui/scroll-area/index.mjs +6 -0
- package/dist/components/ui/scroll-area/index.mjs.map +1 -0
- package/dist/components/ui/scroll-area/scroll-area.mjs +148 -0
- package/dist/components/ui/scroll-area/scroll-area.mjs.map +1 -0
- package/dist/components/ui/scroll-area/use-drag-scroll.mjs +134 -0
- package/dist/components/ui/scroll-area/use-drag-scroll.mjs.map +1 -0
- package/dist/components/ui/select/index.mjs +23 -0
- package/dist/components/ui/select/index.mjs.map +1 -0
- package/dist/components/ui/select/select.mjs +216 -0
- package/dist/components/ui/select/select.mjs.map +1 -0
- package/dist/components/ui/sheet/index.mjs +23 -0
- package/dist/components/ui/sheet/index.mjs.map +1 -0
- package/dist/components/ui/sheet/sheet.mjs +292 -0
- package/dist/components/ui/sheet/sheet.mjs.map +1 -0
- package/dist/components/ui/sidebar/index.mjs +122 -0
- package/dist/components/ui/sidebar/index.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-group.mjs +75 -0
- package/dist/components/ui/sidebar/sidebar-group.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-item.mjs +199 -0
- package/dist/components/ui/sidebar/sidebar-item.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-panels.mjs +182 -0
- package/dist/components/ui/sidebar/sidebar-panels.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-peek.mjs +324 -0
- package/dist/components/ui/sidebar/sidebar-peek.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-rich.mjs +65 -0
- package/dist/components/ui/sidebar/sidebar-rich.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-tree.mjs +224 -0
- package/dist/components/ui/sidebar/sidebar-tree.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar.mjs +205 -0
- package/dist/components/ui/sidebar/sidebar.mjs.map +1 -0
- package/dist/components/ui/sidebar/variants.mjs +396 -0
- package/dist/components/ui/sidebar/variants.mjs.map +1 -0
- package/dist/components/ui/signature/index.mjs +6 -0
- package/dist/components/ui/signature/index.mjs.map +1 -0
- package/dist/components/ui/signature/signature.mjs +145 -0
- package/dist/components/ui/signature/signature.mjs.map +1 -0
- package/dist/components/ui/signature-pad/index.mjs +19 -0
- package/dist/components/ui/signature-pad/index.mjs.map +1 -0
- package/dist/components/ui/signature-pad/signature-pad.mjs +210 -0
- package/dist/components/ui/signature-pad/signature-pad.mjs.map +1 -0
- package/dist/components/ui/signature-pad/strokes.mjs +68 -0
- package/dist/components/ui/signature-pad/strokes.mjs.map +1 -0
- package/dist/components/ui/skeleton/index.mjs +9 -0
- package/dist/components/ui/skeleton/index.mjs.map +1 -0
- package/dist/components/ui/skeleton/skeleton.mjs +58 -0
- package/dist/components/ui/skeleton/skeleton.mjs.map +1 -0
- package/dist/components/ui/slide/index.mjs +25 -0
- package/dist/components/ui/slide/index.mjs.map +1 -0
- package/dist/components/ui/slide/slide.mjs +159 -0
- package/dist/components/ui/slide/slide.mjs.map +1 -0
- package/dist/components/ui/slider/index.mjs +21 -0
- package/dist/components/ui/slider/index.mjs.map +1 -0
- package/dist/components/ui/slider/slider-input.mjs +449 -0
- package/dist/components/ui/slider/slider-input.mjs.map +1 -0
- package/dist/components/ui/slider/slider.mjs +235 -0
- package/dist/components/ui/slider/slider.mjs.map +1 -0
- package/dist/components/ui/slides/index.mjs +31 -0
- package/dist/components/ui/slides/index.mjs.map +1 -0
- package/dist/components/ui/slides/slides.mjs +890 -0
- package/dist/components/ui/slides/slides.mjs.map +1 -0
- package/dist/components/ui/smooth-anchors/index.mjs +17 -0
- package/dist/components/ui/smooth-anchors/index.mjs.map +1 -0
- package/dist/components/ui/smooth-anchors/smooth-anchors.mjs +75 -0
- package/dist/components/ui/smooth-anchors/smooth-anchors.mjs.map +1 -0
- package/dist/components/ui/smooth-anchors/smooth-scroll.mjs +87 -0
- package/dist/components/ui/smooth-anchors/smooth-scroll.mjs.map +1 -0
- package/dist/components/ui/spinner/index.mjs +6 -0
- package/dist/components/ui/spinner/index.mjs.map +1 -0
- package/dist/components/ui/spinner/spinner.mjs +49 -0
- package/dist/components/ui/spinner/spinner.mjs.map +1 -0
- package/dist/components/ui/stat/index.mjs +29 -0
- package/dist/components/ui/stat/index.mjs.map +1 -0
- package/dist/components/ui/stat/stat.mjs +226 -0
- package/dist/components/ui/stat/stat.mjs.map +1 -0
- package/dist/components/ui/status-bar/index.mjs +17 -0
- package/dist/components/ui/status-bar/index.mjs.map +1 -0
- package/dist/components/ui/status-bar/status-bar.mjs +96 -0
- package/dist/components/ui/status-bar/status-bar.mjs.map +1 -0
- package/dist/components/ui/stepper/index.mjs +25 -0
- package/dist/components/ui/stepper/index.mjs.map +1 -0
- package/dist/components/ui/stepper/stepper.mjs +235 -0
- package/dist/components/ui/stepper/stepper.mjs.map +1 -0
- package/dist/components/ui/steps/index.mjs +9 -0
- package/dist/components/ui/steps/index.mjs.map +1 -0
- package/dist/components/ui/steps/steps.mjs +70 -0
- package/dist/components/ui/steps/steps.mjs.map +1 -0
- package/dist/components/ui/swatch-grid/index.mjs +7 -0
- package/dist/components/ui/swatch-grid/index.mjs.map +1 -0
- package/dist/components/ui/swatch-grid/swatch-grid.mjs +110 -0
- package/dist/components/ui/swatch-grid/swatch-grid.mjs.map +1 -0
- package/dist/components/ui/switch/index.mjs +7 -0
- package/dist/components/ui/switch/index.mjs.map +1 -0
- package/dist/components/ui/switch/switch.mjs +79 -0
- package/dist/components/ui/switch/switch.mjs.map +1 -0
- package/dist/components/ui/tab-strip/index.mjs +13 -0
- package/dist/components/ui/tab-strip/index.mjs.map +1 -0
- package/dist/components/ui/tab-strip/tab-strip.mjs +244 -0
- package/dist/components/ui/tab-strip/tab-strip.mjs.map +1 -0
- package/dist/components/ui/table/index.mjs +27 -0
- package/dist/components/ui/table/index.mjs.map +1 -0
- package/dist/components/ui/table/table.mjs +290 -0
- package/dist/components/ui/table/table.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/index.mjs +20 -0
- package/dist/components/ui/table-of-contents/index.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/scroll-spy.mjs +60 -0
- package/dist/components/ui/table-of-contents/scroll-spy.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/table-of-contents.mjs +371 -0
- package/dist/components/ui/table-of-contents/table-of-contents.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/use-headings.mjs +40 -0
- package/dist/components/ui/table-of-contents/use-headings.mjs.map +1 -0
- package/dist/components/ui/tablet-frame/index.mjs +7 -0
- package/dist/components/ui/tablet-frame/index.mjs.map +1 -0
- package/dist/components/ui/tablet-frame/tablet-frame.mjs +48 -0
- package/dist/components/ui/tablet-frame/tablet-frame.mjs.map +1 -0
- package/dist/components/ui/tabs/index.mjs +25 -0
- package/dist/components/ui/tabs/index.mjs.map +1 -0
- package/dist/components/ui/tabs/tabs.mjs +382 -0
- package/dist/components/ui/tabs/tabs.mjs.map +1 -0
- package/dist/components/ui/tabs/use-tabs-indicator.mjs +90 -0
- package/dist/components/ui/tabs/use-tabs-indicator.mjs.map +1 -0
- package/dist/components/ui/tags-input/index.mjs +9 -0
- package/dist/components/ui/tags-input/index.mjs.map +1 -0
- package/dist/components/ui/tags-input/split.mjs +38 -0
- package/dist/components/ui/tags-input/split.mjs.map +1 -0
- package/dist/components/ui/tags-input/tags-input.mjs +328 -0
- package/dist/components/ui/tags-input/tags-input.mjs.map +1 -0
- package/dist/components/ui/terminal/index.mjs +41 -0
- package/dist/components/ui/terminal/index.mjs.map +1 -0
- package/dist/components/ui/terminal/terminal.mjs +287 -0
- package/dist/components/ui/terminal/terminal.mjs.map +1 -0
- package/dist/components/ui/textarea/index.mjs +21 -0
- package/dist/components/ui/textarea/index.mjs.map +1 -0
- package/dist/components/ui/textarea/textarea.mjs +244 -0
- package/dist/components/ui/textarea/textarea.mjs.map +1 -0
- package/dist/components/ui/theme-provider/index.mjs +6 -0
- package/dist/components/ui/theme-provider/index.mjs.map +1 -0
- package/dist/components/ui/theme-provider/theme-provider.mjs +70 -0
- package/dist/components/ui/theme-provider/theme-provider.mjs.map +1 -0
- package/dist/components/ui/toast/index.mjs +19 -0
- package/dist/components/ui/toast/index.mjs.map +1 -0
- package/dist/components/ui/toast/store.mjs +96 -0
- package/dist/components/ui/toast/store.mjs.map +1 -0
- package/dist/components/ui/toast/toast.mjs +395 -0
- package/dist/components/ui/toast/toast.mjs.map +1 -0
- package/dist/components/ui/toggle/index.mjs +13 -0
- package/dist/components/ui/toggle/index.mjs.map +1 -0
- package/dist/components/ui/toggle/toggle.mjs +123 -0
- package/dist/components/ui/toggle/toggle.mjs.map +1 -0
- package/dist/components/ui/toggle-group/index.mjs +11 -0
- package/dist/components/ui/toggle-group/index.mjs.map +1 -0
- package/dist/components/ui/toggle-group/toggle-group.mjs +243 -0
- package/dist/components/ui/toggle-group/toggle-group.mjs.map +1 -0
- package/dist/components/ui/toggletip/index.mjs +6 -0
- package/dist/components/ui/toggletip/index.mjs.map +1 -0
- package/dist/components/ui/toggletip/toggletip.mjs +95 -0
- package/dist/components/ui/toggletip/toggletip.mjs.map +1 -0
- package/dist/components/ui/toolbar/index.mjs +21 -0
- package/dist/components/ui/toolbar/index.mjs.map +1 -0
- package/dist/components/ui/toolbar/toolbar.mjs +130 -0
- package/dist/components/ui/toolbar/toolbar.mjs.map +1 -0
- package/dist/components/ui/tooltip/index.mjs +29 -0
- package/dist/components/ui/tooltip/index.mjs.map +1 -0
- package/dist/components/ui/tooltip/tooltip.mjs +640 -0
- package/dist/components/ui/tooltip/tooltip.mjs.map +1 -0
- package/dist/components/ui/tree/index.mjs +11 -0
- package/dist/components/ui/tree/index.mjs.map +1 -0
- package/dist/components/ui/tree/tree.mjs +450 -0
- package/dist/components/ui/tree/tree.mjs.map +1 -0
- package/dist/index.d.mts +19397 -0
- package/dist/index.mjs +157 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/color.mjs +78 -0
- package/dist/lib/color.mjs.map +1 -0
- package/dist/lib/create-context.mjs +31 -0
- package/dist/lib/create-context.mjs.map +1 -0
- package/dist/lib/date.mjs +116 -0
- package/dist/lib/date.mjs.map +1 -0
- package/dist/lib/density.mjs +79 -0
- package/dist/lib/density.mjs.map +1 -0
- package/dist/lib/field-context.mjs +13 -0
- package/dist/lib/field-context.mjs.map +1 -0
- package/dist/lib/filter.mjs +28 -0
- package/dist/lib/filter.mjs.map +1 -0
- package/dist/lib/gesture.mjs +38 -0
- package/dist/lib/gesture.mjs.map +1 -0
- package/dist/lib/hit-area.mjs +14 -0
- package/dist/lib/hit-area.mjs.map +1 -0
- package/dist/lib/labels.mjs +27 -0
- package/dist/lib/labels.mjs.map +1 -0
- package/dist/lib/morph-box.mjs +56 -0
- package/dist/lib/morph-box.mjs.map +1 -0
- package/dist/lib/motion.mjs +70 -0
- package/dist/lib/motion.mjs.map +1 -0
- package/dist/lib/pulse.mjs +69 -0
- package/dist/lib/pulse.mjs.map +1 -0
- package/dist/lib/roving-focus.mjs +74 -0
- package/dist/lib/roving-focus.mjs.map +1 -0
- package/dist/lib/theme.mjs +67 -0
- package/dist/lib/theme.mjs.map +1 -0
- package/dist/lib/tv.mjs +11 -0
- package/dist/lib/tv.mjs.map +1 -0
- package/dist/lib/utils.mjs +82 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +133 -4
|
@@ -0,0 +1,890 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ArrowDown, ArrowUp, CaretLeft, CaretRight, Copy, Monitor, Play, Rows, SquaresFour, Trash, X } from "atoms-icons";
|
|
5
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
6
|
+
import { Button } from "../button/index.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ContextMenu,
|
|
9
|
+
ContextMenuContent,
|
|
10
|
+
ContextMenuItem,
|
|
11
|
+
ContextMenuSeparator,
|
|
12
|
+
ContextMenuShortcut,
|
|
13
|
+
ContextMenuTrigger
|
|
14
|
+
} from "../context-menu/index.mjs";
|
|
15
|
+
import { useControllableState } from "../input/use-controllable-state.mjs";
|
|
16
|
+
import { SlidePositionContext } from "../slide/index.mjs";
|
|
17
|
+
import { DRAG_SLOP } from "../../../lib/gesture.mjs";
|
|
18
|
+
import { duration, easing, prefersReducedMotion } from "../../../lib/motion.mjs";
|
|
19
|
+
import { cn } from "../../../lib/utils.mjs";
|
|
20
|
+
const defaultLabels = {
|
|
21
|
+
deck: "Slides",
|
|
22
|
+
rail: "Slides",
|
|
23
|
+
grid: "All slides",
|
|
24
|
+
previous: "Previous slide",
|
|
25
|
+
next: "Next slide",
|
|
26
|
+
gridView: "Grid view",
|
|
27
|
+
editView: "Editor view",
|
|
28
|
+
present: "Present",
|
|
29
|
+
notes: "Speaker notes",
|
|
30
|
+
notesPlaceholder: "Speaker notes\u2026",
|
|
31
|
+
presenterView: "Presenter view",
|
|
32
|
+
exit: "Exit",
|
|
33
|
+
nextUp: "Next",
|
|
34
|
+
presentFromHere: "Present from here",
|
|
35
|
+
duplicate: "Duplicate",
|
|
36
|
+
moveUp: "Move up",
|
|
37
|
+
moveDown: "Move down",
|
|
38
|
+
delete: "Delete",
|
|
39
|
+
counter: (index, total) => `Slide ${index + 1} of ${total}`
|
|
40
|
+
};
|
|
41
|
+
const SlidesContext = React.createContext(null);
|
|
42
|
+
function useSlides(consumer) {
|
|
43
|
+
const context = React.useContext(SlidesContext);
|
|
44
|
+
if (!context) throw new Error(`\`${consumer}\` must be used within \`Slides\``);
|
|
45
|
+
return context;
|
|
46
|
+
}
|
|
47
|
+
function DeckSlide({ item, index, total }) {
|
|
48
|
+
const position = React.useMemo(() => ({ index, total }), [index, total]);
|
|
49
|
+
return /* @__PURE__ */ jsx(SlidePositionContext.Provider, { value: position, children: item.content });
|
|
50
|
+
}
|
|
51
|
+
function Slides({
|
|
52
|
+
slides,
|
|
53
|
+
onSlidesChange,
|
|
54
|
+
value: valueProp,
|
|
55
|
+
defaultValue,
|
|
56
|
+
onValueChange,
|
|
57
|
+
view: viewProp,
|
|
58
|
+
defaultView = "edit",
|
|
59
|
+
onViewChange,
|
|
60
|
+
presenting: presentingProp,
|
|
61
|
+
defaultPresenting = false,
|
|
62
|
+
onPresentingChange,
|
|
63
|
+
aspectRatio = 16 / 9,
|
|
64
|
+
labels: labelsProp,
|
|
65
|
+
className,
|
|
66
|
+
style,
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}) {
|
|
70
|
+
const [value, setValue] = useControllableState({ prop: valueProp, defaultProp: defaultValue ?? slides[0]?.id ?? "", onChange: onValueChange });
|
|
71
|
+
const [view, setView] = useControllableState({ prop: viewProp, defaultProp: defaultView, onChange: onViewChange });
|
|
72
|
+
const [presenting, setPresenting] = useControllableState({ prop: presentingProp, defaultProp: defaultPresenting, onChange: onPresentingChange });
|
|
73
|
+
const labels = React.useMemo(() => ({ ...defaultLabels, ...labelsProp }), [labelsProp]);
|
|
74
|
+
const flight = React.useRef(null);
|
|
75
|
+
const setFlight = React.useCallback((next) => {
|
|
76
|
+
flight.current = next;
|
|
77
|
+
}, []);
|
|
78
|
+
const takeFlight = React.useCallback((id) => {
|
|
79
|
+
const stored = flight.current;
|
|
80
|
+
if (!stored || id !== void 0 && stored.id !== id) return null;
|
|
81
|
+
flight.current = null;
|
|
82
|
+
return stored;
|
|
83
|
+
}, []);
|
|
84
|
+
const found = slides.findIndex((slide) => slide.id === value);
|
|
85
|
+
const index = found === -1 ? 0 : found;
|
|
86
|
+
const current = slides[index];
|
|
87
|
+
const go = React.useCallback(
|
|
88
|
+
(delta) => {
|
|
89
|
+
const next = slides[Math.min(Math.max(index + delta, 0), slides.length - 1)];
|
|
90
|
+
if (next) setValue(next.id);
|
|
91
|
+
},
|
|
92
|
+
[slides, index, setValue]
|
|
93
|
+
);
|
|
94
|
+
const move = React.useCallback(
|
|
95
|
+
(from, to) => {
|
|
96
|
+
if (!onSlidesChange || from === to || to < 0 || to >= slides.length) return;
|
|
97
|
+
const next = slides.slice();
|
|
98
|
+
const [item] = next.splice(from, 1);
|
|
99
|
+
next.splice(to, 0, item);
|
|
100
|
+
onSlidesChange(next);
|
|
101
|
+
},
|
|
102
|
+
[slides, onSlidesChange]
|
|
103
|
+
);
|
|
104
|
+
const duplicate = React.useCallback(
|
|
105
|
+
(id) => {
|
|
106
|
+
const at = slides.findIndex((slide) => slide.id === id);
|
|
107
|
+
if (!onSlidesChange || at === -1) return;
|
|
108
|
+
const copy = { ...slides[at], id: `${id}-copy-${Math.random().toString(36).slice(2, 7)}` };
|
|
109
|
+
onSlidesChange([...slides.slice(0, at + 1), copy, ...slides.slice(at + 1)]);
|
|
110
|
+
setValue(copy.id);
|
|
111
|
+
},
|
|
112
|
+
[slides, onSlidesChange, setValue]
|
|
113
|
+
);
|
|
114
|
+
const remove = React.useCallback(
|
|
115
|
+
(id) => {
|
|
116
|
+
const at = slides.findIndex((slide) => slide.id === id);
|
|
117
|
+
if (!onSlidesChange || at === -1 || slides.length <= 1) return;
|
|
118
|
+
const next = slides.filter((slide) => slide.id !== id);
|
|
119
|
+
onSlidesChange(next);
|
|
120
|
+
if (id === value) setValue(next[Math.min(at, next.length - 1)].id);
|
|
121
|
+
},
|
|
122
|
+
[slides, onSlidesChange, value, setValue]
|
|
123
|
+
);
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
SlidesContext.Provider,
|
|
126
|
+
{
|
|
127
|
+
value: {
|
|
128
|
+
slides,
|
|
129
|
+
setSlides: onSlidesChange,
|
|
130
|
+
index,
|
|
131
|
+
current,
|
|
132
|
+
select: setValue,
|
|
133
|
+
go,
|
|
134
|
+
view,
|
|
135
|
+
setView,
|
|
136
|
+
presenting,
|
|
137
|
+
setPresenting,
|
|
138
|
+
aspectRatio,
|
|
139
|
+
labels,
|
|
140
|
+
setFlight,
|
|
141
|
+
takeFlight,
|
|
142
|
+
move,
|
|
143
|
+
duplicate,
|
|
144
|
+
remove
|
|
145
|
+
},
|
|
146
|
+
children: /* @__PURE__ */ jsxs(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
role: "region",
|
|
150
|
+
"aria-label": labels.deck,
|
|
151
|
+
"data-slot": "slides",
|
|
152
|
+
"data-view": view,
|
|
153
|
+
className: cn("group/slides @container/slides relative min-h-0 rounded-xl shadow-xs ring-1 ring-edge w-full", className),
|
|
154
|
+
style: { "--slides-ratio": aspectRatio, ...style },
|
|
155
|
+
...props,
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
"data-slot": "slides-body",
|
|
161
|
+
className: "grid size-full min-h-0 gap-2 p-2 grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto_auto] @xl/slides:grid-cols-[auto_minmax(0,1fr)] @xl/slides:grid-rows-[auto_minmax(0,1fr)_auto]",
|
|
162
|
+
children
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ jsx(SlidesShow, {})
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
function SlidesToolbar({ className, ...props }) {
|
|
173
|
+
return /* @__PURE__ */ jsx(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
role: "toolbar",
|
|
177
|
+
"data-slot": "slides-toolbar",
|
|
178
|
+
className: cn("col-span-full row-start-1 flex h-10 min-w-0 items-center gap-1 pr-1 pl-2", className),
|
|
179
|
+
...props
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function SlidesTitle({ className, ...props }) {
|
|
184
|
+
return /* @__PURE__ */ jsx("h2", { "data-slot": "slides-title", className: cn("mr-auto min-w-0 truncate text-sm font-medium text-foreground", className), ...props });
|
|
185
|
+
}
|
|
186
|
+
function SlidesPrevious({ onClick, ...props }) {
|
|
187
|
+
const { go, index, labels } = useSlides("SlidesPrevious");
|
|
188
|
+
return /* @__PURE__ */ jsx(
|
|
189
|
+
Button,
|
|
190
|
+
{
|
|
191
|
+
variant: "ghost",
|
|
192
|
+
size: "sm",
|
|
193
|
+
iconOnly: true,
|
|
194
|
+
"aria-label": labels.previous,
|
|
195
|
+
tooltip: labels.previous,
|
|
196
|
+
"data-slot": "slides-previous",
|
|
197
|
+
disabled: index === 0,
|
|
198
|
+
onClick: (event) => {
|
|
199
|
+
onClick?.(event);
|
|
200
|
+
if (!event.defaultPrevented) go(-1);
|
|
201
|
+
},
|
|
202
|
+
...props,
|
|
203
|
+
children: /* @__PURE__ */ jsx(CaretLeft, {})
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
function SlidesNext({ onClick, ...props }) {
|
|
208
|
+
const { go, index, slides, labels } = useSlides("SlidesNext");
|
|
209
|
+
return /* @__PURE__ */ jsx(
|
|
210
|
+
Button,
|
|
211
|
+
{
|
|
212
|
+
variant: "ghost",
|
|
213
|
+
size: "sm",
|
|
214
|
+
iconOnly: true,
|
|
215
|
+
"aria-label": labels.next,
|
|
216
|
+
tooltip: labels.next,
|
|
217
|
+
"data-slot": "slides-next",
|
|
218
|
+
disabled: index >= slides.length - 1,
|
|
219
|
+
onClick: (event) => {
|
|
220
|
+
onClick?.(event);
|
|
221
|
+
if (!event.defaultPrevented) go(1);
|
|
222
|
+
},
|
|
223
|
+
...props,
|
|
224
|
+
children: /* @__PURE__ */ jsx(CaretRight, {})
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
function SlidesCounter({ className, ...props }) {
|
|
229
|
+
const { index, slides, labels } = useSlides("SlidesCounter");
|
|
230
|
+
return /* @__PURE__ */ jsxs("span", { "data-slot": "slides-counter", className: cn("px-2 text-sm text-muted-foreground tabular-nums", className), ...props, children: [
|
|
231
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": true, children: [
|
|
232
|
+
index + 1,
|
|
233
|
+
" / ",
|
|
234
|
+
slides.length
|
|
235
|
+
] }),
|
|
236
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.counter(index, slides.length) })
|
|
237
|
+
] });
|
|
238
|
+
}
|
|
239
|
+
function SlidesViewToggle({ onClick, ...props }) {
|
|
240
|
+
const { view, setView, labels, current, setFlight } = useSlides("SlidesViewToggle");
|
|
241
|
+
const label = view === "grid" ? labels.editView : labels.gridView;
|
|
242
|
+
return /* @__PURE__ */ jsx(
|
|
243
|
+
Button,
|
|
244
|
+
{
|
|
245
|
+
variant: "ghost",
|
|
246
|
+
size: "sm",
|
|
247
|
+
iconOnly: true,
|
|
248
|
+
"aria-label": label,
|
|
249
|
+
"aria-pressed": view === "grid",
|
|
250
|
+
tooltip: label,
|
|
251
|
+
"data-slot": "slides-view-toggle",
|
|
252
|
+
onClick: (event) => {
|
|
253
|
+
onClick?.(event);
|
|
254
|
+
if (event.defaultPrevented) return;
|
|
255
|
+
if (view === "edit") {
|
|
256
|
+
const frame = event.currentTarget.closest("[data-slot=slides]")?.querySelector("[data-slot=slides-frame]");
|
|
257
|
+
setFlight(frame && current ? { id: current.id, rect: frame.getBoundingClientRect() } : null);
|
|
258
|
+
}
|
|
259
|
+
setView(view === "grid" ? "edit" : "grid");
|
|
260
|
+
},
|
|
261
|
+
...props,
|
|
262
|
+
children: view === "grid" ? /* @__PURE__ */ jsx(Rows, {}) : /* @__PURE__ */ jsx(SquaresFour, {})
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
function SlidesPresent({ onClick, children, className, ...props }) {
|
|
267
|
+
const { setPresenting, labels } = useSlides("SlidesPresent");
|
|
268
|
+
return /* @__PURE__ */ jsx(
|
|
269
|
+
Button,
|
|
270
|
+
{
|
|
271
|
+
size: "sm",
|
|
272
|
+
"data-slot": "slides-present",
|
|
273
|
+
className: cn("ml-1", className),
|
|
274
|
+
onClick: (event) => {
|
|
275
|
+
onClick?.(event);
|
|
276
|
+
if (!event.defaultPrevented) setPresenting(true);
|
|
277
|
+
},
|
|
278
|
+
...props,
|
|
279
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
280
|
+
/* @__PURE__ */ jsx(Play, {}),
|
|
281
|
+
labels.present
|
|
282
|
+
] })
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
function SlideActions({ item, index, children }) {
|
|
287
|
+
const ctx = useSlides("SlidesRail");
|
|
288
|
+
if (!ctx.setSlides) {
|
|
289
|
+
return /* @__PURE__ */ jsxs(ContextMenu, { children: [
|
|
290
|
+
/* @__PURE__ */ jsx(ContextMenuTrigger, { asChild: true, children }),
|
|
291
|
+
/* @__PURE__ */ jsx(ContextMenuContent, { className: "w-52", children: /* @__PURE__ */ jsxs(
|
|
292
|
+
ContextMenuItem,
|
|
293
|
+
{
|
|
294
|
+
onSelect: () => {
|
|
295
|
+
ctx.select(item.id);
|
|
296
|
+
ctx.setPresenting(true);
|
|
297
|
+
},
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ jsx(Play, {}),
|
|
300
|
+
" ",
|
|
301
|
+
ctx.labels.presentFromHere
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
) })
|
|
305
|
+
] });
|
|
306
|
+
}
|
|
307
|
+
return /* @__PURE__ */ jsxs(ContextMenu, { children: [
|
|
308
|
+
/* @__PURE__ */ jsx(ContextMenuTrigger, { asChild: true, children }),
|
|
309
|
+
/* @__PURE__ */ jsxs(ContextMenuContent, { className: "w-52", children: [
|
|
310
|
+
/* @__PURE__ */ jsxs(
|
|
311
|
+
ContextMenuItem,
|
|
312
|
+
{
|
|
313
|
+
onSelect: () => {
|
|
314
|
+
ctx.select(item.id);
|
|
315
|
+
ctx.setPresenting(true);
|
|
316
|
+
},
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ jsx(Play, {}),
|
|
319
|
+
" ",
|
|
320
|
+
ctx.labels.presentFromHere
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
),
|
|
324
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, { onSelect: () => ctx.duplicate(item.id), children: [
|
|
325
|
+
/* @__PURE__ */ jsx(Copy, {}),
|
|
326
|
+
" ",
|
|
327
|
+
ctx.labels.duplicate,
|
|
328
|
+
/* @__PURE__ */ jsx(ContextMenuShortcut, { children: "\u2318D" })
|
|
329
|
+
] }),
|
|
330
|
+
/* @__PURE__ */ jsx(ContextMenuSeparator, {}),
|
|
331
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, { disabled: index === 0, onSelect: () => ctx.move(index, index - 1), children: [
|
|
332
|
+
/* @__PURE__ */ jsx(ArrowUp, {}),
|
|
333
|
+
" ",
|
|
334
|
+
ctx.labels.moveUp
|
|
335
|
+
] }),
|
|
336
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, { disabled: index === ctx.slides.length - 1, onSelect: () => ctx.move(index, index + 1), children: [
|
|
337
|
+
/* @__PURE__ */ jsx(ArrowDown, {}),
|
|
338
|
+
" ",
|
|
339
|
+
ctx.labels.moveDown
|
|
340
|
+
] }),
|
|
341
|
+
/* @__PURE__ */ jsx(ContextMenuSeparator, {}),
|
|
342
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, { variant: "destructive", disabled: ctx.slides.length <= 1, onSelect: () => ctx.remove(item.id), children: [
|
|
343
|
+
/* @__PURE__ */ jsx(Trash, {}),
|
|
344
|
+
" ",
|
|
345
|
+
ctx.labels.delete,
|
|
346
|
+
/* @__PURE__ */ jsx(ContextMenuShortcut, { children: "\u232B" })
|
|
347
|
+
] })
|
|
348
|
+
] })
|
|
349
|
+
] });
|
|
350
|
+
}
|
|
351
|
+
function SlidesRail({ className, ...props }) {
|
|
352
|
+
const ctx = useSlides("SlidesRail");
|
|
353
|
+
const railRef = React.useRef(null);
|
|
354
|
+
const [drag, setDrag] = React.useState(null);
|
|
355
|
+
const selectedId = ctx.current?.id;
|
|
356
|
+
React.useEffect(() => {
|
|
357
|
+
if (!selectedId) return;
|
|
358
|
+
const item = railRef.current?.querySelector(`[data-id="${CSS.escape(selectedId)}"]`);
|
|
359
|
+
item?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
360
|
+
}, [selectedId]);
|
|
361
|
+
if (ctx.view !== "edit") return null;
|
|
362
|
+
const focusItem = (id) => window.setTimeout(() => railRef.current?.querySelector(`[data-id="${CSS.escape(id)}"]`)?.focus(), 0);
|
|
363
|
+
const onKeyDown = (event, index) => {
|
|
364
|
+
const back = event.key === "ArrowUp" || event.key === "ArrowLeft";
|
|
365
|
+
const forward = event.key === "ArrowDown" || event.key === "ArrowRight";
|
|
366
|
+
if (event.altKey && (back || forward) && ctx.setSlides) {
|
|
367
|
+
event.preventDefault();
|
|
368
|
+
ctx.move(index, index + (back ? -1 : 1));
|
|
369
|
+
focusItem(ctx.slides[index].id);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
let target = null;
|
|
373
|
+
if (back) target = index - 1;
|
|
374
|
+
else if (forward) target = index + 1;
|
|
375
|
+
else if (event.key === "Home") target = 0;
|
|
376
|
+
else if (event.key === "End") target = ctx.slides.length - 1;
|
|
377
|
+
else if ((event.key === "d" || event.key === "D") && (event.metaKey || event.ctrlKey) && ctx.setSlides) {
|
|
378
|
+
event.preventDefault();
|
|
379
|
+
ctx.duplicate(ctx.slides[index].id);
|
|
380
|
+
return;
|
|
381
|
+
} else if ((event.key === "Delete" || event.key === "Backspace") && ctx.setSlides) {
|
|
382
|
+
event.preventDefault();
|
|
383
|
+
ctx.remove(ctx.slides[index].id);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if (target === null) return;
|
|
387
|
+
event.preventDefault();
|
|
388
|
+
const next = ctx.slides[Math.min(Math.max(target, 0), ctx.slides.length - 1)];
|
|
389
|
+
ctx.select(next.id);
|
|
390
|
+
focusItem(next.id);
|
|
391
|
+
};
|
|
392
|
+
const onPointerDown = (event, index) => {
|
|
393
|
+
if (!ctx.setSlides || event.button !== 0) return;
|
|
394
|
+
const rail = railRef.current;
|
|
395
|
+
if (!rail) return;
|
|
396
|
+
const id = ctx.slides[index].id;
|
|
397
|
+
const vertical2 = getComputedStyle(rail).flexDirection === "column";
|
|
398
|
+
const items = Array.from(rail.querySelectorAll("[data-slot=slides-rail-item]"));
|
|
399
|
+
const starts = items.map((item) => vertical2 ? item.offsetTop : item.offsetLeft);
|
|
400
|
+
const step = items.length > 1 ? starts[1] - starts[0] : 0;
|
|
401
|
+
const origin = vertical2 ? event.clientY : event.clientX;
|
|
402
|
+
let active = false;
|
|
403
|
+
const onMove = (move) => {
|
|
404
|
+
const offset = (vertical2 ? move.clientY : move.clientX) - origin;
|
|
405
|
+
if (!active) {
|
|
406
|
+
if (Math.abs(offset) < DRAG_SLOP) return;
|
|
407
|
+
active = true;
|
|
408
|
+
}
|
|
409
|
+
const to = step ? Math.min(Math.max(Math.round(index + offset / step), 0), items.length - 1) : index;
|
|
410
|
+
setDrag({ id, from: index, to, offset, vertical: vertical2, step, starts });
|
|
411
|
+
};
|
|
412
|
+
const finish = (commit) => {
|
|
413
|
+
window.removeEventListener("pointermove", onMove);
|
|
414
|
+
window.removeEventListener("pointerup", onUp);
|
|
415
|
+
window.removeEventListener("pointercancel", onCancel);
|
|
416
|
+
window.removeEventListener("keydown", onKey);
|
|
417
|
+
setDrag((current) => {
|
|
418
|
+
if (commit && current && current.from !== current.to) ctx.move(current.from, current.to);
|
|
419
|
+
return null;
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
const onUp = () => finish(true);
|
|
423
|
+
const onCancel = () => finish(false);
|
|
424
|
+
const onKey = (key) => {
|
|
425
|
+
if (key.key === "Escape") finish(false);
|
|
426
|
+
};
|
|
427
|
+
window.addEventListener("pointermove", onMove);
|
|
428
|
+
window.addEventListener("pointerup", onUp);
|
|
429
|
+
window.addEventListener("pointercancel", onCancel);
|
|
430
|
+
window.addEventListener("keydown", onKey);
|
|
431
|
+
};
|
|
432
|
+
const shiftFor = (index) => {
|
|
433
|
+
if (!drag) return 0;
|
|
434
|
+
const { step } = drag;
|
|
435
|
+
if (index === drag.from) return 0;
|
|
436
|
+
if (drag.from < drag.to && index > drag.from && index <= drag.to) return -step;
|
|
437
|
+
if (drag.from > drag.to && index < drag.from && index >= drag.to) return step;
|
|
438
|
+
return 0;
|
|
439
|
+
};
|
|
440
|
+
const vertical = drag?.vertical ?? true;
|
|
441
|
+
const dragged = drag ? ctx.slides[drag.from] : null;
|
|
442
|
+
return /* @__PURE__ */ jsxs(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
ref: railRef,
|
|
446
|
+
role: "listbox",
|
|
447
|
+
"aria-label": ctx.labels.rail,
|
|
448
|
+
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
449
|
+
"data-slot": "slides-rail",
|
|
450
|
+
"data-dragging": drag ? "" : void 0,
|
|
451
|
+
className: cn(
|
|
452
|
+
"group/rail relative row-start-3 flex min-h-0 gap-3 overflow-x-auto overscroll-contain p-1 scroll-p-2",
|
|
453
|
+
"@xl/slides:col-start-1 @xl/slides:row-span-2 @xl/slides:row-start-2 @xl/slides:w-44 @xl/slides:flex-col @xl/slides:overflow-x-hidden @xl/slides:overflow-y-auto",
|
|
454
|
+
"@xl/slides:py-2 @xl/slides:pr-2 @xl/slides:pl-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
455
|
+
className
|
|
456
|
+
),
|
|
457
|
+
...props,
|
|
458
|
+
children: [
|
|
459
|
+
ctx.slides.map((item, index) => {
|
|
460
|
+
const selected = index === ctx.index;
|
|
461
|
+
const shift = shiftFor(index);
|
|
462
|
+
return /* @__PURE__ */ jsx(SlideActions, { item, index, children: /* @__PURE__ */ jsxs(
|
|
463
|
+
"div",
|
|
464
|
+
{
|
|
465
|
+
role: "option",
|
|
466
|
+
"aria-selected": selected,
|
|
467
|
+
"aria-label": item.title ? `${index + 1}. ${item.title}` : ctx.labels.counter(index, ctx.slides.length),
|
|
468
|
+
tabIndex: selected ? 0 : -1,
|
|
469
|
+
"data-slot": "slides-rail-item",
|
|
470
|
+
"data-id": item.id,
|
|
471
|
+
"data-state": selected ? "active" : "inactive",
|
|
472
|
+
"data-dragging": drag?.id === item.id ? "" : void 0,
|
|
473
|
+
className: cn(
|
|
474
|
+
"group/slides-item relative flex w-36 shrink-0 cursor-pointer items-start gap-2 rounded-sm text-left @xl/slides:w-full",
|
|
475
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
476
|
+
"data-[dragging]:opacity-0 group-data-[dragging]/rail:transition-[translate] group-data-[dragging]/rail:duration-base group-data-[dragging]/rail:ease-out motion-reduce-fade"
|
|
477
|
+
),
|
|
478
|
+
style: shift ? { translate: vertical ? `0 ${shift}px` : `${shift}px 0` } : void 0,
|
|
479
|
+
onClick: () => ctx.select(item.id),
|
|
480
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
481
|
+
onPointerDown: (event) => onPointerDown(event, index),
|
|
482
|
+
children: [
|
|
483
|
+
/* @__PURE__ */ jsx("span", { className: "w-4 shrink-0 pt-0.5 text-end text-xs text-muted-foreground tabular-nums", children: index + 1 }),
|
|
484
|
+
/* @__PURE__ */ jsx(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
"aria-hidden": true,
|
|
488
|
+
"data-slot": "slides-rail-thumb",
|
|
489
|
+
className: cn(
|
|
490
|
+
"pointer-events-none min-w-0 flex-1 overflow-hidden rounded-sm ring-1 ring-edge transition-[translate,box-shadow] duration-base ease-lift motion-reduce-fade",
|
|
491
|
+
"group-hover/slides-item:shadow-sm group-aria-selected/slides-item:-translate-y-0.5 group-aria-selected/slides-item:shadow-md group-aria-selected/slides-item:ring-2 group-aria-selected/slides-item:ring-foreground"
|
|
492
|
+
),
|
|
493
|
+
children: /* @__PURE__ */ jsx(DeckSlide, { item, index, total: ctx.slides.length })
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
) }, item.id);
|
|
499
|
+
}),
|
|
500
|
+
drag && dragged ? (
|
|
501
|
+
// The lifted thumbnail, following the pointer from where it started.
|
|
502
|
+
/* @__PURE__ */ jsxs(
|
|
503
|
+
"div",
|
|
504
|
+
{
|
|
505
|
+
"aria-hidden": true,
|
|
506
|
+
"data-slot": "slides-rail-ghost",
|
|
507
|
+
className: "pointer-events-none absolute z-10 flex w-36 items-start gap-2 @xl/slides:w-[calc(100%-0.75rem)]",
|
|
508
|
+
style: drag.vertical ? { top: drag.starts[drag.from] + drag.offset, left: 4 } : { left: drag.starts[drag.from] + drag.offset, top: 4 },
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ jsx("span", { className: "w-4 shrink-0" }),
|
|
511
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 -translate-y-0.5 scale-[1.03] overflow-hidden rounded-sm shadow-lg ring-2 ring-foreground", children: /* @__PURE__ */ jsx(DeckSlide, { item: dragged, index: drag.from, total: ctx.slides.length }) })
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
)
|
|
515
|
+
) : null
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
function flyFrom(element, from) {
|
|
521
|
+
if (prefersReducedMotion()) return;
|
|
522
|
+
const to = element.getBoundingClientRect();
|
|
523
|
+
if (!to.width || !to.height) return;
|
|
524
|
+
const dx = from.left - to.left;
|
|
525
|
+
const dy = from.top - to.top;
|
|
526
|
+
const sx = from.width / to.width;
|
|
527
|
+
const sy = from.height / to.height;
|
|
528
|
+
element.animate(
|
|
529
|
+
[{ transformOrigin: "top left", transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: "top left", transform: "none" }],
|
|
530
|
+
{ duration: duration.base, easing: easing.out }
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
function SlidesStage({ className, ...props }) {
|
|
534
|
+
const ctx = useSlides("SlidesStage");
|
|
535
|
+
const frameRef = React.useRef(null);
|
|
536
|
+
const { view, takeFlight } = ctx;
|
|
537
|
+
const currentId = ctx.current?.id;
|
|
538
|
+
React.useLayoutEffect(() => {
|
|
539
|
+
const frame = frameRef.current;
|
|
540
|
+
if (!frame || view !== "edit" || !currentId) return;
|
|
541
|
+
const flight = takeFlight(currentId);
|
|
542
|
+
if (flight) flyFrom(frame, flight.rect);
|
|
543
|
+
}, [view, currentId, takeFlight]);
|
|
544
|
+
if (ctx.view !== "edit" || !ctx.current) return null;
|
|
545
|
+
return /* @__PURE__ */ jsx(
|
|
546
|
+
"div",
|
|
547
|
+
{
|
|
548
|
+
"data-slot": "slides-stage",
|
|
549
|
+
className: cn(
|
|
550
|
+
"row-start-2 flex min-h-0 min-w-0 items-center justify-center rounded-md p-4 [container-type:size] @xl/slides:col-start-2 @xl/slides:p-8",
|
|
551
|
+
"bg-muted/50 [--surface:color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
552
|
+
className
|
|
553
|
+
),
|
|
554
|
+
...props,
|
|
555
|
+
children: /* @__PURE__ */ jsx(
|
|
556
|
+
"div",
|
|
557
|
+
{
|
|
558
|
+
ref: frameRef,
|
|
559
|
+
role: "group",
|
|
560
|
+
"aria-roledescription": "slide",
|
|
561
|
+
"aria-label": ctx.labels.counter(ctx.index, ctx.slides.length),
|
|
562
|
+
"data-slot": "slides-frame",
|
|
563
|
+
className: "overflow-hidden rounded-sm shadow-md ring-1 ring-edge [width:min(100cqw,calc(100cqh*var(--slides-ratio)))]",
|
|
564
|
+
children: /* @__PURE__ */ jsx(DeckSlide, { item: ctx.current, index: ctx.index, total: ctx.slides.length })
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
function SlidesNotes({ className, ...props }) {
|
|
571
|
+
const ctx = useSlides("SlidesNotes");
|
|
572
|
+
if (ctx.view !== "edit" || !ctx.current) return null;
|
|
573
|
+
const current = ctx.current;
|
|
574
|
+
return /* @__PURE__ */ jsx(
|
|
575
|
+
"textarea",
|
|
576
|
+
{
|
|
577
|
+
"data-slot": "slides-notes",
|
|
578
|
+
"aria-label": ctx.labels.notes,
|
|
579
|
+
placeholder: ctx.labels.notesPlaceholder,
|
|
580
|
+
readOnly: !ctx.setSlides,
|
|
581
|
+
value: current.notes ?? "",
|
|
582
|
+
onChange: (event) => ctx.setSlides?.(ctx.slides.map((slide) => slide.id === current.id ? { ...slide, notes: event.target.value } : slide)),
|
|
583
|
+
className: cn(
|
|
584
|
+
"row-start-4 block h-24 w-full resize-none rounded-md bg-transparent px-3 py-2.5 text-sm leading-relaxed text-body outline-none",
|
|
585
|
+
"@xl/slides:col-start-2 @xl/slides:row-start-3 placeholder:text-placeholder",
|
|
586
|
+
"transition-colors duration-fast ease-out hover:bg-accent focus-visible:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus read-only:hover:bg-transparent",
|
|
587
|
+
className
|
|
588
|
+
),
|
|
589
|
+
...props
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
function SlidesGrid({ className, ...props }) {
|
|
594
|
+
const ctx = useSlides("SlidesGrid");
|
|
595
|
+
const gridRef = React.useRef(null);
|
|
596
|
+
const { view: gridView, takeFlight: takeGridFlight } = ctx;
|
|
597
|
+
React.useLayoutEffect(() => {
|
|
598
|
+
if (gridView !== "grid") return;
|
|
599
|
+
const flight = takeGridFlight();
|
|
600
|
+
if (!flight) return;
|
|
601
|
+
const cell = gridRef.current?.querySelector(`[data-id="${CSS.escape(flight.id)}"] [data-slot=slides-grid-thumb]`);
|
|
602
|
+
if (cell) flyFrom(cell, flight.rect);
|
|
603
|
+
}, [gridView, takeGridFlight]);
|
|
604
|
+
if (ctx.view !== "grid") return null;
|
|
605
|
+
const open = (item, element) => {
|
|
606
|
+
const thumb = element.querySelector("[data-slot=slides-grid-thumb]");
|
|
607
|
+
ctx.setFlight(thumb ? { id: item.id, rect: thumb.getBoundingClientRect() } : null);
|
|
608
|
+
ctx.select(item.id);
|
|
609
|
+
ctx.setView("edit");
|
|
610
|
+
};
|
|
611
|
+
return /* @__PURE__ */ jsx(
|
|
612
|
+
"div",
|
|
613
|
+
{
|
|
614
|
+
ref: gridRef,
|
|
615
|
+
role: "listbox",
|
|
616
|
+
"aria-label": ctx.labels.grid,
|
|
617
|
+
"data-slot": "slides-grid",
|
|
618
|
+
className: cn(
|
|
619
|
+
"col-span-full row-start-2 row-end-[-1] grid min-h-0 auto-rows-min grid-cols-2 content-start gap-x-4 gap-y-5 overflow-y-auto p-2 scroll-p-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
620
|
+
className
|
|
621
|
+
),
|
|
622
|
+
...props,
|
|
623
|
+
children: ctx.slides.map((item, index) => {
|
|
624
|
+
const selected = index === ctx.index;
|
|
625
|
+
return /* @__PURE__ */ jsx(SlideActions, { item, index, children: /* @__PURE__ */ jsxs(
|
|
626
|
+
"div",
|
|
627
|
+
{
|
|
628
|
+
role: "option",
|
|
629
|
+
"aria-selected": selected,
|
|
630
|
+
"aria-label": item.title ? `${index + 1}. ${item.title}` : ctx.labels.counter(index, ctx.slides.length),
|
|
631
|
+
tabIndex: selected ? 0 : -1,
|
|
632
|
+
"data-slot": "slides-grid-item",
|
|
633
|
+
"data-id": item.id,
|
|
634
|
+
"data-state": selected ? "active" : "inactive",
|
|
635
|
+
className: "group/slides-item flex min-w-0 cursor-pointer flex-col gap-2 rounded-md text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-focus",
|
|
636
|
+
onClick: (event) => open(item, event.currentTarget),
|
|
637
|
+
onKeyDown: (event) => {
|
|
638
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
639
|
+
event.preventDefault();
|
|
640
|
+
open(item, event.currentTarget);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const columns = getComputedStyle(gridRef.current).gridTemplateColumns.split(" ").length;
|
|
644
|
+
const delta = event.key === "ArrowRight" ? 1 : event.key === "ArrowLeft" ? -1 : event.key === "ArrowDown" ? columns : event.key === "ArrowUp" ? -columns : 0;
|
|
645
|
+
const target = event.key === "Home" ? 0 : event.key === "End" ? ctx.slides.length - 1 : delta ? index + delta : null;
|
|
646
|
+
if (target === null || target < 0 || target >= ctx.slides.length) return;
|
|
647
|
+
event.preventDefault();
|
|
648
|
+
const next = ctx.slides[target];
|
|
649
|
+
ctx.select(next.id);
|
|
650
|
+
window.setTimeout(() => gridRef.current?.querySelector(`[data-id="${CSS.escape(next.id)}"]`)?.focus(), 0);
|
|
651
|
+
},
|
|
652
|
+
children: [
|
|
653
|
+
/* @__PURE__ */ jsx(
|
|
654
|
+
"div",
|
|
655
|
+
{
|
|
656
|
+
"aria-hidden": true,
|
|
657
|
+
"data-slot": "slides-grid-thumb",
|
|
658
|
+
className: "pointer-events-none overflow-hidden rounded-sm ring-1 ring-edge transition-shadow duration-fast ease-out group-hover/slides-item:shadow-md group-aria-selected/slides-item:ring-2 group-aria-selected/slides-item:ring-foreground",
|
|
659
|
+
children: /* @__PURE__ */ jsx(DeckSlide, { item, index, total: ctx.slides.length })
|
|
660
|
+
}
|
|
661
|
+
),
|
|
662
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-baseline gap-2 text-sm", children: [
|
|
663
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground tabular-nums", children: index + 1 }),
|
|
664
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-foreground", children: item.title })
|
|
665
|
+
] })
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
) }, item.id);
|
|
669
|
+
})
|
|
670
|
+
}
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
const IDLE_MS = 2500;
|
|
674
|
+
function SlidesShow() {
|
|
675
|
+
const ctx = useSlides("SlidesShow");
|
|
676
|
+
const showRef = React.useRef(null);
|
|
677
|
+
const [presenter, setPresenter] = React.useState(false);
|
|
678
|
+
const [idle, setIdle] = React.useState(false);
|
|
679
|
+
const [layers, setLayers] = React.useState([]);
|
|
680
|
+
const enteredFullscreen = React.useRef(false);
|
|
681
|
+
const returnFocus = React.useRef(null);
|
|
682
|
+
const idleTimer = React.useRef(void 0);
|
|
683
|
+
const [lastIndex, setLastIndex] = React.useState(ctx.index);
|
|
684
|
+
if (ctx.presenting && ctx.current && lastIndex !== ctx.index) {
|
|
685
|
+
const dir = ctx.index > lastIndex ? 1 : -1;
|
|
686
|
+
setLastIndex(ctx.index);
|
|
687
|
+
setLayers((current) => [...current.slice(-1), { id: ctx.current.id, dir }]);
|
|
688
|
+
}
|
|
689
|
+
if (!ctx.presenting && (layers.length > 0 || lastIndex !== ctx.index)) {
|
|
690
|
+
if (layers.length) setLayers([]);
|
|
691
|
+
if (lastIndex !== ctx.index) setLastIndex(ctx.index);
|
|
692
|
+
}
|
|
693
|
+
const poke = React.useCallback(() => {
|
|
694
|
+
setIdle(false);
|
|
695
|
+
window.clearTimeout(idleTimer.current);
|
|
696
|
+
idleTimer.current = window.setTimeout(() => setIdle(true), IDLE_MS);
|
|
697
|
+
}, []);
|
|
698
|
+
const { presenting, setPresenting } = ctx;
|
|
699
|
+
React.useEffect(() => {
|
|
700
|
+
if (!presenting) return;
|
|
701
|
+
const node = showRef.current;
|
|
702
|
+
const onChange = () => {
|
|
703
|
+
if (document.fullscreenElement) enteredFullscreen.current = true;
|
|
704
|
+
else if (enteredFullscreen.current) {
|
|
705
|
+
enteredFullscreen.current = false;
|
|
706
|
+
setPresenting(false);
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
document.addEventListener("fullscreenchange", onChange);
|
|
710
|
+
node?.requestFullscreen?.().catch(() => {
|
|
711
|
+
});
|
|
712
|
+
idleTimer.current = window.setTimeout(() => setIdle(true), IDLE_MS);
|
|
713
|
+
return () => {
|
|
714
|
+
document.removeEventListener("fullscreenchange", onChange);
|
|
715
|
+
window.clearTimeout(idleTimer.current);
|
|
716
|
+
if (document.fullscreenElement) void document.exitFullscreen().catch(() => {
|
|
717
|
+
});
|
|
718
|
+
enteredFullscreen.current = false;
|
|
719
|
+
};
|
|
720
|
+
}, [presenting, setPresenting]);
|
|
721
|
+
const close = () => {
|
|
722
|
+
setPresenter(false);
|
|
723
|
+
setIdle(false);
|
|
724
|
+
ctx.setPresenting(false);
|
|
725
|
+
};
|
|
726
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { open: ctx.presenting, onOpenChange: (open) => open ? ctx.setPresenting(true) : close(), children: /* @__PURE__ */ jsx(DialogPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
727
|
+
DialogPrimitive.Content,
|
|
728
|
+
{
|
|
729
|
+
ref: showRef,
|
|
730
|
+
"aria-describedby": void 0,
|
|
731
|
+
"data-slot": "slides-show",
|
|
732
|
+
"data-idle": idle || void 0,
|
|
733
|
+
className: "group/show fixed inset-0 z-50 flex flex-col bg-black text-white outline-none select-none data-[idle]:cursor-none",
|
|
734
|
+
style: { "--slides-ratio": ctx.aspectRatio },
|
|
735
|
+
onOpenAutoFocus: () => {
|
|
736
|
+
returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
737
|
+
},
|
|
738
|
+
onCloseAutoFocus: (event) => {
|
|
739
|
+
event.preventDefault();
|
|
740
|
+
returnFocus.current?.focus();
|
|
741
|
+
returnFocus.current = null;
|
|
742
|
+
},
|
|
743
|
+
onPointerMove: poke,
|
|
744
|
+
onKeyDown: (event) => {
|
|
745
|
+
poke();
|
|
746
|
+
const key = event.key;
|
|
747
|
+
if (key === "ArrowRight" || key === "PageDown" || key === " ") ctx.go(1);
|
|
748
|
+
else if (key === "ArrowLeft" || key === "PageUp") ctx.go(-1);
|
|
749
|
+
else if (key === "Home") ctx.go(-ctx.slides.length);
|
|
750
|
+
else if (key === "End") ctx.go(ctx.slides.length);
|
|
751
|
+
else if (key === "p" || key === "P") setPresenter((on) => !on);
|
|
752
|
+
else return;
|
|
753
|
+
event.preventDefault();
|
|
754
|
+
},
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: ctx.labels.deck }),
|
|
757
|
+
presenter ? /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 dark", children: /* @__PURE__ */ jsx(SlidesPresenterView, {}) }) : /* @__PURE__ */ jsx("div", { "data-slot": "slides-show-stage", className: "relative flex min-h-0 flex-1 items-center justify-center overflow-hidden [container-type:size]", children: /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden [width:min(100cqw,calc(100cqh*var(--slides-ratio)))] [aspect-ratio:var(--slides-ratio)]", children: (layers.length ? layers : ctx.current ? [{ id: ctx.current.id, dir: 0 }] : []).map((layer, i, all) => {
|
|
758
|
+
const at = ctx.slides.findIndex((slide) => slide.id === layer.id);
|
|
759
|
+
const item = ctx.slides[at];
|
|
760
|
+
if (!item) return null;
|
|
761
|
+
return /* @__PURE__ */ jsx(ShowLayer, { incoming: i === all.length - 1, dir: layer.dir, children: /* @__PURE__ */ jsx(DeckSlide, { item, index: at, total: ctx.slides.length }) }, `${layer.id}-${i === all.length - 1 ? "in" : "out"}`);
|
|
762
|
+
}) }) }),
|
|
763
|
+
/* @__PURE__ */ jsx(
|
|
764
|
+
"div",
|
|
765
|
+
{
|
|
766
|
+
role: "progressbar",
|
|
767
|
+
"aria-label": ctx.labels.deck,
|
|
768
|
+
"aria-valuemin": 0,
|
|
769
|
+
"aria-valuemax": ctx.slides.length,
|
|
770
|
+
"aria-valuenow": ctx.index + 1,
|
|
771
|
+
"aria-valuetext": ctx.labels.counter(ctx.index, ctx.slides.length),
|
|
772
|
+
"data-slot": "slides-show-progress",
|
|
773
|
+
className: "absolute inset-x-0 bottom-0 h-1 bg-white/15",
|
|
774
|
+
children: /* @__PURE__ */ jsx(
|
|
775
|
+
"div",
|
|
776
|
+
{
|
|
777
|
+
className: "h-full w-(--slides-progress) bg-white/80 transition-[width] duration-slow ease-drawer motion-reduce-fade",
|
|
778
|
+
style: { "--slides-progress": `${(ctx.index + 1) / ctx.slides.length * 100}%` }
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
}
|
|
782
|
+
),
|
|
783
|
+
/* @__PURE__ */ jsxs(
|
|
784
|
+
"div",
|
|
785
|
+
{
|
|
786
|
+
"data-slot": "slides-show-controls",
|
|
787
|
+
className: cn(
|
|
788
|
+
"absolute right-4 bottom-5 flex items-center gap-1 rounded-lg bg-black/70 p-1 transition-[opacity,translate] duration-base ease-out",
|
|
789
|
+
"group-data-[idle]/show:pointer-events-none group-data-[idle]/show:translate-y-1 group-data-[idle]/show:opacity-0",
|
|
790
|
+
"focus-within:pointer-events-auto focus-within:translate-y-0 focus-within:opacity-100"
|
|
791
|
+
),
|
|
792
|
+
children: [
|
|
793
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, tone: "onMedia", "aria-label": ctx.labels.previous, tooltip: `${ctx.labels.previous} (\u2190)`, disabled: ctx.index === 0, onClick: () => ctx.go(-1), children: /* @__PURE__ */ jsx(CaretLeft, {}) }),
|
|
794
|
+
/* @__PURE__ */ jsxs("span", { className: "px-2 text-sm text-white/70 tabular-nums", children: [
|
|
795
|
+
ctx.index + 1,
|
|
796
|
+
" / ",
|
|
797
|
+
ctx.slides.length
|
|
798
|
+
] }),
|
|
799
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, tone: "onMedia", "aria-label": ctx.labels.next, tooltip: `${ctx.labels.next} (\u2192)`, disabled: ctx.index >= ctx.slides.length - 1, onClick: () => ctx.go(1), children: /* @__PURE__ */ jsx(CaretRight, {}) }),
|
|
800
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, tone: "onMedia", "aria-label": ctx.labels.presenterView, "aria-pressed": presenter, tooltip: `${ctx.labels.presenterView} (P)`, onClick: () => setPresenter((on) => !on), children: /* @__PURE__ */ jsx(Monitor, {}) }),
|
|
801
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, tone: "onMedia", "aria-label": ctx.labels.exit, tooltip: `${ctx.labels.exit} (Esc)`, onClick: close, children: /* @__PURE__ */ jsx(X, {}) })
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
)
|
|
805
|
+
]
|
|
806
|
+
}
|
|
807
|
+
) }) });
|
|
808
|
+
}
|
|
809
|
+
function ShowLayer({ incoming, dir, children }) {
|
|
810
|
+
const ref = React.useRef(null);
|
|
811
|
+
React.useLayoutEffect(() => {
|
|
812
|
+
const node = ref.current;
|
|
813
|
+
if (!node || dir === 0) return;
|
|
814
|
+
const options = { duration: duration.slow, easing: easing.drawer, fill: "forwards" };
|
|
815
|
+
if (prefersReducedMotion()) {
|
|
816
|
+
node.animate(incoming ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }], options);
|
|
817
|
+
} else if (incoming) {
|
|
818
|
+
node.animate([{ transform: `translateX(${dir * 100}%)` }, { transform: "translateX(0)" }], options);
|
|
819
|
+
} else {
|
|
820
|
+
node.animate([{ transform: "translateX(0)" }, { transform: `translateX(${-dir * 100}%)` }], options);
|
|
821
|
+
}
|
|
822
|
+
}, [incoming, dir]);
|
|
823
|
+
return /* @__PURE__ */ jsx("div", { ref, "aria-hidden": !incoming, "data-slot": "slides-show-layer", className: "absolute inset-0 will-change-transform", children });
|
|
824
|
+
}
|
|
825
|
+
function useElapsed() {
|
|
826
|
+
const [seconds, setSeconds] = React.useState(0);
|
|
827
|
+
React.useEffect(() => {
|
|
828
|
+
const start = Date.now();
|
|
829
|
+
const timer = window.setInterval(() => setSeconds(Math.floor((Date.now() - start) / 1e3)), 1e3);
|
|
830
|
+
return () => window.clearInterval(timer);
|
|
831
|
+
}, []);
|
|
832
|
+
return `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
833
|
+
}
|
|
834
|
+
function SlidesPresenterView({ className, ...props }) {
|
|
835
|
+
const ctx = useSlides("SlidesPresenterView");
|
|
836
|
+
const elapsed = useElapsed();
|
|
837
|
+
const next = ctx.slides[ctx.index + 1];
|
|
838
|
+
if (!ctx.current) return null;
|
|
839
|
+
return /* @__PURE__ */ jsxs(
|
|
840
|
+
"div",
|
|
841
|
+
{
|
|
842
|
+
"data-slot": "slides-presenter",
|
|
843
|
+
className: cn(
|
|
844
|
+
"@container/presenter col-span-full row-[1/-1] flex h-full min-h-0 flex-col gap-4 overflow-y-auto bg-background p-4 text-foreground [--surface:var(--background)]",
|
|
845
|
+
"in-[[data-slot=slides]]:rounded-md in-[[data-slot=slides]]:p-3",
|
|
846
|
+
className
|
|
847
|
+
),
|
|
848
|
+
...props,
|
|
849
|
+
children: [
|
|
850
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "slides-presenter-bar", className: "flex h-9 shrink-0 items-center gap-3", children: [
|
|
851
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm tabular-nums", "aria-label": "Elapsed time", children: elapsed }),
|
|
852
|
+
/* @__PURE__ */ jsxs("span", { className: "ml-auto text-sm text-muted-foreground tabular-nums", children: [
|
|
853
|
+
ctx.index + 1,
|
|
854
|
+
" / ",
|
|
855
|
+
ctx.slides.length
|
|
856
|
+
] })
|
|
857
|
+
] }),
|
|
858
|
+
/* @__PURE__ */ jsxs("div", { className: "grid min-h-0 flex-1 gap-4 @2xl/presenter:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]", children: [
|
|
859
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "slides-presenter-current", className: "flex min-w-0 items-start justify-center", children: /* @__PURE__ */ jsx("div", { className: "w-full overflow-hidden rounded-sm shadow-md ring-1 ring-edge", children: /* @__PURE__ */ jsx(DeckSlide, { item: ctx.current, index: ctx.index, total: ctx.slides.length }) }) }),
|
|
860
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 min-w-0 flex-col gap-4", children: [
|
|
861
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "slides-presenter-next", className: "flex flex-col gap-2", children: [
|
|
862
|
+
/* @__PURE__ */ jsx("span", { className: "eyebrow", children: ctx.labels.nextUp }),
|
|
863
|
+
next ? /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-sm opacity-80 ring-1 ring-edge", children: /* @__PURE__ */ jsx(DeckSlide, { item: next, index: ctx.index + 1, total: ctx.slides.length }) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "End of the deck." })
|
|
864
|
+
] }),
|
|
865
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "slides-presenter-notes", className: "flex min-h-0 flex-1 flex-col gap-2", children: [
|
|
866
|
+
/* @__PURE__ */ jsx("span", { className: "eyebrow", children: ctx.labels.notes }),
|
|
867
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg leading-relaxed text-pretty text-body", children: ctx.current.notes })
|
|
868
|
+
] })
|
|
869
|
+
] })
|
|
870
|
+
] })
|
|
871
|
+
]
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
export {
|
|
876
|
+
Slides,
|
|
877
|
+
SlidesCounter,
|
|
878
|
+
SlidesGrid,
|
|
879
|
+
SlidesNext,
|
|
880
|
+
SlidesNotes,
|
|
881
|
+
SlidesPresent,
|
|
882
|
+
SlidesPresenterView,
|
|
883
|
+
SlidesPrevious,
|
|
884
|
+
SlidesRail,
|
|
885
|
+
SlidesStage,
|
|
886
|
+
SlidesTitle,
|
|
887
|
+
SlidesToolbar,
|
|
888
|
+
SlidesViewToggle
|
|
889
|
+
};
|
|
890
|
+
//# sourceMappingURL=slides.mjs.map
|