@thalavaisankar/atoms 0.0.0-stage → 0.1.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 +142 -2
- package/THIRD_PARTY_NOTICES.md +246 -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/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 +19332 -0
- package/dist/index.mjs +155 -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/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,343 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
5
|
+
import { X } from "atoms-icons";
|
|
6
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
7
|
+
import { DensityProvider, useDensity } from "../../../lib/density.mjs";
|
|
8
|
+
import { Button } from "../button/index.mjs";
|
|
9
|
+
import { resolveReturnTarget, restoreFocus } from "./focus-return.mjs";
|
|
10
|
+
const dialogVariants = tv({
|
|
11
|
+
slots: {
|
|
12
|
+
overlay: [
|
|
13
|
+
"fixed inset-0 z-50 bg-black/50",
|
|
14
|
+
"transition-opacity duration-base ease-out motion-reduce:transition-none",
|
|
15
|
+
"starting:opacity-0",
|
|
16
|
+
"data-[state=closed]:pointer-events-none data-[state=closed]:animate-presence-hold data-[state=closed]:opacity-0",
|
|
17
|
+
"data-stacked:bg-black/25"
|
|
18
|
+
],
|
|
19
|
+
content: [
|
|
20
|
+
"fixed inset-0 z-50 m-auto grid h-fit max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] overflow-y-auto overscroll-contain",
|
|
21
|
+
"rounded-xl border border-border-soft bg-popover text-popover-foreground shadow-xl outline-none [--surface:var(--popover)]",
|
|
22
|
+
"transition-[opacity,scale,translate] duration-base ease-out motion-reduce:transition-none",
|
|
23
|
+
"data-[state=closed]:pointer-events-none data-[state=closed]:animate-presence-hold",
|
|
24
|
+
// A DialogBody caps the dialog to the viewport and scrolls on its own; header and footer stay pinned.
|
|
25
|
+
"has-[[data-slot=dialog-body]]:flex has-[[data-slot=dialog-body]]:flex-col has-[[data-slot=dialog-body]]:overflow-hidden",
|
|
26
|
+
// Leave the title clear of the built-in close button.
|
|
27
|
+
"[&:has(>[data-slot=dialog-close-button])_[data-slot=dialog-header]:not([data-bordered])]:pe-8",
|
|
28
|
+
"[&:has(>[data-slot=dialog-close-button])_[data-slot=dialog-header][data-bordered]]:pe-12",
|
|
29
|
+
"[&:has([data-slot=dialog-header][data-bordered])>[data-slot=dialog-close-button]]:top-2.5",
|
|
30
|
+
// Another dialog open on top: step back and lift a little (`--dialog-nested` is 1 or 2).
|
|
31
|
+
"data-nested:scale-[calc(1-var(--dialog-nested)*0.1)] data-nested:-translate-y-[calc(var(--dialog-nested)*var(--spacing)*3)]"
|
|
32
|
+
],
|
|
33
|
+
icon: "flex shrink-0 text-muted-foreground [&_svg]:shrink-0",
|
|
34
|
+
header: "flex flex-col text-left",
|
|
35
|
+
title: "font-semibold leading-6 tracking-tight text-foreground",
|
|
36
|
+
description: "text-sm text-pretty text-muted-foreground",
|
|
37
|
+
body: [
|
|
38
|
+
"-mx-[var(--dialog-inset)] min-h-0 flex-1 overflow-y-auto overscroll-contain px-[var(--dialog-inset)] scroll-py-10 scroll-fade",
|
|
39
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset"
|
|
40
|
+
],
|
|
41
|
+
footer: "flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end",
|
|
42
|
+
close: "absolute"
|
|
43
|
+
},
|
|
44
|
+
variants: {
|
|
45
|
+
density: {
|
|
46
|
+
comfortable: {
|
|
47
|
+
content: "gap-4 p-5 [--dialog-inset:--spacing(5)]",
|
|
48
|
+
icon: "-mb-2 [&_svg:not([class*='size-'])]:size-6",
|
|
49
|
+
header: "gap-1.5",
|
|
50
|
+
title: "text-lg",
|
|
51
|
+
close: "top-4.5 right-4.5"
|
|
52
|
+
},
|
|
53
|
+
compact: {
|
|
54
|
+
content: "gap-3 p-4 [--dialog-inset:--spacing(4)]",
|
|
55
|
+
icon: "-mb-1 [&_svg:not([class*='size-'])]:size-5",
|
|
56
|
+
header: "gap-1",
|
|
57
|
+
title: "text-base",
|
|
58
|
+
close: "top-3.5 right-3.5"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
size: {
|
|
62
|
+
sm: { content: "max-w-sm" },
|
|
63
|
+
md: { content: "max-w-[30rem]" },
|
|
64
|
+
lg: { content: "max-w-2xl" },
|
|
65
|
+
xl: { content: "max-w-4xl" },
|
|
66
|
+
// A 16:9 frame as wide as the viewport allows while it still fits the height.
|
|
67
|
+
media: {
|
|
68
|
+
content: [
|
|
69
|
+
"h-[min(calc((100vw-2rem)*9/16),calc(100dvh-2rem))] w-[min(calc(100vw-2rem),calc((100dvh-2rem)*16/9))] max-w-none",
|
|
70
|
+
"gap-0 overflow-hidden border-0 bg-black p-0",
|
|
71
|
+
"[&>iframe]:size-full [&>iframe]:border-0 [&>video]:size-full [&>video]:object-contain"
|
|
72
|
+
],
|
|
73
|
+
close: "top-3 right-3"
|
|
74
|
+
},
|
|
75
|
+
// Atoms extension for a command palette: no padding (the input row runs edge to edge) and
|
|
76
|
+
// anchored near the top, so the box grows downward as results filter instead of re-centring.
|
|
77
|
+
command: { content: "max-w-xl gap-0 overflow-hidden p-0" }
|
|
78
|
+
},
|
|
79
|
+
mobile: {
|
|
80
|
+
sheet: {
|
|
81
|
+
overlay: "max-sm:duration-slow max-sm:data-[state=closed]:[animation:presence-hold_var(--duration-slow)_linear]",
|
|
82
|
+
content: [
|
|
83
|
+
"sm:starting:scale-95 sm:starting:opacity-0 sm:data-[state=closed]:scale-95 sm:data-[state=closed]:opacity-0",
|
|
84
|
+
"max-sm:inset-x-0 max-sm:top-auto max-sm:bottom-0 max-sm:m-0 max-sm:max-h-[calc(100dvh-1rem)] max-sm:w-full max-sm:max-w-none",
|
|
85
|
+
"max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:pb-[calc(var(--dialog-inset)+env(safe-area-inset-bottom))]",
|
|
86
|
+
"max-sm:duration-slow max-sm:ease-drawer",
|
|
87
|
+
"max-sm:starting:translate-y-full max-sm:data-[state=closed]:translate-y-full",
|
|
88
|
+
"max-sm:data-[state=closed]:[animation:presence-hold_var(--duration-slow)_linear]"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
center: {
|
|
92
|
+
content: "starting:scale-95 starting:opacity-0 data-[state=closed]:scale-95 data-[state=closed]:opacity-0"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
headerBordered: {
|
|
96
|
+
true: {
|
|
97
|
+
header: [
|
|
98
|
+
"-mx-[var(--dialog-inset)] -mt-[var(--dialog-inset)] flex-row items-center gap-2.5 border-b border-border-soft px-[var(--dialog-inset)] py-3",
|
|
99
|
+
"[&>[data-slot=dialog-icon]]:m-0 [&>[data-slot=dialog-icon]_svg:not([class*='size-'])]:size-5"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
false: {}
|
|
103
|
+
},
|
|
104
|
+
footerBordered: {
|
|
105
|
+
true: {
|
|
106
|
+
footer: "-mx-[var(--dialog-inset)] -mb-[var(--dialog-inset)] mt-1 border-t border-border-soft px-[var(--dialog-inset)] py-3"
|
|
107
|
+
},
|
|
108
|
+
false: {}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
compoundVariants: [
|
|
112
|
+
{ size: "command", mobile: "sheet", class: { content: "sm:mt-[12dvh] sm:mb-auto" } },
|
|
113
|
+
{ size: "command", mobile: "center", class: { content: "mt-[10dvh] mb-auto" } }
|
|
114
|
+
],
|
|
115
|
+
defaultVariants: {
|
|
116
|
+
density: "compact",
|
|
117
|
+
size: "md",
|
|
118
|
+
mobile: "sheet",
|
|
119
|
+
headerBordered: false,
|
|
120
|
+
footerBordered: true
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const DialogRootContext = React.createContext(null);
|
|
124
|
+
DialogRootContext.displayName = "DialogRootContext";
|
|
125
|
+
function useDialogRootContext() {
|
|
126
|
+
return React.useContext(DialogRootContext);
|
|
127
|
+
}
|
|
128
|
+
function Dialog({ open: openProp, defaultOpen = false, onOpenChange, ...props }) {
|
|
129
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
130
|
+
const controlled = openProp !== void 0;
|
|
131
|
+
const open = controlled ? openProp : uncontrolledOpen;
|
|
132
|
+
const setOpen = React.useCallback(
|
|
133
|
+
(next) => {
|
|
134
|
+
if (!controlled) setUncontrolledOpen(next);
|
|
135
|
+
onOpenChange?.(next);
|
|
136
|
+
},
|
|
137
|
+
[controlled, onOpenChange]
|
|
138
|
+
);
|
|
139
|
+
const triggerRef = React.useRef(null);
|
|
140
|
+
const returnTargetRef = React.useRef(null);
|
|
141
|
+
const setTrigger = React.useCallback((node) => {
|
|
142
|
+
triggerRef.current = node;
|
|
143
|
+
}, []);
|
|
144
|
+
const getTrigger = React.useCallback(() => triggerRef.current, []);
|
|
145
|
+
const getReturnTarget = React.useCallback(() => returnTargetRef.current, []);
|
|
146
|
+
React.useLayoutEffect(() => {
|
|
147
|
+
if (open) returnTargetRef.current = resolveReturnTarget(document.activeElement);
|
|
148
|
+
}, [open]);
|
|
149
|
+
const value = React.useMemo(
|
|
150
|
+
() => ({ open, setOpen, setTrigger, getTrigger, getReturnTarget }),
|
|
151
|
+
[open, setOpen, setTrigger, getTrigger, getReturnTarget]
|
|
152
|
+
);
|
|
153
|
+
return /* @__PURE__ */ jsx(DialogRootContext.Provider, { value, children: /* @__PURE__ */ jsx(DialogPrimitive.Root, { open, onOpenChange: setOpen, ...props }) });
|
|
154
|
+
}
|
|
155
|
+
function assignRef(ref, node) {
|
|
156
|
+
if (typeof ref === "function") ref(node);
|
|
157
|
+
else if (ref) ref.current = node;
|
|
158
|
+
}
|
|
159
|
+
function DialogTrigger({ ref, ...props }) {
|
|
160
|
+
const setTrigger = useDialogRootContext()?.setTrigger;
|
|
161
|
+
const mergedRef = React.useCallback(
|
|
162
|
+
(node) => {
|
|
163
|
+
assignRef(ref, node);
|
|
164
|
+
setTrigger?.(node);
|
|
165
|
+
},
|
|
166
|
+
[ref, setTrigger]
|
|
167
|
+
);
|
|
168
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ref: mergedRef, ...props });
|
|
169
|
+
}
|
|
170
|
+
function DialogClose(props) {
|
|
171
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
172
|
+
}
|
|
173
|
+
function useCloseAutoFocus(onCloseAutoFocus) {
|
|
174
|
+
const root = useDialogRootContext();
|
|
175
|
+
return (event) => {
|
|
176
|
+
onCloseAutoFocus?.(event);
|
|
177
|
+
if (event.defaultPrevented || !root) return;
|
|
178
|
+
if (root.getTrigger()?.isConnected) return;
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
restoreFocus(root.getReturnTarget());
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const DialogStackContext = React.createContext(null);
|
|
184
|
+
DialogStackContext.displayName = "DialogStackContext";
|
|
185
|
+
function useDialogStackLevel(open) {
|
|
186
|
+
const parent = React.useContext(DialogStackContext);
|
|
187
|
+
const depth = parent ? parent.depth + 1 : 0;
|
|
188
|
+
const [nested, setNested] = React.useState(0);
|
|
189
|
+
const report = parent?.report;
|
|
190
|
+
React.useEffect(() => {
|
|
191
|
+
if (!report) return;
|
|
192
|
+
report(open ? Math.min(nested + 1, 2) : 0);
|
|
193
|
+
return () => report(0);
|
|
194
|
+
}, [report, open, nested]);
|
|
195
|
+
const value = React.useMemo(() => ({ depth, nested, report: setNested }), [depth, nested]);
|
|
196
|
+
return { depth, nested, value };
|
|
197
|
+
}
|
|
198
|
+
function DialogStackProvider({ value, children }) {
|
|
199
|
+
return /* @__PURE__ */ jsx(DialogStackContext.Provider, { value, children });
|
|
200
|
+
}
|
|
201
|
+
function useDialogStack() {
|
|
202
|
+
const stack = React.useContext(DialogStackContext);
|
|
203
|
+
return stack ? { depth: stack.depth, nested: stack.nested } : null;
|
|
204
|
+
}
|
|
205
|
+
const DialogSlotsContext = React.createContext(null);
|
|
206
|
+
const DialogDensityContext = React.createContext(void 0);
|
|
207
|
+
DialogSlotsContext.displayName = "DialogSlotsContext";
|
|
208
|
+
const defaultSlots = dialogVariants();
|
|
209
|
+
function useDialogSlots() {
|
|
210
|
+
return React.useContext(DialogSlotsContext) ?? defaultSlots;
|
|
211
|
+
}
|
|
212
|
+
function DialogContent({
|
|
213
|
+
className,
|
|
214
|
+
style,
|
|
215
|
+
size = "md",
|
|
216
|
+
mobile,
|
|
217
|
+
density: densityProp,
|
|
218
|
+
showClose = true,
|
|
219
|
+
closeLabel = "Close",
|
|
220
|
+
forceMount,
|
|
221
|
+
onCloseAutoFocus,
|
|
222
|
+
children,
|
|
223
|
+
...props
|
|
224
|
+
}) {
|
|
225
|
+
const density = useDensity(densityProp);
|
|
226
|
+
const resolvedMobile = mobile ?? (size === "command" ? "center" : "sheet");
|
|
227
|
+
const slots = dialogVariants({ density, size, mobile: resolvedMobile });
|
|
228
|
+
const root = useDialogRootContext();
|
|
229
|
+
const stack = useDialogStackLevel(root?.open ?? false);
|
|
230
|
+
const handleCloseAutoFocus = useCloseAutoFocus(onCloseAutoFocus);
|
|
231
|
+
const portal = /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { forceMount, children: [
|
|
232
|
+
/* @__PURE__ */ jsx(
|
|
233
|
+
DialogPrimitive.Overlay,
|
|
234
|
+
{
|
|
235
|
+
"data-slot": "dialog-overlay",
|
|
236
|
+
"data-stacked": stack.depth > 0 ? "" : void 0,
|
|
237
|
+
forceMount,
|
|
238
|
+
className: slots.overlay()
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ jsxs(
|
|
242
|
+
DialogPrimitive.Content,
|
|
243
|
+
{
|
|
244
|
+
"data-slot": "dialog-content",
|
|
245
|
+
"data-size": size,
|
|
246
|
+
"data-nested": stack.nested > 0 ? "" : void 0,
|
|
247
|
+
forceMount,
|
|
248
|
+
onCloseAutoFocus: handleCloseAutoFocus,
|
|
249
|
+
className: slots.content({ className }),
|
|
250
|
+
style: { "--dialog-nested": stack.nested, ...style },
|
|
251
|
+
...props,
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ jsx(DialogSlotsContext.Provider, { value: slots, children: /* @__PURE__ */ jsx(DialogDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsx(DialogStackProvider, { value: stack.value, children }) }) }),
|
|
254
|
+
showClose ? /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
255
|
+
Button,
|
|
256
|
+
{
|
|
257
|
+
"data-slot": "dialog-close-button",
|
|
258
|
+
variant: size === "media" ? "overlay" : "ghost",
|
|
259
|
+
size: "xs",
|
|
260
|
+
iconOnly: true,
|
|
261
|
+
tooltip: false,
|
|
262
|
+
"aria-label": closeLabel,
|
|
263
|
+
className: slots.close(),
|
|
264
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": true })
|
|
265
|
+
}
|
|
266
|
+
) }) : null
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
] });
|
|
271
|
+
return densityProp ? /* @__PURE__ */ jsx(DensityProvider, { density: densityProp, children: portal }) : portal;
|
|
272
|
+
}
|
|
273
|
+
function DialogIcon({ className, ...props }) {
|
|
274
|
+
const slots = useDialogSlots();
|
|
275
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "dialog-icon", "aria-hidden": true, className: slots.icon({ className }), ...props });
|
|
276
|
+
}
|
|
277
|
+
function DialogHeader({ className, bordered = false, ...props }) {
|
|
278
|
+
const slots = useDialogSlots();
|
|
279
|
+
return /* @__PURE__ */ jsx(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
"data-slot": "dialog-header",
|
|
283
|
+
"data-bordered": bordered ? "" : void 0,
|
|
284
|
+
className: slots.header({ headerBordered: bordered, className }),
|
|
285
|
+
...props
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
function DialogTitle({ className, ...props }) {
|
|
290
|
+
const slots = useDialogSlots();
|
|
291
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: slots.title({ className }), ...props });
|
|
292
|
+
}
|
|
293
|
+
function DialogDescription({
|
|
294
|
+
className,
|
|
295
|
+
...props
|
|
296
|
+
}) {
|
|
297
|
+
const slots = useDialogSlots();
|
|
298
|
+
return /* @__PURE__ */ jsx(
|
|
299
|
+
DialogPrimitive.Description,
|
|
300
|
+
{
|
|
301
|
+
"data-slot": "dialog-description",
|
|
302
|
+
className: slots.description({ className }),
|
|
303
|
+
...props
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function DialogBody({ className, ...props }) {
|
|
308
|
+
const slots = useDialogSlots();
|
|
309
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "dialog-body", className: slots.body({ className }), ...props });
|
|
310
|
+
}
|
|
311
|
+
function DialogFooter({ className, bordered = true, ...props }) {
|
|
312
|
+
const slots = useDialogSlots();
|
|
313
|
+
return /* @__PURE__ */ jsx(
|
|
314
|
+
"div",
|
|
315
|
+
{
|
|
316
|
+
"data-slot": "dialog-footer",
|
|
317
|
+
"data-bordered": bordered ? "" : void 0,
|
|
318
|
+
className: slots.footer({ footerBordered: bordered, className }),
|
|
319
|
+
...props
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
export {
|
|
324
|
+
Dialog,
|
|
325
|
+
DialogBody,
|
|
326
|
+
DialogClose,
|
|
327
|
+
DialogContent,
|
|
328
|
+
DialogDensityContext,
|
|
329
|
+
DialogDescription,
|
|
330
|
+
DialogFooter,
|
|
331
|
+
DialogHeader,
|
|
332
|
+
DialogIcon,
|
|
333
|
+
DialogStackProvider,
|
|
334
|
+
DialogTitle,
|
|
335
|
+
DialogTrigger,
|
|
336
|
+
assignRef,
|
|
337
|
+
dialogVariants,
|
|
338
|
+
useCloseAutoFocus,
|
|
339
|
+
useDialogRootContext,
|
|
340
|
+
useDialogStack,
|
|
341
|
+
useDialogStackLevel
|
|
342
|
+
};
|
|
343
|
+
//# sourceMappingURL=dialog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Dialog as DialogPrimitive } from \"radix-ui\"\nimport { X } from \"atoms-icons\"\n\nimport { tv, type VariantProps } from \"../../../lib/tv.mjs\"\nimport { DensityProvider, useDensity, type Density } from \"../../../lib/density.mjs\"\nimport { Button } from \"../button/index.mjs\"\n\nimport { resolveReturnTarget, restoreFocus } from \"./focus-return.mjs\"\n\n/*\n * Enter and exit are transitions, not keyframes, so they are interruptible: a dialog closed\n * half-way in leaves from where it is, and one reopened mid-exit turns around. `starting:` gives\n * the first frame, the closed state names the end values, and `animate-presence-hold` keeps Radix\n * Presence mounting the node for the length of the exit (see atoms.css).\n */\nexport const dialogVariants = tv({\n slots: {\n overlay: [\n \"fixed inset-0 z-50 bg-black/50\",\n \"transition-opacity duration-base ease-out motion-reduce:transition-none\",\n \"starting:opacity-0\",\n \"data-[state=closed]:pointer-events-none data-[state=closed]:animate-presence-hold data-[state=closed]:opacity-0\",\n \"data-stacked:bg-black/25\",\n ],\n content: [\n \"fixed inset-0 z-50 m-auto grid h-fit max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] overflow-y-auto overscroll-contain\",\n \"rounded-xl border border-border-soft bg-popover text-popover-foreground shadow-xl outline-none [--surface:var(--popover)]\",\n \"transition-[opacity,scale,translate] duration-base ease-out motion-reduce:transition-none\",\n \"data-[state=closed]:pointer-events-none data-[state=closed]:animate-presence-hold\",\n // A DialogBody caps the dialog to the viewport and scrolls on its own; header and footer stay pinned.\n \"has-[[data-slot=dialog-body]]:flex has-[[data-slot=dialog-body]]:flex-col has-[[data-slot=dialog-body]]:overflow-hidden\",\n // Leave the title clear of the built-in close button.\n \"[&:has(>[data-slot=dialog-close-button])_[data-slot=dialog-header]:not([data-bordered])]:pe-8\",\n \"[&:has(>[data-slot=dialog-close-button])_[data-slot=dialog-header][data-bordered]]:pe-12\",\n \"[&:has([data-slot=dialog-header][data-bordered])>[data-slot=dialog-close-button]]:top-2.5\",\n // Another dialog open on top: step back and lift a little (`--dialog-nested` is 1 or 2).\n \"data-nested:scale-[calc(1-var(--dialog-nested)*0.1)] data-nested:-translate-y-[calc(var(--dialog-nested)*var(--spacing)*3)]\",\n ],\n icon: \"flex shrink-0 text-muted-foreground [&_svg]:shrink-0\",\n header: \"flex flex-col text-left\",\n title: \"font-semibold leading-6 tracking-tight text-foreground\",\n description: \"text-sm text-pretty text-muted-foreground\",\n body: [\n \"-mx-[var(--dialog-inset)] min-h-0 flex-1 overflow-y-auto overscroll-contain px-[var(--dialog-inset)] scroll-py-10 scroll-fade\",\n \"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset\",\n ],\n footer: \"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end\",\n close: \"absolute\",\n },\n variants: {\n density: {\n comfortable: {\n content: \"gap-4 p-5 [--dialog-inset:--spacing(5)]\",\n icon: \"-mb-2 [&_svg:not([class*='size-'])]:size-6\",\n header: \"gap-1.5\",\n title: \"text-lg\",\n close: \"top-4.5 right-4.5\",\n },\n compact: {\n content: \"gap-3 p-4 [--dialog-inset:--spacing(4)]\",\n icon: \"-mb-1 [&_svg:not([class*='size-'])]:size-5\",\n header: \"gap-1\",\n title: \"text-base\",\n close: \"top-3.5 right-3.5\",\n },\n },\n size: {\n sm: { content: \"max-w-sm\" },\n md: { content: \"max-w-[30rem]\" },\n lg: { content: \"max-w-2xl\" },\n xl: { content: \"max-w-4xl\" },\n // A 16:9 frame as wide as the viewport allows while it still fits the height.\n media: {\n content: [\n \"h-[min(calc((100vw-2rem)*9/16),calc(100dvh-2rem))] w-[min(calc(100vw-2rem),calc((100dvh-2rem)*16/9))] max-w-none\",\n \"gap-0 overflow-hidden border-0 bg-black p-0\",\n \"[&>iframe]:size-full [&>iframe]:border-0 [&>video]:size-full [&>video]:object-contain\",\n ],\n close: \"top-3 right-3\",\n },\n // Atoms extension for a command palette: no padding (the input row runs edge to edge) and\n // anchored near the top, so the box grows downward as results filter instead of re-centring.\n command: { content: \"max-w-xl gap-0 overflow-hidden p-0\" },\n },\n mobile: {\n sheet: {\n overlay: \"max-sm:duration-slow max-sm:data-[state=closed]:[animation:presence-hold_var(--duration-slow)_linear]\",\n content: [\n \"sm:starting:scale-95 sm:starting:opacity-0 sm:data-[state=closed]:scale-95 sm:data-[state=closed]:opacity-0\",\n \"max-sm:inset-x-0 max-sm:top-auto max-sm:bottom-0 max-sm:m-0 max-sm:max-h-[calc(100dvh-1rem)] max-sm:w-full max-sm:max-w-none\",\n \"max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:pb-[calc(var(--dialog-inset)+env(safe-area-inset-bottom))]\",\n \"max-sm:duration-slow max-sm:ease-drawer\",\n \"max-sm:starting:translate-y-full max-sm:data-[state=closed]:translate-y-full\",\n \"max-sm:data-[state=closed]:[animation:presence-hold_var(--duration-slow)_linear]\",\n ],\n },\n center: {\n content: \"starting:scale-95 starting:opacity-0 data-[state=closed]:scale-95 data-[state=closed]:opacity-0\",\n },\n },\n headerBordered: {\n true: {\n header: [\n \"-mx-[var(--dialog-inset)] -mt-[var(--dialog-inset)] flex-row items-center gap-2.5 border-b border-border-soft px-[var(--dialog-inset)] py-3\",\n \"[&>[data-slot=dialog-icon]]:m-0 [&>[data-slot=dialog-icon]_svg:not([class*='size-'])]:size-5\",\n ],\n },\n false: {},\n },\n footerBordered: {\n true: {\n footer:\n \"-mx-[var(--dialog-inset)] -mb-[var(--dialog-inset)] mt-1 border-t border-border-soft px-[var(--dialog-inset)] py-3\",\n },\n false: {},\n },\n },\n compoundVariants: [\n { size: \"command\", mobile: \"sheet\", class: { content: \"sm:mt-[12dvh] sm:mb-auto\" } },\n { size: \"command\", mobile: \"center\", class: { content: \"mt-[10dvh] mb-auto\" } },\n ],\n defaultVariants: {\n density: \"compact\",\n size: \"md\",\n mobile: \"sheet\",\n headerBordered: false,\n footerBordered: true,\n },\n})\n\ntype DialogSlots = ReturnType<typeof dialogVariants>\ntype DialogVariantProps = VariantProps<typeof dialogVariants>\n\n/* ─── Root state ──────────────────────────────────────────────────────────── */\n\ninterface DialogRootContextValue {\n open: boolean\n setOpen: (open: boolean) => void\n setTrigger: (node: HTMLElement | null) => void\n getTrigger: () => HTMLElement | null\n getReturnTarget: () => HTMLElement | null\n}\n\nconst DialogRootContext = React.createContext<DialogRootContextValue | null>(null)\nDialogRootContext.displayName = \"DialogRootContext\"\n\n/** Internal: the open state and focus-return bookkeeping of the nearest Dialog (or Drawer) root. */\nexport function useDialogRootContext() {\n return React.useContext(DialogRootContext)\n}\n\nexport type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>\n\nexport function Dialog({ open: openProp, defaultOpen = false, onOpenChange, ...props }: DialogProps) {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const controlled = openProp !== undefined\n const open = controlled ? openProp : uncontrolledOpen\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (!controlled) setUncontrolledOpen(next)\n onOpenChange?.(next)\n },\n [controlled, onOpenChange],\n )\n\n const triggerRef = React.useRef<HTMLElement | null>(null)\n const returnTargetRef = React.useRef<HTMLElement | null>(null)\n const setTrigger = React.useCallback((node: HTMLElement | null) => {\n triggerRef.current = node\n }, [])\n const getTrigger = React.useCallback(() => triggerRef.current, [])\n const getReturnTarget = React.useCallback(() => returnTargetRef.current, [])\n\n // Remember what had focus as the dialog opens, before Radix moves focus inside (a passive effect).\n React.useLayoutEffect(() => {\n if (open) returnTargetRef.current = resolveReturnTarget(document.activeElement)\n }, [open])\n\n const value = React.useMemo(\n () => ({ open, setOpen, setTrigger, getTrigger, getReturnTarget }),\n [open, setOpen, setTrigger, getTrigger, getReturnTarget],\n )\n\n return (\n <DialogRootContext.Provider value={value}>\n <DialogPrimitive.Root open={open} onOpenChange={setOpen} {...props} />\n </DialogRootContext.Provider>\n )\n}\n\n/** Internal: write a node into a ref of either kind (Radix and React 19 refs alike). */\nexport function assignRef<T>(ref: React.Ref<T> | undefined, node: T | null) {\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.RefObject<T | null>).current = node\n}\n\nexport function DialogTrigger({ ref, ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n const setTrigger = useDialogRootContext()?.setTrigger\n const mergedRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n assignRef(ref, node)\n setTrigger?.(node)\n },\n [ref, setTrigger],\n )\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" ref={mergedRef} {...props} />\n}\n\nexport function DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\n/**\n * Internal: Radix refocuses the trigger on close. With no trigger on the page (a dialog opened by\n * state, or one whose trigger closed with a menu), focus goes back to what had it on open.\n */\nexport function useCloseAutoFocus(onCloseAutoFocus?: (event: Event) => void) {\n const root = useDialogRootContext()\n return (event: Event) => {\n onCloseAutoFocus?.(event)\n if (event.defaultPrevented || !root) return\n if (root.getTrigger()?.isConnected) return\n event.preventDefault()\n restoreFocus(root.getReturnTarget())\n }\n}\n\n/* ─── Nesting ─────────────────────────────────────────────────────────────── */\n\ninterface DialogStackValue {\n /** Dialogs beneath this one: 0 for a top-level dialog. */\n depth: number\n /** Open dialog levels on top of this one (0, 1 or 2). */\n nested: number\n report: (levels: number) => void\n}\n\nconst DialogStackContext = React.createContext<DialogStackValue | null>(null)\nDialogStackContext.displayName = \"DialogStackContext\"\n\n/** Internal: register an open surface with the dialog beneath it and provide a level to the ones above. */\nexport function useDialogStackLevel(open: boolean) {\n const parent = React.useContext(DialogStackContext)\n const depth = parent ? parent.depth + 1 : 0\n const [nested, setNested] = React.useState(0)\n const report = parent?.report\n\n React.useEffect(() => {\n if (!report) return\n report(open ? Math.min(nested + 1, 2) : 0)\n return () => report(0)\n }, [report, open, nested])\n\n const value = React.useMemo<DialogStackValue>(() => ({ depth, nested, report: setNested }), [depth, nested])\n return { depth, nested, value }\n}\n\nexport function DialogStackProvider({ value, children }: { value: DialogStackValue; children: React.ReactNode }) {\n return <DialogStackContext.Provider value={value}>{children}</DialogStackContext.Provider>\n}\n\n/**\n * The nearest dialog's place in the stack: `depth` counts the dialogs beneath it (0 for a\n * top-level one) and `nested` the open levels on top of it. `null` outside a dialog.\n */\nexport function useDialogStack(): { depth: number; nested: number } | null {\n const stack = React.useContext(DialogStackContext)\n return stack ? { depth: stack.depth, nested: stack.nested } : null\n}\n\n/* ─── Content ─────────────────────────────────────────────────────────────── */\n\nconst DialogSlotsContext = React.createContext<DialogSlots | null>(null)\n\n/** The dialog's resolved density, for parts that size themselves to it (DialogStepper). */\nexport const DialogDensityContext = React.createContext<\"comfortable\" | \"compact\" | undefined>(undefined)\nDialogSlotsContext.displayName = \"DialogSlotsContext\"\n\nconst defaultSlots = dialogVariants()\nfunction useDialogSlots() {\n return React.useContext(DialogSlotsContext) ?? defaultSlots\n}\n\nexport interface DialogContentProps\n extends React.ComponentProps<typeof DialogPrimitive.Content>,\n Pick<DialogVariantProps, \"size\" | \"mobile\"> {\n density?: Density\n showClose?: boolean\n closeLabel?: string\n}\n\nexport function DialogContent({\n className,\n style,\n size = \"md\",\n mobile,\n density: densityProp,\n showClose = true,\n closeLabel = \"Close\",\n forceMount,\n onCloseAutoFocus,\n children,\n ...props\n}: DialogContentProps) {\n const density = useDensity(densityProp)\n const resolvedMobile = mobile ?? (size === \"command\" ? \"center\" : \"sheet\")\n const slots = dialogVariants({ density, size, mobile: resolvedMobile })\n const root = useDialogRootContext()\n const stack = useDialogStackLevel(root?.open ?? false)\n const handleCloseAutoFocus = useCloseAutoFocus(onCloseAutoFocus)\n\n const portal = (\n <DialogPrimitive.Portal forceMount={forceMount}>\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n data-stacked={stack.depth > 0 ? \"\" : undefined}\n forceMount={forceMount}\n className={slots.overlay()}\n />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-size={size}\n data-nested={stack.nested > 0 ? \"\" : undefined}\n forceMount={forceMount}\n onCloseAutoFocus={handleCloseAutoFocus}\n className={slots.content({ className })}\n style={{ \"--dialog-nested\": stack.nested, ...style } as React.CSSProperties}\n {...props}\n >\n <DialogSlotsContext.Provider value={slots}>\n <DialogDensityContext.Provider value={density}>\n <DialogStackProvider value={stack.value}>{children}</DialogStackProvider>\n </DialogDensityContext.Provider>\n </DialogSlotsContext.Provider>\n {showClose ? (\n <DialogPrimitive.Close asChild>\n <Button\n data-slot=\"dialog-close-button\"\n variant={size === \"media\" ? \"overlay\" : \"ghost\"}\n size=\"xs\"\n iconOnly\n tooltip={false}\n aria-label={closeLabel}\n className={slots.close()}\n >\n <X aria-hidden />\n </Button>\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n\n // Re-provide an explicit density so Buttons and fields inside follow the dialog, not the page.\n return densityProp ? <DensityProvider density={densityProp}>{portal}</DensityProvider> : portal\n}\n\n/* ─── Parts ───────────────────────────────────────────────────────────────── */\n\nexport function DialogIcon({ className, ...props }: React.ComponentProps<\"div\">) {\n const slots = useDialogSlots()\n return <div data-slot=\"dialog-icon\" aria-hidden className={slots.icon({ className })} {...props} />\n}\n\nexport interface DialogHeaderProps extends React.ComponentProps<\"div\"> {\n bordered?: boolean\n}\n\nexport function DialogHeader({ className, bordered = false, ...props }: DialogHeaderProps) {\n const slots = useDialogSlots()\n return (\n <div\n data-slot=\"dialog-header\"\n data-bordered={bordered ? \"\" : undefined}\n className={slots.header({ headerBordered: bordered, className })}\n {...props}\n />\n )\n}\n\nexport function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n const slots = useDialogSlots()\n return <DialogPrimitive.Title data-slot=\"dialog-title\" className={slots.title({ className })} {...props} />\n}\n\nexport function DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n const slots = useDialogSlots()\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={slots.description({ className })}\n {...props}\n />\n )\n}\n\nexport function DialogBody({ className, ...props }: React.ComponentProps<\"div\">) {\n const slots = useDialogSlots()\n return <div data-slot=\"dialog-body\" className={slots.body({ className })} {...props} />\n}\n\nexport interface DialogFooterProps extends React.ComponentProps<\"div\"> {\n bordered?: boolean\n}\n\nexport function DialogFooter({ className, bordered = true, ...props }: DialogFooterProps) {\n const slots = useDialogSlots()\n return (\n <div\n data-slot=\"dialog-footer\"\n data-bordered={bordered ? \"\" : undefined}\n className={slots.footer({ footerBordered: bordered, className })}\n {...props}\n />\n )\n}\n"],"mappings":";AA6LM,cAsIA,YAtIA;AA3LN,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAC1C,SAAS,SAAS;AA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GAAG,OAAO;AACvF;AAMO,SAAS,aAAa,EAAE,WAAW,WAAW,MAAM,GAAG,MAAM,GAAsB;AACxF,QAAM,QAAQ,eAAe;AAC7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,iBAAe,WAAW,KAAK;AAAA,MAC/B,WAAW,MAAM,OAAO,EAAE,gBAAgB,UAAU,UAAU,CAAC;AAAA,MAC9D,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function resolveReturnTarget(element) {
|
|
2
|
+
let current = element;
|
|
3
|
+
for (let level = 0; current && level < 8; level++) {
|
|
4
|
+
const menu = current.closest('[role="menu"]');
|
|
5
|
+
if (!menu) break;
|
|
6
|
+
const triggerId = menu.getAttribute("aria-labelledby");
|
|
7
|
+
current = triggerId ? document.getElementById(triggerId) : null;
|
|
8
|
+
}
|
|
9
|
+
if (!(current instanceof HTMLElement) || current === document.body) return null;
|
|
10
|
+
return current;
|
|
11
|
+
}
|
|
12
|
+
function restoreFocus(target) {
|
|
13
|
+
if (!target || !target.isConnected) return false;
|
|
14
|
+
target.focus({ preventScroll: true });
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
resolveReturnTarget,
|
|
19
|
+
restoreFocus
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=focus-return.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/dialog/focus-return.ts"],"sourcesContent":["/*\n * Where focus goes back to when a dialog opened without a trigger closes.\n *\n * A dialog opened by state (a shortcut, a row action, a command) has no `DialogTrigger` for Radix\n * to refocus, so it remembers what had focus when it opened. A menu item is a poor target: it\n * closes with its menu, so the walk climbs to the button that opened the menu, and from a\n * submenu on up to the button of the top menu (Radix labels each menu by its trigger's id).\n */\nexport function resolveReturnTarget(element: Element | null): HTMLElement | null {\n let current: Element | null = element\n for (let level = 0; current && level < 8; level++) {\n const menu = current.closest('[role=\"menu\"]')\n if (!menu) break\n const triggerId = menu.getAttribute(\"aria-labelledby\")\n current = triggerId ? document.getElementById(triggerId) : null\n }\n if (!(current instanceof HTMLElement) || current === document.body) return null\n return current\n}\n\n/** Focus the remembered element, if it is still on the page. Returns whether it did. */\nexport function restoreFocus(target: HTMLElement | null): boolean {\n if (!target || !target.isConnected) return false\n target.focus({ preventScroll: true })\n return true\n}\n"],"mappings":"AAQO,SAAS,oBAAoB,SAA6C;AAC/E,MAAI,UAA0B;AAC9B,WAAS,QAAQ,GAAG,WAAW,QAAQ,GAAG,SAAS;AACjD,UAAM,OAAO,QAAQ,QAAQ,eAAe;AAC5C,QAAI,CAAC,KAAM;AACX,UAAM,YAAY,KAAK,aAAa,iBAAiB;AACrD,cAAU,YAAY,SAAS,eAAe,SAAS,IAAI;AAAA,EAC7D;AACA,MAAI,EAAE,mBAAmB,gBAAgB,YAAY,SAAS,KAAM,QAAO;AAC3E,SAAO;AACT;AAGO,SAAS,aAAa,QAAqC;AAChE,MAAI,CAAC,UAAU,CAAC,OAAO,YAAa,QAAO;AAC3C,SAAO,MAAM,EAAE,eAAe,KAAK,CAAC;AACpC,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogTrigger,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogIcon,
|
|
7
|
+
DialogHeader,
|
|
8
|
+
DialogBody,
|
|
9
|
+
DialogFooter,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
DialogDescription,
|
|
12
|
+
dialogVariants,
|
|
13
|
+
useDialogStack
|
|
14
|
+
} from "./dialog.mjs";
|
|
15
|
+
import { DialogStepper } from "./dialog-stepper.mjs";
|
|
16
|
+
import { DialogDensityContext } from "./dialog.mjs";
|
|
17
|
+
export {
|
|
18
|
+
Dialog,
|
|
19
|
+
DialogBody,
|
|
20
|
+
DialogClose,
|
|
21
|
+
DialogContent,
|
|
22
|
+
DialogDensityContext,
|
|
23
|
+
DialogDescription,
|
|
24
|
+
DialogFooter,
|
|
25
|
+
DialogHeader,
|
|
26
|
+
DialogIcon,
|
|
27
|
+
DialogStepper,
|
|
28
|
+
DialogTitle,
|
|
29
|
+
DialogTrigger,
|
|
30
|
+
dialogVariants,
|
|
31
|
+
useDialogStack
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/dialog/index.ts"],"sourcesContent":["export {\r\n Dialog,\r\n DialogTrigger,\r\n DialogClose,\r\n DialogContent,\r\n DialogIcon,\r\n DialogHeader,\r\n DialogBody,\r\n DialogFooter,\r\n DialogTitle,\r\n DialogDescription,\r\n dialogVariants,\r\n useDialogStack,\r\n type DialogProps,\r\n type DialogContentProps,\r\n type DialogFooterProps,\r\n type DialogHeaderProps,\r\n} from \"./dialog.mjs\"\r\nexport { DialogStepper } from \"./dialog-stepper.mjs\"\r\nexport { DialogDensityContext } from \"./dialog.mjs\"\r\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;","names":[]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Separator } from "radix-ui";
|
|
3
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
4
|
+
const smartCollapse = [
|
|
5
|
+
// Leading: no rendered, non-divider sibling before it.
|
|
6
|
+
"[&:not(:is(:not([hidden],[data-slot=divider])~*))]:hidden",
|
|
7
|
+
// Trailing: no rendered, non-divider sibling after it.
|
|
8
|
+
"[&:not(:has(~:not([hidden],[data-slot=divider])))]:hidden",
|
|
9
|
+
// Doubled: another divider directly before it (hidden content in between counts as nothing).
|
|
10
|
+
"[[data-slot=divider]+&]:hidden [[data-slot=divider]+[hidden]+&]:hidden"
|
|
11
|
+
];
|
|
12
|
+
const dividerVariants = tv({
|
|
13
|
+
slots: {
|
|
14
|
+
root: "shrink-0",
|
|
15
|
+
line: "shrink-0",
|
|
16
|
+
label: [
|
|
17
|
+
"inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-muted-foreground",
|
|
18
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
solid: { root: "border-solid", line: "border-solid" },
|
|
24
|
+
dashed: { root: "border-dashed", line: "border-dashed" },
|
|
25
|
+
dotted: { root: "border-dotted", line: "border-dotted" },
|
|
26
|
+
gradient: {
|
|
27
|
+
root: "border-0 from-transparent via-border to-transparent",
|
|
28
|
+
line: "border-0 from-transparent via-border to-transparent"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
orientation: {
|
|
32
|
+
horizontal: { root: "w-full", line: "min-w-0 flex-1" },
|
|
33
|
+
vertical: { root: "self-stretch" }
|
|
34
|
+
},
|
|
35
|
+
labelled: {
|
|
36
|
+
true: { root: "flex w-full items-center gap-3 border-0 bg-none" },
|
|
37
|
+
false: {}
|
|
38
|
+
},
|
|
39
|
+
tone: {
|
|
40
|
+
default: { root: "border-border", line: "border-border" },
|
|
41
|
+
brand: {
|
|
42
|
+
root: "border-brand",
|
|
43
|
+
line: "border-brand",
|
|
44
|
+
label: "text-brand"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
smart: {
|
|
48
|
+
true: { root: smartCollapse },
|
|
49
|
+
false: {}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
compoundVariants: [
|
|
53
|
+
{ orientation: "horizontal", labelled: false, class: { root: "h-0 border-t" } },
|
|
54
|
+
{ orientation: "vertical", class: { root: "h-auto w-0 border-s" } },
|
|
55
|
+
{ labelled: true, class: { line: "h-0 border-t" } },
|
|
56
|
+
{
|
|
57
|
+
variant: "gradient",
|
|
58
|
+
orientation: "horizontal",
|
|
59
|
+
labelled: false,
|
|
60
|
+
class: { root: "h-px border-0 bg-linear-to-r" }
|
|
61
|
+
},
|
|
62
|
+
{ variant: "gradient", orientation: "vertical", class: { root: "w-px border-0 bg-linear-to-b" } },
|
|
63
|
+
{ variant: "gradient", labelled: true, class: { line: "h-px border-0 bg-linear-to-r" } },
|
|
64
|
+
{ variant: "gradient", tone: "brand", class: { root: "via-brand", line: "via-brand" } }
|
|
65
|
+
],
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
variant: "solid",
|
|
68
|
+
orientation: "horizontal",
|
|
69
|
+
labelled: false,
|
|
70
|
+
tone: "default",
|
|
71
|
+
smart: true
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
function Divider({
|
|
75
|
+
className,
|
|
76
|
+
variant,
|
|
77
|
+
orientation = "horizontal",
|
|
78
|
+
tone,
|
|
79
|
+
labelPosition = "center",
|
|
80
|
+
decorative = false,
|
|
81
|
+
static: isStatic = false,
|
|
82
|
+
children,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
const hasLabel = orientation === "horizontal" && children != null && children !== false;
|
|
86
|
+
const slots = dividerVariants({
|
|
87
|
+
variant,
|
|
88
|
+
orientation: orientation ?? "horizontal",
|
|
89
|
+
tone,
|
|
90
|
+
labelled: hasLabel,
|
|
91
|
+
smart: !isStatic
|
|
92
|
+
});
|
|
93
|
+
const smart = isStatic ? void 0 : "";
|
|
94
|
+
if (!hasLabel) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
Separator.Root,
|
|
97
|
+
{
|
|
98
|
+
"data-slot": "divider",
|
|
99
|
+
"data-smart": smart,
|
|
100
|
+
orientation: orientation ?? "horizontal",
|
|
101
|
+
decorative,
|
|
102
|
+
className: slots.root({ className }),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return /* @__PURE__ */ jsxs(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "divider",
|
|
111
|
+
"data-smart": smart,
|
|
112
|
+
"data-orientation": "horizontal",
|
|
113
|
+
"data-label-position": labelPosition,
|
|
114
|
+
role: decorative ? "none" : "separator",
|
|
115
|
+
"aria-orientation": decorative ? void 0 : "horizontal",
|
|
116
|
+
className: slots.root({ className }),
|
|
117
|
+
...props,
|
|
118
|
+
children: [
|
|
119
|
+
labelPosition !== "start" && /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-slot": "divider-line", className: slots.line() }),
|
|
120
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "divider-label", className: slots.label(), children }),
|
|
121
|
+
labelPosition !== "end" && /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-slot": "divider-line", className: slots.line() })
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
Divider,
|
|
128
|
+
dividerVariants
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=divider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/divider/divider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Separator } from \"radix-ui\"\n\nimport { tv, type VariantProps } from \"../../../lib/tv.mjs\"\n\n/*\n * Smart collapse. A divider only paints when it separates two things, so it hides itself when it\n * would be orphaned: nothing before it in its group, nothing after it, or another divider right\n * before it. \"Nothing\" means no sibling that is rendered (absent content is `null` or carries\n * `hidden`) and is not itself a divider. Written as selectors on the divider itself so it needs no\n * global stylesheet; `static` drops these classes and the `data-smart` hook.\n */\nconst smartCollapse = [\n // Leading: no rendered, non-divider sibling before it.\n \"[&:not(:is(:not([hidden],[data-slot=divider])~*))]:hidden\",\n // Trailing: no rendered, non-divider sibling after it.\n \"[&:not(:has(~:not([hidden],[data-slot=divider])))]:hidden\",\n // Doubled: another divider directly before it (hidden content in between counts as nothing).\n \"[[data-slot=divider]+&]:hidden [[data-slot=divider]+[hidden]+&]:hidden\",\n]\n\nexport const dividerVariants = tv({\n slots: {\n root: \"shrink-0\",\n line: \"shrink-0\",\n label: [\n \"inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-muted-foreground\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n ],\n },\n variants: {\n variant: {\n solid: { root: \"border-solid\", line: \"border-solid\" },\n dashed: { root: \"border-dashed\", line: \"border-dashed\" },\n dotted: { root: \"border-dotted\", line: \"border-dotted\" },\n gradient: {\n root: \"border-0 from-transparent via-border to-transparent\",\n line: \"border-0 from-transparent via-border to-transparent\",\n },\n },\n orientation: {\n horizontal: { root: \"w-full\", line: \"min-w-0 flex-1\" },\n vertical: { root: \"self-stretch\" },\n },\n labelled: {\n true: { root: \"flex w-full items-center gap-3 border-0 bg-none\" },\n false: {},\n },\n tone: {\n default: { root: \"border-border\", line: \"border-border\" },\n brand: {\n root: \"border-brand\",\n line: \"border-brand\",\n label: \"text-brand\",\n },\n },\n smart: {\n true: { root: smartCollapse },\n false: {},\n },\n },\n compoundVariants: [\n { orientation: \"horizontal\", labelled: false, class: { root: \"h-0 border-t\" } },\n { orientation: \"vertical\", class: { root: \"h-auto w-0 border-s\" } },\n { labelled: true, class: { line: \"h-0 border-t\" } },\n {\n variant: \"gradient\",\n orientation: \"horizontal\",\n labelled: false,\n class: { root: \"h-px border-0 bg-linear-to-r\" },\n },\n { variant: \"gradient\", orientation: \"vertical\", class: { root: \"w-px border-0 bg-linear-to-b\" } },\n { variant: \"gradient\", labelled: true, class: { line: \"h-px border-0 bg-linear-to-r\" } },\n { variant: \"gradient\", tone: \"brand\", class: { root: \"via-brand\", line: \"via-brand\" } },\n ],\n defaultVariants: {\n variant: \"solid\",\n orientation: \"horizontal\",\n labelled: false,\n tone: \"default\",\n smart: true,\n },\n})\n\ntype DividerVariantProps = Omit<VariantProps<typeof dividerVariants>, \"labelled\" | \"smart\">\n\nexport interface DividerProps extends React.ComponentProps<\"div\">, DividerVariantProps {\n /** Where the label sits; `start` and `end` drop the line on that side. Ignored without children. */\n labelPosition?: \"start\" | \"center\" | \"end\"\n /** Purely visual: the rule takes `role=\"none\"` and leaves the accessibility tree. */\n decorative?: boolean\n /** Opt out of the smart auto-collapse. */\n static?: boolean\n}\n\nexport function Divider({\n className,\n variant,\n orientation = \"horizontal\",\n tone,\n labelPosition = \"center\",\n decorative = false,\n static: isStatic = false,\n children,\n ...props\n}: DividerProps) {\n const hasLabel = orientation === \"horizontal\" && children != null && children !== false\n const slots = dividerVariants({\n variant,\n orientation: orientation ?? \"horizontal\",\n tone,\n labelled: hasLabel,\n smart: !isStatic,\n })\n const smart = isStatic ? undefined : \"\"\n\n if (!hasLabel) {\n return (\n <Separator.Root\n data-slot=\"divider\"\n data-smart={smart}\n orientation={orientation ?? \"horizontal\"}\n decorative={decorative}\n className={slots.root({ className })}\n {...props}\n />\n )\n }\n\n return (\n <div\n data-slot=\"divider\"\n data-smart={smart}\n data-orientation=\"horizontal\"\n data-label-position={labelPosition}\n role={decorative ? \"none\" : \"separator\"}\n aria-orientation={decorative ? undefined : \"horizontal\"}\n className={slots.root({ className })}\n {...props}\n >\n {labelPosition !== \"start\" && (\n <span aria-hidden data-slot=\"divider-line\" className={slots.line()} />\n )}\n <span data-slot=\"divider-label\" className={slots.label()}>\n {children}\n </span>\n {labelPosition !== \"end\" && (\n <span aria-hidden data-slot=\"divider-line\" className={slots.line()} />\n )}\n </div>\n )\n}\n"],"mappings":"AAsHM,cAYF,YAZE;AArHN,SAAS,iBAAiB;AAE1B,SAAS,UAA6B;AAStC,MAAM,gBAAgB;AAAA;AAAA,EAEpB;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AACF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AW,MAAC,aAAU,gBAAe,WAAW,MAAM,KAAK,GAAG;AAAA,QAEtE,oBAAC,UAAK,aAAU,iBAAgB,WAAW,MAAM,MAAM,GACpD,UACH;AAAA,QACC,kBAAkB,SACjB,oBAAC,UAAK,eAAW,MAAC,aAAU,gBAAe,WAAW,MAAM,KAAK,GAAG;AAAA;AAAA;AAAA,EAExE;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/divider/index.ts"],"sourcesContent":["export { Divider, dividerVariants, type DividerProps } from \"./divider.mjs\"\n"],"mappings":"AAAA,SAAS,SAAS,uBAA0C;","names":[]}
|