@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,210 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { CaretLeft, CaretRight } from "atoms-icons";
|
|
5
|
+
import { Button } from "../button/index.mjs";
|
|
6
|
+
import { InputField, InputRoot } from "../input/index.mjs";
|
|
7
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/index.mjs";
|
|
8
|
+
import { createContext } from "../../../lib/create-context.mjs";
|
|
9
|
+
import { ControlSizeProvider, useDensity } from "../../../lib/density.mjs";
|
|
10
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
11
|
+
const paginationVariants = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
root: "flex flex-wrap items-center justify-between gap-x-6 gap-y-3",
|
|
14
|
+
cluster: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
15
|
+
info: "text-muted-foreground tabular-nums whitespace-nowrap select-none",
|
|
16
|
+
controls: "flex items-center gap-0.5",
|
|
17
|
+
field: "flex items-center gap-2",
|
|
18
|
+
label: "text-muted-foreground whitespace-nowrap select-none",
|
|
19
|
+
gotoInput: "w-14 text-center tabular-nums [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
density: {
|
|
23
|
+
compact: { info: "text-xs", label: "text-xs" },
|
|
24
|
+
comfortable: { info: "text-sm", label: "text-sm" }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { density: "compact" }
|
|
28
|
+
});
|
|
29
|
+
const clampPage = (page, count) => Math.min(Math.max(1, Math.round(page)), count);
|
|
30
|
+
const [PaginationProvider, usePagination] = createContext("PaginationRoot");
|
|
31
|
+
const DEFAULT_OPTIONS = [10, 20, 30, 50];
|
|
32
|
+
function PaginationRoot({
|
|
33
|
+
page: pageProp,
|
|
34
|
+
pageCount: countProp,
|
|
35
|
+
onPageChange,
|
|
36
|
+
rowsPerPage,
|
|
37
|
+
onRowsPerPageChange,
|
|
38
|
+
rowsPerPageOptions = DEFAULT_OPTIONS,
|
|
39
|
+
disabled = false,
|
|
40
|
+
density: densityProp,
|
|
41
|
+
className,
|
|
42
|
+
"aria-label": ariaLabel = "Pagination",
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const density = useDensity(densityProp);
|
|
46
|
+
const pageCount = Math.max(1, Math.floor(countProp));
|
|
47
|
+
const page = clampPage(pageProp, pageCount);
|
|
48
|
+
const slots = paginationVariants({ density });
|
|
49
|
+
const go = React.useCallback(
|
|
50
|
+
(next) => {
|
|
51
|
+
const clamped = clampPage(next, pageCount);
|
|
52
|
+
if (clamped !== page) onPageChange?.(clamped);
|
|
53
|
+
},
|
|
54
|
+
[page, pageCount, onPageChange]
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
PaginationProvider,
|
|
58
|
+
{
|
|
59
|
+
page,
|
|
60
|
+
pageCount,
|
|
61
|
+
go,
|
|
62
|
+
rowsPerPage,
|
|
63
|
+
onRowsPerPageChange,
|
|
64
|
+
rowsPerPageOptions,
|
|
65
|
+
disabled,
|
|
66
|
+
slots,
|
|
67
|
+
children: /* @__PURE__ */ jsx(ControlSizeProvider, { size: density === "comfortable" ? "lg" : "sm", children: /* @__PURE__ */ jsx("nav", { "data-slot": "pagination", "aria-label": ariaLabel, className: slots.root({ className }), ...props }) })
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function PaginationInfo({ className, children, ...props }) {
|
|
72
|
+
const { page, pageCount, slots } = usePagination("PaginationInfo");
|
|
73
|
+
return /* @__PURE__ */ jsx("p", { "data-slot": "pagination-info", "aria-live": "polite", className: slots.info({ className }), ...props, children: children ?? `Page ${page} of ${pageCount}` });
|
|
74
|
+
}
|
|
75
|
+
function PaginationControls({ className, children, ...props }) {
|
|
76
|
+
const { slots } = usePagination("PaginationControls");
|
|
77
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "pagination-controls", className: slots.controls({ className }), ...props, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx(PaginationPrevButton, {}),
|
|
79
|
+
/* @__PURE__ */ jsx(PaginationNextButton, {})
|
|
80
|
+
] }) });
|
|
81
|
+
}
|
|
82
|
+
function StepButton({
|
|
83
|
+
direction,
|
|
84
|
+
label,
|
|
85
|
+
icon,
|
|
86
|
+
children,
|
|
87
|
+
onClick,
|
|
88
|
+
disabled,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
const ctx = usePagination(direction > 0 ? "PaginationNextButton" : "PaginationPrevButton");
|
|
92
|
+
const atEnd = direction > 0 ? ctx.page >= ctx.pageCount : ctx.page <= 1;
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
Button,
|
|
95
|
+
{
|
|
96
|
+
variant: "outline",
|
|
97
|
+
iconOnly: true,
|
|
98
|
+
"aria-label": label,
|
|
99
|
+
"data-slot": direction > 0 ? "pagination-next" : "pagination-prev",
|
|
100
|
+
disabled: disabled ?? (ctx.disabled || atEnd),
|
|
101
|
+
onClick: (event) => {
|
|
102
|
+
onClick?.(event);
|
|
103
|
+
if (!event.defaultPrevented) ctx.go(ctx.page + direction);
|
|
104
|
+
},
|
|
105
|
+
...props,
|
|
106
|
+
children: children ?? icon
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function PaginationPrevButton(props) {
|
|
111
|
+
return /* @__PURE__ */ jsx(StepButton, { direction: -1, label: "Previous page", icon: /* @__PURE__ */ jsx(CaretLeft, {}), ...props });
|
|
112
|
+
}
|
|
113
|
+
function PaginationNextButton(props) {
|
|
114
|
+
return /* @__PURE__ */ jsx(StepButton, { direction: 1, label: "Next page", icon: /* @__PURE__ */ jsx(CaretRight, {}), ...props });
|
|
115
|
+
}
|
|
116
|
+
function PaginationGoTo({ label = "Go to", className, ...props }) {
|
|
117
|
+
const ctx = usePagination("PaginationGoTo");
|
|
118
|
+
const id = React.useId();
|
|
119
|
+
const [draft, setDraft] = React.useState(null);
|
|
120
|
+
const text = draft && draft.page === ctx.page ? draft.text : String(ctx.page);
|
|
121
|
+
const commit = () => {
|
|
122
|
+
if (!draft) return;
|
|
123
|
+
const n = Number.parseInt(draft.text, 10);
|
|
124
|
+
setDraft(null);
|
|
125
|
+
if (Number.isFinite(n)) ctx.go(n);
|
|
126
|
+
};
|
|
127
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "pagination-goto", className: ctx.slots.field({ className }), ...props, children: [
|
|
128
|
+
label != null && /* @__PURE__ */ jsx("label", { htmlFor: id, className: ctx.slots.label(), children: label }),
|
|
129
|
+
/* @__PURE__ */ jsx(InputRoot, { className: "w-auto", disabled: ctx.disabled, children: /* @__PURE__ */ jsx(
|
|
130
|
+
InputField,
|
|
131
|
+
{
|
|
132
|
+
id,
|
|
133
|
+
type: "number",
|
|
134
|
+
inputMode: "numeric",
|
|
135
|
+
min: 1,
|
|
136
|
+
max: ctx.pageCount,
|
|
137
|
+
"aria-label": "Go to page",
|
|
138
|
+
value: text,
|
|
139
|
+
onChange: (event) => setDraft({ page: ctx.page, text: event.target.value }),
|
|
140
|
+
onBlur: commit,
|
|
141
|
+
onKeyDown: (event) => {
|
|
142
|
+
if (event.key === "Enter") {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
commit();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
className: ctx.slots.gotoInput()
|
|
148
|
+
}
|
|
149
|
+
) })
|
|
150
|
+
] });
|
|
151
|
+
}
|
|
152
|
+
function PaginationRowsPerPage({ label = "Rows per page", className, ...props }) {
|
|
153
|
+
const ctx = usePagination("PaginationRowsPerPage");
|
|
154
|
+
const id = React.useId();
|
|
155
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "pagination-rows", className: ctx.slots.field({ className }), ...props, children: [
|
|
156
|
+
label != null && /* @__PURE__ */ jsx("label", { htmlFor: id, className: ctx.slots.label(), children: label }),
|
|
157
|
+
/* @__PURE__ */ jsxs(
|
|
158
|
+
Select,
|
|
159
|
+
{
|
|
160
|
+
value: ctx.rowsPerPage === void 0 ? void 0 : String(ctx.rowsPerPage),
|
|
161
|
+
onValueChange: (value) => ctx.onRowsPerPageChange?.(Number(value)),
|
|
162
|
+
disabled: ctx.disabled,
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id, "aria-label": "Rows per page", className: "w-auto gap-2 tabular-nums", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
165
|
+
/* @__PURE__ */ jsx(SelectContent, { children: ctx.rowsPerPageOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: String(option), children: option }, option)) })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
] });
|
|
170
|
+
}
|
|
171
|
+
function Pagination({
|
|
172
|
+
showInfo = true,
|
|
173
|
+
showControls = true,
|
|
174
|
+
showGoTo = false,
|
|
175
|
+
showRowsPerPage = false,
|
|
176
|
+
children,
|
|
177
|
+
...props
|
|
178
|
+
}) {
|
|
179
|
+
return /* @__PURE__ */ jsx(PaginationRoot, { ...props, children: children ?? /* @__PURE__ */ jsx(DefaultLayout, { showInfo, showControls, showGoTo, showRowsPerPage }) });
|
|
180
|
+
}
|
|
181
|
+
function DefaultLayout({
|
|
182
|
+
showInfo,
|
|
183
|
+
showControls,
|
|
184
|
+
showGoTo,
|
|
185
|
+
showRowsPerPage
|
|
186
|
+
}) {
|
|
187
|
+
const { slots } = usePagination("Pagination");
|
|
188
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
189
|
+
(showRowsPerPage || showInfo) && /* @__PURE__ */ jsxs("div", { className: slots.cluster(), children: [
|
|
190
|
+
showRowsPerPage && /* @__PURE__ */ jsx(PaginationRowsPerPage, {}),
|
|
191
|
+
showInfo && /* @__PURE__ */ jsx(PaginationInfo, {})
|
|
192
|
+
] }),
|
|
193
|
+
(showGoTo || showControls) && /* @__PURE__ */ jsxs("div", { className: slots.cluster(), children: [
|
|
194
|
+
showGoTo && /* @__PURE__ */ jsx(PaginationGoTo, {}),
|
|
195
|
+
showControls && /* @__PURE__ */ jsx(PaginationControls, {})
|
|
196
|
+
] })
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
Pagination,
|
|
201
|
+
PaginationControls,
|
|
202
|
+
PaginationGoTo,
|
|
203
|
+
PaginationInfo,
|
|
204
|
+
PaginationNextButton,
|
|
205
|
+
PaginationPrevButton,
|
|
206
|
+
PaginationRoot,
|
|
207
|
+
PaginationRowsPerPage,
|
|
208
|
+
paginationVariants
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/pagination/pagination.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { CaretLeft, CaretRight } from \"atoms-icons\"\n\nimport { Button, type ButtonProps } from \"../button/index.mjs\"\nimport { InputField, InputRoot } from \"../input/index.mjs\"\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select/index.mjs\"\nimport { createContext } from \"../../../lib/create-context.mjs\"\nimport { ControlSizeProvider, useDensity, type Density } from \"../../../lib/density.mjs\"\nimport { tv } from \"../../../lib/tv.mjs\"\n\n/*\n * A toolbar for a paged dataset: the page readout, prev/next, a go-to field and a rows-per-page\n * select. Fully controlled by `page` and `pageCount`. The density lands every control inside on\n * one height (32px compact, 40px comfortable) through a ControlSizeProvider.\n */\nexport const paginationVariants = tv({\n slots: {\n root: \"flex flex-wrap items-center justify-between gap-x-6 gap-y-3\",\n cluster: \"flex flex-wrap items-center gap-x-4 gap-y-2\",\n info: \"text-muted-foreground tabular-nums whitespace-nowrap select-none\",\n controls: \"flex items-center gap-0.5\",\n field: \"flex items-center gap-2\",\n label: \"text-muted-foreground whitespace-nowrap select-none\",\n gotoInput:\n \"w-14 text-center tabular-nums [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none\",\n },\n variants: {\n density: {\n compact: { info: \"text-xs\", label: \"text-xs\" },\n comfortable: { info: \"text-sm\", label: \"text-sm\" },\n },\n },\n defaultVariants: { density: \"compact\" },\n})\n\nconst clampPage = (page: number, count: number) => Math.min(Math.max(1, Math.round(page)), count)\n\ninterface PaginationContextValue {\n page: number\n pageCount: number\n go: (page: number) => void\n rowsPerPage: number | undefined\n onRowsPerPageChange: ((rows: number) => void) | undefined\n rowsPerPageOptions: number[]\n disabled: boolean\n slots: ReturnType<typeof paginationVariants>\n}\n\nconst [PaginationProvider, usePagination] = createContext<PaginationContextValue>(\"PaginationRoot\")\n\nexport interface PaginationRootProps extends React.ComponentProps<\"nav\"> {\n /** The current page, 1-based. Fully controlled. */\n page: number\n /** Total pages, clamped to at least 1. */\n pageCount: number\n /** Called with the next page, already clamped into range. */\n onPageChange?: (page: number) => void\n /** The current rows-per-page value, needed by the rows select. */\n rowsPerPage?: number\n /** Called with the next rows-per-page value. */\n onRowsPerPageChange?: (rows: number) => void\n /** The choices the rows select offers. */\n rowsPerPageOptions?: number[]\n /** Disables every control at once. */\n disabled?: boolean\n /** One matched control height: 40px comfortable, 32px compact. */\n density?: Density\n}\n\nconst DEFAULT_OPTIONS = [10, 20, 30, 50]\n\n/** The state provider and the navigation landmark, for a layout of your own. */\nexport function PaginationRoot({\n page: pageProp,\n pageCount: countProp,\n onPageChange,\n rowsPerPage,\n onRowsPerPageChange,\n rowsPerPageOptions = DEFAULT_OPTIONS,\n disabled = false,\n density: densityProp,\n className,\n \"aria-label\": ariaLabel = \"Pagination\",\n ...props\n}: PaginationRootProps) {\n const density = useDensity(densityProp)\n const pageCount = Math.max(1, Math.floor(countProp))\n const page = clampPage(pageProp, pageCount)\n const slots = paginationVariants({ density })\n\n const go = React.useCallback(\n (next: number) => {\n const clamped = clampPage(next, pageCount)\n if (clamped !== page) onPageChange?.(clamped)\n },\n [page, pageCount, onPageChange],\n )\n\n return (\n <PaginationProvider\n page={page}\n pageCount={pageCount}\n go={go}\n rowsPerPage={rowsPerPage}\n onRowsPerPageChange={onRowsPerPageChange}\n rowsPerPageOptions={rowsPerPageOptions}\n disabled={disabled}\n slots={slots}\n >\n <ControlSizeProvider size={density === \"comfortable\" ? \"lg\" : \"sm\"}>\n <nav data-slot=\"pagination\" aria-label={ariaLabel} className={slots.root({ className })} {...props} />\n </ControlSizeProvider>\n </PaginationProvider>\n )\n}\n\n/** \"Page X of Y\", announced politely. Children replace the copy. */\nexport function PaginationInfo({ className, children, ...props }: React.ComponentProps<\"p\">) {\n const { page, pageCount, slots } = usePagination(\"PaginationInfo\")\n return (\n <p data-slot=\"pagination-info\" aria-live=\"polite\" className={slots.info({ className })} {...props}>\n {children ?? `Page ${page} of ${pageCount}`}\n </p>\n )\n}\n\n/** The previous and next buttons, with the cluster's spacing. */\nexport function PaginationControls({ className, children, ...props }: React.ComponentProps<\"div\">) {\n const { slots } = usePagination(\"PaginationControls\")\n return (\n <div data-slot=\"pagination-controls\" className={slots.controls({ className })} {...props}>\n {children ?? (\n <>\n <PaginationPrevButton />\n <PaginationNextButton />\n </>\n )}\n </div>\n )\n}\n\nexport type PaginationStepButtonProps = Omit<ButtonProps, \"size\" | \"variant\" | \"iconOnly\">\n\nfunction StepButton({\n direction,\n label,\n icon,\n children,\n onClick,\n disabled,\n ...props\n}: PaginationStepButtonProps & { direction: 1 | -1; label: string; icon: React.ReactNode }) {\n const ctx = usePagination(direction > 0 ? \"PaginationNextButton\" : \"PaginationPrevButton\")\n const atEnd = direction > 0 ? ctx.page >= ctx.pageCount : ctx.page <= 1\n return (\n <Button\n variant=\"outline\"\n iconOnly\n aria-label={label}\n data-slot={direction > 0 ? \"pagination-next\" : \"pagination-prev\"}\n disabled={disabled ?? (ctx.disabled || atEnd)}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) ctx.go(ctx.page + direction)\n }}\n {...props}\n >\n {children ?? icon}\n </Button>\n )\n}\n\n/** The outline icon button to the previous page, disabled on the first. */\nexport function PaginationPrevButton(props: PaginationStepButtonProps) {\n return <StepButton direction={-1} label=\"Previous page\" icon={<CaretLeft />} {...props} />\n}\n\n/** The outline icon button to the next page, disabled on the last. */\nexport function PaginationNextButton(props: PaginationStepButtonProps) {\n return <StepButton direction={1} label=\"Next page\" icon={<CaretRight />} {...props} />\n}\n\nexport interface PaginationGoToProps extends React.ComponentProps<\"div\"> {\n /** The label before the field. `null` hides it. */\n label?: React.ReactNode\n}\n\n/** A numeric field that jumps to a page on Enter or blur, clamped into range. */\nexport function PaginationGoTo({ label = \"Go to\", className, ...props }: PaginationGoToProps) {\n const ctx = usePagination(\"PaginationGoTo\")\n const id = React.useId()\n // The typed text, until it commits. A page change from outside resets it.\n const [draft, setDraft] = React.useState<{ page: number; text: string } | null>(null)\n const text = draft && draft.page === ctx.page ? draft.text : String(ctx.page)\n\n const commit = () => {\n if (!draft) return\n const n = Number.parseInt(draft.text, 10)\n setDraft(null)\n if (Number.isFinite(n)) ctx.go(n)\n }\n\n return (\n <div data-slot=\"pagination-goto\" className={ctx.slots.field({ className })} {...props}>\n {label != null && (\n <label htmlFor={id} className={ctx.slots.label()}>\n {label}\n </label>\n )}\n <InputRoot className=\"w-auto\" disabled={ctx.disabled}>\n <InputField\n id={id}\n type=\"number\"\n inputMode=\"numeric\"\n min={1}\n max={ctx.pageCount}\n aria-label=\"Go to page\"\n value={text}\n onChange={(event) => setDraft({ page: ctx.page, text: event.target.value })}\n onBlur={commit}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault()\n commit()\n }\n }}\n className={ctx.slots.gotoInput()}\n />\n </InputRoot>\n </div>\n )\n}\n\nexport interface PaginationRowsPerPageProps extends React.ComponentProps<\"div\"> {\n /** The label before the select. `null` hides it. */\n label?: React.ReactNode\n}\n\n/** The rows-per-page select, fed by the root's rowsPerPage and rowsPerPageOptions. */\nexport function PaginationRowsPerPage({ label = \"Rows per page\", className, ...props }: PaginationRowsPerPageProps) {\n const ctx = usePagination(\"PaginationRowsPerPage\")\n const id = React.useId()\n return (\n <div data-slot=\"pagination-rows\" className={ctx.slots.field({ className })} {...props}>\n {label != null && (\n <label htmlFor={id} className={ctx.slots.label()}>\n {label}\n </label>\n )}\n <Select\n value={ctx.rowsPerPage === undefined ? undefined : String(ctx.rowsPerPage)}\n onValueChange={(value) => ctx.onRowsPerPageChange?.(Number(value))}\n disabled={ctx.disabled}\n >\n <SelectTrigger id={id} aria-label=\"Rows per page\" className=\"w-auto gap-2 tabular-nums\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {ctx.rowsPerPageOptions.map((option) => (\n <SelectItem key={option} value={String(option)}>\n {option}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )\n}\n\nexport interface PaginationProps extends PaginationRootProps {\n /** The Page X of Y readout. */\n showInfo?: boolean\n /** The previous and next buttons. */\n showControls?: boolean\n /** The go-to-page field. */\n showGoTo?: boolean\n /** The rows-per-page select. */\n showRowsPerPage?: boolean\n}\n\n/** The ready toolbar: PaginationRoot with a default layout gated by the show* toggles. */\nexport function Pagination({\n showInfo = true,\n showControls = true,\n showGoTo = false,\n showRowsPerPage = false,\n children,\n ...props\n}: PaginationProps) {\n return (\n <PaginationRoot {...props}>\n {children ?? <DefaultLayout showInfo={showInfo} showControls={showControls} showGoTo={showGoTo} showRowsPerPage={showRowsPerPage} />}\n </PaginationRoot>\n )\n}\n\nfunction DefaultLayout({\n showInfo,\n showControls,\n showGoTo,\n showRowsPerPage,\n}: Required<Pick<PaginationProps, \"showInfo\" | \"showControls\" | \"showGoTo\" | \"showRowsPerPage\">>) {\n const { slots } = usePagination(\"Pagination\")\n return (\n <>\n {(showRowsPerPage || showInfo) && (\n <div className={slots.cluster()}>\n {showRowsPerPage && <PaginationRowsPerPage />}\n {showInfo && <PaginationInfo />}\n </div>\n )}\n {(showGoTo || showControls) && (\n <div className={slots.cluster()}>\n {showGoTo && <PaginationGoTo />}\n {showControls && <PaginationControls />}\n </div>\n )}\n </>\n )\n}\n"],"mappings":";AAgHQ,SAsBA,UAtBA,KAsBA,YAtBA;AA9GR,YAAY,WAAW;AACvB,SAAS,WAAW,kBAAkB;AAEtC,SAAS,cAAgC;AACzC,SAAS,YAAY,iB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SACE,oBAAC,kBAAgB,GAAG,OACjB,sBAAY,oBAAC,iBAAc,UAAoB,cAA4B,UAAoB,iBAAkC,GACpI;AAEJ;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAkG;AAChG,QAAM,EAAE,MAAM,IAAI,cAAc,YAAY;AAC5C,SACE,iCACI;AAAA,wBAAmB,aACnB,qBAAC,SAAI,WAAW,MAAM,QAAQ,GAC3B;AAAA,yBAAmB,oBAAC,yBAAsB;AAAA,MAC1C,YAAY,oBAAC,kBAAe;AAAA,OAC/B;AAAA,KAEA,YAAY,iBACZ,qBAAC,SAAI,WAAW,MAAM,QAAQ,GAC3B;AAAA,kBAAY,oBAAC,kBAAe;AAAA,MAC5B,gBAAgB,oBAAC,sBAAmB;AAAA,OACvC;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PasswordStrength,
|
|
3
|
+
PasswordStrengthMeter,
|
|
4
|
+
PasswordStrengthLabel,
|
|
5
|
+
PasswordStrengthList,
|
|
6
|
+
passwordStrengthVariants
|
|
7
|
+
} from "./password-strength.mjs";
|
|
8
|
+
import {
|
|
9
|
+
getPasswordStrength,
|
|
10
|
+
defaultPasswordRules
|
|
11
|
+
} from "./password-rules.mjs";
|
|
12
|
+
export {
|
|
13
|
+
PasswordStrength,
|
|
14
|
+
PasswordStrengthLabel,
|
|
15
|
+
PasswordStrengthList,
|
|
16
|
+
PasswordStrengthMeter,
|
|
17
|
+
defaultPasswordRules,
|
|
18
|
+
getPasswordStrength,
|
|
19
|
+
passwordStrengthVariants
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/password-strength/index.ts"],"sourcesContent":["export {\n PasswordStrength,\n PasswordStrengthMeter,\n PasswordStrengthLabel,\n PasswordStrengthList,\n passwordStrengthVariants,\n type PasswordStrengthProps,\n type PasswordStrengthLabelProps,\n} from \"./password-strength.mjs\"\nexport {\n getPasswordStrength,\n defaultPasswordRules,\n type PasswordRule,\n type PasswordStrengthResult,\n type PasswordStrengthTone,\n} from \"./password-rules.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const defaultPasswordRules = [
|
|
2
|
+
{ id: "length", label: "At least 8 characters", test: (v) => v.length >= 8 },
|
|
3
|
+
{ id: "case", label: "Upper & lowercase letters", test: (v) => /[a-z]/.test(v) && /[A-Z]/.test(v) },
|
|
4
|
+
{ id: "number", label: "At least one number", test: (v) => /\d/.test(v) },
|
|
5
|
+
{ id: "symbol", label: "At least one symbol", test: (v) => /[^A-Za-z0-9\s]/.test(v) }
|
|
6
|
+
];
|
|
7
|
+
const LEVELS = [
|
|
8
|
+
{ label: "", tone: "muted" },
|
|
9
|
+
{ label: "Weak", tone: "destructive" },
|
|
10
|
+
{ label: "Fair", tone: "orange" },
|
|
11
|
+
{ label: "Good", tone: "warning" },
|
|
12
|
+
{ label: "Strong", tone: "success" }
|
|
13
|
+
];
|
|
14
|
+
function getPasswordStrength(value, rules = defaultPasswordRules) {
|
|
15
|
+
const checked = rules.map((rule) => ({ ...rule, met: rule.test(value) }));
|
|
16
|
+
const score = checked.filter((rule) => rule.met).length;
|
|
17
|
+
const max = checked.length;
|
|
18
|
+
const level = value === "" ? 0 : Math.max(1, Math.ceil(score / Math.max(1, max) * 4));
|
|
19
|
+
return { score, max, level, label: LEVELS[level].label, tone: LEVELS[level].tone, rules: checked };
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
defaultPasswordRules,
|
|
23
|
+
getPasswordStrength
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=password-rules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/password-strength/password-rules.ts"],"sourcesContent":["/*\n * Password scoring, without rendering. A plain module (no \"use client\"), so a server can score\n * too. Any number of rules maps onto four levels: Weak, Fair, Good, Strong.\n */\n\nexport interface PasswordRule {\n id: string\n label: string\n test: (value: string) => boolean\n}\n\nexport type PasswordStrengthTone = \"muted\" | \"destructive\" | \"orange\" | \"warning\" | \"success\"\n\nexport interface PasswordStrengthResult {\n /** Rules met. */\n score: number\n /** Rules in the policy. */\n max: number\n /** 0 with nothing typed, then 1 to 4. */\n level: 0 | 1 | 2 | 3 | 4\n /** The verdict, or \"\" at level 0. */\n label: string\n tone: PasswordStrengthTone\n rules: (PasswordRule & { met: boolean })[]\n}\n\n/** 8 characters, mixed case, a number and a symbol. */\nexport const defaultPasswordRules: PasswordRule[] = [\n { id: \"length\", label: \"At least 8 characters\", test: (v) => v.length >= 8 },\n { id: \"case\", label: \"Upper & lowercase letters\", test: (v) => /[a-z]/.test(v) && /[A-Z]/.test(v) },\n { id: \"number\", label: \"At least one number\", test: (v) => /\\d/.test(v) },\n { id: \"symbol\", label: \"At least one symbol\", test: (v) => /[^A-Za-z0-9\\s]/.test(v) },\n]\n\nconst LEVELS = [\n { label: \"\", tone: \"muted\" },\n { label: \"Weak\", tone: \"destructive\" },\n { label: \"Fair\", tone: \"orange\" },\n { label: \"Good\", tone: \"warning\" },\n { label: \"Strong\", tone: \"success\" },\n] as const\n\nexport function getPasswordStrength(value: string, rules: PasswordRule[] = defaultPasswordRules): PasswordStrengthResult {\n const checked = rules.map((rule) => ({ ...rule, met: rule.test(value) }))\n const score = checked.filter((rule) => rule.met).length\n const max = checked.length\n const level = (value === \"\" ? 0 : Math.max(1, Math.ceil((score / Math.max(1, max)) * 4))) as PasswordStrengthResult[\"level\"]\n return { score, max, level, label: LEVELS[level].label, tone: LEVELS[level].tone, rules: checked }\n}\n"],"mappings":"AA2BO,MAAM,uBAAuC;AA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-label/index.mjs";
|
|
5
|
+
import { createContext } from "../../../lib/create-context.mjs";
|
|
6
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
7
|
+
import { defaultPasswordRules, getPasswordStrength } from "./password-rules.mjs";
|
|
8
|
+
const passwordStrengthVariants = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "flex w-full flex-col gap-2",
|
|
11
|
+
meter: "flex w-full items-center gap-1.5",
|
|
12
|
+
segment: "h-1.5 flex-1 rounded-full bg-muted transition-colors duration-base ease-out",
|
|
13
|
+
label: "text-sm font-medium tabular-nums text-pretty transition-colors duration-fast ease-out",
|
|
14
|
+
list: "flex flex-col gap-1.5",
|
|
15
|
+
item: "flex items-center gap-2 text-sm text-pretty text-muted-foreground transition-colors duration-fast ease-out data-met:text-foreground",
|
|
16
|
+
glyphs: "relative flex size-4 shrink-0 items-center justify-center",
|
|
17
|
+
// A rule being met rolls the dot up and out as the check rises in. Transitions, not keyframes,
|
|
18
|
+
// so a rule that flips back mid-roll retargets instead of restarting.
|
|
19
|
+
glyph: "absolute [transition:opacity_var(--duration-base)_var(--ease-out),translate_var(--duration-base)_var(--ease-drawer),filter_var(--duration-base)_var(--ease-out)] motion-reduce:transition-opacity"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
tone: {
|
|
23
|
+
muted: { segment: "", label: "text-muted-foreground" },
|
|
24
|
+
destructive: { segment: "data-filled:bg-destructive", label: "text-destructive" },
|
|
25
|
+
orange: { segment: "data-filled:bg-orange", label: "text-orange" },
|
|
26
|
+
warning: { segment: "data-filled:bg-warning", label: "text-warning" },
|
|
27
|
+
success: { segment: "data-filled:bg-success", label: "text-success" }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: { tone: "muted" }
|
|
31
|
+
});
|
|
32
|
+
const [StrengthProvider, useStrength] = createContext("PasswordStrength");
|
|
33
|
+
function PasswordStrength({ value, rules = defaultPasswordRules, className, ...props }) {
|
|
34
|
+
const result = getPasswordStrength(value, rules);
|
|
35
|
+
return /* @__PURE__ */ jsx(StrengthProvider, { result, children: /* @__PURE__ */ jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "password-strength",
|
|
39
|
+
"data-level": result.level,
|
|
40
|
+
className: passwordStrengthVariants().root({ className }),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
) });
|
|
44
|
+
}
|
|
45
|
+
function PasswordStrengthMeter({ className, ...props }) {
|
|
46
|
+
const { result } = useStrength("PasswordStrengthMeter");
|
|
47
|
+
const slots = passwordStrengthVariants({ tone: result.tone });
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
role: "meter",
|
|
52
|
+
"aria-label": "Password strength",
|
|
53
|
+
"aria-valuemin": 0,
|
|
54
|
+
"aria-valuemax": 4,
|
|
55
|
+
"aria-valuenow": result.level,
|
|
56
|
+
"aria-valuetext": result.level === 0 ? "Empty" : result.label,
|
|
57
|
+
"data-slot": "password-strength-meter",
|
|
58
|
+
className: slots.meter({ className }),
|
|
59
|
+
...props,
|
|
60
|
+
children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsx(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
"data-slot": "password-strength-segment",
|
|
64
|
+
"data-filled": step <= result.level ? "" : void 0,
|
|
65
|
+
className: slots.segment()
|
|
66
|
+
},
|
|
67
|
+
step
|
|
68
|
+
))
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function PasswordStrengthLabel({ placeholder, className, ...props }) {
|
|
73
|
+
const { result } = useStrength("PasswordStrengthLabel");
|
|
74
|
+
const text = result.level === 0 ? placeholder ?? "" : result.label;
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
"p",
|
|
77
|
+
{
|
|
78
|
+
"aria-live": "polite",
|
|
79
|
+
"data-slot": "password-strength-label",
|
|
80
|
+
className: passwordStrengthVariants({ tone: result.tone }).label({ className }),
|
|
81
|
+
...props,
|
|
82
|
+
children: /* @__PURE__ */ jsx(AnimatedLabel, { swapKey: text, children: text })
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
function PasswordStrengthList({ className, ...props }) {
|
|
87
|
+
const { result } = useStrength("PasswordStrengthList");
|
|
88
|
+
const slots = passwordStrengthVariants();
|
|
89
|
+
return /* @__PURE__ */ jsx("ul", { "data-slot": "password-strength-list", className: slots.list({ className }), ...props, children: result.rules.map((rule) => /* @__PURE__ */ jsxs("li", { "data-slot": "password-strength-item", "data-met": rule.met || void 0, className: slots.item(), children: [
|
|
90
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: slots.glyphs(), children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Circle,
|
|
93
|
+
{
|
|
94
|
+
className: slots.glyph({
|
|
95
|
+
className: [
|
|
96
|
+
"size-3 text-muted-foreground",
|
|
97
|
+
rule.met ? "-translate-y-2 opacity-0 blur-[4px]" : "translate-y-0 opacity-100 blur-[0px]"
|
|
98
|
+
]
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
Check,
|
|
104
|
+
{
|
|
105
|
+
className: slots.glyph({
|
|
106
|
+
className: [
|
|
107
|
+
"size-4 text-success",
|
|
108
|
+
rule.met ? "translate-y-0 opacity-100 blur-[0px]" : "translate-y-2 opacity-0 blur-[4px]"
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] }),
|
|
114
|
+
rule.label,
|
|
115
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: rule.met ? " (met)" : " (not met)" })
|
|
116
|
+
] }, rule.id)) });
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
PasswordStrength,
|
|
120
|
+
PasswordStrengthLabel,
|
|
121
|
+
PasswordStrengthList,
|
|
122
|
+
PasswordStrengthMeter,
|
|
123
|
+
passwordStrengthVariants
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=password-strength.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/password-strength/password-strength.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Check, Circle } from \"atoms-icons\"\n\nimport { AnimatedLabel } from \"../animated-label/index.mjs\"\nimport { createContext } from \"../../../lib/create-context.mjs\"\nimport { tv } from \"../../../lib/tv.mjs\"\n\nimport { defaultPasswordRules, getPasswordStrength, type PasswordRule, type PasswordStrengthResult } from \"./password-rules.mjs\"\n\n/*\n * A live strength meter for a password field. The root scores the value against its rules on\n * every render and shares the result; the meter, the verdict and the checklist read it in any\n * arrangement. Hand the same state to the PasswordInput and to PasswordStrength.\n */\nexport const passwordStrengthVariants = tv({\n slots: {\n root: \"flex w-full flex-col gap-2\",\n meter: \"flex w-full items-center gap-1.5\",\n segment: \"h-1.5 flex-1 rounded-full bg-muted transition-colors duration-base ease-out\",\n label: \"text-sm font-medium tabular-nums text-pretty transition-colors duration-fast ease-out\",\n list: \"flex flex-col gap-1.5\",\n item: \"flex items-center gap-2 text-sm text-pretty text-muted-foreground transition-colors duration-fast ease-out data-met:text-foreground\",\n glyphs: \"relative flex size-4 shrink-0 items-center justify-center\",\n // A rule being met rolls the dot up and out as the check rises in. Transitions, not keyframes,\n // so a rule that flips back mid-roll retargets instead of restarting.\n glyph:\n \"absolute [transition:opacity_var(--duration-base)_var(--ease-out),translate_var(--duration-base)_var(--ease-drawer),filter_var(--duration-base)_var(--ease-out)] motion-reduce:transition-opacity\",\n },\n variants: {\n tone: {\n muted: { segment: \"\", label: \"text-muted-foreground\" },\n destructive: { segment: \"data-filled:bg-destructive\", label: \"text-destructive\" },\n orange: { segment: \"data-filled:bg-orange\", label: \"text-orange\" },\n warning: { segment: \"data-filled:bg-warning\", label: \"text-warning\" },\n success: { segment: \"data-filled:bg-success\", label: \"text-success\" },\n },\n },\n defaultVariants: { tone: \"muted\" },\n})\n\nconst [StrengthProvider, useStrength] = createContext<{ result: PasswordStrengthResult }>(\"PasswordStrength\")\n\nexport interface PasswordStrengthProps extends React.ComponentProps<\"div\"> {\n /** The current password; hand it the same state as the input. */\n value: string\n /** The policy, as { id, label, test }. */\n rules?: PasswordRule[]\n}\n\nexport function PasswordStrength({ value, rules = defaultPasswordRules, className, ...props }: PasswordStrengthProps) {\n const result = getPasswordStrength(value, rules)\n return (\n <StrengthProvider result={result}>\n <div\n data-slot=\"password-strength\"\n data-level={result.level}\n className={passwordStrengthVariants().root({ className })}\n {...props}\n />\n </StrengthProvider>\n )\n}\n\n/** Four segments climbing red to green, as a meter. Any number of rules maps onto the four. */\nexport function PasswordStrengthMeter({ className, ...props }: React.ComponentProps<\"div\">) {\n const { result } = useStrength(\"PasswordStrengthMeter\")\n const slots = passwordStrengthVariants({ tone: result.tone })\n return (\n <div\n role=\"meter\"\n aria-label=\"Password strength\"\n aria-valuemin={0}\n aria-valuemax={4}\n aria-valuenow={result.level}\n aria-valuetext={result.level === 0 ? \"Empty\" : result.label}\n data-slot=\"password-strength-meter\"\n className={slots.meter({ className })}\n {...props}\n >\n {[1, 2, 3, 4].map((step) => (\n <span\n key={step}\n data-slot=\"password-strength-segment\"\n data-filled={step <= result.level ? \"\" : undefined}\n className={slots.segment()}\n />\n ))}\n </div>\n )\n}\n\nexport interface PasswordStrengthLabelProps extends React.ComponentProps<\"p\"> {\n /** Shown before anything is typed. */\n placeholder?: string\n}\n\n/** The verdict in its tone, announced politely; the word rolls as it changes. */\nexport function PasswordStrengthLabel({ placeholder, className, ...props }: PasswordStrengthLabelProps) {\n const { result } = useStrength(\"PasswordStrengthLabel\")\n const text = result.level === 0 ? (placeholder ?? \"\") : result.label\n return (\n <p\n aria-live=\"polite\"\n data-slot=\"password-strength-label\"\n className={passwordStrengthVariants({ tone: result.tone }).label({ className })}\n {...props}\n >\n <AnimatedLabel swapKey={text}>{text}</AnimatedLabel>\n </p>\n )\n}\n\n/** One row per rule; a met rule's dot rolls out as its check rolls in. */\nexport function PasswordStrengthList({ className, ...props }: Omit<React.ComponentProps<\"ul\">, \"children\">) {\n const { result } = useStrength(\"PasswordStrengthList\")\n const slots = passwordStrengthVariants()\n return (\n <ul data-slot=\"password-strength-list\" className={slots.list({ className })} {...props}>\n {result.rules.map((rule) => (\n <li key={rule.id} data-slot=\"password-strength-item\" data-met={rule.met || undefined} className={slots.item()}>\n <span aria-hidden className={slots.glyphs()}>\n <Circle\n className={slots.glyph({\n className: [\n \"size-3 text-muted-foreground\",\n rule.met ? \"-translate-y-2 opacity-0 blur-[4px]\" : \"translate-y-0 opacity-100 blur-[0px]\",\n ],\n })}\n />\n <Check\n className={slots.glyph({\n className: [\n \"size-4 text-success\",\n rule.met ? \"translate-y-0 opacity-100 blur-[0px]\" : \"translate-y-2 opacity-0 blur-[4px]\",\n ],\n })}\n />\n </span>\n {rule.label}\n <span className=\"sr-only\">{rule.met ? \" (met)\" : \" (not met)\"}</span>\n </li>\n ))}\n </ul>\n )\n}\n"],"mappings":";AAuDM,cAmEI,YAnEJ;AApDN,SAAS,OAAO,cAAc;AAE9B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AAEnB,SAAS,sBAAsB,2BAA2E;AAOnG,MAAM,2BAA2B,GAAG;AAAA,EACzC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA;AAAA;AAAA,IAGR,OACE;AAAA,EACJ;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,OAAO,EAAE,SAAS,IAAI,OAAO,wBAAwB;AAAA,MACrD,aAAa,EAAE,SAAS,8BAA8B,OAAO,mBAAmB;AAAA,MAChF,QAAQ,EAAE,SAAS,yBAAyB,OAAO,c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
|
+
import {
|
|
2
|
+
Popover,
|
|
3
|
+
PopoverTrigger,
|
|
4
|
+
PopoverAnchor,
|
|
5
|
+
PopoverContent,
|
|
6
|
+
PopoverViewport,
|
|
7
|
+
PopoverTitle,
|
|
8
|
+
PopoverDescription,
|
|
9
|
+
PopoverMedia,
|
|
10
|
+
PopoverFooter,
|
|
11
|
+
PopoverClose,
|
|
12
|
+
PopoverCloseButton,
|
|
13
|
+
createPopoverHandle,
|
|
14
|
+
popoverVariants
|
|
15
|
+
} from "./popover.mjs";
|
|
16
|
+
export {
|
|
17
|
+
Popover,
|
|
18
|
+
PopoverAnchor,
|
|
19
|
+
PopoverClose,
|
|
20
|
+
PopoverCloseButton,
|
|
21
|
+
PopoverContent,
|
|
22
|
+
PopoverDescription,
|
|
23
|
+
PopoverFooter,
|
|
24
|
+
PopoverMedia,
|
|
25
|
+
PopoverTitle,
|
|
26
|
+
PopoverTrigger,
|
|
27
|
+
PopoverViewport,
|
|
28
|
+
createPopoverHandle,
|
|
29
|
+
popoverVariants
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/popover/index.ts"],"sourcesContent":["export {\n Popover,\n PopoverTrigger,\n PopoverAnchor,\n PopoverContent,\n PopoverViewport,\n PopoverTitle,\n PopoverDescription,\n PopoverMedia,\n PopoverFooter,\n PopoverClose,\n PopoverCloseButton,\n createPopoverHandle,\n popoverVariants,\n type PopoverProps,\n type PopoverTriggerProps,\n type PopoverContentProps,\n type PopoverViewportProps,\n type PopoverHandle,\n type PopoverOpenChangeDetails,\n type PopoverOpenChangeReason,\n} from \"./popover.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;","names":[]}
|