@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,852 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Popover as PopoverPrimitive, Slider as SliderPrimitive, ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
5
|
+
import { Eyedropper, Image as ImageIcon, UploadSimple } from "atoms-icons";
|
|
6
|
+
import {
|
|
7
|
+
checkerboard,
|
|
8
|
+
hexToHsv,
|
|
9
|
+
hslToHsv,
|
|
10
|
+
hsvToHex,
|
|
11
|
+
hsvToHsl,
|
|
12
|
+
hsvToRgb,
|
|
13
|
+
rgbString,
|
|
14
|
+
rgbToHsv
|
|
15
|
+
} from "../../../lib/color.mjs";
|
|
16
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
17
|
+
import { Button } from "../button/index.mjs";
|
|
18
|
+
import { InputField, InputPrefix, InputRoot, InputSuffix } from "../input/index.mjs";
|
|
19
|
+
import { ToggleGroup, ToggleGroupItem } from "../toggle-group/index.mjs";
|
|
20
|
+
const thumb = "block size-4 rounded-xs border-2 border-white bg-transparent shadow-[0_0_0_1px_rgba(0,0,0,0.4),0_1px_3px_rgba(0,0,0,0.4)] cursor-grab active:cursor-grabbing transition-[scale] duration-fast ease-out outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-popover";
|
|
21
|
+
const colorPickerVariants = tv({
|
|
22
|
+
slots: {
|
|
23
|
+
root: "flex max-w-full flex-col",
|
|
24
|
+
area: [
|
|
25
|
+
"relative aspect-square w-full shrink-0 cursor-crosshair touch-none select-none overflow-hidden max-sm:aspect-[3/2]",
|
|
26
|
+
"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:ring-media-edge",
|
|
27
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-foreground"
|
|
28
|
+
],
|
|
29
|
+
areaThumb: "pointer-events-none absolute z-10 size-4 -translate-x-1/2 -translate-y-1/2 rounded-xs border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.45),inset_0_0_0_1px_rgba(0,0,0,0.3),0_1px_3px_rgba(0,0,0,0.45)]",
|
|
30
|
+
controls: "flex w-full flex-col gap-2.5 px-1",
|
|
31
|
+
rail: "relative flex h-4 w-full touch-none select-none items-center pointer-coarse:h-9",
|
|
32
|
+
track: "relative h-2.5 w-full grow overflow-hidden rounded-full after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:ring-black/10",
|
|
33
|
+
thumb,
|
|
34
|
+
fields: "flex w-full items-center gap-2",
|
|
35
|
+
swatches: "flex w-full flex-col border-t border-border",
|
|
36
|
+
swatchesLabel: "text-sm font-medium text-muted-foreground",
|
|
37
|
+
swatchesGroup: "flex flex-wrap gap-1 pointer-coarse:gap-2",
|
|
38
|
+
swatch: [
|
|
39
|
+
"relative size-6 shrink-0 cursor-pointer rounded-sm ring-1 ring-inset ring-black/10 pointer-coarse:size-8 transition-[scale] duration-fast ease-out",
|
|
40
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--surface,var(--background))]",
|
|
41
|
+
"before:absolute before:-inset-0.5 pointer-coarse:before:-inset-1 before:content-['']",
|
|
42
|
+
"data-[selected=true]:ring-2 data-[selected=true]:ring-[var(--surface,var(--background))]"
|
|
43
|
+
],
|
|
44
|
+
preview: "relative size-9 shrink-0 overflow-hidden rounded-md ring-1 ring-inset ring-black/10",
|
|
45
|
+
triggerSwatch: [
|
|
46
|
+
"relative inline-flex size-9 shrink-0 cursor-pointer overflow-hidden rounded-md border border-input pointer-coarse:size-10 transition-[scale,box-shadow] duration-fast ease-out",
|
|
47
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50"
|
|
48
|
+
],
|
|
49
|
+
content: [
|
|
50
|
+
"z-50 flex max-h-(--radix-popover-content-available-height) max-w-[calc(100vw-1rem)] flex-col outline-none",
|
|
51
|
+
"[&>[data-slot=color-picker]]:min-h-0 [&>[data-slot=color-picker]]:overflow-y-auto [&>[data-slot=color-picker]]:overscroll-contain [&>[data-slot=color-picker]>*]:shrink-0",
|
|
52
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
53
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
54
|
+
"data-[state=open]:duration-fast data-[state=closed]:duration-[100ms] ease-out"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
variants: {
|
|
58
|
+
size: {
|
|
59
|
+
md: { root: "w-81 gap-3", area: "rounded-md", swatches: "gap-2 pt-4" },
|
|
60
|
+
sm: { root: "w-54 gap-2", area: "rounded-sm", swatches: "gap-1.5 pt-3" }
|
|
61
|
+
},
|
|
62
|
+
surface: {
|
|
63
|
+
card: { root: "bg-popover text-popover-foreground shadow-xl ring-1 ring-inset ring-border [--surface:var(--popover)]" },
|
|
64
|
+
plain: {}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
compoundVariants: [
|
|
68
|
+
{ size: "md", surface: "card", class: { root: "rounded-3xl p-4" } },
|
|
69
|
+
{ size: "sm", surface: "card", class: { root: "rounded-lg p-2" } }
|
|
70
|
+
],
|
|
71
|
+
defaultVariants: { size: "md", surface: "card" }
|
|
72
|
+
});
|
|
73
|
+
const defaultColorPresets = [
|
|
74
|
+
"#64748b",
|
|
75
|
+
"#78716c",
|
|
76
|
+
"#7c3aed",
|
|
77
|
+
"#8b5cf6",
|
|
78
|
+
"#c4b5fd",
|
|
79
|
+
"#2563eb",
|
|
80
|
+
"#60a5fa",
|
|
81
|
+
"#0891b2",
|
|
82
|
+
"#0d9488",
|
|
83
|
+
"#16a34a",
|
|
84
|
+
"#84cc16",
|
|
85
|
+
"#eab308",
|
|
86
|
+
"#f59e0b",
|
|
87
|
+
"#ea580c",
|
|
88
|
+
"#e11d48",
|
|
89
|
+
"#db2777"
|
|
90
|
+
];
|
|
91
|
+
const DEFAULT_GRADIENT = {
|
|
92
|
+
type: "linear",
|
|
93
|
+
angle: 90,
|
|
94
|
+
stops: [
|
|
95
|
+
{ position: 0, color: "#6366f1" },
|
|
96
|
+
{ position: 100, color: "#ec4899" }
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
const DEFAULT_IMAGE = { src: "", fit: "cover" };
|
|
100
|
+
const stopList = (stops) => [...stops].sort((a, b) => a.position - b.position).map((stop) => `${stop.color} ${Math.round(stop.position)}%`).join(", ");
|
|
101
|
+
function gradientToCss(gradient) {
|
|
102
|
+
return gradient.type === "radial" ? `radial-gradient(circle, ${stopList(gradient.stops)})` : `linear-gradient(${Math.round(gradient.angle)}deg, ${stopList(gradient.stops)})`;
|
|
103
|
+
}
|
|
104
|
+
const ColorPickerContext = React.createContext(null);
|
|
105
|
+
ColorPickerContext.displayName = "ColorPickerContext";
|
|
106
|
+
function useColorPicker(part) {
|
|
107
|
+
const context = React.useContext(ColorPickerContext);
|
|
108
|
+
if (!context) throw new Error(`${part} must be used inside <ColorPicker>`);
|
|
109
|
+
return context;
|
|
110
|
+
}
|
|
111
|
+
const SOLID = ["solid"];
|
|
112
|
+
function ColorPicker({
|
|
113
|
+
className,
|
|
114
|
+
value,
|
|
115
|
+
defaultValue = "#3b82f6",
|
|
116
|
+
onValueChange,
|
|
117
|
+
size: sizeProp,
|
|
118
|
+
density,
|
|
119
|
+
surface = "card",
|
|
120
|
+
format: formatProp,
|
|
121
|
+
defaultFormat = "hex",
|
|
122
|
+
onFormatChange,
|
|
123
|
+
showAlpha = true,
|
|
124
|
+
showInput,
|
|
125
|
+
showPresets = true,
|
|
126
|
+
presets = defaultColorPresets,
|
|
127
|
+
modes = SOLID,
|
|
128
|
+
mode: modeProp,
|
|
129
|
+
defaultMode,
|
|
130
|
+
onModeChange,
|
|
131
|
+
onFillChange,
|
|
132
|
+
defaultGradient = DEFAULT_GRADIENT,
|
|
133
|
+
defaultImage = DEFAULT_IMAGE,
|
|
134
|
+
children,
|
|
135
|
+
...props
|
|
136
|
+
}) {
|
|
137
|
+
const size = sizeProp ?? (density === "compact" ? "sm" : "md");
|
|
138
|
+
const inputs = showInput ?? size === "md";
|
|
139
|
+
const [solid, setSolid] = React.useState(() => hexToHsv(value ?? defaultValue) ?? { h: 0, s: 0, v: 0, a: 1 });
|
|
140
|
+
const [seen, setSeen] = React.useState(value);
|
|
141
|
+
if (value !== void 0 && value !== seen) {
|
|
142
|
+
setSeen(value);
|
|
143
|
+
const next = hexToHsv(value, solid.h);
|
|
144
|
+
if (next && hsvToHex(next) !== hsvToHex(solid)) setSolid(next);
|
|
145
|
+
}
|
|
146
|
+
const [ownFormat, setOwnFormat] = React.useState(defaultFormat);
|
|
147
|
+
const format = formatProp ?? ownFormat;
|
|
148
|
+
const [ownMode, setOwnMode] = React.useState(defaultMode ?? modes[0] ?? "solid");
|
|
149
|
+
const mode = modeProp ?? ownMode;
|
|
150
|
+
const [gradient, setGradientState] = React.useState(defaultGradient);
|
|
151
|
+
const [activeStop, setActiveStop] = React.useState(0);
|
|
152
|
+
const [image, setImageState] = React.useState(defaultImage);
|
|
153
|
+
const [stopHue, setStopHue] = React.useState(null);
|
|
154
|
+
const solidHex = hsvToHex(solid);
|
|
155
|
+
const stop = gradient.stops[Math.min(activeStop, gradient.stops.length - 1)];
|
|
156
|
+
const editing = mode === "gradient" && stop ? hexToHsv(stop.color, stopHue ?? solid.h) ?? solid : solid;
|
|
157
|
+
const hex = hsvToHex(editing);
|
|
158
|
+
const context = React.useMemo(() => {
|
|
159
|
+
const emitFill = (next) => {
|
|
160
|
+
if (!onFillChange) return;
|
|
161
|
+
if (next.mode === "gradient") onFillChange(gradientToCss(next.gradient));
|
|
162
|
+
else if (next.mode === "image") onFillChange(next.image.src ? `url("${next.image.src}")` : "");
|
|
163
|
+
else onFillChange(next.solid);
|
|
164
|
+
};
|
|
165
|
+
return {
|
|
166
|
+
hsva: editing,
|
|
167
|
+
hex,
|
|
168
|
+
setHsva(next) {
|
|
169
|
+
const nextHex = hsvToHex(next);
|
|
170
|
+
if (mode === "gradient" && stop) {
|
|
171
|
+
setStopHue(next.h);
|
|
172
|
+
const stops = gradient.stops.map((item, index) => index === activeStop ? { ...item, color: nextHex } : item);
|
|
173
|
+
const nextGradient = { ...gradient, stops };
|
|
174
|
+
setGradientState(nextGradient);
|
|
175
|
+
emitFill({ mode, solid: solidHex, gradient: nextGradient, image });
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
setSolid(next);
|
|
179
|
+
if (nextHex !== solidHex) {
|
|
180
|
+
onValueChange?.(nextHex);
|
|
181
|
+
emitFill({ mode, solid: nextHex, gradient, image });
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
format,
|
|
185
|
+
setFormat(next) {
|
|
186
|
+
if (formatProp === void 0) setOwnFormat(next);
|
|
187
|
+
onFormatChange?.(next);
|
|
188
|
+
},
|
|
189
|
+
size,
|
|
190
|
+
showAlpha,
|
|
191
|
+
presets,
|
|
192
|
+
modes,
|
|
193
|
+
mode,
|
|
194
|
+
setMode(next) {
|
|
195
|
+
if (modeProp === void 0) setOwnMode(next);
|
|
196
|
+
onModeChange?.(next);
|
|
197
|
+
emitFill({ mode: next, solid: solidHex, gradient, image });
|
|
198
|
+
},
|
|
199
|
+
chooseGradient(type) {
|
|
200
|
+
const next = { ...gradient, type };
|
|
201
|
+
setGradientState(next);
|
|
202
|
+
if (modeProp === void 0) setOwnMode("gradient");
|
|
203
|
+
if (mode !== "gradient") onModeChange?.("gradient");
|
|
204
|
+
emitFill({ mode: "gradient", solid: solidHex, gradient: next, image });
|
|
205
|
+
},
|
|
206
|
+
gradient,
|
|
207
|
+
setGradient(next) {
|
|
208
|
+
setGradientState(next);
|
|
209
|
+
emitFill({ mode, solid: solidHex, gradient: next, image });
|
|
210
|
+
},
|
|
211
|
+
activeStop,
|
|
212
|
+
setActiveStop(index) {
|
|
213
|
+
setActiveStop(index);
|
|
214
|
+
setStopHue(null);
|
|
215
|
+
},
|
|
216
|
+
image,
|
|
217
|
+
setImage(next) {
|
|
218
|
+
setImageState(next);
|
|
219
|
+
emitFill({ mode, solid: solidHex, gradient, image: next });
|
|
220
|
+
},
|
|
221
|
+
solidHex
|
|
222
|
+
};
|
|
223
|
+
}, [editing, hex, mode, stop, gradient, activeStop, solidHex, image, onFillChange, onValueChange, format, formatProp, onFormatChange, size, showAlpha, presets, modes, modeProp, onModeChange]);
|
|
224
|
+
return /* @__PURE__ */ jsx(ColorPickerContext.Provider, { value: context, children: /* @__PURE__ */ jsx("div", { "data-slot": "color-picker", className: colorPickerVariants({ size, surface }).root({ className }), ...props, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
225
|
+
modes.length > 1 ? /* @__PURE__ */ jsx(ColorPickerModes, {}) : null,
|
|
226
|
+
mode === "image" ? /* @__PURE__ */ jsx(ColorPickerImage, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
227
|
+
mode === "gradient" ? /* @__PURE__ */ jsx(ColorPickerGradient, {}) : null,
|
|
228
|
+
inputs ? /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2", children: [
|
|
229
|
+
/* @__PURE__ */ jsx(ColorPickerFormat, {}),
|
|
230
|
+
/* @__PURE__ */ jsx(ColorPickerEyeDropper, {})
|
|
231
|
+
] }) : null,
|
|
232
|
+
/* @__PURE__ */ jsx(ColorPickerArea, {}),
|
|
233
|
+
/* @__PURE__ */ jsx(ColorPickerControls, {}),
|
|
234
|
+
inputs ? /* @__PURE__ */ jsx(ColorPickerFields, {}) : null,
|
|
235
|
+
showPresets ? /* @__PURE__ */ jsx(ColorPickerSwatches, {}) : null
|
|
236
|
+
] })
|
|
237
|
+
] }) }) });
|
|
238
|
+
}
|
|
239
|
+
function ColorPickerFormat({ className }) {
|
|
240
|
+
const { format, setFormat } = useColorPicker("ColorPickerFormat");
|
|
241
|
+
return /* @__PURE__ */ jsx(
|
|
242
|
+
ToggleGroup,
|
|
243
|
+
{
|
|
244
|
+
type: "single",
|
|
245
|
+
variant: "segmented",
|
|
246
|
+
size: "sm",
|
|
247
|
+
"data-slot": "color-picker-format",
|
|
248
|
+
"aria-label": "Color format",
|
|
249
|
+
value: format,
|
|
250
|
+
onValueChange: (next) => next && setFormat(next),
|
|
251
|
+
className: ["w-full", className].filter(Boolean).join(" "),
|
|
252
|
+
children: ["hex", "hsl", "rgb"].map((item) => /* @__PURE__ */ jsx(ToggleGroupItem, { value: item, className: "flex-1 px-0", children: item.toUpperCase() }, item))
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
const subscribeNothing = () => () => {
|
|
257
|
+
};
|
|
258
|
+
function ColorPickerEyeDropper({ className }) {
|
|
259
|
+
const { hsva, setHsva } = useColorPicker("ColorPickerEyeDropper");
|
|
260
|
+
const supported = React.useSyncExternalStore(
|
|
261
|
+
subscribeNothing,
|
|
262
|
+
() => "EyeDropper" in window,
|
|
263
|
+
() => false
|
|
264
|
+
);
|
|
265
|
+
if (!supported) return null;
|
|
266
|
+
return /* @__PURE__ */ jsx(
|
|
267
|
+
Button,
|
|
268
|
+
{
|
|
269
|
+
"data-slot": "color-picker-eyedropper",
|
|
270
|
+
variant: "outline",
|
|
271
|
+
size: "sm",
|
|
272
|
+
iconOnly: true,
|
|
273
|
+
static: true,
|
|
274
|
+
tooltip: false,
|
|
275
|
+
"aria-label": "Pick a color from the screen",
|
|
276
|
+
className: ["text-muted-foreground hover:text-foreground", className].filter(Boolean).join(" "),
|
|
277
|
+
onClick: async () => {
|
|
278
|
+
try {
|
|
279
|
+
const Ctor = window.EyeDropper;
|
|
280
|
+
const { sRGBHex } = await new Ctor().open();
|
|
281
|
+
const next = hexToHsv(sRGBHex, hsva.h);
|
|
282
|
+
if (next) setHsva({ ...next, a: hsva.a });
|
|
283
|
+
} catch {
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
children: /* @__PURE__ */ jsx(Eyedropper, {})
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
function ColorPickerArea({ className, ...props }) {
|
|
291
|
+
const { hsva, setHsva, size } = useColorPicker("ColorPickerArea");
|
|
292
|
+
const slots = colorPickerVariants({ size });
|
|
293
|
+
const fromPointer = (event) => {
|
|
294
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
295
|
+
const s = Math.min(100, Math.max(0, (event.clientX - box.left) / box.width * 100));
|
|
296
|
+
const v = Math.min(100, Math.max(0, 100 - (event.clientY - box.top) / box.height * 100));
|
|
297
|
+
setHsva({ ...hsva, s, v });
|
|
298
|
+
};
|
|
299
|
+
return /* @__PURE__ */ jsx(
|
|
300
|
+
"div",
|
|
301
|
+
{
|
|
302
|
+
"data-slot": "color-picker-area",
|
|
303
|
+
role: "slider",
|
|
304
|
+
tabIndex: 0,
|
|
305
|
+
"aria-label": "Saturation and brightness",
|
|
306
|
+
"aria-valuemin": 0,
|
|
307
|
+
"aria-valuemax": 100,
|
|
308
|
+
"aria-valuenow": Math.round(hsva.s),
|
|
309
|
+
"aria-valuetext": `saturation ${Math.round(hsva.s)}%, brightness ${Math.round(hsva.v)}%`,
|
|
310
|
+
className: slots.area({ className }),
|
|
311
|
+
...props,
|
|
312
|
+
style: {
|
|
313
|
+
backgroundColor: `hsl(${hsva.h} 100% 50%)`,
|
|
314
|
+
backgroundImage: "linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)"
|
|
315
|
+
},
|
|
316
|
+
onPointerDown: (event) => {
|
|
317
|
+
if (event.button !== 0) return;
|
|
318
|
+
try {
|
|
319
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
320
|
+
} catch {
|
|
321
|
+
}
|
|
322
|
+
event.currentTarget.focus();
|
|
323
|
+
fromPointer(event);
|
|
324
|
+
},
|
|
325
|
+
onPointerMove: (event) => {
|
|
326
|
+
if (event.buttons > 0) fromPointer(event);
|
|
327
|
+
},
|
|
328
|
+
onKeyDown: (event) => {
|
|
329
|
+
const by = event.shiftKey ? 10 : 1;
|
|
330
|
+
const moves = {
|
|
331
|
+
ArrowLeft: [-by, 0],
|
|
332
|
+
ArrowRight: [by, 0],
|
|
333
|
+
ArrowUp: [0, by],
|
|
334
|
+
ArrowDown: [0, -by]
|
|
335
|
+
};
|
|
336
|
+
const move = moves[event.key];
|
|
337
|
+
if (!move) return;
|
|
338
|
+
event.preventDefault();
|
|
339
|
+
setHsva({
|
|
340
|
+
...hsva,
|
|
341
|
+
s: Math.min(100, Math.max(0, hsva.s + move[0])),
|
|
342
|
+
v: Math.min(100, Math.max(0, hsva.v + move[1]))
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
children: /* @__PURE__ */ jsx("span", { className: slots.areaThumb(), style: { left: `${hsva.s}%`, top: `${100 - hsva.v}%` } })
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
function ColorPickerHueSlider({ className }) {
|
|
350
|
+
const { hsva, setHsva } = useColorPicker("ColorPickerHueSlider");
|
|
351
|
+
const slots = colorPickerVariants();
|
|
352
|
+
return /* @__PURE__ */ jsxs(
|
|
353
|
+
SliderPrimitive.Root,
|
|
354
|
+
{
|
|
355
|
+
"data-slot": "color-picker-hue",
|
|
356
|
+
"aria-label": "Hue",
|
|
357
|
+
min: 0,
|
|
358
|
+
max: 360,
|
|
359
|
+
step: 1,
|
|
360
|
+
value: [hsva.h],
|
|
361
|
+
onValueChange: ([h]) => setHsva({ ...hsva, h }),
|
|
362
|
+
className: slots.rail({ className }),
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsx(
|
|
365
|
+
SliderPrimitive.Track,
|
|
366
|
+
{
|
|
367
|
+
className: slots.track(),
|
|
368
|
+
style: {
|
|
369
|
+
backgroundImage: "linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
/* @__PURE__ */ jsx(
|
|
374
|
+
SliderPrimitive.Thumb,
|
|
375
|
+
{
|
|
376
|
+
className: slots.thumb(),
|
|
377
|
+
style: { backgroundColor: rgbString(hsvToRgb({ h: hsva.h, s: 100, v: 100, a: 1 })) }
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
function ColorPickerAlphaSlider({ className }) {
|
|
385
|
+
const { hsva, setHsva } = useColorPicker("ColorPickerAlphaSlider");
|
|
386
|
+
const slots = colorPickerVariants();
|
|
387
|
+
const solid = rgbString(hsvToRgb(hsva));
|
|
388
|
+
return /* @__PURE__ */ jsxs(
|
|
389
|
+
SliderPrimitive.Root,
|
|
390
|
+
{
|
|
391
|
+
"data-slot": "color-picker-alpha",
|
|
392
|
+
"aria-label": "Alpha",
|
|
393
|
+
min: 0,
|
|
394
|
+
max: 100,
|
|
395
|
+
step: 1,
|
|
396
|
+
value: [Math.round(hsva.a * 100)],
|
|
397
|
+
onValueChange: ([a]) => setHsva({ ...hsva, a: a / 100 }),
|
|
398
|
+
className: slots.rail({ className }),
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: slots.track(), style: checkerboard, children: /* @__PURE__ */ jsx("span", { className: "absolute inset-0", style: { backgroundImage: `linear-gradient(to right, transparent, ${solid})` } }) }),
|
|
401
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: slots.thumb(), style: { backgroundColor: solid } })
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
function ColorPickerControls({ className }) {
|
|
407
|
+
const { showAlpha } = useColorPicker("ColorPickerControls");
|
|
408
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "color-picker-controls", className: colorPickerVariants().controls({ className }), children: [
|
|
409
|
+
/* @__PURE__ */ jsx(ColorPickerHueSlider, {}),
|
|
410
|
+
showAlpha ? /* @__PURE__ */ jsx(ColorPickerAlphaSlider, {}) : null
|
|
411
|
+
] });
|
|
412
|
+
}
|
|
413
|
+
function ChannelField({
|
|
414
|
+
label,
|
|
415
|
+
value,
|
|
416
|
+
max,
|
|
417
|
+
onCommit,
|
|
418
|
+
suffix,
|
|
419
|
+
className
|
|
420
|
+
}) {
|
|
421
|
+
const [draft, setDraft] = React.useState(null);
|
|
422
|
+
return /* @__PURE__ */ jsxs(InputRoot, { className: className ?? "min-w-0 flex-1", children: [
|
|
423
|
+
/* @__PURE__ */ jsx(
|
|
424
|
+
InputField,
|
|
425
|
+
{
|
|
426
|
+
className: "tabular-nums",
|
|
427
|
+
inputMode: "numeric",
|
|
428
|
+
spellCheck: false,
|
|
429
|
+
autoComplete: "off",
|
|
430
|
+
"aria-label": label,
|
|
431
|
+
value: draft ?? String(Math.round(value)),
|
|
432
|
+
onChange: (event) => {
|
|
433
|
+
setDraft(event.target.value);
|
|
434
|
+
const n = Number(event.target.value);
|
|
435
|
+
if (event.target.value.trim() !== "" && Number.isFinite(n)) onCommit(Math.min(max, Math.max(0, n)));
|
|
436
|
+
},
|
|
437
|
+
onBlur: () => setDraft(null)
|
|
438
|
+
}
|
|
439
|
+
),
|
|
440
|
+
suffix ? /* @__PURE__ */ jsx(InputSuffix, { children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: suffix }) }) : null
|
|
441
|
+
] });
|
|
442
|
+
}
|
|
443
|
+
function ColorPickerHexInput({ className }) {
|
|
444
|
+
const { hsva, hex, setHsva } = useColorPicker("ColorPickerHexInput");
|
|
445
|
+
const [draft, setDraft] = React.useState(null);
|
|
446
|
+
return /* @__PURE__ */ jsxs(InputRoot, { className: ["flex-[2]", className].filter(Boolean).join(" "), children: [
|
|
447
|
+
/* @__PURE__ */ jsx(InputPrefix, { children: /* @__PURE__ */ jsx("span", { className: "font-mono text-sm", children: "#" }) }),
|
|
448
|
+
/* @__PURE__ */ jsx(
|
|
449
|
+
InputField,
|
|
450
|
+
{
|
|
451
|
+
"data-slot": "color-picker-hex",
|
|
452
|
+
className: "font-mono uppercase tabular-nums",
|
|
453
|
+
spellCheck: false,
|
|
454
|
+
autoComplete: "off",
|
|
455
|
+
"aria-label": "Hex color",
|
|
456
|
+
value: draft ?? hex.slice(1, 7),
|
|
457
|
+
onChange: (event) => {
|
|
458
|
+
const text = event.target.value.replace(/[^0-9a-f]/gi, "").slice(0, 6);
|
|
459
|
+
setDraft(text);
|
|
460
|
+
if (text.length === 6 || text.length === 3) {
|
|
461
|
+
const next = hexToHsv(text, hsva.h);
|
|
462
|
+
if (next) setHsva({ ...next, a: hsva.a });
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
onBlur: () => setDraft(null)
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
] });
|
|
469
|
+
}
|
|
470
|
+
function ColorPickerFields({ className }) {
|
|
471
|
+
const { hsva, setHsva, format, showAlpha } = useColorPicker("ColorPickerFields");
|
|
472
|
+
const rgb = hsvToRgb(hsva);
|
|
473
|
+
const hsl = hsvToHsl(hsva);
|
|
474
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "color-picker-fields", className: colorPickerVariants().fields({ className }), children: [
|
|
475
|
+
format === "hex" ? /* @__PURE__ */ jsx(ColorPickerHexInput, {}) : null,
|
|
476
|
+
format === "hsl" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
477
|
+
/* @__PURE__ */ jsx(ChannelField, { label: "Hue", value: hsl.h, max: 360, onCommit: (h) => setHsva(hslToHsv({ ...hsl, h })) }),
|
|
478
|
+
/* @__PURE__ */ jsx(ChannelField, { label: "Saturation", value: hsl.s, max: 100, onCommit: (s) => setHsva(hslToHsv({ ...hsl, s })) }),
|
|
479
|
+
/* @__PURE__ */ jsx(ChannelField, { label: "Lightness", value: hsl.l, max: 100, onCommit: (l) => setHsva(hslToHsv({ ...hsl, l })) })
|
|
480
|
+
] }) : null,
|
|
481
|
+
format === "rgb" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
482
|
+
/* @__PURE__ */ jsx(ChannelField, { label: "Red", value: rgb.r, max: 255, onCommit: (r) => setHsva(rgbToHsv({ ...rgb, r }, hsva.h)) }),
|
|
483
|
+
/* @__PURE__ */ jsx(ChannelField, { label: "Green", value: rgb.g, max: 255, onCommit: (g) => setHsva(rgbToHsv({ ...rgb, g }, hsva.h)) }),
|
|
484
|
+
/* @__PURE__ */ jsx(ChannelField, { label: "Blue", value: rgb.b, max: 255, onCommit: (b) => setHsva(rgbToHsv({ ...rgb, b }, hsva.h)) })
|
|
485
|
+
] }) : null,
|
|
486
|
+
showAlpha ? /* @__PURE__ */ jsx(ChannelField, { label: "Alpha", value: hsva.a * 100, max: 100, suffix: "%", onCommit: (a) => setHsva({ ...hsva, a: a / 100 }) }) : null
|
|
487
|
+
] });
|
|
488
|
+
}
|
|
489
|
+
function ColorPickerPreview({ className }) {
|
|
490
|
+
const { hex } = useColorPicker("ColorPickerPreview");
|
|
491
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "color-picker-preview", className: colorPickerVariants().preview({ className }), style: checkerboard, children: /* @__PURE__ */ jsx("span", { className: "absolute inset-0", style: { backgroundColor: hex } }) });
|
|
492
|
+
}
|
|
493
|
+
function ColorPickerSwatches({ presets: presetsProp, label = "Colors", className }) {
|
|
494
|
+
const { hsva, hex, setHsva, presets: rootPresets, size } = useColorPicker("ColorPickerSwatches");
|
|
495
|
+
const presets = presetsProp ?? rootPresets;
|
|
496
|
+
const slots = colorPickerVariants({ size });
|
|
497
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "color-picker-swatches", className: slots.swatches({ className }), children: [
|
|
498
|
+
label !== null ? /* @__PURE__ */ jsx("p", { className: slots.swatchesLabel(), children: label }) : null,
|
|
499
|
+
/* @__PURE__ */ jsx("div", { className: slots.swatchesGroup(), role: "group", "aria-label": "Color presets", children: presets.map((color) => {
|
|
500
|
+
const selected = color.toLowerCase() === hex.toLowerCase();
|
|
501
|
+
return /* @__PURE__ */ jsx(
|
|
502
|
+
"button",
|
|
503
|
+
{
|
|
504
|
+
type: "button",
|
|
505
|
+
"aria-label": color,
|
|
506
|
+
"aria-pressed": selected,
|
|
507
|
+
"data-selected": selected ? "true" : void 0,
|
|
508
|
+
className: slots.swatch(),
|
|
509
|
+
style: {
|
|
510
|
+
backgroundColor: color,
|
|
511
|
+
...selected ? { outline: `1.5px solid ${color}`, outlineOffset: 0 } : null
|
|
512
|
+
},
|
|
513
|
+
onClick: () => {
|
|
514
|
+
const next = hexToHsv(color, hsva.h);
|
|
515
|
+
if (next) setHsva(next);
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
color
|
|
519
|
+
);
|
|
520
|
+
}) })
|
|
521
|
+
] });
|
|
522
|
+
}
|
|
523
|
+
const modeTile = [
|
|
524
|
+
"select-none gap-1.5 whitespace-nowrap border-input font-medium data-[state=on]:border-primary disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 text-sm has-[>svg]:px-3",
|
|
525
|
+
"before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] before:h-10 before:w-full pointer-coarse:before:h-11",
|
|
526
|
+
"relative size-9 shrink-0 cursor-pointer overflow-hidden rounded-md border-0 bg-transparent p-0 ring-1 ring-black/10 flex items-center justify-center text-muted-foreground",
|
|
527
|
+
"transition-[scale,box-shadow,color] duration-fast ease-out hover:text-foreground data-[state=off]:hover:bg-transparent data-[state=off]:hover:text-foreground data-[state=on]:text-muted-foreground",
|
|
528
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-popover",
|
|
529
|
+
"data-[state=on]:ring-2 data-[state=on]:ring-primary data-[state=on]:ring-offset-2 data-[state=on]:ring-offset-popover",
|
|
530
|
+
"[&_svg]:relative [&_svg]:size-4 [&_svg]:shrink-0"
|
|
531
|
+
].join(" ");
|
|
532
|
+
function ColorPickerModes({ className }) {
|
|
533
|
+
const { modes, mode, setMode, chooseGradient, gradient, solidHex, image } = useColorPicker("ColorPickerModes");
|
|
534
|
+
const tiles = [
|
|
535
|
+
...modes.includes("solid") ? ["solid"] : [],
|
|
536
|
+
...modes.includes("gradient") ? ["linear", "radial"] : [],
|
|
537
|
+
...modes.includes("image") ? ["image"] : []
|
|
538
|
+
];
|
|
539
|
+
if (tiles.length < 2) return null;
|
|
540
|
+
const current = mode === "gradient" ? gradient.type : mode;
|
|
541
|
+
const stops = stopList(gradient.stops);
|
|
542
|
+
const preview = {
|
|
543
|
+
solid: { backgroundColor: solidHex },
|
|
544
|
+
linear: { backgroundImage: `linear-gradient(to right, ${stops})` },
|
|
545
|
+
radial: { backgroundImage: `radial-gradient(circle, ${stops})` }
|
|
546
|
+
};
|
|
547
|
+
return /* @__PURE__ */ jsx(
|
|
548
|
+
ToggleGroupPrimitive.Root,
|
|
549
|
+
{
|
|
550
|
+
type: "single",
|
|
551
|
+
"data-slot": "color-picker-modes",
|
|
552
|
+
"aria-label": "Fill type",
|
|
553
|
+
value: current,
|
|
554
|
+
onValueChange: (next) => {
|
|
555
|
+
if (!next) return;
|
|
556
|
+
const tile = next;
|
|
557
|
+
if (tile === "linear" || tile === "radial") {
|
|
558
|
+
chooseGradient(tile);
|
|
559
|
+
} else {
|
|
560
|
+
setMode(tile);
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
className: ["group/toggle-group [--button-corner:calc(var(--radius)*0.875)] flex w-full items-center gap-1.5", className].filter(Boolean).join(" "),
|
|
564
|
+
children: tiles.map((tile) => /* @__PURE__ */ jsx(
|
|
565
|
+
ToggleGroupPrimitive.Item,
|
|
566
|
+
{
|
|
567
|
+
value: tile,
|
|
568
|
+
"data-slot": "toggle-group-item",
|
|
569
|
+
"aria-label": tile[0].toUpperCase() + tile.slice(1),
|
|
570
|
+
className: modeTile,
|
|
571
|
+
style: tile === "image" && !image.src ? void 0 : checkerboard,
|
|
572
|
+
children: tile === "image" ? image.src ? /* @__PURE__ */ jsx(
|
|
573
|
+
"span",
|
|
574
|
+
{
|
|
575
|
+
className: "absolute inset-0",
|
|
576
|
+
style: { backgroundImage: `url("${image.src}")`, backgroundSize: "cover", backgroundPosition: "center" }
|
|
577
|
+
}
|
|
578
|
+
) : /* @__PURE__ */ jsx(ImageIcon, {}) : /* @__PURE__ */ jsx("span", { className: "absolute inset-0", style: preview[tile] })
|
|
579
|
+
},
|
|
580
|
+
tile
|
|
581
|
+
))
|
|
582
|
+
}
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
const stopButton = [
|
|
586
|
+
"absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full",
|
|
587
|
+
"before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] before:size-10 pointer-coarse:before:size-11",
|
|
588
|
+
"border-2 border-white bg-clip-padding shadow-[0_0_0_1px_rgba(0,0,0,0.4),0_1px_3px_rgba(0,0,0,0.4)] transition-[scale] duration-fast ease-out active:cursor-grabbing",
|
|
589
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-1 focus-visible:ring-offset-popover",
|
|
590
|
+
"data-[active=true]:ring-2 data-[active=true]:ring-primary data-[active=true]:ring-offset-1 data-[active=true]:ring-offset-popover"
|
|
591
|
+
].join(" ");
|
|
592
|
+
function ColorPickerGradient({ className }) {
|
|
593
|
+
const { gradient, setGradient, activeStop, setActiveStop } = useColorPicker("ColorPickerGradient");
|
|
594
|
+
const trackRef = React.useRef(null);
|
|
595
|
+
const dragging = React.useRef(null);
|
|
596
|
+
const slots = colorPickerVariants();
|
|
597
|
+
const positionAt = (clientX) => {
|
|
598
|
+
const box = trackRef.current?.getBoundingClientRect();
|
|
599
|
+
if (!box) return 0;
|
|
600
|
+
return Math.min(100, Math.max(0, (clientX - box.left) / box.width * 100));
|
|
601
|
+
};
|
|
602
|
+
const moveStop = (index, position) => {
|
|
603
|
+
const stops = gradient.stops.map((stop, i) => i === index ? { ...stop, position } : stop);
|
|
604
|
+
setGradient({ ...gradient, stops });
|
|
605
|
+
};
|
|
606
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "color-picker-gradient", className: ["flex flex-col gap-3", className].filter(Boolean).join(" "), children: [
|
|
607
|
+
/* @__PURE__ */ jsxs(
|
|
608
|
+
"div",
|
|
609
|
+
{
|
|
610
|
+
ref: trackRef,
|
|
611
|
+
role: "group",
|
|
612
|
+
"aria-label": "Gradient stops",
|
|
613
|
+
className: "relative h-7 w-full cursor-copy touch-none select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-foreground",
|
|
614
|
+
style: checkerboard,
|
|
615
|
+
onPointerDown: (event) => {
|
|
616
|
+
if (event.target !== event.currentTarget && !event.target.dataset.track) return;
|
|
617
|
+
const position = positionAt(event.clientX);
|
|
618
|
+
const nearest = gradient.stops.reduce(
|
|
619
|
+
(best, stop) => Math.abs(stop.position - position) < Math.abs(best.position - position) ? stop : best
|
|
620
|
+
);
|
|
621
|
+
const stops = [...gradient.stops, { position, color: nearest.color }];
|
|
622
|
+
setGradient({ ...gradient, stops });
|
|
623
|
+
setActiveStop(stops.length - 1);
|
|
624
|
+
},
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ jsx(
|
|
627
|
+
"span",
|
|
628
|
+
{
|
|
629
|
+
"data-track": "",
|
|
630
|
+
className: "absolute inset-0 rounded-md ring-1 ring-inset ring-black/10 pointer-events-none",
|
|
631
|
+
style: { backgroundImage: `linear-gradient(to right, ${stopList(gradient.stops)})` }
|
|
632
|
+
}
|
|
633
|
+
),
|
|
634
|
+
gradient.stops.map((stop, index) => /* @__PURE__ */ jsx(
|
|
635
|
+
"button",
|
|
636
|
+
{
|
|
637
|
+
type: "button",
|
|
638
|
+
"data-slot": "color-picker-gradient-stop",
|
|
639
|
+
"data-active": index === activeStop ? "true" : "false",
|
|
640
|
+
"aria-label": `Color stop at ${Math.round(stop.position)}%`,
|
|
641
|
+
className: stopButton,
|
|
642
|
+
style: { left: `${stop.position}%`, backgroundColor: stop.color },
|
|
643
|
+
onPointerDown: (event) => {
|
|
644
|
+
event.stopPropagation();
|
|
645
|
+
setActiveStop(index);
|
|
646
|
+
dragging.current = index;
|
|
647
|
+
try {
|
|
648
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
649
|
+
} catch {
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
onPointerMove: (event) => {
|
|
653
|
+
if (dragging.current === index && event.buttons > 0) moveStop(index, positionAt(event.clientX));
|
|
654
|
+
},
|
|
655
|
+
onPointerUp: () => {
|
|
656
|
+
dragging.current = null;
|
|
657
|
+
},
|
|
658
|
+
onKeyDown: (event) => {
|
|
659
|
+
const by = event.shiftKey ? 10 : 1;
|
|
660
|
+
if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
661
|
+
event.preventDefault();
|
|
662
|
+
const dir = event.key === "ArrowLeft" ? -1 : 1;
|
|
663
|
+
moveStop(index, Math.min(100, Math.max(0, stop.position + dir * by)));
|
|
664
|
+
} else if ((event.key === "Delete" || event.key === "Backspace") && gradient.stops.length > 2) {
|
|
665
|
+
event.preventDefault();
|
|
666
|
+
setGradient({ ...gradient, stops: gradient.stops.filter((_, i) => i !== index) });
|
|
667
|
+
setActiveStop(0);
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
onFocus: () => setActiveStop(index)
|
|
671
|
+
},
|
|
672
|
+
index
|
|
673
|
+
))
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
gradient.type === "linear" ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
678
|
+
/* @__PURE__ */ jsxs(
|
|
679
|
+
SliderPrimitive.Root,
|
|
680
|
+
{
|
|
681
|
+
"aria-label": "Gradient angle",
|
|
682
|
+
min: 0,
|
|
683
|
+
max: 360,
|
|
684
|
+
step: 1,
|
|
685
|
+
value: [gradient.angle],
|
|
686
|
+
onValueChange: ([angle]) => setGradient({ ...gradient, angle }),
|
|
687
|
+
className: slots.rail(),
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: slots.track({ className: "bg-muted after:ring-black/5" }), children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full rounded-full bg-primary/30" }) }),
|
|
690
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: slots.thumb({ className: "bg-background" }) })
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
),
|
|
694
|
+
/* @__PURE__ */ jsxs("span", { className: "w-10 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground", children: [
|
|
695
|
+
Math.round(gradient.angle),
|
|
696
|
+
"\xB0"
|
|
697
|
+
] })
|
|
698
|
+
] }) }) : null
|
|
699
|
+
] });
|
|
700
|
+
}
|
|
701
|
+
function ColorPickerImage({ className }) {
|
|
702
|
+
const { image, setImage } = useColorPicker("ColorPickerImage");
|
|
703
|
+
const fileRef = React.useRef(null);
|
|
704
|
+
const [url, setUrl] = React.useState(image.src.startsWith("data:") ? "" : image.src);
|
|
705
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "color-picker-image", className: ["flex flex-col gap-3", className].filter(Boolean).join(" "), children: [
|
|
706
|
+
/* @__PURE__ */ jsx(
|
|
707
|
+
"input",
|
|
708
|
+
{
|
|
709
|
+
ref: fileRef,
|
|
710
|
+
type: "file",
|
|
711
|
+
accept: "image/*",
|
|
712
|
+
className: "hidden",
|
|
713
|
+
"aria-hidden": "true",
|
|
714
|
+
tabIndex: -1,
|
|
715
|
+
onChange: (event) => {
|
|
716
|
+
const file = event.target.files?.[0];
|
|
717
|
+
if (!file) return;
|
|
718
|
+
const reader = new FileReader();
|
|
719
|
+
reader.onload = () => setImage({ ...image, src: String(reader.result) });
|
|
720
|
+
reader.readAsDataURL(file);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
/* @__PURE__ */ jsx(
|
|
725
|
+
"button",
|
|
726
|
+
{
|
|
727
|
+
type: "button",
|
|
728
|
+
onClick: () => fileRef.current?.click(),
|
|
729
|
+
className: [
|
|
730
|
+
"flex aspect-[16/10] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg p-4 text-center",
|
|
731
|
+
image.src ? "relative overflow-hidden ring-1 ring-inset ring-black/10" : "border border-dashed border-input bg-[var(--surface,var(--background))]",
|
|
732
|
+
"text-muted-foreground transition-[color,background-color,border-color] duration-fast ease-out hover:border-primary/50 hover:bg-accent hover:text-foreground",
|
|
733
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-popover [&_svg]:size-6 [&_svg]:shrink-0"
|
|
734
|
+
].join(" "),
|
|
735
|
+
style: image.src ? checkerboard : void 0,
|
|
736
|
+
"aria-label": image.src ? "Replace image" : void 0,
|
|
737
|
+
children: image.src ? /* @__PURE__ */ jsx(
|
|
738
|
+
"span",
|
|
739
|
+
{
|
|
740
|
+
className: "absolute inset-0",
|
|
741
|
+
style: {
|
|
742
|
+
backgroundImage: `url("${image.src}")`,
|
|
743
|
+
backgroundSize: image.fit,
|
|
744
|
+
backgroundPosition: "center",
|
|
745
|
+
backgroundRepeat: "no-repeat"
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
749
|
+
/* @__PURE__ */ jsx(UploadSimple, {}),
|
|
750
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: "Upload image" }),
|
|
751
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: "or paste a URL below" })
|
|
752
|
+
] })
|
|
753
|
+
}
|
|
754
|
+
),
|
|
755
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs(InputRoot, { children: [
|
|
756
|
+
/* @__PURE__ */ jsx(InputPrefix, { children: /* @__PURE__ */ jsx(ImageIcon, { className: "size-4" }) }),
|
|
757
|
+
/* @__PURE__ */ jsx(
|
|
758
|
+
InputField,
|
|
759
|
+
{
|
|
760
|
+
placeholder: "https://\u2026",
|
|
761
|
+
spellCheck: false,
|
|
762
|
+
autoComplete: "off",
|
|
763
|
+
"aria-label": "Image URL",
|
|
764
|
+
value: url,
|
|
765
|
+
onChange: (event) => {
|
|
766
|
+
setUrl(event.target.value);
|
|
767
|
+
setImage({ ...image, src: event.target.value.trim() });
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
] }) }),
|
|
772
|
+
image.src ? /* @__PURE__ */ jsxs(
|
|
773
|
+
ToggleGroup,
|
|
774
|
+
{
|
|
775
|
+
type: "single",
|
|
776
|
+
variant: "segmented",
|
|
777
|
+
size: "sm",
|
|
778
|
+
"aria-label": "Image fit",
|
|
779
|
+
value: image.fit,
|
|
780
|
+
onValueChange: (next) => next && setImage({ ...image, fit: next }),
|
|
781
|
+
className: "w-full",
|
|
782
|
+
children: [
|
|
783
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "cover", className: "flex-1 px-0", children: "Cover" }),
|
|
784
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "contain", className: "flex-1 px-0", children: "Contain" })
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
) : null
|
|
788
|
+
] });
|
|
789
|
+
}
|
|
790
|
+
function ColorPickerPopover(props) {
|
|
791
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { ...props });
|
|
792
|
+
}
|
|
793
|
+
function ColorPickerTrigger(props) {
|
|
794
|
+
const slot = props.asChild ? {} : { "data-slot": "color-picker-trigger" };
|
|
795
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { ...slot, ...props });
|
|
796
|
+
}
|
|
797
|
+
function ColorPickerTriggerSwatch({ className, value, type, ...props }) {
|
|
798
|
+
return /* @__PURE__ */ jsx(
|
|
799
|
+
"button",
|
|
800
|
+
{
|
|
801
|
+
"data-slot": "color-picker-trigger-swatch",
|
|
802
|
+
type: type ?? "button",
|
|
803
|
+
className: colorPickerVariants().triggerSwatch({ className }),
|
|
804
|
+
style: checkerboard,
|
|
805
|
+
...props,
|
|
806
|
+
children: /* @__PURE__ */ jsx("span", { className: "absolute inset-0", style: { backgroundColor: value } })
|
|
807
|
+
}
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
function ColorPickerContent({
|
|
811
|
+
className,
|
|
812
|
+
side = "bottom",
|
|
813
|
+
align = "start",
|
|
814
|
+
sideOffset = 8,
|
|
815
|
+
...props
|
|
816
|
+
}) {
|
|
817
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
818
|
+
PopoverPrimitive.Content,
|
|
819
|
+
{
|
|
820
|
+
"data-slot": "color-picker-content",
|
|
821
|
+
side,
|
|
822
|
+
align,
|
|
823
|
+
sideOffset,
|
|
824
|
+
className: colorPickerVariants().content({ className }),
|
|
825
|
+
...props
|
|
826
|
+
}
|
|
827
|
+
) });
|
|
828
|
+
}
|
|
829
|
+
export {
|
|
830
|
+
ColorPicker,
|
|
831
|
+
ColorPickerAlphaSlider,
|
|
832
|
+
ColorPickerArea,
|
|
833
|
+
ColorPickerContent,
|
|
834
|
+
ColorPickerControls,
|
|
835
|
+
ColorPickerEyeDropper,
|
|
836
|
+
ColorPickerFields,
|
|
837
|
+
ColorPickerFormat,
|
|
838
|
+
ColorPickerGradient,
|
|
839
|
+
ColorPickerHexInput,
|
|
840
|
+
ColorPickerHueSlider,
|
|
841
|
+
ColorPickerImage,
|
|
842
|
+
ColorPickerModes,
|
|
843
|
+
ColorPickerPopover,
|
|
844
|
+
ColorPickerPreview,
|
|
845
|
+
ColorPickerSwatches,
|
|
846
|
+
ColorPickerTrigger,
|
|
847
|
+
ColorPickerTriggerSwatch,
|
|
848
|
+
colorPickerVariants,
|
|
849
|
+
defaultColorPresets,
|
|
850
|
+
gradientToCss
|
|
851
|
+
};
|
|
852
|
+
//# sourceMappingURL=color-picker.mjs.map
|