@thalavaisankar/atoms 0.0.0-stage → 0.1.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 +142 -2
- package/THIRD_PARTY_NOTICES.md +246 -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/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 +19332 -0
- package/dist/index.mjs +155 -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/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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/tab-strip/index.ts"],"sourcesContent":["export {\n TabStrip,\n TabStripItem,\n TabStripAdd,\n tabStripVariants,\n type TabStripProps,\n type TabStripItemProps,\n type TabStripAddProps,\n type TabStripSize,\n} from \"./tab-strip.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;","names":[]}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Plus, X } from "atoms-icons";
|
|
5
|
+
import { createContext } from "../../../lib/create-context.mjs";
|
|
6
|
+
import { hitBox, hitY } from "../../../lib/hit-area.mjs";
|
|
7
|
+
import { useRovingFocus } from "../../../lib/roving-focus.mjs";
|
|
8
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
9
|
+
const tabStripVariants = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: "flex min-w-0 items-center",
|
|
12
|
+
list: "relative flex min-w-0 items-center gap-1 overflow-x-auto overflow-y-hidden px-0.5 py-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
13
|
+
item: [
|
|
14
|
+
"group/tab-strip-item flex max-w-60 min-w-0 shrink-0 cursor-pointer items-center rounded-sm select-none font-medium whitespace-nowrap",
|
|
15
|
+
hitY,
|
|
16
|
+
"transition-[color,background-color,box-shadow,opacity,scale] duration-fast ease-out motion-reduce-fade",
|
|
17
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset [&>svg]:shrink-0"
|
|
18
|
+
],
|
|
19
|
+
label: "min-w-0 truncate",
|
|
20
|
+
close: [
|
|
21
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-xs",
|
|
22
|
+
hitY,
|
|
23
|
+
"text-muted-foreground hover:bg-accent hover:text-foreground transition-[color,background-color,opacity] duration-fast ease-out motion-reduce-fade"
|
|
24
|
+
],
|
|
25
|
+
add: [
|
|
26
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm",
|
|
27
|
+
hitBox,
|
|
28
|
+
"text-muted-foreground hover:bg-accent hover:text-foreground transition-[color,background-color,scale] duration-fast ease-out motion-reduce-fade",
|
|
29
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
variants: {
|
|
33
|
+
size: {
|
|
34
|
+
sm: {
|
|
35
|
+
item: "h-7 gap-1.5 px-2.5 text-xs [&>svg]:size-4",
|
|
36
|
+
close: "-mr-1 size-5 [&_svg]:size-3",
|
|
37
|
+
add: "size-7 [&_svg]:size-3.5"
|
|
38
|
+
},
|
|
39
|
+
md: {
|
|
40
|
+
item: "h-9 gap-2 px-3 text-sm [&>svg]:size-5",
|
|
41
|
+
close: "-mr-1.5 size-6 [&_svg]:size-3.5",
|
|
42
|
+
add: "size-9 [&_svg]:size-4"
|
|
43
|
+
},
|
|
44
|
+
lg: {
|
|
45
|
+
item: "h-11 gap-2 px-4 text-sm [&>svg]:size-5",
|
|
46
|
+
close: "-mr-2 size-8 [&_svg]:size-4",
|
|
47
|
+
add: "size-11 [&_svg]:size-5"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
active: {
|
|
51
|
+
true: { item: "bg-thumb text-foreground shadow-xs ring-1 ring-border", close: "opacity-100" },
|
|
52
|
+
// Hidden until hover or focus, in a slot that's always reserved, so nothing shifts. On touch it
|
|
53
|
+
// shows but only an active tab's button takes taps.
|
|
54
|
+
false: {
|
|
55
|
+
item: "text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
56
|
+
close: "pointer-events-none opacity-0 group-hover/tab-strip-item:pointer-events-auto group-hover/tab-strip-item:opacity-100 group-focus-visible/tab-strip-item:opacity-100 pointer-coarse:opacity-100 pointer-coarse:group-hover/tab-strip-item:pointer-events-none"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
dragging: {
|
|
60
|
+
true: { item: "z-30 bg-thumb text-foreground shadow-md ring-1 ring-border transition-none" }
|
|
61
|
+
},
|
|
62
|
+
pinned: {
|
|
63
|
+
true: { item: "aspect-square justify-center px-0" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: { size: "sm", active: false }
|
|
67
|
+
});
|
|
68
|
+
const [StripProvider, useStrip] = createContext("TabStrip");
|
|
69
|
+
function TabStrip({
|
|
70
|
+
size = "sm",
|
|
71
|
+
className,
|
|
72
|
+
children,
|
|
73
|
+
"aria-label": ariaLabel,
|
|
74
|
+
"aria-labelledby": ariaLabelledby,
|
|
75
|
+
...props
|
|
76
|
+
}) {
|
|
77
|
+
const slots = tabStripVariants({ size });
|
|
78
|
+
const listRef = React.useRef(null);
|
|
79
|
+
const pendingFocus = React.useRef(null);
|
|
80
|
+
const lastActive = React.useRef({ el: null, count: 0 });
|
|
81
|
+
const roving = useRovingFocus({
|
|
82
|
+
item: "[role=tab]",
|
|
83
|
+
orientation: "horizontal",
|
|
84
|
+
loop: true,
|
|
85
|
+
ref: listRef,
|
|
86
|
+
initial: (tabs) => tabs.find((tab) => tab.getAttribute("aria-selected") === "true")
|
|
87
|
+
});
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
const list = listRef.current;
|
|
90
|
+
if (!list) return;
|
|
91
|
+
const tabs = Array.from(list.querySelectorAll("[role=tab]"));
|
|
92
|
+
if (pendingFocus.current !== null && tabs.length > 0) {
|
|
93
|
+
tabs[Math.min(pendingFocus.current, tabs.length - 1)].focus();
|
|
94
|
+
pendingFocus.current = null;
|
|
95
|
+
}
|
|
96
|
+
const active = tabs.find((tab) => tab.getAttribute("aria-selected") === "true") ?? null;
|
|
97
|
+
const previous = lastActive.current;
|
|
98
|
+
lastActive.current = { el: active, count: tabs.length };
|
|
99
|
+
if (!active || active === previous.el && tabs.length <= previous.count) return;
|
|
100
|
+
const left = active.offsetLeft;
|
|
101
|
+
const right = left + active.offsetWidth;
|
|
102
|
+
if (left < list.scrollLeft) list.scrollLeft = left - 4;
|
|
103
|
+
else if (right > list.scrollLeft + list.clientWidth) list.scrollLeft = right - list.clientWidth + 4;
|
|
104
|
+
});
|
|
105
|
+
React.useEffect(() => {
|
|
106
|
+
const list = listRef.current;
|
|
107
|
+
if (!list) return;
|
|
108
|
+
const onWheel = (event) => {
|
|
109
|
+
if (list.scrollWidth <= list.clientWidth || Math.abs(event.deltaY) <= Math.abs(event.deltaX)) return;
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
list.scrollLeft += event.deltaY;
|
|
112
|
+
};
|
|
113
|
+
list.addEventListener("wheel", onWheel, { passive: false });
|
|
114
|
+
return () => list.removeEventListener("wheel", onWheel);
|
|
115
|
+
}, []);
|
|
116
|
+
const focusAfterRender = React.useCallback((index) => {
|
|
117
|
+
pendingFocus.current = index;
|
|
118
|
+
}, []);
|
|
119
|
+
const indexOf = React.useCallback(
|
|
120
|
+
(el) => Array.from(listRef.current?.querySelectorAll("[role=tab]") ?? []).indexOf(el),
|
|
121
|
+
[]
|
|
122
|
+
);
|
|
123
|
+
return /* @__PURE__ */ jsx(StripProvider, { size, focusAfterRender, indexOf, children: /* @__PURE__ */ jsx("div", { "data-slot": "tab-strip", "data-size": size, className: slots.root({ className }), ...props, children: /* @__PURE__ */ jsx(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
ref: listRef,
|
|
127
|
+
role: "tablist",
|
|
128
|
+
"aria-orientation": "horizontal",
|
|
129
|
+
"aria-label": ariaLabel,
|
|
130
|
+
"aria-labelledby": ariaLabelledby,
|
|
131
|
+
"data-slot": "tab-strip-list",
|
|
132
|
+
className: slots.list(),
|
|
133
|
+
onFocus: roving.onFocus,
|
|
134
|
+
onKeyDown: roving.onKeyDown,
|
|
135
|
+
children
|
|
136
|
+
}
|
|
137
|
+
) }) });
|
|
138
|
+
}
|
|
139
|
+
function TabStripItem({
|
|
140
|
+
label,
|
|
141
|
+
icon: Icon,
|
|
142
|
+
active = false,
|
|
143
|
+
dragging = false,
|
|
144
|
+
onClose,
|
|
145
|
+
closeLabel = "Close tab",
|
|
146
|
+
pinned = false,
|
|
147
|
+
static: _static,
|
|
148
|
+
className,
|
|
149
|
+
onKeyDown,
|
|
150
|
+
onAuxClick,
|
|
151
|
+
onMouseDown,
|
|
152
|
+
// A sortable's role, tab stop and pressed state would break the tab pattern: ignored.
|
|
153
|
+
role: _role,
|
|
154
|
+
tabIndex: _tabIndex,
|
|
155
|
+
"aria-pressed": _pressed,
|
|
156
|
+
...props
|
|
157
|
+
}) {
|
|
158
|
+
void [_static, _role, _tabIndex, _pressed];
|
|
159
|
+
const { size, focusAfterRender, indexOf } = useStrip("TabStripItem");
|
|
160
|
+
const closable = Boolean(onClose) && !pinned;
|
|
161
|
+
const slots = tabStripVariants({ size, active, dragging, pinned });
|
|
162
|
+
return /* @__PURE__ */ jsxs(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
role: "tab",
|
|
166
|
+
"aria-selected": active,
|
|
167
|
+
"aria-keyshortcuts": closable ? "Delete" : void 0,
|
|
168
|
+
"data-slot": "tab-strip-item",
|
|
169
|
+
"data-state": active ? "active" : "inactive",
|
|
170
|
+
"data-active": active,
|
|
171
|
+
"data-dragging": dragging || void 0,
|
|
172
|
+
className: slots.item({ className }),
|
|
173
|
+
onKeyDown: (event) => {
|
|
174
|
+
onKeyDown?.(event);
|
|
175
|
+
if (event.defaultPrevented || event.target !== event.currentTarget) return;
|
|
176
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
event.currentTarget.click();
|
|
179
|
+
} else if (closable && (event.key === "Delete" || event.key === "Backspace")) {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
focusAfterRender(indexOf(event.currentTarget));
|
|
182
|
+
onClose?.();
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
onMouseDown: (event) => {
|
|
186
|
+
onMouseDown?.(event);
|
|
187
|
+
if (event.button === 1 && closable) event.preventDefault();
|
|
188
|
+
},
|
|
189
|
+
onAuxClick: (event) => {
|
|
190
|
+
onAuxClick?.(event);
|
|
191
|
+
if (event.button === 1 && closable) onClose?.();
|
|
192
|
+
},
|
|
193
|
+
...props,
|
|
194
|
+
children: [
|
|
195
|
+
Icon ? /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, weight: "bold" }) : null,
|
|
196
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "tab-strip-label", className: pinned ? "sr-only" : slots.label(), children: label }),
|
|
197
|
+
closable ? /* @__PURE__ */ jsx(
|
|
198
|
+
"span",
|
|
199
|
+
{
|
|
200
|
+
"aria-hidden": true,
|
|
201
|
+
title: closeLabel,
|
|
202
|
+
"data-slot": "tab-strip-close",
|
|
203
|
+
className: slots.close(),
|
|
204
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
205
|
+
onClick: (event) => {
|
|
206
|
+
event.stopPropagation();
|
|
207
|
+
onClose?.();
|
|
208
|
+
},
|
|
209
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
210
|
+
}
|
|
211
|
+
) : null
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function TabStripAdd({
|
|
217
|
+
size = "sm",
|
|
218
|
+
className,
|
|
219
|
+
children,
|
|
220
|
+
static: _static,
|
|
221
|
+
"aria-label": ariaLabel = "New tab",
|
|
222
|
+
...props
|
|
223
|
+
}) {
|
|
224
|
+
void _static;
|
|
225
|
+
return /* @__PURE__ */ jsx(
|
|
226
|
+
"button",
|
|
227
|
+
{
|
|
228
|
+
type: "button",
|
|
229
|
+
tabIndex: -1,
|
|
230
|
+
"aria-label": ariaLabel,
|
|
231
|
+
"data-slot": "tab-strip-add",
|
|
232
|
+
className: tabStripVariants({ size }).add({ className }),
|
|
233
|
+
...props,
|
|
234
|
+
children: children ?? /* @__PURE__ */ jsx(Plus, {})
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
export {
|
|
239
|
+
TabStrip,
|
|
240
|
+
TabStripAdd,
|
|
241
|
+
TabStripItem,
|
|
242
|
+
tabStripVariants
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=tab-strip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/tab-strip/tab-strip.tsx"],"sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { Plus, X } from \"atoms-icons\"\r\n\r\nimport { createContext } from \"../../../lib/create-context.mjs\"\r\nimport { hitBox, hitY } from \"../../../lib/hit-area.mjs\"\r\nimport { useRovingFocus } from \"../../../lib/roving-focus.mjs\"\r\nimport { tv } from \"../../../lib/tv.mjs\"\r\n\r\n/*\r\n * The browser-style row of open documents. Presentation only: the app keeps the list, selects and\r\n * closes, and any drag-and-drop library can reorder it. The strip is one tab stop (the active tab);\r\n * the arrows move focus, Enter or Space selects, Delete or Backspace closes, and a middle click\r\n * closes too. It scrolls sideways instead of wrapping, a vertical wheel included, and keeps the\r\n * active tab in view.\r\n */\r\nexport const tabStripVariants = tv({\r\n slots: {\r\n root: \"flex min-w-0 items-center\",\r\n list: \"relative flex min-w-0 items-center gap-1 overflow-x-auto overflow-y-hidden px-0.5 py-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\r\n item: [\r\n \"group/tab-strip-item flex max-w-60 min-w-0 shrink-0 cursor-pointer items-center rounded-sm select-none font-medium whitespace-nowrap\",\r\n hitY,\r\n \"transition-[color,background-color,box-shadow,opacity,scale] duration-fast ease-out motion-reduce-fade\",\r\n \"outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset [&>svg]:shrink-0\",\r\n ],\r\n label: \"min-w-0 truncate\",\r\n close: [\r\n \"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-xs\",\r\n hitY,\r\n \"text-muted-foreground hover:bg-accent hover:text-foreground transition-[color,background-color,opacity] duration-fast ease-out motion-reduce-fade\",\r\n ],\r\n add: [\r\n \"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm\",\r\n hitBox,\r\n \"text-muted-foreground hover:bg-accent hover:text-foreground transition-[color,background-color,scale] duration-fast ease-out motion-reduce-fade\",\r\n \"outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0\",\r\n ],\r\n },\r\n variants: {\r\n size: {\r\n sm: {\r\n item: \"h-7 gap-1.5 px-2.5 text-xs [&>svg]:size-4\",\r\n close: \"-mr-1 size-5 [&_svg]:size-3\",\r\n add: \"size-7 [&_svg]:size-3.5\",\r\n },\r\n md: {\r\n item: \"h-9 gap-2 px-3 text-sm [&>svg]:size-5\",\r\n close: \"-mr-1.5 size-6 [&_svg]:size-3.5\",\r\n add: \"size-9 [&_svg]:size-4\",\r\n },\r\n lg: {\r\n item: \"h-11 gap-2 px-4 text-sm [&>svg]:size-5\",\r\n close: \"-mr-2 size-8 [&_svg]:size-4\",\r\n add: \"size-11 [&_svg]:size-5\",\r\n },\r\n },\r\n active: {\r\n true: { item: \"bg-thumb text-foreground shadow-xs ring-1 ring-border\", close: \"opacity-100\" },\r\n // Hidden until hover or focus, in a slot that's always reserved, so nothing shifts. On touch it\r\n // shows but only an active tab's button takes taps.\r\n false: {\r\n item: \"text-muted-foreground hover:bg-accent hover:text-foreground\",\r\n close:\r\n \"pointer-events-none opacity-0 group-hover/tab-strip-item:pointer-events-auto group-hover/tab-strip-item:opacity-100 group-focus-visible/tab-strip-item:opacity-100 pointer-coarse:opacity-100 pointer-coarse:group-hover/tab-strip-item:pointer-events-none\",\r\n },\r\n },\r\n dragging: {\r\n true: { item: \"z-30 bg-thumb text-foreground shadow-md ring-1 ring-border transition-none\" },\r\n },\r\n pinned: {\r\n true: { item: \"aspect-square justify-center px-0\" },\r\n },\r\n },\r\n defaultVariants: { size: \"sm\", active: false },\r\n})\r\n\r\nexport type TabStripSize = \"sm\" | \"md\" | \"lg\"\r\n\r\ninterface StripContextValue {\r\n size: TabStripSize\r\n /** Focus the tab at this index after the next render (a closed tab's neighbour). */\r\n focusAfterRender: (index: number) => void\r\n indexOf: (el: HTMLElement) => number\r\n}\r\n\r\nconst [StripProvider, useStrip] = createContext<StripContextValue>(\"TabStrip\")\r\n\r\nexport interface TabStripProps extends React.ComponentProps<\"div\"> {\r\n /** Tab height: 28, 36 or 44px, shared with every item and the add button. */\r\n size?: TabStripSize\r\n}\r\n\r\nexport function TabStrip({\r\n size = \"sm\",\r\n className,\r\n children,\r\n \"aria-label\": ariaLabel,\r\n \"aria-labelledby\": ariaLabelledby,\r\n ...props\r\n}: TabStripProps) {\r\n const slots = tabStripVariants({ size })\r\n const listRef = React.useRef<HTMLDivElement>(null)\r\n const pendingFocus = React.useRef<number | null>(null)\r\n const lastActive = React.useRef<{ el: Element | null; count: number }>({ el: null, count: 0 })\r\n const roving = useRovingFocus<HTMLDivElement>({\r\n item: \"[role=tab]\",\r\n orientation: \"horizontal\",\r\n loop: true,\r\n ref: listRef,\r\n initial: (tabs) => tabs.find((tab) => tab.getAttribute(\"aria-selected\") === \"true\"),\r\n })\r\n\r\n // After each render: honour a pending focus, and keep the active tab in view when it changes or a\r\n // tab opens. Only the strip scrolls, never the page.\r\n React.useEffect(() => {\r\n const list = listRef.current\r\n if (!list) return\r\n const tabs = Array.from(list.querySelectorAll<HTMLElement>(\"[role=tab]\"))\r\n if (pendingFocus.current !== null && tabs.length > 0) {\r\n tabs[Math.min(pendingFocus.current, tabs.length - 1)].focus()\r\n pendingFocus.current = null\r\n }\r\n const active = tabs.find((tab) => tab.getAttribute(\"aria-selected\") === \"true\") ?? null\r\n const previous = lastActive.current\r\n lastActive.current = { el: active, count: tabs.length }\r\n if (!active || (active === previous.el && tabs.length <= previous.count)) return\r\n const left = active.offsetLeft\r\n const right = left + active.offsetWidth\r\n if (left < list.scrollLeft) list.scrollLeft = left - 4\r\n else if (right > list.scrollLeft + list.clientWidth) list.scrollLeft = right - list.clientWidth + 4\r\n })\r\n\r\n // A vertical wheel scrolls the strip sideways while it overflows.\r\n React.useEffect(() => {\r\n const list = listRef.current\r\n if (!list) return\r\n const onWheel = (event: WheelEvent) => {\r\n if (list.scrollWidth <= list.clientWidth || Math.abs(event.deltaY) <= Math.abs(event.deltaX)) return\r\n event.preventDefault()\r\n list.scrollLeft += event.deltaY\r\n }\r\n list.addEventListener(\"wheel\", onWheel, { passive: false })\r\n return () => list.removeEventListener(\"wheel\", onWheel)\r\n }, [])\r\n\r\n const focusAfterRender = React.useCallback((index: number) => {\r\n pendingFocus.current = index\r\n }, [])\r\n const indexOf = React.useCallback(\r\n (el: HTMLElement) => Array.from(listRef.current?.querySelectorAll(\"[role=tab]\") ?? []).indexOf(el),\r\n [],\r\n )\r\n\r\n return (\r\n <StripProvider size={size} focusAfterRender={focusAfterRender} indexOf={indexOf}>\r\n <div data-slot=\"tab-strip\" data-size={size} className={slots.root({ className })} {...props}>\r\n <div\r\n ref={listRef}\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n aria-label={ariaLabel}\r\n aria-labelledby={ariaLabelledby}\r\n data-slot=\"tab-strip-list\"\r\n className={slots.list()}\r\n onFocus={roving.onFocus}\r\n onKeyDown={roving.onKeyDown}\r\n >\r\n {children}\r\n </div>\r\n </div>\r\n </StripProvider>\r\n )\r\n}\r\n\r\nexport interface TabStripItemProps extends Omit<React.ComponentProps<\"div\">, \"children\"> {\r\n /** The tab's text. Truncates. */\r\n label: React.ReactNode\r\n /** A leading glyph: the icon component, not an element (icon={House}). */\r\n icon?: React.ElementType\r\n /** The selected tab: lifted, its close button always visible, and the strip's one tab stop. */\r\n active?: boolean\r\n /** Being dragged by a sortable library: lifted above its neighbours, with no transition. */\r\n dragging?: boolean\r\n /** Makes the tab closable: the close button, a middle click, and Delete or Backspace while focused. */\r\n onClose?: () => void\r\n /** The close button's hint on hover. */\r\n closeLabel?: string\r\n /** A pinned tab: the icon alone in a square, never closable. The label stays for screen readers. */\r\n pinned?: boolean\r\n /** Kept for compatibility; controls no longer scale on press. */\r\n static?: boolean\r\n}\r\n\r\n/** One tab, a role=\"tab\" div. Takes a ref and forwards every other prop (a sortable's listeners too). */\r\nexport function TabStripItem({\r\n label,\r\n icon: Icon,\r\n active = false,\r\n dragging = false,\r\n onClose,\r\n closeLabel = \"Close tab\",\r\n pinned = false,\r\n static: _static,\r\n className,\r\n onKeyDown,\r\n onAuxClick,\r\n onMouseDown,\r\n // A sortable's role, tab stop and pressed state would break the tab pattern: ignored.\r\n role: _role,\r\n tabIndex: _tabIndex,\r\n \"aria-pressed\": _pressed,\r\n ...props\r\n}: TabStripItemProps) {\r\n void [_static, _role, _tabIndex, _pressed]\r\n const { size, focusAfterRender, indexOf } = useStrip(\"TabStripItem\")\r\n const closable = Boolean(onClose) && !pinned\r\n const slots = tabStripVariants({ size, active, dragging, pinned })\r\n\r\n return (\r\n <div\r\n role=\"tab\"\r\n aria-selected={active}\r\n aria-keyshortcuts={closable ? \"Delete\" : undefined}\r\n data-slot=\"tab-strip-item\"\r\n data-state={active ? \"active\" : \"inactive\"}\r\n data-active={active}\r\n data-dragging={dragging || undefined}\r\n className={slots.item({ className })}\r\n onKeyDown={(event) => {\r\n onKeyDown?.(event)\r\n if (event.defaultPrevented || event.target !== event.currentTarget) return\r\n if (event.key === \"Enter\" || event.key === \" \") {\r\n event.preventDefault()\r\n event.currentTarget.click()\r\n } else if (closable && (event.key === \"Delete\" || event.key === \"Backspace\")) {\r\n event.preventDefault()\r\n focusAfterRender(indexOf(event.currentTarget))\r\n onClose?.()\r\n }\r\n }}\r\n onMouseDown={(event) => {\r\n onMouseDown?.(event)\r\n // A middle press would start the browser's autoscroll.\r\n if (event.button === 1 && closable) event.preventDefault()\r\n }}\r\n onAuxClick={(event) => {\r\n onAuxClick?.(event)\r\n if (event.button === 1 && closable) onClose?.()\r\n }}\r\n {...props}\r\n >\r\n {Icon ? <Icon aria-hidden weight=\"bold\" /> : null}\r\n <span data-slot=\"tab-strip-label\" className={pinned ? \"sr-only\" : slots.label()}>\r\n {label}\r\n </span>\r\n {closable ? (\r\n <span\r\n aria-hidden\r\n title={closeLabel}\r\n data-slot=\"tab-strip-close\"\r\n className={slots.close()}\r\n onPointerDown={(event) => event.stopPropagation()}\r\n onClick={(event) => {\r\n event.stopPropagation()\r\n onClose?.()\r\n }}\r\n >\r\n <X />\r\n </span>\r\n ) : null}\r\n </div>\r\n )\r\n}\r\n\r\nexport interface TabStripAddProps extends React.ComponentProps<\"button\"> {\r\n /** Match the strip's size (it sits outside the strip, so it can't read it). */\r\n size?: TabStripSize\r\n /** Kept for compatibility; controls no longer scale on press. */\r\n static?: boolean\r\n}\r\n\r\n/** The new-tab button. Place it beside the strip: a tablist may only hold tabs. */\r\nexport function TabStripAdd({\r\n size = \"sm\",\r\n className,\r\n children,\r\n static: _static,\r\n \"aria-label\": ariaLabel = \"New tab\",\r\n ...props\r\n}: TabStripAddProps) {\r\n void _static\r\n return (\r\n <button\r\n type=\"button\"\r\n tabIndex={-1}\r\n aria-label={ariaLabel}\r\n data-slot=\"tab-strip-add\"\r\n className={tabStripVariants({ size }).add({ className })}\r\n {...props}\r\n >\r\n {children ?? <Plus />}\r\n </button>\r\n )\r\n}\r\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
TableHeader,
|
|
4
|
+
TableBody,
|
|
5
|
+
TableFooter,
|
|
6
|
+
TableCaption,
|
|
7
|
+
TableRow,
|
|
8
|
+
TableHead,
|
|
9
|
+
TableCell,
|
|
10
|
+
TableCellText,
|
|
11
|
+
TableEmpty,
|
|
12
|
+
tableVariants
|
|
13
|
+
} from "./table.mjs";
|
|
14
|
+
export {
|
|
15
|
+
Table,
|
|
16
|
+
TableBody,
|
|
17
|
+
TableCaption,
|
|
18
|
+
TableCell,
|
|
19
|
+
TableCellText,
|
|
20
|
+
TableEmpty,
|
|
21
|
+
TableFooter,
|
|
22
|
+
TableHead,
|
|
23
|
+
TableHeader,
|
|
24
|
+
TableRow,
|
|
25
|
+
tableVariants
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/table/index.ts"],"sourcesContent":["export {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableCaption,\n TableRow,\n TableHead,\n TableCell,\n TableCellText,\n TableEmpty,\n tableVariants,\n type TableProps,\n type TableRowProps,\n type TableHeadProps,\n type TableCellProps,\n type TableCellTextProps,\n type TableEmptyProps,\n type TableAlign,\n type TableSticky,\n} from \"./table.mjs\"\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;","names":[]}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useDensity } from "../../../lib/density.mjs";
|
|
5
|
+
import { tv } from "../../../lib/tv.mjs";
|
|
6
|
+
const roundedRows = [
|
|
7
|
+
"[&_td]:border-b-0 [&_th]:border-b-0 [&_tbody>tr]:bg-transparent!",
|
|
8
|
+
"[&_tbody>tr>td]:transition-colors [&_tbody>tr>td]:duration-fast [&_tbody>tr>td]:ease-out",
|
|
9
|
+
"[&_tbody>tr>td:first-child]:rounded-s-(--table-row-radius) [&_tbody>tr>td:last-child]:rounded-e-(--table-row-radius)",
|
|
10
|
+
"[&_td[data-sticky]]:bg-(--table-surface) [&_td[data-dragging]]:bg-(--table-surface)",
|
|
11
|
+
"[&_tbody>tr[data-dragging]>td]:bg-[color-mix(in_oklab,var(--foreground)_4%,var(--table-surface))]",
|
|
12
|
+
"[&_tbody>tr[data-state=selected]>td]:bg-[color-mix(in_oklab,var(--foreground)_5%,var(--table-surface))]",
|
|
13
|
+
"[&_tbody>tr[aria-current=true]>td]:bg-[color-mix(in_oklab,var(--foreground)_7%,var(--table-surface))]"
|
|
14
|
+
];
|
|
15
|
+
const tableVariants = tv({
|
|
16
|
+
slots: {
|
|
17
|
+
container: [
|
|
18
|
+
"relative isolate overflow-auto outline-none [--table-surface:var(--surface,var(--background))]",
|
|
19
|
+
// Outside the box: the rows are opaque and would cover a ring drawn inside it.
|
|
20
|
+
"focus-visible:outline-2 focus-visible:outline-focus focus-visible:outline-solid"
|
|
21
|
+
],
|
|
22
|
+
table: "w-full border-separate border-spacing-0 text-sm",
|
|
23
|
+
header: "",
|
|
24
|
+
body: [
|
|
25
|
+
"[&>tr[aria-current=true]]:bg-[color-mix(in_oklab,var(--foreground)_5%,var(--table-surface))] dark:[&>tr[aria-current=true]]:bg-[color-mix(in_oklab,var(--foreground)_9%,var(--table-surface))]"
|
|
26
|
+
],
|
|
27
|
+
footer: "bg-[color-mix(in_oklab,var(--muted)_50%,var(--table-surface))] font-medium tabular-nums [&>tr]:bg-inherit [&>tr>td]:border-t [&>tr>td]:border-b-0 [&>tr>td]:border-border",
|
|
28
|
+
row: "bg-(--table-surface) transition-colors duration-fast ease-out data-[state=selected]:bg-muted",
|
|
29
|
+
head: "border-b border-border text-start align-middle font-medium whitespace-nowrap text-muted-foreground transition-[height,padding] duration-base ease-out motion-reduce-fade",
|
|
30
|
+
cell: "border-b border-border align-middle whitespace-nowrap transition-[height,padding] duration-base ease-out motion-reduce-fade [tbody>tr:last-child>&]:border-b-0",
|
|
31
|
+
caption: "caption-bottom pt-3 text-start text-sm text-muted-foreground",
|
|
32
|
+
cellText: "flex min-w-0 flex-col gap-0.5"
|
|
33
|
+
},
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
minimal: {
|
|
37
|
+
// Bleeds a strip past the table and pads it back, so a focus ring at the edge isn't clipped.
|
|
38
|
+
container: [
|
|
39
|
+
"[--table-bleed:max(4px,--spacing(1))] [--table-pad:var(--table-bleed)]",
|
|
40
|
+
"-m-(--table-bleed) w-[calc(100%+var(--table-bleed)*2)] scroll-p-(--table-bleed) p-(--table-bleed)",
|
|
41
|
+
"scroll-fade-x has-[[data-sticky]]:[-webkit-mask-image:none] has-[[data-sticky]]:[mask-image:none]"
|
|
42
|
+
],
|
|
43
|
+
table: [
|
|
44
|
+
"[&_tr>*:first-child]:ps-0 [&_tr>*:last-child]:pe-0",
|
|
45
|
+
"[&_tr>[data-sticky]:first-child]:shadow-[calc(var(--table-bleed)*-1)_0_0_var(--table-surface)] rtl:[&_tr>[data-sticky]:first-child]:shadow-[var(--table-bleed)_0_0_var(--table-surface)]",
|
|
46
|
+
"[&_tr>[data-sticky]:last-child]:shadow-[var(--table-bleed)_0_0_var(--table-surface)] rtl:[&_tr>[data-sticky]:last-child]:shadow-[calc(var(--table-bleed)*-1)_0_0_var(--table-surface)]"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
container: { container: "w-full rounded-xl bg-(--table-surface) text-card-foreground ring-1 ring-border" },
|
|
50
|
+
"full-bleed": {
|
|
51
|
+
container: [
|
|
52
|
+
"[--table-edge:var(--card-inset,var(--page-inset,0px))] [--table-inset:var(--card-inset,var(--page-inset,calc(var(--spacing)*4)))]",
|
|
53
|
+
// Its card would clip a ring outside.
|
|
54
|
+
"mx-[calc(var(--table-edge)*-1)] w-[calc(100%+var(--table-edge)*2)] focus-visible:-outline-offset-2",
|
|
55
|
+
"[[data-slot=card-content]:last-child>&:last-child]:-mb-(--card-inset) [[data-slot=card-content]:last-child>&:last-child]:rounded-b-xl",
|
|
56
|
+
"scroll-fade-x has-[[data-sticky]]:[-webkit-mask-image:none] has-[[data-sticky]]:[mask-image:none]"
|
|
57
|
+
],
|
|
58
|
+
table: "[&_tr>*:first-child]:ps-(--table-inset) [&_tr>*:last-child]:pe-(--table-inset)"
|
|
59
|
+
},
|
|
60
|
+
rounded: {
|
|
61
|
+
container: [
|
|
62
|
+
"[--table-bleed:calc(var(--spacing)*3)] [--table-pad:--spacing(1)] [--table-row-radius:var(--radius-md)]",
|
|
63
|
+
"-mx-(--table-bleed) -my-1 w-[calc(100%+var(--table-bleed)*2)] px-(--table-bleed) py-1",
|
|
64
|
+
"scroll-fade-x has-[[data-sticky]]:[-webkit-mask-image:none] has-[[data-sticky]]:[mask-image:none]"
|
|
65
|
+
],
|
|
66
|
+
// The chips reach a step past the text, so the columns line up with the heading above.
|
|
67
|
+
table: [
|
|
68
|
+
...roundedRows,
|
|
69
|
+
"-mx-(--table-bleed) w-[calc(100%+var(--table-bleed)*2)] [&_tr>*:first-child]:ps-(--table-bleed) [&_tr>*:last-child]:pe-(--table-bleed)"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
inset: {
|
|
73
|
+
container: "w-full rounded-xl bg-(--table-surface) p-1.5 text-card-foreground ring-1 ring-border [--table-pad:calc(var(--spacing)*1.5)] [--table-row-radius:calc(var(--radius-xl)-var(--spacing)*1.5)]",
|
|
74
|
+
table: roundedRows
|
|
75
|
+
},
|
|
76
|
+
separated: {
|
|
77
|
+
container: "-my-2 w-full py-0.5 [--table-pad:--spacing(0.5)] [--table-row-radius:var(--radius-lg)]",
|
|
78
|
+
table: [
|
|
79
|
+
...roundedRows,
|
|
80
|
+
"border-spacing-y-2 [&_tbody>tr>td]:bg-(--table-surface)",
|
|
81
|
+
"[&_tbody>tr>td]:shadow-[inset_0_1px_0_0_var(--border),inset_0_-1px_0_0_var(--border)]",
|
|
82
|
+
"[&_tbody>tr>td:first-child]:shadow-[inset_1px_0_0_0_var(--border),inset_0_1px_0_0_var(--border),inset_0_-1px_0_0_var(--border)] rtl:[&_tbody>tr>td:first-child]:shadow-[inset_-1px_0_0_0_var(--border),inset_0_1px_0_0_var(--border),inset_0_-1px_0_0_var(--border)]",
|
|
83
|
+
"[&_tbody>tr>td:last-child]:shadow-[inset_-1px_0_0_0_var(--border),inset_0_1px_0_0_var(--border),inset_0_-1px_0_0_var(--border)] rtl:[&_tbody>tr>td:last-child]:shadow-[inset_1px_0_0_0_var(--border),inset_0_1px_0_0_var(--border),inset_0_-1px_0_0_var(--border)]",
|
|
84
|
+
"[&_tbody>tr>td:only-child]:shadow-[inset_0_0_0_1px_var(--border)]"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
density: {
|
|
89
|
+
compact: { container: "[--table-head-h:--spacing(9)]", head: "h-9 px-3", cell: "h-9 px-3 py-1.5" },
|
|
90
|
+
comfortable: { container: "[--table-head-h:--spacing(12)]", head: "h-12 px-4", cell: "h-12 px-4 py-3" }
|
|
91
|
+
},
|
|
92
|
+
striped: {
|
|
93
|
+
// Skips rows that already say something else.
|
|
94
|
+
true: {
|
|
95
|
+
body: "[&>tr:nth-child(even_of_:not([data-static])):not(:hover,[data-state=selected],[aria-current=true])]:bg-[color-mix(in_oklab,var(--muted)_40%,var(--table-surface))]"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
hoverable: { true: {} },
|
|
99
|
+
stickyHeader: {
|
|
100
|
+
true: {
|
|
101
|
+
container: "scroll-pt-[calc(var(--table-head-h)+var(--table-pad,4px))]",
|
|
102
|
+
head: "sticky top-[calc(var(--table-pad,0px)*-1)] z-20 bg-(--table-surface)"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
align: {
|
|
106
|
+
start: {},
|
|
107
|
+
center: { head: "text-center", cell: "text-center" },
|
|
108
|
+
end: { head: "text-end", cell: "text-end" }
|
|
109
|
+
},
|
|
110
|
+
numeric: { true: { cell: "text-end tabular-nums" } },
|
|
111
|
+
sticky: {
|
|
112
|
+
start: {
|
|
113
|
+
head: "sticky start-0 z-30 border-e bg-(--table-surface)",
|
|
114
|
+
cell: "sticky start-0 z-10 border-e bg-inherit"
|
|
115
|
+
},
|
|
116
|
+
end: {
|
|
117
|
+
head: "sticky end-0 z-30 border-s bg-(--table-surface)",
|
|
118
|
+
cell: "sticky end-0 z-10 border-s bg-inherit"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
compoundVariants: [
|
|
123
|
+
{
|
|
124
|
+
hoverable: true,
|
|
125
|
+
variant: ["minimal", "container", "full-bleed"],
|
|
126
|
+
class: {
|
|
127
|
+
body: [
|
|
128
|
+
"[@media(hover:hover)]:[&>tr:not([data-static],[data-state=selected]):hover]:bg-[color-mix(in_oklab,var(--muted)_50%,var(--table-surface))]",
|
|
129
|
+
"[@media(hover:hover)]:[&>tr[aria-current=true]:hover]:bg-[color-mix(in_oklab,var(--foreground)_7%,var(--table-surface))] dark:[@media(hover:hover)]:[&>tr[aria-current=true]:hover]:bg-[color-mix(in_oklab,var(--foreground)_12%,var(--table-surface))]"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
hoverable: true,
|
|
135
|
+
variant: ["rounded", "inset", "separated"],
|
|
136
|
+
class: {
|
|
137
|
+
table: "[@media(hover:hover)]:[&_tbody>tr:not([data-static],[data-state=selected],[aria-current=true]):hover>td]:bg-[color-mix(in_oklab,var(--foreground)_4%,var(--table-surface))]"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
defaultVariants: { variant: "minimal", density: "compact", hoverable: true, align: "start" }
|
|
142
|
+
});
|
|
143
|
+
const TableContext = React.createContext(null);
|
|
144
|
+
function useTableContext(part) {
|
|
145
|
+
const ctx = React.useContext(TableContext);
|
|
146
|
+
if (!ctx) throw new Error(`<${part}> must be used within <Table>`);
|
|
147
|
+
return ctx;
|
|
148
|
+
}
|
|
149
|
+
function Table({
|
|
150
|
+
label,
|
|
151
|
+
variant = "minimal",
|
|
152
|
+
density: densityProp,
|
|
153
|
+
striped = false,
|
|
154
|
+
hoverable = true,
|
|
155
|
+
stickyHeader = false,
|
|
156
|
+
containerProps,
|
|
157
|
+
containerRef: containerRefProp,
|
|
158
|
+
className,
|
|
159
|
+
children,
|
|
160
|
+
...props
|
|
161
|
+
}) {
|
|
162
|
+
const density = useDensity(densityProp);
|
|
163
|
+
const slots = tableVariants({ variant, density, striped, hoverable, stickyHeader });
|
|
164
|
+
const containerRef = React.useRef(null);
|
|
165
|
+
React.useImperativeHandle(containerRefProp, () => containerRef.current, []);
|
|
166
|
+
const [scrolls, setScrolls] = React.useState(null);
|
|
167
|
+
React.useEffect(() => {
|
|
168
|
+
const box = containerRef.current;
|
|
169
|
+
const table = box?.querySelector("table");
|
|
170
|
+
if (!box || !table) return;
|
|
171
|
+
const observer = new ResizeObserver(() => {
|
|
172
|
+
const overflows = box.scrollWidth > box.clientWidth + 1 || box.scrollHeight > box.clientHeight + 1;
|
|
173
|
+
setScrolls((was) => !overflows ? null : was && was.captionId === table.caption?.id ? was : { captionId: table.caption?.id });
|
|
174
|
+
});
|
|
175
|
+
observer.observe(box);
|
|
176
|
+
observer.observe(table);
|
|
177
|
+
return () => observer.disconnect();
|
|
178
|
+
}, []);
|
|
179
|
+
const context = React.useMemo(
|
|
180
|
+
() => ({ variant, density, striped, hoverable, stickyHeader }),
|
|
181
|
+
[variant, density, striped, hoverable, stickyHeader]
|
|
182
|
+
);
|
|
183
|
+
const { className: containerClassName, ...containerRest } = containerProps ?? {};
|
|
184
|
+
const named = Boolean(label || scrolls?.captionId);
|
|
185
|
+
return /* @__PURE__ */ jsx(TableContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
ref: containerRef,
|
|
189
|
+
"data-slot": "table-container",
|
|
190
|
+
"data-variant": variant,
|
|
191
|
+
tabIndex: scrolls ? 0 : void 0,
|
|
192
|
+
role: scrolls && named ? "region" : void 0,
|
|
193
|
+
"aria-label": scrolls && label ? label : void 0,
|
|
194
|
+
"aria-labelledby": scrolls && !label ? scrolls.captionId : void 0,
|
|
195
|
+
className: slots.container({ className: containerClassName }),
|
|
196
|
+
...containerRest,
|
|
197
|
+
children: /* @__PURE__ */ jsx("table", { "data-slot": "table", "aria-label": label, className: slots.table({ className }), ...props, children })
|
|
198
|
+
}
|
|
199
|
+
) });
|
|
200
|
+
}
|
|
201
|
+
function TableHeader({ className, ...props }) {
|
|
202
|
+
return /* @__PURE__ */ jsx("thead", { "data-slot": "table-header", className: tableVariants(useTableContext("TableHeader")).header({ className }), ...props });
|
|
203
|
+
}
|
|
204
|
+
function TableBody({ className, ...props }) {
|
|
205
|
+
return /* @__PURE__ */ jsx("tbody", { "data-slot": "table-body", className: tableVariants(useTableContext("TableBody")).body({ className }), ...props });
|
|
206
|
+
}
|
|
207
|
+
function TableFooter({ className, ...props }) {
|
|
208
|
+
return /* @__PURE__ */ jsx("tfoot", { "data-slot": "table-footer", className: tableVariants(useTableContext("TableFooter")).footer({ className }), ...props });
|
|
209
|
+
}
|
|
210
|
+
function TableCaption({ className, id, ...props }) {
|
|
211
|
+
const auto = React.useId();
|
|
212
|
+
return /* @__PURE__ */ jsx(
|
|
213
|
+
"caption",
|
|
214
|
+
{
|
|
215
|
+
"data-slot": "table-caption",
|
|
216
|
+
id: id ?? auto,
|
|
217
|
+
className: tableVariants(useTableContext("TableCaption")).caption({ className }),
|
|
218
|
+
...props
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
function TableRow({ selected, current, className, ...props }) {
|
|
223
|
+
return /* @__PURE__ */ jsx(
|
|
224
|
+
"tr",
|
|
225
|
+
{
|
|
226
|
+
"data-slot": "table-row",
|
|
227
|
+
"data-state": selected ? "selected" : void 0,
|
|
228
|
+
"aria-current": current ? "true" : void 0,
|
|
229
|
+
className: tableVariants(useTableContext("TableRow")).row({ className }),
|
|
230
|
+
...props
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function TableHead({ align = "start", sticky, className, ...props }) {
|
|
235
|
+
const ctx = useTableContext("TableHead");
|
|
236
|
+
return /* @__PURE__ */ jsx(
|
|
237
|
+
"th",
|
|
238
|
+
{
|
|
239
|
+
scope: "col",
|
|
240
|
+
"data-slot": "table-head",
|
|
241
|
+
"data-sticky": sticky,
|
|
242
|
+
className: tableVariants({ ...ctx, align, sticky }).head({ className }),
|
|
243
|
+
...props
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
function TableCell({ align = "start", numeric, sticky, className, ...props }) {
|
|
248
|
+
const ctx = useTableContext("TableCell");
|
|
249
|
+
return /* @__PURE__ */ jsx(
|
|
250
|
+
"td",
|
|
251
|
+
{
|
|
252
|
+
"data-slot": "table-cell",
|
|
253
|
+
"data-sticky": sticky,
|
|
254
|
+
className: tableVariants({ ...ctx, align, numeric, sticky }).cell({ className }),
|
|
255
|
+
...props
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
function TableCellText({ primary, secondary, className, ...props }) {
|
|
260
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "table-cell-text", className: tableVariants().cellText({ className }), ...props, children: [
|
|
261
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium text-foreground", children: primary }),
|
|
262
|
+
secondary ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: secondary }) : null
|
|
263
|
+
] });
|
|
264
|
+
}
|
|
265
|
+
function TableEmpty({ colSpan, className, children = "No results.", ...props }) {
|
|
266
|
+
return /* @__PURE__ */ jsx(TableRow, { "data-static": "", children: /* @__PURE__ */ jsx(
|
|
267
|
+
TableCell,
|
|
268
|
+
{
|
|
269
|
+
colSpan,
|
|
270
|
+
align: "center",
|
|
271
|
+
className: className ?? "h-24 text-muted-foreground",
|
|
272
|
+
...props,
|
|
273
|
+
children
|
|
274
|
+
}
|
|
275
|
+
) });
|
|
276
|
+
}
|
|
277
|
+
export {
|
|
278
|
+
Table,
|
|
279
|
+
TableBody,
|
|
280
|
+
TableCaption,
|
|
281
|
+
TableCell,
|
|
282
|
+
TableCellText,
|
|
283
|
+
TableEmpty,
|
|
284
|
+
TableFooter,
|
|
285
|
+
TableHead,
|
|
286
|
+
TableHeader,
|
|
287
|
+
TableRow,
|
|
288
|
+
tableVariants
|
|
289
|
+
};
|
|
290
|
+
//# sourceMappingURL=table.mjs.map
|