@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,174 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { MagnifyingGlass } from "atoms-icons";
|
|
5
|
+
import { useControlSize } from "../../../lib/density.mjs";
|
|
6
|
+
import { hitBox } from "../../../lib/hit-area.mjs";
|
|
7
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
8
|
+
import { InputField, InputRoot } from "../input/index.mjs";
|
|
9
|
+
const expandableSearchVariants = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: [
|
|
12
|
+
"group/search w-64 gap-0 px-0 overflow-visible",
|
|
13
|
+
"data-[state=closed]:border-transparent data-[state=closed]:bg-transparent data-[state=closed]:hover:bg-accent",
|
|
14
|
+
"transition-[width,border-color,background-color,box-shadow] duration-base ease-out motion-reduce-fade"
|
|
15
|
+
],
|
|
16
|
+
trigger: [
|
|
17
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[inherit] outline-none text-foreground",
|
|
18
|
+
"transition-colors duration-fast ease-out",
|
|
19
|
+
"group-data-[state=open]/search:cursor-text group-data-[state=open]/search:text-muted-foreground",
|
|
20
|
+
"disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
21
|
+
hitBox
|
|
22
|
+
],
|
|
23
|
+
body: [
|
|
24
|
+
"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",
|
|
25
|
+
"transition-opacity duration-base ease-out motion-reduce-fade group-data-[state=closed]/search:opacity-0"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
size: {
|
|
30
|
+
sm: {
|
|
31
|
+
root: "data-[state=closed]:w-8 data-[state=open]:pr-2.5",
|
|
32
|
+
trigger: "size-8 [&_svg]:size-[15px]",
|
|
33
|
+
// The Input's own gap at this size.
|
|
34
|
+
body: "gap-1.5"
|
|
35
|
+
},
|
|
36
|
+
md: { root: "data-[state=closed]:w-9 data-[state=open]:pr-3", trigger: "size-9 [&_svg]:size-4" },
|
|
37
|
+
lg: { root: "data-[state=closed]:w-10 data-[state=open]:pr-3.5", trigger: "size-10 [&_svg]:size-[18px]" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: { size: "sm" }
|
|
41
|
+
});
|
|
42
|
+
function assignRef(ref, node) {
|
|
43
|
+
if (typeof ref === "function") ref(node);
|
|
44
|
+
else if (ref) ref.current = node;
|
|
45
|
+
}
|
|
46
|
+
function clearField(input) {
|
|
47
|
+
const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
48
|
+
setter?.call(input, "");
|
|
49
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
50
|
+
}
|
|
51
|
+
function ExpandableSearch({
|
|
52
|
+
open: openProp,
|
|
53
|
+
defaultOpen = false,
|
|
54
|
+
onOpenChange,
|
|
55
|
+
placeholder = "Search",
|
|
56
|
+
label,
|
|
57
|
+
inputProps,
|
|
58
|
+
children,
|
|
59
|
+
size,
|
|
60
|
+
density,
|
|
61
|
+
disabled,
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultOpen);
|
|
66
|
+
const open = openProp ?? uncontrolled;
|
|
67
|
+
const setOpen = React.useCallback(
|
|
68
|
+
(next) => {
|
|
69
|
+
if (openProp === void 0) setUncontrolled(next);
|
|
70
|
+
onOpenChange?.(next);
|
|
71
|
+
},
|
|
72
|
+
[openProp, onOpenChange]
|
|
73
|
+
);
|
|
74
|
+
const resolvedSize = useControlSize(size, density);
|
|
75
|
+
const slots = expandableSearchVariants({ size: resolvedSize });
|
|
76
|
+
const name = label ?? placeholder;
|
|
77
|
+
const inputId = React.useId();
|
|
78
|
+
const rootRef = React.useRef(null);
|
|
79
|
+
const triggerRef = React.useRef(null);
|
|
80
|
+
const inputRef = React.useRef(null);
|
|
81
|
+
const { ref: inputPropsRef, onKeyDown: inputKeyDown, ...fieldProps } = inputProps ?? {};
|
|
82
|
+
const setInputRef = React.useCallback(
|
|
83
|
+
(node) => {
|
|
84
|
+
inputRef.current = node;
|
|
85
|
+
assignRef(inputPropsRef, node);
|
|
86
|
+
},
|
|
87
|
+
[inputPropsRef]
|
|
88
|
+
);
|
|
89
|
+
const focusOnOpen = React.useRef(false);
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
if (open && focusOnOpen.current) {
|
|
92
|
+
focusOnOpen.current = false;
|
|
93
|
+
inputRef.current?.focus();
|
|
94
|
+
}
|
|
95
|
+
}, [open]);
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
if (!open) return;
|
|
98
|
+
const onPointerDown = (event) => {
|
|
99
|
+
const root = rootRef.current;
|
|
100
|
+
if (!root || event.target instanceof Node && root.contains(event.target)) return;
|
|
101
|
+
if (!inputRef.current?.value) setOpen(false);
|
|
102
|
+
};
|
|
103
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
104
|
+
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
105
|
+
}, [open, setOpen]);
|
|
106
|
+
return /* @__PURE__ */ jsxs(
|
|
107
|
+
InputRoot,
|
|
108
|
+
{
|
|
109
|
+
ref: rootRef,
|
|
110
|
+
"data-slot": "expandable-search",
|
|
111
|
+
"data-state": open ? "open" : "closed",
|
|
112
|
+
size: resolvedSize,
|
|
113
|
+
disabled,
|
|
114
|
+
className: slots.root({ className }),
|
|
115
|
+
...props,
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
"button",
|
|
119
|
+
{
|
|
120
|
+
ref: triggerRef,
|
|
121
|
+
type: "button",
|
|
122
|
+
"data-slot": "expandable-search-trigger",
|
|
123
|
+
"aria-label": name,
|
|
124
|
+
"aria-expanded": open,
|
|
125
|
+
"aria-controls": inputId,
|
|
126
|
+
tabIndex: open ? -1 : void 0,
|
|
127
|
+
"aria-hidden": open || void 0,
|
|
128
|
+
disabled,
|
|
129
|
+
className: slots.trigger(),
|
|
130
|
+
onClick: () => {
|
|
131
|
+
if (open) {
|
|
132
|
+
inputRef.current?.focus();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
focusOnOpen.current = true;
|
|
136
|
+
setOpen(true);
|
|
137
|
+
},
|
|
138
|
+
children: /* @__PURE__ */ jsx(MagnifyingGlass, {})
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "expandable-search-body", inert: !open || void 0, className: slots.body(), children: [
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
InputField,
|
|
144
|
+
{
|
|
145
|
+
...fieldProps,
|
|
146
|
+
ref: setInputRef,
|
|
147
|
+
id: inputId,
|
|
148
|
+
type: "search",
|
|
149
|
+
placeholder,
|
|
150
|
+
"aria-label": name,
|
|
151
|
+
onKeyDown: (event) => {
|
|
152
|
+
inputKeyDown?.(event);
|
|
153
|
+
if (event.defaultPrevented || event.key !== "Escape") return;
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
if (event.currentTarget.value) {
|
|
156
|
+
clearField(event.currentTarget);
|
|
157
|
+
} else {
|
|
158
|
+
setOpen(false);
|
|
159
|
+
triggerRef.current?.focus();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
children
|
|
165
|
+
] })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
ExpandableSearch,
|
|
172
|
+
expandableSearchVariants
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=expandable-search.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/expandable-search/expandable-search.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { MagnifyingGlass } from \"atoms-icons\"\n\nimport { useControlSize } from \"../../../lib/density.mjs\"\nimport { hitBox } from \"../../../lib/hit-area.mjs\"\nimport { tv } from \"../../../lib/tv.mjs\"\nimport { InputField, InputRoot, type InputFieldProps, type InputRootProps } from \"../input/index.mjs\"\n\n/**\n * One InputRoot that widens under its magnifier. Closed, the frame goes clear and the root is a\n * square the size of a ghost icon Button; open, it is the Input, pixel for pixel. The glyph never\n * moves: it is the field's leading icon either way.\n */\nexport const expandableSearchVariants = tv({\n slots: {\n root: [\n \"group/search w-64 gap-0 px-0 overflow-visible\",\n \"data-[state=closed]:border-transparent data-[state=closed]:bg-transparent data-[state=closed]:hover:bg-accent\",\n \"transition-[width,border-color,background-color,box-shadow] duration-base ease-out motion-reduce-fade\",\n ],\n trigger: [\n \"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[inherit] outline-none text-foreground\",\n \"transition-colors duration-fast ease-out\",\n \"group-data-[state=open]/search:cursor-text group-data-[state=open]/search:text-muted-foreground\",\n \"disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n hitBox,\n ],\n body: [\n \"flex min-w-0 flex-1 items-center gap-2 overflow-hidden\",\n \"transition-opacity duration-base ease-out motion-reduce-fade group-data-[state=closed]/search:opacity-0\",\n ],\n },\n variants: {\n size: {\n sm: {\n root: \"data-[state=closed]:w-8 data-[state=open]:pr-2.5\",\n trigger: \"size-8 [&_svg]:size-[15px]\",\n // The Input's own gap at this size.\n body: \"gap-1.5\",\n },\n md: { root: \"data-[state=closed]:w-9 data-[state=open]:pr-3\", trigger: \"size-9 [&_svg]:size-4\" },\n lg: { root: \"data-[state=closed]:w-10 data-[state=open]:pr-3.5\", trigger: \"size-10 [&_svg]:size-[18px]\" },\n },\n },\n defaultVariants: { size: \"sm\" },\n})\n\nexport interface ExpandableSearchProps extends Omit<InputRootProps, \"children\" | \"onChange\"> {\n /** Open, when you control it. A controlled change never moves focus. */\n open?: boolean\n /** Open on mount when uncontrolled. Mounting open does not take focus. */\n defaultOpen?: boolean\n /** Called when the field opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** Placeholder of the field. */\n placeholder?: string\n /** Accessible name of the button and the field. Defaults to the placeholder. */\n label?: string\n /** Forwarded to the `<input type=\"search\">`: value, onChange, name, ref… */\n inputProps?: InputFieldProps & { ref?: React.Ref<HTMLInputElement> }\n /** Trailing content inside the open field, such as an InputSuffix holding a Kbd. */\n children?: React.ReactNode\n}\n\n/** Hands a node to a callback or object ref. */\nfunction assignRef<T>(ref: React.Ref<T> | undefined, node: T | null) {\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.RefObject<T | null>).current = node\n}\n\n/** Empties the field the way typing would, so a controlled value hears it through its onChange. */\nfunction clearField(input: HTMLInputElement) {\n const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"value\")?.set\n setter?.call(input, \"\")\n input.dispatchEvent(new Event(\"input\", { bubbles: true }))\n}\n\nexport function ExpandableSearch({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n placeholder = \"Search\",\n label,\n inputProps,\n children,\n size,\n density,\n disabled,\n className,\n ...props\n}: ExpandableSearchProps) {\n const [uncontrolled, setUncontrolled] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolled\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (openProp === undefined) setUncontrolled(next)\n onOpenChange?.(next)\n },\n [openProp, onOpenChange],\n )\n\n const resolvedSize = useControlSize(size, density)\n const slots = expandableSearchVariants({ size: resolvedSize })\n const name = label ?? placeholder\n const inputId = React.useId()\n\n const rootRef = React.useRef<HTMLDivElement>(null)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n const { ref: inputPropsRef, onKeyDown: inputKeyDown, ...fieldProps } = inputProps ?? {}\n const setInputRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n assignRef(inputPropsRef, node)\n },\n [inputPropsRef],\n )\n\n // Only the component's own button moves focus into the field, once the field is live.\n const focusOnOpen = React.useRef(false)\n React.useEffect(() => {\n if (open && focusOnOpen.current) {\n focusOnOpen.current = false\n inputRef.current?.focus()\n }\n }, [open])\n\n // A press elsewhere folds an empty search; one holding a query stays, so the text that is\n // filtering the page never disappears behind an icon.\n React.useEffect(() => {\n if (!open) return\n const onPointerDown = (event: PointerEvent) => {\n const root = rootRef.current\n if (!root || (event.target instanceof Node && root.contains(event.target))) return\n if (!inputRef.current?.value) setOpen(false)\n }\n document.addEventListener(\"pointerdown\", onPointerDown)\n return () => document.removeEventListener(\"pointerdown\", onPointerDown)\n }, [open, setOpen])\n\n return (\n <InputRoot\n ref={rootRef}\n data-slot=\"expandable-search\"\n data-state={open ? \"open\" : \"closed\"}\n size={resolvedSize}\n disabled={disabled}\n className={slots.root({ className })}\n {...props}\n >\n <button\n ref={triggerRef}\n type=\"button\"\n data-slot=\"expandable-search-trigger\"\n aria-label={name}\n aria-expanded={open}\n aria-controls={inputId}\n tabIndex={open ? -1 : undefined}\n aria-hidden={open || undefined}\n disabled={disabled}\n className={slots.trigger()}\n onClick={() => {\n if (open) {\n inputRef.current?.focus()\n return\n }\n focusOnOpen.current = true\n setOpen(true)\n }}\n >\n <MagnifyingGlass />\n </button>\n <span data-slot=\"expandable-search-body\" inert={!open || undefined} className={slots.body()}>\n <InputField\n {...fieldProps}\n ref={setInputRef}\n id={inputId}\n type=\"search\"\n placeholder={placeholder}\n aria-label={name}\n onKeyDown={(event) => {\n inputKeyDown?.(event)\n if (event.defaultPrevented || event.key !== \"Escape\") return\n event.preventDefault()\n // Escape steps back one layer: the query first, then the field itself.\n if (event.currentTarget.value) {\n clearField(event.currentTarget)\n } else {\n setOpen(false)\n triggerRef.current?.focus()\n }\n }}\n />\n {children}\n </span>\n </InputRoot>\n )\n}\n"],"mappings":";AA4KQ,cAEF,YAFE;AA1KR,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAEhC,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,YAAY,iBAA4D;AAO1E,MAAM,2BAA2B,GAAG;AAAA,EACzC,OAAO;AAAA,IACL,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,QACF,MAAM;AAAA,QACN,SAAS;AAAA;AAAA,QAET,MAAM;AAAA,MACR;AAAA,MACA,IAAI,EAAE,MAAM,kDAAkD,SAAS,wBAAwB;AAAA,MAC/F,IAAI,EAAE,MAAM,qDAAqD,SAAS,8BAA8B;AAAA,IAC1G;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CAAC;AAoBD,SAAS,UAAa,KAA+B,MAAgB;AACnE,MAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,WAC9B,IAAK,CAAC,IAAkC,UAAU;AAC7D;AAGA,SAAS,WAAW,OAAyB;AAC3C,QAAM,SAAS,OAAO,yBAAyB,iBAAiB,WAAW,OAAO,GAAG;AACrF,UAAQ,KAAK,OAAO,EAAE;AACtB,QAAM,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AAC3D;AAEO,SAAS,iBAAiB;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAAA,EACd;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA0B;AACxB,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,WAAW;AAClE,QAAM,OAAO,YAAY;AACzB,QAAM,UAAU,MAAM;AAAA,IACpB,CAAC,SAAkB;AACjB,UAAI,aAAa,OAAW,iBAAgB,IAAI;AAChD,qBAAe,IAAI;AAAA,IACrB;AAAA,IACA,CAAC,UAAU,YAAY;AAAA,EACzB;AAEA,QAAM,eAAe,eAAe,MAAM,OAAO;AACjD,QAAM,QAAQ,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC7D,QAAM,OAAO,SAAS;AACtB,QAAM,UAAU,MAAM,MAAM;AAE5B,QAAM,UAAU,MAAM,OAAuB,IAAI;AACjD,QAAM,aAAa,MAAM,OAA0B,IAAI;AACvD,QAAM,WAAW,MAAM,OAAgC,IAAI;AAC3D,QAAM,EAAE,KAAK,eAAe,WAAW,cAAc,GAAG,WAAW,IAAI,cAAc,CAAC;AACtF,QAAM,cAAc,MAAM;AAAA,IACxB,CAAC,SAAkC;AACjC,eAAS,UAAU;AACnB,gBAAU,eAAe,IAAI;AAAA,IAC/B;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAGA,QAAM,cAAc,MAAM,OAAO,KAAK;AACtC,QAAM,UAAU,MAAM;AACpB,QAAI,QAAQ,YAAY,SAAS;AAC/B,kBAAY,UAAU;AACtB,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAIT,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,KAAM;AACX,UAAM,gBAAgB,CAAC,UAAwB;AAC7C,YAAM,OAAO,QAAQ;AACrB,UAAI,CAAC,QAAS,MAAM,kBAAkB,QAAQ,KAAK,SAAS,MAAM,MAAM,EAAI;AAC5E,UAAI,CAAC,SAAS,SAAS,MAAO,SAAQ,KAAK;AAAA,IAC7C;AACA,aAAS,iBAAiB,eAAe,aAAa;AACtD,WAAO,MAAM,SAAS,oBAAoB,eAAe,aAAa;AAAA,EACxE,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,aAAU;AAAA,MACV,cAAY,OAAO,SAAS;AAAA,MAC5B,MAAM;AAAA,MACN;AAAA,MACA,WAAW,MAAM,KAAK,EAAE,UAAU,CAAC;AAAA,MAClC,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,MAAK;AAAA,YACL,aAAU;AAAA,YACV,cAAY;AAAA,YACZ,iBAAe;AAAA,YACf,iBAAe;AAAA,YACf,UAAU,OAAO,KAAK;AAAA,YACtB,eAAa,QAAQ;AAAA,YACrB;AAAA,YACA,WAAW,MAAM,QAAQ;AAAA,YACzB,SAAS,MAAM;AACb,kBAAI,MAAM;AACR,yBAAS,SAAS,MAAM;AACxB;AAAA,cACF;AACA,0BAAY,UAAU;AACtB,sBAAQ,IAAI;AAAA,YACd;AAAA,YAEA,8BAAC,mBAAgB;AAAA;AAAA,QACnB;AAAA,QACA,qBAAC,UAAK,aAAU,0BAAyB,OAAO,CAAC,QAAQ,QAAW,WAAW,MAAM,KAAK,GACxF;AAAA;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ,KAAK;AAAA,cACL,IAAI;AAAA,cACJ,MAAK;AAAA,cACL;AAAA,cACA,cAAY;AAAA,cACZ,WAAW,CAAC,UAAU;AACpB,+BAAe,KAAK;AACpB,oBAAI,MAAM,oBAAoB,MAAM,QAAQ,SAAU;AACtD,sBAAM,eAAe;AAErB,oBAAI,MAAM,cAAc,OAAO;AAC7B,6BAAW,MAAM,aAAa;AAAA,gBAChC,OAAO;AACL,0BAAQ,KAAK;AACb,6BAAW,SAAS,MAAM;AAAA,gBAC5B;AAAA,cACF;AAAA;AAAA,UACF;AAAA,UACC;AAAA,WACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/expandable-search/index.ts"],"sourcesContent":["export { ExpandableSearch, expandableSearchVariants, type ExpandableSearchProps } from \"./expandable-search.mjs\"\n"],"mappings":"AAAA,SAAS,kBAAkB,gCAA4D;","names":[]}
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { FieldContextProvider, useFieldContext } from "../../../lib/field-context.mjs";
|
|
5
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
6
|
+
import { Hint, Label, LabelInfo, RequiredMark, labelVariants } from "../label/label.mjs";
|
|
7
|
+
import { readFormValues, useFormContext } from "../form/form.mjs";
|
|
8
|
+
const VALIDITY_KEYS = [
|
|
9
|
+
"valueMissing",
|
|
10
|
+
"typeMismatch",
|
|
11
|
+
"patternMismatch",
|
|
12
|
+
"tooShort",
|
|
13
|
+
"tooLong",
|
|
14
|
+
"rangeUnderflow",
|
|
15
|
+
"rangeOverflow",
|
|
16
|
+
"stepMismatch",
|
|
17
|
+
"badInput"
|
|
18
|
+
];
|
|
19
|
+
function isNativeControl(el) {
|
|
20
|
+
return el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement;
|
|
21
|
+
}
|
|
22
|
+
function readValue(el) {
|
|
23
|
+
if (el instanceof HTMLInputElement && (el.type === "checkbox" || el.type === "radio")) return el.checked;
|
|
24
|
+
if (el instanceof HTMLSelectElement && el.multiple) {
|
|
25
|
+
return [...el.selectedOptions].map((option) => option.value);
|
|
26
|
+
}
|
|
27
|
+
return el.value;
|
|
28
|
+
}
|
|
29
|
+
function isFilled(value) {
|
|
30
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
31
|
+
return value !== "" && value !== false && value != null;
|
|
32
|
+
}
|
|
33
|
+
function toMessages(result) {
|
|
34
|
+
if (result == null) return [];
|
|
35
|
+
return (Array.isArray(result) ? result : [result]).filter((message) => message !== "");
|
|
36
|
+
}
|
|
37
|
+
function useRegistry() {
|
|
38
|
+
const [count, setCount] = React.useState(0);
|
|
39
|
+
const register = React.useCallback(() => {
|
|
40
|
+
setCount((n) => n + 1);
|
|
41
|
+
return () => setCount((n) => n - 1);
|
|
42
|
+
}, []);
|
|
43
|
+
return [count, register];
|
|
44
|
+
}
|
|
45
|
+
function useIdList() {
|
|
46
|
+
const [ids, setIds] = React.useState([]);
|
|
47
|
+
const add = React.useCallback((id) => {
|
|
48
|
+
setIds((list) => list.includes(id) ? list : [...list, id]);
|
|
49
|
+
return () => setIds((list) => list.filter((item) => item !== id));
|
|
50
|
+
}, []);
|
|
51
|
+
return [ids, add];
|
|
52
|
+
}
|
|
53
|
+
const NO_ERRORS = [];
|
|
54
|
+
const focusedForms = /* @__PURE__ */ new WeakSet();
|
|
55
|
+
const FieldStatusContext = React.createContext(null);
|
|
56
|
+
FieldStatusContext.displayName = "FieldStatusContext";
|
|
57
|
+
const FieldGroupContext = React.createContext(null);
|
|
58
|
+
FieldGroupContext.displayName = "FieldGroupContext";
|
|
59
|
+
const fieldVariants = tv({
|
|
60
|
+
slots: {
|
|
61
|
+
root: "flex w-full flex-col gap-1.5 [&:has(>[data-slot=field-error])>[data-slot=hint]]:hidden",
|
|
62
|
+
// Preflight already zeroes a fieldset's margin, padding and border. A disabled fieldset
|
|
63
|
+
// disables every control inside natively, and the selector dims their labels to match.
|
|
64
|
+
group: "w-full min-w-0 space-y-1.5 [&:disabled_[data-slot=label]]:opacity-50",
|
|
65
|
+
error: "",
|
|
66
|
+
row: "grid grid-cols-1 gap-x-4 gap-y-5 sm:grid-cols-2"
|
|
67
|
+
},
|
|
68
|
+
variants: {
|
|
69
|
+
columns: {
|
|
70
|
+
2: {},
|
|
71
|
+
3: { row: "sm:grid-cols-3" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
columns: 2
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
function Field({
|
|
79
|
+
className,
|
|
80
|
+
hasError,
|
|
81
|
+
required = false,
|
|
82
|
+
disabled,
|
|
83
|
+
name,
|
|
84
|
+
validate,
|
|
85
|
+
validationMode,
|
|
86
|
+
validationDebounceTime,
|
|
87
|
+
onFocus,
|
|
88
|
+
onBlur,
|
|
89
|
+
children,
|
|
90
|
+
ref,
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
const group = React.useContext(FieldGroupContext);
|
|
94
|
+
const form = useFormContext();
|
|
95
|
+
const id = React.useId();
|
|
96
|
+
const labelId = `${id}label`;
|
|
97
|
+
const hintId = `${id}hint`;
|
|
98
|
+
const infoId = `${id}info`;
|
|
99
|
+
const ownErrorId = `${id}error`;
|
|
100
|
+
const [labels, registerLabel] = useRegistry();
|
|
101
|
+
const [hints, registerHint] = useRegistry();
|
|
102
|
+
const [infos, registerInfo] = useRegistry();
|
|
103
|
+
const [errorParts, registerErrorPart] = useRegistry();
|
|
104
|
+
const [errorIds, showError] = useIdList();
|
|
105
|
+
const [result, setResult] = React.useState(null);
|
|
106
|
+
const [validating, setValidating] = React.useState(false);
|
|
107
|
+
const [touched, setTouched] = React.useState(false);
|
|
108
|
+
const [focused, setFocused] = React.useState(false);
|
|
109
|
+
const [dirty, setDirty] = React.useState(false);
|
|
110
|
+
const [filled, setFilled] = React.useState(false);
|
|
111
|
+
const [nativeName, setNativeName] = React.useState(void 0);
|
|
112
|
+
const isDisabled = disabled ?? group?.disabled ?? false;
|
|
113
|
+
const mode = validationMode ?? form?.validationMode ?? "onSubmit";
|
|
114
|
+
const debounce = validationDebounceTime ?? form?.validationDebounceTime ?? 0;
|
|
115
|
+
const fieldName = name ?? nativeName;
|
|
116
|
+
const serverErrors = form?.serverErrors;
|
|
117
|
+
const serverMessages = React.useMemo(
|
|
118
|
+
() => fieldName && serverErrors ? toMessages(serverErrors[fieldName]) : NO_ERRORS,
|
|
119
|
+
[fieldName, serverErrors]
|
|
120
|
+
);
|
|
121
|
+
const hasServerError = serverMessages.length > 0;
|
|
122
|
+
const isInvalid = hasError ?? (hasServerError || result != null && result.errors.length > 0);
|
|
123
|
+
const isValid = !isInvalid && result != null;
|
|
124
|
+
const rootRef = React.useRef(null);
|
|
125
|
+
React.useImperativeHandle(ref, () => rootRef.current);
|
|
126
|
+
const initial = React.useRef(void 0);
|
|
127
|
+
const token = React.useRef(0);
|
|
128
|
+
const timer = React.useRef(void 0);
|
|
129
|
+
const pending = React.useRef(null);
|
|
130
|
+
const validated = React.useRef(false);
|
|
131
|
+
const latest = React.useRef({ validate, name: fieldName, isDisabled, mode, debounce, form });
|
|
132
|
+
React.useEffect(() => {
|
|
133
|
+
latest.current = { validate, name: fieldName, isDisabled, mode, debounce, form };
|
|
134
|
+
});
|
|
135
|
+
const getControl = React.useCallback(() => {
|
|
136
|
+
const root = rootRef.current;
|
|
137
|
+
if (!root) return null;
|
|
138
|
+
return root.ownerDocument.getElementById(id) ?? root.querySelector("input:not([type=hidden]), select, textarea, button");
|
|
139
|
+
}, [id]);
|
|
140
|
+
const getNative = React.useCallback(() => {
|
|
141
|
+
const control = getControl();
|
|
142
|
+
if (isNativeControl(control)) return control;
|
|
143
|
+
return rootRef.current?.querySelector("input:not([type=hidden]), select, textarea") ?? null;
|
|
144
|
+
}, [getControl]);
|
|
145
|
+
const readState = React.useCallback(() => {
|
|
146
|
+
const el = getNative();
|
|
147
|
+
const value = el ? readValue(el) : void 0;
|
|
148
|
+
setFilled(isFilled(value));
|
|
149
|
+
setDirty(JSON.stringify(value) !== JSON.stringify(initial.current));
|
|
150
|
+
}, [getNative]);
|
|
151
|
+
const run = React.useCallback(async () => {
|
|
152
|
+
const { validate: check, name: key, isDisabled: off, form: owner } = latest.current;
|
|
153
|
+
window.clearTimeout(timer.current);
|
|
154
|
+
const mine = ++token.current;
|
|
155
|
+
if (off) {
|
|
156
|
+
setResult(null);
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
validated.current = true;
|
|
160
|
+
const el = getNative();
|
|
161
|
+
let next = { errors: [], failed: null };
|
|
162
|
+
if (el && el.willValidate && !owner?.skipNative) {
|
|
163
|
+
const failed2 = VALIDITY_KEYS.find((state) => el.validity[state]);
|
|
164
|
+
if (failed2) next = { errors: [el.validationMessage || "Enter a valid value."], failed: failed2 };
|
|
165
|
+
}
|
|
166
|
+
if (!next.failed && check) {
|
|
167
|
+
const values = owner ? owner.getValues() : readFormValues(rootRef.current?.closest("form") ?? null);
|
|
168
|
+
const value = el ? readValue(el) : key ? values[key] : void 0;
|
|
169
|
+
let out = check(value, values);
|
|
170
|
+
if (out instanceof Promise) {
|
|
171
|
+
setValidating(true);
|
|
172
|
+
try {
|
|
173
|
+
out = await out;
|
|
174
|
+
} finally {
|
|
175
|
+
if (mine === token.current) setValidating(false);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (mine !== token.current) return pending.current ?? true;
|
|
179
|
+
const messages = toMessages(out);
|
|
180
|
+
if (messages.length > 0) next = { errors: messages, failed: "customError" };
|
|
181
|
+
}
|
|
182
|
+
setResult(next);
|
|
183
|
+
return next.errors.length === 0;
|
|
184
|
+
}, [getNative]);
|
|
185
|
+
const validateNow = React.useCallback(() => {
|
|
186
|
+
const promise = run();
|
|
187
|
+
pending.current = promise;
|
|
188
|
+
return promise;
|
|
189
|
+
}, [run]);
|
|
190
|
+
const reset = React.useCallback(() => {
|
|
191
|
+
token.current++;
|
|
192
|
+
window.clearTimeout(timer.current);
|
|
193
|
+
validated.current = false;
|
|
194
|
+
pending.current = null;
|
|
195
|
+
setResult(null);
|
|
196
|
+
setValidating(false);
|
|
197
|
+
setTouched(false);
|
|
198
|
+
const el = getNative();
|
|
199
|
+
initial.current = el ? readValue(el) : void 0;
|
|
200
|
+
readState();
|
|
201
|
+
}, [getNative, readState]);
|
|
202
|
+
React.useEffect(() => {
|
|
203
|
+
const frame = window.setTimeout(() => {
|
|
204
|
+
const el = getNative();
|
|
205
|
+
initial.current = el ? readValue(el) : void 0;
|
|
206
|
+
setNativeName(el?.name || void 0);
|
|
207
|
+
readState();
|
|
208
|
+
});
|
|
209
|
+
return () => window.clearTimeout(frame);
|
|
210
|
+
}, [getNative, readState]);
|
|
211
|
+
React.useEffect(() => {
|
|
212
|
+
const root = rootRef.current;
|
|
213
|
+
if (!root) return;
|
|
214
|
+
const onValue = () => {
|
|
215
|
+
readState();
|
|
216
|
+
const { mode: current, debounce: wait, name: key, form: owner } = latest.current;
|
|
217
|
+
if (key && owner) owner.clearServerError(key);
|
|
218
|
+
if (current !== "onChange" && !validated.current) return;
|
|
219
|
+
window.clearTimeout(timer.current);
|
|
220
|
+
if (wait > 0) timer.current = window.setTimeout(validateNow, wait);
|
|
221
|
+
else void validateNow();
|
|
222
|
+
};
|
|
223
|
+
root.addEventListener("input", onValue);
|
|
224
|
+
root.addEventListener("change", onValue);
|
|
225
|
+
return () => {
|
|
226
|
+
root.removeEventListener("input", onValue);
|
|
227
|
+
root.removeEventListener("change", onValue);
|
|
228
|
+
window.clearTimeout(timer.current);
|
|
229
|
+
};
|
|
230
|
+
}, [readState, validateNow]);
|
|
231
|
+
React.useEffect(() => {
|
|
232
|
+
if (!form) return;
|
|
233
|
+
const api = { validate: validateNow, getControl, getName: () => latest.current.name, reset };
|
|
234
|
+
return form.register(api);
|
|
235
|
+
}, [form, validateNow, getControl, reset]);
|
|
236
|
+
React.useEffect(() => {
|
|
237
|
+
const root = rootRef.current;
|
|
238
|
+
if (form || !root) return;
|
|
239
|
+
const onInvalid = (event) => {
|
|
240
|
+
event.preventDefault();
|
|
241
|
+
void validateNow();
|
|
242
|
+
const control = event.target;
|
|
243
|
+
const owner = control.closest("form");
|
|
244
|
+
if (!owner || focusedForms.has(owner)) return;
|
|
245
|
+
focusedForms.add(owner);
|
|
246
|
+
window.setTimeout(() => focusedForms.delete(owner));
|
|
247
|
+
control.focus();
|
|
248
|
+
};
|
|
249
|
+
root.addEventListener("invalid", onInvalid, true);
|
|
250
|
+
return () => root.removeEventListener("invalid", onInvalid, true);
|
|
251
|
+
}, [form, validateNow]);
|
|
252
|
+
const describedBy = [hints > 0 ? hintId : null, infos > 0 ? infoId : null, ...errorIds].filter(Boolean).join(" ") || void 0;
|
|
253
|
+
const fieldContext = React.useMemo(
|
|
254
|
+
() => ({
|
|
255
|
+
id,
|
|
256
|
+
labelId,
|
|
257
|
+
labelledBy: labels > 0 ? labelId : void 0,
|
|
258
|
+
registerLabel,
|
|
259
|
+
describedBy,
|
|
260
|
+
hintId,
|
|
261
|
+
registerHint,
|
|
262
|
+
infoId,
|
|
263
|
+
registerInfo,
|
|
264
|
+
hasError: isInvalid,
|
|
265
|
+
disabled: isDisabled,
|
|
266
|
+
required
|
|
267
|
+
}),
|
|
268
|
+
[id, labelId, labels, registerLabel, describedBy, hintId, registerHint, infoId, registerInfo, isInvalid, isDisabled, required]
|
|
269
|
+
);
|
|
270
|
+
const errors = hasServerError ? serverMessages : result?.errors ?? NO_ERRORS;
|
|
271
|
+
const failed = hasServerError ? "customError" : result?.failed ?? null;
|
|
272
|
+
const status = React.useMemo(
|
|
273
|
+
() => ({ invalid: isInvalid, errors, failed, registerErrorPart, showError }),
|
|
274
|
+
[isInvalid, errors, failed, registerErrorPart, showError]
|
|
275
|
+
);
|
|
276
|
+
return /* @__PURE__ */ jsx(FieldContextProvider, { value: fieldContext, children: /* @__PURE__ */ jsx(FieldStatusContext.Provider, { value: status, children: /* @__PURE__ */ jsxs(
|
|
277
|
+
"div",
|
|
278
|
+
{
|
|
279
|
+
ref: rootRef,
|
|
280
|
+
"data-slot": "field",
|
|
281
|
+
"data-invalid": isInvalid || void 0,
|
|
282
|
+
"data-error": isInvalid || void 0,
|
|
283
|
+
"data-valid": isValid || void 0,
|
|
284
|
+
"data-validating": validating || void 0,
|
|
285
|
+
"data-touched": touched || void 0,
|
|
286
|
+
"data-dirty": dirty || void 0,
|
|
287
|
+
"data-filled": filled || void 0,
|
|
288
|
+
"data-focused": focused || void 0,
|
|
289
|
+
"data-disabled": isDisabled || void 0,
|
|
290
|
+
className: fieldVariants().root({ className }),
|
|
291
|
+
onFocus: (event) => {
|
|
292
|
+
onFocus?.(event);
|
|
293
|
+
setFocused(true);
|
|
294
|
+
},
|
|
295
|
+
onBlur: (event) => {
|
|
296
|
+
onBlur?.(event);
|
|
297
|
+
if (event.currentTarget.contains(event.relatedTarget)) return;
|
|
298
|
+
setFocused(false);
|
|
299
|
+
setTouched(true);
|
|
300
|
+
if (latest.current.mode === "onBlur") void validateNow();
|
|
301
|
+
},
|
|
302
|
+
...props,
|
|
303
|
+
children: [
|
|
304
|
+
children,
|
|
305
|
+
errorParts === 0 && hasError === void 0 && isInvalid && errors.length > 0 ? /* @__PURE__ */ jsx(ErrorMessage, { id: ownErrorId, show: showError, children: /* @__PURE__ */ jsx(Messages, { messages: errors }) }) : null
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
) }) });
|
|
309
|
+
}
|
|
310
|
+
function FieldLabel(props) {
|
|
311
|
+
return /* @__PURE__ */ jsx(Label, { ...props });
|
|
312
|
+
}
|
|
313
|
+
function FieldHint(props) {
|
|
314
|
+
const field = useFieldContext();
|
|
315
|
+
const group = React.useContext(FieldGroupContext);
|
|
316
|
+
if (!field && group) return /* @__PURE__ */ jsx(GroupHint, { ...props, group });
|
|
317
|
+
return /* @__PURE__ */ jsx(Hint, { ...props });
|
|
318
|
+
}
|
|
319
|
+
function GroupHint({
|
|
320
|
+
group,
|
|
321
|
+
hasError,
|
|
322
|
+
id,
|
|
323
|
+
...props
|
|
324
|
+
}) {
|
|
325
|
+
const { registerHint } = group;
|
|
326
|
+
const ownsId = id === void 0;
|
|
327
|
+
React.useEffect(() => {
|
|
328
|
+
if (!ownsId) return;
|
|
329
|
+
return registerHint();
|
|
330
|
+
}, [ownsId, registerHint]);
|
|
331
|
+
return /* @__PURE__ */ jsx(Hint, { id: id ?? group.hintId, hasError: hasError ?? group.invalid, ...props });
|
|
332
|
+
}
|
|
333
|
+
function Messages({ messages }) {
|
|
334
|
+
if (messages.length === 1) return /* @__PURE__ */ jsx(Fragment, { children: messages[0] });
|
|
335
|
+
return /* @__PURE__ */ jsx(Fragment, { children: messages.map((message) => /* @__PURE__ */ jsx("span", { className: "block", children: message }, message)) });
|
|
336
|
+
}
|
|
337
|
+
function ErrorMessage({
|
|
338
|
+
id,
|
|
339
|
+
show,
|
|
340
|
+
className,
|
|
341
|
+
...props
|
|
342
|
+
}) {
|
|
343
|
+
React.useEffect(() => show?.(id), [show, id]);
|
|
344
|
+
return /* @__PURE__ */ jsx(
|
|
345
|
+
"p",
|
|
346
|
+
{
|
|
347
|
+
"data-slot": "field-error",
|
|
348
|
+
id,
|
|
349
|
+
className: labelVariants({ hasError: true }).hint({ className }),
|
|
350
|
+
...props
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
function FieldError({ match, children, id, ...props }) {
|
|
355
|
+
const status = React.useContext(FieldStatusContext);
|
|
356
|
+
const group = React.useContext(FieldGroupContext);
|
|
357
|
+
const generatedId = React.useId();
|
|
358
|
+
const registerErrorPart = status?.registerErrorPart;
|
|
359
|
+
React.useEffect(() => registerErrorPart?.(), [registerErrorPart]);
|
|
360
|
+
const invalid = status ? status.invalid : group?.invalid ?? false;
|
|
361
|
+
const show = match === true || match !== false && invalid && (match === void 0 || match === status?.failed);
|
|
362
|
+
if (!show) return null;
|
|
363
|
+
const content = children ?? (status && status.errors.length > 0 ? /* @__PURE__ */ jsx(Messages, { messages: status.errors }) : null);
|
|
364
|
+
if (content == null) return null;
|
|
365
|
+
return /* @__PURE__ */ jsx(ErrorMessage, { id: id ?? generatedId, show: status?.showError ?? group?.showError, ...props, children: content });
|
|
366
|
+
}
|
|
367
|
+
function FieldGroup({
|
|
368
|
+
className,
|
|
369
|
+
hasError = false,
|
|
370
|
+
disabled = false,
|
|
371
|
+
required = false,
|
|
372
|
+
children,
|
|
373
|
+
...props
|
|
374
|
+
}) {
|
|
375
|
+
const id = React.useId();
|
|
376
|
+
const hintId = `${id}hint`;
|
|
377
|
+
const infoId = `${id}info`;
|
|
378
|
+
const [hints, registerHint] = useRegistry();
|
|
379
|
+
const [infos, registerInfo] = useRegistry();
|
|
380
|
+
const [errorIds, showError] = useIdList();
|
|
381
|
+
const context = React.useMemo(
|
|
382
|
+
() => ({ hasError, disabled, required, hintId, registerHint, infoId, registerInfo, invalid: hasError, showError }),
|
|
383
|
+
[hasError, disabled, required, hintId, registerHint, infoId, registerInfo, showError]
|
|
384
|
+
);
|
|
385
|
+
const describedBy = [hints > 0 ? hintId : null, infos > 0 ? infoId : null, ...errorIds].filter(Boolean).join(" ") || void 0;
|
|
386
|
+
return /* @__PURE__ */ jsx(FieldGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx(FieldContextProvider, { value: null, children: /* @__PURE__ */ jsx(
|
|
387
|
+
"fieldset",
|
|
388
|
+
{
|
|
389
|
+
"data-slot": "field-group",
|
|
390
|
+
"data-invalid": hasError || void 0,
|
|
391
|
+
"data-error": hasError || void 0,
|
|
392
|
+
"data-disabled": disabled || void 0,
|
|
393
|
+
disabled,
|
|
394
|
+
"aria-invalid": hasError || void 0,
|
|
395
|
+
"aria-describedby": describedBy,
|
|
396
|
+
className: fieldVariants().group({ className }),
|
|
397
|
+
...props,
|
|
398
|
+
children
|
|
399
|
+
}
|
|
400
|
+
) }) });
|
|
401
|
+
}
|
|
402
|
+
function FieldGroupLabel({ className, required, info, children, ...props }) {
|
|
403
|
+
const group = React.useContext(FieldGroupContext);
|
|
404
|
+
const isRequired = required ?? group?.required ?? false;
|
|
405
|
+
const hasInfo = info != null && info !== false;
|
|
406
|
+
const fallbackInfoId = React.useId();
|
|
407
|
+
const infoId = group?.infoId ?? fallbackInfoId;
|
|
408
|
+
const registerInfo = group?.registerInfo;
|
|
409
|
+
React.useEffect(() => {
|
|
410
|
+
if (!hasInfo || !registerInfo) return;
|
|
411
|
+
return registerInfo();
|
|
412
|
+
}, [hasInfo, registerInfo]);
|
|
413
|
+
const slots = labelVariants({ disabled: group?.disabled ?? false });
|
|
414
|
+
return /* @__PURE__ */ jsxs(
|
|
415
|
+
"legend",
|
|
416
|
+
{
|
|
417
|
+
"data-slot": "field-group-label",
|
|
418
|
+
className: slots.label({ className }),
|
|
419
|
+
...props,
|
|
420
|
+
children: [
|
|
421
|
+
children,
|
|
422
|
+
isRequired ? /* @__PURE__ */ jsx(RequiredMark, {}) : null,
|
|
423
|
+
hasInfo ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
424
|
+
/* @__PURE__ */ jsx(LabelInfo, { info, id: infoId }),
|
|
425
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "label-info-text", id: infoId, className: "sr-only", children: info })
|
|
426
|
+
] }) : null
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
function FieldRow({ className, columns, ...props }) {
|
|
432
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "field-row", className: fieldVariants({ columns }).row({ className }), ...props });
|
|
433
|
+
}
|
|
434
|
+
export {
|
|
435
|
+
Field,
|
|
436
|
+
FieldError,
|
|
437
|
+
FieldGroup,
|
|
438
|
+
FieldGroupLabel,
|
|
439
|
+
FieldHint,
|
|
440
|
+
FieldLabel,
|
|
441
|
+
FieldRow,
|
|
442
|
+
fieldVariants
|
|
443
|
+
};
|
|
444
|
+
//# sourceMappingURL=field.mjs.map
|