@adea-ai/ui 0.162.6 → 0.162.8
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["<Portal mount={overlayContainer()}>\n <UiDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: props.side, variant: variant(), size: props.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>","<UiDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: props.side, variant: variant(), size: props.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>","ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}","render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}","<TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>","class=\"fixed inset-0 z-(--z-dialog)\"","<Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>","<DialogScrim open={state.open} />","expandedDiv(panelProps, state)","<LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>","element={() => panel}","props.children","<Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>","<UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>","tabindex=\"0\"","class={overlayCornerClose}","<X class=\"size-4\" />","class=\"size-4\"","<UiDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />","<div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', props.class)}\n {...rest}\n />","<div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />","<UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","X","LucideX","resolveChildren"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import {\n DialogClose as UiDialogClose,\n DialogContent as UiDialogContent,\n DialogDescription as UiDialogDescription,\n DialogTitle as UiDialogTitle,\n type DialogContentState,\n} from '@ui-sdk/solid/dialog'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport { X as LucideX } from '@lucide/solid'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { children as resolveChildren, Show, omit } from 'solid-js'\nimport { Portal } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayCornerClose, overlayDescription, overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Dialog, DialogTrigger } from '../dialog'\nimport {\n DialogScrim,\n LayerEscapeTarget,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n TopLayerPositioner,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { asRender, expandedDiv, overlayContainer, type WithAs } from '../tooltip/tooltip'\nimport { fastIcon } from '#lib/fast-icon'\nimport { forwardRef } from '#lib/refs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width band that holds\n * the decision. Pass `band` to the header, the footer, or both to step those\n * parts onto the ladder's subtle-fill rung (see `SheetFooter`).\n *\n * It is a Dialog underneath (ui-sdk's dialog: focus trapped, the page inert\n * and its scroll locked, Escape and an outside press close it), so like every\n * dialog a sheet returns focus on close to its trigger, or to the element\n * focused before it opened. Pass `restoreFocusRef` when a stable external opener must\n * be used instead, such as when another layer closes before the sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n /**\n * `panel` gives a start or end sheet the shell's panel width\n * (`--panel-width`, 390px) — the width a pane that collapses into a sheet\n * on a narrow window already had beside the work, so its content does not\n * reflow when it moves. Top and bottom sheets span the window either way.\n */\n size: {\n default: '',\n panel: '',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n {\n side: ['start', 'end'],\n variant: 'edge',\n size: 'panel',\n class: 'w-panel max-w-[92vw]',\n },\n { side: ['start', 'end'], variant: 'inset', size: 'panel', class: 'w-panel' },\n ],\n defaultVariants: { side: 'end', variant: 'edge', size: 'default' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\ntype SheetContentOwnProps = {\n class?: string\n children?: JSX.Element\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n}\n\nexport type SheetContentProps = Omit<\n PartProps<'div', DialogContentState>,\n | keyof SheetContentOwnProps\n | keyof LayerHandlers\n | 'keepMounted'\n | 'inline'\n | 'render'\n | 'side'\n | 'variant'\n | 'size'\n> &\n SheetContentOwnProps &\n LayerHandlers &\n VariantProps<typeof sheetVariants>\n\n/**\n * The panel renders into `<body>` inside the same kind of top-layer positioner\n * as Dialog's (see `TopLayerPositioner`), so a sheet opened from a popover\n * still stacks above it. The positioner is a transparent window-sized layer;\n * the panel keeps its own `fixed` edge placement inside it, and a press beside\n * the panel lands on the positioner, outside the panel, and closes the sheet.\n */\nexport function SheetContent(props: SheetContentProps) {\n let panel: HTMLDivElement | undefined\n const rest = omit(\n props,\n 'class',\n 'side',\n 'variant',\n 'size',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'ref',\n ...layerHandlerProps\n )\n const focus = useLayerContent({\n content: () => panel,\n handlers: layerHandlers(props),\n restoreFocusRef: () => props.restoreFocusRef?.(),\n })\n\n const variant = () => sheetVariantFor(props.side, props.variant)\n\n const closeButton = resolveChildren(() => props.closeButton)\n return (\n <Portal mount={overlayContainer()}>\n <UiDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: props.side, variant: variant(), size: props.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>\n )\n}\n\n/** The sheet's root and trigger are the dialog's: a sheet is a dialog placed at an edge. */\nexport { Dialog as Sheet, DialogTrigger as SheetTrigger }\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements> = PartProps<Tag> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n class?: string\n [key: string]: unknown\n}\n\nexport function SheetCloseButton(props: WithAs<ComponentProps<typeof UiDialogClose>>) {\n return (\n <UiDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/**\n * The sheet's title band: a heading, a description and the full-width rule\n * beneath, with the close button in the corner. `band` steps the band onto the\n * subtle-fill rung (see `SheetFooter`) — the two-toned anatomy of a sheet that\n * reads as a panel beside the work rather than one flat canvas.\n */\nexport function SheetHeader(props: ComponentProps<'div'> & { band?: boolean }) {\n const rest = omit(props, 'class', 'band')\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', props.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The sheet's decision band: a full-width, hairline-ruled strip that holds the\n * actions. `band` paints it with `--muted` — the elevation ladder's\n * subtle-fill rung, one step up from the panel's `--background` — so the sheet\n * reads two-toned: title band and decision band on the raised rung, scrolling\n * body on the panel surface. The rung already exists for cards, sidebars and\n * input fills; this is the panel-shaped overlay family claiming it. Opt-in\n * because the flat panel is the documented default: the centred modal\n * separates with veil, hairline and shadow instead (the elevated overlay rung\n * amplifies the canvas chroma, which reads as a cast across a large panel),\n * and a host opts a whole sheet family in by passing the prop where it composes\n * the parts — not by restyling them from the outside.\n */\nexport function SheetFooter(props: ComponentProps<'div'> & { band?: boolean }) {\n const rest = omit(props, 'class', 'band')\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: PolymorphicPartProps<'h2'>) {\n return (\n <UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function SheetDescription(props: PolymorphicPartProps<'p'>) {\n return (\n <UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;AA+BA,IAAMwB,MAAI,SAASC,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqC1B,IAAM,gBAAgB,IACpB,0GACA;CACE,UAAU;EACR,MAAM;GACJ,KAAK;GACL,QAAQ;GACR,OAAO;GACP,KAAK;EACP;EACA,SAAS;GACP,MAAM;GACN,OAAO;EACT;;;;;;;EAOA,MAAM;GACJ,SAAS;GACT,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM,CAAC,SAAS,KAAK;GACrB,SAAS;GACT,MAAM;GACN,OAAO;EACT;EACA;GAAE,MAAM,CAAC,SAAS,KAAK;GAAG,SAAS;GAAS,MAAM;GAAS,OAAO;EAAU;CAC9E;CACA,iBAAiB;EAAE,MAAM;EAAO,SAAS;EAAQ,MAAM;CAAU;AACnE,CACF;;AAGA,IAAM,mBACJ,MACA,YACqB,aAAa,QAAQ,WAAW,QAAQ,UAAU;;;;;;;;AAmCzE,SAAgB,aAAa,OAA0B;CACrD,IAAI;CACJ,MAAM,OAAO,KACX,OACA,SACA,QACA,WACA,QACA,YACA,eACA,cACA,mBACA,OACA,GAAG,iBACL;CACA,MAAM,QAAQ,gBAAgB;EAC5B,eAAe;EACf,UAAU,cAAc,KAAK;EAC7B,uBAAuB,MAAM,kBAAkB;CACjD,CAAC;CAED,M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AAA,KAAA;CARR,OACEC;AAUJ;AAEA,SAAgB,WAAW,OAAmC;CAC5D,OACEC,gBAAAA,aAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,cAAc,MAAM,KAAK;EAAC;EACpC,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;AAEA,SAAgB,iBAAiB,OAAkC;CACjE,OACEC,gBAAAA,mBAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,oBAAoB,MAAM,KAAK;EAAC;EAC1C,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"sheet.js","names":["<Portal mount={overlayContainer()}>\n <UiDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: props.side, variant: variant(), size: props.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>","<UiDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: props.side, variant: variant(), size: props.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>","ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}","render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}","<TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>","class=\"fixed inset-0 z-(--z-dialog)\"","<Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>","<DialogScrim open={state.open} />","expandedDiv(panelProps, state)","<LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>","element={() => panel}","props.children","<Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>","<UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>","tabindex=\"0\"","class={overlayCornerClose}","<X class=\"size-4\" />","class=\"size-4\"","<UiDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />","<div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', props.class)}\n {...rest}\n />","<div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />","<UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","LucideX","resolveChildren","_$spread"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import {\n DialogClose as UiDialogClose,\n DialogContent as UiDialogContent,\n DialogDescription as UiDialogDescription,\n DialogTitle as UiDialogTitle,\n type DialogContentState,\n} from '@ui-sdk/solid/dialog'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport { X as LucideX } from '@lucide/solid'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { children as resolveChildren, Show, omit } from 'solid-js'\nimport { Portal } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayCornerClose, overlayDescription, overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Dialog, DialogTrigger } from '../dialog'\nimport {\n DialogScrim,\n LayerEscapeTarget,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n TopLayerPositioner,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { asRender, expandedDiv, overlayContainer, type WithAs } from '../tooltip/tooltip'\nimport { fastIcon } from '#lib/fast-icon'\nimport { forwardRef } from '#lib/refs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width band that holds\n * the decision. Pass `band` to the header, the footer, or both to step those\n * parts onto the ladder's subtle-fill rung (see `SheetFooter`).\n *\n * It is a Dialog underneath (ui-sdk's dialog: focus trapped, the page inert\n * and its scroll locked, Escape and an outside press close it), so like every\n * dialog a sheet returns focus on close to its trigger, or to the element\n * focused before it opened. Pass `restoreFocusRef` when a stable external opener must\n * be used instead, such as when another layer closes before the sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n /**\n * `panel` gives a start or end sheet the shell's panel width\n * (`--panel-width`, 390px) — the width a pane that collapses into a sheet\n * on a narrow window already had beside the work, so its content does not\n * reflow when it moves. Top and bottom sheets span the window either way.\n */\n size: {\n default: '',\n panel: '',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n {\n side: ['start', 'end'],\n variant: 'edge',\n size: 'panel',\n class: 'w-panel max-w-[92vw]',\n },\n { side: ['start', 'end'], variant: 'inset', size: 'panel', class: 'w-panel' },\n ],\n defaultVariants: { side: 'end', variant: 'edge', size: 'default' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\ntype SheetContentOwnProps = {\n class?: string\n children?: JSX.Element\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n}\n\nexport type SheetContentProps = Omit<\n PartProps<'div', DialogContentState>,\n | keyof SheetContentOwnProps\n | keyof LayerHandlers\n | 'keepMounted'\n | 'inline'\n | 'render'\n | 'side'\n | 'variant'\n | 'size'\n> &\n SheetContentOwnProps &\n LayerHandlers &\n VariantProps<typeof sheetVariants>\n\n/**\n * The panel renders into `<body>` inside the same kind of top-layer positioner\n * as Dialog's (see `TopLayerPositioner`), so a sheet opened from a popover\n * still stacks above it. The positioner is a transparent window-sized layer;\n * the panel keeps its own `fixed` edge placement inside it, and a press beside\n * the panel lands on the positioner, outside the panel, and closes the sheet.\n */\nexport function SheetContent(props: SheetContentProps) {\n let panel: HTMLDivElement | undefined\n const rest = omit(\n props,\n 'class',\n 'side',\n 'variant',\n 'size',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'ref',\n ...layerHandlerProps\n )\n const focus = useLayerContent({\n content: () => panel,\n handlers: layerHandlers(props),\n restoreFocusRef: () => props.restoreFocusRef?.(),\n })\n\n const variant = () => sheetVariantFor(props.side, props.variant)\n\n const closeButton = resolveChildren(() => props.closeButton)\n return (\n <Portal mount={overlayContainer()}>\n <UiDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: props.side, variant: variant(), size: props.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n {/* An inset panel is beside the work, so the work stays in view: no\n scrim. It is still modal: focus stays inside and an outside\n press dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogScrim open={state.open} />\n </Show>\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <UiDialogClose\n aria-label={props.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </UiDialogClose>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>\n )\n}\n\n/** The sheet's root and trigger are the dialog's: a sheet is a dialog placed at an edge. */\nexport { Dialog as Sheet, DialogTrigger as SheetTrigger }\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements> = PartProps<Tag> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n class?: string\n [key: string]: unknown\n}\n\nexport function SheetCloseButton(props: WithAs<ComponentProps<typeof UiDialogClose>>) {\n return (\n <UiDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/**\n * The sheet's title band: a heading, a description and the full-width rule\n * beneath, with the close button in the corner. `band` steps the band onto the\n * subtle-fill rung (see `SheetFooter`) — the two-toned anatomy of a sheet that\n * reads as a panel beside the work rather than one flat canvas.\n */\nexport function SheetHeader(props: ComponentProps<'div'> & { band?: boolean }) {\n const rest = omit(props, 'class', 'band')\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', props.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The sheet's decision band: a full-width, hairline-ruled strip that holds the\n * actions. `band` paints it with `--muted` — the elevation ladder's\n * subtle-fill rung, one step up from the panel's `--background` — so the sheet\n * reads two-toned: title band and decision band on the raised rung, scrolling\n * body on the panel surface. The rung already exists for cards, sidebars and\n * input fills; this is the panel-shaped overlay family claiming it. Opt-in\n * because the flat panel is the documented default: the centred modal\n * separates with veil, hairline and shadow instead (the elevated overlay rung\n * amplifies the canvas chroma, which reads as a cast across a large panel),\n * and a host opts a whole sheet family in by passing the prop where it composes\n * the parts — not by restyling them from the outside.\n */\nexport function SheetFooter(props: ComponentProps<'div'> & { band?: boolean }) {\n const rest = omit(props, 'class', 'band')\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n { 'bg-muted': props.band },\n props.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: PolymorphicPartProps<'h2'>) {\n return (\n <UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function SheetDescription(props: PolymorphicPartProps<'p'>) {\n return (\n <UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;AA+BA,IAAM,IAAI,SAASwB,GAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqC1B,IAAM,gBAAgB,IACpB,0GACA;CACE,UAAU;EACR,MAAM;GACJ,KAAK;GACL,QAAQ;GACR,OAAO;GACP,KAAK;EACP;EACA,SAAS;GACP,MAAM;GACN,OAAO;EACT;;;;;;;EAOA,MAAM;GACJ,SAAS;GACT,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM,CAAC,SAAS,KAAK;GACrB,SAAS;GACT,MAAM;GACN,OAAO;EACT;EACA;GAAE,MAAM,CAAC,SAAS,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AAO,OAAO;CAE9B,IAAA,QAAA,OAIC;CADCO,OAAA,OAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,sCAAsC,MAAM,KAAK;EAAC;CACpD,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEN;AAMJ;;;;;;;;;;;;;;AAeA,SAAgB,YAAY,OAAmD;CAC7E,MAAM,OAAO,KAAK,OAAO,SAAS,MAAM;CAEtC,IAAA,QAAA,OAQC;CADCM,OAAA,OAAA,CAAA;EANA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,yGACA,EAAE,YAAY,MAAM,KAAK,GACzB,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,KAAA;CARR,OACEL;AAUJ;AAEA,SAAgB,WAAW,OAAmC;CAC5D,OACEC,gBAAAA,aAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,cAAc,MAAM,KAAK;EAAC;EACpC,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;AAEA,SAAgB,iBAAiB,OAAkC;CACjE,OACEC,gBAAAA,mBAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,oBAAoB,MAAM,KAAK;EAAC;EAC1C,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL"}
|
|
@@ -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/skeleton/skeleton.tsx
|
|
5
5
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","names":["<div\n data-slot=\"skeleton\"\n aria-hidden=\"true\"\n class={cn('bg-muted animate-shimmer rounded-md', local.class)}\n {...rest}\n />"],"sources":["../../../../src/components/ui/skeleton/skeleton.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Skeleton.\n *\n * A placeholder that stands in for content whose shape is already known. It\n * carries `aria-hidden` and no text, because the loading state is announced by\n * the region that owns it, a skeleton that says \"loading\" would announce it\n * once per bar.\n *\n * The shimmer is a background animation rather than a moving gradient element\n * so it costs one paint and no layout, and it stops under `prefers-reduced-motion`\n * (base.css).\n */\nexport function Skeleton(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n\n return (\n <div\n data-slot=\"skeleton\"\n aria-hidden=\"true\"\n class={cn('bg-muted animate-shimmer rounded-md', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,SAAS,OAA8B;CACrD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,OAAA,OAKC;
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":["<div\n data-slot=\"skeleton\"\n aria-hidden=\"true\"\n class={cn('bg-muted animate-shimmer rounded-md', local.class)}\n {...rest}\n />","_$spread"],"sources":["../../../../src/components/ui/skeleton/skeleton.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Skeleton.\n *\n * A placeholder that stands in for content whose shape is already known. It\n * carries `aria-hidden` and no text, because the loading state is announced by\n * the region that owns it, a skeleton that says \"loading\" would announce it\n * once per bar.\n *\n * The shimmer is a background animation rather than a moving gradient element\n * so it costs one paint and no layout, and it stops under `prefers-reduced-motion`\n * (base.css).\n */\nexport function Skeleton(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n\n return (\n <div\n data-slot=\"skeleton\"\n aria-hidden=\"true\"\n class={cn('bg-muted animate-shimmer rounded-md', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,SAAS,OAA8B;CACrD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,OAAA,OAKC;CADCC,OAAA,MAAA,CAAA;EAHA,aAAA;EACA,eAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,uCAAuC,MAAM,KAAK;EAAC;CACrD,GAAJ,IAAA,GAAA,KAAA;CALR,OACED;AAOJ"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
1
|
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
2
|
+
import { Slider as Slider$1, SliderControl, SliderIndicator, SliderThumb, SliderTrack } from "@ui-sdk/solid/slider";
|
|
3
3
|
import { For, omit } from "solid-js";
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
// src/components/ui/slider/slider.tsx
|
|
6
6
|
var _tmpl$ = /* @__PURE__ */ template(`<span class="bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums">`);
|
|
7
7
|
var toArray = (value) => Array.isArray(value) ? value : [value];
|
|
8
|
-
function Slider
|
|
8
|
+
function Slider(props) {
|
|
9
9
|
const rest = omit(props, "class", "trackClass", "rangeClass", "thumbClass", "thumbLabels", "valueLabel", "children", "aria-label", "aria-labelledby", "value", "defaultValue", "onChange", "onChangeEnd", "minValue", "maxValue");
|
|
10
10
|
const thumbs = () => Array.from({ length: (props.value ?? props.defaultValue ?? [0]).length }, (_, index) => index);
|
|
11
|
-
return createComponent(Slider, mergeProps({
|
|
11
|
+
return createComponent(Slider$1, mergeProps({
|
|
12
12
|
"data-slot": "slider",
|
|
13
13
|
get value() {
|
|
14
14
|
return props.value;
|
|
@@ -86,6 +86,6 @@ function Slider$1(props) {
|
|
|
86
86
|
})];
|
|
87
87
|
} }));
|
|
88
88
|
}
|
|
89
|
-
export { Slider
|
|
89
|
+
export { Slider };
|
|
90
90
|
|
|
91
91
|
//# sourceMappingURL=slider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","names":["<SdkSlider\n data-slot=\"slider\"\n value={props.value}\n defaultValue={props.defaultValue ?? (props.value ? undefined : [0])}\n min={props.minValue}\n max={props.maxValue}\n onValueChange={(value) => props.onChange?.(toArray(value))}\n onValueCommit={(value) => props.onChangeEnd?.(toArray(value))}\n // A range names its group as well as each thumb; a single thumb is the\n // control, and carries the name itself.\n aria-label={props.thumbLabels ? props['aria-label'] : undefined}\n aria-labelledby={props.thumbLabels ? props['aria-labelledby'] : undefined}\n class={cn(\n 'relative flex touch-none flex-col justify-center select-none',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=horizontal]:w-full',\n 'data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {/* Where presses land: the whole box around the thin track. */}\n <SdkSliderControl class=\"flex grow flex-col justify-center self-stretch\">\n <SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>\n </SdkSliderControl>\n {props.children}\n </SdkSlider>","onValueChange={(value) => props.onChange?.(toArray(value))}","onValueCommit={(value) => props.onChangeEnd?.(toArray(value))}","props.thumbLabels ? props['aria-label'] : undefined","props.thumbLabels ? props['aria-labelledby'] : undefined","<SdkSliderControl class=\"flex grow flex-col justify-center self-stretch\">\n <SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>\n </SdkSliderControl>","class=\"flex grow flex-col justify-center self-stretch\"","<SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>","<SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />","<For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>","<SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>","props.thumbLabels?.[index] ? undefined : props['aria-labelledby']","<Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>","props.children","Slider"],"sources":["../../../../src/components/ui/slider/slider.tsx"],"sourcesContent":["import {\n Slider as SdkSlider,\n SliderControl as SdkSliderControl,\n SliderIndicator as SdkSliderIndicator,\n SliderThumb as SdkSliderThumb,\n SliderTrack as SdkSliderTrack,\n} from '@ui-sdk/solid/slider'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Slider.\n *\n * For a value on a continuum where position matters more than precision, a\n * zoom, a volume, a threshold. When the number matters, pass `valueLabel` so\n * the value is both adjustable *and* readable; a bare slider is a control\n * nobody can set exactly.\n *\n * ui-sdk's Slider handles pointer capture, keyboard stepping and the ARIA\n * value wiring: each thumb holds a visually hidden native range input, which\n * is what takes focus, so the ring is drawn from `:has(:focus-visible)`. This\n * paints the track, fill and one thumb per value. The thumbs sit on the track,\n * which ui-sdk places them in, so the track does not clip its children; the\n * fill never leaves it, so nothing is drawn differently.\n *\n * A range submits one form value, `start/end`, under its `name`.\n */\ntype SdkSliderProps = ComponentProps<typeof SdkSlider>\n\n// `onChange` is omitted too: the DOM `onChange` the root's props carry would\n// otherwise intersect with the value callback below, and a plain\n// `(value: number[]) => void` handler would not type-check.\nexport type SliderProps = Omit<\n SdkSliderProps,\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'onValueCommit'\n | 'onChange'\n | 'min'\n | 'max'\n | 'children'\n> & {\n /** One number per thumb, like `[20, 80]` for a range. Pass it to control the slider. */\n value?: number[]\n /** The values at first, when uncontrolled. A form reset returns to them. */\n defaultValue?: number[]\n /** Called on every step of a drag or a key, with one number per thumb. */\n onChange?: (value: number[]) => void\n /** Called once the interaction that changed the value ends: for saving. */\n onChangeEnd?: (value: number[]) => void\n /** The lowest value; 0 by default. */\n minValue?: number\n /** The highest value; 100 by default. */\n maxValue?: number\n /** Accessible names for individual thumbs, in value order (for example minimum and maximum). */\n thumbLabels?: readonly string[]\n trackClass?: string\n rangeClass?: string\n thumbClass?: string\n /** Show the current value beside the thumb while dragging. */\n valueLabel?: boolean\n children?: JSX.Element\n}\n\nconst toArray = (value: number | number[]) => (Array.isArray(value) ? value : [value])\n\nexport function Slider(props: SliderProps) {\n const rest = omit(\n props,\n 'class',\n 'trackClass',\n 'rangeClass',\n 'thumbClass',\n 'thumbLabels',\n 'valueLabel',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'value',\n 'defaultValue',\n 'onChange',\n 'onChangeEnd',\n 'minValue',\n 'maxValue'\n )\n const thumbs = () =>\n Array.from({ length: (props.value ?? props.defaultValue ?? [0]).length }, (_, index) => index)\n\n return (\n <SdkSlider\n data-slot=\"slider\"\n value={props.value}\n defaultValue={props.defaultValue ?? (props.value ? undefined : [0])}\n min={props.minValue}\n max={props.maxValue}\n onValueChange={(value) => props.onChange?.(toArray(value))}\n onValueCommit={(value) => props.onChangeEnd?.(toArray(value))}\n // A range names its group as well as each thumb; a single thumb is the\n // control, and carries the name itself.\n aria-label={props.thumbLabels ? props['aria-label'] : undefined}\n aria-labelledby={props.thumbLabels ? props['aria-labelledby'] : undefined}\n class={cn(\n 'relative flex touch-none flex-col justify-center select-none',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=horizontal]:w-full',\n 'data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {/* Where presses land: the whole box around the thin track. */}\n <SdkSliderControl class=\"flex grow flex-col justify-center self-stretch\">\n <SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\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A;GAAkBC,OAAM;GAAxB,IAAA,WAAA;IACEC,OAAAA,gBAAAA,aAAAA;KACE,IAAA,UAAA;MAAO,OAAA,GACL,uCACA,4EACA,wEACA,MAAM,UACR;KAAC;KANH,IAAA,WAAA;MAOC,OAAA,CACCC,gBAAAA,iBAAAA,EACE,IAAA,UAAA;OAAO,OAAA,GACL,oCACA,2EACA,MAAM,UACR;MAAC,EACF,CAAA,GACDC,gBAAAA,KAAAA;OAAK,IAAA,OAAA;QAAM,OAAA,OAAO;OAAC;OAAnBA,WACI,UACAC,gBAAAA,aAAAA;QACS;QACP,IAAA,eAAA;SAAY,OAAA,MAAM,cAAc,UAAU,MAAM;QAAa;QAC7D,IAAA,oBAAA;SAAiBC,OAAAA,WAAAA;UAAM,OAAA,CAAA,CAAA,MAAA,cAAc;SAA4C,CAAA,CAAC,CAAD,IAAnC,KAAA,IAAY,MAAM;QAAkB;QAClF,IAAA,UAAA;SAAO,OAAA,GACL,sFACA,uDACA,0CACA,wEACA,MAAM,UACR;QAAC;QAVHD,WAYI,UACAE,WAAAA;;UAAY,OAAA,CAAA,CAAA,MAAM;SAIZ,CAAA,CAAC,CAAD,WAHJ;UAEM,IAAA,OAAA,OAAA;UAFN,OAAA,YACE;WAAC,OAAA,MAAM;UAAU,CACb;UAFN,OAAA;SAEM,EAAA,CAAA,IAHR,KAAA;QAIM,CAAA;OAEM,CAAA;MAEf,CAAA,CA9BN;KA+Be;;GACA;EACjBC,CAAAA,GAAAA,WAAAA;GAAM,OAAA,MAAA;EAAO,CAAA,CA3Cf;CA4CU,EAAA,CAAA,CAAA;AAEf"}
|
|
1
|
+
{"version":3,"file":"slider.js","names":["<SdkSlider\n data-slot=\"slider\"\n value={props.value}\n defaultValue={props.defaultValue ?? (props.value ? undefined : [0])}\n min={props.minValue}\n max={props.maxValue}\n onValueChange={(value) => props.onChange?.(toArray(value))}\n onValueCommit={(value) => props.onChangeEnd?.(toArray(value))}\n // A range names its group as well as each thumb; a single thumb is the\n // control, and carries the name itself.\n aria-label={props.thumbLabels ? props['aria-label'] : undefined}\n aria-labelledby={props.thumbLabels ? props['aria-labelledby'] : undefined}\n class={cn(\n 'relative flex touch-none flex-col justify-center select-none',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=horizontal]:w-full',\n 'data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {/* Where presses land: the whole box around the thin track. */}\n <SdkSliderControl class=\"flex grow flex-col justify-center self-stretch\">\n <SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>\n </SdkSliderControl>\n {props.children}\n </SdkSlider>","onValueChange={(value) => props.onChange?.(toArray(value))}","onValueCommit={(value) => props.onChangeEnd?.(toArray(value))}","props.thumbLabels ? props['aria-label'] : undefined","props.thumbLabels ? props['aria-labelledby'] : undefined","<SdkSliderControl class=\"flex grow flex-col justify-center self-stretch\">\n <SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>\n </SdkSliderControl>","class=\"flex grow flex-col justify-center self-stretch\"","<SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>","<SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />","<For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>","<SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>","props.thumbLabels?.[index] ? undefined : props['aria-labelledby']","<Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>","props.children","_$insert"],"sources":["../../../../src/components/ui/slider/slider.tsx"],"sourcesContent":["import {\n Slider as SdkSlider,\n SliderControl as SdkSliderControl,\n SliderIndicator as SdkSliderIndicator,\n SliderThumb as SdkSliderThumb,\n SliderTrack as SdkSliderTrack,\n} from '@ui-sdk/solid/slider'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Slider.\n *\n * For a value on a continuum where position matters more than precision, a\n * zoom, a volume, a threshold. When the number matters, pass `valueLabel` so\n * the value is both adjustable *and* readable; a bare slider is a control\n * nobody can set exactly.\n *\n * ui-sdk's Slider handles pointer capture, keyboard stepping and the ARIA\n * value wiring: each thumb holds a visually hidden native range input, which\n * is what takes focus, so the ring is drawn from `:has(:focus-visible)`. This\n * paints the track, fill and one thumb per value. The thumbs sit on the track,\n * which ui-sdk places them in, so the track does not clip its children; the\n * fill never leaves it, so nothing is drawn differently.\n *\n * A range submits one form value, `start/end`, under its `name`.\n */\ntype SdkSliderProps = ComponentProps<typeof SdkSlider>\n\n// `onChange` is omitted too: the DOM `onChange` the root's props carry would\n// otherwise intersect with the value callback below, and a plain\n// `(value: number[]) => void` handler would not type-check.\nexport type SliderProps = Omit<\n SdkSliderProps,\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'onValueCommit'\n | 'onChange'\n | 'min'\n | 'max'\n | 'children'\n> & {\n /** One number per thumb, like `[20, 80]` for a range. Pass it to control the slider. */\n value?: number[]\n /** The values at first, when uncontrolled. A form reset returns to them. */\n defaultValue?: number[]\n /** Called on every step of a drag or a key, with one number per thumb. */\n onChange?: (value: number[]) => void\n /** Called once the interaction that changed the value ends: for saving. */\n onChangeEnd?: (value: number[]) => void\n /** The lowest value; 0 by default. */\n minValue?: number\n /** The highest value; 100 by default. */\n maxValue?: number\n /** Accessible names for individual thumbs, in value order (for example minimum and maximum). */\n thumbLabels?: readonly string[]\n trackClass?: string\n rangeClass?: string\n thumbClass?: string\n /** Show the current value beside the thumb while dragging. */\n valueLabel?: boolean\n children?: JSX.Element\n}\n\nconst toArray = (value: number | number[]) => (Array.isArray(value) ? value : [value])\n\nexport function Slider(props: SliderProps) {\n const rest = omit(\n props,\n 'class',\n 'trackClass',\n 'rangeClass',\n 'thumbClass',\n 'thumbLabels',\n 'valueLabel',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'value',\n 'defaultValue',\n 'onChange',\n 'onChangeEnd',\n 'minValue',\n 'maxValue'\n )\n const thumbs = () =>\n Array.from({ length: (props.value ?? props.defaultValue ?? [0]).length }, (_, index) => index)\n\n return (\n <SdkSlider\n data-slot=\"slider\"\n value={props.value}\n defaultValue={props.defaultValue ?? (props.value ? undefined : [0])}\n min={props.minValue}\n max={props.maxValue}\n onValueChange={(value) => props.onChange?.(toArray(value))}\n onValueCommit={(value) => props.onChangeEnd?.(toArray(value))}\n // A range names its group as well as each thumb; a single thumb is the\n // control, and carries the name itself.\n aria-label={props.thumbLabels ? props['aria-label'] : undefined}\n aria-labelledby={props.thumbLabels ? props['aria-labelledby'] : undefined}\n class={cn(\n 'relative flex touch-none flex-col justify-center select-none',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=horizontal]:w-full',\n 'data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {/* Where presses land: the whole box around the thin track. */}\n <SdkSliderControl class=\"flex grow flex-col justify-center self-stretch\">\n <SdkSliderTrack\n class={cn(\n 'bg-input relative grow rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n props.trackClass\n )}\n >\n <SdkSliderIndicator\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n props.rangeClass\n )}\n />\n <For each={thumbs()}>\n {(index) => (\n <SdkSliderThumb\n index={index}\n aria-label={props.thumbLabels?.[index] ?? props['aria-label']}\n aria-labelledby={props.thumbLabels?.[index] ? undefined : props['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'has-[:focus-visible]:ring-4 has-[:focus-visible]:ring-primary-subtle',\n props.thumbClass\n )}\n >\n {(state) => (\n <Show when={props.valueLabel}>\n <span class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\">\n {state.thumbValue}\n </span>\n </Show>\n )}\n </SdkSliderThumb>\n )}\n </For>\n </SdkSliderTrack>\n </SdkSliderControl>\n {props.children}\n </SdkSlider>\n )\n}\n"],"mappings":";;;;;;AAkEA,IAAM,WAAW,UAA8B,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;AAEpF,SAAgB,OAAO,OAAoB;CACzC,MAAM,OAAO,KACX,OACA,SACA,cACA,cACA,cACA,eACA,cACA,YACA,cACA,mBACA,SACA,gBACA,YACA,eACA,YACA,UACF;CACA,MAAM,eACJ,MAAM,KAAK,EAAE,SAAS,MAAM,SAAS,MAAM,gBAAgB,CAAC,CAAC,EAAA,CAAG,OAAO,IAAI,GAAG,UAAU,KAAK;CAE/F,OACEA,gBAAAA,UAAAA,WAAAA;EACE,aAAU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4C,CAAA,CAAC,CAAD,IAAnC,KAAA,IAAY,MAAM;QAAkB;QAClF,IAAA,UAAA;SAAO,OAAA,GACL,sFACA,uDACA,0CACA,wEACA,MAAM,UACR;QAAC;QAVHD,WAYI,UACAE,WAAAA;;UAAY,OAAA,CAAA,CAAA,MAAM;SAIZ,CAAA,CAAC,CAAD,WAHJ;UAEM,IAAA,OAAA,OAAA;UAFNE,OAAA,YACE;WAAC,OAAA,MAAM;UAAU,CACb;UAFN,OAAA;SAEM,EAAA,CAAA,IAHR,KAAA;QAIM,CAAA;OAEM,CAAA;MAEf,CAAA,CA9BN;KA+Be;;GACA;EACjBD,CAAAA,GAAAA,WAAAA;GAAM,OAAA,MAAA;EAAO,CAAA,CA3Cf;CA4CU,EAAA,CAAA,CAAA;AAEf"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
2
|
+
import { LoaderCircle as LoaderCircle$1 } from "@lucide/solid";
|
|
3
|
+
import { omit } from "solid-js";
|
|
1
4
|
import { cva } from "../../../lib/variants.js";
|
|
2
5
|
import { cn } from "../../../lib/utils.js";
|
|
3
6
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
|
-
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
5
|
-
import { LoaderCircle } from "@lucide/solid";
|
|
6
|
-
import { omit } from "solid-js";
|
|
7
7
|
// src/components/ui/spinner/spinner.tsx
|
|
8
8
|
var _tmpl$ = /* @__PURE__ */ template(`<span class=visually-hidden>`);
|
|
9
|
-
var LoaderCircle
|
|
9
|
+
var LoaderCircle = fastIcon(LoaderCircle$1);
|
|
10
10
|
/**
|
|
11
11
|
* Spinner.
|
|
12
12
|
*
|
|
@@ -32,7 +32,7 @@ var spinnerVariants = cva("animate-spin shrink-0", {
|
|
|
32
32
|
function Spinner(props) {
|
|
33
33
|
const local = props;
|
|
34
34
|
const rest = omit(props, "class", "size", "label");
|
|
35
|
-
return [createComponent(LoaderCircle
|
|
35
|
+
return [createComponent(LoaderCircle, mergeProps({
|
|
36
36
|
"data-slot": "spinner",
|
|
37
37
|
role: "status",
|
|
38
38
|
get "aria-label"() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","names":["<LoaderCircle\n data-slot=\"spinner\"\n role=\"status\"\n aria-label={local.label === false ? undefined : (local.label ?? 'Loading')}\n aria-hidden={local.label === false ? 'true' : undefined}\n class={cn(spinnerVariants({ size: local.size }), local.class)}\n // Solid's SVG attributes allow `false` (remove) for width and height,\n // which lucide's props do not name; the icon spreads them onto the\n // <svg> as is, so the wider type is safe here.\n {...(rest as LucideProps)}\n />","role=\"status\"","local.label === false ? undefined : (local.label ?? 'Loading')","{local.label === false ? null : (\n <span class=\"visually-hidden\">{local.label ?? 'Loading'}</span>\n )}","
|
|
1
|
+
{"version":3,"file":"spinner.js","names":["<LoaderCircle\n data-slot=\"spinner\"\n role=\"status\"\n aria-label={local.label === false ? undefined : (local.label ?? 'Loading')}\n aria-hidden={local.label === false ? 'true' : undefined}\n class={cn(spinnerVariants({ size: local.size }), local.class)}\n // Solid's SVG attributes allow `false` (remove) for width and height,\n // which lucide's props do not name; the icon spreads them onto the\n // <svg> as is, so the wider type is safe here.\n {...(rest as LucideProps)}\n />","role=\"status\"","local.label === false ? undefined : (local.label ?? 'Loading')","{local.label === false ? null : (\n <span class=\"visually-hidden\">{local.label ?? 'Loading'}</span>\n )}","LucideLoaderCircle","_$insert"],"sources":["../../../../src/components/ui/spinner/spinner.tsx"],"sourcesContent":["import { LoaderCircle as LucideLoaderCircle, type LucideProps } from '@lucide/solid'\nimport type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Spinner.\n *\n * A determinate-length activity indicator with no progress to report. When\n * there *is* progress, use Progress instead, a spinner next to a known\n * percentage is a lie about what the app knows.\n *\n * The glyph spins continuously, so it is the one thing in the system that\n * keeps moving under `prefers-reduced-motion`; base.css only shortens\n * `animation-duration` for the *entrance* animations and leaves this loop\n * alone. A frozen spinner reads as a hang, which is worse than motion.\n */\nconst spinnerVariants = cva('animate-spin shrink-0', {\n variants: {\n size: {\n xs: 'size-3',\n sm: 'size-3.5',\n md: 'size-4',\n lg: 'size-5',\n xl: 'size-6',\n },\n },\n defaultVariants: { size: 'md' },\n})\n\ntype SpinnerVariants = VariantProps<typeof spinnerVariants>\n\nexport type SpinnerProps = Omit<ComponentProps<'svg'>, 'size'> &\n SpinnerVariants & {\n /** An accessible name. Defaults to \"Loading\"; pass `false` to hide it. */\n label?: string | false\n }\n\nexport function Spinner(props: SpinnerProps) {\n const local = props\n const rest = omit(props, 'class', 'size', 'label')\n\n return (\n <>\n <LoaderCircle\n data-slot=\"spinner\"\n role=\"status\"\n aria-label={local.label === false ? undefined : (local.label ?? 'Loading')}\n aria-hidden={local.label === false ? 'true' : undefined}\n class={cn(spinnerVariants({ size: local.size }), local.class)}\n // Solid's SVG attributes allow `false` (remove) for width and height,\n // which lucide's props do not name; the icon spreads them onto the\n // <svg> as is, so the wider type is safe here.\n {...(rest as LucideProps)}\n />\n {local.label === false ? null : (\n <span class=\"visually-hidden\">{local.label ?? 'Loading'}</span>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,eAAe,SAASI,cAAkB;;;;;;;;;;;;;AAchD,IAAM,kBAAkB,IAAI,yBAAyB;CACnD,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CAAC;AAUD,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,OAAO;CAEjD,OACI,CACAJ,gBAAAA,cAAAA,WAAAA;EACE,aAAU;EACVC,MAAK;EACL,IAAA,eAAA;GAAYC,OAAAA,WAAAA;IAAM,OAAA,MAAA,UAAU;GAA6C,CAAA,CAAC,CAAD,IAArC,KAAA,IAAa,MAAM,SAAS;EAAU;EAC1E,IAAA,gBAAA;GAAa,OAAA,MAAM,UAAU,QAAQ,SAAS,KAAA;EAAS;EACvD,IAAA,UAAA;GAAO,OAAA,GAAG,gBAAgB,EAAE,MAAM,MAAM,KAAK,CAAC,GAAG,MAAM,KAAK;EAAC;CAK9D,GADM,IACN,CAAA,GACDC,WAAAA;;GAAC,OAAA,MAAM,UAAU;EAEhB,CAAA,CAAC,CAAD,IAFwB,cACvB;GAA8D,IAAA,OAAA,OAAA;GAA9DE,OAAA,YAA8B;IAAC,OAAA,MAAM,SAAS;GAAS,CAAO;GAA9D,OAAA;EAA8D,EAAA,CAAA;CAC/D,CAAA,CAbF;AAgBL"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { addEvent, className, createComponent, effect, insert, memo, readShallow, ref, setAttribute, spread, template } from "@solidjs/web";
|
|
2
|
+
import { Show, omit } from "solid-js";
|
|
1
3
|
import { cva } from "../../../lib/variants.js";
|
|
2
4
|
import { cn } from "../../../lib/utils.js";
|
|
3
5
|
import { LazyTooltip } from "../tooltip/lazy-tooltip.js";
|
|
4
|
-
import { addEvent, className, createComponent, effect, insert, memo, readShallow, ref, setAttribute, spread, template } from "@solidjs/web";
|
|
5
|
-
import { Show, omit } from "solid-js";
|
|
6
6
|
// src/components/ui/status-chip/status-chip.tsx
|
|
7
7
|
var _tmpl$ = /* @__PURE__ */ template(`<span><span aria-hidden=true></span><span>`);
|
|
8
8
|
var _tmpl$2 = /* @__PURE__ */ template(`<span class=inline-flex>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-chip.js","names":["class={cn(local.compact && 'sr-only')}","<span\n data-slot=\"status-chip\"\n class={cn(\n 'inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap',\n labelTone[local.tone ?? 'neutral'],\n local.class\n )}\n {...rest}\n >\n <span class={statusDotVariants({ tone: local.tone })} aria-hidden=\"true\" />\n <span class={cn(local.compact && 'sr-only')}>{local.label}</span>\n {local.trailing}\n </span>","<Show when={local.detail} fallback={chip}>\n {(detail) => (\n <LazyTooltip content={detail()} contentProps={{ 'data-slot': 'tooltip-content' }}>\n {(tip) => (\n <span\n ref={tip.ref}\n class=\"inline-flex\"\n aria-describedby={tip.describedBy()}\n onPointerEnter={tip.onPointerEnter}\n onFocus={tip.onFocus}\n >\n {chip}\n </span>\n )}\n </LazyTooltip>\n )}\n </Show>","fallback={chip}","<LazyTooltip content={detail()} contentProps={{ 'data-slot': 'tooltip-content' }}>\n {(tip) => (\n <span\n ref={tip.ref}\n class=\"inline-flex\"\n aria-describedby={tip.describedBy()}\n onPointerEnter={tip.onPointerEnter}\n onFocus={tip.onFocus}\n >\n {chip}\n </span>\n )}\n </LazyTooltip>","contentProps={{ 'data-slot': 'tooltip-content' }}","ref={tip.ref}","<div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>","<StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />","<dl class={cn('grid gap-2 text-sm', props.class)}>\n {props.entries.map((entry) => (\n <div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>\n ))}\n </dl>","_$readShallow"],"sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"sourcesContent":["import { Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cva } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { LazyTooltip } from '../tooltip'\n\n/**\n * StatusChip.\n *\n * A state, said in one word, with the reason available on hover. It exists\n * because a status readout has three parts that are always the same three parts,\n * a tone, a label, and the detail that justifies the label, and rendering them\n * ad hoc produces the two failures this component is here to prevent: a colour\n * with no text (unreadable to anyone who cannot see it) and a bare word with no\n * explanation (\"Needs configuration\", of what?).\n *\n * The tones are deliberately not a rainbow. Seven cover what a status can actually\n * mean:\n *\n * - `neutral`: fine, and there is nothing to say about it.\n * - `success`: a check passed, a capability is ready, a job finished.\n * - `warning`: degraded, or needs a decision from the user.\n * - `danger`: blocked, failed, unrecoverable without intervention.\n * - `info`: in flight or scheduled; work is happening, nothing is wrong.\n * - `pending`: running now with no result yet (a check, a build). The ring\n * turns, so it reads as live rather than as a settled state.\n * - `unknown`: the honest absence of information.\n *\n * `unknown` is not the same as `neutral`, and collapsing them is the mistake\n * worth avoiding: \"this is idle\" and \"we have not been told yet\" are different\n * facts, and a product that shows the second as the first is lying quietly. The\n * ring is hollow so it also reads as different in greyscale.\n *\n * The dot is `aria-hidden` and the label carries the meaning, so a tone is never\n * the only signal.\n */\nexport const statusDotVariants = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n info: 'bg-info',\n pending: 'border-2 border-info border-r-transparent motion-safe:animate-spin',\n unknown: 'border border-muted-foreground bg-transparent',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\nconst labelTone: Record<StatusTone, string> = {\n neutral: 'text-foreground',\n success: 'text-foreground',\n warning: 'text-foreground',\n danger: 'text-foreground',\n info: 'text-foreground',\n pending: 'text-foreground',\n unknown: 'text-muted-foreground',\n}\n\nexport type StatusTone =\n | 'neutral'\n | 'success'\n | 'warning'\n | 'danger'\n | 'info'\n | 'pending'\n | 'unknown'\n\nexport type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {\n tone?: StatusTone\n label: string\n /** Visually hide the text while preserving it for assistive technology. */\n compact?: boolean\n /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */\n detail?: string\n /** A trailing slot: a timestamp, a retry affordance, a count. */\n trailing?: JSX.Element\n}\n\nexport function StatusChip(props: StatusChipProps) {\n const local = props\n const rest = omit(props, 'tone', 'label', 'compact', 'detail', 'trailing', 'class')\n\n const chip = (\n <span\n data-slot=\"status-chip\"\n class={cn(\n 'inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap',\n labelTone[local.tone ?? 'neutral'],\n local.class\n )}\n {...rest}\n >\n <span class={statusDotVariants({ tone: local.tone })} aria-hidden=\"true\" />\n <span class={cn(local.compact && 'sr-only')}>{local.label}</span>\n {local.trailing}\n </span>\n )\n\n return (\n <Show when={local.detail} fallback={chip}>\n {(detail) => (\n <LazyTooltip content={detail()} contentProps={{ 'data-slot': 'tooltip-content' }}>\n {(tip) => (\n <span\n ref={tip.ref}\n class=\"inline-flex\"\n aria-describedby={tip.describedBy()}\n onPointerEnter={tip.onPointerEnter}\n onFocus={tip.onFocus}\n >\n {chip}\n </span>\n )}\n </LazyTooltip>\n )}\n </Show>\n )\n}\n\nexport type StatusEntry = Readonly<{\n /** A stable key for the row. */\n id: string\n /** What is being reported, \"Configuration\", \"Runtime\", \"Sync\". */\n name: string\n tone: StatusTone\n label: string\n detail?: string\n}>\n\n/**\n * StatusList.\n *\n * The several-facts-about-one-thing shape: an agent with a configuration state, a\n * runtime state and an activity state; a service with a build, a deploy and a\n * health check. It is a definition list rather than a table because there is no\n * column to sort or compare, the rows are facets of a single subject, and a\n * screen reader should hear them as such.\n *\n * Fixed width on the name column is what makes a column of these scannable; the\n * rows line up without a table's semantics.\n */\nexport function StatusList(props: {\n entries: readonly StatusEntry[]\n class?: string\n /** Hide the name column and show only the chips, for a compact badge strip. */\n compact?: boolean\n}) {\n return (\n <dl class={cn('grid gap-2 text-sm', props.class)}>\n {props.entries.map((entry) => (\n <div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>\n ))}\n </dl>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,oBAAoB,IAAI,gCAAgC;CACnE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;AAED,IAAM,YAAwC;CAC5C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;AACX;AAsBA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,QAAQ,SAAS,WAAW,UAAU,YAAY,OAAO;CAGhF,IAAA,OAAA,OAYM;CAHJ,IAAA,QAAA,KAAA;CACA,IAAA,QAAA,MAAA;CAHA,OAAA,MAAA,CAAA;EANA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,gFACA,UAAU,MAAM,QAAQ,YACxB,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAGJ,OAAA,aAA6C;EAAC,OAAA,MAAM;CAAK,CAAO;CAVlE,OAAA,YAWE;EAAC,OAAA,MAAM;CAAQ,GAXjB,IAYM;CAHE,aAAA;;GAAO,GAAAU,YAAA,kBAAkB,EAAE,MAAM,MAAM,KAAK,CAAC,CAAC;GAC9CV,GAAAA,YAAO,GAAG,MAAM,WAAW,SAAS,CAAC;EADS;CAA9C,IAAA,EAAA,GAAA,KAAA,QAAA;EAA8C,UAAA,OAAA,GAAA,KAAA,CAAA;EAC9C,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G,CAAA,CACvE;GAFA,aAAAE,YAAO,GAAG,CAAC,MAAM,WAAW,UAAU,CAAC,IAAvC,KAAA,QAAA;IAAuC,UAAA,OAAA,KAAA,GAAA;;GAJ7C,OAAA;EAOK,EAAA,CAAA,CACN;CAAC,CACA;CAXA,aAAAA,YAAO,GAAG,sBAAsB,MAAM,KAAK,CAAC,IAA5C,KAAA,QAAA;EAA4C,UAAA,OAAA,KAAA,GAAA;;CADlD,OACED;AAaJ"}
|
|
1
|
+
{"version":3,"file":"status-chip.js","names":["class={cn(local.compact && 'sr-only')}","<span\n data-slot=\"status-chip\"\n class={cn(\n 'inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap',\n labelTone[local.tone ?? 'neutral'],\n local.class\n )}\n {...rest}\n >\n <span class={statusDotVariants({ tone: local.tone })} aria-hidden=\"true\" />\n <span class={cn(local.compact && 'sr-only')}>{local.label}</span>\n {local.trailing}\n </span>","<Show when={local.detail} fallback={chip}>\n {(detail) => (\n <LazyTooltip content={detail()} contentProps={{ 'data-slot': 'tooltip-content' }}>\n {(tip) => (\n <span\n ref={tip.ref}\n class=\"inline-flex\"\n aria-describedby={tip.describedBy()}\n onPointerEnter={tip.onPointerEnter}\n onFocus={tip.onFocus}\n >\n {chip}\n </span>\n )}\n </LazyTooltip>\n )}\n </Show>","fallback={chip}","<LazyTooltip content={detail()} contentProps={{ 'data-slot': 'tooltip-content' }}>\n {(tip) => (\n <span\n ref={tip.ref}\n class=\"inline-flex\"\n aria-describedby={tip.describedBy()}\n onPointerEnter={tip.onPointerEnter}\n onFocus={tip.onFocus}\n >\n {chip}\n </span>\n )}\n </LazyTooltip>","contentProps={{ 'data-slot': 'tooltip-content' }}","ref={tip.ref}","<div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>","<StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />","<dl class={cn('grid gap-2 text-sm', props.class)}>\n {props.entries.map((entry) => (\n <div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>\n ))}\n </dl>","_$spread","_$insert","_$effect","_$readShallow","_$className","_$addEvent","_$setAttribute"],"sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"sourcesContent":["import { Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cva } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { LazyTooltip } from '../tooltip'\n\n/**\n * StatusChip.\n *\n * A state, said in one word, with the reason available on hover. It exists\n * because a status readout has three parts that are always the same three parts,\n * a tone, a label, and the detail that justifies the label, and rendering them\n * ad hoc produces the two failures this component is here to prevent: a colour\n * with no text (unreadable to anyone who cannot see it) and a bare word with no\n * explanation (\"Needs configuration\", of what?).\n *\n * The tones are deliberately not a rainbow. Seven cover what a status can actually\n * mean:\n *\n * - `neutral`: fine, and there is nothing to say about it.\n * - `success`: a check passed, a capability is ready, a job finished.\n * - `warning`: degraded, or needs a decision from the user.\n * - `danger`: blocked, failed, unrecoverable without intervention.\n * - `info`: in flight or scheduled; work is happening, nothing is wrong.\n * - `pending`: running now with no result yet (a check, a build). The ring\n * turns, so it reads as live rather than as a settled state.\n * - `unknown`: the honest absence of information.\n *\n * `unknown` is not the same as `neutral`, and collapsing them is the mistake\n * worth avoiding: \"this is idle\" and \"we have not been told yet\" are different\n * facts, and a product that shows the second as the first is lying quietly. The\n * ring is hollow so it also reads as different in greyscale.\n *\n * The dot is `aria-hidden` and the label carries the meaning, so a tone is never\n * the only signal.\n */\nexport const statusDotVariants = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n info: 'bg-info',\n pending: 'border-2 border-info border-r-transparent motion-safe:animate-spin',\n unknown: 'border border-muted-foreground bg-transparent',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\nconst labelTone: Record<StatusTone, string> = {\n neutral: 'text-foreground',\n success: 'text-foreground',\n warning: 'text-foreground',\n danger: 'text-foreground',\n info: 'text-foreground',\n pending: 'text-foreground',\n unknown: 'text-muted-foreground',\n}\n\nexport type StatusTone =\n | 'neutral'\n | 'success'\n | 'warning'\n | 'danger'\n | 'info'\n | 'pending'\n | 'unknown'\n\nexport type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {\n tone?: StatusTone\n label: string\n /** Visually hide the text while preserving it for assistive technology. */\n compact?: boolean\n /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */\n detail?: string\n /** A trailing slot: a timestamp, a retry affordance, a count. */\n trailing?: JSX.Element\n}\n\nexport function StatusChip(props: StatusChipProps) {\n const local = props\n const rest = omit(props, 'tone', 'label', 'compact', 'detail', 'trailing', 'class')\n\n const chip = (\n <span\n data-slot=\"status-chip\"\n class={cn(\n 'inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap',\n labelTone[local.tone ?? 'neutral'],\n local.class\n )}\n {...rest}\n >\n <span class={statusDotVariants({ tone: local.tone })} aria-hidden=\"true\" />\n <span class={cn(local.compact && 'sr-only')}>{local.label}</span>\n {local.trailing}\n </span>\n )\n\n return (\n <Show when={local.detail} fallback={chip}>\n {(detail) => (\n <LazyTooltip content={detail()} contentProps={{ 'data-slot': 'tooltip-content' }}>\n {(tip) => (\n <span\n ref={tip.ref}\n class=\"inline-flex\"\n aria-describedby={tip.describedBy()}\n onPointerEnter={tip.onPointerEnter}\n onFocus={tip.onFocus}\n >\n {chip}\n </span>\n )}\n </LazyTooltip>\n )}\n </Show>\n )\n}\n\nexport type StatusEntry = Readonly<{\n /** A stable key for the row. */\n id: string\n /** What is being reported, \"Configuration\", \"Runtime\", \"Sync\". */\n name: string\n tone: StatusTone\n label: string\n detail?: string\n}>\n\n/**\n * StatusList.\n *\n * The several-facts-about-one-thing shape: an agent with a configuration state, a\n * runtime state and an activity state; a service with a build, a deploy and a\n * health check. It is a definition list rather than a table because there is no\n * column to sort or compare, the rows are facets of a single subject, and a\n * screen reader should hear them as such.\n *\n * Fixed width on the name column is what makes a column of these scannable; the\n * rows line up without a table's semantics.\n */\nexport function StatusList(props: {\n entries: readonly StatusEntry[]\n class?: string\n /** Hide the name column and show only the chips, for a compact badge strip. */\n compact?: boolean\n}) {\n return (\n <dl class={cn('grid gap-2 text-sm', props.class)}>\n {props.entries.map((entry) => (\n <div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>\n ))}\n </dl>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,oBAAoB,IAAI,gCAAgC;CACnE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;AAED,IAAM,YAAwC;CAC5C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;AACX;AAsBA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,QAAQ,SAAS,WAAW,UAAU,YAAY,OAAO;CAGhF,IAAA,OAAA,OAYM;CAHJ,IAAA,QAAA,KAAA;CACA,IAAA,QAAA,MAAA;CAHAU,OAAA,MAAA,CAAA;EANA,aAAA;EACA,IAAA,UA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H,IAAA,QAAA,MAAA;GAJFA,OAAA,cACE;;KAAY,OAAA,CAAC,MAAM;IAEb,CAAA;IAFN,aAAA;KAEM,OAAA,IAAA,WADJ;MAAkD,IAAA,QAAA,QAAA;MAAlDA,OAAA,aAAkC;OAAC,OAAA,MAAM;MAAI,CAAK;MAAlD,OAAA;KAAkD,EAAA,CAAA,IADpD,KAAA;IAEM;GAAC,EAAA,CAAD,GAHRJ,KAOK;GAHHI,OAAA,OACEH,gBAAAA,YAAAA;IAAY,IAAA,OAAA;KAAM,OAAA,MAAM;IAAI;IAAE,IAAA,QAAA;KAAO,OAAA,MAAM;IAAK;IAAE,IAAA,SAAA;KAAQ,OAAA,MAAM;IAAM;GAAG,CAAA,CACvE;GAFAI,aAAAC,YAAO,GAAG,CAAC,MAAM,WAAW,UAAU,CAAC,IAAvC,KAAA,QAAA;IAAuCC,UAAA,OAAA,KAAA,GAAA;;GAJ7C,OAAA;EAOK,EAAA,CAAA,CACN;CAAC,CACA;CAXAF,aAAAC,YAAO,GAAG,sBAAsB,MAAM,KAAK,CAAC,IAA5C,KAAA,QAAA;EAA4CC,UAAA,OAAA,KAAA,GAAA;;CADlD,OACEL;AAaJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useFormFieldControl } from "../../../lib/form-field.js";
|
|
2
|
-
import { cn } from "../../../lib/utils.js";
|
|
3
1
|
import { className, createComponent, delegateEvents, effect, heldRead, insert, memo, readShallow, ref, setAttribute, setProperty, spread, template } from "@solidjs/web";
|
|
4
2
|
import { Show, children, createContext, createSignal, createUniqueId, merge, omit, onSettled, useContext } from "solid-js";
|
|
3
|
+
import { useFormFieldControl } from "../../../lib/form-field.js";
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
// src/components/ui/switch/switch.tsx
|
|
6
6
|
var _tmpl$ = /* @__PURE__ */ template(`<div><input type=checkbox role=switch class="peer sr-only"><div><div>`);
|
|
7
7
|
var _tmpl$2 = /* @__PURE__ */ template(`<div class="grid gap-0.5"><!><!>`);
|
|
@@ -19,7 +19,7 @@ var SwitchContext = createContext(null);
|
|
|
19
19
|
* `children` replace the label block and may use `SwitchLabel` and
|
|
20
20
|
* `SwitchDescription`, which find the switch through a context.
|
|
21
21
|
*/
|
|
22
|
-
function Switch
|
|
22
|
+
function Switch(props) {
|
|
23
23
|
const rest = omit(props, "class", "controlClass", "thumbClass", "labelClass", "descriptionClass", "label", "description", "children", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "aria-errormessage", "aria-busy", "id", "inputId", "title", "checked", "defaultChecked", "onChange", "name", "value", "required", "disabled", "readOnly", "validationState");
|
|
24
24
|
const field = useFormFieldControl("control", merge(props, { get id() {
|
|
25
25
|
return props.inputId ?? props.id;
|
|
@@ -319,6 +319,6 @@ function SwitchDescription(props) {
|
|
|
319
319
|
return _el$11;
|
|
320
320
|
}
|
|
321
321
|
delegateEvents(["click"]);
|
|
322
|
-
export { Switch
|
|
322
|
+
export { Switch, SwitchDescription, SwitchLabel };
|
|
323
323
|
|
|
324
324
|
//# sourceMappingURL=switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","names":["role=\"group\"","ref={(element) => {\n input = element\n }}","<SwitchContext value={context}>{props.children}</SwitchContext>","value={context}","<Show when={label() || description()}>\n <div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>\n </Show>","class={cn('text-sm leading-none font-medium', props.labelClass)}","data-checked={dataChecked()}","data-disabled={dataDisabled()}","<div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>","name={props.name ?? rootId()}","value={props.value ?? 'on'}","checked={checked()}","aria-checked={checked() ? 'true' : 'false'}","required={props.required}","disabled={props.disabled}","readonly={props.readOnly}","aria-label={props['aria-label']}","aria-labelledby={labelledBy()}","aria-describedby={describedBy()}","aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }","aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}","aria-busy={props['aria-busy']}","aria-required={props.required ? 'true' : undefined}","aria-disabled={props.disabled ? 'true' : undefined}","aria-readonly={props.readOnly ? 'true' : undefined}","title={props.title}","data-invalid={dataInvalid()}","class={switchControlClass(props.controlClass)}","class={switchThumbClass(props.thumbClass)}","id={inputId()}","<div\n data-slot=\"switch\"\n role=\"group\"\n id={rootId()}\n title={props.title}\n class={cn('group/switch relative flex items-center gap-2.5', props.class)}\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-valid={flag(props.validationState === 'valid')}\n data-required={flag(props.required)}\n data-disabled={dataDisabled()}\n data-readonly={flag(props.readOnly)}\n {...(rest as ComponentProps<'div'>)}\n >\n {/* The name belongs on the input; see Checkbox for why. */}\n <input\n ref={(element) => {\n input = element\n }}\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n id={inputId()}\n name={props.name ?? rootId()}\n value={props.value ?? 'on'}\n checked={checked()}\n aria-checked={checked() ? 'true' : 'false'}\n required={props.required}\n disabled={props.disabled}\n readonly={props.readOnly}\n aria-label={props['aria-label']}\n aria-labelledby={labelledBy()}\n aria-describedby={describedBy()}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-busy={props['aria-busy']}\n aria-required={props.required ? 'true' : undefined}\n aria-disabled={props.disabled ? 'true' : undefined}\n aria-readonly={props.readOnly ? 'true' : undefined}\n title={props.title}\n data-checked={dataChecked()}\n onChange={(event) => {\n event.stopPropagation()\n // Controlled: the switch shows the value the host keeps, not the click.\n event.currentTarget.checked = setChecked(event.currentTarget.checked)\n }}\n />\n <div\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-disabled={dataDisabled()}\n class={switchControlClass(props.controlClass)}\n onClick={() => {\n setChecked(!checked())\n input?.focus({ preventScroll: true })\n }}\n >\n <div data-checked={dataChecked()} class={switchThumbClass(props.thumbClass)} />\n </div>\n {composed ? (\n <SwitchContext value={context}>{props.children}</SwitchContext>\n ) : (\n <Show when={label() || description()}>\n <div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>\n </Show>\n )}\n </div>","<label\n id={control.labelId}\n for={control.inputId()}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-sm leading-none font-medium', props.class)}\n {...rest}\n />","<div\n id={control.descriptionId}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-muted-foreground text-sm', props.class)}\n {...rest}\n />","Switch","resolveChildren","_$readShallow","_$setAttribute","_$setProperty"],"sources":["../../../../src/components/ui/switch/switch.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from '@solidjs/web'\nimport {\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n merge,\n onSettled,\n Show,\n omit,\n useContext,\n} from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Switch.\n *\n * For a setting that takes effect the moment it is flipped. The distinction\n * from Checkbox is behaviour, not looks: a switch applies immediately and\n * belongs in a settings row, while a checkbox is a value the user is still\n * composing and is applied when a form is submitted. A switch inside an unsaved\n * form is the mistake this split exists to prevent.\n *\n * The value is a real hidden `role=\"switch\"` checkbox, so the control is\n * form-native, keyboard-operable, and its `aria-checked` follows the state the\n * user sees.\n */\nexport type SwitchProps = Omit<ComponentProps<'div'>, 'children' | 'onChange'> & {\n /** Whether it is on. Pass it to control the switch. */\n checked?: boolean\n /** Whether it starts on, when uncontrolled. A form reset returns to it. */\n defaultChecked?: boolean\n /** Called with the new state when the user flips it. */\n onChange?: (checked: boolean) => void\n /** The name the input submits under; without one, the root's id. */\n name?: string\n /** What the input submits while on; `on` by default. */\n value?: string\n required?: boolean\n disabled?: boolean\n readOnly?: boolean\n /** `'invalid'` marks the track and its input invalid. */\n validationState?: 'valid' | 'invalid'\n /** ID for the hidden native switch input; useful with an external label. */\n inputId?: string\n controlClass?: string\n thumbClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the label block. Omit it to get the default control beside\n * `label` and `description`; supply it to compose `SwitchLabel` and\n * `SwitchDescription` yourself.\n */\n children?: JSX.Element\n}\n\nconst switchControlClass = (className?: string) =>\n cn(\n 'bg-input inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent',\n 'transition-colors ease-out outline-none',\n 'peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary',\n 'data-[invalid]:border-destructive',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n className\n )\n\nconst switchThumbClass = (className?: string) =>\n cn(\n 'bg-background pointer-events-none block size-4 rounded-full shadow-xs',\n 'transition-transform ease-out',\n 'data-[checked]:translate-x-4',\n className\n )\n\nconst flag = (on: boolean | undefined) => (on ? '' : undefined)\n\n/** What `SwitchLabel` and `SwitchDescription` need from their switch. */\ntype SwitchParts = {\n inputId: () => string\n labelId: string\n descriptionId: string\n checked: () => string | undefined\n disabled: () => string | undefined\n /** Counts a mounted part, so the input only points at ids that exist. */\n mount: (part: 'label' | 'description') => () => void\n}\n\nconst SwitchContext = createContext<SwitchParts | null>(null)\n\n/**\n * Renders a native `role=\"switch\"` checkbox and its painted track directly,\n * for the same reason and with the same contract as `Checkbox`: ui-sdk's\n * Switch measured about 1 ms per instance in the unit DOM, against a few\n * hundredths of a millisecond here, and a settings page holds one per row.\n * `children` replace the label block and may use `SwitchLabel` and\n * `SwitchDescription`, which find the switch through a context.\n */\nexport function Switch(props: SwitchProps) {\n const rest = omit(\n props,\n 'class',\n 'controlClass',\n 'thumbClass',\n 'labelClass',\n 'descriptionClass',\n 'label',\n 'description',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n 'checked',\n 'defaultChecked',\n 'onChange',\n 'name',\n 'value',\n 'required',\n 'disabled',\n 'readOnly',\n 'validationState'\n )\n const field = useFormFieldControl(\n 'control',\n merge(props, {\n get id() {\n return props.inputId ?? props.id\n },\n })\n )\n const uid = createUniqueId()\n // The root names the input and, without a `name`, the form value.\n const rootId = () => (field ? undefined : props.id || undefined) ?? `switch-${uid}`\n const inputId = () => field?.id ?? props.inputId ?? `${rootId()}-input`\n const descriptionId = `switch-${uid}-description`\n const labelId = `switch-${uid}-label`\n // Derived from `defaultChecked`, so a new default restarts an uncontrolled switch.\n const [ownChecked, setOwnChecked] = createSignal(() => props.defaultChecked ?? false)\n const checked = () => props.checked ?? ownChecked()\n // Returns what the control shows now. A write is read back only after the\n // next flush, so an event handler that has to put the input right uses this\n // value rather than reading `checked()` straight after the write.\n const setChecked = (next: boolean) => {\n if (props.disabled || props.readOnly || next === checked()) return checked()\n if (props.checked === undefined) setOwnChecked(next)\n props.onChange?.(next)\n return props.checked === undefined ? next : props.checked === true\n }\n let input: HTMLInputElement | undefined\n // A native form reset puts the input back on its default without an input or\n // change event, so the state follows it.\n onSettled(() => {\n // The reset baseline (the `checked` attribute); `checked` below only sets the property.\n if (input) input.defaultChecked = props.defaultChecked ?? false\n const form = input?.form\n if (!form) return\n const reset = () => {\n setChecked(props.defaultChecked ?? false)\n // The browser resets the input after this event; then the input shows the state.\n setTimeout(() => {\n if (input) input.checked = checked()\n })\n }\n form.addEventListener('reset', reset)\n return () => form.removeEventListener('reset', reset)\n })\n\n // Composed parts announce themselves, so the input names and describes\n // itself only with elements that are in the page.\n const [parts, setParts] = createSignal({ label: 0, description: 0 })\n const mount = (part: 'label' | 'description') => {\n setParts((count) => ({ ...count, [part]: count[part] + 1 }))\n return () => setParts((count) => ({ ...count, [part]: count[part] - 1 }))\n }\n\n const composed = 'children' in props\n const label = resolveChildren(() => (composed ? undefined : props.label))\n const description = resolveChildren(() => (composed ? undefined : props.description))\n const hasLabel = () => Boolean(label()) || parts().label > 0\n const hasDescription = () => Boolean(description()) || parts().description > 0\n // Naming: the label element, then the input itself when it also has an\n // aria-label; the description before any caller's description.\n const labelledBy = () => {\n const external = field?.['aria-labelledby'] ?? props['aria-labelledby']\n const own = hasLabel() ? labelId : undefined\n const self = (external || own) && props['aria-label'] ? inputId() : undefined\n return [external, own, self].filter(Boolean).join(' ') || undefined\n }\n const describedBy = () =>\n [\n hasDescription() ? descriptionId : '',\n field?.['aria-describedby'] ?? props['aria-describedby'],\n ]\n .filter(Boolean)\n .join(' ') || undefined\n const dataChecked = () => flag(checked())\n const dataInvalid = () => flag(props.validationState === 'invalid')\n const dataDisabled = () => flag(props.disabled)\n const context: SwitchParts = {\n inputId,\n labelId,\n descriptionId,\n checked: dataChecked,\n disabled: dataDisabled,\n mount,\n }\n\n return (\n <div\n data-slot=\"switch\"\n role=\"group\"\n id={rootId()}\n title={props.title}\n class={cn('group/switch relative flex items-center gap-2.5', props.class)}\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-valid={flag(props.validationState === 'valid')}\n data-required={flag(props.required)}\n data-disabled={dataDisabled()}\n data-readonly={flag(props.readOnly)}\n {...(rest as ComponentProps<'div'>)}\n >\n {/* The name belongs on the input; see Checkbox for why. */}\n <input\n ref={(element) => {\n input = element\n }}\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n id={inputId()}\n name={props.name ?? rootId()}\n value={props.value ?? 'on'}\n checked={checked()}\n aria-checked={checked() ? 'true' : 'false'}\n required={props.required}\n disabled={props.disabled}\n readonly={props.readOnly}\n aria-label={props['aria-label']}\n aria-labelledby={labelledBy()}\n aria-describedby={describedBy()}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-busy={props['aria-busy']}\n aria-required={props.required ? 'true' : undefined}\n aria-disabled={props.disabled ? 'true' : undefined}\n aria-readonly={props.readOnly ? 'true' : undefined}\n title={props.title}\n data-checked={dataChecked()}\n onChange={(event) => {\n event.stopPropagation()\n // Controlled: the switch shows the value the host keeps, not the click.\n event.currentTarget.checked = setChecked(event.currentTarget.checked)\n }}\n />\n <div\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-disabled={dataDisabled()}\n class={switchControlClass(props.controlClass)}\n onClick={() => {\n setChecked(!checked())\n input?.focus({ preventScroll: true })\n }}\n >\n <div data-checked={dataChecked()} class={switchThumbClass(props.thumbClass)} />\n </div>\n {composed ? (\n <SwitchContext value={context}>{props.children}</SwitchContext>\n ) : (\n <Show when={label() || description()}>\n <div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>\n </Show>\n )}\n </div>\n )\n}\n\nfunction useSwitchPart(name: string, part: 'label' | 'description') {\n const control = useContext(SwitchContext)\n if (!control) throw new Error(`<${name}> must be used inside <Switch>.`)\n onSettled(() => control.mount(part))\n return control\n}\n\n/**\n * The switch's own label. Valid only inside a `<Switch>`: it labels that\n * root's input, and outside one there is nothing to associate with.\n * A label drawn *beside* a switch — a settings row with the control trailing —\n * is plain text, and the switch takes an `aria-label` instead.\n */\nexport function SwitchLabel(props: ComponentProps<'label'>) {\n const control = useSwitchPart('SwitchLabel', 'label')\n const rest = omit(props, 'class')\n return (\n <label\n id={control.labelId}\n for={control.inputId()}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-sm leading-none font-medium', props.class)}\n {...rest}\n />\n )\n}\n\nexport function SwitchDescription(props: ComponentProps<'div'>) {\n const control = useSwitchPart('SwitchDescription', 'description')\n const rest = omit(props, 'class')\n return (\n <div\n id={control.descriptionId}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-muted-foreground text-sm', props.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;AA4DA,IAAM,sBAAsB,cAC1B,GACE,6FACA,2CACA,mGACA,6BACA,qCACA,iEACA,SACF;AAEF,IAAM,oBAAoB,cACxB,GACE,yEACA,iCACA,gCACA,SACF;AAEF,IAAM,QAAQ,OAA6B,KAAK,KAAK,KAAA;AAarD,IAAM,gBAAgB,cAAkC,IAAI;;;;;;;;;AAU5D,SAAgBiC,SAAO,OAAoB;CACzC,MAAM,OAAO,KACX,OACA,SACA,gBACA,cACA,cACA,oBACA,SACA,eACA,YACA,cACA,mBACA,oBACA,gBACA,qBACA,aACA,MACA,WACA,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A,GAAG,oCAAoC,MAAM,KAAK;EAAC;CAClD,GAAJ,IAAA,GAAA,KAAA;CAPR,OACEC;AASJ;AAEA,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,UAAU,cAAc,qBAAqB,aAAa;CAChE,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,SAAA,QAMC;CADC,OAAA,QAAA,CAAA;EAJA,IAAA,KAAA;GAAI,OAAA,QAAQ;EAAa;EACzB,IAAA,iBAAA;GAAc,OAAA,QAAQ,QAAQ;EAAC;EAC/B,IAAA,kBAAA;GAAe,OAAA,QAAQ,SAAS;EAAC;EACjC,IAAA,UAAA;GAAO,OAAA,GAAG,iCAAiC,MAAM,KAAK;EAAC;CAC/C,GAAJ,IAAA,GAAA,KAAA;CANR,OACEC;AAQJ"}
|
|
1
|
+
{"version":3,"file":"switch.js","names":["role=\"group\"","ref={(element) => {\n input = element\n }}","<SwitchContext value={context}>{props.children}</SwitchContext>","value={context}","<Show when={label() || description()}>\n <div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>\n </Show>","class={cn('text-sm leading-none font-medium', props.labelClass)}","data-checked={dataChecked()}","data-disabled={dataDisabled()}","<div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>","name={props.name ?? rootId()}","value={props.value ?? 'on'}","checked={checked()}","aria-checked={checked() ? 'true' : 'false'}","required={props.required}","disabled={props.disabled}","readonly={props.readOnly}","aria-label={props['aria-label']}","aria-labelledby={labelledBy()}","aria-describedby={describedBy()}","aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }","aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}","aria-busy={props['aria-busy']}","aria-required={props.required ? 'true' : undefined}","aria-disabled={props.disabled ? 'true' : undefined}","aria-readonly={props.readOnly ? 'true' : undefined}","title={props.title}","data-invalid={dataInvalid()}","class={switchControlClass(props.controlClass)}","class={switchThumbClass(props.thumbClass)}","id={inputId()}","<div\n data-slot=\"switch\"\n role=\"group\"\n id={rootId()}\n title={props.title}\n class={cn('group/switch relative flex items-center gap-2.5', props.class)}\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-valid={flag(props.validationState === 'valid')}\n data-required={flag(props.required)}\n data-disabled={dataDisabled()}\n data-readonly={flag(props.readOnly)}\n {...(rest as ComponentProps<'div'>)}\n >\n {/* The name belongs on the input; see Checkbox for why. */}\n <input\n ref={(element) => {\n input = element\n }}\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n id={inputId()}\n name={props.name ?? rootId()}\n value={props.value ?? 'on'}\n checked={checked()}\n aria-checked={checked() ? 'true' : 'false'}\n required={props.required}\n disabled={props.disabled}\n readonly={props.readOnly}\n aria-label={props['aria-label']}\n aria-labelledby={labelledBy()}\n aria-describedby={describedBy()}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-busy={props['aria-busy']}\n aria-required={props.required ? 'true' : undefined}\n aria-disabled={props.disabled ? 'true' : undefined}\n aria-readonly={props.readOnly ? 'true' : undefined}\n title={props.title}\n data-checked={dataChecked()}\n onChange={(event) => {\n event.stopPropagation()\n // Controlled: the switch shows the value the host keeps, not the click.\n event.currentTarget.checked = setChecked(event.currentTarget.checked)\n }}\n />\n <div\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-disabled={dataDisabled()}\n class={switchControlClass(props.controlClass)}\n onClick={() => {\n setChecked(!checked())\n input?.focus({ preventScroll: true })\n }}\n >\n <div data-checked={dataChecked()} class={switchThumbClass(props.thumbClass)} />\n </div>\n {composed ? (\n <SwitchContext value={context}>{props.children}</SwitchContext>\n ) : (\n <Show when={label() || description()}>\n <div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>\n </Show>\n )}\n </div>","<label\n id={control.labelId}\n for={control.inputId()}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-sm leading-none font-medium', props.class)}\n {...rest}\n />","<div\n id={control.descriptionId}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-muted-foreground text-sm', props.class)}\n {...rest}\n />","resolveChildren","_$spread","_$ref","_$insert","_$setAttribute","_$effect","_$readShallow","_$className","_$setProperty"],"sources":["../../../../src/components/ui/switch/switch.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from '@solidjs/web'\nimport {\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n merge,\n onSettled,\n Show,\n omit,\n useContext,\n} from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Switch.\n *\n * For a setting that takes effect the moment it is flipped. The distinction\n * from Checkbox is behaviour, not looks: a switch applies immediately and\n * belongs in a settings row, while a checkbox is a value the user is still\n * composing and is applied when a form is submitted. A switch inside an unsaved\n * form is the mistake this split exists to prevent.\n *\n * The value is a real hidden `role=\"switch\"` checkbox, so the control is\n * form-native, keyboard-operable, and its `aria-checked` follows the state the\n * user sees.\n */\nexport type SwitchProps = Omit<ComponentProps<'div'>, 'children' | 'onChange'> & {\n /** Whether it is on. Pass it to control the switch. */\n checked?: boolean\n /** Whether it starts on, when uncontrolled. A form reset returns to it. */\n defaultChecked?: boolean\n /** Called with the new state when the user flips it. */\n onChange?: (checked: boolean) => void\n /** The name the input submits under; without one, the root's id. */\n name?: string\n /** What the input submits while on; `on` by default. */\n value?: string\n required?: boolean\n disabled?: boolean\n readOnly?: boolean\n /** `'invalid'` marks the track and its input invalid. */\n validationState?: 'valid' | 'invalid'\n /** ID for the hidden native switch input; useful with an external label. */\n inputId?: string\n controlClass?: string\n thumbClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the label block. Omit it to get the default control beside\n * `label` and `description`; supply it to compose `SwitchLabel` and\n * `SwitchDescription` yourself.\n */\n children?: JSX.Element\n}\n\nconst switchControlClass = (className?: string) =>\n cn(\n 'bg-input inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent',\n 'transition-colors ease-out outline-none',\n 'peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary',\n 'data-[invalid]:border-destructive',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n className\n )\n\nconst switchThumbClass = (className?: string) =>\n cn(\n 'bg-background pointer-events-none block size-4 rounded-full shadow-xs',\n 'transition-transform ease-out',\n 'data-[checked]:translate-x-4',\n className\n )\n\nconst flag = (on: boolean | undefined) => (on ? '' : undefined)\n\n/** What `SwitchLabel` and `SwitchDescription` need from their switch. */\ntype SwitchParts = {\n inputId: () => string\n labelId: string\n descriptionId: string\n checked: () => string | undefined\n disabled: () => string | undefined\n /** Counts a mounted part, so the input only points at ids that exist. */\n mount: (part: 'label' | 'description') => () => void\n}\n\nconst SwitchContext = createContext<SwitchParts | null>(null)\n\n/**\n * Renders a native `role=\"switch\"` checkbox and its painted track directly,\n * for the same reason and with the same contract as `Checkbox`: ui-sdk's\n * Switch measured about 1 ms per instance in the unit DOM, against a few\n * hundredths of a millisecond here, and a settings page holds one per row.\n * `children` replace the label block and may use `SwitchLabel` and\n * `SwitchDescription`, which find the switch through a context.\n */\nexport function Switch(props: SwitchProps) {\n const rest = omit(\n props,\n 'class',\n 'controlClass',\n 'thumbClass',\n 'labelClass',\n 'descriptionClass',\n 'label',\n 'description',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n 'checked',\n 'defaultChecked',\n 'onChange',\n 'name',\n 'value',\n 'required',\n 'disabled',\n 'readOnly',\n 'validationState'\n )\n const field = useFormFieldControl(\n 'control',\n merge(props, {\n get id() {\n return props.inputId ?? props.id\n },\n })\n )\n const uid = createUniqueId()\n // The root names the input and, without a `name`, the form value.\n const rootId = () => (field ? undefined : props.id || undefined) ?? `switch-${uid}`\n const inputId = () => field?.id ?? props.inputId ?? `${rootId()}-input`\n const descriptionId = `switch-${uid}-description`\n const labelId = `switch-${uid}-label`\n // Derived from `defaultChecked`, so a new default restarts an uncontrolled switch.\n const [ownChecked, setOwnChecked] = createSignal(() => props.defaultChecked ?? false)\n const checked = () => props.checked ?? ownChecked()\n // Returns what the control shows now. A write is read back only after the\n // next flush, so an event handler that has to put the input right uses this\n // value rather than reading `checked()` straight after the write.\n const setChecked = (next: boolean) => {\n if (props.disabled || props.readOnly || next === checked()) return checked()\n if (props.checked === undefined) setOwnChecked(next)\n props.onChange?.(next)\n return props.checked === undefined ? next : props.checked === true\n }\n let input: HTMLInputElement | undefined\n // A native form reset puts the input back on its default without an input or\n // change event, so the state follows it.\n onSettled(() => {\n // The reset baseline (the `checked` attribute); `checked` below only sets the property.\n if (input) input.defaultChecked = props.defaultChecked ?? false\n const form = input?.form\n if (!form) return\n const reset = () => {\n setChecked(props.defaultChecked ?? false)\n // The browser resets the input after this event; then the input shows the state.\n setTimeout(() => {\n if (input) input.checked = checked()\n })\n }\n form.addEventListener('reset', reset)\n return () => form.removeEventListener('reset', reset)\n })\n\n // Composed parts announce themselves, so the input names and describes\n // itself only with elements that are in the page.\n const [parts, setParts] = createSignal({ label: 0, description: 0 })\n const mount = (part: 'label' | 'description') => {\n setParts((count) => ({ ...count, [part]: count[part] + 1 }))\n return () => setParts((count) => ({ ...count, [part]: count[part] - 1 }))\n }\n\n const composed = 'children' in props\n const label = resolveChildren(() => (composed ? undefined : props.label))\n const description = resolveChildren(() => (composed ? undefined : props.description))\n const hasLabel = () => Boolean(label()) || parts().label > 0\n const hasDescription = () => Boolean(description()) || parts().description > 0\n // Naming: the label element, then the input itself when it also has an\n // aria-label; the description before any caller's description.\n const labelledBy = () => {\n const external = field?.['aria-labelledby'] ?? props['aria-labelledby']\n const own = hasLabel() ? labelId : undefined\n const self = (external || own) && props['aria-label'] ? inputId() : undefined\n return [external, own, self].filter(Boolean).join(' ') || undefined\n }\n const describedBy = () =>\n [\n hasDescription() ? descriptionId : '',\n field?.['aria-describedby'] ?? props['aria-describedby'],\n ]\n .filter(Boolean)\n .join(' ') || undefined\n const dataChecked = () => flag(checked())\n const dataInvalid = () => flag(props.validationState === 'invalid')\n const dataDisabled = () => flag(props.disabled)\n const context: SwitchParts = {\n inputId,\n labelId,\n descriptionId,\n checked: dataChecked,\n disabled: dataDisabled,\n mount,\n }\n\n return (\n <div\n data-slot=\"switch\"\n role=\"group\"\n id={rootId()}\n title={props.title}\n class={cn('group/switch relative flex items-center gap-2.5', props.class)}\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-valid={flag(props.validationState === 'valid')}\n data-required={flag(props.required)}\n data-disabled={dataDisabled()}\n data-readonly={flag(props.readOnly)}\n {...(rest as ComponentProps<'div'>)}\n >\n {/* The name belongs on the input; see Checkbox for why. */}\n <input\n ref={(element) => {\n input = element\n }}\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n id={inputId()}\n name={props.name ?? rootId()}\n value={props.value ?? 'on'}\n checked={checked()}\n aria-checked={checked() ? 'true' : 'false'}\n required={props.required}\n disabled={props.disabled}\n readonly={props.readOnly}\n aria-label={props['aria-label']}\n aria-labelledby={labelledBy()}\n aria-describedby={describedBy()}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-busy={props['aria-busy']}\n aria-required={props.required ? 'true' : undefined}\n aria-disabled={props.disabled ? 'true' : undefined}\n aria-readonly={props.readOnly ? 'true' : undefined}\n title={props.title}\n data-checked={dataChecked()}\n onChange={(event) => {\n event.stopPropagation()\n // Controlled: the switch shows the value the host keeps, not the click.\n event.currentTarget.checked = setChecked(event.currentTarget.checked)\n }}\n />\n <div\n data-checked={dataChecked()}\n data-invalid={dataInvalid()}\n data-disabled={dataDisabled()}\n class={switchControlClass(props.controlClass)}\n onClick={() => {\n setChecked(!checked())\n input?.focus({ preventScroll: true })\n }}\n >\n <div data-checked={dataChecked()} class={switchThumbClass(props.thumbClass)} />\n </div>\n {composed ? (\n <SwitchContext value={context}>{props.children}</SwitchContext>\n ) : (\n <Show when={label() || description()}>\n <div class=\"grid gap-0.5\">\n <Show when={label()}>\n <label\n id={labelId}\n for={inputId()}\n class={cn('text-sm leading-none font-medium', props.labelClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {label()}\n </label>\n </Show>\n <Show when={description()}>\n <div\n id={descriptionId}\n class={cn('text-muted-foreground text-sm', props.descriptionClass)}\n data-checked={dataChecked()}\n data-disabled={dataDisabled()}\n >\n {description()}\n </div>\n </Show>\n </div>\n </Show>\n )}\n </div>\n )\n}\n\nfunction useSwitchPart(name: string, part: 'label' | 'description') {\n const control = useContext(SwitchContext)\n if (!control) throw new Error(`<${name}> must be used inside <Switch>.`)\n onSettled(() => control.mount(part))\n return control\n}\n\n/**\n * The switch's own label. Valid only inside a `<Switch>`: it labels that\n * root's input, and outside one there is nothing to associate with.\n * A label drawn *beside* a switch — a settings row with the control trailing —\n * is plain text, and the switch takes an `aria-label` instead.\n */\nexport function SwitchLabel(props: ComponentProps<'label'>) {\n const control = useSwitchPart('SwitchLabel', 'label')\n const rest = omit(props, 'class')\n return (\n <label\n id={control.labelId}\n for={control.inputId()}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-sm leading-none font-medium', props.class)}\n {...rest}\n />\n )\n}\n\nexport function SwitchDescription(props: ComponentProps<'div'>) {\n const control = useSwitchPart('SwitchDescription', 'description')\n const rest = omit(props, 'class')\n return (\n <div\n id={control.descriptionId}\n data-checked={control.checked()}\n data-disabled={control.disabled()}\n class={cn('text-muted-foreground text-sm', props.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;AA4DA,IAAM,sBAAsB,cAC1B,GACE,6FACA,2CACA,mGACA,6BACA,qCACA,iEACA,SACF;AAEF,IAAM,oBAAoB,cACxB,GACE,yEACA,iCACA,gCACA,SACF;AAEF,IAAM,QAAQ,OAA6B,KAAK,KAAK,KAAA;AAarD,IAAM,gBAAgB,cAAkC,IAAI;;;;;;;;;AAU5D,SAAgB,OAAO,OAAoB;CACzC,MAAM,OAAO,KACX,OACA,SACA,gBACA,cACA,cACA,oBACA,SACA,eACA,YACA,cACA,mBACA,oBACA,gBACA,qBACA,aACA,MACA,WACA,SACA,WACA,kBACA,YACA,QACA,SACA,YACA,YACA,YACA,iBACF;CACA,MAAM,QAAQ,oBACZ,WACA,MAAM,OAAO,EACX,IAAI,KAAK;EACP,OAAO,MAAM,WAAW,MAAM;CAChC,EACF,CAAC,CACH;CACA,MAAM,MA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AAqB,aAAa;CAChE,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,SAAA,QAMC;CADCG,OAAA,QAAA,CAAA;EAJA,IAAA,KAAA;GAAI,OAAA,QAAQ;EAAa;EACzB,IAAA,iBAAA;GAAc,OAAA,QAAQ,QAAQ;EAAC;EAC/B,IAAA,kBAAA;GAAe,OAAA,QAAQ,SAAS;EAAC;EACjC,IAAA,UAAA;GAAO,OAAA,GAAG,iCAAiC,MAAM,KAAK;EAAC;CAC/C,GAAJ,IAAA,GAAA,KAAA;CANR,OACEF;AAQJ"}
|
|
@@ -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/table/table.tsx
|
|
5
5
|
var _tmpl$ = /* @__PURE__ */ template(`<div data-slot=table-container class="relative w-full overflow-x-auto"><table>`);
|
|
6
6
|
var _tmpl$2 = /* @__PURE__ */ template(`<thead>`);
|