@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,285 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useControllableState } from "../input/use-controllable-state.mjs";
|
|
5
|
+
import { useFieldContext } from "../../../lib/field-context.mjs";
|
|
6
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
7
|
+
import { cn } from "../../../lib/utils.mjs";
|
|
8
|
+
const otpInputVariants = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "flex min-w-0 max-w-full flex-col gap-2",
|
|
11
|
+
label: "flex items-center gap-1 text-sm font-normal text-muted-foreground select-none transition-opacity duration-fast ease-out",
|
|
12
|
+
control: "flex items-center motion-reduce:animate-none",
|
|
13
|
+
cell: "relative flex min-w-0 focus-within:z-10",
|
|
14
|
+
slot: [
|
|
15
|
+
"aspect-square max-w-full rounded-[min(calc(var(--radius)*0.875),33%)] text-center font-medium tabular-nums",
|
|
16
|
+
"text-transparent autofill-clear border bg-[var(--surface,var(--background))]",
|
|
17
|
+
"placeholder:text-placeholder/40 focus:placeholder:text-transparent",
|
|
18
|
+
"min-h-0 appearance-none outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
19
|
+
"selection:bg-foreground/15 disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
"[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
|
|
21
|
+
],
|
|
22
|
+
glyphs: "pointer-events-none absolute inset-0 grid place-items-center select-none font-medium tabular-nums text-foreground leading-[normal]",
|
|
23
|
+
glyph: "[grid-area:1/1]",
|
|
24
|
+
separator: "flex shrink-0 select-none items-center justify-center self-center text-2xl text-muted-foreground/60",
|
|
25
|
+
dash: "h-0.5 w-2.5 rounded-full bg-border",
|
|
26
|
+
hint: "text-xs text-pretty text-muted-foreground transition-colors duration-fast ease-out"
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
size: {
|
|
30
|
+
sm: { control: "gap-1.5 [--shake-distance:2px]", slot: "w-10 text-base", glyphs: "text-base" },
|
|
31
|
+
md: { control: "gap-2 [--shake-distance:3px]", slot: "w-12 text-lg", glyphs: "text-lg" },
|
|
32
|
+
lg: { control: "gap-2.5 [--shake-distance:4px]", slot: "w-14 text-xl", glyphs: "text-xl" }
|
|
33
|
+
},
|
|
34
|
+
hasError: {
|
|
35
|
+
true: {
|
|
36
|
+
slot: "border-destructive caret-destructive focus:border-destructive focus:destructive-ring",
|
|
37
|
+
hint: "text-destructive"
|
|
38
|
+
},
|
|
39
|
+
false: { slot: "border-input caret-foreground focus:border-focus focus:focus-ring" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: { size: "md", hasError: false }
|
|
43
|
+
});
|
|
44
|
+
const digitsOnly = (text) => text.replace(/\D/g, "");
|
|
45
|
+
function useGlyphs(value, length) {
|
|
46
|
+
const [state, setState] = React.useState(() => ({
|
|
47
|
+
value,
|
|
48
|
+
glyphs: Array.from({ length }, (_, i) => ({ char: value[i] ?? "", prev: "", seq: 0, delay: 0 }))
|
|
49
|
+
}));
|
|
50
|
+
if (state.value !== value || state.glyphs.length !== length) {
|
|
51
|
+
let changed = 0;
|
|
52
|
+
const glyphs = Array.from({ length }, (_, i) => {
|
|
53
|
+
const old = state.glyphs[i] ?? { char: "", prev: "", seq: 0, delay: 0 };
|
|
54
|
+
const char = value[i] ?? "";
|
|
55
|
+
if (char === old.char) return old;
|
|
56
|
+
return { char, prev: old.char, seq: old.seq + 1, delay: char ? changed++ : 0 };
|
|
57
|
+
});
|
|
58
|
+
setState({ value, glyphs });
|
|
59
|
+
return glyphs;
|
|
60
|
+
}
|
|
61
|
+
return state.glyphs;
|
|
62
|
+
}
|
|
63
|
+
function OTPInput({
|
|
64
|
+
length = 6,
|
|
65
|
+
size = "md",
|
|
66
|
+
value: valueProp,
|
|
67
|
+
defaultValue = "",
|
|
68
|
+
onChange,
|
|
69
|
+
onComplete,
|
|
70
|
+
hasError,
|
|
71
|
+
errorKey,
|
|
72
|
+
disabled,
|
|
73
|
+
label,
|
|
74
|
+
hint,
|
|
75
|
+
required = false,
|
|
76
|
+
separator,
|
|
77
|
+
groupSize,
|
|
78
|
+
placeholder,
|
|
79
|
+
name,
|
|
80
|
+
autoFocus = false,
|
|
81
|
+
ref,
|
|
82
|
+
slotClassName,
|
|
83
|
+
className,
|
|
84
|
+
"aria-label": ariaLabel = "One-time passcode",
|
|
85
|
+
...props
|
|
86
|
+
}) {
|
|
87
|
+
const field = useFieldContext();
|
|
88
|
+
const isError = hasError ?? field?.hasError ?? false;
|
|
89
|
+
const isDisabled = disabled ?? field?.disabled ?? false;
|
|
90
|
+
const slots = otpInputVariants({ size, hasError: isError });
|
|
91
|
+
const [rawValue, setRawValue] = useControllableState({
|
|
92
|
+
prop: valueProp === void 0 ? void 0 : digitsOnly(valueProp).slice(0, length),
|
|
93
|
+
defaultProp: digitsOnly(defaultValue).slice(0, length),
|
|
94
|
+
onChange
|
|
95
|
+
});
|
|
96
|
+
const value = rawValue;
|
|
97
|
+
const glyphs = useGlyphs(value, length);
|
|
98
|
+
const id = React.useId();
|
|
99
|
+
const labelId = `${id}-label`;
|
|
100
|
+
const hintId = `${id}-hint`;
|
|
101
|
+
const rootRef = React.useRef(null);
|
|
102
|
+
const controlRef = React.useRef(null);
|
|
103
|
+
const inputs = React.useRef([]);
|
|
104
|
+
const focusSlot = React.useCallback(
|
|
105
|
+
(index, options) => {
|
|
106
|
+
const target = inputs.current[Math.max(0, Math.min(length - 1, index))];
|
|
107
|
+
target?.focus(options);
|
|
108
|
+
target?.select();
|
|
109
|
+
},
|
|
110
|
+
[length]
|
|
111
|
+
);
|
|
112
|
+
const latest = React.useRef(value);
|
|
113
|
+
React.useEffect(() => {
|
|
114
|
+
latest.current = value;
|
|
115
|
+
}, [value]);
|
|
116
|
+
const commit = (next) => {
|
|
117
|
+
const clean = digitsOnly(next).slice(0, length);
|
|
118
|
+
if (clean === value) return;
|
|
119
|
+
latest.current = clean;
|
|
120
|
+
setRawValue(clean);
|
|
121
|
+
if (clean.length === length && value.length < length) onComplete?.(clean);
|
|
122
|
+
};
|
|
123
|
+
const write = (index, text) => {
|
|
124
|
+
const digits = digitsOnly(text);
|
|
125
|
+
const current = value[index];
|
|
126
|
+
if (!digits) {
|
|
127
|
+
if (text === "") commit(value.slice(0, index) + value.slice(index + 1));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (digits.length === 2 && current && digits[1] === current && digits[0] !== current) {
|
|
131
|
+
commit(value.slice(0, index) + digits[0] + value.slice(index + 1));
|
|
132
|
+
focusSlot(index + 1);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const chunk = digits.length === 1 ? digits : digits.slice(0, length - index);
|
|
136
|
+
commit(value.slice(0, index) + chunk + value.slice(index + chunk.length));
|
|
137
|
+
focusSlot(index + chunk.length);
|
|
138
|
+
};
|
|
139
|
+
const onKeyDown = (index) => (event) => {
|
|
140
|
+
if (event.metaKey || event.ctrlKey || event.altKey) return;
|
|
141
|
+
switch (event.key) {
|
|
142
|
+
case "Backspace":
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
if (value[index]) commit(value.slice(0, index) + value.slice(index + 1));
|
|
145
|
+
else if (index > 0) {
|
|
146
|
+
commit(value.slice(0, index - 1) + value.slice(index));
|
|
147
|
+
focusSlot(index - 1);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
case "Delete":
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
commit(value.slice(0, index) + value.slice(index + 1));
|
|
153
|
+
return;
|
|
154
|
+
case "ArrowLeft":
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
focusSlot(index - 1);
|
|
157
|
+
return;
|
|
158
|
+
case "ArrowRight":
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
focusSlot(Math.min(index + 1, value.length));
|
|
161
|
+
return;
|
|
162
|
+
case "Home":
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
focusSlot(0);
|
|
165
|
+
return;
|
|
166
|
+
case "End":
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
focusSlot(Math.min(value.length, length - 1));
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const onFocus = (index) => (event) => {
|
|
172
|
+
const filled = latest.current.length;
|
|
173
|
+
if (index > filled) {
|
|
174
|
+
focusSlot(filled);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
event.currentTarget.select();
|
|
178
|
+
};
|
|
179
|
+
React.useImperativeHandle(
|
|
180
|
+
ref,
|
|
181
|
+
() => ({
|
|
182
|
+
focus: (options) => focusSlot(Math.min(value.length, length - 1), options),
|
|
183
|
+
blur: () => {
|
|
184
|
+
const active = document.activeElement;
|
|
185
|
+
if (active instanceof HTMLElement && rootRef.current?.contains(active)) active.blur();
|
|
186
|
+
}
|
|
187
|
+
}),
|
|
188
|
+
[focusSlot, length, value.length]
|
|
189
|
+
);
|
|
190
|
+
React.useEffect(() => {
|
|
191
|
+
const el = controlRef.current;
|
|
192
|
+
if (!isError || !el) return;
|
|
193
|
+
const next = el.classList.contains("animate-shake-a") ? "animate-shake-b" : "animate-shake-a";
|
|
194
|
+
el.classList.remove("animate-shake-a", "animate-shake-b");
|
|
195
|
+
el.classList.add(next);
|
|
196
|
+
const done = () => el.classList.remove(next);
|
|
197
|
+
el.addEventListener("animationend", done, { once: true });
|
|
198
|
+
return () => el.removeEventListener("animationend", done);
|
|
199
|
+
}, [isError, errorKey]);
|
|
200
|
+
const previous = React.useRef(value);
|
|
201
|
+
React.useEffect(() => {
|
|
202
|
+
const was = previous.current;
|
|
203
|
+
previous.current = value;
|
|
204
|
+
if (value !== "" || was === "") return;
|
|
205
|
+
const active = document.activeElement;
|
|
206
|
+
if (active === document.body || active === null || rootRef.current?.contains(active)) focusSlot(0);
|
|
207
|
+
}, [value, focusSlot]);
|
|
208
|
+
const group = separator == null ? 0 : Math.max(1, groupSize ?? Math.ceil(length / 2));
|
|
209
|
+
const mark = separator === "dash" ? /* @__PURE__ */ jsx("span", { className: slots.dash() }) : separator === "dot" ? "\xB7" : separator;
|
|
210
|
+
return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-slot": "otp-input", className: slots.root({ className }), ...props, children: [
|
|
211
|
+
label != null && /* @__PURE__ */ jsxs("label", { "data-slot": "otp-input-label", id: labelId, htmlFor: `${id}-0`, className: slots.label(), children: [
|
|
212
|
+
label,
|
|
213
|
+
required && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
214
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-destructive", children: "*" }),
|
|
215
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "(required)" })
|
|
216
|
+
] })
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
ref: controlRef,
|
|
222
|
+
role: "group",
|
|
223
|
+
"aria-label": label == null ? ariaLabel : void 0,
|
|
224
|
+
"aria-labelledby": label != null ? labelId : void 0,
|
|
225
|
+
"aria-describedby": hint != null ? hintId : void 0,
|
|
226
|
+
"data-slot": "otp-input-control",
|
|
227
|
+
"data-error": isError || void 0,
|
|
228
|
+
"data-disabled": isDisabled || void 0,
|
|
229
|
+
className: slots.control(),
|
|
230
|
+
children: glyphs.map((glyph, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
231
|
+
group > 0 && index > 0 && index % group === 0 && /* @__PURE__ */ jsx("div", { role: "separator", "aria-hidden": true, "data-slot": "otp-input-separator", className: slots.separator(), children: mark }),
|
|
232
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "otp-input-cell", "data-filled": glyph.char ? "" : void 0, className: slots.cell(), children: [
|
|
233
|
+
/* @__PURE__ */ jsx(
|
|
234
|
+
"input",
|
|
235
|
+
{
|
|
236
|
+
ref: (el) => {
|
|
237
|
+
inputs.current[index] = el;
|
|
238
|
+
},
|
|
239
|
+
id: `${id}-${index}`,
|
|
240
|
+
type: "text",
|
|
241
|
+
inputMode: "numeric",
|
|
242
|
+
pattern: "[0-9]*",
|
|
243
|
+
autoComplete: index === 0 ? "one-time-code" : "off",
|
|
244
|
+
"aria-label": `Digit ${index + 1} of ${length}`,
|
|
245
|
+
"aria-invalid": isError || void 0,
|
|
246
|
+
"aria-required": required || void 0,
|
|
247
|
+
placeholder,
|
|
248
|
+
autoFocus: autoFocus && index === 0,
|
|
249
|
+
disabled: isDisabled,
|
|
250
|
+
value: value[index] ?? "",
|
|
251
|
+
onChange: (event) => write(index, event.target.value),
|
|
252
|
+
onPaste: (event) => {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
write(index, event.clipboardData.getData("text"));
|
|
255
|
+
},
|
|
256
|
+
onKeyDown: onKeyDown(index),
|
|
257
|
+
onFocus: onFocus(index),
|
|
258
|
+
className: cn(slots.slot(), slotClassName)
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": true, "data-slot": "otp-input-glyphs", className: slots.glyphs(), children: [
|
|
262
|
+
glyph.seq > 0 && glyph.prev ? /* @__PURE__ */ jsx("span", { className: cn(slots.glyph(), "opacity-0 number-roll-out"), children: glyph.prev }, `out-${glyph.seq}`) : null,
|
|
263
|
+
glyph.char ? /* @__PURE__ */ jsx(
|
|
264
|
+
"span",
|
|
265
|
+
{
|
|
266
|
+
className: cn(slots.glyph(), glyph.seq > 0 && "number-roll-in"),
|
|
267
|
+
style: glyph.seq > 0 && glyph.delay > 0 ? { animationDelay: `calc(var(--number-roll-stagger) * ${glyph.delay})` } : void 0,
|
|
268
|
+
children: glyph.char
|
|
269
|
+
},
|
|
270
|
+
`in-${glyph.seq}`
|
|
271
|
+
) : null
|
|
272
|
+
] })
|
|
273
|
+
] })
|
|
274
|
+
] }, index))
|
|
275
|
+
}
|
|
276
|
+
),
|
|
277
|
+
hint != null && /* @__PURE__ */ jsx("p", { "data-slot": "otp-input-hint", id: hintId, className: slots.hint(), children: hint }),
|
|
278
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null
|
|
279
|
+
] });
|
|
280
|
+
}
|
|
281
|
+
export {
|
|
282
|
+
OTPInput,
|
|
283
|
+
otpInputVariants
|
|
284
|
+
};
|
|
285
|
+
//# sourceMappingURL=otp-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/otp-input/otp-input.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport type { VariantProps } from \"tailwind-variants\"\n\nimport { useControllableState } from \"../input/use-controllable-state.mjs\"\nimport { useFieldContext } from \"../../../lib/field-context.mjs\"\nimport { tv } from \"../../../lib/tv.mjs\"\nimport { cn } from \"../../../lib/utils.mjs\"\n\n/*\n * A one-time-code field: one real input per digit, so the caret, selection, autofill and screen\n * readers all work as usual. The digit you see is painted over the input (whose own text is\n * transparent) so it can roll in on the `number-roll-*` keyframes AnimatedNumber uses.\n *\n * The value is always contiguous: focus never lands past the first empty slot, and clearing a\n * slot in the middle closes the gap. Any multi-digit text arriving in one slot (a paste, an SMS\n * autofill, a script typing into the first slot) spreads from that slot onwards.\n */\nexport const otpInputVariants = tv({\n slots: {\n root: \"flex min-w-0 max-w-full flex-col gap-2\",\n label:\n \"flex items-center gap-1 text-sm font-normal text-muted-foreground select-none transition-opacity duration-fast ease-out\",\n control: \"flex items-center motion-reduce:animate-none\",\n cell: \"relative flex min-w-0 focus-within:z-10\",\n slot: [\n \"aspect-square max-w-full rounded-[min(calc(var(--radius)*0.875),33%)] text-center font-medium tabular-nums\",\n \"text-transparent autofill-clear border bg-[var(--surface,var(--background))]\",\n \"placeholder:text-placeholder/40 focus:placeholder:text-transparent\",\n \"min-h-0 appearance-none outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out\",\n \"selection:bg-foreground/15 disabled:cursor-not-allowed disabled:opacity-50\",\n \"[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none\",\n ],\n glyphs:\n \"pointer-events-none absolute inset-0 grid place-items-center select-none font-medium tabular-nums text-foreground leading-[normal]\",\n glyph: \"[grid-area:1/1]\",\n separator:\n \"flex shrink-0 select-none items-center justify-center self-center text-2xl text-muted-foreground/60\",\n dash: \"h-0.5 w-2.5 rounded-full bg-border\",\n hint: \"text-xs text-pretty text-muted-foreground transition-colors duration-fast ease-out\",\n },\n variants: {\n size: {\n sm: { control: \"gap-1.5 [--shake-distance:2px]\", slot: \"w-10 text-base\", glyphs: \"text-base\" },\n md: { control: \"gap-2 [--shake-distance:3px]\", slot: \"w-12 text-lg\", glyphs: \"text-lg\" },\n lg: { control: \"gap-2.5 [--shake-distance:4px]\", slot: \"w-14 text-xl\", glyphs: \"text-xl\" },\n },\n hasError: {\n true: {\n slot: \"border-destructive caret-destructive focus:border-destructive focus:destructive-ring\",\n hint: \"text-destructive\",\n },\n false: { slot: \"border-input caret-foreground focus:border-focus focus:focus-ring\" },\n },\n },\n defaultVariants: { size: \"md\", hasError: false },\n})\n\nexport type OTPInputSize = NonNullable<VariantProps<typeof otpInputVariants>[\"size\"]>\n\nexport interface OTPInputHandle {\n /** Focuses and selects the first empty slot, or the first slot when the code is complete. */\n focus: (options?: FocusOptions) => void\n /** Blurs the focused slot, if focus is inside the field. */\n blur: () => void\n}\n\nexport interface OTPInputProps\n extends Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\" | \"ref\" | \"children\"> {\n /** Number of digit slots. */\n length?: number\n /** Slot size: 40, 48 or 56px squares. */\n size?: OTPInputSize\n /** The concatenated digits, controlled. */\n value?: string\n /** The initial digits, uncontrolled. */\n defaultValue?: string\n /** Called on every edit with the concatenated digits. */\n onChange?: (value: string) => void\n /** Called once, when the last empty slot fills: start verification here. */\n onComplete?: (value: string) => void\n /** Destructive slots, aria-invalid, a destructive hint and one shake of the row. */\n hasError?: boolean\n /** Shakes again when it changes while hasError stays true. An attempt counter works. */\n errorKey?: string | number\n disabled?: boolean\n /** Rendered above the slots and wired as the group's aria-labelledby. */\n label?: React.ReactNode\n /** Helper text below, wired as aria-describedby; destructive with hasError. */\n hint?: React.ReactNode\n /** Appends a destructive asterisk to the label. */\n required?: boolean\n /** A mark between groups: a short line, a centred dot, or any node. */\n separator?: \"dash\" | \"dot\" | React.ReactNode\n /** Slots per group when separator is set. Defaults to two even halves. */\n groupSize?: number\n /** One character shown in empty, unfocused slots. */\n placeholder?: string\n /** Renders a hidden input so the code posts with a native form. */\n name?: string\n autoFocus?: boolean\n /** A handle, { focus, blur }. */\n ref?: React.Ref<OTPInputHandle>\n /** Merged onto every digit slot. */\n slotClassName?: string\n}\n\ninterface Glyph {\n char: string\n prev: string\n seq: number\n delay: number\n}\n\nconst digitsOnly = (text: string) => text.replace(/\\D/g, \"\")\n\n/** Per-slot roll state, derived during render: a slot whose digit changed gets a new seq. */\nfunction useGlyphs(value: string, length: number) {\n const [state, setState] = React.useState(() => ({\n value,\n glyphs: Array.from({ length }, (_, i): Glyph => ({ char: value[i] ?? \"\", prev: \"\", seq: 0, delay: 0 })),\n }))\n if (state.value !== value || state.glyphs.length !== length) {\n let changed = 0\n const glyphs = Array.from({ length }, (_, i): Glyph => {\n const old = state.glyphs[i] ?? { char: \"\", prev: \"\", seq: 0, delay: 0 }\n const char = value[i] ?? \"\"\n if (char === old.char) return old\n return { char, prev: old.char, seq: old.seq + 1, delay: char ? changed++ : 0 }\n })\n setState({ value, glyphs })\n return glyphs\n }\n return state.glyphs\n}\n\nexport function OTPInput({\n length = 6,\n size = \"md\",\n value: valueProp,\n defaultValue = \"\",\n onChange,\n onComplete,\n hasError,\n errorKey,\n disabled,\n label,\n hint,\n required = false,\n separator,\n groupSize,\n placeholder,\n name,\n autoFocus = false,\n ref,\n slotClassName,\n className,\n \"aria-label\": ariaLabel = \"One-time passcode\",\n ...props\n}: OTPInputProps) {\n const field = useFieldContext()\n const isError = hasError ?? field?.hasError ?? false\n const isDisabled = disabled ?? field?.disabled ?? false\n const slots = otpInputVariants({ size, hasError: isError })\n\n const [rawValue, setRawValue] = useControllableState({\n prop: valueProp === undefined ? undefined : digitsOnly(valueProp).slice(0, length),\n defaultProp: digitsOnly(defaultValue).slice(0, length),\n onChange,\n })\n const value = rawValue\n const glyphs = useGlyphs(value, length)\n\n const id = React.useId()\n const labelId = `${id}-label`\n const hintId = `${id}-hint`\n const rootRef = React.useRef<HTMLDivElement>(null)\n const controlRef = React.useRef<HTMLDivElement>(null)\n const inputs = React.useRef<(HTMLInputElement | null)[]>([])\n\n const focusSlot = React.useCallback(\n (index: number, options?: FocusOptions) => {\n const target = inputs.current[Math.max(0, Math.min(length - 1, index))]\n target?.focus(options)\n target?.select()\n },\n [length],\n )\n\n // The value the next focus will see: written by edits before React re-renders, and kept in step\n // with outside changes after it does. Read only in handlers.\n const latest = React.useRef(value)\n React.useEffect(() => {\n latest.current = value\n }, [value])\n\n const commit = (next: string) => {\n const clean = digitsOnly(next).slice(0, length)\n if (clean === value) return\n latest.current = clean\n setRawValue(clean)\n if (clean.length === length && value.length < length) onComplete?.(clean)\n }\n\n // Text landing in slot i: one digit sets it; more spread from it, as a paste or autofill does.\n const write = (index: number, text: string) => {\n const digits = digitsOnly(text)\n const current = value[index]\n if (!digits) {\n // A letter or symbol is dropped; only an emptied slot clears.\n if (text === \"\") commit(value.slice(0, index) + value.slice(index + 1))\n return\n }\n // A digit typed in front of the one already there replaces it.\n if (digits.length === 2 && current && digits[1] === current && digits[0] !== current) {\n commit(value.slice(0, index) + digits[0] + value.slice(index + 1))\n focusSlot(index + 1)\n return\n }\n const chunk = digits.length === 1 ? digits : digits.slice(0, length - index)\n commit(value.slice(0, index) + chunk + value.slice(index + chunk.length))\n focusSlot(index + chunk.length)\n }\n\n const onKeyDown = (index: number) => (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.metaKey || event.ctrlKey || event.altKey) return\n switch (event.key) {\n case \"Backspace\":\n event.preventDefault()\n if (value[index]) commit(value.slice(0, index) + value.slice(index + 1))\n else if (index > 0) {\n commit(value.slice(0, index - 1) + value.slice(index))\n focusSlot(index - 1)\n }\n return\n case \"Delete\":\n event.preventDefault()\n commit(value.slice(0, index) + value.slice(index + 1))\n return\n case \"ArrowLeft\":\n event.preventDefault()\n focusSlot(index - 1)\n return\n case \"ArrowRight\":\n event.preventDefault()\n focusSlot(Math.min(index + 1, value.length))\n return\n case \"Home\":\n event.preventDefault()\n focusSlot(0)\n return\n case \"End\":\n event.preventDefault()\n focusSlot(Math.min(value.length, length - 1))\n }\n }\n\n // Never past the first empty slot, so the code stays contiguous.\n const onFocus = (index: number) => (event: React.FocusEvent<HTMLInputElement>) => {\n const filled = latest.current.length\n if (index > filled) {\n focusSlot(filled)\n return\n }\n event.currentTarget.select()\n }\n\n React.useImperativeHandle(\n ref,\n () => ({\n focus: (options) => focusSlot(Math.min(value.length, length - 1), options),\n blur: () => {\n const active = document.activeElement\n if (active instanceof HTMLElement && rootRef.current?.contains(active)) active.blur()\n },\n }),\n [focusSlot, length, value.length],\n )\n\n // A rejection shakes the row: on the way into the error, and again for every new errorKey.\n React.useEffect(() => {\n const el = controlRef.current\n if (!isError || !el) return\n const next = el.classList.contains(\"animate-shake-a\") ? \"animate-shake-b\" : \"animate-shake-a\"\n el.classList.remove(\"animate-shake-a\", \"animate-shake-b\")\n el.classList.add(next)\n const done = () => el.classList.remove(next)\n el.addEventListener(\"animationend\", done, { once: true })\n return () => el.removeEventListener(\"animationend\", done)\n }, [isError, errorKey])\n\n // Cleared from outside: take focus back to the first slot, if it was here or had nowhere to go.\n const previous = React.useRef(value)\n React.useEffect(() => {\n const was = previous.current\n previous.current = value\n if (value !== \"\" || was === \"\") return\n const active = document.activeElement\n if (active === document.body || active === null || rootRef.current?.contains(active)) focusSlot(0)\n }, [value, focusSlot])\n\n const group = separator == null ? 0 : Math.max(1, groupSize ?? Math.ceil(length / 2))\n const mark =\n separator === \"dash\" ? <span className={slots.dash()} /> : separator === \"dot\" ? \"·\" : separator\n\n return (\n <div ref={rootRef} data-slot=\"otp-input\" className={slots.root({ className })} {...props}>\n {label != null && (\n <label data-slot=\"otp-input-label\" id={labelId} htmlFor={`${id}-0`} className={slots.label()}>\n {label}\n {required && (\n <>\n <span aria-hidden className=\"text-destructive\">\n *\n </span>\n <span className=\"sr-only\">(required)</span>\n </>\n )}\n </label>\n )}\n <div\n ref={controlRef}\n role=\"group\"\n aria-label={label == null ? ariaLabel : undefined}\n aria-labelledby={label != null ? labelId : undefined}\n aria-describedby={hint != null ? hintId : undefined}\n data-slot=\"otp-input-control\"\n data-error={isError || undefined}\n data-disabled={isDisabled || undefined}\n className={slots.control()}\n >\n {glyphs.map((glyph, index) => (\n <React.Fragment key={index}>\n {group > 0 && index > 0 && index % group === 0 && (\n <div role=\"separator\" aria-hidden data-slot=\"otp-input-separator\" className={slots.separator()}>\n {mark}\n </div>\n )}\n <div data-slot=\"otp-input-cell\" data-filled={glyph.char ? \"\" : undefined} className={slots.cell()}>\n <input\n ref={(el) => {\n inputs.current[index] = el\n }}\n id={`${id}-${index}`}\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"[0-9]*\"\n autoComplete={index === 0 ? \"one-time-code\" : \"off\"}\n aria-label={`Digit ${index + 1} of ${length}`}\n aria-invalid={isError || undefined}\n aria-required={required || undefined}\n placeholder={placeholder}\n autoFocus={autoFocus && index === 0}\n disabled={isDisabled}\n value={value[index] ?? \"\"}\n onChange={(event) => write(index, event.target.value)}\n onPaste={(event) => {\n event.preventDefault()\n write(index, event.clipboardData.getData(\"text\"))\n }}\n onKeyDown={onKeyDown(index)}\n onFocus={onFocus(index)}\n className={cn(slots.slot(), slotClassName)}\n />\n <span aria-hidden data-slot=\"otp-input-glyphs\" className={slots.glyphs()}>\n {glyph.seq > 0 && glyph.prev ? (\n <span key={`out-${glyph.seq}`} className={cn(slots.glyph(), \"opacity-0 number-roll-out\")}>\n {glyph.prev}\n </span>\n ) : null}\n {glyph.char ? (\n <span\n key={`in-${glyph.seq}`}\n className={cn(slots.glyph(), glyph.seq > 0 && \"number-roll-in\")}\n style={\n glyph.seq > 0 && glyph.delay > 0\n ? { animationDelay: `calc(var(--number-roll-stagger) * ${glyph.delay})` }\n : undefined\n }\n >\n {glyph.char}\n </span>\n ) : null}\n </span>\n </div>\n </React.Fragment>\n ))}\n </div>\n {hint != null && (\n <p data-slot=\"otp-input-hint\" id={hintId} className={slots.hint()}>\n {hint}\n </p>\n )}\n {name ? <input type=\"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|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/pager/index.ts"],"sourcesContent":["export { Pager, PagerItem, pagerVariants, type PagerProps, type PagerItemProps } from \"./pager.mjs\"\n"],"mappings":"AAAA,SAAS,OAAO,WAAW,qBAA2D;","names":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import { ArrowLeft, ArrowRight } from "atoms-icons";
|
|
4
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
5
|
+
import { Card } from "../card/index.mjs";
|
|
6
|
+
const pagerVariants = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
9
|
+
item: "group/pager min-h-10 min-w-0 flex-row items-center gap-3 p-4 no-underline",
|
|
10
|
+
arrow: [
|
|
11
|
+
"size-4 shrink-0 text-muted-foreground",
|
|
12
|
+
"transition-[translate,color] duration-fast ease-out motion-reduce-fade",
|
|
13
|
+
"group-hover/pager:text-foreground"
|
|
14
|
+
],
|
|
15
|
+
body: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
16
|
+
label: "text-xs text-muted-foreground",
|
|
17
|
+
title: "truncate text-sm font-medium text-foreground",
|
|
18
|
+
description: "line-clamp-2 text-sm text-pretty text-muted-foreground"
|
|
19
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
direction: {
|
|
22
|
+
previous: {
|
|
23
|
+
item: "sm:col-start-1",
|
|
24
|
+
arrow: "group-hover/pager:-translate-x-0.5",
|
|
25
|
+
body: "text-start"
|
|
26
|
+
},
|
|
27
|
+
next: {
|
|
28
|
+
item: "sm:col-start-2 flex-row-reverse",
|
|
29
|
+
arrow: "group-hover/pager:translate-x-0.5",
|
|
30
|
+
body: "text-end"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: { direction: "next" }
|
|
35
|
+
});
|
|
36
|
+
function Pager({ className, "aria-label": ariaLabel = "Pagination", ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
"nav",
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "pager",
|
|
41
|
+
"aria-label": ariaLabel,
|
|
42
|
+
className: pagerVariants().root({ className }),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const DEFAULT_LABELS = { previous: "Previous page", next: "Next page" };
|
|
48
|
+
function PagerItem({
|
|
49
|
+
direction,
|
|
50
|
+
title,
|
|
51
|
+
description,
|
|
52
|
+
label,
|
|
53
|
+
asChild = false,
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
const slots = pagerVariants({ direction });
|
|
59
|
+
const Arrow = direction === "previous" ? ArrowLeft : ArrowRight;
|
|
60
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
61
|
+
return /* @__PURE__ */ jsx(Card, { variant: "outline", interactive: true, asChild: true, className: slots.item({ className }), children: /* @__PURE__ */ jsxs(
|
|
62
|
+
Comp,
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "pager-item",
|
|
65
|
+
"data-direction": direction,
|
|
66
|
+
rel: direction === "previous" ? "prev" : "next",
|
|
67
|
+
...props,
|
|
68
|
+
children: [
|
|
69
|
+
asChild ? /* @__PURE__ */ jsx(Slot.Slottable, { children }) : null,
|
|
70
|
+
/* @__PURE__ */ jsx(Arrow, { "data-slot": "pager-arrow", "aria-hidden": true, className: slots.arrow() }),
|
|
71
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "pager-body", className: slots.body(), children: [
|
|
72
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "pager-label", className: slots.label(), children: label ?? DEFAULT_LABELS[direction] }),
|
|
73
|
+
" ",
|
|
74
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "pager-title", className: slots.title(), children: title }),
|
|
75
|
+
description ? /* @__PURE__ */ jsx("span", { "data-slot": "pager-description", className: slots.description(), children: description }) : null
|
|
76
|
+
] })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
) });
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
Pager,
|
|
83
|
+
PagerItem,
|
|
84
|
+
pagerVariants
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=pager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/pager/pager.tsx"],"sourcesContent":["import * as React from \"react\"\r\nimport { Slot } from \"radix-ui\"\r\nimport { ArrowLeft, ArrowRight } from \"atoms-icons\"\r\n\r\nimport { tv } from \"../../../lib/tv.mjs\"\r\nimport { Card } from \"../card/index.mjs\"\r\n\r\nexport const pagerVariants = tv({\r\n slots: {\r\n root: \"grid grid-cols-1 gap-3 sm:grid-cols-2\",\r\n item: \"group/pager min-h-10 min-w-0 flex-row items-center gap-3 p-4 no-underline\",\r\n arrow: [\r\n \"size-4 shrink-0 text-muted-foreground\",\r\n \"transition-[translate,color] duration-fast ease-out motion-reduce-fade\",\r\n \"group-hover/pager:text-foreground\",\r\n ],\r\n body: \"flex min-w-0 flex-1 flex-col gap-0.5\",\r\n label: \"text-xs text-muted-foreground\",\r\n title: \"truncate text-sm font-medium text-foreground\",\r\n description: \"line-clamp-2 text-sm text-pretty text-muted-foreground\",\r\n },\r\n variants: {\r\n direction: {\r\n previous: {\r\n item: \"sm:col-start-1\",\r\n arrow: \"group-hover/pager:-translate-x-0.5\",\r\n body: \"text-start\",\r\n },\r\n next: {\r\n item: \"sm:col-start-2 flex-row-reverse\",\r\n arrow: \"group-hover/pager:translate-x-0.5\",\r\n body: \"text-end\",\r\n },\r\n },\r\n },\r\n defaultVariants: { direction: \"next\" },\r\n})\r\n\r\nexport interface PagerProps extends React.ComponentProps<\"nav\"> {\r\n /** Names the landmark. Defaults to \"Pagination\". */\r\n \"aria-label\"?: string\r\n}\r\n\r\nexport function Pager({ className, \"aria-label\": ariaLabel = \"Pagination\", ...props }: PagerProps) {\r\n return (\r\n <nav\r\n data-slot=\"pager\"\r\n aria-label={ariaLabel}\r\n className={pagerVariants().root({ className })}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nconst DEFAULT_LABELS = { previous: \"Previous page\", next: \"Next page\" } as const\r\n\r\nexport interface PagerItemProps extends Omit<React.ComponentProps<\"a\">, \"title\"> {\r\n /** Which way the link goes. Sets the arrow, the default label, `rel` and the column. */\r\n direction: \"previous\" | \"next\"\r\n /** The title of the page the link goes to. */\r\n title: React.ReactNode\r\n /** A line under the title, clamped to two lines. */\r\n description?: React.ReactNode\r\n /** The small line above the title. Defaults to \"Previous page\" or \"Next page\". */\r\n label?: React.ReactNode\r\n /** Merge onto the single child element instead, such as a Next.js `Link`. */\r\n asChild?: boolean\r\n}\r\n\r\nexport function PagerItem({\r\n direction,\r\n title,\r\n description,\r\n label,\r\n asChild = false,\r\n className,\r\n children,\r\n ...props\r\n}: PagerItemProps) {\r\n const slots = pagerVariants({ direction })\r\n const Arrow = direction === \"previous\" ? ArrowLeft : ArrowRight\r\n const Comp = asChild ? Slot.Root : \"a\"\r\n\r\n return (\r\n <Card variant=\"outline\" interactive asChild className={slots.item({ className })}>\r\n <Comp\r\n data-slot=\"pager-item\"\r\n data-direction={direction}\r\n rel={direction === \"previous\" ? \"prev\" : \"next\"}\r\n {...props}\r\n >\r\n {asChild ? <Slot.Slottable>{children}</Slot.Slottable> : null}\r\n <Arrow data-slot=\"pager-arrow\" aria-hidden className={slots.arrow()} />\r\n <span data-slot=\"pager-body\" className={slots.body()}>\r\n <span data-slot=\"pager-label\" className={slots.label()}>\r\n {label ?? DEFAULT_LABELS[direction]}\r\n </span>{\" \"}\r\n <span data-slot=\"pager-title\" className={slots.title()}>\r\n {title}\r\n </span>\r\n {description ? (\r\n <span data-slot=\"pager-description\" className={slots.description()}>\r\n {description}\r\n </span>\r\n ) : null}\r\n </span>\r\n </Comp>\r\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,UAAU,CAAC,GAC7E;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,kBAAgB;AAAA,MAChB,KAAK,cAAc,aAAa,SAAS;AAAA,MACxC,GAAG;AAAA,MAEH;AAAA,kBAAU,oBAAC,KAAK,WAAL,EAAgB,UAAS,IAAoB;AAAA,QACzD,oBAAC,SAAM,aAAU,eAAc,eAAW,MAAC,WAAW,MAAM,MAAM,GAAG;AAAA,QACrE,qBAAC,UAAK,aAAU,cAAa,WAAW,MAAM,KAAK,GACjD;AAAA,8BAAC,UAAK,aAAU,eAAc,WAAW,MAAM,MAAM,GAClD,mBAAS,eAAe,SAAS,GACpC;AAAA,UAAQ;AAAA,UACR,oBAAC,UAAK,aAAU,eAAc,WAAW,MAAM,MAAM,GAClD,iBACH;AAAA,UACC,cACC,oBAAC,UAAK,aAAU,qBAAoB,WAAW,MAAM,YAAY,GAC9D,uBACH,IACE;AAAA,WACN;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Pagination,
|
|
3
|
+
PaginationRoot,
|
|
4
|
+
PaginationInfo,
|
|
5
|
+
PaginationControls,
|
|
6
|
+
PaginationPrevButton,
|
|
7
|
+
PaginationNextButton,
|
|
8
|
+
PaginationGoTo,
|
|
9
|
+
PaginationRowsPerPage,
|
|
10
|
+
paginationVariants
|
|
11
|
+
} from "./pagination.mjs";
|
|
12
|
+
export {
|
|
13
|
+
Pagination,
|
|
14
|
+
PaginationControls,
|
|
15
|
+
PaginationGoTo,
|
|
16
|
+
PaginationInfo,
|
|
17
|
+
PaginationNextButton,
|
|
18
|
+
PaginationPrevButton,
|
|
19
|
+
PaginationRoot,
|
|
20
|
+
PaginationRowsPerPage,
|
|
21
|
+
paginationVariants
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/pagination/index.ts"],"sourcesContent":["export {\n Pagination,\n PaginationRoot,\n PaginationInfo,\n PaginationControls,\n PaginationPrevButton,\n PaginationNextButton,\n PaginationGoTo,\n PaginationRowsPerPage,\n paginationVariants,\n type PaginationProps,\n type PaginationRootProps,\n type PaginationStepButtonProps,\n type PaginationGoToProps,\n type PaginationRowsPerPageProps,\n} from \"./pagination.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;","names":[]}
|