@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,202 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { X } from "atoms-icons";
|
|
5
|
+
import { hitX, hitY } from "../../../lib/hit-area.mjs";
|
|
6
|
+
import { PressPulse } from "../../../lib/pulse.mjs";
|
|
7
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
8
|
+
const tonedSelected = "data-selected:border-(--chip-tone) data-selected:[--chip-wash:0.16] data-selected:[--chip-wash-hover:0.22]";
|
|
9
|
+
const chipVariants = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: [
|
|
12
|
+
"group/chip inline-flex max-w-full shrink-0 items-center justify-center whitespace-nowrap rounded-[var(--button-radius,var(--chip-corner))] border font-medium tabular-nums",
|
|
13
|
+
hitX,
|
|
14
|
+
// The wash: a layer under the label in the chip's tone, so a tint never needs color-mix().
|
|
15
|
+
"isolate after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-[inherit] after:bg-(--chip-tone) after:opacity-(--chip-wash) after:transition-opacity after:duration-fast after:ease-out",
|
|
16
|
+
"[&:is(button,a[href],[role=button])]:cursor-pointer hover:[&:is(button,a[href],[role=button])]:after:opacity-(--chip-wash-hover)",
|
|
17
|
+
"transition-[color,background-color,border-color,box-shadow,transform] duration-fast ease-out motion-reduce-fade",
|
|
18
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface,var(--background))]",
|
|
19
|
+
"data-selected:shadow-xs data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
20
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
21
|
+
],
|
|
22
|
+
mark: "shrink-0 rounded-full bg-(--chip-color) ring-1 ring-inset ring-border",
|
|
23
|
+
icon: "inline-grid shrink-0 place-items-center first:-ms-0.5 [&>*]:min-w-0",
|
|
24
|
+
iconIdle: [
|
|
25
|
+
"col-start-1 row-start-1 flex items-center justify-center transition-[opacity,transform,filter] duration-base ease-out motion-reduce-fade",
|
|
26
|
+
"group-hover/chip:[transform:scale(0.25)] group-hover/chip:opacity-0 group-hover/chip:blur-xs",
|
|
27
|
+
"group-focus-visible/chip:[transform:scale(0.25)] group-focus-visible/chip:opacity-0 group-focus-visible/chip:blur-xs"
|
|
28
|
+
],
|
|
29
|
+
iconHover: [
|
|
30
|
+
"col-start-1 row-start-1 flex items-center justify-center transition-[opacity,transform,filter] duration-base ease-out motion-reduce-fade",
|
|
31
|
+
"[transform:scale(0.25)] opacity-0 blur-xs",
|
|
32
|
+
"group-hover/chip:[transform:none] group-hover/chip:opacity-100 group-hover/chip:blur-none",
|
|
33
|
+
"group-focus-visible/chip:[transform:none] group-focus-visible/chip:opacity-100 group-focus-visible/chip:blur-none"
|
|
34
|
+
],
|
|
35
|
+
remove: [
|
|
36
|
+
"grid shrink-0 cursor-pointer place-items-center rounded-full",
|
|
37
|
+
hitY,
|
|
38
|
+
"isolate after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-[inherit] after:bg-current after:opacity-0 after:transition-opacity after:duration-fast after:ease-out hover:after:opacity-15",
|
|
39
|
+
"[&>svg]:opacity-60 [&>svg]:transition-opacity [&>svg]:duration-fast hover:[&>svg]:opacity-100",
|
|
40
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:[&>svg]:opacity-100",
|
|
41
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
variants: {
|
|
45
|
+
variant: {
|
|
46
|
+
soft: {},
|
|
47
|
+
outline: {}
|
|
48
|
+
},
|
|
49
|
+
tone: {
|
|
50
|
+
neutral: {
|
|
51
|
+
root: [
|
|
52
|
+
"[--chip-tone:var(--foreground)] [--chip-wash:0] [--chip-wash-hover:0.06] text-foreground",
|
|
53
|
+
"data-selected:border-foreground data-selected:bg-foreground data-selected:text-background data-selected:[--chip-tone:var(--background)] data-selected:[--chip-wash:0] data-selected:[--chip-wash-hover:0.14]"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
brand: { root: [tonedSelected, "text-brand-strong dark:text-brand [--chip-tone:var(--brand)]"] },
|
|
57
|
+
info: { root: [tonedSelected, "text-info-strong [--chip-tone:var(--info)]"] },
|
|
58
|
+
success: { root: [tonedSelected, "text-success-strong [--chip-tone:var(--success)]"] },
|
|
59
|
+
warning: { root: [tonedSelected, "text-warning-strong [--chip-tone:var(--warning)]"] },
|
|
60
|
+
destructive: { root: [tonedSelected, "text-destructive-strong [--chip-tone:var(--destructive)]"] },
|
|
61
|
+
// Set by `color`: the label stays in the foreground ink, the hue goes to edge, wash and mark.
|
|
62
|
+
custom: { root: [tonedSelected, "text-foreground [--chip-tone:var(--chip-color)]"] }
|
|
63
|
+
},
|
|
64
|
+
size: {
|
|
65
|
+
xs: {
|
|
66
|
+
root: "h-5 [--chip-corner:calc(var(--radius)*0.375)] gap-1 px-1.5 text-xs [&_svg:not([class*='size-'])]:size-3 [&>[data-slot=chip-remove]]:-me-1 [&>[data-slot=chip-remove]]:size-4",
|
|
67
|
+
mark: "size-1.5"
|
|
68
|
+
},
|
|
69
|
+
sm: {
|
|
70
|
+
root: "h-6 [--chip-corner:var(--radius-sm)] gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 [&>[data-slot=chip-remove]]:-me-1.5 [&>[data-slot=chip-remove]]:size-5 [&>[data-slot=chip-remove]>svg:not([class*='size-'])]:size-3",
|
|
71
|
+
mark: "size-2"
|
|
72
|
+
},
|
|
73
|
+
md: {
|
|
74
|
+
root: "h-control-sm [--chip-corner:var(--radius-md)] gap-1.5 px-3 text-sm [&_svg:not([class*='size-'])]:size-4 [&>[data-slot=chip-remove]]:-me-2 [&>[data-slot=chip-remove]]:size-6 [&>[data-slot=chip-remove]>svg:not([class*='size-'])]:size-3.5",
|
|
75
|
+
mark: "size-2"
|
|
76
|
+
},
|
|
77
|
+
lg: {
|
|
78
|
+
root: "h-control-lg [--chip-corner:var(--radius-lg)] gap-2 px-4 text-sm [&_svg:not([class*='size-'])]:size-4 [&>[data-slot=chip-remove]]:-me-2.5 [&>[data-slot=chip-remove]]:size-7 [&>[data-slot=chip-remove]>svg:not([class*='size-'])]:size-4",
|
|
79
|
+
mark: "size-2.5"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
static: {
|
|
83
|
+
true: { root: "active:[&:is(button,a[href],[role=button])]:[transform:none]" },
|
|
84
|
+
false: {}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
compoundVariants: [
|
|
88
|
+
// Neutral: the muted ground, or only the input edge.
|
|
89
|
+
{ tone: "neutral", variant: "soft", class: { root: "border-transparent bg-muted" } },
|
|
90
|
+
{ tone: "neutral", variant: "outline", class: { root: "border-input bg-transparent" } },
|
|
91
|
+
// A tone or a colour: the tone's wash, or its edge at 40% (35% for an arbitrary colour).
|
|
92
|
+
{
|
|
93
|
+
tone: ["brand", "info", "success", "warning", "destructive", "custom"],
|
|
94
|
+
variant: "soft",
|
|
95
|
+
class: { root: "border-transparent [--chip-wash:0.1] [--chip-wash-hover:0.16]" }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
tone: ["brand", "info", "success", "warning", "destructive"],
|
|
99
|
+
variant: "outline",
|
|
100
|
+
class: { root: "[--chip-wash:0] bg-transparent border-(--chip-tone)/40 [--chip-wash-hover:0.08]" }
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
tone: "custom",
|
|
104
|
+
variant: "outline",
|
|
105
|
+
class: { root: "[--chip-wash:0] bg-transparent border-(--chip-color)/35 [--chip-wash-hover:0.08]" }
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
defaultVariants: {
|
|
109
|
+
variant: "soft",
|
|
110
|
+
tone: "neutral",
|
|
111
|
+
size: "sm",
|
|
112
|
+
static: false
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
function Chip({
|
|
116
|
+
className,
|
|
117
|
+
variant,
|
|
118
|
+
tone,
|
|
119
|
+
size,
|
|
120
|
+
color,
|
|
121
|
+
selected,
|
|
122
|
+
static: isStatic,
|
|
123
|
+
asChild = false,
|
|
124
|
+
disabled,
|
|
125
|
+
type,
|
|
126
|
+
style,
|
|
127
|
+
children,
|
|
128
|
+
...props
|
|
129
|
+
}) {
|
|
130
|
+
const slots = chipVariants({
|
|
131
|
+
variant,
|
|
132
|
+
tone: color ? "custom" : tone,
|
|
133
|
+
size,
|
|
134
|
+
static: isStatic
|
|
135
|
+
});
|
|
136
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
137
|
+
const toggles = selected !== void 0 && !asChild;
|
|
138
|
+
return /* @__PURE__ */ jsxs(
|
|
139
|
+
Comp,
|
|
140
|
+
{
|
|
141
|
+
"data-slot": "chip",
|
|
142
|
+
"data-size": size ?? "sm",
|
|
143
|
+
"data-selected": selected || void 0,
|
|
144
|
+
"data-disabled": disabled || void 0,
|
|
145
|
+
type: asChild ? void 0 : type ?? "button",
|
|
146
|
+
"aria-pressed": toggles ? selected : void 0,
|
|
147
|
+
disabled: asChild ? void 0 : disabled,
|
|
148
|
+
"aria-disabled": asChild && disabled ? true : void 0,
|
|
149
|
+
className: slots.root({ className }),
|
|
150
|
+
style: color ? { "--chip-color": color, ...style } : style,
|
|
151
|
+
...props,
|
|
152
|
+
children: [
|
|
153
|
+
color ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", "data-slot": "chip-mark", className: slots.mark() }) : null,
|
|
154
|
+
asChild ? /* @__PURE__ */ jsx(Slot.Slottable, { children }) : children,
|
|
155
|
+
toggles ? /* @__PURE__ */ jsx(PressPulse, { slot: "chip-pulse" }) : null
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
const trailing = "[&:not(:has(~:not([data-pulse])))]:-me-0.5";
|
|
161
|
+
const revealClasses = [
|
|
162
|
+
"grid-cols-[0fr] overflow-hidden -ms-1 [&:not(:has(~:not([data-pulse])))]:me-0 opacity-0",
|
|
163
|
+
"group-data-selected/chip:grid-cols-[1fr] group-data-selected/chip:ms-0 group-data-selected/chip:[&:not(:has(~:not([data-pulse])))]:-me-0.5 group-data-selected/chip:opacity-100",
|
|
164
|
+
"transition-[grid-template-columns,margin,opacity] duration-base ease-out motion-reduce:transition-opacity"
|
|
165
|
+
].join(" ");
|
|
166
|
+
function ChipIcon({ className, idle, hover, reveal, children, ...props }) {
|
|
167
|
+
const slots = chipVariants();
|
|
168
|
+
const swaps = idle !== void 0 || hover !== void 0;
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
"span",
|
|
171
|
+
{
|
|
172
|
+
"data-slot": "chip-icon",
|
|
173
|
+
"aria-hidden": "true",
|
|
174
|
+
className: slots.icon({ className: [reveal ? revealClasses : trailing, className] }),
|
|
175
|
+
...props,
|
|
176
|
+
children: swaps ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
177
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "chip-icon-idle", className: slots.iconIdle(), children: idle }),
|
|
178
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "chip-icon-hover", className: slots.iconHover(), children: hover })
|
|
179
|
+
] }) : children
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function ChipRemove({ className, label = "Remove", type, children, ...props }) {
|
|
184
|
+
return /* @__PURE__ */ jsx(
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
"data-slot": "chip-remove",
|
|
188
|
+
type: type ?? "button",
|
|
189
|
+
"aria-label": label,
|
|
190
|
+
className: chipVariants().remove({ className }),
|
|
191
|
+
...props,
|
|
192
|
+
children: children ?? /* @__PURE__ */ jsx(X, {})
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
export {
|
|
197
|
+
Chip,
|
|
198
|
+
ChipIcon,
|
|
199
|
+
ChipRemove,
|
|
200
|
+
chipVariants
|
|
201
|
+
};
|
|
202
|
+
//# sourceMappingURL=chip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/chip/chip.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Slot } from \"radix-ui\"\nimport { X } from \"atoms-icons\"\n\nimport { hitX, hitY } from \"../../../lib/hit-area.mjs\"\nimport { PressPulse } from \"../../../lib/pulse.mjs\"\nimport { tv, type VariantProps } from \"../../../lib/tv.mjs\"\n\n// What a selected toned or coloured chip does: its own hue at full on the edge and a deeper wash.\nconst tonedSelected =\n \"data-selected:border-(--chip-tone) data-selected:[--chip-wash:0.16] data-selected:[--chip-wash-hover:0.22]\"\n\nexport const chipVariants = tv({\n slots: {\n root: [\n \"group/chip inline-flex max-w-full shrink-0 items-center justify-center whitespace-nowrap rounded-[var(--button-radius,var(--chip-corner))] border font-medium tabular-nums\",\n hitX,\n // The wash: a layer under the label in the chip's tone, so a tint never needs color-mix().\n \"isolate after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-[inherit] after:bg-(--chip-tone) after:opacity-(--chip-wash) after:transition-opacity after:duration-fast after:ease-out\",\n \"[&:is(button,a[href],[role=button])]:cursor-pointer hover:[&:is(button,a[href],[role=button])]:after:opacity-(--chip-wash-hover)\",\n \"transition-[color,background-color,border-color,box-shadow,transform] duration-fast ease-out motion-reduce-fade\",\n \"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface,var(--background))]\",\n \"data-selected:shadow-xs data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n ],\n mark: \"shrink-0 rounded-full bg-(--chip-color) ring-1 ring-inset ring-border\",\n icon: \"inline-grid shrink-0 place-items-center first:-ms-0.5 [&>*]:min-w-0\",\n iconIdle: [\n \"col-start-1 row-start-1 flex items-center justify-center transition-[opacity,transform,filter] duration-base ease-out motion-reduce-fade\",\n \"group-hover/chip:[transform:scale(0.25)] group-hover/chip:opacity-0 group-hover/chip:blur-xs\",\n \"group-focus-visible/chip:[transform:scale(0.25)] group-focus-visible/chip:opacity-0 group-focus-visible/chip:blur-xs\",\n ],\n iconHover: [\n \"col-start-1 row-start-1 flex items-center justify-center transition-[opacity,transform,filter] duration-base ease-out motion-reduce-fade\",\n \"[transform:scale(0.25)] opacity-0 blur-xs\",\n \"group-hover/chip:[transform:none] group-hover/chip:opacity-100 group-hover/chip:blur-none\",\n \"group-focus-visible/chip:[transform:none] group-focus-visible/chip:opacity-100 group-focus-visible/chip:blur-none\",\n ],\n remove: [\n \"grid shrink-0 cursor-pointer place-items-center rounded-full\",\n hitY,\n \"isolate after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-[inherit] after:bg-current after:opacity-0 after:transition-opacity after:duration-fast after:ease-out hover:after:opacity-15\",\n \"[&>svg]:opacity-60 [&>svg]:transition-opacity [&>svg]:duration-fast hover:[&>svg]:opacity-100\",\n \"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:[&>svg]:opacity-100\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n ],\n },\n variants: {\n variant: {\n soft: {},\n outline: {},\n },\n tone: {\n neutral: {\n root: [\n \"[--chip-tone:var(--foreground)] [--chip-wash:0] [--chip-wash-hover:0.06] text-foreground\",\n \"data-selected:border-foreground data-selected:bg-foreground data-selected:text-background data-selected:[--chip-tone:var(--background)] data-selected:[--chip-wash:0] data-selected:[--chip-wash-hover:0.14]\",\n ],\n },\n brand: { root: [tonedSelected, \"text-brand-strong dark:text-brand [--chip-tone:var(--brand)]\"] },\n info: { root: [tonedSelected, \"text-info-strong [--chip-tone:var(--info)]\"] },\n success: { root: [tonedSelected, \"text-success-strong [--chip-tone:var(--success)]\"] },\n warning: { root: [tonedSelected, \"text-warning-strong [--chip-tone:var(--warning)]\"] },\n destructive: { root: [tonedSelected, \"text-destructive-strong [--chip-tone:var(--destructive)]\"] },\n // Set by `color`: the label stays in the foreground ink, the hue goes to edge, wash and mark.\n custom: { root: [tonedSelected, \"text-foreground [--chip-tone:var(--chip-color)]\"] },\n },\n size: {\n xs: {\n root: \"h-5 [--chip-corner:calc(var(--radius)*0.375)] gap-1 px-1.5 text-xs [&_svg:not([class*='size-'])]:size-3 [&>[data-slot=chip-remove]]:-me-1 [&>[data-slot=chip-remove]]:size-4\",\n mark: \"size-1.5\",\n },\n sm: {\n root: \"h-6 [--chip-corner:var(--radius-sm)] gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 [&>[data-slot=chip-remove]]:-me-1.5 [&>[data-slot=chip-remove]]:size-5 [&>[data-slot=chip-remove]>svg:not([class*='size-'])]:size-3\",\n mark: \"size-2\",\n },\n md: {\n root: \"h-control-sm [--chip-corner:var(--radius-md)] gap-1.5 px-3 text-sm [&_svg:not([class*='size-'])]:size-4 [&>[data-slot=chip-remove]]:-me-2 [&>[data-slot=chip-remove]]:size-6 [&>[data-slot=chip-remove]>svg:not([class*='size-'])]:size-3.5\",\n mark: \"size-2\",\n },\n lg: {\n root: \"h-control-lg [--chip-corner:var(--radius-lg)] gap-2 px-4 text-sm [&_svg:not([class*='size-'])]:size-4 [&>[data-slot=chip-remove]]:-me-2.5 [&>[data-slot=chip-remove]]:size-7 [&>[data-slot=chip-remove]>svg:not([class*='size-'])]:size-4\",\n mark: \"size-2.5\",\n },\n },\n static: {\n true: { root: \"active:[&:is(button,a[href],[role=button])]:[transform:none]\" },\n false: {},\n },\n },\n compoundVariants: [\n // Neutral: the muted ground, or only the input edge.\n { tone: \"neutral\", variant: \"soft\", class: { root: \"border-transparent bg-muted\" } },\n { tone: \"neutral\", variant: \"outline\", class: { root: \"border-input bg-transparent\" } },\n // A tone or a colour: the tone's wash, or its edge at 40% (35% for an arbitrary colour).\n {\n tone: [\"brand\", \"info\", \"success\", \"warning\", \"destructive\", \"custom\"],\n variant: \"soft\",\n class: { root: \"border-transparent [--chip-wash:0.1] [--chip-wash-hover:0.16]\" },\n },\n {\n tone: [\"brand\", \"info\", \"success\", \"warning\", \"destructive\"],\n variant: \"outline\",\n class: { root: \"[--chip-wash:0] bg-transparent border-(--chip-tone)/40 [--chip-wash-hover:0.08]\" },\n },\n {\n tone: \"custom\",\n variant: \"outline\",\n class: { root: \"[--chip-wash:0] bg-transparent border-(--chip-color)/35 [--chip-wash-hover:0.08]\" },\n },\n ],\n defaultVariants: {\n variant: \"soft\",\n tone: \"neutral\",\n size: \"sm\",\n static: false,\n },\n})\n\ntype ChipTone = Exclude<NonNullable<VariantProps<typeof chipVariants>[\"tone\"]>, \"custom\">\ntype ChipSize = NonNullable<VariantProps<typeof chipVariants>[\"size\"]>\n\n/* ─── Chip ──────────────────────────────────────────────────────────────── */\n\nexport interface ChipProps extends React.ComponentProps<\"button\"> {\n /** `soft` fills the pill; `outline` keeps only the edge. */\n variant?: \"soft\" | \"outline\"\n /** The hue of the label, edge and wash. */\n tone?: ChipTone\n /** 20, 24, 32 or 40px tall. The hit area reaches 40px either way. */\n size?: ChipSize\n /** Any CSS colour: tints the edge and ground and adds a leading mark. Takes over the tone. */\n color?: string\n /** Chosen. Sets `aria-pressed` on the default button. Leave unset on a chip that isn't a toggle. */\n selected?: boolean\n /** Kept for compatibility; controls don't scale on press. */\n static?: boolean\n /** Renders the child element as the chip: a link, a `<span>` tag, a drag handle. */\n asChild?: boolean\n}\n\nexport function Chip({\n className,\n variant,\n tone,\n size,\n color,\n selected,\n static: isStatic,\n asChild = false,\n disabled,\n type,\n style,\n children,\n ...props\n}: ChipProps) {\n const slots = chipVariants({\n variant,\n tone: color ? \"custom\" : tone,\n size,\n static: isStatic,\n })\n const Comp = asChild ? Slot.Root : \"button\"\n const toggles = selected !== undefined && !asChild\n\n return (\n <Comp\n data-slot=\"chip\"\n data-size={size ?? \"sm\"}\n data-selected={selected || undefined}\n data-disabled={disabled || undefined}\n type={asChild ? undefined : (type ?? \"button\")}\n aria-pressed={toggles ? selected : undefined}\n disabled={asChild ? undefined : disabled}\n aria-disabled={asChild && disabled ? true : undefined}\n className={slots.root({ className })}\n style={color ? ({ \"--chip-color\": color, ...style } as React.CSSProperties) : style}\n {...props}\n >\n {color ? <span aria-hidden=\"true\" data-slot=\"chip-mark\" className={slots.mark()} /> : null}\n {asChild ? <Slot.Slottable>{children}</Slot.Slottable> : children}\n {toggles ? <PressPulse slot=\"chip-pulse\" /> : null}\n </Comp>\n )\n}\n\n/* ─── ChipIcon ──────────────────────────────────────────────────────────── */\n\nexport interface ChipIconProps extends React.ComponentProps<\"span\"> {\n /** The glyph at rest, when the icon swaps on hover. */\n idle?: React.ReactNode\n /** The glyph on the chip's hover or keyboard focus. Both stay mounted and cross-fade. */\n hover?: React.ReactNode\n /** Keeps a trailing icon collapsed until the chip is selected, then opens and fades it in. */\n reveal?: \"selected\"\n}\n\n// The end margin applies when the icon is the last real child (a pulse anchor doesn't count).\nconst trailing = \"[&:not(:has(~:not([data-pulse])))]:-me-0.5\"\nconst revealClasses = [\n \"grid-cols-[0fr] overflow-hidden -ms-1 [&:not(:has(~:not([data-pulse])))]:me-0 opacity-0\",\n \"group-data-selected/chip:grid-cols-[1fr] group-data-selected/chip:ms-0 group-data-selected/chip:[&:not(:has(~:not([data-pulse])))]:-me-0.5 group-data-selected/chip:opacity-100\",\n \"transition-[grid-template-columns,margin,opacity] duration-base ease-out motion-reduce:transition-opacity\",\n].join(\" \")\n\n/** A decorative glyph before or after the label, or one that swaps on hover. */\nexport function ChipIcon({ className, idle, hover, reveal, children, ...props }: ChipIconProps) {\n const slots = chipVariants()\n const swaps = idle !== undefined || hover !== undefined\n return (\n <span\n data-slot=\"chip-icon\"\n aria-hidden=\"true\"\n className={slots.icon({ className: [reveal ? revealClasses : trailing, className] })}\n {...props}\n >\n {swaps ? (\n <>\n <span data-slot=\"chip-icon-idle\" className={slots.iconIdle()}>\n {idle}\n </span>\n <span data-slot=\"chip-icon-hover\" className={slots.iconHover()}>\n {hover}\n </span>\n </>\n ) : (\n children\n )}\n </span>\n )\n}\n\n/* ─── ChipRemove ────────────────────────────────────────────────────────── */\n\nexport interface ChipRemoveProps extends React.ComponentProps<\"button\"> {\n /** The accessible name: say what goes (\"Remove Design\"). */\n label?: string\n}\n\n/** A round × button, last in a chip that isn't a button itself. */\nexport function ChipRemove({ className, label = \"Remove\", type, children, ...props }: ChipRemoveProps) {\n return (\n <button\n data-slot=\"chip-remove\"\n type={type ?? \"button\"}\n aria-label={label}\n className={chipVariants().remove({ className })}\n {...props}\n >\n {children ?? <X />}\n </button>\n )\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/chip/index.ts"],"sourcesContent":["export {\n Chip,\n ChipIcon,\n ChipRemove,\n chipVariants,\n type ChipProps,\n type ChipIconProps,\n type ChipRemoveProps,\n} from \"./chip.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;","names":[]}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
5
|
+
import { CheckCircle } from "atoms-icons";
|
|
6
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
7
|
+
import { Chip } from "../chip/index.mjs";
|
|
8
|
+
const chipGroupVariants = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "flex items-center gap-1.5",
|
|
11
|
+
// Chips in a group are one size: 28px tall, 14px text, a 40px hit area.
|
|
12
|
+
item: "h-7 px-2.5 text-sm [&_svg:not([class*='size-'])]:size-4",
|
|
13
|
+
check: [
|
|
14
|
+
"inline-grid shrink-0 place-items-center [&>*]:min-w-0",
|
|
15
|
+
"grid-cols-[0fr] overflow-hidden -ms-1 [&:not(:has(~:not([data-pulse])))]:me-0 opacity-0",
|
|
16
|
+
"group-data-selected/chip:grid-cols-[1fr] group-data-selected/chip:ms-0 group-data-selected/chip:[&:not(:has(~:not([data-pulse])))]:-me-0.5 group-data-selected/chip:opacity-100",
|
|
17
|
+
"transition-[grid-template-columns,margin,opacity] ease-out motion-reduce:transition-opacity",
|
|
18
|
+
"last:-me-1 first:ms-0 duration-fast group-data-selected/chip:last:me-0 group-data-selected/chip:first:-ms-0.5 group-data-selected/chip:duration-base"
|
|
19
|
+
],
|
|
20
|
+
checkGlyph: [
|
|
21
|
+
"flex [transform:scale(0.25)] opacity-0 blur-xs transition-[opacity,transform,filter] duration-fast ease-out",
|
|
22
|
+
"group-data-selected/chip:[transform:none] group-data-selected/chip:opacity-100 group-data-selected/chip:blur-none group-data-selected/chip:duration-base",
|
|
23
|
+
"motion-reduce:[transform:none] motion-reduce:blur-none motion-reduce:transition-opacity"
|
|
24
|
+
],
|
|
25
|
+
icon: "inline-grid shrink-0 place-items-center first:-ms-0.5",
|
|
26
|
+
iconIdle: [
|
|
27
|
+
"col-start-1 row-start-1 flex transition-[opacity,transform,filter] duration-base ease-out motion-reduce:[transform:none] motion-reduce:blur-none motion-reduce:transition-opacity",
|
|
28
|
+
"text-muted-foreground group-data-selected/chip:text-current group-data-selected/chip:[transform:scale(0.25)] group-data-selected/chip:opacity-0 group-data-selected/chip:blur-xs"
|
|
29
|
+
],
|
|
30
|
+
iconCheck: [
|
|
31
|
+
"col-start-1 row-start-1 flex transition-[opacity,transform,filter] duration-base ease-out motion-reduce:[transform:none] motion-reduce:blur-none motion-reduce:transition-opacity",
|
|
32
|
+
"[transform:scale(0.25)] opacity-0 blur-xs group-data-selected/chip:[transform:none] group-data-selected/chip:opacity-100 group-data-selected/chip:blur-none"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
variants: {
|
|
36
|
+
wrap: {
|
|
37
|
+
true: { root: "flex-wrap" },
|
|
38
|
+
false: { root: "flex-nowrap overflow-x-auto" }
|
|
39
|
+
},
|
|
40
|
+
orientation: {
|
|
41
|
+
horizontal: {},
|
|
42
|
+
vertical: { root: "flex-col items-start" }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
wrap: true,
|
|
47
|
+
orientation: "horizontal"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const ChipGroupContext = React.createContext(null);
|
|
51
|
+
ChipGroupContext.displayName = "ChipGroupContext";
|
|
52
|
+
function ChipGroup(props) {
|
|
53
|
+
const {
|
|
54
|
+
className,
|
|
55
|
+
variant,
|
|
56
|
+
tone,
|
|
57
|
+
indicator = "none",
|
|
58
|
+
wrap,
|
|
59
|
+
orientation = "horizontal",
|
|
60
|
+
loop = true,
|
|
61
|
+
disabled,
|
|
62
|
+
children,
|
|
63
|
+
...rest
|
|
64
|
+
} = props;
|
|
65
|
+
const slots = chipGroupVariants({ wrap, orientation });
|
|
66
|
+
if (rest.type === "multiple") {
|
|
67
|
+
const { type: type2, value: valueProp2, defaultValue: defaultValue2 = [], onValueChange: onValueChange2, ...div2 } = rest;
|
|
68
|
+
void type2;
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
MultipleRoot,
|
|
71
|
+
{
|
|
72
|
+
valueProp: valueProp2,
|
|
73
|
+
defaultValue: defaultValue2,
|
|
74
|
+
onValueChange: onValueChange2,
|
|
75
|
+
context: { variant, tone, indicator },
|
|
76
|
+
className: slots.root({ className }),
|
|
77
|
+
orientation,
|
|
78
|
+
loop,
|
|
79
|
+
disabled,
|
|
80
|
+
div: div2,
|
|
81
|
+
children
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const { type, value: valueProp, defaultValue = "", onValueChange, allowEmpty = false, ...div } = rest;
|
|
86
|
+
void type;
|
|
87
|
+
return /* @__PURE__ */ jsx(
|
|
88
|
+
SingleRoot,
|
|
89
|
+
{
|
|
90
|
+
valueProp,
|
|
91
|
+
defaultValue,
|
|
92
|
+
onValueChange,
|
|
93
|
+
allowEmpty,
|
|
94
|
+
context: { variant, tone, indicator },
|
|
95
|
+
className: slots.root({ className }),
|
|
96
|
+
orientation,
|
|
97
|
+
loop,
|
|
98
|
+
disabled,
|
|
99
|
+
div,
|
|
100
|
+
children
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function SingleRoot({
|
|
105
|
+
valueProp,
|
|
106
|
+
defaultValue,
|
|
107
|
+
onValueChange,
|
|
108
|
+
allowEmpty,
|
|
109
|
+
context,
|
|
110
|
+
div,
|
|
111
|
+
children,
|
|
112
|
+
...root
|
|
113
|
+
}) {
|
|
114
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultValue);
|
|
115
|
+
const value = valueProp ?? uncontrolled;
|
|
116
|
+
const list = React.useMemo(() => value ? [value] : [], [value]);
|
|
117
|
+
const ctx = React.useMemo(() => ({ ...context, value: list }), [context, list]);
|
|
118
|
+
return /* @__PURE__ */ jsx(ChipGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
119
|
+
ToggleGroupPrimitive.Root,
|
|
120
|
+
{
|
|
121
|
+
type: "single",
|
|
122
|
+
"data-slot": "chip-group",
|
|
123
|
+
value,
|
|
124
|
+
onValueChange: (next) => {
|
|
125
|
+
if (!next && !allowEmpty) return;
|
|
126
|
+
if (valueProp === void 0) setUncontrolled(next);
|
|
127
|
+
onValueChange?.(next);
|
|
128
|
+
},
|
|
129
|
+
...root,
|
|
130
|
+
...div,
|
|
131
|
+
children
|
|
132
|
+
}
|
|
133
|
+
) });
|
|
134
|
+
}
|
|
135
|
+
function MultipleRoot({
|
|
136
|
+
valueProp,
|
|
137
|
+
defaultValue,
|
|
138
|
+
onValueChange,
|
|
139
|
+
context,
|
|
140
|
+
div,
|
|
141
|
+
children,
|
|
142
|
+
...root
|
|
143
|
+
}) {
|
|
144
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultValue);
|
|
145
|
+
const value = valueProp ?? uncontrolled;
|
|
146
|
+
const ctx = React.useMemo(() => ({ ...context, value }), [context, value]);
|
|
147
|
+
return /* @__PURE__ */ jsx(ChipGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
148
|
+
ToggleGroupPrimitive.Root,
|
|
149
|
+
{
|
|
150
|
+
type: "multiple",
|
|
151
|
+
"data-slot": "chip-group",
|
|
152
|
+
value,
|
|
153
|
+
onValueChange: (next) => {
|
|
154
|
+
if (valueProp === void 0) setUncontrolled(next);
|
|
155
|
+
onValueChange?.(next);
|
|
156
|
+
},
|
|
157
|
+
...root,
|
|
158
|
+
...div,
|
|
159
|
+
children
|
|
160
|
+
}
|
|
161
|
+
) });
|
|
162
|
+
}
|
|
163
|
+
function ChipGroupItem({
|
|
164
|
+
className,
|
|
165
|
+
value,
|
|
166
|
+
icon,
|
|
167
|
+
indicator,
|
|
168
|
+
variant,
|
|
169
|
+
tone,
|
|
170
|
+
disabled,
|
|
171
|
+
children,
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
const group = React.useContext(ChipGroupContext);
|
|
175
|
+
const slots = chipGroupVariants();
|
|
176
|
+
const selected = group?.value.includes(value) ?? false;
|
|
177
|
+
const showsCheck = (indicator ?? group?.indicator ?? "none") === "check";
|
|
178
|
+
return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Item, { value, disabled, asChild: true, children: /* @__PURE__ */ jsxs(
|
|
179
|
+
Chip,
|
|
180
|
+
{
|
|
181
|
+
"data-slot": "chip-group-item",
|
|
182
|
+
size: "sm",
|
|
183
|
+
variant: variant ?? group?.variant,
|
|
184
|
+
tone: tone ?? group?.tone,
|
|
185
|
+
selected,
|
|
186
|
+
disabled,
|
|
187
|
+
className: slots.item({ className }),
|
|
188
|
+
...props,
|
|
189
|
+
children: [
|
|
190
|
+
icon ? /* @__PURE__ */ jsx("span", { "data-slot": "chip-group-icon", className: slots.icon(), children: showsCheck ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
191
|
+
/* @__PURE__ */ jsx("span", { className: slots.iconIdle(), children: icon }),
|
|
192
|
+
/* @__PURE__ */ jsx("span", { className: slots.iconCheck(), children: /* @__PURE__ */ jsx(CheckCircle, {}) })
|
|
193
|
+
] }) : icon }) : showsCheck ? /* @__PURE__ */ jsx("span", { "data-slot": "chip-group-check", className: slots.check(), children: /* @__PURE__ */ jsx("span", { className: slots.checkGlyph(), children: /* @__PURE__ */ jsx(CheckCircle, {}) }) }) : null,
|
|
194
|
+
children
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
) });
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
ChipGroup,
|
|
201
|
+
ChipGroupItem,
|
|
202
|
+
chipGroupVariants
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=chip-group.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/chip-group/chip-group.tsx"],"sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ToggleGroup as ToggleGroupPrimitive } from \"radix-ui\"\r\nimport { CheckCircle } from \"atoms-icons\"\r\n\r\nimport { tv } from \"../../../lib/tv.mjs\"\r\nimport { Chip, type ChipProps } from \"../chip/index.mjs\"\r\n\r\nexport const chipGroupVariants = tv({\r\n slots: {\r\n root: \"flex items-center gap-1.5\",\r\n // Chips in a group are one size: 28px tall, 14px text, a 40px hit area.\r\n item: \"h-7 px-2.5 text-sm [&_svg:not([class*='size-'])]:size-4\",\r\n check: [\r\n \"inline-grid shrink-0 place-items-center [&>*]:min-w-0\",\r\n \"grid-cols-[0fr] overflow-hidden -ms-1 [&:not(:has(~:not([data-pulse])))]:me-0 opacity-0\",\r\n \"group-data-selected/chip:grid-cols-[1fr] group-data-selected/chip:ms-0 group-data-selected/chip:[&:not(:has(~:not([data-pulse])))]:-me-0.5 group-data-selected/chip:opacity-100\",\r\n \"transition-[grid-template-columns,margin,opacity] ease-out motion-reduce:transition-opacity\",\r\n \"last:-me-1 first:ms-0 duration-fast group-data-selected/chip:last:me-0 group-data-selected/chip:first:-ms-0.5 group-data-selected/chip:duration-base\",\r\n ],\r\n checkGlyph: [\r\n \"flex [transform:scale(0.25)] opacity-0 blur-xs transition-[opacity,transform,filter] duration-fast ease-out\",\r\n \"group-data-selected/chip:[transform:none] group-data-selected/chip:opacity-100 group-data-selected/chip:blur-none group-data-selected/chip:duration-base\",\r\n \"motion-reduce:[transform:none] motion-reduce:blur-none motion-reduce:transition-opacity\",\r\n ],\r\n icon: \"inline-grid shrink-0 place-items-center first:-ms-0.5\",\r\n iconIdle: [\r\n \"col-start-1 row-start-1 flex transition-[opacity,transform,filter] duration-base ease-out motion-reduce:[transform:none] motion-reduce:blur-none motion-reduce:transition-opacity\",\r\n \"text-muted-foreground group-data-selected/chip:text-current group-data-selected/chip:[transform:scale(0.25)] group-data-selected/chip:opacity-0 group-data-selected/chip:blur-xs\",\r\n ],\r\n iconCheck: [\r\n \"col-start-1 row-start-1 flex transition-[opacity,transform,filter] duration-base ease-out motion-reduce:[transform:none] motion-reduce:blur-none motion-reduce:transition-opacity\",\r\n \"[transform:scale(0.25)] opacity-0 blur-xs group-data-selected/chip:[transform:none] group-data-selected/chip:opacity-100 group-data-selected/chip:blur-none\",\r\n ],\r\n },\r\n variants: {\r\n wrap: {\r\n true: { root: \"flex-wrap\" },\r\n false: { root: \"flex-nowrap overflow-x-auto\" },\r\n },\r\n orientation: {\r\n horizontal: {},\r\n vertical: { root: \"flex-col items-start\" },\r\n },\r\n },\r\n defaultVariants: {\r\n wrap: true,\r\n orientation: \"horizontal\",\r\n },\r\n})\r\n\r\ntype Indicator = \"none\" | \"check\"\r\n\r\ninterface ChipGroupContextValue {\r\n value: string[]\r\n variant: ChipProps[\"variant\"]\r\n tone: ChipProps[\"tone\"]\r\n indicator: Indicator\r\n}\r\n\r\nconst ChipGroupContext = React.createContext<ChipGroupContextValue | null>(null)\r\nChipGroupContext.displayName = \"ChipGroupContext\"\r\n\r\n/* ─── ChipGroup ─────────────────────────────────────────────────────────── */\r\n\r\ninterface ChipGroupBaseProps\r\n extends Omit<React.ComponentProps<\"div\">, \"defaultValue\" | \"dir\" | \"onChange\"> {\r\n /** Passed to every item. */\r\n variant?: ChipProps[\"variant\"]\r\n /** Passed to every item. Neutral picks in ink, never brand. */\r\n tone?: ChipProps[\"tone\"]\r\n /** `check` opens a filled check in front of every picked chip. */\r\n indicator?: Indicator\r\n /** Chips flow onto new lines; `false` holds one row. */\r\n wrap?: boolean\r\n /** Which arrows move. */\r\n orientation?: \"horizontal\" | \"vertical\"\r\n /** The arrows wrap at the ends. */\r\n loop?: boolean\r\n /** Disables every chip. */\r\n disabled?: boolean\r\n}\r\n\r\nexport interface ChipGroupSingleProps extends ChipGroupBaseProps {\r\n type?: \"single\"\r\n value?: string\r\n defaultValue?: string\r\n onValueChange?: (value: string) => void\r\n /** Pressing the picked chip clears it. Off, one chip always stays picked. */\r\n allowEmpty?: boolean\r\n}\r\n\r\nexport interface ChipGroupMultipleProps extends ChipGroupBaseProps {\r\n type: \"multiple\"\r\n value?: string[]\r\n defaultValue?: string[]\r\n onValueChange?: (value: string[]) => void\r\n allowEmpty?: never\r\n}\r\n\r\nexport type ChipGroupProps = ChipGroupSingleProps | ChipGroupMultipleProps\r\n\r\nexport function ChipGroup(props: ChipGroupProps) {\r\n const {\r\n className,\r\n variant,\r\n tone,\r\n indicator = \"none\",\r\n wrap,\r\n orientation = \"horizontal\",\r\n loop = true,\r\n disabled,\r\n children,\r\n ...rest\r\n } = props\r\n const slots = chipGroupVariants({ wrap, orientation })\r\n\r\n if (rest.type === \"multiple\") {\r\n const { type, value: valueProp, defaultValue = [], onValueChange, ...div } = rest\r\n void type\r\n return (\r\n <MultipleRoot\r\n valueProp={valueProp}\r\n defaultValue={defaultValue}\r\n onValueChange={onValueChange}\r\n context={{ variant, tone, indicator }}\r\n className={slots.root({ className })}\r\n orientation={orientation}\r\n loop={loop}\r\n disabled={disabled}\r\n div={div}\r\n >\r\n {children}\r\n </MultipleRoot>\r\n )\r\n }\r\n\r\n const { type, value: valueProp, defaultValue = \"\", onValueChange, allowEmpty = false, ...div } = rest\r\n void type\r\n return (\r\n <SingleRoot\r\n valueProp={valueProp}\r\n defaultValue={defaultValue}\r\n onValueChange={onValueChange}\r\n allowEmpty={allowEmpty}\r\n context={{ variant, tone, indicator }}\r\n className={slots.root({ className })}\r\n orientation={orientation}\r\n loop={loop}\r\n disabled={disabled}\r\n div={div}\r\n >\r\n {children}\r\n </SingleRoot>\r\n )\r\n}\r\n\r\ninterface RootShared {\r\n context: Omit<ChipGroupContextValue, \"value\">\r\n className: string\r\n orientation: \"horizontal\" | \"vertical\"\r\n loop: boolean\r\n disabled?: boolean\r\n div: Omit<React.ComponentProps<\"div\">, \"defaultValue\" | \"dir\" | \"onChange\">\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction SingleRoot({\r\n valueProp,\r\n defaultValue,\r\n onValueChange,\r\n allowEmpty,\r\n context,\r\n div,\r\n children,\r\n ...root\r\n}: RootShared & {\r\n valueProp?: string\r\n defaultValue: string\r\n onValueChange?: (value: string) => void\r\n allowEmpty: boolean\r\n}) {\r\n const [uncontrolled, setUncontrolled] = React.useState(defaultValue)\r\n const value = valueProp ?? uncontrolled\r\n const list = React.useMemo(() => (value ? [value] : []), [value])\r\n const ctx = React.useMemo(() => ({ ...context, value: list }), [context, list])\r\n return (\r\n <ChipGroupContext.Provider value={ctx}>\r\n <ToggleGroupPrimitive.Root\r\n type=\"single\"\r\n data-slot=\"chip-group\"\r\n value={value}\r\n onValueChange={(next) => {\r\n // Without allowEmpty, pressing the picked chip keeps it picked.\r\n if (!next && !allowEmpty) return\r\n if (valueProp === undefined) setUncontrolled(next)\r\n onValueChange?.(next)\r\n }}\r\n {...root}\r\n {...div}\r\n >\r\n {children}\r\n </ToggleGroupPrimitive.Root>\r\n </ChipGroupContext.Provider>\r\n )\r\n}\r\n\r\nfunction MultipleRoot({\r\n valueProp,\r\n defaultValue,\r\n onValueChange,\r\n context,\r\n div,\r\n children,\r\n ...root\r\n}: RootShared & {\r\n valueProp?: string[]\r\n defaultValue: string[]\r\n onValueChange?: (value: string[]) => void\r\n}) {\r\n const [uncontrolled, setUncontrolled] = React.useState(defaultValue)\r\n const value = valueProp ?? uncontrolled\r\n const ctx = React.useMemo(() => ({ ...context, value }), [context, value])\r\n return (\r\n <ChipGroupContext.Provider value={ctx}>\r\n <ToggleGroupPrimitive.Root\r\n type=\"multiple\"\r\n data-slot=\"chip-group\"\r\n value={value}\r\n onValueChange={(next) => {\r\n if (valueProp === undefined) setUncontrolled(next)\r\n onValueChange?.(next)\r\n }}\r\n {...root}\r\n {...div}\r\n >\r\n {children}\r\n </ToggleGroupPrimitive.Root>\r\n </ChipGroupContext.Provider>\r\n )\r\n}\r\n\r\n/* ─── ChipGroupItem ─────────────────────────────────────────────────────── */\r\n\r\nexport interface ChipGroupItemProps extends Omit<ChipProps, \"selected\" | \"size\" | \"asChild\" | \"value\"> {\r\n /** The value this chip stands for. */\r\n value: string\r\n /** A glyph in front of the label. With the check indicator it turns into the check when picked. */\r\n icon?: React.ReactNode\r\n /** Overrides the group's indicator for this chip. */\r\n indicator?: Indicator\r\n}\r\n\r\nexport function ChipGroupItem({\r\n className,\r\n value,\r\n icon,\r\n indicator,\r\n variant,\r\n tone,\r\n disabled,\r\n children,\r\n ...props\r\n}: ChipGroupItemProps) {\r\n const group = React.useContext(ChipGroupContext)\r\n const slots = chipGroupVariants()\r\n const selected = group?.value.includes(value) ?? false\r\n const showsCheck = (indicator ?? group?.indicator ?? \"none\") === \"check\"\r\n\r\n return (\r\n <ToggleGroupPrimitive.Item value={value} disabled={disabled} asChild>\r\n <Chip\r\n data-slot=\"chip-group-item\"\r\n size=\"sm\"\r\n variant={variant ?? group?.variant}\r\n tone={tone ?? group?.tone}\r\n selected={selected}\r\n disabled={disabled}\r\n className={slots.item({ className })}\r\n {...props}\r\n >\r\n {icon ? (\r\n <span data-slot=\"chip-group-icon\" className={slots.icon()}>\r\n {showsCheck ? (\r\n <>\r\n <span className={slots.iconIdle()}>{icon}</span>\r\n <span className={slots.iconCheck()}>\r\n <CheckCircle />\r\n </span>\r\n </>\r\n ) : (\r\n icon\r\n )}\r\n </span>\r\n ) : showsCheck ? (\r\n <span data-slot=\"chip-group-check\" className={slots.check()}>\r\n <span className={slots.checkGlyph()}>\r\n <CheckCircle />\r\n </span>\r\n </span>\r\n ) : null}\r\n {children}\r\n </Chip>\r\n </ToggleGroupPrimitive.Item>\r\n )\r\n}\r\n"],"mappings":"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","names":["type","valueProp","defaultValue","onValueChange","div"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/chip-group/index.ts"],"sourcesContent":["export {\n ChipGroup,\n ChipGroupItem,\n chipGroupVariants,\n type ChipGroupProps,\n type ChipGroupSingleProps,\n type ChipGroupMultipleProps,\n type ChipGroupItemProps,\n} from \"./chip-group.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
const CodeHighlighterContext = React.createContext(null);
|
|
5
|
+
CodeHighlighterContext.displayName = "CodeHighlighterContext";
|
|
6
|
+
function CodeHighlighterProvider({ highlighter, children }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(CodeHighlighterContext.Provider, { value: highlighter, children });
|
|
8
|
+
}
|
|
9
|
+
function useCodeHighlighter() {
|
|
10
|
+
return React.useContext(CodeHighlighterContext);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
CodeHighlighterProvider,
|
|
14
|
+
useCodeHighlighter
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=code-highlighter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/code-snippet/code-highlighter.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport type { CodeHighlighter } from \"./types.mjs\"\n\nexport type { CodeHighlighter, CodeToken, CodeTokenType } from \"./types.mjs\"\n\n/*\n * The seam for more languages. The spec places this at `@/lib/code-highlighter`; it lives beside\n * Code Snippet until that shared module exists (a one-line re-export there is all it takes).\n * Nothing here imports a highlighter: without a provider, Code Snippet uses its own grammar.\n */\n\nconst CodeHighlighterContext = React.createContext<CodeHighlighter | null>(null)\nCodeHighlighterContext.displayName = \"CodeHighlighterContext\"\n\nexport interface CodeHighlighterProviderProps {\n /** Lines of `{ type?, value }` tokens for `(code, lang)`, a promise of them, or `null`. */\n highlighter: CodeHighlighter\n children: React.ReactNode\n}\n\nexport function CodeHighlighterProvider({ highlighter, children }: CodeHighlighterProviderProps) {\n return (\n <CodeHighlighterContext.Provider value={highlighter}>{children}</CodeHighlighterContext.Provider>\n )\n}\n\n/** The nearest provider's highlighter, or `null` without one. */\nexport function useCodeHighlighter(): CodeHighlighter | null {\n return React.useContext(CodeHighlighterContext)\n}\n"],"mappings":";AAyBI;AAvBJ,YAAY,WAAW;AAYvB,MAAM,yBAAyB,MAAM,cAAsC,IAAI;AAC/E,uBAAuB,cAAc;AAQ9B,SAAS,wBAAwB,EAAE,aAAa,SAAS,GAAiC;AAC/F,SACE,oBAAC,uBAAuB,UAAvB,EAAgC,OAAO,aAAc,UAAS;AAEnE;AAGO,SAAS,qBAA6C;AAC3D,SAAO,MAAM,WAAW,sBAAsB;AAChD;","names":[]}
|