@thalavaisankar/atoms 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +196 -2
- package/THIRD_PARTY_NOTICES.md +275 -0
- package/dist/blocks/index.d.mts +2 -0
- package/dist/blocks/index.mjs +1 -0
- package/dist/blocks/index.mjs.map +1 -0
- package/dist/components/ui/accordion/accordion.mjs +194 -0
- package/dist/components/ui/accordion/accordion.mjs.map +1 -0
- package/dist/components/ui/accordion/index.mjs +15 -0
- package/dist/components/ui/accordion/index.mjs.map +1 -0
- package/dist/components/ui/activity-feed/activity-feed.mjs +287 -0
- package/dist/components/ui/activity-feed/activity-feed.mjs.map +1 -0
- package/dist/components/ui/activity-feed/index.mjs +39 -0
- package/dist/components/ui/activity-feed/index.mjs.map +1 -0
- package/dist/components/ui/alert/alert.mjs +128 -0
- package/dist/components/ui/alert/alert.mjs.map +1 -0
- package/dist/components/ui/alert/index.mjs +17 -0
- package/dist/components/ui/alert/index.mjs.map +1 -0
- package/dist/components/ui/animated-label/animated-label.mjs +89 -0
- package/dist/components/ui/animated-label/animated-label.mjs.map +1 -0
- package/dist/components/ui/animated-label/index.mjs +9 -0
- package/dist/components/ui/animated-label/index.mjs.map +1 -0
- package/dist/components/ui/animated-number/animated-number.mjs +101 -0
- package/dist/components/ui/animated-number/animated-number.mjs.map +1 -0
- package/dist/components/ui/animated-number/index.mjs +5 -0
- package/dist/components/ui/animated-number/index.mjs.map +1 -0
- package/dist/components/ui/avatar/avatar.mjs +130 -0
- package/dist/components/ui/avatar/avatar.mjs.map +1 -0
- package/dist/components/ui/avatar/index.mjs +17 -0
- package/dist/components/ui/avatar/index.mjs.map +1 -0
- package/dist/components/ui/avatar-group/avatar-group.mjs +49 -0
- package/dist/components/ui/avatar-group/avatar-group.mjs.map +1 -0
- package/dist/components/ui/avatar-group/index.mjs +5 -0
- package/dist/components/ui/avatar-group/index.mjs.map +1 -0
- package/dist/components/ui/badge/badge-motion.mjs +108 -0
- package/dist/components/ui/badge/badge-motion.mjs.map +1 -0
- package/dist/components/ui/badge/badge.mjs +314 -0
- package/dist/components/ui/badge/badge.mjs.map +1 -0
- package/dist/components/ui/badge/index.mjs +27 -0
- package/dist/components/ui/badge/index.mjs.map +1 -0
- package/dist/components/ui/badge/readable-ink.mjs +36 -0
- package/dist/components/ui/badge/readable-ink.mjs.map +1 -0
- package/dist/components/ui/badge-group/badge-group.mjs +132 -0
- package/dist/components/ui/badge-group/badge-group.mjs.map +1 -0
- package/dist/components/ui/badge-group/index.mjs +5 -0
- package/dist/components/ui/badge-group/index.mjs.map +1 -0
- package/dist/components/ui/breadcrumb/breadcrumb.mjs +108 -0
- package/dist/components/ui/breadcrumb/breadcrumb.mjs.map +1 -0
- package/dist/components/ui/breadcrumb/index.mjs +19 -0
- package/dist/components/ui/breadcrumb/index.mjs.map +1 -0
- package/dist/components/ui/button/button-variants.mjs +80 -0
- package/dist/components/ui/button/button-variants.mjs.map +1 -0
- package/dist/components/ui/button/button.mjs +74 -0
- package/dist/components/ui/button/button.mjs.map +1 -0
- package/dist/components/ui/button/index.mjs +17 -0
- package/dist/components/ui/button/index.mjs.map +1 -0
- package/dist/components/ui/button/social-button.mjs +45 -0
- package/dist/components/ui/button/social-button.mjs.map +1 -0
- package/dist/components/ui/button/social-logos.mjs +179 -0
- package/dist/components/ui/button/social-logos.mjs.map +1 -0
- package/dist/components/ui/button/split-button.mjs +72 -0
- package/dist/components/ui/button/split-button.mjs.map +1 -0
- package/dist/components/ui/button-group/button-group.mjs +58 -0
- package/dist/components/ui/button-group/button-group.mjs.map +1 -0
- package/dist/components/ui/button-group/index.mjs +11 -0
- package/dist/components/ui/button-group/index.mjs.map +1 -0
- package/dist/components/ui/card/card.mjs +131 -0
- package/dist/components/ui/card/card.mjs.map +1 -0
- package/dist/components/ui/card/index.mjs +23 -0
- package/dist/components/ui/card/index.mjs.map +1 -0
- package/dist/components/ui/chart/bar-list.mjs +87 -0
- package/dist/components/ui/chart/bar-list.mjs.map +1 -0
- package/dist/components/ui/chart/chart-colors.mjs +68 -0
- package/dist/components/ui/chart/chart-colors.mjs.map +1 -0
- package/dist/components/ui/chart/chart-geometry.mjs +152 -0
- package/dist/components/ui/chart/chart-geometry.mjs.map +1 -0
- package/dist/components/ui/chart/chart-specialized.mjs +194 -0
- package/dist/components/ui/chart/chart-specialized.mjs.map +1 -0
- package/dist/components/ui/chart/chart.mjs +648 -0
- package/dist/components/ui/chart/chart.mjs.map +1 -0
- package/dist/components/ui/chart/index.mjs +88 -0
- package/dist/components/ui/chart/index.mjs.map +1 -0
- package/dist/components/ui/chart/radial-meter.mjs +142 -0
- package/dist/components/ui/chart/radial-meter.mjs.map +1 -0
- package/dist/components/ui/chart/types.mjs +1 -0
- package/dist/components/ui/chart/types.mjs.map +1 -0
- package/dist/components/ui/checkbox/checkbox.mjs +183 -0
- package/dist/components/ui/checkbox/checkbox.mjs.map +1 -0
- package/dist/components/ui/checkbox/index.mjs +11 -0
- package/dist/components/ui/checkbox/index.mjs.map +1 -0
- package/dist/components/ui/checklist/checklist.mjs +353 -0
- package/dist/components/ui/checklist/checklist.mjs.map +1 -0
- package/dist/components/ui/checklist/index.mjs +33 -0
- package/dist/components/ui/checklist/index.mjs.map +1 -0
- package/dist/components/ui/chip/chip.mjs +202 -0
- package/dist/components/ui/chip/chip.mjs.map +1 -0
- package/dist/components/ui/chip/index.mjs +13 -0
- package/dist/components/ui/chip/index.mjs.map +1 -0
- package/dist/components/ui/chip-group/chip-group.mjs +204 -0
- package/dist/components/ui/chip-group/chip-group.mjs.map +1 -0
- package/dist/components/ui/chip-group/index.mjs +11 -0
- package/dist/components/ui/chip-group/index.mjs.map +1 -0
- package/dist/components/ui/code-snippet/code-highlighter.mjs +16 -0
- package/dist/components/ui/code-snippet/code-highlighter.mjs.map +1 -0
- package/dist/components/ui/code-snippet/code-snippet.mjs +437 -0
- package/dist/components/ui/code-snippet/code-snippet.mjs.map +1 -0
- package/dist/components/ui/code-snippet/index.mjs +17 -0
- package/dist/components/ui/code-snippet/index.mjs.map +1 -0
- package/dist/components/ui/code-snippet/labels.mjs +16 -0
- package/dist/components/ui/code-snippet/labels.mjs.map +1 -0
- package/dist/components/ui/code-snippet/tokenize.mjs +715 -0
- package/dist/components/ui/code-snippet/tokenize.mjs.map +1 -0
- package/dist/components/ui/code-snippet/types.mjs +1 -0
- package/dist/components/ui/code-snippet/types.mjs.map +1 -0
- package/dist/components/ui/collapsible/collapsible.mjs +85 -0
- package/dist/components/ui/collapsible/collapsible.mjs.map +1 -0
- package/dist/components/ui/collapsible/index.mjs +15 -0
- package/dist/components/ui/collapsible/index.mjs.map +1 -0
- package/dist/components/ui/color-picker/color-picker.mjs +852 -0
- package/dist/components/ui/color-picker/color-picker.mjs.map +1 -0
- package/dist/components/ui/color-picker/index.mjs +47 -0
- package/dist/components/ui/color-picker/index.mjs.map +1 -0
- package/dist/components/ui/combobox/combobox.mjs +745 -0
- package/dist/components/ui/combobox/combobox.mjs.map +1 -0
- package/dist/components/ui/combobox/index.mjs +27 -0
- package/dist/components/ui/combobox/index.mjs.map +1 -0
- package/dist/components/ui/command/command.mjs +439 -0
- package/dist/components/ui/command/command.mjs.map +1 -0
- package/dist/components/ui/command/index.mjs +31 -0
- package/dist/components/ui/command/index.mjs.map +1 -0
- package/dist/components/ui/compare-slider/compare-slider.mjs +335 -0
- package/dist/components/ui/compare-slider/compare-slider.mjs.map +1 -0
- package/dist/components/ui/compare-slider/index.mjs +17 -0
- package/dist/components/ui/compare-slider/index.mjs.map +1 -0
- package/dist/components/ui/context-menu/context-menu.mjs +184 -0
- package/dist/components/ui/context-menu/context-menu.mjs.map +1 -0
- package/dist/components/ui/context-menu/index.mjs +37 -0
- package/dist/components/ui/context-menu/index.mjs.map +1 -0
- package/dist/components/ui/data-table/active-filters.mjs +69 -0
- package/dist/components/ui/data-table/active-filters.mjs.map +1 -0
- package/dist/components/ui/data-table/body-row.mjs +118 -0
- package/dist/components/ui/data-table/body-row.mjs.map +1 -0
- package/dist/components/ui/data-table/cards.mjs +76 -0
- package/dist/components/ui/data-table/cards.mjs.map +1 -0
- package/dist/components/ui/data-table/data-table.mjs +680 -0
- package/dist/components/ui/data-table/data-table.mjs.map +1 -0
- package/dist/components/ui/data-table/empty.mjs +26 -0
- package/dist/components/ui/data-table/empty.mjs.map +1 -0
- package/dist/components/ui/data-table/expand.mjs +70 -0
- package/dist/components/ui/data-table/expand.mjs.map +1 -0
- package/dist/components/ui/data-table/faceted-filter.mjs +112 -0
- package/dist/components/ui/data-table/faceted-filter.mjs.map +1 -0
- package/dist/components/ui/data-table/features.mjs +96 -0
- package/dist/components/ui/data-table/features.mjs.map +1 -0
- package/dist/components/ui/data-table/grip.mjs +37 -0
- package/dist/components/ui/data-table/grip.mjs.map +1 -0
- package/dist/components/ui/data-table/header-cell.mjs +85 -0
- package/dist/components/ui/data-table/header-cell.mjs.map +1 -0
- package/dist/components/ui/data-table/index.mjs +55 -0
- package/dist/components/ui/data-table/index.mjs.map +1 -0
- package/dist/components/ui/data-table/labels.mjs +55 -0
- package/dist/components/ui/data-table/labels.mjs.map +1 -0
- package/dist/components/ui/data-table/load-more.mjs +56 -0
- package/dist/components/ui/data-table/load-more.mjs.map +1 -0
- package/dist/components/ui/data-table/move-item.mjs +11 -0
- package/dist/components/ui/data-table/move-item.mjs.map +1 -0
- package/dist/components/ui/data-table/persist.mjs +65 -0
- package/dist/components/ui/data-table/persist.mjs.map +1 -0
- package/dist/components/ui/data-table/selection-bar.mjs +51 -0
- package/dist/components/ui/data-table/selection-bar.mjs.map +1 -0
- package/dist/components/ui/data-table/tabs.mjs +48 -0
- package/dist/components/ui/data-table/tabs.mjs.map +1 -0
- package/dist/components/ui/data-table/toolbar.mjs +92 -0
- package/dist/components/ui/data-table/toolbar.mjs.map +1 -0
- package/dist/components/ui/data-table/use-reorder.mjs +239 -0
- package/dist/components/ui/data-table/use-reorder.mjs.map +1 -0
- package/dist/components/ui/data-table/use-reveal.mjs +24 -0
- package/dist/components/ui/data-table/use-reveal.mjs.map +1 -0
- package/dist/components/ui/data-table/use-table-state.mjs +38 -0
- package/dist/components/ui/data-table/use-table-state.mjs.map +1 -0
- package/dist/components/ui/data-table/view-options.mjs +66 -0
- package/dist/components/ui/data-table/view-options.mjs.map +1 -0
- package/dist/components/ui/date-picker/calendar.mjs +466 -0
- package/dist/components/ui/date-picker/calendar.mjs.map +1 -0
- package/dist/components/ui/date-picker/date-picker.mjs +366 -0
- package/dist/components/ui/date-picker/date-picker.mjs.map +1 -0
- package/dist/components/ui/date-picker/index.mjs +17 -0
- package/dist/components/ui/date-picker/index.mjs.map +1 -0
- package/dist/components/ui/date-picker/presets.mjs +49 -0
- package/dist/components/ui/date-picker/presets.mjs.map +1 -0
- package/dist/components/ui/description-list/description-list.mjs +40 -0
- package/dist/components/ui/description-list/description-list.mjs.map +1 -0
- package/dist/components/ui/description-list/index.mjs +15 -0
- package/dist/components/ui/description-list/index.mjs.map +1 -0
- package/dist/components/ui/dialog/dialog-stepper.mjs +23 -0
- package/dist/components/ui/dialog/dialog-stepper.mjs.map +1 -0
- package/dist/components/ui/dialog/dialog.mjs +343 -0
- package/dist/components/ui/dialog/dialog.mjs.map +1 -0
- package/dist/components/ui/dialog/focus-return.mjs +21 -0
- package/dist/components/ui/dialog/focus-return.mjs.map +1 -0
- package/dist/components/ui/dialog/index.mjs +33 -0
- package/dist/components/ui/dialog/index.mjs.map +1 -0
- package/dist/components/ui/divider/divider.mjs +130 -0
- package/dist/components/ui/divider/divider.mjs.map +1 -0
- package/dist/components/ui/divider/index.mjs +6 -0
- package/dist/components/ui/divider/index.mjs.map +1 -0
- package/dist/components/ui/dock/dock.mjs +444 -0
- package/dist/components/ui/dock/dock.mjs.map +1 -0
- package/dist/components/ui/dock/index.mjs +19 -0
- package/dist/components/ui/dock/index.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-actions.mjs +118 -0
- package/dist/components/ui/document-editor/block-actions.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-commands.mjs +182 -0
- package/dist/components/ui/document-editor/block-commands.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-handle.mjs +387 -0
- package/dist/components/ui/document-editor/block-handle.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-morph.mjs +95 -0
- package/dist/components/ui/document-editor/block-morph.mjs.map +1 -0
- package/dist/components/ui/document-editor/block-selection.mjs +81 -0
- package/dist/components/ui/document-editor/block-selection.mjs.map +1 -0
- package/dist/components/ui/document-editor/blocks.mjs +30 -0
- package/dist/components/ui/document-editor/blocks.mjs.map +1 -0
- package/dist/components/ui/document-editor/bubble-menu.mjs +120 -0
- package/dist/components/ui/document-editor/bubble-menu.mjs.map +1 -0
- package/dist/components/ui/document-editor/code-block.mjs +89 -0
- package/dist/components/ui/document-editor/code-block.mjs.map +1 -0
- package/dist/components/ui/document-editor/collaboration-types.mjs +9 -0
- package/dist/components/ui/document-editor/collaboration-types.mjs.map +1 -0
- package/dist/components/ui/document-editor/collaboration.mjs +198 -0
- package/dist/components/ui/document-editor/collaboration.mjs.map +1 -0
- package/dist/components/ui/document-editor/columns.mjs +52 -0
- package/dist/components/ui/document-editor/columns.mjs.map +1 -0
- package/dist/components/ui/document-editor/contents.mjs +60 -0
- package/dist/components/ui/document-editor/contents.mjs.map +1 -0
- package/dist/components/ui/document-editor/date-chip.mjs +115 -0
- package/dist/components/ui/document-editor/date-chip.mjs.map +1 -0
- package/dist/components/ui/document-editor/date-words.mjs +101 -0
- package/dist/components/ui/document-editor/date-words.mjs.map +1 -0
- package/dist/components/ui/document-editor/doc-labels.mjs +19 -0
- package/dist/components/ui/document-editor/doc-labels.mjs.map +1 -0
- package/dist/components/ui/document-editor/document-editor.mjs +496 -0
- package/dist/components/ui/document-editor/document-editor.mjs.map +1 -0
- package/dist/components/ui/document-editor/emoji-suggest.mjs +81 -0
- package/dist/components/ui/document-editor/emoji-suggest.mjs.map +1 -0
- package/dist/components/ui/document-editor/focus-mode.mjs +32 -0
- package/dist/components/ui/document-editor/focus-mode.mjs.map +1 -0
- package/dist/components/ui/document-editor/geometry.mjs +35 -0
- package/dist/components/ui/document-editor/geometry.mjs.map +1 -0
- package/dist/components/ui/document-editor/ghost-text.mjs +154 -0
- package/dist/components/ui/document-editor/ghost-text.mjs.map +1 -0
- package/dist/components/ui/document-editor/gliding-caret.mjs +118 -0
- package/dist/components/ui/document-editor/gliding-caret.mjs.map +1 -0
- package/dist/components/ui/document-editor/headings.mjs +64 -0
- package/dist/components/ui/document-editor/headings.mjs.map +1 -0
- package/dist/components/ui/document-editor/image.mjs +318 -0
- package/dist/components/ui/document-editor/image.mjs.map +1 -0
- package/dist/components/ui/document-editor/index.mjs +131 -0
- package/dist/components/ui/document-editor/index.mjs.map +1 -0
- package/dist/components/ui/document-editor/labels.mjs +96 -0
- package/dist/components/ui/document-editor/labels.mjs.map +1 -0
- package/dist/components/ui/document-editor/link-card.mjs +138 -0
- package/dist/components/ui/document-editor/link-card.mjs.map +1 -0
- package/dist/components/ui/document-editor/mentions.mjs +105 -0
- package/dist/components/ui/document-editor/mentions.mjs.map +1 -0
- package/dist/components/ui/document-editor/outline.mjs +138 -0
- package/dist/components/ui/document-editor/outline.mjs.map +1 -0
- package/dist/components/ui/document-editor/section-fold.mjs +124 -0
- package/dist/components/ui/document-editor/section-fold.mjs.map +1 -0
- package/dist/components/ui/document-editor/slash-command.mjs +210 -0
- package/dist/components/ui/document-editor/slash-command.mjs.map +1 -0
- package/dist/components/ui/document-editor/suggest-list.mjs +187 -0
- package/dist/components/ui/document-editor/suggest-list.mjs.map +1 -0
- package/dist/components/ui/document-editor/table.mjs +242 -0
- package/dist/components/ui/document-editor/table.mjs.map +1 -0
- package/dist/components/ui/document-editor/templates.mjs +66 -0
- package/dist/components/ui/document-editor/templates.mjs.map +1 -0
- package/dist/components/ui/document-editor/toggle.mjs +176 -0
- package/dist/components/ui/document-editor/toggle.mjs.map +1 -0
- package/dist/components/ui/document-editor/typography-rules.mjs +8 -0
- package/dist/components/ui/document-editor/typography-rules.mjs.map +1 -0
- package/dist/components/ui/document-editor/use-editor-value.mjs +34 -0
- package/dist/components/ui/document-editor/use-editor-value.mjs.map +1 -0
- package/dist/components/ui/drawer/drawer-nav.mjs +153 -0
- package/dist/components/ui/drawer/drawer-nav.mjs.map +1 -0
- package/dist/components/ui/drawer/drawer.mjs +334 -0
- package/dist/components/ui/drawer/drawer.mjs.map +1 -0
- package/dist/components/ui/drawer/index.mjs +37 -0
- package/dist/components/ui/drawer/index.mjs.map +1 -0
- package/dist/components/ui/drawer/use-swipe-to-close.mjs +77 -0
- package/dist/components/ui/drawer/use-swipe-to-close.mjs.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.mjs +567 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.mjs.map +1 -0
- package/dist/components/ui/dropdown-menu/index.mjs +43 -0
- package/dist/components/ui/dropdown-menu/index.mjs.map +1 -0
- package/dist/components/ui/editable-text/editable-text.mjs +148 -0
- package/dist/components/ui/editable-text/editable-text.mjs.map +1 -0
- package/dist/components/ui/editable-text/index.mjs +6 -0
- package/dist/components/ui/editable-text/index.mjs.map +1 -0
- package/dist/components/ui/emoji-picker/emoji-data.mjs +469 -0
- package/dist/components/ui/emoji-picker/emoji-data.mjs.map +1 -0
- package/dist/components/ui/emoji-picker/emoji-picker.mjs +464 -0
- package/dist/components/ui/emoji-picker/emoji-picker.mjs.map +1 -0
- package/dist/components/ui/emoji-picker/index.mjs +19 -0
- package/dist/components/ui/emoji-picker/index.mjs.map +1 -0
- package/dist/components/ui/empty-state/empty-state.mjs +110 -0
- package/dist/components/ui/empty-state/empty-state.mjs.map +1 -0
- package/dist/components/ui/empty-state/index.mjs +17 -0
- package/dist/components/ui/empty-state/index.mjs.map +1 -0
- package/dist/components/ui/event-calendar/calendar-math.mjs +256 -0
- package/dist/components/ui/event-calendar/calendar-math.mjs.map +1 -0
- package/dist/components/ui/event-calendar/context.mjs +51 -0
- package/dist/components/ui/event-calendar/context.mjs.map +1 -0
- package/dist/components/ui/event-calendar/editor.mjs +292 -0
- package/dist/components/ui/event-calendar/editor.mjs.map +1 -0
- package/dist/components/ui/event-calendar/event-block.mjs +55 -0
- package/dist/components/ui/event-calendar/event-block.mjs.map +1 -0
- package/dist/components/ui/event-calendar/event-calendar.mjs +438 -0
- package/dist/components/ui/event-calendar/event-calendar.mjs.map +1 -0
- package/dist/components/ui/event-calendar/event-keys.mjs +41 -0
- package/dist/components/ui/event-calendar/event-keys.mjs.map +1 -0
- package/dist/components/ui/event-calendar/index.mjs +37 -0
- package/dist/components/ui/event-calendar/index.mjs.map +1 -0
- package/dist/components/ui/event-calendar/month-grid.mjs +207 -0
- package/dist/components/ui/event-calendar/month-grid.mjs.map +1 -0
- package/dist/components/ui/event-calendar/narrow.mjs +193 -0
- package/dist/components/ui/event-calendar/narrow.mjs.map +1 -0
- package/dist/components/ui/event-calendar/time-grid.mjs +534 -0
- package/dist/components/ui/event-calendar/time-grid.mjs.map +1 -0
- package/dist/components/ui/expandable-search/expandable-search.mjs +174 -0
- package/dist/components/ui/expandable-search/expandable-search.mjs.map +1 -0
- package/dist/components/ui/expandable-search/index.mjs +6 -0
- package/dist/components/ui/expandable-search/index.mjs.map +1 -0
- package/dist/components/ui/field/field.mjs +444 -0
- package/dist/components/ui/field/field.mjs.map +1 -0
- package/dist/components/ui/field/index.mjs +21 -0
- package/dist/components/ui/field/index.mjs.map +1 -0
- package/dist/components/ui/file-card/file-card.mjs +198 -0
- package/dist/components/ui/file-card/file-card.mjs.map +1 -0
- package/dist/components/ui/file-card/file-icon.mjs +66 -0
- package/dist/components/ui/file-card/file-icon.mjs.map +1 -0
- package/dist/components/ui/file-card/file-types.mjs +70 -0
- package/dist/components/ui/file-card/file-types.mjs.map +1 -0
- package/dist/components/ui/file-card/index.mjs +32 -0
- package/dist/components/ui/file-card/index.mjs.map +1 -0
- package/dist/components/ui/file-preview/context.mjs +77 -0
- package/dist/components/ui/file-preview/context.mjs.map +1 -0
- package/dist/components/ui/file-preview/file-preview.mjs +865 -0
- package/dist/components/ui/file-preview/file-preview.mjs.map +1 -0
- package/dist/components/ui/file-preview/index.mjs +56 -0
- package/dist/components/ui/file-preview/index.mjs.map +1 -0
- package/dist/components/ui/file-preview/pdf.mjs +250 -0
- package/dist/components/ui/file-preview/pdf.mjs.map +1 -0
- package/dist/components/ui/file-preview/renderers.mjs +257 -0
- package/dist/components/ui/file-preview/renderers.mjs.map +1 -0
- package/dist/components/ui/file-upload/file-upload.mjs +633 -0
- package/dist/components/ui/file-upload/file-upload.mjs.map +1 -0
- package/dist/components/ui/file-upload/index.mjs +42 -0
- package/dist/components/ui/file-upload/index.mjs.map +1 -0
- package/dist/components/ui/file-upload/validate.mjs +111 -0
- package/dist/components/ui/file-upload/validate.mjs.map +1 -0
- package/dist/components/ui/flag/flag.mjs +39 -0
- package/dist/components/ui/flag/flag.mjs.map +1 -0
- package/dist/components/ui/flag/index.mjs +7 -0
- package/dist/components/ui/flag/index.mjs.map +1 -0
- package/dist/components/ui/floating-window/floating-window.mjs +255 -0
- package/dist/components/ui/floating-window/floating-window.mjs.map +1 -0
- package/dist/components/ui/floating-window/index.mjs +11 -0
- package/dist/components/ui/floating-window/index.mjs.map +1 -0
- package/dist/components/ui/form/form-section.mjs +87 -0
- package/dist/components/ui/form/form-section.mjs.map +1 -0
- package/dist/components/ui/form/form.mjs +205 -0
- package/dist/components/ui/form/form.mjs.map +1 -0
- package/dist/components/ui/form/index.mjs +29 -0
- package/dist/components/ui/form/index.mjs.map +1 -0
- package/dist/components/ui/globe/globe-data.mjs +9 -0
- package/dist/components/ui/globe/globe-data.mjs.map +1 -0
- package/dist/components/ui/globe/globe-math.mjs +269 -0
- package/dist/components/ui/globe/globe-math.mjs.map +1 -0
- package/dist/components/ui/globe/globe.mjs +719 -0
- package/dist/components/ui/globe/globe.mjs.map +1 -0
- package/dist/components/ui/globe/index.mjs +13 -0
- package/dist/components/ui/globe/index.mjs.map +1 -0
- package/dist/components/ui/highlight-match/highlight-children.mjs +13 -0
- package/dist/components/ui/highlight-match/highlight-children.mjs.map +1 -0
- package/dist/components/ui/highlight-match/highlight-match-variants.mjs +17 -0
- package/dist/components/ui/highlight-match/highlight-match-variants.mjs.map +1 -0
- package/dist/components/ui/highlight-match/highlight-match.mjs +37 -0
- package/dist/components/ui/highlight-match/highlight-match.mjs.map +1 -0
- package/dist/components/ui/highlight-match/index.mjs +15 -0
- package/dist/components/ui/highlight-match/index.mjs.map +1 -0
- package/dist/components/ui/highlight-match/match-ranges.mjs +50 -0
- package/dist/components/ui/highlight-match/match-ranges.mjs.map +1 -0
- package/dist/components/ui/histogram-slider/histogram-slider.mjs +83 -0
- package/dist/components/ui/histogram-slider/histogram-slider.mjs.map +1 -0
- package/dist/components/ui/histogram-slider/index.mjs +6 -0
- package/dist/components/ui/histogram-slider/index.mjs.map +1 -0
- package/dist/components/ui/hold-button/hold-button.mjs +258 -0
- package/dist/components/ui/hold-button/hold-button.mjs.map +1 -0
- package/dist/components/ui/hold-button/index.mjs +6 -0
- package/dist/components/ui/hold-button/index.mjs.map +1 -0
- package/dist/components/ui/hover-card/hover-card.mjs +111 -0
- package/dist/components/ui/hover-card/hover-card.mjs.map +1 -0
- package/dist/components/ui/hover-card/index.mjs +21 -0
- package/dist/components/ui/hover-card/index.mjs.map +1 -0
- package/dist/components/ui/ink-tray/index.mjs +29 -0
- package/dist/components/ui/ink-tray/index.mjs.map +1 -0
- package/dist/components/ui/ink-tray/ink-tray-art.mjs +68 -0
- package/dist/components/ui/ink-tray/ink-tray-art.mjs.map +1 -0
- package/dist/components/ui/ink-tray/ink-tray.mjs +350 -0
- package/dist/components/ui/ink-tray/ink-tray.mjs.map +1 -0
- package/dist/components/ui/input/index.mjs +41 -0
- package/dist/components/ui/input/index.mjs.map +1 -0
- package/dist/components/ui/input/input.mjs +268 -0
- package/dist/components/ui/input/input.mjs.map +1 -0
- package/dist/components/ui/input/number-input.mjs +272 -0
- package/dist/components/ui/input/number-input.mjs.map +1 -0
- package/dist/components/ui/input/password-input.mjs +49 -0
- package/dist/components/ui/input/password-input.mjs.map +1 -0
- package/dist/components/ui/input/phone-input-countries.mjs +216 -0
- package/dist/components/ui/input/phone-input-countries.mjs.map +1 -0
- package/dist/components/ui/input/phone-input.mjs +326 -0
- package/dist/components/ui/input/phone-input.mjs.map +1 -0
- package/dist/components/ui/input/use-controllable-state.mjs +24 -0
- package/dist/components/ui/input/use-controllable-state.mjs.map +1 -0
- package/dist/components/ui/input/use-hold-repeat.mjs +35 -0
- package/dist/components/ui/input/use-hold-repeat.mjs.map +1 -0
- package/dist/components/ui/input-group/index.mjs +11 -0
- package/dist/components/ui/input-group/index.mjs.map +1 -0
- package/dist/components/ui/input-group/input-group.mjs +78 -0
- package/dist/components/ui/input-group/input-group.mjs.map +1 -0
- package/dist/components/ui/island/index.mjs +23 -0
- package/dist/components/ui/island/index.mjs.map +1 -0
- package/dist/components/ui/island/island.mjs +328 -0
- package/dist/components/ui/island/island.mjs.map +1 -0
- package/dist/components/ui/kbd/index.mjs +6 -0
- package/dist/components/ui/kbd/index.mjs.map +1 -0
- package/dist/components/ui/kbd/kbd.mjs +73 -0
- package/dist/components/ui/kbd/kbd.mjs.map +1 -0
- package/dist/components/ui/keypad/index.mjs +23 -0
- package/dist/components/ui/keypad/index.mjs.map +1 -0
- package/dist/components/ui/keypad/keypad.mjs +345 -0
- package/dist/components/ui/keypad/keypad.mjs.map +1 -0
- package/dist/components/ui/label/index.mjs +7 -0
- package/dist/components/ui/label/index.mjs.map +1 -0
- package/dist/components/ui/label/label.mjs +117 -0
- package/dist/components/ui/label/label.mjs.map +1 -0
- package/dist/components/ui/lightbox/index.mjs +47 -0
- package/dist/components/ui/lightbox/index.mjs.map +1 -0
- package/dist/components/ui/lightbox/labels.mjs +23 -0
- package/dist/components/ui/lightbox/labels.mjs.map +1 -0
- package/dist/components/ui/lightbox/lightbox.mjs +1359 -0
- package/dist/components/ui/lightbox/lightbox.mjs.map +1 -0
- package/dist/components/ui/link/index.mjs +6 -0
- package/dist/components/ui/link/index.mjs.map +1 -0
- package/dist/components/ui/link/link.mjs +64 -0
- package/dist/components/ui/link/link.mjs.map +1 -0
- package/dist/components/ui/list/index.mjs +35 -0
- package/dist/components/ui/list/index.mjs.map +1 -0
- package/dist/components/ui/list/list.mjs +505 -0
- package/dist/components/ui/list/list.mjs.map +1 -0
- package/dist/components/ui/load-more/index.mjs +23 -0
- package/dist/components/ui/load-more/index.mjs.map +1 -0
- package/dist/components/ui/load-more/load-more.mjs +409 -0
- package/dist/components/ui/load-more/load-more.mjs.map +1 -0
- package/dist/components/ui/map/index.mjs +27 -0
- package/dist/components/ui/map/index.mjs.map +1 -0
- package/dist/components/ui/map/map-style.mjs +169 -0
- package/dist/components/ui/map/map-style.mjs.map +1 -0
- package/dist/components/ui/map/map.mjs +624 -0
- package/dist/components/ui/map/map.mjs.map +1 -0
- package/dist/components/ui/map-pin/index.mjs +6 -0
- package/dist/components/ui/map-pin/index.mjs.map +1 -0
- package/dist/components/ui/map-pin/map-pin.mjs +55 -0
- package/dist/components/ui/map-pin/map-pin.mjs.map +1 -0
- package/dist/components/ui/mention/index.mjs +29 -0
- package/dist/components/ui/mention/index.mjs.map +1 -0
- package/dist/components/ui/mention/mention.mjs +262 -0
- package/dist/components/ui/mention/mention.mjs.map +1 -0
- package/dist/components/ui/mention/split-mentions.mjs +24 -0
- package/dist/components/ui/mention/split-mentions.mjs.map +1 -0
- package/dist/components/ui/menubar/index.mjs +39 -0
- package/dist/components/ui/menubar/index.mjs.map +1 -0
- package/dist/components/ui/menubar/menubar.mjs +222 -0
- package/dist/components/ui/menubar/menubar.mjs.map +1 -0
- package/dist/components/ui/meter/index.mjs +21 -0
- package/dist/components/ui/meter/index.mjs.map +1 -0
- package/dist/components/ui/meter/meter.mjs +167 -0
- package/dist/components/ui/meter/meter.mjs.map +1 -0
- package/dist/components/ui/multi-select/index.mjs +25 -0
- package/dist/components/ui/multi-select/index.mjs.map +1 -0
- package/dist/components/ui/multi-select/multi-select.mjs +285 -0
- package/dist/components/ui/multi-select/multi-select.mjs.map +1 -0
- package/dist/components/ui/navigation-menu/index.mjs +41 -0
- package/dist/components/ui/navigation-menu/index.mjs.map +1 -0
- package/dist/components/ui/navigation-menu/navigation-menu.mjs +396 -0
- package/dist/components/ui/navigation-menu/navigation-menu.mjs.map +1 -0
- package/dist/components/ui/notebook-page/index.mjs +15 -0
- package/dist/components/ui/notebook-page/index.mjs.map +1 -0
- package/dist/components/ui/notebook-page/notebook-page.mjs +162 -0
- package/dist/components/ui/notebook-page/notebook-page.mjs.map +1 -0
- package/dist/components/ui/notification-inbox/index.mjs +47 -0
- package/dist/components/ui/notification-inbox/index.mjs.map +1 -0
- package/dist/components/ui/notification-inbox/notification-inbox.mjs +422 -0
- package/dist/components/ui/notification-inbox/notification-inbox.mjs.map +1 -0
- package/dist/components/ui/number-field/index.mjs +24 -0
- package/dist/components/ui/number-field/index.mjs.map +1 -0
- package/dist/components/ui/number-field/number-field.mjs +460 -0
- package/dist/components/ui/number-field/number-field.mjs.map +1 -0
- package/dist/components/ui/number-field/number-format.mjs +48 -0
- package/dist/components/ui/number-field/number-format.mjs.map +1 -0
- package/dist/components/ui/otp-input/index.mjs +9 -0
- package/dist/components/ui/otp-input/index.mjs.map +1 -0
- package/dist/components/ui/otp-input/otp-input.mjs +285 -0
- package/dist/components/ui/otp-input/otp-input.mjs.map +1 -0
- package/dist/components/ui/pager/index.mjs +7 -0
- package/dist/components/ui/pager/index.mjs.map +1 -0
- package/dist/components/ui/pager/pager.mjs +86 -0
- package/dist/components/ui/pager/pager.mjs.map +1 -0
- package/dist/components/ui/pagination/index.mjs +23 -0
- package/dist/components/ui/pagination/index.mjs.map +1 -0
- package/dist/components/ui/pagination/pagination.mjs +210 -0
- package/dist/components/ui/pagination/pagination.mjs.map +1 -0
- package/dist/components/ui/password-strength/index.mjs +21 -0
- package/dist/components/ui/password-strength/index.mjs.map +1 -0
- package/dist/components/ui/password-strength/password-rules.mjs +25 -0
- package/dist/components/ui/password-strength/password-rules.mjs.map +1 -0
- package/dist/components/ui/password-strength/password-strength.mjs +125 -0
- package/dist/components/ui/password-strength/password-strength.mjs.map +1 -0
- package/dist/components/ui/popover/index.mjs +31 -0
- package/dist/components/ui/popover/index.mjs.map +1 -0
- package/dist/components/ui/popover/popover.mjs +574 -0
- package/dist/components/ui/popover/popover.mjs.map +1 -0
- package/dist/components/ui/progress/index.mjs +15 -0
- package/dist/components/ui/progress/index.mjs.map +1 -0
- package/dist/components/ui/progress/progress.mjs +224 -0
- package/dist/components/ui/progress/progress.mjs.map +1 -0
- package/dist/components/ui/prose/index.mjs +6 -0
- package/dist/components/ui/prose/index.mjs.map +1 -0
- package/dist/components/ui/prose/prose.mjs +89 -0
- package/dist/components/ui/prose/prose.mjs.map +1 -0
- package/dist/components/ui/radio-group/index.mjs +15 -0
- package/dist/components/ui/radio-group/index.mjs.map +1 -0
- package/dist/components/ui/radio-group/radio-group.mjs +88 -0
- package/dist/components/ui/radio-group/radio-group.mjs.map +1 -0
- package/dist/components/ui/rating/index.mjs +6 -0
- package/dist/components/ui/rating/index.mjs.map +1 -0
- package/dist/components/ui/rating/rating.mjs +119 -0
- package/dist/components/ui/rating/rating.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/bubble-menu.mjs +120 -0
- package/dist/components/ui/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/image-links.mjs +63 -0
- package/dist/components/ui/rich-text-editor/image-links.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/index.mjs +37 -0
- package/dist/components/ui/rich-text-editor/index.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/labels.mjs +27 -0
- package/dist/components/ui/rich-text-editor/labels.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/rich-text-editor.mjs +149 -0
- package/dist/components/ui/rich-text-editor/rich-text-editor.mjs.map +1 -0
- package/dist/components/ui/rich-text-editor/toolbar.mjs +325 -0
- package/dist/components/ui/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/components/ui/save-bar/index.mjs +13 -0
- package/dist/components/ui/save-bar/index.mjs.map +1 -0
- package/dist/components/ui/save-bar/save-bar.mjs +59 -0
- package/dist/components/ui/save-bar/save-bar.mjs.map +1 -0
- package/dist/components/ui/scroll-area/index.mjs +6 -0
- package/dist/components/ui/scroll-area/index.mjs.map +1 -0
- package/dist/components/ui/scroll-area/scroll-area.mjs +148 -0
- package/dist/components/ui/scroll-area/scroll-area.mjs.map +1 -0
- package/dist/components/ui/scroll-area/use-drag-scroll.mjs +134 -0
- package/dist/components/ui/scroll-area/use-drag-scroll.mjs.map +1 -0
- package/dist/components/ui/select/index.mjs +23 -0
- package/dist/components/ui/select/index.mjs.map +1 -0
- package/dist/components/ui/select/select.mjs +216 -0
- package/dist/components/ui/select/select.mjs.map +1 -0
- package/dist/components/ui/sheet/index.mjs +23 -0
- package/dist/components/ui/sheet/index.mjs.map +1 -0
- package/dist/components/ui/sheet/sheet.mjs +292 -0
- package/dist/components/ui/sheet/sheet.mjs.map +1 -0
- package/dist/components/ui/sidebar/index.mjs +122 -0
- package/dist/components/ui/sidebar/index.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-group.mjs +75 -0
- package/dist/components/ui/sidebar/sidebar-group.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-item.mjs +199 -0
- package/dist/components/ui/sidebar/sidebar-item.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-panels.mjs +182 -0
- package/dist/components/ui/sidebar/sidebar-panels.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-peek.mjs +324 -0
- package/dist/components/ui/sidebar/sidebar-peek.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-rich.mjs +65 -0
- package/dist/components/ui/sidebar/sidebar-rich.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar-tree.mjs +224 -0
- package/dist/components/ui/sidebar/sidebar-tree.mjs.map +1 -0
- package/dist/components/ui/sidebar/sidebar.mjs +205 -0
- package/dist/components/ui/sidebar/sidebar.mjs.map +1 -0
- package/dist/components/ui/sidebar/variants.mjs +396 -0
- package/dist/components/ui/sidebar/variants.mjs.map +1 -0
- package/dist/components/ui/signature/index.mjs +6 -0
- package/dist/components/ui/signature/index.mjs.map +1 -0
- package/dist/components/ui/signature/signature.mjs +145 -0
- package/dist/components/ui/signature/signature.mjs.map +1 -0
- package/dist/components/ui/signature-pad/index.mjs +19 -0
- package/dist/components/ui/signature-pad/index.mjs.map +1 -0
- package/dist/components/ui/signature-pad/signature-pad.mjs +210 -0
- package/dist/components/ui/signature-pad/signature-pad.mjs.map +1 -0
- package/dist/components/ui/signature-pad/strokes.mjs +68 -0
- package/dist/components/ui/signature-pad/strokes.mjs.map +1 -0
- package/dist/components/ui/skeleton/index.mjs +9 -0
- package/dist/components/ui/skeleton/index.mjs.map +1 -0
- package/dist/components/ui/skeleton/skeleton.mjs +58 -0
- package/dist/components/ui/skeleton/skeleton.mjs.map +1 -0
- package/dist/components/ui/slide/index.mjs +25 -0
- package/dist/components/ui/slide/index.mjs.map +1 -0
- package/dist/components/ui/slide/slide.mjs +159 -0
- package/dist/components/ui/slide/slide.mjs.map +1 -0
- package/dist/components/ui/slider/index.mjs +21 -0
- package/dist/components/ui/slider/index.mjs.map +1 -0
- package/dist/components/ui/slider/slider-input.mjs +449 -0
- package/dist/components/ui/slider/slider-input.mjs.map +1 -0
- package/dist/components/ui/slider/slider.mjs +235 -0
- package/dist/components/ui/slider/slider.mjs.map +1 -0
- package/dist/components/ui/slides/index.mjs +31 -0
- package/dist/components/ui/slides/index.mjs.map +1 -0
- package/dist/components/ui/slides/slides.mjs +890 -0
- package/dist/components/ui/slides/slides.mjs.map +1 -0
- package/dist/components/ui/smooth-anchors/index.mjs +17 -0
- package/dist/components/ui/smooth-anchors/index.mjs.map +1 -0
- package/dist/components/ui/smooth-anchors/smooth-anchors.mjs +75 -0
- package/dist/components/ui/smooth-anchors/smooth-anchors.mjs.map +1 -0
- package/dist/components/ui/smooth-anchors/smooth-scroll.mjs +87 -0
- package/dist/components/ui/smooth-anchors/smooth-scroll.mjs.map +1 -0
- package/dist/components/ui/spinner/index.mjs +6 -0
- package/dist/components/ui/spinner/index.mjs.map +1 -0
- package/dist/components/ui/spinner/spinner.mjs +49 -0
- package/dist/components/ui/spinner/spinner.mjs.map +1 -0
- package/dist/components/ui/stat/index.mjs +29 -0
- package/dist/components/ui/stat/index.mjs.map +1 -0
- package/dist/components/ui/stat/stat.mjs +226 -0
- package/dist/components/ui/stat/stat.mjs.map +1 -0
- package/dist/components/ui/status-bar/index.mjs +17 -0
- package/dist/components/ui/status-bar/index.mjs.map +1 -0
- package/dist/components/ui/status-bar/status-bar.mjs +96 -0
- package/dist/components/ui/status-bar/status-bar.mjs.map +1 -0
- package/dist/components/ui/stepper/index.mjs +25 -0
- package/dist/components/ui/stepper/index.mjs.map +1 -0
- package/dist/components/ui/stepper/stepper.mjs +235 -0
- package/dist/components/ui/stepper/stepper.mjs.map +1 -0
- package/dist/components/ui/steps/index.mjs +9 -0
- package/dist/components/ui/steps/index.mjs.map +1 -0
- package/dist/components/ui/steps/steps.mjs +70 -0
- package/dist/components/ui/steps/steps.mjs.map +1 -0
- package/dist/components/ui/swatch-grid/index.mjs +7 -0
- package/dist/components/ui/swatch-grid/index.mjs.map +1 -0
- package/dist/components/ui/swatch-grid/swatch-grid.mjs +110 -0
- package/dist/components/ui/swatch-grid/swatch-grid.mjs.map +1 -0
- package/dist/components/ui/switch/index.mjs +7 -0
- package/dist/components/ui/switch/index.mjs.map +1 -0
- package/dist/components/ui/switch/switch.mjs +79 -0
- package/dist/components/ui/switch/switch.mjs.map +1 -0
- package/dist/components/ui/tab-strip/index.mjs +13 -0
- package/dist/components/ui/tab-strip/index.mjs.map +1 -0
- package/dist/components/ui/tab-strip/tab-strip.mjs +244 -0
- package/dist/components/ui/tab-strip/tab-strip.mjs.map +1 -0
- package/dist/components/ui/table/index.mjs +27 -0
- package/dist/components/ui/table/index.mjs.map +1 -0
- package/dist/components/ui/table/table.mjs +290 -0
- package/dist/components/ui/table/table.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/index.mjs +20 -0
- package/dist/components/ui/table-of-contents/index.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/scroll-spy.mjs +60 -0
- package/dist/components/ui/table-of-contents/scroll-spy.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/table-of-contents.mjs +371 -0
- package/dist/components/ui/table-of-contents/table-of-contents.mjs.map +1 -0
- package/dist/components/ui/table-of-contents/use-headings.mjs +40 -0
- package/dist/components/ui/table-of-contents/use-headings.mjs.map +1 -0
- package/dist/components/ui/tablet-frame/index.mjs +7 -0
- package/dist/components/ui/tablet-frame/index.mjs.map +1 -0
- package/dist/components/ui/tablet-frame/tablet-frame.mjs +48 -0
- package/dist/components/ui/tablet-frame/tablet-frame.mjs.map +1 -0
- package/dist/components/ui/tabs/index.mjs +25 -0
- package/dist/components/ui/tabs/index.mjs.map +1 -0
- package/dist/components/ui/tabs/tabs.mjs +382 -0
- package/dist/components/ui/tabs/tabs.mjs.map +1 -0
- package/dist/components/ui/tabs/use-tabs-indicator.mjs +90 -0
- package/dist/components/ui/tabs/use-tabs-indicator.mjs.map +1 -0
- package/dist/components/ui/tags-input/index.mjs +9 -0
- package/dist/components/ui/tags-input/index.mjs.map +1 -0
- package/dist/components/ui/tags-input/split.mjs +38 -0
- package/dist/components/ui/tags-input/split.mjs.map +1 -0
- package/dist/components/ui/tags-input/tags-input.mjs +328 -0
- package/dist/components/ui/tags-input/tags-input.mjs.map +1 -0
- package/dist/components/ui/terminal/index.mjs +41 -0
- package/dist/components/ui/terminal/index.mjs.map +1 -0
- package/dist/components/ui/terminal/terminal.mjs +287 -0
- package/dist/components/ui/terminal/terminal.mjs.map +1 -0
- package/dist/components/ui/textarea/index.mjs +21 -0
- package/dist/components/ui/textarea/index.mjs.map +1 -0
- package/dist/components/ui/textarea/textarea.mjs +244 -0
- package/dist/components/ui/textarea/textarea.mjs.map +1 -0
- package/dist/components/ui/theme-provider/index.mjs +6 -0
- package/dist/components/ui/theme-provider/index.mjs.map +1 -0
- package/dist/components/ui/theme-provider/theme-provider.mjs +70 -0
- package/dist/components/ui/theme-provider/theme-provider.mjs.map +1 -0
- package/dist/components/ui/toast/index.mjs +19 -0
- package/dist/components/ui/toast/index.mjs.map +1 -0
- package/dist/components/ui/toast/store.mjs +96 -0
- package/dist/components/ui/toast/store.mjs.map +1 -0
- package/dist/components/ui/toast/toast.mjs +395 -0
- package/dist/components/ui/toast/toast.mjs.map +1 -0
- package/dist/components/ui/toggle/index.mjs +13 -0
- package/dist/components/ui/toggle/index.mjs.map +1 -0
- package/dist/components/ui/toggle/toggle.mjs +123 -0
- package/dist/components/ui/toggle/toggle.mjs.map +1 -0
- package/dist/components/ui/toggle-group/index.mjs +11 -0
- package/dist/components/ui/toggle-group/index.mjs.map +1 -0
- package/dist/components/ui/toggle-group/toggle-group.mjs +243 -0
- package/dist/components/ui/toggle-group/toggle-group.mjs.map +1 -0
- package/dist/components/ui/toggletip/index.mjs +6 -0
- package/dist/components/ui/toggletip/index.mjs.map +1 -0
- package/dist/components/ui/toggletip/toggletip.mjs +95 -0
- package/dist/components/ui/toggletip/toggletip.mjs.map +1 -0
- package/dist/components/ui/toolbar/index.mjs +21 -0
- package/dist/components/ui/toolbar/index.mjs.map +1 -0
- package/dist/components/ui/toolbar/toolbar.mjs +130 -0
- package/dist/components/ui/toolbar/toolbar.mjs.map +1 -0
- package/dist/components/ui/tooltip/index.mjs +29 -0
- package/dist/components/ui/tooltip/index.mjs.map +1 -0
- package/dist/components/ui/tooltip/tooltip.mjs +640 -0
- package/dist/components/ui/tooltip/tooltip.mjs.map +1 -0
- package/dist/components/ui/tree/index.mjs +11 -0
- package/dist/components/ui/tree/index.mjs.map +1 -0
- package/dist/components/ui/tree/tree.mjs +450 -0
- package/dist/components/ui/tree/tree.mjs.map +1 -0
- package/dist/index.d.mts +19397 -0
- package/dist/index.mjs +157 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/color.mjs +78 -0
- package/dist/lib/color.mjs.map +1 -0
- package/dist/lib/create-context.mjs +31 -0
- package/dist/lib/create-context.mjs.map +1 -0
- package/dist/lib/date.mjs +116 -0
- package/dist/lib/date.mjs.map +1 -0
- package/dist/lib/density.mjs +79 -0
- package/dist/lib/density.mjs.map +1 -0
- package/dist/lib/field-context.mjs +13 -0
- package/dist/lib/field-context.mjs.map +1 -0
- package/dist/lib/filter.mjs +28 -0
- package/dist/lib/filter.mjs.map +1 -0
- package/dist/lib/gesture.mjs +38 -0
- package/dist/lib/gesture.mjs.map +1 -0
- package/dist/lib/hit-area.mjs +14 -0
- package/dist/lib/hit-area.mjs.map +1 -0
- package/dist/lib/labels.mjs +27 -0
- package/dist/lib/labels.mjs.map +1 -0
- package/dist/lib/morph-box.mjs +56 -0
- package/dist/lib/morph-box.mjs.map +1 -0
- package/dist/lib/motion.mjs +70 -0
- package/dist/lib/motion.mjs.map +1 -0
- package/dist/lib/pulse.mjs +69 -0
- package/dist/lib/pulse.mjs.map +1 -0
- package/dist/lib/roving-focus.mjs +74 -0
- package/dist/lib/roving-focus.mjs.map +1 -0
- package/dist/lib/theme.mjs +67 -0
- package/dist/lib/theme.mjs.map +1 -0
- package/dist/lib/tv.mjs +11 -0
- package/dist/lib/tv.mjs.map +1 -0
- package/dist/lib/utils.mjs +82 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +133 -4
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { CaretDown } from "atoms-icons";
|
|
5
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
|
|
6
|
+
import { useControllableState } from "../input/use-controllable-state.mjs";
|
|
7
|
+
import { useDensity } from "../../../lib/density.mjs";
|
|
8
|
+
import { hitY } from "../../../lib/hit-area.mjs";
|
|
9
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
10
|
+
import { cn } from "../../../lib/utils.mjs";
|
|
11
|
+
const navigationMenuVariants = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
root: "group/navigation-menu relative flex max-w-max items-center max-sm:max-w-full max-sm:[&>div:first-child]:min-w-0",
|
|
14
|
+
list: [
|
|
15
|
+
"flex min-w-0 list-none items-center gap-0.5 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
|
|
16
|
+
"max-sm:group-data-[viewport=true]/navigation-menu:overflow-x-auto max-sm:group-data-[viewport=true]/navigation-menu:scroll-fade-x max-sm:group-data-[viewport=true]/navigation-menu:[scrollbar-width:none]"
|
|
17
|
+
],
|
|
18
|
+
item: "group-data-[viewport=false]/navigation-menu:relative",
|
|
19
|
+
trigger: [
|
|
20
|
+
"group/navigation-menu-trigger inline-flex h-8 w-max cursor-pointer items-center justify-center gap-1 whitespace-nowrap rounded-md px-2.5 text-sm font-medium text-foreground outline-none",
|
|
21
|
+
"transition-colors duration-fast ease-out hover:bg-nav-hover data-[state=open]:bg-nav-hover",
|
|
22
|
+
"focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
23
|
+
"disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:caret-turn-fast",
|
|
24
|
+
hitY
|
|
25
|
+
],
|
|
26
|
+
content: [
|
|
27
|
+
"absolute start-0 top-0 max-w-(--navigation-menu-available-width) p-1 [&>*]:max-w-full",
|
|
28
|
+
"[[data-slot=navigation-menu-viewport]>&]:max-h-(--navigation-menu-available-height) [[data-slot=navigation-menu-viewport]>&]:overflow-y-auto [[data-slot=navigation-menu-viewport]>&]:overscroll-contain",
|
|
29
|
+
"[[data-slot=navigation-menu-viewport]>&]:[clip-path:inset(1px_round_calc(var(--radius-lg)-1px))]",
|
|
30
|
+
"data-[motion=from-start]:animate-in data-[motion=from-start]:fade-in-0 data-[motion=from-start]:slide-in-from-left-12",
|
|
31
|
+
"data-[motion=from-end]:animate-in data-[motion=from-end]:fade-in-0 data-[motion=from-end]:slide-in-from-right-12",
|
|
32
|
+
"data-[motion=to-start]:animate-out data-[motion=to-start]:fade-out-0 data-[motion=to-start]:slide-out-to-left-12",
|
|
33
|
+
"data-[motion=to-end]:animate-out data-[motion=to-end]:fade-out-0 data-[motion=to-end]:slide-out-to-right-12",
|
|
34
|
+
// Without the shared panel, each content is its own panel under its item.
|
|
35
|
+
"group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:z-50 group-data-[viewport=false]/navigation-menu:mt-2",
|
|
36
|
+
"group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground",
|
|
37
|
+
"group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-inset group-data-[viewport=false]/navigation-menu:ring-border",
|
|
38
|
+
"group-data-[viewport=false]/navigation-menu:[--surface:var(--popover)] group-data-[viewport=false]/navigation-menu:origin-top",
|
|
39
|
+
"group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95",
|
|
40
|
+
"group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95"
|
|
41
|
+
],
|
|
42
|
+
positioner: "absolute left-0 top-full isolate z-50 flex translate-x-(--navigation-menu-x) transition-[translate] duration-base ease-out data-instant:transition-none",
|
|
43
|
+
viewport: [
|
|
44
|
+
"relative mt-2 h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) shrink-0 overflow-hidden",
|
|
45
|
+
"rounded-lg bg-popover text-popover-foreground shadow-lg ring-1 ring-inset ring-border [--surface:var(--popover)]",
|
|
46
|
+
"origin-[var(--navigation-menu-origin-x,50%)_top] transition-[width,height] duration-base ease-out [[data-instant]>&]:transition-none",
|
|
47
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
48
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
49
|
+
],
|
|
50
|
+
indicator: [
|
|
51
|
+
"top-full z-60 flex h-[calc(--spacing(2)+1px)] items-end justify-center overflow-hidden group-data-[viewport=false]/navigation-menu:hidden",
|
|
52
|
+
"transition-[width,transform] duration-base ease-out data-[state=visible]:animate-indicator-in data-[state=hidden]:animate-indicator-out"
|
|
53
|
+
],
|
|
54
|
+
indicatorTip: "size-2.5 translate-y-1/2 rotate-45 rounded-tl-[calc(var(--radius-xs)*0.4)] bg-popover ring-1 ring-inset ring-border [--surface:var(--popover)]",
|
|
55
|
+
link: [
|
|
56
|
+
"cursor-pointer select-none items-center gap-2 rounded-md text-sm font-medium text-foreground no-underline outline-none transition-colors duration-fast ease-out",
|
|
57
|
+
"[&>svg]:text-muted-foreground [&_svg]:shrink-0 [&>svg:not([class*='size-'])]:size-5",
|
|
58
|
+
"has-[[data-slot=navigation-menu-link-description]]:items-start has-[[data-slot=navigation-menu-link-icon]]:has-[[data-slot=navigation-menu-link-description]]:items-center"
|
|
59
|
+
],
|
|
60
|
+
linkText: "flex min-w-0 flex-col gap-0.5",
|
|
61
|
+
linkDescription: "text-sm font-normal text-pretty text-muted-foreground",
|
|
62
|
+
linkIcon: "flex size-8 shrink-0 items-center justify-center rounded-sm text-foreground ring-1 ring-inset ring-border [&>svg:not([class*='size-'])]:size-4",
|
|
63
|
+
linkMedia: [
|
|
64
|
+
"relative block aspect-video w-full overflow-hidden rounded-sm bg-muted [&>img]:size-full [&>img]:object-cover",
|
|
65
|
+
"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:ring-media-edge"
|
|
66
|
+
],
|
|
67
|
+
group: "flex min-w-0 flex-col",
|
|
68
|
+
groupLabel: "px-2 py-1 text-xs font-medium text-muted-foreground",
|
|
69
|
+
footer: "-mx-0.75 mt-1 flex items-center justify-between gap-2 border-t border-border px-0.75 pt-1 first:mt-0 first:border-t-0 first:pt-0",
|
|
70
|
+
sub: "group/navigation-menu-sub flex gap-1 data-[orientation=horizontal]:flex-col max-sm:flex-col",
|
|
71
|
+
subViewport: "relative h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) shrink-0 overflow-hidden transition-[width,height] duration-base ease-out"
|
|
72
|
+
},
|
|
73
|
+
variants: {
|
|
74
|
+
variant: {
|
|
75
|
+
row: { link: "relative flex px-2 hover:bg-accent focus-visible:bg-accent data-active:bg-accent" },
|
|
76
|
+
bar: {
|
|
77
|
+
link: [
|
|
78
|
+
"inline-flex h-8 w-max justify-center whitespace-nowrap px-2.5 py-1.5 hover:bg-nav-hover data-active:bg-nav-hover",
|
|
79
|
+
"focus-visible:bg-transparent focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
80
|
+
hitY
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
card: {
|
|
84
|
+
link: [
|
|
85
|
+
"relative flex flex-col items-stretch gap-2 p-1 pb-2 hover:bg-accent focus-visible:bg-accent data-active:bg-accent",
|
|
86
|
+
"has-[[data-slot=navigation-menu-link-description]]:items-stretch [&>[data-slot=navigation-menu-link-text]]:px-1"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
density: {
|
|
91
|
+
compact: { groupLabel: "py-1" },
|
|
92
|
+
comfortable: { groupLabel: "py-1.5" }
|
|
93
|
+
},
|
|
94
|
+
// A trigger on a category rail: full width, its caret pointing at the pane.
|
|
95
|
+
rail: {
|
|
96
|
+
true: { trigger: "w-full justify-between px-2 [&_svg]:-rotate-90" },
|
|
97
|
+
false: { trigger: "[&[data-state=open]_svg]:rotate-180" }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
compoundVariants: [
|
|
101
|
+
{ variant: "row", density: "compact", class: { link: "py-1.5" } },
|
|
102
|
+
{ variant: "row", density: "comfortable", class: { link: "py-2.5" } }
|
|
103
|
+
],
|
|
104
|
+
defaultVariants: { variant: "row", density: "compact", rail: false }
|
|
105
|
+
});
|
|
106
|
+
const RootContext = React.createContext(null);
|
|
107
|
+
const SubContext = React.createContext(false);
|
|
108
|
+
function useRoot() {
|
|
109
|
+
const ctx = React.useContext(RootContext);
|
|
110
|
+
if (!ctx) throw new Error("NavigationMenu parts must sit inside <NavigationMenu>.");
|
|
111
|
+
return ctx;
|
|
112
|
+
}
|
|
113
|
+
function NavigationMenu({
|
|
114
|
+
viewport = true,
|
|
115
|
+
density: densityProp,
|
|
116
|
+
delayDuration = 100,
|
|
117
|
+
skipDelayDuration = 300,
|
|
118
|
+
value: valueProp,
|
|
119
|
+
defaultValue = "",
|
|
120
|
+
onValueChange,
|
|
121
|
+
className,
|
|
122
|
+
children,
|
|
123
|
+
...props
|
|
124
|
+
}) {
|
|
125
|
+
const density = useDensity(densityProp);
|
|
126
|
+
const [value, setValue] = useControllableState({ prop: valueProp, defaultProp: defaultValue, onChange: onValueChange });
|
|
127
|
+
const rootRef = React.useRef(null);
|
|
128
|
+
const context = React.useMemo(() => ({ density, value, rootRef }), [density, value]);
|
|
129
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, { value: context, children: /* @__PURE__ */ jsxs(
|
|
130
|
+
NavigationMenuPrimitive.Root,
|
|
131
|
+
{
|
|
132
|
+
ref: rootRef,
|
|
133
|
+
"data-slot": "navigation-menu",
|
|
134
|
+
"data-viewport": viewport,
|
|
135
|
+
delayDuration,
|
|
136
|
+
skipDelayDuration,
|
|
137
|
+
value,
|
|
138
|
+
onValueChange: setValue,
|
|
139
|
+
className: navigationMenuVariants().root({ className }),
|
|
140
|
+
...props,
|
|
141
|
+
children: [
|
|
142
|
+
children,
|
|
143
|
+
viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
) });
|
|
147
|
+
}
|
|
148
|
+
function NavigationMenuList({ className, ...props }) {
|
|
149
|
+
return /* @__PURE__ */ jsx(
|
|
150
|
+
NavigationMenuPrimitive.List,
|
|
151
|
+
{
|
|
152
|
+
"data-slot": "navigation-menu-list",
|
|
153
|
+
className: navigationMenuVariants().list({ className }),
|
|
154
|
+
...props
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
159
|
+
return /* @__PURE__ */ jsx(
|
|
160
|
+
NavigationMenuPrimitive.Item,
|
|
161
|
+
{
|
|
162
|
+
"data-slot": "navigation-menu-item",
|
|
163
|
+
className: navigationMenuVariants().item({ className }),
|
|
164
|
+
...props
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
function NavigationMenuTrigger({
|
|
169
|
+
className,
|
|
170
|
+
children,
|
|
171
|
+
...props
|
|
172
|
+
}) {
|
|
173
|
+
const rail = React.useContext(SubContext);
|
|
174
|
+
return /* @__PURE__ */ jsxs(
|
|
175
|
+
NavigationMenuPrimitive.Trigger,
|
|
176
|
+
{
|
|
177
|
+
"data-slot": "navigation-menu-trigger",
|
|
178
|
+
className: navigationMenuVariants({ rail }).trigger({ className }),
|
|
179
|
+
...props,
|
|
180
|
+
children: [
|
|
181
|
+
children,
|
|
182
|
+
/* @__PURE__ */ jsx(CaretDown, { "aria-hidden": true })
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
function NavigationMenuContent({
|
|
188
|
+
className,
|
|
189
|
+
...props
|
|
190
|
+
}) {
|
|
191
|
+
return /* @__PURE__ */ jsx(
|
|
192
|
+
NavigationMenuPrimitive.Content,
|
|
193
|
+
{
|
|
194
|
+
"data-slot": "navigation-menu-content",
|
|
195
|
+
className: navigationMenuVariants().content({ className }),
|
|
196
|
+
...props
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
function clipRect(from) {
|
|
201
|
+
let el = from.parentElement;
|
|
202
|
+
while (el && el !== document.body) {
|
|
203
|
+
const style = getComputedStyle(el);
|
|
204
|
+
if (style.overflowX !== "visible" || style.overflowY !== "visible") {
|
|
205
|
+
const r = el.getBoundingClientRect();
|
|
206
|
+
return { left: r.left, right: r.right, bottom: r.bottom };
|
|
207
|
+
}
|
|
208
|
+
el = el.parentElement;
|
|
209
|
+
}
|
|
210
|
+
return { left: 0, right: window.innerWidth, bottom: window.innerHeight };
|
|
211
|
+
}
|
|
212
|
+
const MIN_HEIGHT = 160;
|
|
213
|
+
const GUTTER = 8;
|
|
214
|
+
function NavigationMenuViewport({
|
|
215
|
+
className,
|
|
216
|
+
...props
|
|
217
|
+
}) {
|
|
218
|
+
const { value, rootRef } = useRoot();
|
|
219
|
+
const positioner = React.useRef(null);
|
|
220
|
+
const previous = React.useRef("");
|
|
221
|
+
React.useEffect(() => {
|
|
222
|
+
const pos = positioner.current;
|
|
223
|
+
const root = rootRef.current;
|
|
224
|
+
if (!pos || !root) return;
|
|
225
|
+
const opening = previous.current === "" && value !== "";
|
|
226
|
+
previous.current = value;
|
|
227
|
+
const setVar = (name, next) => {
|
|
228
|
+
if (pos.style.getPropertyValue(name) !== next) pos.style.setProperty(name, next);
|
|
229
|
+
};
|
|
230
|
+
const update = () => {
|
|
231
|
+
const trigger = root.querySelector(
|
|
232
|
+
"[data-slot=navigation-menu-trigger][data-state=open]:not([data-slot=navigation-menu-sub] *)"
|
|
233
|
+
);
|
|
234
|
+
const viewport = pos.querySelector("[data-slot=navigation-menu-viewport]");
|
|
235
|
+
const bar = root.getBoundingClientRect();
|
|
236
|
+
const clip = clipRect(root);
|
|
237
|
+
setVar("--navigation-menu-available-width", `${Math.max(0, clip.right - clip.left - GUTTER * 2)}px`);
|
|
238
|
+
setVar("--navigation-menu-available-height", `${Math.max(MIN_HEIGHT, clip.bottom - bar.bottom - GUTTER * 3)}px`);
|
|
239
|
+
if (!trigger || !viewport) return;
|
|
240
|
+
const width = Number.parseFloat(viewport.style.getPropertyValue("--radix-navigation-menu-viewport-width")) || viewport.offsetWidth;
|
|
241
|
+
const t = trigger.getBoundingClientRect();
|
|
242
|
+
const centre = t.left + t.width / 2 - bar.left;
|
|
243
|
+
const min = clip.left + GUTTER - bar.left;
|
|
244
|
+
const max = clip.right - GUTTER - width - bar.left;
|
|
245
|
+
const x = Math.max(min, Math.min(centre - width / 2, Math.max(min, max)));
|
|
246
|
+
setVar("--navigation-menu-x", `${Math.round(x)}px`);
|
|
247
|
+
setVar("--navigation-menu-origin-x", `${Math.round(centre - x)}px`);
|
|
248
|
+
};
|
|
249
|
+
let frame = 0;
|
|
250
|
+
if (opening) {
|
|
251
|
+
pos.setAttribute("data-instant", "");
|
|
252
|
+
frame = requestAnimationFrame(() => {
|
|
253
|
+
frame = requestAnimationFrame(() => pos.removeAttribute("data-instant"));
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
update();
|
|
257
|
+
const observer = new MutationObserver(update);
|
|
258
|
+
observer.observe(pos, { attributes: true, attributeFilter: ["style"], subtree: true, childList: true });
|
|
259
|
+
window.addEventListener("resize", update);
|
|
260
|
+
window.addEventListener("scroll", update, true);
|
|
261
|
+
return () => {
|
|
262
|
+
cancelAnimationFrame(frame);
|
|
263
|
+
observer.disconnect();
|
|
264
|
+
window.removeEventListener("resize", update);
|
|
265
|
+
window.removeEventListener("scroll", update, true);
|
|
266
|
+
};
|
|
267
|
+
}, [value, rootRef]);
|
|
268
|
+
return /* @__PURE__ */ jsx("div", { ref: positioner, "data-slot": "navigation-menu-positioner", className: navigationMenuVariants().positioner(), children: /* @__PURE__ */ jsx(
|
|
269
|
+
NavigationMenuPrimitive.Viewport,
|
|
270
|
+
{
|
|
271
|
+
"data-slot": "navigation-menu-viewport",
|
|
272
|
+
className: navigationMenuVariants().viewport({ className }),
|
|
273
|
+
...props
|
|
274
|
+
}
|
|
275
|
+
) });
|
|
276
|
+
}
|
|
277
|
+
function NavigationMenuIndicator({
|
|
278
|
+
className,
|
|
279
|
+
...props
|
|
280
|
+
}) {
|
|
281
|
+
const slots = navigationMenuVariants();
|
|
282
|
+
return /* @__PURE__ */ jsx(
|
|
283
|
+
NavigationMenuPrimitive.Indicator,
|
|
284
|
+
{
|
|
285
|
+
"data-slot": "navigation-menu-indicator",
|
|
286
|
+
className: slots.indicator({ className }),
|
|
287
|
+
...props,
|
|
288
|
+
children: /* @__PURE__ */ jsx("div", { className: slots.indicatorTip() })
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
function NavigationMenuLink({ variant = "row", density, className, ...props }) {
|
|
293
|
+
const root = useRoot();
|
|
294
|
+
return /* @__PURE__ */ jsx(
|
|
295
|
+
NavigationMenuPrimitive.Link,
|
|
296
|
+
{
|
|
297
|
+
"data-slot": "navigation-menu-link",
|
|
298
|
+
"data-variant": variant,
|
|
299
|
+
className: navigationMenuVariants({ variant, density: density ?? root.density }).link({ className }),
|
|
300
|
+
...props
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
function NavigationMenuLinkText({ className, ...props }) {
|
|
305
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "navigation-menu-link-text", className: navigationMenuVariants().linkText({ className }), ...props });
|
|
306
|
+
}
|
|
307
|
+
function NavigationMenuLinkDescription({ className, ...props }) {
|
|
308
|
+
return /* @__PURE__ */ jsx(
|
|
309
|
+
"span",
|
|
310
|
+
{
|
|
311
|
+
"data-slot": "navigation-menu-link-description",
|
|
312
|
+
className: navigationMenuVariants().linkDescription({ className }),
|
|
313
|
+
...props
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
function NavigationMenuLinkIcon({ className, ...props }) {
|
|
318
|
+
return /* @__PURE__ */ jsx(
|
|
319
|
+
"span",
|
|
320
|
+
{
|
|
321
|
+
"aria-hidden": true,
|
|
322
|
+
"data-slot": "navigation-menu-link-icon",
|
|
323
|
+
className: navigationMenuVariants().linkIcon({ className }),
|
|
324
|
+
...props
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
function NavigationMenuLinkMedia({ className, ...props }) {
|
|
329
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "navigation-menu-link-media", className: navigationMenuVariants().linkMedia({ className }), ...props });
|
|
330
|
+
}
|
|
331
|
+
function NavigationMenuGroup({ className, ...props }) {
|
|
332
|
+
return /* @__PURE__ */ jsx("div", { role: "group", "data-slot": "navigation-menu-group", className: navigationMenuVariants().group({ className }), ...props });
|
|
333
|
+
}
|
|
334
|
+
function NavigationMenuGroupLabel({ className, ...props }) {
|
|
335
|
+
const root = useRoot();
|
|
336
|
+
return /* @__PURE__ */ jsx(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
"data-slot": "navigation-menu-group-label",
|
|
340
|
+
className: navigationMenuVariants({ density: root.density }).groupLabel({ className }),
|
|
341
|
+
...props
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
function NavigationMenuFooter({ className, ...props }) {
|
|
346
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "navigation-menu-footer", className: navigationMenuVariants().footer({ className }), ...props });
|
|
347
|
+
}
|
|
348
|
+
function NavigationMenuSub({
|
|
349
|
+
orientation = "vertical",
|
|
350
|
+
className,
|
|
351
|
+
...props
|
|
352
|
+
}) {
|
|
353
|
+
return /* @__PURE__ */ jsx(SubContext.Provider, { value: orientation === "vertical", children: /* @__PURE__ */ jsx(
|
|
354
|
+
NavigationMenuPrimitive.Sub,
|
|
355
|
+
{
|
|
356
|
+
"data-slot": "navigation-menu-sub",
|
|
357
|
+
orientation,
|
|
358
|
+
className: navigationMenuVariants().sub({ className }),
|
|
359
|
+
...props
|
|
360
|
+
}
|
|
361
|
+
) });
|
|
362
|
+
}
|
|
363
|
+
function NavigationMenuSubViewport({
|
|
364
|
+
className,
|
|
365
|
+
...props
|
|
366
|
+
}) {
|
|
367
|
+
return /* @__PURE__ */ jsx(
|
|
368
|
+
NavigationMenuPrimitive.Viewport,
|
|
369
|
+
{
|
|
370
|
+
"data-slot": "navigation-menu-sub-viewport",
|
|
371
|
+
className: cn(navigationMenuVariants().subViewport(), className),
|
|
372
|
+
...props
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
export {
|
|
377
|
+
NavigationMenu,
|
|
378
|
+
NavigationMenuContent,
|
|
379
|
+
NavigationMenuFooter,
|
|
380
|
+
NavigationMenuGroup,
|
|
381
|
+
NavigationMenuGroupLabel,
|
|
382
|
+
NavigationMenuIndicator,
|
|
383
|
+
NavigationMenuItem,
|
|
384
|
+
NavigationMenuLink,
|
|
385
|
+
NavigationMenuLinkDescription,
|
|
386
|
+
NavigationMenuLinkIcon,
|
|
387
|
+
NavigationMenuLinkMedia,
|
|
388
|
+
NavigationMenuLinkText,
|
|
389
|
+
NavigationMenuList,
|
|
390
|
+
NavigationMenuSub,
|
|
391
|
+
NavigationMenuSubViewport,
|
|
392
|
+
NavigationMenuTrigger,
|
|
393
|
+
NavigationMenuViewport,
|
|
394
|
+
navigationMenuVariants
|
|
395
|
+
};
|
|
396
|
+
//# sourceMappingURL=navigation-menu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/navigation-menu/navigation-menu.tsx"],"sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { CaretDown } from \"atoms-icons\"\r\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\"\r\n\r\nimport { useControllableState } from \"../input/use-controllable-state.mjs\"\r\nimport { useDensity, type Density } from \"../../../lib/density.mjs\"\r\nimport { hitY } from \"../../../lib/hit-area.mjs\"\r\nimport { tv } from \"../../../lib/tv.mjs\"\r\nimport { cn } from \"../../../lib/utils.mjs\"\r\n\r\n/*\r\n * Menus that open on hover and share one floating panel. Radix NavigationMenu owns the keyboard,\r\n * the hover timing and the panel's measured size (--radix-navigation-menu-viewport-width/height).\r\n * The positioner around the panel is ours: it centres the panel under the open trigger, keeps it\r\n * inside whatever clips the menu, caps it to the room below the bar, and only glides when the\r\n * panel moves from one trigger to the next (the first open lands in place, `data-instant`).\r\n */\r\nexport const navigationMenuVariants = tv({\r\n slots: {\r\n root: \"group/navigation-menu relative flex max-w-max items-center max-sm:max-w-full max-sm:[&>div:first-child]:min-w-0\",\r\n list: [\r\n \"flex min-w-0 list-none items-center gap-0.5 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch\",\r\n \"max-sm:group-data-[viewport=true]/navigation-menu:overflow-x-auto max-sm:group-data-[viewport=true]/navigation-menu:scroll-fade-x max-sm:group-data-[viewport=true]/navigation-menu:[scrollbar-width:none]\",\r\n ],\r\n item: \"group-data-[viewport=false]/navigation-menu:relative\",\r\n trigger: [\r\n \"group/navigation-menu-trigger inline-flex h-8 w-max cursor-pointer items-center justify-center gap-1 whitespace-nowrap rounded-md px-2.5 text-sm font-medium text-foreground outline-none\",\r\n \"transition-colors duration-fast ease-out hover:bg-nav-hover data-[state=open]:bg-nav-hover\",\r\n \"focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\r\n \"disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:caret-turn-fast\",\r\n hitY,\r\n ],\r\n content: [\r\n \"absolute start-0 top-0 max-w-(--navigation-menu-available-width) p-1 [&>*]:max-w-full\",\r\n \"[[data-slot=navigation-menu-viewport]>&]:max-h-(--navigation-menu-available-height) [[data-slot=navigation-menu-viewport]>&]:overflow-y-auto [[data-slot=navigation-menu-viewport]>&]:overscroll-contain\",\r\n \"[[data-slot=navigation-menu-viewport]>&]:[clip-path:inset(1px_round_calc(var(--radius-lg)-1px))]\",\r\n \"data-[motion=from-start]:animate-in data-[motion=from-start]:fade-in-0 data-[motion=from-start]:slide-in-from-left-12\",\r\n \"data-[motion=from-end]:animate-in data-[motion=from-end]:fade-in-0 data-[motion=from-end]:slide-in-from-right-12\",\r\n \"data-[motion=to-start]:animate-out data-[motion=to-start]:fade-out-0 data-[motion=to-start]:slide-out-to-left-12\",\r\n \"data-[motion=to-end]:animate-out data-[motion=to-end]:fade-out-0 data-[motion=to-end]:slide-out-to-right-12\",\r\n // Without the shared panel, each content is its own panel under its item.\r\n \"group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:z-50 group-data-[viewport=false]/navigation-menu:mt-2\",\r\n \"group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground\",\r\n \"group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-inset group-data-[viewport=false]/navigation-menu:ring-border\",\r\n \"group-data-[viewport=false]/navigation-menu:[--surface:var(--popover)] group-data-[viewport=false]/navigation-menu:origin-top\",\r\n \"group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95\",\r\n \"group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95\",\r\n ],\r\n positioner:\r\n \"absolute left-0 top-full isolate z-50 flex translate-x-(--navigation-menu-x) transition-[translate] duration-base ease-out data-instant:transition-none\",\r\n viewport: [\r\n \"relative mt-2 h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) shrink-0 overflow-hidden\",\r\n \"rounded-lg bg-popover text-popover-foreground shadow-lg ring-1 ring-inset ring-border [--surface:var(--popover)]\",\r\n \"origin-[var(--navigation-menu-origin-x,50%)_top] transition-[width,height] duration-base ease-out [[data-instant]>&]:transition-none\",\r\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\r\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\r\n ],\r\n indicator: [\r\n \"top-full z-60 flex h-[calc(--spacing(2)+1px)] items-end justify-center overflow-hidden group-data-[viewport=false]/navigation-menu:hidden\",\r\n \"transition-[width,transform] duration-base ease-out data-[state=visible]:animate-indicator-in data-[state=hidden]:animate-indicator-out\",\r\n ],\r\n indicatorTip:\r\n \"size-2.5 translate-y-1/2 rotate-45 rounded-tl-[calc(var(--radius-xs)*0.4)] bg-popover ring-1 ring-inset ring-border [--surface:var(--popover)]\",\r\n link: [\r\n \"cursor-pointer select-none items-center gap-2 rounded-md text-sm font-medium text-foreground no-underline outline-none transition-colors duration-fast ease-out\",\r\n \"[&>svg]:text-muted-foreground [&_svg]:shrink-0 [&>svg:not([class*='size-'])]:size-5\",\r\n \"has-[[data-slot=navigation-menu-link-description]]:items-start has-[[data-slot=navigation-menu-link-icon]]:has-[[data-slot=navigation-menu-link-description]]:items-center\",\r\n ],\r\n linkText: \"flex min-w-0 flex-col gap-0.5\",\r\n linkDescription: \"text-sm font-normal text-pretty text-muted-foreground\",\r\n linkIcon:\r\n \"flex size-8 shrink-0 items-center justify-center rounded-sm text-foreground ring-1 ring-inset ring-border [&>svg:not([class*='size-'])]:size-4\",\r\n linkMedia: [\r\n \"relative block aspect-video w-full overflow-hidden rounded-sm bg-muted [&>img]:size-full [&>img]:object-cover\",\r\n \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:ring-media-edge\",\r\n ],\r\n group: \"flex min-w-0 flex-col\",\r\n groupLabel: \"px-2 py-1 text-xs font-medium text-muted-foreground\",\r\n footer:\r\n \"-mx-0.75 mt-1 flex items-center justify-between gap-2 border-t border-border px-0.75 pt-1 first:mt-0 first:border-t-0 first:pt-0\",\r\n sub: \"group/navigation-menu-sub flex gap-1 data-[orientation=horizontal]:flex-col max-sm:flex-col\",\r\n subViewport:\r\n \"relative h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) shrink-0 overflow-hidden transition-[width,height] duration-base ease-out\",\r\n },\r\n variants: {\r\n variant: {\r\n row: { link: \"relative flex px-2 hover:bg-accent focus-visible:bg-accent data-active:bg-accent\" },\r\n bar: {\r\n link: [\r\n \"inline-flex h-8 w-max justify-center whitespace-nowrap px-2.5 py-1.5 hover:bg-nav-hover data-active:bg-nav-hover\",\r\n \"focus-visible:bg-transparent focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\r\n hitY,\r\n ],\r\n },\r\n card: {\r\n link: [\r\n \"relative flex flex-col items-stretch gap-2 p-1 pb-2 hover:bg-accent focus-visible:bg-accent data-active:bg-accent\",\r\n \"has-[[data-slot=navigation-menu-link-description]]:items-stretch [&>[data-slot=navigation-menu-link-text]]:px-1\",\r\n ],\r\n },\r\n },\r\n density: {\r\n compact: { groupLabel: \"py-1\" },\r\n comfortable: { groupLabel: \"py-1.5\" },\r\n },\r\n // A trigger on a category rail: full width, its caret pointing at the pane.\r\n rail: {\r\n true: { trigger: \"w-full justify-between px-2 [&_svg]:-rotate-90\" },\r\n false: { trigger: \"[&[data-state=open]_svg]:rotate-180\" },\r\n },\r\n },\r\n compoundVariants: [\r\n { variant: \"row\", density: \"compact\", class: { link: \"py-1.5\" } },\r\n { variant: \"row\", density: \"comfortable\", class: { link: \"py-2.5\" } },\r\n ],\r\n defaultVariants: { variant: \"row\", density: \"compact\", rail: false },\r\n})\r\n\r\ninterface RootContextValue {\r\n density: Density\r\n value: string\r\n rootRef: React.RefObject<HTMLElement | null>\r\n}\r\n\r\nconst RootContext = React.createContext<RootContextValue | null>(null)\r\nconst SubContext = React.createContext(false)\r\n\r\nfunction useRoot() {\r\n const ctx = React.useContext(RootContext)\r\n if (!ctx) throw new Error(\"NavigationMenu parts must sit inside <NavigationMenu>.\")\r\n return ctx\r\n}\r\n\r\nexport interface NavigationMenuProps\r\n extends Omit<React.ComponentProps<typeof NavigationMenuPrimitive.Root>, \"orientation\"> {\r\n /** Renders the shared panel every content mounts into. false opens each content as its own panel. */\r\n viewport?: boolean\r\n /** Row height for every link. Inherits the nearest DensityProvider when unset. */\r\n density?: Density\r\n}\r\n\r\nexport function NavigationMenu({\r\n viewport = true,\r\n density: densityProp,\r\n delayDuration = 100,\r\n skipDelayDuration = 300,\r\n value: valueProp,\r\n defaultValue = \"\",\r\n onValueChange,\r\n className,\r\n children,\r\n ...props\r\n}: NavigationMenuProps) {\r\n const density = useDensity(densityProp)\r\n const [value, setValue] = useControllableState({ prop: valueProp, defaultProp: defaultValue, onChange: onValueChange })\r\n const rootRef = React.useRef<HTMLElement>(null)\r\n const context = React.useMemo(() => ({ density, value, rootRef }), [density, value])\r\n\r\n return (\r\n <RootContext.Provider value={context}>\r\n <NavigationMenuPrimitive.Root\r\n ref={rootRef}\r\n data-slot=\"navigation-menu\"\r\n data-viewport={viewport}\r\n delayDuration={delayDuration}\r\n skipDelayDuration={skipDelayDuration}\r\n value={value}\r\n onValueChange={setValue}\r\n className={navigationMenuVariants().root({ className })}\r\n {...props}\r\n >\r\n {children}\r\n {viewport && <NavigationMenuViewport />}\r\n </NavigationMenuPrimitive.Root>\r\n </RootContext.Provider>\r\n )\r\n}\r\n\r\nexport function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {\r\n return (\r\n <NavigationMenuPrimitive.List\r\n data-slot=\"navigation-menu-list\"\r\n className={navigationMenuVariants().list({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {\r\n return (\r\n <NavigationMenuPrimitive.Item\r\n data-slot=\"navigation-menu-item\"\r\n className={navigationMenuVariants().item({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/** The chip in the bar, with a caret that turns while its panel is open. */\r\nexport function NavigationMenuTrigger({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {\r\n const rail = React.useContext(SubContext)\r\n return (\r\n <NavigationMenuPrimitive.Trigger\r\n data-slot=\"navigation-menu-trigger\"\r\n className={navigationMenuVariants({ rail }).trigger({ className })}\r\n {...props}\r\n >\r\n {children}\r\n <CaretDown aria-hidden />\r\n </NavigationMenuPrimitive.Trigger>\r\n )\r\n}\r\n\r\n/** One panel's contents. Give its wrapper a width (w-56, w-72) to size the panel. */\r\nexport function NavigationMenuContent({\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {\r\n return (\r\n <NavigationMenuPrimitive.Content\r\n data-slot=\"navigation-menu-content\"\r\n className={navigationMenuVariants().content({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/** The scroll-clipping ancestor's box, or the window's. */\r\nfunction clipRect(from: HTMLElement) {\r\n let el = from.parentElement\r\n while (el && el !== document.body) {\r\n const style = getComputedStyle(el)\r\n if (style.overflowX !== \"visible\" || style.overflowY !== \"visible\") {\r\n const r = el.getBoundingClientRect()\r\n return { left: r.left, right: r.right, bottom: r.bottom }\r\n }\r\n el = el.parentElement\r\n }\r\n return { left: 0, right: window.innerWidth, bottom: window.innerHeight }\r\n}\r\n\r\n/** Below this, the room under the bar is a scrolled-away page, not a cap worth applying. */\r\nconst MIN_HEIGHT = 160\r\n\r\nconst GUTTER = 8\r\n\r\n/**\r\n * The shared panel, which NavigationMenu already renders. Its positioner centres it under the open\r\n * trigger, shifts it back inside whatever clips the menu, and caps it to the room below the bar.\r\n */\r\nexport function NavigationMenuViewport({\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {\r\n const { value, rootRef } = useRoot()\r\n const positioner = React.useRef<HTMLDivElement>(null)\r\n const previous = React.useRef(\"\")\r\n\r\n React.useEffect(() => {\r\n const pos = positioner.current\r\n const root = rootRef.current\r\n if (!pos || !root) return\r\n const opening = previous.current === \"\" && value !== \"\"\r\n previous.current = value\r\n\r\n // Only write what changed, so the observer below doesn't hear its own writes.\r\n const setVar = (name: string, next: string) => {\r\n if (pos.style.getPropertyValue(name) !== next) pos.style.setProperty(name, next)\r\n }\r\n\r\n const update = () => {\r\n const trigger = root.querySelector<HTMLElement>(\r\n \"[data-slot=navigation-menu-trigger][data-state=open]:not([data-slot=navigation-menu-sub] *)\",\r\n )\r\n const viewport = pos.querySelector<HTMLElement>(\"[data-slot=navigation-menu-viewport]\")\r\n const bar = root.getBoundingClientRect()\r\n const clip = clipRect(root)\r\n setVar(\"--navigation-menu-available-width\", `${Math.max(0, clip.right - clip.left - GUTTER * 2)}px`)\r\n setVar(\"--navigation-menu-available-height\", `${Math.max(MIN_HEIGHT, clip.bottom - bar.bottom - GUTTER * 3)}px`)\r\n if (!trigger || !viewport) return\r\n const width = Number.parseFloat(viewport.style.getPropertyValue(\"--radix-navigation-menu-viewport-width\")) || viewport.offsetWidth\r\n const t = trigger.getBoundingClientRect()\r\n const centre = t.left + t.width / 2 - bar.left\r\n const min = clip.left + GUTTER - bar.left\r\n const max = clip.right - GUTTER - width - bar.left\r\n const x = Math.max(min, Math.min(centre - width / 2, Math.max(min, max)))\r\n setVar(\"--navigation-menu-x\", `${Math.round(x)}px`)\r\n setVar(\"--navigation-menu-origin-x\", `${Math.round(centre - x)}px`)\r\n }\r\n\r\n // The first open lands in place; only a move between triggers glides.\r\n let frame = 0\r\n if (opening) {\r\n pos.setAttribute(\"data-instant\", \"\")\r\n frame = requestAnimationFrame(() => {\r\n frame = requestAnimationFrame(() => pos.removeAttribute(\"data-instant\"))\r\n })\r\n }\r\n update()\r\n\r\n // Radix writes the panel's measured size onto the viewport; follow it, and the page.\r\n const observer = new MutationObserver(update)\r\n observer.observe(pos, { attributes: true, attributeFilter: [\"style\"], subtree: true, childList: true })\r\n window.addEventListener(\"resize\", update)\r\n window.addEventListener(\"scroll\", update, true)\r\n return () => {\r\n cancelAnimationFrame(frame)\r\n observer.disconnect()\r\n window.removeEventListener(\"resize\", update)\r\n window.removeEventListener(\"scroll\", update, true)\r\n }\r\n }, [value, rootRef])\r\n\r\n return (\r\n <div ref={positioner} data-slot=\"navigation-menu-positioner\" className={navigationMenuVariants().positioner()}>\r\n <NavigationMenuPrimitive.Viewport\r\n data-slot=\"navigation-menu-viewport\"\r\n className={navigationMenuVariants().viewport({ className })}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\n/** The tip that tracks the active trigger. Optional: the list's last child. */\r\nexport function NavigationMenuIndicator({\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {\r\n const slots = navigationMenuVariants()\r\n return (\r\n <NavigationMenuPrimitive.Indicator\r\n data-slot=\"navigation-menu-indicator\"\r\n className={slots.indicator({ className })}\r\n {...props}\r\n >\r\n <div className={slots.indicatorTip()} />\r\n </NavigationMenuPrimitive.Indicator>\r\n )\r\n}\r\n\r\nexport interface NavigationMenuLinkProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Link> {\r\n /** row in a panel; bar a plain entry beside the triggers; card a featured block over a picture. */\r\n variant?: \"row\" | \"bar\" | \"card\"\r\n /** Row height for this link. Inherits the menu's density when unset. */\r\n density?: Density\r\n}\r\n\r\n/** A link that closes the panel on select and joins the arrow-key focus. `active` marks the current page. */\r\nexport function NavigationMenuLink({ variant = \"row\", density, className, ...props }: NavigationMenuLinkProps) {\r\n const root = useRoot()\r\n return (\r\n <NavigationMenuPrimitive.Link\r\n data-slot=\"navigation-menu-link\"\r\n data-variant={variant}\r\n className={navigationMenuVariants({ variant, density: density ?? root.density }).link({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport function NavigationMenuLinkText({ className, ...props }: React.ComponentProps<\"span\">) {\r\n return <span data-slot=\"navigation-menu-link-text\" className={navigationMenuVariants().linkText({ className })} {...props} />\r\n}\r\n\r\nexport function NavigationMenuLinkDescription({ className, ...props }: React.ComponentProps<\"span\">) {\r\n return (\r\n <span\r\n data-slot=\"navigation-menu-link-description\"\r\n className={navigationMenuVariants().linkDescription({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/** A ringed 32px tile for a row's glyph. */\r\nexport function NavigationMenuLinkIcon({ className, ...props }: React.ComponentProps<\"span\">) {\r\n return (\r\n <span\r\n aria-hidden\r\n data-slot=\"navigation-menu-link-icon\"\r\n className={navigationMenuVariants().linkIcon({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/** The inset picture frame of a card link; put an <img> inside. */\r\nexport function NavigationMenuLinkMedia({ className, ...props }: React.ComponentProps<\"span\">) {\r\n return <span data-slot=\"navigation-menu-link-media\" className={navigationMenuVariants().linkMedia({ className })} {...props} />\r\n}\r\n\r\nexport function NavigationMenuGroup({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return <div role=\"group\" data-slot=\"navigation-menu-group\" className={navigationMenuVariants().group({ className })} {...props} />\r\n}\r\n\r\nexport function NavigationMenuGroupLabel({ className, ...props }: React.ComponentProps<\"div\">) {\r\n const root = useRoot()\r\n return (\r\n <div\r\n data-slot=\"navigation-menu-group-label\"\r\n className={navigationMenuVariants({ density: root.density }).groupLabel({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/** The panel's foot under a hairline; the rule drops when nothing sits above it. */\r\nexport function NavigationMenuFooter({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return <div data-slot=\"navigation-menu-footer\" className={navigationMenuVariants().footer({ className })} {...props} />\r\n}\r\n\r\n/** A menu inside a panel: a NavigationMenuList rail, then a NavigationMenuSubViewport. */\r\nexport function NavigationMenuSub({\r\n orientation = \"vertical\",\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Sub>) {\r\n return (\r\n <SubContext.Provider value={orientation === \"vertical\"}>\r\n <NavigationMenuPrimitive.Sub\r\n data-slot=\"navigation-menu-sub\"\r\n orientation={orientation}\r\n className={navigationMenuVariants().sub({ className })}\r\n {...props}\r\n />\r\n </SubContext.Provider>\r\n )\r\n}\r\n\r\n/** Where a Sub's active pane shows, sized to it. Place it after the rail. */\r\nexport function NavigationMenuSubViewport({\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {\r\n return (\r\n <NavigationMenuPrimitive.Viewport\r\n data-slot=\"navigation-menu-sub-viewport\"\r\n className={cn(navigationMenuVariants().subViewport(), className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n"],"mappings":";AAkKM,SAYe,KAZf;AAhKN,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB,+BAA+B;AAE1D,SAAS,4BAA4B;AACrC,SAAS,kBAAgC;AACzC,SAAS,YAAY;AACrB,SAAS,UAAU;AACnB,SAAS,UAAU;AASZ,MAAM,yBAAyB,GAAG;AAAA,EACvC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,IACF;AAAA,IACA,MAAM;AAAA,IACN,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACA,cACE;AAAA,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,MAAM,GAAgC;AACzF,SAAO,oBAAC,SAAI,aAAU,0BAAyB,WAAW,uBAAuB,EAAE,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACvH;AAGO,SAAS,kBAAkB;AAAA,EAChC,cAAc;AAAA,EACd;AAAA,EACA,GAAG;AACL,GAA6D;AAC3D,SACE,oBAAC,WAAW,UAAX,EAAoB,OAAO,gBAAgB,YAC1C;AAAA,IAAC,wBAAwB;AAAA,IAAxB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,WAAW,uBAAuB,EAAE,IAAI,EAAE,UAAU,CAAC;AAAA,MACpD,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;AAGO,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA,GAAG;AACL,GAAkE;AAChE,SACE;AAAA,IAAC,wBAAwB;AAAA,IAAxB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,uBAAuB,EAAE,YAAY,GAAG,SAAS;AAAA,MAC9D,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NotebookPage,
|
|
3
|
+
NotebookPageField,
|
|
4
|
+
NotebookPageTitle,
|
|
5
|
+
NotebookBinding,
|
|
6
|
+
notebookPageVariants
|
|
7
|
+
} from "./notebook-page.mjs";
|
|
8
|
+
export {
|
|
9
|
+
NotebookBinding,
|
|
10
|
+
NotebookPage,
|
|
11
|
+
NotebookPageField,
|
|
12
|
+
NotebookPageTitle,
|
|
13
|
+
notebookPageVariants
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/notebook-page/index.ts"],"sourcesContent":["export {\n NotebookPage,\n NotebookPageField,\n NotebookPageTitle,\n NotebookBinding,\n notebookPageVariants,\n type NotebookPageProps,\n type NotebookPageFieldProps,\n type NotebookPageTitleProps,\n type NotebookBindingProps,\n type NotebookPageSize,\n type NotebookPageLines,\n} from \"./notebook-page.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;","names":[]}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
4
|
+
import { cn } from "../../../lib/utils.mjs";
|
|
5
|
+
const notebookPageVariants = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
page: [
|
|
8
|
+
"relative text-foreground bg-local",
|
|
9
|
+
"[background-image:var(--notebook-margin-image),var(--notebook-pattern)]",
|
|
10
|
+
"[background-size:100%_100%,var(--notebook-tile)]",
|
|
11
|
+
"[background-position:0_0,var(--notebook-offset)]",
|
|
12
|
+
"[background-origin:border-box,var(--notebook-origin)]",
|
|
13
|
+
"min-h-[calc(var(--notebook-rows,0)*var(--notebook-line))]"
|
|
14
|
+
],
|
|
15
|
+
field: [
|
|
16
|
+
"block w-full min-w-0 resize-none appearance-none rounded-none border-0 bg-transparent p-0 shadow-none",
|
|
17
|
+
"text-inherit leading-(--notebook-line) outline-none caret-foreground placeholder:text-placeholder",
|
|
18
|
+
"disabled:cursor-not-allowed disabled:opacity-50 [input&]:h-(--notebook-line) autofill-clear"
|
|
19
|
+
],
|
|
20
|
+
title: [
|
|
21
|
+
"block h-(--notebook-line) w-full min-w-0 truncate rounded-none border-0 bg-transparent p-0",
|
|
22
|
+
"text-[1.375em]/(--notebook-line) font-semibold text-foreground outline-none caret-foreground",
|
|
23
|
+
"placeholder:font-normal placeholder:text-placeholder autofill-clear"
|
|
24
|
+
],
|
|
25
|
+
binding: "flex items-center gap-2 px-3 pt-2 pb-1.5 [background-image:linear-gradient(to_bottom,var(--notebook-binding-shade),transparent)]",
|
|
26
|
+
bindingEdge: "flex shrink-0 items-center gap-1.5 text-muted-foreground",
|
|
27
|
+
rings: "flex min-w-0 flex-1 items-center",
|
|
28
|
+
ring: "size-2 shrink-0 rounded-full bg-(--notebook-ring) shadow-[inset_0_1px_0_var(--notebook-ring-highlight),0_1px_0_var(--notebook-ring-shadow)]"
|
|
29
|
+
},
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: { page: "text-sm/(--notebook-line) [--notebook-line:--spacing(6)]" },
|
|
33
|
+
md: { page: "text-base/(--notebook-line) [--notebook-line:--spacing(7)]" },
|
|
34
|
+
lg: { page: "text-lg/(--notebook-line) [--notebook-line:--spacing(8)]" }
|
|
35
|
+
},
|
|
36
|
+
lines: {
|
|
37
|
+
ruled: {
|
|
38
|
+
page: [
|
|
39
|
+
"[--notebook-pattern:linear-gradient(to_bottom,transparent_calc(var(--notebook-line)_-_1px),var(--border-soft)_calc(var(--notebook-line)_-_1px))]",
|
|
40
|
+
"[--notebook-tile:100%_var(--notebook-line)] [--notebook-offset:0_0] [--notebook-origin:content-box]"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
// A dot on every line's foot at every line-width step: the bullet journal's grid.
|
|
44
|
+
dotted: {
|
|
45
|
+
page: [
|
|
46
|
+
"[--notebook-pattern:radial-gradient(circle_at_center,var(--muted-foreground)_0.5px,transparent_1px)]",
|
|
47
|
+
"[--notebook-tile:var(--notebook-line)_var(--notebook-line)]",
|
|
48
|
+
"[--notebook-offset:calc(var(--notebook-line)/-2)_calc(var(--notebook-line)/2)] [--notebook-origin:content-box]"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
grid: {
|
|
52
|
+
page: [
|
|
53
|
+
"[--notebook-pattern:linear-gradient(to_bottom,transparent_calc(var(--notebook-line)_-_1px),var(--border-soft)_calc(var(--notebook-line)_-_1px)),linear-gradient(to_right,transparent_calc(var(--notebook-line)_-_1px),var(--border-soft)_calc(var(--notebook-line)_-_1px))]",
|
|
54
|
+
"[--notebook-tile:var(--notebook-line)_var(--notebook-line),var(--notebook-line)_var(--notebook-line)]",
|
|
55
|
+
"[--notebook-offset:0_0,0_0] [--notebook-origin:content-box,content-box]"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
plain: {
|
|
59
|
+
page: "[--notebook-pattern:none] [--notebook-tile:100%_var(--notebook-line)] [--notebook-offset:0_0] [--notebook-origin:content-box]"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
margin: {
|
|
63
|
+
none: { page: "[--notebook-margin-image:none]" },
|
|
64
|
+
// The school notebook's red rule, 1.5 lines in; the writing starts a quarter line past it.
|
|
65
|
+
// The inset is a data variant so it outranks a plain px-* on the page.
|
|
66
|
+
left: {
|
|
67
|
+
page: [
|
|
68
|
+
"[--notebook-margin-x:calc(var(--notebook-line)*1.5)]",
|
|
69
|
+
"[--notebook-margin-image:linear-gradient(to_right,transparent_var(--notebook-margin-x),var(--notebook-margin)_var(--notebook-margin-x),var(--notebook-margin)_calc(var(--notebook-margin-x)_+_1px),transparent_calc(var(--notebook-margin-x)_+_1px))]",
|
|
70
|
+
"data-[margin=left]:pl-[calc(var(--notebook-margin-x)+var(--notebook-line)/4)]"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
focusTint: {
|
|
75
|
+
true: {
|
|
76
|
+
field: "transition-[background-color] duration-fast ease-out focus-visible:bg-foreground/5",
|
|
77
|
+
title: "transition-[background-color] duration-fast ease-out focus-visible:bg-foreground/5"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
fill: {
|
|
81
|
+
// As many whole rings as fit, spread evenly by background-repeat: space. Nothing is measured.
|
|
82
|
+
true: {
|
|
83
|
+
rings: [
|
|
84
|
+
"h-2.5",
|
|
85
|
+
"[background-image:radial-gradient(circle_at_50%_35%,var(--notebook-ring-highlight)_0.5px,transparent_1.5px),radial-gradient(circle_at_50%_50%,var(--notebook-ring)_3.5px,var(--notebook-ring-shadow)_4px,transparent_4.5px)]",
|
|
86
|
+
"[background-size:0.9375rem_100%] [background-repeat:space_no-repeat] [background-position:center]"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
false: { rings: "justify-center gap-[0.4375rem]" }
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
size: "md",
|
|
94
|
+
lines: "ruled",
|
|
95
|
+
margin: "none",
|
|
96
|
+
focusTint: false,
|
|
97
|
+
fill: true
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
function NotebookPage({
|
|
101
|
+
lines = "ruled",
|
|
102
|
+
size = "md",
|
|
103
|
+
margin = "none",
|
|
104
|
+
rows,
|
|
105
|
+
asChild = false,
|
|
106
|
+
className,
|
|
107
|
+
style,
|
|
108
|
+
...props
|
|
109
|
+
}) {
|
|
110
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
Comp,
|
|
113
|
+
{
|
|
114
|
+
"data-slot": "notebook-page",
|
|
115
|
+
"data-lines": lines,
|
|
116
|
+
"data-margin": margin,
|
|
117
|
+
style: rows === void 0 ? style : { "--notebook-rows": rows, ...style },
|
|
118
|
+
className: notebookPageVariants({ lines, size, margin }).page({ className }),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function NotebookPageField({ focusTint = false, asChild = false, className, ...props }) {
|
|
124
|
+
const Comp = asChild ? Slot.Root : "textarea";
|
|
125
|
+
return /* @__PURE__ */ jsx(
|
|
126
|
+
Comp,
|
|
127
|
+
{
|
|
128
|
+
"data-slot": "notebook-page-field",
|
|
129
|
+
className: notebookPageVariants({ focusTint }).field({ className }),
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function NotebookPageTitle({
|
|
135
|
+
focusTint = false,
|
|
136
|
+
asChild = false,
|
|
137
|
+
type = "text",
|
|
138
|
+
className,
|
|
139
|
+
...props
|
|
140
|
+
}) {
|
|
141
|
+
const cls = notebookPageVariants({ focusTint }).title({ className });
|
|
142
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot.Root, { "data-slot": "notebook-page-title", className: cls, ...props });
|
|
143
|
+
return /* @__PURE__ */ jsx("input", { "data-slot": "notebook-page-title", type, className: cls, ...props });
|
|
144
|
+
}
|
|
145
|
+
function NotebookBinding({ rings, start, end, className, children, ...props }) {
|
|
146
|
+
const fill = rings === void 0;
|
|
147
|
+
const slots = notebookPageVariants({ fill });
|
|
148
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "notebook-binding", className: slots.binding({ className }), ...props, children: [
|
|
149
|
+
start != null && /* @__PURE__ */ jsx("div", { "data-slot": "notebook-binding-start", className: slots.bindingEdge(), children: start }),
|
|
150
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "notebook-binding-rings", "data-fill": fill || void 0, "aria-hidden": true, className: slots.rings(), children: !fill && Array.from({ length: Math.max(0, rings) }, (_, i) => /* @__PURE__ */ jsx("span", { className: slots.ring() }, i)) }),
|
|
151
|
+
children,
|
|
152
|
+
end != null && /* @__PURE__ */ jsx("div", { "data-slot": "notebook-binding-end", className: cn(slots.bindingEdge()), children: end })
|
|
153
|
+
] });
|
|
154
|
+
}
|
|
155
|
+
export {
|
|
156
|
+
NotebookBinding,
|
|
157
|
+
NotebookPage,
|
|
158
|
+
NotebookPageField,
|
|
159
|
+
NotebookPageTitle,
|
|
160
|
+
notebookPageVariants
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=notebook-page.mjs.map
|