@adea-ai/ui 0.162.6 → 0.162.7
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/dist/components/composites/about-dialog/about-dialog.js +5 -5
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +3 -3
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +22 -22
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.js +7 -7
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +5 -5
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +13 -13
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js +7 -7
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +9 -9
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js +5 -5
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +10 -10
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +117 -117
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +7 -7
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js +2 -2
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +7 -7
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +12 -12
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js +5 -5
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/prompt-input/prompt-input.js +3 -3
- package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
- package/dist/components/composites/queue/queue.js +13 -13
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +5 -5
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +16 -16
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +2 -2
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +2 -2
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js +5 -5
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js +5 -5
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +10 -10
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js +6 -6
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js +5 -5
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js +2 -2
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js +5 -5
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.js +1 -1
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +18 -18
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js +17 -17
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js +5 -5
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js +6 -6
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +1 -1
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +23 -23
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js +1 -1
- package/dist/components/conversation/busy-send-button.js +10 -10
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js +1 -1
- package/dist/components/conversation/composer-core.js +1 -1
- package/dist/components/conversation/composer-menu.js +2 -2
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +7 -7
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +5 -5
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -9
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js +13 -13
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/scroll-follow.js +1 -1
- package/dist/components/conversation/thread-panel.js +5 -5
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js +5 -5
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +7 -7
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js +2 -2
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +5 -5
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +2 -2
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +7 -7
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +5 -5
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js +1 -1
- package/dist/components/theme/appearance-panel.js +3 -3
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.js +3 -3
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/script-projection.js +1 -1
- package/dist/components/theme/theme-catalogue-source.js +1 -1
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +7 -7
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js +2 -2
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.js +1 -1
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-provider.js +1 -1
- package/dist/components/theme/theme-toggle.js +7 -7
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +13 -13
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js +12 -12
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +16 -16
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js +2 -2
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button-group/button-group.js +2 -2
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +8 -8
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js +2 -2
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js +8 -8
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js +2 -2
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +6 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js +6 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +7 -7
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +21 -21
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js +1 -1
- package/dist/components/ui/command/command.js +23 -23
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/detail-panel/detail-panel.js +5 -5
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +2 -2
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +21 -21
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js +2 -2
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js +14 -14
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js +5 -5
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +2 -2
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js +14 -14
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js +2 -2
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js +10 -10
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js +2 -2
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +2 -2
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js +2 -2
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js +2 -2
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +7 -7
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js +3 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +5 -5
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +28 -28
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js +15 -15
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js +5 -5
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +10 -10
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +9 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js +11 -11
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +21 -21
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js +5 -5
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js +6 -6
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js +5 -5
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js +5 -5
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +2 -2
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js +4 -4
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +7 -7
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +2 -2
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +7 -7
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js +6 -6
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js +7 -8
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
- package/dist/components/ui/tooltip/tooltip.js +10 -10
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js +19 -19
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js +2 -2
- package/dist/lib/accent-presets.js +1 -1
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/async-action.js +1 -1
- package/dist/lib/create-poll.js +1 -1
- package/dist/lib/create-poll.js.map +1 -1
- package/dist/lib/external-link.js +1 -1
- package/dist/lib/external-link.js.map +1 -1
- package/dist/lib/fast-icon.js +1 -1
- package/dist/lib/theme-css.js +1 -1
- package/dist/lib/theme-engine-light.js +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-records.js +1 -1
- package/dist/lib/themes.js +1 -1
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/vite/source-parser.js +1 -1
- package/dist/vite/tailwind-sources.js +1 -1
- package/package.json +7 -7
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { className, createComponent, effect, insert, memo, mergeProps, readShallow, template } from "@solidjs/web";
|
|
2
|
+
import { Resizable, ResizableHandle as ResizableHandle$1, ResizablePanel as ResizablePanel$1 } from "@ui-sdk/solid/resizable";
|
|
3
|
+
import { GripVertical as GripVertical$1 } from "@lucide/solid";
|
|
4
|
+
import { children, createEffect, omit } from "solid-js";
|
|
1
5
|
import { cn } from "../../../lib/utils.js";
|
|
2
6
|
import { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from "../../../lib/resize-separator.js";
|
|
3
7
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
|
-
import { className, createComponent, effect, insert, memo, mergeProps, readShallow, template } from "@solidjs/web";
|
|
5
|
-
import { GripVertical } from "@lucide/solid";
|
|
6
|
-
import { children, createEffect, omit } from "solid-js";
|
|
7
|
-
import { Resizable, ResizableHandle, ResizablePanel } from "@ui-sdk/solid/resizable";
|
|
8
8
|
// src/components/ui/resizable/resizable.tsx
|
|
9
9
|
var _tmpl$ = /* @__PURE__ */ template(`<div data-slot=resizable-grip>`);
|
|
10
10
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
11
|
-
var GripVertical
|
|
11
|
+
var GripVertical = fastIcon(GripVertical$1);
|
|
12
12
|
var toSdkSize = (size) => typeof size === "number" ? size * 100 : size;
|
|
13
13
|
var toPercents = (sizes) => sizes?.map((size) => size * 100);
|
|
14
14
|
var toFractions = (layout) => layout.map((size) => size / 100);
|
|
@@ -55,11 +55,11 @@ function PanelCallbacks(props) {
|
|
|
55
55
|
return props.children;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function ResizablePanel
|
|
58
|
+
function ResizablePanel(props) {
|
|
59
59
|
const rest = omit(props, "class", "children", "initialSize", "minSize", "maxSize", "collapsedSize", "panelId", "onResize", "onCollapse", "onExpand");
|
|
60
60
|
const listens = () => !!(props.onResize || props.onCollapse || props.onExpand);
|
|
61
61
|
const content = children(() => props.children);
|
|
62
|
-
return createComponent(ResizablePanel, mergeProps(rest, {
|
|
62
|
+
return createComponent(ResizablePanel$1, mergeProps(rest, {
|
|
63
63
|
get id() {
|
|
64
64
|
return props.panelId ?? props.id;
|
|
65
65
|
},
|
|
@@ -87,9 +87,9 @@ function ResizablePanel$1(props) {
|
|
|
87
87
|
}) : content()
|
|
88
88
|
}));
|
|
89
89
|
}
|
|
90
|
-
function ResizableHandle
|
|
90
|
+
function ResizableHandle(props) {
|
|
91
91
|
const rest = omit(props, "class", "withHandle", "label");
|
|
92
|
-
return createComponent(ResizableHandle, mergeProps({ get "aria-label"() {
|
|
92
|
+
return createComponent(ResizableHandle$1, mergeProps({ get "aria-label"() {
|
|
93
93
|
return props.label ?? "Resize panels";
|
|
94
94
|
} }, rest, {
|
|
95
95
|
get "class"() {
|
|
@@ -108,7 +108,7 @@ function ResizableHandle$1(props) {
|
|
|
108
108
|
return !!props.withHandle;
|
|
109
109
|
})() ? (() => {
|
|
110
110
|
var _el$2 = _tmpl$2();
|
|
111
|
-
insert(_el$2, createComponent(GripVertical
|
|
111
|
+
insert(_el$2, createComponent(GripVertical, { class: resizeGripIconClass }));
|
|
112
112
|
effect(() => readShallow(resizeGripClass.chip), (_v$, _$p) => {
|
|
113
113
|
className(_el$2, _v$, _$p);
|
|
114
114
|
});
|
|
@@ -117,6 +117,6 @@ function ResizableHandle$1(props) {
|
|
|
117
117
|
}
|
|
118
118
|
}));
|
|
119
119
|
}
|
|
120
|
-
export { ResizableHandle
|
|
120
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
121
121
|
|
|
122
122
|
//# sourceMappingURL=resizable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.js","names":["<Resizable\n {...rest}\n layout={toPercents(props.sizes)}\n defaultLayout={toPercents(props.initialSizes)}\n step={props.keyboardDelta === undefined ? undefined : props.keyboardDelta * 100}\n onLayoutChange={(layout, details) => {\n props.onLayoutChange?.(layout, details)\n props.onSizesChange?.(toFractions(layout))\n }}\n class={cn('flex size-full data-[orientation=vertical]:flex-col', props.class)}\n />","props.keyboardDelta === undefined ? undefined : props.keyboardDelta * 100","onLayoutChange={(layout, details) => {\n props.onLayoutChange?.(layout, details)\n props.onSizesChange?.(toFractions(layout))\n }}","{props.children}","<SdkResizablePanel\n {...rest}\n id={props.panelId ?? props.id}\n defaultSize={toSdkSize(props.initialSize)}\n minSize={toSdkSize(props.minSize)}\n maxSize={toSdkSize(props.maxSize)}\n collapsedSize={toSdkSize(props.collapsedSize)}\n class={cn('min-h-0 min-w-0 overflow-hidden', props.class)}\n >\n {(state: ResizablePanelState) =>\n listens() ? (\n <PanelCallbacks state={state} panel={props}>\n {content()}\n </PanelCallbacks>\n ) : (\n content()\n )\n }\n </SdkResizablePanel>","<PanelCallbacks state={state} panel={props}>\n {content()}\n </PanelCallbacks>","panel={props}","<SdkResizableHandle\n aria-label={props.label ?? 'Resize panels'}\n {...rest}\n class={cn(\n resizeSeparatorClass(props.withHandle === 'rung' ? 'rung' : 'chip'),\n 'relative w-px data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n props.class\n )}\n >\n {props.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : props.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}\n </SdkResizableHandle>","{props.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : props.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}","<GripVertical class={resizeGripIconClass} />","class={resizeGripIconClass}","GripVertical","LucideGripVertical","ResizablePanel","ResizableHandle","_$readShallow"],"sources":["../../../../src/components/ui/resizable/resizable.tsx"],"sourcesContent":["import {\n Resizable,\n ResizableHandle as SdkResizableHandle,\n ResizablePanel as SdkResizablePanel,\n type ResizablePanelState,\n type ResizableSize,\n} from '@ui-sdk/solid/resizable'\nimport { GripVertical as LucideGripVertical } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { children, createEffect, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from '#lib/resize-separator'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst GripVertical = fastIcon(LucideGripVertical)\n\n/**\n * Resizable.\n *\n * A split layout: panels the user can resize, with a handle between them. This\n * is the shape of every IDE-like surface, rail, file tree, editor, terminal,\n * and the reason it is a primitive rather than something each view improvises.\n *\n * ui-sdk supplies the pointer capture, the min/max constraints, collapsing, the\n * hit area around a thin handle and the keyboard resizing (the WAI-ARIA window\n * splitter), which is what makes a divider operable without a mouse. The handle\n * is a real focusable `separator` with its value, so a split pane can be adjusted\n * from the keyboard; a bare `cursor-col-resize` div cannot.\n *\n * Sizes keep the shape they had when this was built on corvu: fractions of the\n * group (`initialSize={0.28}`), or a `px`/`rem` string. ui-sdk speaks percentages,\n * so numbers are scaled at the edge rather than every caller changing.\n */\n\n/** A panel size: a fraction of the group, 0 to 1, or a CSS length ui-sdk understands. */\nexport type ResizableFraction = number | `${number}%` | `${number}px` | `${number}rem`\n\nconst toSdkSize = (size: ResizableFraction | undefined): ResizableSize | undefined =>\n typeof size === 'number' ? size * 100 : size\nconst toPercents = (sizes: readonly number[] | undefined) => sizes?.map((size) => size * 100)\nconst toFractions = (layout: readonly number[]) => layout.map((size) => size / 100)\n\nexport type ResizablePanelGroupProps = Omit<\n ComponentProps<typeof Resizable>,\n 'layout' | 'defaultLayout' | 'step' | 'class'\n> & {\n class?: string\n /** Every panel's size as a fraction of the group, in order. Pass it to control the group. */\n sizes?: readonly number[]\n /** The starting sizes, as fractions, when uncontrolled. A panel's own `initialSize` wins. */\n initialSizes?: readonly number[]\n /** Runs while the sizes change, on every frame of a drag and every key, with fractions. */\n onSizesChange?: (sizes: number[]) => void\n /** How far an arrow key moves a handle, as a fraction of the group. */\n keyboardDelta?: number\n}\n\nexport function ResizablePanelGroup(props: ResizablePanelGroupProps) {\n const rest = omit(\n props,\n 'class',\n 'sizes',\n 'initialSizes',\n 'onSizesChange',\n 'keyboardDelta',\n 'onLayoutChange'\n )\n\n return (\n <Resizable\n {...rest}\n layout={toPercents(props.sizes)}\n defaultLayout={toPercents(props.initialSizes)}\n step={props.keyboardDelta === undefined ? undefined : props.keyboardDelta * 100}\n onLayoutChange={(layout, details) => {\n props.onLayoutChange?.(layout, details)\n props.onSizesChange?.(toFractions(layout))\n }}\n class={cn('flex size-full data-[orientation=vertical]:flex-col', props.class)}\n />\n )\n}\n\nexport type ResizablePanelProps = Omit<\n ComponentProps<typeof SdkResizablePanel>,\n 'defaultSize' | 'minSize' | 'maxSize' | 'collapsedSize' | 'class' | 'children'\n> & {\n class?: string\n children?: JSX.Element\n /**\n * The starting size. Without one, ui-sdk gives the panel whatever its sized\n * siblings leave, shared evenly between the unsized ones.\n */\n initialSize?: ResizableFraction\n minSize?: ResizableFraction\n maxSize?: ResizableFraction\n collapsedSize?: ResizableFraction\n /** The panel's id, for a saved layout or a controller. ui-sdk's `id`. */\n panelId?: string\n /** Runs when the panel's size changes, as a fraction of the group. */\n onResize?: (size: number) => void\n /** Runs when the panel collapses, with its collapsed size as a fraction. */\n onCollapse?: (size: number) => void\n /** Runs when a collapsed panel opens, with its new size as a fraction. */\n onExpand?: (size: number) => void\n}\n\n/**\n * Reports a panel's size and collapse to the corvu-era callbacks. It reads\n * `size`, which updates on every frame of a drag, so it only exists when a\n * callback does: a panel nobody listens to never re-renders for a resize.\n */\nfunction PanelCallbacks(props: {\n state: ResizablePanelState\n panel: ResizablePanelProps\n children?: JSX.Element\n}) {\n createEffect(\n () => ({ size: props.state.size, collapsed: props.state.collapsed }),\n (next, previous) => {\n if (!previous) return\n const fraction = next.size / 100\n if (next.size !== previous.size) props.panel.onResize?.(fraction)\n if (next.collapsed && !previous.collapsed) props.panel.onCollapse?.(fraction)\n if (!next.collapsed && previous.collapsed) props.panel.onExpand?.(fraction)\n }\n )\n return <>{props.children}</>\n}\n\nexport function ResizablePanel(props: ResizablePanelProps) {\n const rest = omit(\n props,\n 'class',\n 'children',\n 'initialSize',\n 'minSize',\n 'maxSize',\n 'collapsedSize',\n 'panelId',\n 'onResize',\n 'onCollapse',\n 'onExpand'\n )\n const listens = () => !!(props.onResize || props.onCollapse || props.onExpand)\n const content = children(() => props.children)\n\n return (\n <SdkResizablePanel\n {...rest}\n id={props.panelId ?? props.id}\n defaultSize={toSdkSize(props.initialSize)}\n minSize={toSdkSize(props.minSize)}\n maxSize={toSdkSize(props.maxSize)}\n collapsedSize={toSdkSize(props.collapsedSize)}\n class={cn('min-h-0 min-w-0 overflow-hidden', props.class)}\n >\n {(state: ResizablePanelState) =>\n listens() ? (\n <PanelCallbacks state={state} panel={props}>\n {content()}\n </PanelCallbacks>\n ) : (\n content()\n )\n }\n </SdkResizablePanel>\n )\n}\n\nexport type ResizableHandleProps = Omit<\n ComponentProps<typeof SdkResizableHandle>,\n 'class' | 'children'\n> & {\n class?: string\n /**\n * Draw a visible grip in the middle of the divider: `true` is the bordered\n * chip with its grip icon; `'rung'` is a quieter translucent bar with no\n * icon, for edges that should read as barely there. Either way the divider\n * keeps its full 24px hit target.\n */\n withHandle?: boolean | 'rung'\n /**\n * The divider's accessible name. It is a focusable control, arrow keys move\n * the split, so it needs one; without it a screen reader announces an\n * unlabelled separator between the two panels.\n */\n label?: string\n}\n\nexport function ResizableHandle(props: ResizableHandleProps) {\n const rest = omit(props, 'class', 'withHandle', 'label')\n\n // ui-sdk writes `data-orientation` (the group's direction) on the handle, which\n // the separator classes key on, and `aria-orientation` as the line's own, which\n // runs across the group.\n return (\n <SdkResizableHandle\n aria-label={props.label ?? 'Resize panels'}\n {...rest}\n class={cn(\n resizeSeparatorClass(props.withHandle === 'rung' ? 'rung' : 'chip'),\n 'relative w-px data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n props.class\n )}\n >\n {props.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : props.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}\n </SdkResizableHandle>\n )\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAMW,iBAAe,SAASC,YAAkB;AAuBhD,IAAM,aAAa,SACjB,OAAO,SAAS,WAAW,OAAO,MAAM;AAC1C,IAAM,cAAc,UAAyC,OAAO,KAAK,SAAS,OAAO,GAAG;AAC5F,IAAM,eAAe,WAA8B,OAAO,KAAK,SAAS,OAAO,GAAG;AAiBlF,SAAgB,oBAAoB,OAAiC;CACnE,MAAM,OAAO,KACX,OACA,SACA,SACA,gBACA,iBACA,iBACA,gBACF;CAEA,OACEZ,gBAAAA,WAAAA,WACM,MADN;EAEE,IAAA,SAAA;GAAQ,OAAA,WAAW,MAAM,KAAK;EAAC;EAC/B,IAAA,gBAAA;GAAe,OAAA,WAAW,MAAM,YAAY;EAAC;EAC7C,IAAA,OAAA;GAAMC,OAAAA,WAAAA;IAAM,OAAA,MAAA,kBAAkB,KAAA;GAAgD,CAAA,CAAC,CAAD,IAApC,KAAA,IAAY,MAAM,gBAAgB;EAAG;EAC/EC,iBAAiB,QAAQ,YAAY;GACnC,MAAM,iBAAiB,QAAQ,OAAO;GACtC,MAAM,gBAAgB,YAAY,MAAM,CAAC;EAC3C;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,uDAAuD,MAAM,KAAK;EAAC;CAC9E,CAAA,CAAA;AAEL;;;;;;AA+BA,SAAS,eAAe,OAIrB;CACD,oBACS;EAAE,MAAM,MAAM,MAAM;EAAM,WAAW,MAAM,MAAM;CAAU,KACjE,MAAM,aAAa;EAClB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d,MAFN;EAGE,IAAA,UAAA;GAAO,OAAA,GACL,qBAAqB,MAAM,eAAe,SAAS,SAAS,MAAM,GAClE,qFACA,MAAM,KACR;EAAC;EAPH,IAAA,WAAA;GASEC,OAAAA,WAAAA;IAAC,OAAA,MAAM,eAAe;GAMd,CAAA,CAAC,CAAD,WALN;IAA8D,IAAA,OAAA,OAAA;IAA9B,aAAAO,YAAO,gBAAgB,IAAI,IAA3B,KAAA,QAAA;KAA2B,UAAA,MAAA,KAAA,GAAA;;IAA3D,OAAA;GAA8D,EAAA,CAAA,IADhEP,WAAAA;IAEI,OAAA,CAAA,CAAA,MAAM;GAIF,CAAA,CAAC,CAAD,WAHN;IAEK,IAAA,QAAA,QAAA;IAFL,OAAA,OACEC,gBAAAA,gBAAAA,EAAcC,OAAO,oBAAsB,CAAA,CACxC;IAFA,aAAAK,YAAO,gBAAgB,IAAI,IAA3B,KAAA,QAAA;KAA2B,UAAA,OAAA,KAAA,GAAA;;IAAhC,OAAA;GAEK,EAAA,CAAA,IACH;EACc;;AAExB"}
|
|
1
|
+
{"version":3,"file":"resizable.js","names":["<Resizable\n {...rest}\n layout={toPercents(props.sizes)}\n defaultLayout={toPercents(props.initialSizes)}\n step={props.keyboardDelta === undefined ? undefined : props.keyboardDelta * 100}\n onLayoutChange={(layout, details) => {\n props.onLayoutChange?.(layout, details)\n props.onSizesChange?.(toFractions(layout))\n }}\n class={cn('flex size-full data-[orientation=vertical]:flex-col', props.class)}\n />","props.keyboardDelta === undefined ? undefined : props.keyboardDelta * 100","onLayoutChange={(layout, details) => {\n props.onLayoutChange?.(layout, details)\n props.onSizesChange?.(toFractions(layout))\n }}","{props.children}","<SdkResizablePanel\n {...rest}\n id={props.panelId ?? props.id}\n defaultSize={toSdkSize(props.initialSize)}\n minSize={toSdkSize(props.minSize)}\n maxSize={toSdkSize(props.maxSize)}\n collapsedSize={toSdkSize(props.collapsedSize)}\n class={cn('min-h-0 min-w-0 overflow-hidden', props.class)}\n >\n {(state: ResizablePanelState) =>\n listens() ? (\n <PanelCallbacks state={state} panel={props}>\n {content()}\n </PanelCallbacks>\n ) : (\n content()\n )\n }\n </SdkResizablePanel>","<PanelCallbacks state={state} panel={props}>\n {content()}\n </PanelCallbacks>","panel={props}","<SdkResizableHandle\n aria-label={props.label ?? 'Resize panels'}\n {...rest}\n class={cn(\n resizeSeparatorClass(props.withHandle === 'rung' ? 'rung' : 'chip'),\n 'relative w-px data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n props.class\n )}\n >\n {props.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : props.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}\n </SdkResizableHandle>","{props.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : props.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}","<GripVertical class={resizeGripIconClass} />","class={resizeGripIconClass}","LucideGripVertical","_$effect","_$readShallow","_$className","_$insert"],"sources":["../../../../src/components/ui/resizable/resizable.tsx"],"sourcesContent":["import {\n Resizable,\n ResizableHandle as SdkResizableHandle,\n ResizablePanel as SdkResizablePanel,\n type ResizablePanelState,\n type ResizableSize,\n} from '@ui-sdk/solid/resizable'\nimport { GripVertical as LucideGripVertical } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { children, createEffect, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from '#lib/resize-separator'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst GripVertical = fastIcon(LucideGripVertical)\n\n/**\n * Resizable.\n *\n * A split layout: panels the user can resize, with a handle between them. This\n * is the shape of every IDE-like surface, rail, file tree, editor, terminal,\n * and the reason it is a primitive rather than something each view improvises.\n *\n * ui-sdk supplies the pointer capture, the min/max constraints, collapsing, the\n * hit area around a thin handle and the keyboard resizing (the WAI-ARIA window\n * splitter), which is what makes a divider operable without a mouse. The handle\n * is a real focusable `separator` with its value, so a split pane can be adjusted\n * from the keyboard; a bare `cursor-col-resize` div cannot.\n *\n * Sizes keep the shape they had when this was built on corvu: fractions of the\n * group (`initialSize={0.28}`), or a `px`/`rem` string. ui-sdk speaks percentages,\n * so numbers are scaled at the edge rather than every caller changing.\n */\n\n/** A panel size: a fraction of the group, 0 to 1, or a CSS length ui-sdk understands. */\nexport type ResizableFraction = number | `${number}%` | `${number}px` | `${number}rem`\n\nconst toSdkSize = (size: ResizableFraction | undefined): ResizableSize | undefined =>\n typeof size === 'number' ? size * 100 : size\nconst toPercents = (sizes: readonly number[] | undefined) => sizes?.map((size) => size * 100)\nconst toFractions = (layout: readonly number[]) => layout.map((size) => size / 100)\n\nexport type ResizablePanelGroupProps = Omit<\n ComponentProps<typeof Resizable>,\n 'layout' | 'defaultLayout' | 'step' | 'class'\n> & {\n class?: string\n /** Every panel's size as a fraction of the group, in order. Pass it to control the group. */\n sizes?: readonly number[]\n /** The starting sizes, as fractions, when uncontrolled. A panel's own `initialSize` wins. */\n initialSizes?: readonly number[]\n /** Runs while the sizes change, on every frame of a drag and every key, with fractions. */\n onSizesChange?: (sizes: number[]) => void\n /** How far an arrow key moves a handle, as a fraction of the group. */\n keyboardDelta?: number\n}\n\nexport function ResizablePanelGroup(props: ResizablePanelGroupProps) {\n const rest = omit(\n props,\n 'class',\n 'sizes',\n 'initialSizes',\n 'onSizesChange',\n 'keyboardDelta',\n 'onLayoutChange'\n )\n\n return (\n <Resizable\n {...rest}\n layout={toPercents(props.sizes)}\n defaultLayout={toPercents(props.initialSizes)}\n step={props.keyboardDelta === undefined ? undefined : props.keyboardDelta * 100}\n onLayoutChange={(layout, details) => {\n props.onLayoutChange?.(layout, details)\n props.onSizesChange?.(toFractions(layout))\n }}\n class={cn('flex size-full data-[orientation=vertical]:flex-col', props.class)}\n />\n )\n}\n\nexport type ResizablePanelProps = Omit<\n ComponentProps<typeof SdkResizablePanel>,\n 'defaultSize' | 'minSize' | 'maxSize' | 'collapsedSize' | 'class' | 'children'\n> & {\n class?: string\n children?: JSX.Element\n /**\n * The starting size. Without one, ui-sdk gives the panel whatever its sized\n * siblings leave, shared evenly between the unsized ones.\n */\n initialSize?: ResizableFraction\n minSize?: ResizableFraction\n maxSize?: ResizableFraction\n collapsedSize?: ResizableFraction\n /** The panel's id, for a saved layout or a controller. ui-sdk's `id`. */\n panelId?: string\n /** Runs when the panel's size changes, as a fraction of the group. */\n onResize?: (size: number) => void\n /** Runs when the panel collapses, with its collapsed size as a fraction. */\n onCollapse?: (size: number) => void\n /** Runs when a collapsed panel opens, with its new size as a fraction. */\n onExpand?: (size: number) => void\n}\n\n/**\n * Reports a panel's size and collapse to the corvu-era callbacks. It reads\n * `size`, which updates on every frame of a drag, so it only exists when a\n * callback does: a panel nobody listens to never re-renders for a resize.\n */\nfunction PanelCallbacks(props: {\n state: ResizablePanelState\n panel: ResizablePanelProps\n children?: JSX.Element\n}) {\n createEffect(\n () => ({ size: props.state.size, collapsed: props.state.collapsed }),\n (next, previous) => {\n if (!previous) return\n const fraction = next.size / 100\n if (next.size !== previous.size) props.panel.onResize?.(fraction)\n if (next.collapsed && !previous.collapsed) props.panel.onCollapse?.(fraction)\n if (!next.collapsed && previous.collapsed) props.panel.onExpand?.(fraction)\n }\n )\n return <>{props.children}</>\n}\n\nexport function ResizablePanel(props: ResizablePanelProps) {\n const rest = omit(\n props,\n 'class',\n 'children',\n 'initialSize',\n 'minSize',\n 'maxSize',\n 'collapsedSize',\n 'panelId',\n 'onResize',\n 'onCollapse',\n 'onExpand'\n )\n const listens = () => !!(props.onResize || props.onCollapse || props.onExpand)\n const content = children(() => props.children)\n\n return (\n <SdkResizablePanel\n {...rest}\n id={props.panelId ?? props.id}\n defaultSize={toSdkSize(props.initialSize)}\n minSize={toSdkSize(props.minSize)}\n maxSize={toSdkSize(props.maxSize)}\n collapsedSize={toSdkSize(props.collapsedSize)}\n class={cn('min-h-0 min-w-0 overflow-hidden', props.class)}\n >\n {(state: ResizablePanelState) =>\n listens() ? (\n <PanelCallbacks state={state} panel={props}>\n {content()}\n </PanelCallbacks>\n ) : (\n content()\n )\n }\n </SdkResizablePanel>\n )\n}\n\nexport type ResizableHandleProps = Omit<\n ComponentProps<typeof SdkResizableHandle>,\n 'class' | 'children'\n> & {\n class?: string\n /**\n * Draw a visible grip in the middle of the divider: `true` is the bordered\n * chip with its grip icon; `'rung'` is a quieter translucent bar with no\n * icon, for edges that should read as barely there. Either way the divider\n * keeps its full 24px hit target.\n */\n withHandle?: boolean | 'rung'\n /**\n * The divider's accessible name. It is a focusable control, arrow keys move\n * the split, so it needs one; without it a screen reader announces an\n * unlabelled separator between the two panels.\n */\n label?: string\n}\n\nexport function ResizableHandle(props: ResizableHandleProps) {\n const rest = omit(props, 'class', 'withHandle', 'label')\n\n // ui-sdk writes `data-orientation` (the group's direction) on the handle, which\n // the separator classes key on, and `aria-orientation` as the line's own, which\n // runs across the group.\n return (\n <SdkResizableHandle\n aria-label={props.label ?? 'Resize panels'}\n {...rest}\n class={cn(\n resizeSeparatorClass(props.withHandle === 'rung' ? 'rung' : 'chip'),\n 'relative w-px data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n props.class\n )}\n >\n {props.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : props.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}\n </SdkResizableHandle>\n )\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAM,eAAe,SAASW,cAAkB;AAuBhD,IAAM,aAAa,SACjB,OAAO,SAAS,WAAW,OAAO,MAAM;AAC1C,IAAM,cAAc,UAAyC,OAAO,KAAK,SAAS,OAAO,GAAG;AAC5F,IAAM,eAAe,WAA8B,OAAO,KAAK,SAAS,OAAO,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O,gBAAgB,IAAI,IAA3B,KAAA,QAAA;KAA2BC,UAAA,OAAA,KAAA,GAAA;;IAAhC,OAAA;GAEK,EAAA,CAAA,IACH;EACc;;AAExB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
1
|
import { spread, template } from "@solidjs/web";
|
|
3
2
|
import { omit } from "solid-js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
// src/components/ui/scroll-area/scroll-area.tsx
|
|
5
5
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
6
6
|
function ScrollArea(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.js","names":["<div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />"],"sources":["../../../../src/components/ui/scroll-area/scroll-area.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * ScrollArea.\n *\n * A scroll container with the design system's scrollbar treatment, plus an\n * optional fade at each edge so a long list reads as continuing rather than\n * ending at the fold.\n *\n * This is a styled native scroller, not a reimplementation of scrolling. The\n * platform scroller already handles momentum, rubber-banding, keyboard paging,\n * trackpad gestures, `scrollIntoView`, focus-into-view and find-in-page. A\n * custom scrollbar over a transformed div gives up every one of those to gain\n * nothing but the scrollbar's appearance, which CSS already controls.\n *\n * `orientation` only decides which edges the fade appears on; `overflow-auto`\n * stays on both axes in `both` mode so a wide table can still be reached.\n */\nexport type ScrollAreaProps = ComponentProps<'div'> & {\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Draw a fade at the leading and trailing edges of the scrolled axis. */\n fade?: boolean\n /** Replace the browser's scrollbar with the system's thin treatment. */\n hideScrollbar?: boolean\n}\n\nexport function ScrollArea(props: ScrollAreaProps) {\n const local = props\n const rest = omit(props, 'class', 'orientation', 'fade', 'hideScrollbar', 'tabindex')\n\n return (\n <div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AA4BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,eAAe,QAAQ,iBAAiB,UAAU;CAGlF,IAAA,OAAA,OAyBC;
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":["<div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />","_$spread"],"sources":["../../../../src/components/ui/scroll-area/scroll-area.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * ScrollArea.\n *\n * A scroll container with the design system's scrollbar treatment, plus an\n * optional fade at each edge so a long list reads as continuing rather than\n * ending at the fold.\n *\n * This is a styled native scroller, not a reimplementation of scrolling. The\n * platform scroller already handles momentum, rubber-banding, keyboard paging,\n * trackpad gestures, `scrollIntoView`, focus-into-view and find-in-page. A\n * custom scrollbar over a transformed div gives up every one of those to gain\n * nothing but the scrollbar's appearance, which CSS already controls.\n *\n * `orientation` only decides which edges the fade appears on; `overflow-auto`\n * stays on both axes in `both` mode so a wide table can still be reached.\n */\nexport type ScrollAreaProps = ComponentProps<'div'> & {\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Draw a fade at the leading and trailing edges of the scrolled axis. */\n fade?: boolean\n /** Replace the browser's scrollbar with the system's thin treatment. */\n hideScrollbar?: boolean\n}\n\nexport function ScrollArea(props: ScrollAreaProps) {\n const local = props\n const rest = omit(props, 'class', 'orientation', 'fade', 'hideScrollbar', 'tabindex')\n\n return (\n <div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AA4BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,eAAe,QAAQ,iBAAiB,UAAU;CAGlF,IAAA,OAAA,OAyBC;CADCC,OAAA,MAAA,CAAA;EAvBA,aAAA;EASA,IAAA,WAAA;GAAU,OAAA,MAAM,YAAY;EAAC;EAC7B,IAAA,UAAA;GAAO,OAAA,GACL,gGACA;IACE,qCACE,MAAM,gBAAgB,cAAc,MAAM,gBAAgB,KAAA;IAC5D,qCAAqC,MAAM,gBAAgB;IAC3D,iBAAiB,MAAM,gBAAgB;IACvC,gBAAgB,MAAM;IACtB,mBACE,MAAM,SAAS,MAAM,gBAAgB,cAAc,MAAM,gBAAgB,KAAA;GAC7E,GACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,KAAA;CAzBR,OACED;AA2BJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { className, createComponent, dynamic, effect, insert, memo, mergeProps, readShallow, spread, template } from "@solidjs/web";
|
|
2
|
+
import { Select as Select$1, SelectContent as SelectContent$1, SelectItem as SelectItem$1, SelectList, SelectTrigger as SelectTrigger$1, SelectValue as SelectValue$1 } from "@ui-sdk/solid/select";
|
|
3
|
+
import { Check as Check$1, ChevronDown as ChevronDown$1, ChevronsUpDown as ChevronsUpDown$1 } from "@lucide/solid";
|
|
4
|
+
import { For, Show, createContext, createMemo, omit, useContext } from "solid-js";
|
|
1
5
|
import { menuItem, menuSwatchTone } from "../../../lib/overlay.js";
|
|
2
6
|
import { cn } from "../../../lib/utils.js";
|
|
3
7
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
|
-
import { className, createComponent, dynamic, effect, insert, memo, mergeProps, readShallow, spread, template } from "@solidjs/web";
|
|
5
|
-
import { Check, ChevronDown, ChevronsUpDown } from "@lucide/solid";
|
|
6
|
-
import { For, Show, createContext, createMemo, omit, useContext } from "solid-js";
|
|
7
|
-
import { Select, SelectContent, SelectItem, SelectList, SelectTrigger, SelectValue } from "@ui-sdk/solid/select";
|
|
8
8
|
// src/components/ui/select/select.tsx
|
|
9
9
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
10
10
|
var _tmpl$2 = /* @__PURE__ */ template(`<span aria-hidden=true class=text-muted-foreground>`);
|
|
@@ -12,9 +12,9 @@ var _tmpl$3 = /* @__PURE__ */ template(`<button>`);
|
|
|
12
12
|
var _tmpl$4 = /* @__PURE__ */ template(`<span>`);
|
|
13
13
|
var _tmpl$5 = /* @__PURE__ */ template(`<span aria-hidden=true>`);
|
|
14
14
|
var _tmpl$6 = /* @__PURE__ */ template(`<span data-slot=select-indicator aria-hidden=true class="absolute end-2 flex size-4 items-center justify-center text-primary">`);
|
|
15
|
-
var Check
|
|
16
|
-
var ChevronDown
|
|
17
|
-
var ChevronsUpDown
|
|
15
|
+
var Check = fastIcon(Check$1);
|
|
16
|
+
var ChevronDown = fastIcon(ChevronDown$1);
|
|
17
|
+
var ChevronsUpDown = fastIcon(ChevronsUpDown$1);
|
|
18
18
|
var SelectScopeContext = createContext(null);
|
|
19
19
|
function read(accessor, option, fallback) {
|
|
20
20
|
if (accessor === void 0) return fallback;
|
|
@@ -41,7 +41,7 @@ function read(accessor, option, fallback) {
|
|
|
41
41
|
* rather than a bare list of strings, and the reason the trigger never shows a
|
|
42
42
|
* raw id.
|
|
43
43
|
*/
|
|
44
|
-
function Select
|
|
44
|
+
function Select(props) {
|
|
45
45
|
const rest = omit(props, "options", "optionValue", "optionTextValue", "optionDisabled", "optionGroupChildren", "itemComponent", "sectionComponent", "placeholder", "open", "defaultOpen", "onOpenChange", "disabled", "required", "readOnly", "name", "validationState", "placement", "gutter", "modal", "loop", "children", "multiple", "value", "defaultValue", "onChange");
|
|
46
46
|
const keyOf = (option) => String(read(props.optionValue, option, option));
|
|
47
47
|
const textOf = (option) => read(props.optionTextValue, option, keyOf(option));
|
|
@@ -96,7 +96,7 @@ function Select$1(props) {
|
|
|
96
96
|
insert(_el$, createComponent(SelectScopeContext, {
|
|
97
97
|
value: scope,
|
|
98
98
|
get children() {
|
|
99
|
-
return createComponent(Select, {
|
|
99
|
+
return createComponent(Select$1, {
|
|
100
100
|
get items() {
|
|
101
101
|
return items();
|
|
102
102
|
},
|
|
@@ -146,10 +146,10 @@ function Select$1(props) {
|
|
|
146
146
|
}));
|
|
147
147
|
return _el$;
|
|
148
148
|
}
|
|
149
|
-
function SelectTrigger
|
|
149
|
+
function SelectTrigger(props) {
|
|
150
150
|
const scope = useContext(SelectScopeContext);
|
|
151
151
|
const rest = omit(props, "class", "size", "hideIcon", "children");
|
|
152
|
-
return createComponent(SelectTrigger, mergeProps({ get "aria-invalid"() {
|
|
152
|
+
return createComponent(SelectTrigger$1, mergeProps({ get "aria-invalid"() {
|
|
153
153
|
return scope?.invalid() ? "true" : void 0;
|
|
154
154
|
} }, rest, {
|
|
155
155
|
render: (part, state) => (() => {
|
|
@@ -178,7 +178,7 @@ function SelectTrigger$1(props) {
|
|
|
178
178
|
},
|
|
179
179
|
get children() {
|
|
180
180
|
var _el$2 = _tmpl$2();
|
|
181
|
-
insert(_el$2, createComponent(ChevronDown
|
|
181
|
+
insert(_el$2, createComponent(ChevronDown, {}));
|
|
182
182
|
return _el$2;
|
|
183
183
|
}
|
|
184
184
|
})];
|
|
@@ -199,7 +199,7 @@ function labelFromOption(option) {
|
|
|
199
199
|
}
|
|
200
200
|
return "";
|
|
201
201
|
}
|
|
202
|
-
function SelectValue
|
|
202
|
+
function SelectValue(props) {
|
|
203
203
|
const scope = useContext(SelectScopeContext);
|
|
204
204
|
const rest = omit(props, "class", "children", "optionLabel");
|
|
205
205
|
const show = (state) => {
|
|
@@ -213,7 +213,7 @@ function SelectValue$1(props) {
|
|
|
213
213
|
const option = readout.selectedOption();
|
|
214
214
|
return props.optionLabel ? props.optionLabel(option) : labelFromOption(option);
|
|
215
215
|
};
|
|
216
|
-
return createComponent(SelectValue, mergeProps(rest, {
|
|
216
|
+
return createComponent(SelectValue$1, mergeProps(rest, {
|
|
217
217
|
get "class"() {
|
|
218
218
|
return cn("truncate", props.class);
|
|
219
219
|
},
|
|
@@ -227,7 +227,7 @@ function SelectValue$1(props) {
|
|
|
227
227
|
children: (state) => show(state)
|
|
228
228
|
}));
|
|
229
229
|
}
|
|
230
|
-
function SelectContent
|
|
230
|
+
function SelectContent(props) {
|
|
231
231
|
const scope = useContext(SelectScopeContext);
|
|
232
232
|
const rest = omit(props, "class", "children", "portalMount");
|
|
233
233
|
const placement = () => {
|
|
@@ -237,7 +237,7 @@ function SelectContent$1(props) {
|
|
|
237
237
|
align: side ? align ?? "center" : void 0
|
|
238
238
|
};
|
|
239
239
|
};
|
|
240
|
-
return createComponent(SelectContent, mergeProps(rest, {
|
|
240
|
+
return createComponent(SelectContent$1, mergeProps(rest, {
|
|
241
241
|
get side() {
|
|
242
242
|
return placement().side;
|
|
243
243
|
},
|
|
@@ -284,9 +284,9 @@ function SelectContent$1(props) {
|
|
|
284
284
|
}
|
|
285
285
|
}));
|
|
286
286
|
}
|
|
287
|
-
function SelectItem
|
|
287
|
+
function SelectItem(props) {
|
|
288
288
|
const rest = omit(props, "class", "children", "swatch", "item");
|
|
289
|
-
return createComponent(SelectItem, mergeProps(rest, {
|
|
289
|
+
return createComponent(SelectItem$1, mergeProps(rest, {
|
|
290
290
|
get value() {
|
|
291
291
|
return props.item.rawValue;
|
|
292
292
|
},
|
|
@@ -323,7 +323,7 @@ function SelectItem$1(props) {
|
|
|
323
323
|
return !!state.selected;
|
|
324
324
|
})() ? (() => {
|
|
325
325
|
var _el$8 = _tmpl$6();
|
|
326
|
-
insert(_el$8, createComponent(Check
|
|
326
|
+
insert(_el$8, createComponent(Check, { class: "size-4" }));
|
|
327
327
|
return _el$8;
|
|
328
328
|
})() : void 0;
|
|
329
329
|
})
|
|
@@ -353,8 +353,8 @@ function SelectLabel(props) {
|
|
|
353
353
|
}
|
|
354
354
|
/** The chevron pair used when a Select is composed by hand in a field. */
|
|
355
355
|
function SelectChevronsUpDown(props) {
|
|
356
|
-
return createComponent(ChevronsUpDown
|
|
356
|
+
return createComponent(ChevronsUpDown, mergeProps({ "aria-hidden": "true" }, props));
|
|
357
357
|
}
|
|
358
|
-
export { Select
|
|
358
|
+
export { Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue };
|
|
359
359
|
|
|
360
360
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["<SelectScopeContext value={scope}>\n <SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>\n </SelectScopeContext>","value={scope}","<SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>","onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }","itemToValue={keyOf}","itemToLabel={textOf}","isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}","onOpenChange={(open: boolean) => props.onOpenChange?.(open)}","<div {...(rest as ComponentProps<'div'>)}>\n <SelectScopeContext value={scope}>\n <SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>\n </SelectScopeContext>\n </div>","<SelectTriggerPrimitive\n aria-invalid={scope?.invalid() ? 'true' : undefined}\n {...(rest as Record<string, unknown>)}\n // The Kobalte-era state names the classes below and callers key on.\n // Kobalte marked only the value `data-placeholder-shown`, never the\n // trigger, so the trigger's placeholder rule below never matched and a\n // placeholder drew in the foreground colour; the trigger keeps that.\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button {...part} data-slot=\"select-trigger\" data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': props.size === 'sm',\n 'h-control-md text-sm': props.size === 'md' || props.size === undefined,\n 'h-control-lg text-sm': props.size === 'lg',\n },\n props.class\n )}\n >\n {props.children}\n <Show when={!props.hideIcon}>\n <span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>\n </Show>\n </SelectTriggerPrimitive>","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button {...part} data-slot=\"select-trigger\" data-expanded={state.open ? '' : undefined} />\n )}","props.children","<Show when={!props.hideIcon}>\n <span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>\n </Show>","<ChevronDown />","<span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>","<SelectValuePrimitive\n {...(rest as Record<string, unknown>)}\n class={cn('truncate', props.class)}\n render={(part: Record<string, unknown>, state: { placeholder: boolean }) => (\n <span {...part} data-placeholder-shown={state.placeholder ? '' : undefined} />\n )}\n >\n {(state: { value: unknown; placeholder: boolean }) => show(state)}\n </SelectValuePrimitive>","render={(part: Record<string, unknown>, state: { placeholder: boolean }) => (\n <span {...part} data-placeholder-shown={state.placeholder ? '' : undefined} />\n )}","<SelectContentPrimitive\n {...(rest as Record<string, unknown>)}\n side={placement().side}\n align={placement().align}\n // Four pixels is shadcn's `sideOffset`: attached, with room for the\n // trigger's own border.\n sideOffset={scope?.gutter() ?? 4}\n container={props.portalMount}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-y-auto overflow-x-hidden',\n // The trigger's width, as Kobalte's `sameWidth` default drew the list.\n 'w-(--anchor-width)',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n props.class\n )}\n >\n {props.children}\n {/* No arrow: the list is the trigger's own value opened up, attached\n to it, where an arrow would read as a gap. */}\n <SelectList class=\"flex flex-col\">\n <For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>\n </SelectList>\n </SelectContentPrimitive>","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}","<SelectList class=\"flex flex-col\">\n <For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>\n </SelectList>","class=\"flex flex-col\"","<For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>","<Section section={node} />","section={node}","<Item item={node} />","item={node}","<SelectItemPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.item.rawValue}\n label={props.item.textValue}\n disabled={props.item.disabled}\n class={cn(menuItem, 'pe-8', props.class)}\n >\n {(state: { selected: boolean }) => (\n <>\n <Show when={props.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.swatch })} />\n </Show>\n <div>{props.children}</div>\n {/* The indicator reads in the accent, like every other selected\n state in the system — the row's own foreground reads as\n decoration. Drawn from the row's `selected` state. */}\n <Show when={state.selected}>\n <span\n data-slot=\"select-indicator\"\n aria-hidden=\"true\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </span>\n </Show>\n </>\n )}\n </SelectItemPrimitive>","<Show when={props.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.swatch })} />\n </Show>","<Show when={state.selected}>\n <span\n data-slot=\"select-indicator\"\n aria-hidden=\"true\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </span>\n </Show>","<Check class=\"size-4\" />","class=\"size-4\"","role=\"presentation\"","<div role=\"presentation\" class={cn('flex flex-col', props.class)} {...rest} />","<div\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', props.class)}\n {...rest}\n />","<ChevronsUpDown aria-hidden=\"true\" {...(props as Record<string, unknown>)} />","Check","LucideCheck","ChevronDown","LucideChevronDown","ChevronsUpDown","LucideChevronsUpDown","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","_$readShallow"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import {\n Select as SelectPrimitive,\n SelectContent as SelectContentPrimitive,\n SelectItem as SelectItemPrimitive,\n SelectList,\n SelectTrigger as SelectTriggerPrimitive,\n SelectValue as SelectValuePrimitive,\n} from '@ui-sdk/solid/select'\nimport {\n Check as LucideCheck,\n ChevronDown as LucideChevronDown,\n ChevronsUpDown as LucideChevronsUpDown,\n} from '@lucide/solid'\nimport { dynamic, type ComponentProps, type JSX } from '@solidjs/web'\nimport { For, Show, createContext, createMemo, omit, useContext, type Component } from 'solid-js'\nimport { menuContentPadding, menuItem, menuSwatchTone, type MenuSwatchTone } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst ChevronsUpDown = fastIcon(LucideChevronsUpDown)\n\n/**\n * One entry of the list the root builds from `options`: an option, or the\n * section heading of a group. The Kobalte-era `CollectionNode` fields a\n * caller's `itemComponent` reads (`rawValue`, `key`, `textValue`) keep their\n * names.\n */\nexport type SelectCollectionNode<T> = {\n type: 'item' | 'section'\n key: string\n rawValue: T\n textValue: string\n disabled: boolean\n index: number\n}\n\ntype Accessor<T, R> = keyof T | ((option: T) => R)\n\ntype SelectBaseProps<Option, OptGroup> = Omit<\n ComponentProps<'div'>,\n 'onChange' | 'children' | 'placeholder'\n> & {\n options: ReadonlyArray<Option | OptGroup>\n /** The option's identity: a field name or a function. Defaults to the option itself. */\n optionValue?: Accessor<Option, string | number>\n /** The text typeahead matches and the trigger shows. */\n optionTextValue?: Accessor<Option, string>\n optionDisabled?: Accessor<Option, boolean>\n /** The field of a group that holds its options. */\n optionGroupChildren?: keyof OptGroup\n /** Draws one option; render a `SelectItem` with the `item` it receives. */\n itemComponent?: Component<{ item: SelectCollectionNode<Option> }>\n /** Draws a group's heading, before its options. */\n sectionComponent?: Component<{ section: SelectCollectionNode<OptGroup> }>\n /** What the trigger shows while nothing is selected. */\n placeholder?: JSX.Element\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n disabled?: boolean\n required?: boolean\n readOnly?: boolean\n /** The name the value submits under, as the option's `optionValue`. */\n name?: string\n /** `invalid` marks the trigger `aria-invalid`. */\n validationState?: 'valid' | 'invalid'\n /** Where the list opens against the trigger. */\n placement?: `${'top' | 'bottom'}${'' | '-start' | '-end'}`\n /** The gap between the trigger and the list, in pixels. */\n gutter?: number\n /** `true` locks scroll and makes the page inert while open. */\n modal?: boolean\n /** Whether the arrow keys wrap from the last option to the first. */\n loop?: boolean\n children?: JSX.Element\n}\n\n/**\n * The selection: one option, or a list of them with `multiple`. One shape\n * rather than a union, so `options` alone infers `Option` for the callbacks.\n */\ntype SelectionProps<Option, Multiple extends boolean> = {\n multiple?: Multiple\n value?: Selection<Option, Multiple>\n defaultValue?: Selection<Option, Multiple>\n /** The chosen option, `null` for none, or the list with `multiple`. */\n onChange?: (value: Selection<Option, Multiple>) => void\n}\n\ntype Selection<Option, Multiple extends boolean> = Multiple extends true ? Option[] : Option | null\n\nexport type SelectProps<\n Option,\n OptGroup = never,\n Multiple extends boolean = false,\n> = SelectBaseProps<Option, OptGroup> & SelectionProps<Option, Multiple>\n\ntype SelectScope = {\n nodes: () => SelectCollectionNode<unknown>[]\n itemComponent: () => Component<{ item: SelectCollectionNode<unknown> }> | undefined\n sectionComponent: () => Component<{ section: SelectCollectionNode<unknown> }> | undefined\n placeholder: () => JSX.Element\n placement: () => SelectBaseProps<unknown, unknown>['placement']\n gutter: () => number | undefined\n invalid: () => boolean\n /** The `optionValue` key of an option. */\n keyOf: (option: unknown) => string\n}\n\nconst SelectScopeContext = createContext<SelectScope | null>(null)\n\nfunction read<T, R>(accessor: Accessor<T, R> | undefined, option: T, fallback: R): R {\n if (accessor === undefined) return fallback\n if (typeof accessor === 'function') return accessor(option)\n if (option !== null && typeof option === 'object') return option[accessor] as R\n return fallback\n}\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * ui-sdk's Select is the behaviour: the select-only combobox pattern, typeahead\n * on the closed trigger, a listbox with the chosen option focused on open, form\n * submission. This keeps the Kobalte-era collection API on top of it: the\n * root takes `options` with `optionValue`/`optionTextValue`, and draws each\n * one through `itemComponent`, so the value stays the caller's option object.\n *\n * `SelectValue` renders the human-readable label of the selection, not its\n * value, the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never, Multiple extends boolean = false>(\n props: SelectProps<Option, OptGroup, Multiple>\n) {\n const rest = omit(\n props,\n 'options',\n 'optionValue',\n 'optionTextValue',\n 'optionDisabled',\n 'optionGroupChildren',\n 'itemComponent',\n 'sectionComponent',\n 'placeholder',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'disabled',\n 'required',\n 'readOnly',\n 'name',\n 'validationState',\n 'placement',\n 'gutter',\n 'modal',\n 'loop',\n 'children',\n 'multiple',\n 'value',\n 'defaultValue',\n 'onChange'\n )\n const keyOf = (option: unknown) =>\n String(read(props.optionValue as Accessor<unknown, string | number>, option, option as string))\n const textOf = (option: unknown) =>\n read(props.optionTextValue as Accessor<unknown, string>, option, keyOf(option))\n\n // One node per option, reused while the option object is, so an `<For>`\n // over them keeps its rows when `options` is replaced by an equal list.\n const cache = new WeakMap<object, SelectCollectionNode<unknown>>()\n const nodeOf = (rawValue: unknown, type: 'item' | 'section', index: number) => {\n const disabled =\n type === 'item' && !!read(props.optionDisabled as Accessor<unknown, boolean>, rawValue, false)\n const key = type === 'item' ? keyOf(rawValue) : `section-${index}`\n const textValue = type === 'item' ? textOf(rawValue) : ''\n const cached =\n rawValue !== null && typeof rawValue === 'object' ? cache.get(rawValue) : undefined\n if (\n cached &&\n cached.type === type &&\n cached.key === key &&\n cached.textValue === textValue &&\n cached.disabled === disabled &&\n cached.index === index\n ) {\n return cached\n }\n const node = { type, key, rawValue, textValue, disabled, index }\n if (rawValue !== null && typeof rawValue === 'object') cache.set(rawValue, node)\n return node\n }\n\n const nodes = createMemo(() => {\n const children = props.optionGroupChildren\n const list: SelectCollectionNode<unknown>[] = []\n let index = 0\n for (const entry of props.options) {\n const groupItems =\n children && entry !== null && typeof entry === 'object'\n ? (entry as Record<PropertyKey, unknown>)[children as PropertyKey]\n : undefined\n if (Array.isArray(groupItems)) {\n list.push(nodeOf(entry, 'section', index++))\n for (const option of groupItems) list.push(nodeOf(option, 'item', index++))\n } else {\n list.push(nodeOf(entry, 'item', index++))\n }\n }\n return list\n })\n\n // The options as ui-sdk data: the closed trigger's typeahead and labels\n // read them before the list has ever opened.\n const items = createMemo(() =>\n nodes()\n .filter((node) => node.type === 'item')\n .map((node) => ({ value: node.rawValue, label: node.textValue, disabled: node.disabled }))\n )\n\n const scope: SelectScope = {\n nodes,\n itemComponent: () =>\n props.itemComponent as Component<{ item: SelectCollectionNode<unknown> }> | undefined,\n sectionComponent: () =>\n props.sectionComponent as Component<{ section: SelectCollectionNode<unknown> }> | undefined,\n placeholder: () => props.placeholder,\n placement: () => props.placement,\n gutter: () => props.gutter,\n invalid: () => props.validationState === 'invalid',\n keyOf,\n }\n\n // Kobalte's root was an element; the wrapper keeps that box and its props.\n return (\n <div {...(rest as ComponentProps<'div'>)}>\n <SelectScopeContext value={scope}>\n <SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>\n </SelectScopeContext>\n </div>\n )\n}\n\nexport type SelectTriggerProps = Omit<\n ComponentProps<'button'>,\n 'value' | 'onChange' | 'onSelect'\n> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const scope = useContext(SelectScopeContext)\n const rest = omit(props, 'class', 'size', 'hideIcon', 'children')\n\n return (\n <SelectTriggerPrimitive\n aria-invalid={scope?.invalid() ? 'true' : undefined}\n {...(rest as Record<string, unknown>)}\n // The Kobalte-era state names the classes below and callers key on.\n // Kobalte marked only the value `data-placeholder-shown`, never the\n // trigger, so the trigger's placeholder rule below never matched and a\n // placeholder drew in the foreground colour; the trigger keeps that.\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button {...part} data-slot=\"select-trigger\" data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': props.size === 'sm',\n 'h-control-md text-sm': props.size === 'md' || props.size === undefined,\n 'h-control-lg text-sm': props.size === 'lg',\n },\n props.class\n )}\n >\n {props.children}\n <Show when={!props.hideIcon}>\n <span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>\n </Show>\n </SelectTriggerPrimitive>\n )\n}\n\n/**\n * What a `SelectValue` render function receives, in the Kobalte-era shape.\n */\nexport type SelectValueState<Option = unknown> = {\n selectedOption: () => Option\n selectedOptions: () => Option[]\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at\n * all. An option is the caller's type, so the label is read from a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\nexport type SelectValueProps = Omit<ComponentProps<'span'>, 'children'> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: (state: SelectValueState<any>) => JSX.Element\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const scope = useContext(SelectScopeContext)\n const rest = omit(props, 'class', 'children', 'optionLabel')\n\n const show = (state: { value: unknown; placeholder: boolean }) => {\n if (state.placeholder) return scope?.placeholder()\n const values = Array.isArray(state.value) ? state.value : [state.value]\n const readout: SelectValueState = {\n selectedOption: () => values[0],\n selectedOptions: () => values,\n }\n if (props.children) return props.children(readout)\n const option = readout.selectedOption()\n return props.optionLabel ? props.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <SelectValuePrimitive\n {...(rest as Record<string, unknown>)}\n class={cn('truncate', props.class)}\n render={(part: Record<string, unknown>, state: { placeholder: boolean }) => (\n <span {...part} data-placeholder-shown={state.placeholder ? '' : undefined} />\n )}\n >\n {(state: { value: unknown; placeholder: boolean }) => show(state)}\n </SelectValuePrimitive>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = Omit<ComponentProps<'div'>, 'children'> & {\n children?: JSX.Element\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const scope = useContext(SelectScopeContext)\n const rest = omit(props, 'class', 'children', 'portalMount')\n const placement = () => {\n const [side, align] = (scope?.placement() ?? '').split('-')\n return {\n side: (side || undefined) as 'top' | 'bottom' | undefined,\n align: (side ? (align ?? 'center') : undefined) as 'start' | 'center' | 'end' | undefined,\n }\n }\n\n return (\n <SelectContentPrimitive\n {...(rest as Record<string, unknown>)}\n side={placement().side}\n align={placement().align}\n // Four pixels is shadcn's `sideOffset`: attached, with room for the\n // trigger's own border.\n sideOffset={scope?.gutter() ?? 4}\n container={props.portalMount}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-y-auto overflow-x-hidden',\n // The trigger's width, as Kobalte's `sameWidth` default drew the list.\n 'w-(--anchor-width)',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n props.class\n )}\n >\n {props.children}\n {/* No arrow: the list is the trigger's own value opened up, attached\n to it, where an arrow would read as a gap. */}\n <SelectList class=\"flex flex-col\">\n <For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>\n </SelectList>\n </SelectContentPrimitive>\n )\n}\n\nexport type SelectItemProps = Omit<ComponentProps<'div'>, 'onSelect' | 'onChange'> & {\n /** The node the root's `itemComponent` received. */\n item: SelectCollectionNode<any>\n /** Draw a leading colour dot from the shared tone ladder, the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n}\n\nexport function SelectItem(props: SelectItemProps) {\n const rest = omit(props, 'class', 'children', 'swatch', 'item')\n\n return (\n <SelectItemPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.item.rawValue}\n label={props.item.textValue}\n disabled={props.item.disabled}\n class={cn(menuItem, 'pe-8', props.class)}\n >\n {(state: { selected: boolean }) => (\n <>\n <Show when={props.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.swatch })} />\n </Show>\n <div>{props.children}</div>\n {/* The indicator reads in the accent, like every other selected\n state in the system — the row's own foreground reads as\n decoration. Drawn from the row's `selected` state. */}\n <Show when={state.selected}>\n <span\n data-slot=\"select-indicator\"\n aria-hidden=\"true\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </span>\n </Show>\n </>\n )}\n </SelectItemPrimitive>\n )\n}\n\n/** A group's wrapper inside the list, for a `sectionComponent`. */\nexport function SelectSection(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div role=\"presentation\" class={cn('flex flex-col', props.class)} {...rest} />\n}\n\n/** A group's heading inside the list, for a `sectionComponent`. */\nexport function SelectLabel(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <div\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', props.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <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AAA,CACnB;KANN,OAAA;IAMM,EAAA,CAAA,IAPR,KAAA;GAQM,CAAA;EAfP;CAkBgB,CAAA,CAAA;AAEzB;;AAGA,SAAgB,cAAc,OAA8B;CAC1D,MAAM,OAAO,KAAK,OAAO,OAAO;CACzB,IAAA,QAAA,OAA6E;CAAX,OAAA,OAAA,CAAA;EAA7DC,MAAAA;EAAoB,IAAA,UAAA;GAAO,OAAA,GAAG,iBAAiB,MAAM,KAAK;EAAC;CAAU,GAAJ,IAAA,GAAA,KAAA;CAA7E,OAAOC;AACT;;AAGA,SAAgB,YAAY,OAA8B;CACxD,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,SAAA,OAGC;CADC,OAAA,QAAA,CAAA,EADA,IAAA,UAAA;EAAO,OAAA,GAAG,oEAAoE,MAAM,KAAK;CAAC,EAClF,GAAJ,IAAA,GAAA,KAAA;CAHR,OACEC;AAKJ;;AAGA,SAAgB,qBAAqB,OAA8B;CACjE,OAAOC,gBAAAA,kBAAAA,WAAAA,EAAgB,eAAY,OAAgD,GAApC,KAAoC,CAAA;AACrF"}
|
|
1
|
+
{"version":3,"file":"select.js","names":["<SelectScopeContext value={scope}>\n <SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>\n </SelectScopeContext>","value={scope}","<SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>","onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }","itemToValue={keyOf}","itemToLabel={textOf}","isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}","onOpenChange={(open: boolean) => props.onOpenChange?.(open)}","<div {...(rest as ComponentProps<'div'>)}>\n <SelectScopeContext value={scope}>\n <SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>\n </SelectScopeContext>\n </div>","<SelectTriggerPrimitive\n aria-invalid={scope?.invalid() ? 'true' : undefined}\n {...(rest as Record<string, unknown>)}\n // The Kobalte-era state names the classes below and callers key on.\n // Kobalte marked only the value `data-placeholder-shown`, never the\n // trigger, so the trigger's placeholder rule below never matched and a\n // placeholder drew in the foreground colour; the trigger keeps that.\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button {...part} data-slot=\"select-trigger\" data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': props.size === 'sm',\n 'h-control-md text-sm': props.size === 'md' || props.size === undefined,\n 'h-control-lg text-sm': props.size === 'lg',\n },\n props.class\n )}\n >\n {props.children}\n <Show when={!props.hideIcon}>\n <span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>\n </Show>\n </SelectTriggerPrimitive>","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button {...part} data-slot=\"select-trigger\" data-expanded={state.open ? '' : undefined} />\n )}","props.children","<Show when={!props.hideIcon}>\n <span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>\n </Show>","<ChevronDown />","<span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>","<SelectValuePrimitive\n {...(rest as Record<string, unknown>)}\n class={cn('truncate', props.class)}\n render={(part: Record<string, unknown>, state: { placeholder: boolean }) => (\n <span {...part} data-placeholder-shown={state.placeholder ? '' : undefined} />\n )}\n >\n {(state: { value: unknown; placeholder: boolean }) => show(state)}\n </SelectValuePrimitive>","render={(part: Record<string, unknown>, state: { placeholder: boolean }) => (\n <span {...part} data-placeholder-shown={state.placeholder ? '' : undefined} />\n )}","<SelectContentPrimitive\n {...(rest as Record<string, unknown>)}\n side={placement().side}\n align={placement().align}\n // Four pixels is shadcn's `sideOffset`: attached, with room for the\n // trigger's own border.\n sideOffset={scope?.gutter() ?? 4}\n container={props.portalMount}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-y-auto overflow-x-hidden',\n // The trigger's width, as Kobalte's `sameWidth` default drew the list.\n 'w-(--anchor-width)',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n props.class\n )}\n >\n {props.children}\n {/* No arrow: the list is the trigger's own value opened up, attached\n to it, where an arrow would read as a gap. */}\n <SelectList class=\"flex flex-col\">\n <For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>\n </SelectList>\n </SelectContentPrimitive>","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}","<SelectList class=\"flex flex-col\">\n <For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>\n </SelectList>","class=\"flex flex-col\"","<For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>","<Section section={node} />","section={node}","<Item item={node} />","item={node}","<SelectItemPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.item.rawValue}\n label={props.item.textValue}\n disabled={props.item.disabled}\n class={cn(menuItem, 'pe-8', props.class)}\n >\n {(state: { selected: boolean }) => (\n <>\n <Show when={props.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.swatch })} />\n </Show>\n <div>{props.children}</div>\n {/* The indicator reads in the accent, like every other selected\n state in the system — the row's own foreground reads as\n decoration. Drawn from the row's `selected` state. */}\n <Show when={state.selected}>\n <span\n data-slot=\"select-indicator\"\n aria-hidden=\"true\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </span>\n </Show>\n </>\n )}\n </SelectItemPrimitive>","<Show when={props.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.swatch })} />\n </Show>","<Show when={state.selected}>\n <span\n data-slot=\"select-indicator\"\n aria-hidden=\"true\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </span>\n </Show>","<Check class=\"size-4\" />","class=\"size-4\"","role=\"presentation\"","<div role=\"presentation\" class={cn('flex flex-col', props.class)} {...rest} />","<div\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', props.class)}\n {...rest}\n />","<ChevronsUpDown aria-hidden=\"true\" {...(props as Record<string, unknown>)} />","LucideCheck","LucideChevronDown","LucideChevronsUpDown","_$spread","_$insert","_$effect","_$readShallow","_$className"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import {\n Select as SelectPrimitive,\n SelectContent as SelectContentPrimitive,\n SelectItem as SelectItemPrimitive,\n SelectList,\n SelectTrigger as SelectTriggerPrimitive,\n SelectValue as SelectValuePrimitive,\n} from '@ui-sdk/solid/select'\nimport {\n Check as LucideCheck,\n ChevronDown as LucideChevronDown,\n ChevronsUpDown as LucideChevronsUpDown,\n} from '@lucide/solid'\nimport { dynamic, type ComponentProps, type JSX } from '@solidjs/web'\nimport { For, Show, createContext, createMemo, omit, useContext, type Component } from 'solid-js'\nimport { menuContentPadding, menuItem, menuSwatchTone, type MenuSwatchTone } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst ChevronsUpDown = fastIcon(LucideChevronsUpDown)\n\n/**\n * One entry of the list the root builds from `options`: an option, or the\n * section heading of a group. The Kobalte-era `CollectionNode` fields a\n * caller's `itemComponent` reads (`rawValue`, `key`, `textValue`) keep their\n * names.\n */\nexport type SelectCollectionNode<T> = {\n type: 'item' | 'section'\n key: string\n rawValue: T\n textValue: string\n disabled: boolean\n index: number\n}\n\ntype Accessor<T, R> = keyof T | ((option: T) => R)\n\ntype SelectBaseProps<Option, OptGroup> = Omit<\n ComponentProps<'div'>,\n 'onChange' | 'children' | 'placeholder'\n> & {\n options: ReadonlyArray<Option | OptGroup>\n /** The option's identity: a field name or a function. Defaults to the option itself. */\n optionValue?: Accessor<Option, string | number>\n /** The text typeahead matches and the trigger shows. */\n optionTextValue?: Accessor<Option, string>\n optionDisabled?: Accessor<Option, boolean>\n /** The field of a group that holds its options. */\n optionGroupChildren?: keyof OptGroup\n /** Draws one option; render a `SelectItem` with the `item` it receives. */\n itemComponent?: Component<{ item: SelectCollectionNode<Option> }>\n /** Draws a group's heading, before its options. */\n sectionComponent?: Component<{ section: SelectCollectionNode<OptGroup> }>\n /** What the trigger shows while nothing is selected. */\n placeholder?: JSX.Element\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n disabled?: boolean\n required?: boolean\n readOnly?: boolean\n /** The name the value submits under, as the option's `optionValue`. */\n name?: string\n /** `invalid` marks the trigger `aria-invalid`. */\n validationState?: 'valid' | 'invalid'\n /** Where the list opens against the trigger. */\n placement?: `${'top' | 'bottom'}${'' | '-start' | '-end'}`\n /** The gap between the trigger and the list, in pixels. */\n gutter?: number\n /** `true` locks scroll and makes the page inert while open. */\n modal?: boolean\n /** Whether the arrow keys wrap from the last option to the first. */\n loop?: boolean\n children?: JSX.Element\n}\n\n/**\n * The selection: one option, or a list of them with `multiple`. One shape\n * rather than a union, so `options` alone infers `Option` for the callbacks.\n */\ntype SelectionProps<Option, Multiple extends boolean> = {\n multiple?: Multiple\n value?: Selection<Option, Multiple>\n defaultValue?: Selection<Option, Multiple>\n /** The chosen option, `null` for none, or the list with `multiple`. */\n onChange?: (value: Selection<Option, Multiple>) => void\n}\n\ntype Selection<Option, Multiple extends boolean> = Multiple extends true ? Option[] : Option | null\n\nexport type SelectProps<\n Option,\n OptGroup = never,\n Multiple extends boolean = false,\n> = SelectBaseProps<Option, OptGroup> & SelectionProps<Option, Multiple>\n\ntype SelectScope = {\n nodes: () => SelectCollectionNode<unknown>[]\n itemComponent: () => Component<{ item: SelectCollectionNode<unknown> }> | undefined\n sectionComponent: () => Component<{ section: SelectCollectionNode<unknown> }> | undefined\n placeholder: () => JSX.Element\n placement: () => SelectBaseProps<unknown, unknown>['placement']\n gutter: () => number | undefined\n invalid: () => boolean\n /** The `optionValue` key of an option. */\n keyOf: (option: unknown) => string\n}\n\nconst SelectScopeContext = createContext<SelectScope | null>(null)\n\nfunction read<T, R>(accessor: Accessor<T, R> | undefined, option: T, fallback: R): R {\n if (accessor === undefined) return fallback\n if (typeof accessor === 'function') return accessor(option)\n if (option !== null && typeof option === 'object') return option[accessor] as R\n return fallback\n}\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * ui-sdk's Select is the behaviour: the select-only combobox pattern, typeahead\n * on the closed trigger, a listbox with the chosen option focused on open, form\n * submission. This keeps the Kobalte-era collection API on top of it: the\n * root takes `options` with `optionValue`/`optionTextValue`, and draws each\n * one through `itemComponent`, so the value stays the caller's option object.\n *\n * `SelectValue` renders the human-readable label of the selection, not its\n * value, the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never, Multiple extends boolean = false>(\n props: SelectProps<Option, OptGroup, Multiple>\n) {\n const rest = omit(\n props,\n 'options',\n 'optionValue',\n 'optionTextValue',\n 'optionDisabled',\n 'optionGroupChildren',\n 'itemComponent',\n 'sectionComponent',\n 'placeholder',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'disabled',\n 'required',\n 'readOnly',\n 'name',\n 'validationState',\n 'placement',\n 'gutter',\n 'modal',\n 'loop',\n 'children',\n 'multiple',\n 'value',\n 'defaultValue',\n 'onChange'\n )\n const keyOf = (option: unknown) =>\n String(read(props.optionValue as Accessor<unknown, string | number>, option, option as string))\n const textOf = (option: unknown) =>\n read(props.optionTextValue as Accessor<unknown, string>, option, keyOf(option))\n\n // One node per option, reused while the option object is, so an `<For>`\n // over them keeps its rows when `options` is replaced by an equal list.\n const cache = new WeakMap<object, SelectCollectionNode<unknown>>()\n const nodeOf = (rawValue: unknown, type: 'item' | 'section', index: number) => {\n const disabled =\n type === 'item' && !!read(props.optionDisabled as Accessor<unknown, boolean>, rawValue, false)\n const key = type === 'item' ? keyOf(rawValue) : `section-${index}`\n const textValue = type === 'item' ? textOf(rawValue) : ''\n const cached =\n rawValue !== null && typeof rawValue === 'object' ? cache.get(rawValue) : undefined\n if (\n cached &&\n cached.type === type &&\n cached.key === key &&\n cached.textValue === textValue &&\n cached.disabled === disabled &&\n cached.index === index\n ) {\n return cached\n }\n const node = { type, key, rawValue, textValue, disabled, index }\n if (rawValue !== null && typeof rawValue === 'object') cache.set(rawValue, node)\n return node\n }\n\n const nodes = createMemo(() => {\n const children = props.optionGroupChildren\n const list: SelectCollectionNode<unknown>[] = []\n let index = 0\n for (const entry of props.options) {\n const groupItems =\n children && entry !== null && typeof entry === 'object'\n ? (entry as Record<PropertyKey, unknown>)[children as PropertyKey]\n : undefined\n if (Array.isArray(groupItems)) {\n list.push(nodeOf(entry, 'section', index++))\n for (const option of groupItems) list.push(nodeOf(option, 'item', index++))\n } else {\n list.push(nodeOf(entry, 'item', index++))\n }\n }\n return list\n })\n\n // The options as ui-sdk data: the closed trigger's typeahead and labels\n // read them before the list has ever opened.\n const items = createMemo(() =>\n nodes()\n .filter((node) => node.type === 'item')\n .map((node) => ({ value: node.rawValue, label: node.textValue, disabled: node.disabled }))\n )\n\n const scope: SelectScope = {\n nodes,\n itemComponent: () =>\n props.itemComponent as Component<{ item: SelectCollectionNode<unknown> }> | undefined,\n sectionComponent: () =>\n props.sectionComponent as Component<{ section: SelectCollectionNode<unknown> }> | undefined,\n placeholder: () => props.placeholder,\n placement: () => props.placement,\n gutter: () => props.gutter,\n invalid: () => props.validationState === 'invalid',\n keyOf,\n }\n\n // Kobalte's root was an element; the wrapper keeps that box and its props.\n return (\n <div {...(rest as ComponentProps<'div'>)}>\n <SelectScopeContext value={scope}>\n <SelectPrimitive<unknown, boolean>\n items={items()}\n multiple={props.multiple}\n value={props.value as unknown}\n defaultValue={props.defaultValue as unknown}\n onValueChange={(value: unknown) =>\n (props.onChange as ((value: unknown) => void) | undefined)?.(value ?? null)\n }\n itemToValue={keyOf}\n itemToLabel={textOf}\n isItemEqualToValue={(item: unknown, value: unknown) => keyOf(item) === keyOf(value)}\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={(open: boolean) => props.onOpenChange?.(open)}\n disabled={props.disabled}\n required={props.required}\n readOnly={props.readOnly}\n name={props.name}\n modal={props.modal ?? false}\n loop={props.loop}\n >\n {props.children}\n </SelectPrimitive>\n </SelectScopeContext>\n </div>\n )\n}\n\nexport type SelectTriggerProps = Omit<\n ComponentProps<'button'>,\n 'value' | 'onChange' | 'onSelect'\n> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const scope = useContext(SelectScopeContext)\n const rest = omit(props, 'class', 'size', 'hideIcon', 'children')\n\n return (\n <SelectTriggerPrimitive\n aria-invalid={scope?.invalid() ? 'true' : undefined}\n {...(rest as Record<string, unknown>)}\n // The Kobalte-era state names the classes below and callers key on.\n // Kobalte marked only the value `data-placeholder-shown`, never the\n // trigger, so the trigger's placeholder rule below never matched and a\n // placeholder drew in the foreground colour; the trigger keeps that.\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button {...part} data-slot=\"select-trigger\" data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': props.size === 'sm',\n 'h-control-md text-sm': props.size === 'md' || props.size === undefined,\n 'h-control-lg text-sm': props.size === 'lg',\n },\n props.class\n )}\n >\n {props.children}\n <Show when={!props.hideIcon}>\n <span aria-hidden=\"true\" class=\"text-muted-foreground\">\n <ChevronDown />\n </span>\n </Show>\n </SelectTriggerPrimitive>\n )\n}\n\n/**\n * What a `SelectValue` render function receives, in the Kobalte-era shape.\n */\nexport type SelectValueState<Option = unknown> = {\n selectedOption: () => Option\n selectedOptions: () => Option[]\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at\n * all. An option is the caller's type, so the label is read from a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\nexport type SelectValueProps = Omit<ComponentProps<'span'>, 'children'> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: (state: SelectValueState<any>) => JSX.Element\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const scope = useContext(SelectScopeContext)\n const rest = omit(props, 'class', 'children', 'optionLabel')\n\n const show = (state: { value: unknown; placeholder: boolean }) => {\n if (state.placeholder) return scope?.placeholder()\n const values = Array.isArray(state.value) ? state.value : [state.value]\n const readout: SelectValueState = {\n selectedOption: () => values[0],\n selectedOptions: () => values,\n }\n if (props.children) return props.children(readout)\n const option = readout.selectedOption()\n return props.optionLabel ? props.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <SelectValuePrimitive\n {...(rest as Record<string, unknown>)}\n class={cn('truncate', props.class)}\n render={(part: Record<string, unknown>, state: { placeholder: boolean }) => (\n <span {...part} data-placeholder-shown={state.placeholder ? '' : undefined} />\n )}\n >\n {(state: { value: unknown; placeholder: boolean }) => show(state)}\n </SelectValuePrimitive>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = Omit<ComponentProps<'div'>, 'children'> & {\n children?: JSX.Element\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const scope = useContext(SelectScopeContext)\n const rest = omit(props, 'class', 'children', 'portalMount')\n const placement = () => {\n const [side, align] = (scope?.placement() ?? '').split('-')\n return {\n side: (side || undefined) as 'top' | 'bottom' | undefined,\n align: (side ? (align ?? 'center') : undefined) as 'start' | 'center' | 'end' | undefined,\n }\n }\n\n return (\n <SelectContentPrimitive\n {...(rest as Record<string, unknown>)}\n side={placement().side}\n align={placement().align}\n // Four pixels is shadcn's `sideOffset`: attached, with room for the\n // trigger's own border.\n sideOffset={scope?.gutter() ?? 4}\n container={props.portalMount}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-y-auto overflow-x-hidden',\n // The trigger's width, as Kobalte's `sameWidth` default drew the list.\n 'w-(--anchor-width)',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n props.class\n )}\n >\n {props.children}\n {/* No arrow: the list is the trigger's own value opened up, attached\n to it, where an arrow would read as a gap. */}\n <SelectList class=\"flex flex-col\">\n <For each={scope?.nodes() ?? []}>\n {(node) => {\n if (node.type === 'section') {\n const Section = dynamic(() => scope?.sectionComponent())\n return <Section section={node} />\n }\n const Item = dynamic(() => scope?.itemComponent())\n return <Item item={node} />\n }}\n </For>\n </SelectList>\n </SelectContentPrimitive>\n )\n}\n\nexport type SelectItemProps = Omit<ComponentProps<'div'>, 'onSelect' | 'onChange'> & {\n /** The node the root's `itemComponent` received. */\n item: SelectCollectionNode<any>\n /** Draw a leading colour dot from the shared tone ladder, the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n}\n\nexport function SelectItem(props: SelectItemProps) {\n const rest = omit(props, 'class', 'children', 'swatch', 'item')\n\n return (\n <SelectItemPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.item.rawValue}\n label={props.item.textValue}\n disabled={props.item.disabled}\n class={cn(menuItem, 'pe-8', props.class)}\n >\n {(state: { selected: boolean }) => (\n <>\n <Show when={props.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.swatch })} />\n </Show>\n <div>{props.children}</div>\n {/* The indicator reads in the accent, like every other selected\n state in the system — the row's own foreground reads as\n decoration. Drawn from the row's `selected` state. */}\n <Show when={state.selected}>\n <span\n data-slot=\"select-indicator\"\n aria-hidden=\"true\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </span>\n </Show>\n </>\n )}\n </SelectItemPrimitive>\n )\n}\n\n/** A group's wrapper inside the list, for a `sectionComponent`. */\nexport function SelectSection(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div role=\"presentation\" class={cn('flex flex-col', props.class)} {...rest} />\n}\n\n/** A group's heading inside the list, for a `sectionComponent`. */\nexport function SelectLabel(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <div\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', props.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...(props as Record<string, unknown>)} />\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAM,QAAQ,SAASmC,OAAW;AAClC,IAAM,cAAc,SAASC,aAAiB;AAC9C,IAAM,iBAAiB,SAASC,gBAAoB;AA0FpD,IAAM,qBAAqB,cAAkC,IAAI;AAEjE,SAAS,KAAW,U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B,IAAA,UAAA;GAAO,OAAA,GAAG,iBAAiB,MAAM,KAAK;EAAC;CAAU,GAAJ,IAAA,GAAA,KAAA;CAA7E,OAAOC;AACT;;AAGA,SAAgB,YAAY,OAA8B;CACxD,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,SAAA,OAGC;CADCM,OAAA,QAAA,CAAA,EADA,IAAA,UAAA;EAAO,OAAA,GAAG,oEAAoE,MAAM,KAAK;CAAC,EAClF,GAAJ,IAAA,GAAA,KAAA;CAHR,OACEL;AAKJ;;AAGA,SAAgB,qBAAqB,OAA8B;CACjE,OAAOC,gBAAAA,gBAAAA,WAAAA,EAAgB,eAAY,OAAgD,GAApC,KAAoC,CAAA;AACrF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
1
|
import { Dynamic, createComponent, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { Separator as Separator$1 } from "@ui-sdk/solid/separator";
|
|
3
3
|
import { omit } from "solid-js";
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
// src/components/ui/separator/separator.tsx
|
|
6
|
-
function Separator
|
|
6
|
+
function Separator(props) {
|
|
7
7
|
const local = props;
|
|
8
8
|
const rest = omit(local, "as", "class", "variant", "orientation");
|
|
9
|
-
return createComponent(Separator, mergeProps({
|
|
9
|
+
return createComponent(Separator$1, mergeProps({
|
|
10
10
|
render: (separatorProps) => createComponent(Dynamic, mergeProps({ get component() {
|
|
11
11
|
return local.as ?? "div";
|
|
12
12
|
} }, separatorProps, { get "data-slot"() {
|
|
@@ -20,6 +20,6 @@ function Separator$1(props) {
|
|
|
20
20
|
}
|
|
21
21
|
}, rest));
|
|
22
22
|
}
|
|
23
|
-
export { Separator
|
|
23
|
+
export { Separator };
|
|
24
24
|
|
|
25
25
|
//# sourceMappingURL=separator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":["<SdkSeparator\n // ui-sdk stamps its own `data-slot=\"separator\"` over the caller's; a caller's\n // slot (`shell-top-bar-divider`, ...) is a public hook and wins, as it did\n // when Kobalte passed it straight through.\n render={(separatorProps: Record<string, unknown>) => (\n <Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />\n )}\n orientation={local.orientation ?? 'horizontal'}\n class={cn(\n 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n {\n 'border-t border-dashed border-border bg-transparent data-[orientation=horizontal]:h-0':\n local.variant === 'dashed',\n },\n local.class\n )}\n {...(rest as ComponentProps<typeof SdkSeparator>)}\n />","render={(separatorProps: Record<string, unknown>) => (\n <Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />\n )}","<Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />"
|
|
1
|
+
{"version":3,"file":"separator.js","names":["<SdkSeparator\n // ui-sdk stamps its own `data-slot=\"separator\"` over the caller's; a caller's\n // slot (`shell-top-bar-divider`, ...) is a public hook and wins, as it did\n // when Kobalte passed it straight through.\n render={(separatorProps: Record<string, unknown>) => (\n <Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />\n )}\n orientation={local.orientation ?? 'horizontal'}\n class={cn(\n 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n {\n 'border-t border-dashed border-border bg-transparent data-[orientation=horizontal]:h-0':\n local.variant === 'dashed',\n },\n local.class\n )}\n {...(rest as ComponentProps<typeof SdkSeparator>)}\n />","render={(separatorProps: Record<string, unknown>) => (\n <Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />\n )}","<Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />"],"sources":["../../../../src/components/ui/separator/separator.tsx"],"sourcesContent":["import { Separator as SdkSeparator } from '@ui-sdk/solid/separator'\nimport { omit } from 'solid-js'\nimport { Dynamic, type ComponentProps, type JSX, type ValidComponent } from '@solidjs/web'\nimport { cn } from '#lib/utils'\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * polymorphic props this type has always had.\n */\ntype PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\n/**\n * Separator.\n *\n * Renders `role=\"separator\"` with the right orientation, so a screen reader\n * understands it as a boundary rather than as an empty element. A plain\n * `<div>` with a border looks identical and announces nothing.\n *\n * ui-sdk's Separator supplies the role, `aria-orientation` and\n * `data-orientation`; `as` renders it as another element through its `render`.\n */\nexport type SeparatorProps<T extends ValidComponent = 'div'> = PolymorphicProps<\n T,\n {\n class?: string\n /** Draw the line as a dashed rule. For an \"or\" between alternative paths. */\n variant?: 'solid' | 'dashed'\n orientation?: 'horizontal' | 'vertical'\n }\n>\n\nexport function Separator<T extends ValidComponent = 'div'>(props: SeparatorProps<T>) {\n const local = props as SeparatorProps & { as?: ValidComponent }\n const rest = omit(local, 'as', 'class', 'variant', 'orientation')\n\n return (\n <SdkSeparator\n // ui-sdk stamps its own `data-slot=\"separator\"` over the caller's; a caller's\n // slot (`shell-top-bar-divider`, ...) is a public hook and wins, as it did\n // when Kobalte passed it straight through.\n render={(separatorProps: Record<string, unknown>) => (\n <Dynamic\n component={local.as ?? 'div'}\n {...separatorProps}\n data-slot={\n (local as { 'data-slot'?: string })['data-slot'] ??\n (separatorProps['data-slot'] as string)\n }\n />\n )}\n orientation={local.orientation ?? 'horizontal'}\n class={cn(\n 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n {\n 'border-t border-dashed border-border bg-transparent data-[orientation=horizontal]:h-0':\n local.variant === 'dashed',\n },\n local.class\n )}\n {...(rest as ComponentProps<typeof SdkSeparator>)}\n />\n )\n}\n"],"mappings":";;;;;AAmCA,SAAgB,UAA4C,OAA0B;CACpF,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,MAAM,SAAS,WAAW,aAAa;CAEhE,OACEA,gBAAAA,aAAAA,WAAAA;EAIEC,SAAS,mBACPC,gBAAAA,SAAAA,WAAAA,EACE,IAAA,YAAA;GAAW,OAAA,MAAM,MAAM;EAAK,EAM7B,GALK,gBAFN,EAGE,IAAA,cAAA;GACG,OAAA,MAAmC,gBACnC,eAAe;EAClB,EACD,CAAA,CAAA;EAEH,IAAA,cAAA;GAAa,OAAA,MAAM,eAAe;EAAY;EAC9C,IAAA,UAAA;GAAO,OAAA,GACL,kKACA,EACE,yFACE,MAAM,YAAY,SACtB,GACA,MAAM,KACR;EAAC;CAEF,GADM,IACN,CAAA;AAEL"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { Portal, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
2
|
+
import { DialogClose, DialogContent, DialogDescription, DialogTitle } from "@ui-sdk/solid/dialog";
|
|
3
|
+
import { X as X$1 } from "@lucide/solid";
|
|
4
|
+
import { Show, children, omit } from "solid-js";
|
|
1
5
|
import { cva } from "../../../lib/variants.js";
|
|
2
6
|
import { overlayCornerClose, overlayDescription, overlayTitle } from "../../../lib/overlay.js";
|
|
3
7
|
import { cn } from "../../../lib/utils.js";
|
|
@@ -6,13 +10,9 @@ import { asRender, expandedDiv, overlayContainer } from "../tooltip/tooltip.js";
|
|
|
6
10
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
7
11
|
import { forwardRef } from "../../../lib/refs.js";
|
|
8
12
|
import { Dialog as Dialog$1, DialogTrigger as DialogTrigger$1 } from "../dialog/dialog.js";
|
|
9
|
-
import { Portal, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
10
|
-
import { X } from "@lucide/solid";
|
|
11
|
-
import { Show, children, omit } from "solid-js";
|
|
12
|
-
import { DialogClose, DialogContent, DialogDescription, DialogTitle } from "@ui-sdk/solid/dialog";
|
|
13
13
|
// src/components/ui/sheet/sheet.tsx
|
|
14
14
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
15
|
-
var X
|
|
15
|
+
var X = fastIcon(X$1);
|
|
16
16
|
/**
|
|
17
17
|
* Sheet.
|
|
18
18
|
*
|
|
@@ -189,7 +189,7 @@ function SheetContent(props) {
|
|
|
189
189
|
tabindex: "0",
|
|
190
190
|
class: overlayCornerClose,
|
|
191
191
|
get children() {
|
|
192
|
-
return closeButton() ?? createComponent(X
|
|
192
|
+
return closeButton() ?? createComponent(X, { class: "size-4" });
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
}
|