@adea-ai/ui 0.153.0 → 0.154.1
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/README.md +10 -10
- package/dist/NOTICE +10 -1
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +3 -1
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +20 -9
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +20 -10
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +37 -24
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +5 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +3 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +11 -5
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts.map +1 -1
- package/dist/components/composites/context/context.js +7 -4
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +3 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
- package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +77 -71
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +119 -59
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +5 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +3 -4
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +5 -2
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +15 -1
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +271 -33
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +3 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +11 -5
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +3 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +14 -7
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +77 -67
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts.map +1 -1
- package/dist/components/composites/sources/sources.js +39 -39
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +9 -4
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +4 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +3 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts.map +1 -1
- package/dist/components/composites/task/task.js +3 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
- package/dist/components/composites/terminal/ansi.js +16 -0
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +15 -7
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
- package/dist/components/composites/test-results/test-results.js +15 -7
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts.map +1 -1
- package/dist/components/composites/tool/tool.js +3 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +3 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +34 -24
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +9 -5
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +6 -3
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -1
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -4
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +11 -5
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +3 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +3 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +5 -2
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +3 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +46 -42
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +5 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +16 -13
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +3 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +6 -3
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js +6 -3
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/accordion.js +3 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +15 -9
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment/attachment.js +18 -9
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +30 -11
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/button.js +37 -13
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar/calendar.js +5 -2
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js +12 -6
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +296 -21
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +9 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +8 -11
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +4 -2
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +3 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +10 -10
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +3 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +3 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +12 -6
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.d.ts +2 -0
- package/dist/components/ui/input/input-control.d.ts.map +1 -1
- package/dist/components/ui/input/input-control.js +24 -6
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +47 -48
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -8
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts +23 -10
- package/dist/components/ui/kbd/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd/kbd.js +42 -11
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/message/index.d.ts +1 -1
- package/dist/components/ui/message/index.d.ts.map +1 -1
- package/dist/components/ui/message/index.js +2 -2
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +5 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/message/parse-message-text.d.ts +32 -0
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
- package/dist/components/ui/message/parse-message-text.js +63 -3
- package/dist/components/ui/message/parse-message-text.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select/native-select.js +4 -9
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.js +7 -3
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +9 -4
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +4 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +3 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +7 -3
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +3 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner/spinner.js +3 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +35 -30
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +7 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +255 -17
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -8
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +3 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +2 -1
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +82 -68
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts.map +1 -1
- package/dist/components/ui/typography/typography.js +5 -6
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/clipboard.js +3 -0
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/fast-icon.d.ts +18 -0
- package/dist/lib/fast-icon.d.ts.map +1 -0
- package/dist/lib/fast-icon.js +75 -0
- package/dist/lib/fast-icon.js.map +1 -0
- package/dist/lib/form-field.d.ts +1 -1
- package/dist/lib/form-field.js +3 -1
- package/dist/lib/form-field.js.map +1 -1
- package/dist/lib/observe-resize.d.ts +14 -0
- package/dist/lib/observe-resize.d.ts.map +1 -0
- package/dist/lib/observe-resize.js +19 -0
- package/dist/lib/observe-resize.js.map +1 -0
- package/dist/lib/overlay.d.ts +1 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +1 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lint/index.d.ts +1 -0
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +251 -118
- package/dist/lint.js.map +1 -1
- package/dist/r/action-button.json +3 -1
- package/dist/r/floating-preview.json +2 -1
- package/dist/r/icon-picker.json +0 -1
- package/dist/r/lib.json +10 -0
- package/dist/r/model-selector.json +1 -0
- package/dist/r/plan.json +2 -1
- package/dist/r/queue.json +2 -1
- package/dist/r/registry.json +33 -9
- package/dist/r/scene-controls.json +2 -1
- package/dist/r/side-rail.json +1 -0
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/dist/r/src/components/composites/chat/chat.tsx +11 -1
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/dist/r/src/components/composites/context/context.tsx +9 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +197 -11
- package/dist/r/src/components/composites/plan/plan.tsx +5 -1
- package/dist/r/src/components/composites/queue/queue.tsx +15 -1
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/dist/r/src/components/composites/settings/settings.tsx +23 -14
- package/dist/r/src/components/composites/sources/sources.tsx +27 -20
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/dist/r/src/components/composites/stat/stat.tsx +9 -1
- package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
- package/dist/r/src/components/composites/task/task.tsx +5 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
- package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
- package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
- package/dist/r/src/components/composites/tool/tool.tsx +5 -1
- package/dist/r/src/components/composites/tree/tree.tsx +5 -1
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
- package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
- package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/dist/r/src/components/conversation/message-composer.tsx +13 -1
- package/dist/r/src/components/conversation/message-row.tsx +15 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
- package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
- package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +16 -19
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +8 -8
- package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
- package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
- package/dist/r/src/components/ui/alert/alert.tsx +20 -3
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
- package/dist/r/src/components/ui/badge/badge.tsx +24 -8
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/dist/r/src/components/ui/button/button.tsx +47 -16
- package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
- package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
- package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
- package/dist/r/src/components/ui/command/command.tsx +8 -4
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +16 -18
- package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +14 -5
- package/dist/r/src/components/ui/input/input-control.tsx +28 -19
- package/dist/r/src/components/ui/input/input.tsx +9 -12
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
- package/dist/r/src/components/ui/kbd/kbd.tsx +53 -12
- package/dist/r/src/components/ui/message/index.ts +3 -0
- package/dist/r/src/components/ui/message/message.tsx +11 -2
- package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
- package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
- package/dist/r/src/components/ui/select/select.tsx +11 -1
- package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/dist/r/src/components/ui/switch/switch.tsx +235 -28
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
- package/dist/r/src/components/ui/toast/toast.tsx +5 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/dist/r/src/components/ui/trace/trace.tsx +61 -28
- package/dist/r/src/components/ui/typography/typography.tsx +6 -5
- package/dist/r/src/lib/clipboard.ts +4 -0
- package/dist/r/src/lib/fast-icon.ts +88 -0
- package/dist/r/src/lib/form-field.ts +7 -7
- package/dist/r/src/lib/observe-resize.ts +28 -0
- package/dist/r/src/lib/overlay.ts +1 -1
- package/dist/r/subagent.json +2 -1
- package/dist/r/tool.json +2 -1
- package/dist/r/tooltip.json +5 -0
- package/dist/r/top-bar.json +1 -0
- package/dist/r/trace.json +0 -1
- package/package.json +1 -1
- package/registry.json +33 -9
- package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/src/components/composites/action-button/action-button.tsx +38 -21
- package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/src/components/composites/chat/chat.tsx +11 -1
- package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/src/components/composites/context/context.tsx +9 -1
- package/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/src/components/composites/help-center/help-center.tsx +5 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/src/components/composites/model-selector/model-selector.tsx +197 -11
- package/src/components/composites/plan/plan.tsx +5 -1
- package/src/components/composites/queue/queue.tsx +15 -1
- package/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/src/components/composites/settings/settings.tsx +23 -14
- package/src/components/composites/sources/sources.tsx +27 -20
- package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/src/components/composites/stat/stat.tsx +9 -1
- package/src/components/composites/subagent/subagent.tsx +5 -1
- package/src/components/composites/task/task.tsx +5 -1
- package/src/components/composites/terminal/ansi.ts +18 -0
- package/src/components/composites/terminal/terminal.tsx +17 -7
- package/src/components/composites/test-results/test-results.tsx +17 -7
- package/src/components/composites/tool/tool.tsx +5 -1
- package/src/components/composites/tree/tree.tsx +5 -1
- package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/src/components/conversation/busy-send-button.tsx +11 -1
- package/src/components/conversation/conversation-avatar.tsx +7 -1
- package/src/components/conversation/conversation-surface.tsx +5 -1
- package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/src/components/conversation/message-composer.tsx +13 -1
- package/src/components/conversation/message-row.tsx +15 -1
- package/src/components/conversation/thread-panel.tsx +5 -1
- package/src/components/conversation/transcript-composition.tsx +5 -1
- package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/src/components/layout/side-rail/side-rail.tsx +16 -19
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/src/components/layout/top-bar/top-bar.tsx +8 -8
- package/src/components/theme/appearance-panel.tsx +6 -1
- package/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/src/components/theme/theme-toggle.tsx +7 -1
- package/src/components/ui/accordion/accordion.tsx +5 -1
- package/src/components/ui/alert/alert.tsx +20 -3
- package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/src/components/ui/attachment/attachment.tsx +19 -8
- package/src/components/ui/badge/badge.tsx +24 -8
- package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/src/components/ui/button/button.tsx +47 -16
- package/src/components/ui/calendar/calendar.tsx +6 -1
- package/src/components/ui/carousel/carousel.tsx +15 -5
- package/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/src/components/ui/code-block/code-block.tsx +11 -5
- package/src/components/ui/combobox/combobox.tsx +8 -9
- package/src/components/ui/command/command.tsx +8 -4
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/src/components/ui/dialog/dialog-layer.tsx +16 -18
- package/src/components/ui/dialog/dialog.tsx +5 -1
- package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/src/components/ui/empty/empty-state.tsx +5 -1
- package/src/components/ui/field/field.tsx +14 -5
- package/src/components/ui/input/input-control.tsx +28 -19
- package/src/components/ui/input/input.tsx +9 -12
- package/src/components/ui/input-group/input-group.tsx +1 -8
- package/src/components/ui/kbd/kbd.tsx +53 -12
- package/src/components/ui/message/index.ts +3 -0
- package/src/components/ui/message/message.tsx +11 -2
- package/src/components/ui/message/parse-message-text.ts +94 -2
- package/src/components/ui/native-select/native-select.tsx +6 -9
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/src/components/ui/pagination/pagination.tsx +11 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/src/components/ui/resizable/resizable.tsx +5 -1
- package/src/components/ui/select/select.tsx +11 -1
- package/src/components/ui/sheet/sheet.tsx +5 -1
- package/src/components/ui/spinner/spinner.tsx +5 -1
- package/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/src/components/ui/switch/switch.tsx +235 -28
- package/src/components/ui/textarea/textarea.tsx +1 -8
- package/src/components/ui/toast/toast.tsx +5 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/src/components/ui/trace/trace.tsx +61 -28
- package/src/components/ui/typography/typography.tsx +6 -5
- package/src/lib/clipboard.ts +4 -0
- package/src/lib/fast-icon.ts +88 -0
- package/src/lib/form-field.ts +7 -7
- package/src/lib/observe-resize.ts +28 -0
- package/src/lib/overlay.ts +1 -1
- package/src/lint/index.ts +199 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { menuItem, menuSwatchTone, topLayerProps } from "../../../lib/overlay.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
4
|
import { className, createComponent, effect, memo, mergeProps, template } from "solid-js/web";
|
|
4
5
|
import { Check, ChevronDown, ChevronsUpDown } from "lucide-solid";
|
|
5
6
|
import { Show, splitProps } from "solid-js";
|
|
6
7
|
import { Select } from "@kobalte/core/select";
|
|
7
8
|
// src/components/ui/select/select.tsx
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
|
|
10
|
+
var Check$1 = fastIcon(Check);
|
|
11
|
+
var ChevronDown$1 = fastIcon(ChevronDown);
|
|
12
|
+
var ChevronsUpDown$1 = fastIcon(ChevronsUpDown);
|
|
9
13
|
/**
|
|
10
14
|
* Select.
|
|
11
15
|
*
|
|
@@ -50,7 +54,7 @@ function SelectTrigger(props) {
|
|
|
50
54
|
return createComponent(Select.Icon, {
|
|
51
55
|
"class": "text-muted-foreground",
|
|
52
56
|
get children() {
|
|
53
|
-
return createComponent(ChevronDown, {});
|
|
57
|
+
return createComponent(ChevronDown$1, {});
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
}
|
|
@@ -136,7 +140,7 @@ function SelectItem(props) {
|
|
|
136
140
|
"data-slot": "select-indicator",
|
|
137
141
|
"class": "absolute end-2 flex size-4 items-center justify-center text-primary",
|
|
138
142
|
get children() {
|
|
139
|
-
return createComponent(Check, { "class": "size-4" });
|
|
143
|
+
return createComponent(Check$1, { "class": "size-4" });
|
|
140
144
|
}
|
|
141
145
|
})
|
|
142
146
|
];
|
|
@@ -156,7 +160,7 @@ function SelectLabel(props) {
|
|
|
156
160
|
}
|
|
157
161
|
/** The chevron pair used when a Select is composed by hand in a field. */
|
|
158
162
|
function SelectChevronsUpDown(props) {
|
|
159
|
-
return createComponent(ChevronsUpDown, mergeProps({ "aria-hidden": "true" }, props));
|
|
163
|
+
return createComponent(ChevronsUpDown$1, mergeProps({ "aria-hidden": "true" }, props));
|
|
160
164
|
}
|
|
161
165
|
export { Select$1 as Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue };
|
|
162
166
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","ChevronDown","ChevronsUpDown","Show","splitProps","menuItem","menuSwatchTone","topLayerProps","cn","props","local","rest","_$createComponent","_$mergeProps","gutter","Trigger","size","hideIcon","SelectTrigger","class","undefined","children","_$memo","when","Icon","Value","optionLabel","option","LABEL_FIELDS","labelFromOption","field","value","SelectValue","readLabel","state","selectedOption","Content","portalMount","SelectContent","Portal","mount","Listbox","SelectItem","Item","swatch","_el$","_tmpl$","_$effect","_$className","tone","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n menuItem,\n menuSwatchTone,\n type MenuSwatchTone,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value, the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n // Kobalte's own default gutter is 8px; without the arrow (removed below) the\n // popper no longer folds half an arrow box into that offset, and 8px read as\n // a detached list. Four pixels is shadcn's `sideOffset`, attached, with\n // room for the trigger's own border.\n const [local, rest] = splitProps(props, ['gutter'])\n return <KobalteSelect gutter={local.gutter ?? 4} {...rest} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n data-slot=\"select-trigger\"\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n {/* No arrow: the list is the trigger's own value opened up, and Kobalte\n reserves half the arrow's 30px box as popper gutter, which is where\n the reported gap between a form trigger and its options came from. */}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(\n props: ComponentProps<typeof KobalteSelect.Item> & {\n /** Draw a leading colour dot from the shared tone ladder, the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'children', 'swatch'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system — the row's own foreground reads as decoration. */}\n <KobalteSelect.ItemIndicator\n data-slot=\"select-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgBA,SACdW,OACA;CAKA,MAA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AAAU,WAAA;EAAA,OAAA;GAAAT,gBACnET,MAAI;IAAA,IAACoB,OAAI;KAAA,OAAEb,MAAMkC;IAAM;IAAA,IAAAvB,WAAA;KAAA,IAAAwB,OAAAC,OAAA;KAAAC,aAAAC,UAAAH,MACUvC,eAAe,EAAE2C,MAAMvC,MAAMkC,OAAO,CAAC,CAAC,CAAA;KAAA,OAAAC;IAAA;GAAA,CAAA;GAAAjC,gBAEvEb,OAAcmD,WAAS,EAAA,IAAA7B,WAAA;IAAA,OAAEX,MAAMW;GAAQ,EAAA,CAAA;GAAAT,gBAGvCb,OAAcoD,eAAa;IAAA,aAAA;IAAA,SAAA;IAAA,IAAA9B,WAAA;KAAA,OAAAT,gBAIzBZ,OAAK,EAAA,SAAA,SAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgBoD,cAAc3C,OAAqD;CACjF,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQb,OAAcsD,SAAOxC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAG,iBAAiBE,MAAMS,KAAK;CAAC,EAAA,GAAMR,IAAI,CAAA;AACjF;AAEA,SAAgB2C,YAAY7C,OAAmD;CAC7E,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGb,OAAcwD,OAAK1C,WAAA,EAAA,KAAA,WAAA;EAAA,OACXL,GAAG,oEAAoEE,MAAMS,KAAK;CAAC,EAAA,GACtFR,IAAI,CAAA;AAGd;;AAGA,SAAgB6C,qBAAqB/C,OAA8B;CACjE,OAAAG,gBAAQV,gBAAcW,WAAA,EAAA,eAAA,OAAA,GAAwBJ,KAAK,CAAA;AACrD"}
|
|
1
|
+
{"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","LucideCheck","ChevronDown","LucideChevronDown","ChevronsUpDown","LucideChevronsUpDown","Show","splitProps","menuItem","menuSwatchTone","topLayerProps","cn","fastIcon","props","local","rest","_$createComponent","_$mergeProps","gutter","Trigger","size","hideIcon","SelectTrigger","class","undefined","children","_$memo","when","Icon","Value","optionLabel","option","LABEL_FIELDS","labelFromOption","field","value","SelectValue","readLabel","state","selectedOption","Content","portalMount","SelectContent","Portal","mount","Listbox","SelectItem","Item","swatch","_el$","_tmpl$","_$effect","_$className","tone","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport {\n Check as LucideCheck,\n ChevronDown as LucideChevronDown,\n ChevronsUpDown as LucideChevronsUpDown,\n} from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n menuItem,\n menuSwatchTone,\n type MenuSwatchTone,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst ChevronsUpDown = fastIcon(LucideChevronsUpDown)\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value, the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n // Kobalte's own default gutter is 8px; without the arrow (removed below) the\n // popper no longer folds half an arrow box into that offset, and 8px read as\n // a detached list. Four pixels is shadcn's `sideOffset`, attached, with\n // room for the trigger's own border.\n const [local, rest] = splitProps(props, ['gutter'])\n return <KobalteSelect gutter={local.gutter ?? 4} {...rest} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n data-slot=\"select-trigger\"\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n {/* No arrow: the list is the trigger's own value opened up, and Kobalte\n reserves half the arrow's 30px box as popper gutter, which is where\n the reported gap between a form trigger and its options came from. */}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(\n props: ComponentProps<typeof KobalteSelect.Item> & {\n /** Draw a leading colour dot from the shared tone ladder, the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'children', 'swatch'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system — the row's own foreground reads as decoration. */}\n <KobalteSelect.ItemIndicator\n data-slot=\"select-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;AAmBA,IAAME,UAAQY,SAASX,KAAW;AAClC,IAAMC,gBAAcU,SAAST,WAAiB;AAC9C,IAAMC,mBAAiBQ,SAASP,cAAoB;;;;;;;;;;;;;;AAepD,SAAgBP,SACde,OACA;CAKA,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,QAAQ,CAAC;CAClD,OAAAG,gBAAQjB,QAAakB,WAAA,EAAA,IAACC,SAAM;EAAA,OAAEJ,MAAMI,UAAU;CAAC,EAAA,GAAMH,IAAI,CAAA;AAC3D;AAQA,SAAgBO,cAAcT,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO;EAAC;EAAS;EAAQ;EAAY;CAAU,CAAC;CAEjF,OAAAG,gBACGjB,OAAcoB,SAAOF,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEbN,GACL,6GACA,sFACA,kDACA,sBACA,oFACA,4FACA,gFACA,oJACA,+DACA;IACE,wBAAwBG,MAAMM,SAAS;IACvC,wBAAwBN,MAAMM,SAAS,QAAQN,MAAMM,SAASI,KAAAA;IAC9D,wBAAwBV,MAAMM,SAAS;GACzC,GACAN,MAAMS,KACR;EAAC;CAAA,GACGR,MAAI,EAAA,IAAAU,WAAA;EAAA,OAAA,CAAAC,WAEPZ,MAAMW,QAAQ,GAAAT,gBACdV,MAAI;GAAA,IAACqB,OAAI;IAAA,OAAE,CAACb,MAAMO;GAAQ;GAAA,IAAAI,WAAA;IAAA,OAAAT,gBACxBjB,OAAc6B,MAAI;KAAA,SAAA;KAAA,IAAAH,WAAA;MAAA,OAAAT,gBAChBd,eAAW,CAAA,CAAA;KAAA;IAAA,CAAA;GAAA;EAAA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AAG,gBACGjB,OAAc4D,OAAK1C,WAAA,EAAA,KAAA,WAAA;EAAA,OACXN,GAAG,oEAAoEG,MAAMS,KAAK;CAAC,EAAA,GACtFR,IAAI,CAAA;AAGd;;AAGA,SAAgB6C,qBAAqB/C,OAA8B;CACjE,OAAAG,gBAAQZ,kBAAca,WAAA,EAAA,eAAA,OAAA,GAAwBJ,KAAK,CAAA;AACrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG/F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG/F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAUtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,QAAA,MAAM,aAAa;;;;8EAwDlB,CAAA;AAQD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACzE,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACjC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sFAAsF;IACtF,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;CACpD,CAAA;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA4DpD;AAED,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE7E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGvF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,eAa5E;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,eAa5E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,eAG3E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGvF;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { overlayCornerClose, overlayDescription, overlayTitle } from "../../../l
|
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
import { DialogOverlay } from "../dialog/dialog.js";
|
|
5
5
|
import { DialogEscapeTarget, createDialogLayer } from "../dialog/dialog-layer.js";
|
|
6
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
6
7
|
import { createComponent, memo, mergeProps, spread, template } from "solid-js/web";
|
|
7
8
|
import { X } from "lucide-solid";
|
|
8
9
|
import { Show, children, splitProps } from "solid-js";
|
|
@@ -11,6 +12,7 @@ import { Content, Dialog, Root as Sheet, Trigger as SheetTrigger } from "@kobalt
|
|
|
11
12
|
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=sheet-header>`);
|
|
12
13
|
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=sheet-body>`);
|
|
13
14
|
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=sheet-footer>`);
|
|
15
|
+
var X$1 = fastIcon(X);
|
|
14
16
|
/**
|
|
15
17
|
* Sheet.
|
|
16
18
|
*
|
|
@@ -170,7 +172,7 @@ function SheetContent(props) {
|
|
|
170
172
|
tabindex: "0",
|
|
171
173
|
"class": overlayCornerClose,
|
|
172
174
|
get children() {
|
|
173
|
-
return closeButton() ?? createComponent(X, { "class": "size-4" });
|
|
175
|
+
return closeButton() ?? createComponent(X$1, { "class": "size-4" });
|
|
174
176
|
}
|
|
175
177
|
});
|
|
176
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["KobalteDialog","KobalteDialogContent","X","children","resolveChildren","Show","splitProps","cva","overlayCornerClose","overlayDescription","overlayTitle","cn","DialogOverlay","createDialogLayer","DialogEscapeTarget","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","size","default","panel","compoundVariants","class","defaultVariants","sheetVariantFor","closeButton","closeLabel","restoreFocusRef","SheetContent","props","local","rest","layer","onOpenAutoFocus","event","onCloseAutoFocus","_$createComponent","Portal","when","_$mergeProps","onEscapeKeyDown","_$memo","CloseButton","tabindex","SheetCloseButton","SheetHeader","band","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as KobalteDialog, Content as KobalteDialogContent } from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { children as resolveChildren, Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayCornerClose, overlayDescription, overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { DialogOverlay } from '../dialog'\nimport { createDialogLayer, DialogEscapeTarget } from '../dialog/dialog-layer'\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 * Like every dialog, a sheet returns focus on close to the element focused\n * 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\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\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 }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'size',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const layer = createDialogLayer({\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: (event) => local.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => local.onCloseAutoFocus?.(event),\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n const closeButton = resolveChildren(() => local.closeButton)\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant(), size: local.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 local.class\n )}\n {...rest}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n <DialogEscapeTarget onEscapeKeyDown={props.onEscapeKeyDown}>\n {local.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 <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </DialogEscapeTarget>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport { Root as Sheet, Trigger as SheetTrigger } from '@kobalte/core/dialog'\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\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 [local, rest] = splitProps(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': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.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 [local, rest] = splitProps(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': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Description class={cn(overlayDescription, local.class)} {...rest} />\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMe,gBAAgBR,IACpB,0GACA;CACES,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;;;;;;;EAOAC,MAAM;GACJC,SAAS;GACTC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACEX,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM,CAAC,SAAS,KAAK;GACrBK,SAAS;GACTG,MAAM;GACNI,OAAO;EACT;EACA;GAAEZ,MAAM,CAAC,SAAS,KAAK;GAAGK,SAAS;GAASG,MAAM;GAASI,OAAO;EAAU;CAAC;CAE/EC,iBAAiB;EAAEb,MAAM;EAAOK,SAAS;EAAQG,MAAM;CAAU;AACnE,CACF;;AAGA,IAAMM,mBACJd,MACAK,YACqBA,aAAaL,QAAQ,WAAW,QAAQ,UAAU;AAWzE,SAAgBkB,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CACD,MAAMG,QAAQ1B,kBAAkB;EAC9BqB,iBAAiBG,MAAMH;EACvBM,kBAAkBC,UAAUJ,MAAMG,kBAAkBC,KAAK;EACzDC,mBAAmBD,UAAUJ,MAAMK,mBAAmBD,KAAK;CAC7D,CAAC;CAED,MAAMnB,gBAAgBS,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EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,WAAW3B,OAAmD;CAC5E,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAO,gBAAQ3C,OAAcgE,OAAKlB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQnC,GAAGD,cAAc2B,MAAMR,KAAK;CAAC,EAAA,GAAMS,IAAI,CAAA;AAC5E;AAEA,SAAgB2B,iBAAiB7B,OAAyD;CACxF,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAO,gBAAQ3C,OAAckE,aAAWpB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQnC,GAAGF,oBAAoB4B,MAAMR,KAAK;CAAC,EAAA,GAAMS,IAAI,CAAA;AACxF"}
|
|
1
|
+
{"version":3,"file":"sheet.js","names":["KobalteDialog","KobalteDialogContent","X","LucideX","children","resolveChildren","Show","splitProps","cva","overlayCornerClose","overlayDescription","overlayTitle","cn","DialogOverlay","createDialogLayer","DialogEscapeTarget","fastIcon","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","size","default","panel","compoundVariants","class","defaultVariants","sheetVariantFor","closeButton","closeLabel","restoreFocusRef","SheetContent","props","local","rest","layer","onOpenAutoFocus","event","onCloseAutoFocus","_$createComponent","Portal","when","_$mergeProps","onEscapeKeyDown","_$memo","CloseButton","tabindex","SheetCloseButton","SheetHeader","band","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as KobalteDialog, Content as KobalteDialogContent } from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X as LucideX } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { children as resolveChildren, Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayCornerClose, overlayDescription, overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { DialogOverlay } from '../dialog'\nimport { createDialogLayer, DialogEscapeTarget } from '../dialog/dialog-layer'\nimport { fastIcon } from '#lib/fast-icon'\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 * Like every dialog, a sheet returns focus on close to the element focused\n * 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\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\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 }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'size',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const layer = createDialogLayer({\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: (event) => local.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => local.onCloseAutoFocus?.(event),\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n const closeButton = resolveChildren(() => local.closeButton)\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant(), size: local.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 local.class\n )}\n {...rest}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n <DialogEscapeTarget onEscapeKeyDown={props.onEscapeKeyDown}>\n {local.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 <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </DialogEscapeTarget>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport { Root as Sheet, Trigger as SheetTrigger } from '@kobalte/core/dialog'\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\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 [local, rest] = splitProps(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': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.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 [local, rest] = splitProps(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': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Description class={cn(overlayDescription, local.class)} {...rest} />\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAME,MAAIc,SAASb,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmC1B,IAAMc,gBAAgBT,IACpB,0GACA;CACEU,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;;;;;;;EAOAC,MAAM;GACJC,SAAS;GACTC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACEX,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM,CAAC,SAAS,KAAK;GACrBK,SAAS;GACTG,MAAM;GACNI,OAAO;EACT;EACA;GAAEZ,MAAM,CAAC,SAAS,KAAK;GAAGK,SAAS;GAASG,MAAM;GAASI,OAAO;EAAU;CAAC;CAE/EC,iBAAiB;EAAEb,MAAM;EAAOK,SAAS;EAAQG,MAAM;CAAU;AACnE,CACF;;AAGA,IAAMM,mBACJd,MACAK,YACqBA,aAAaL,QAAQ,WAAW,QAAQ,UAAU;AAWzE,SAAgBkB,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQjC,WAAW+B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CACD,MAAMG,QAAQ3B,kBAAkB;EAC9BsB,iBAAiBG,MAAMH;EACvBM,kBAAkBC,UAAUJ,MAAMG,kBAAkBC,KAAK;EACzDC,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B,MAAMgB,KAAK,GACzBhB,MAAMR,KACR;EAAC,EAAA,GACGS,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,WAAW3B,OAAmD;CAC5E,MAAM,CAACC,OAAOC,QAAQjC,WAAW+B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAO,gBAAQ7C,OAAckE,OAAKlB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQpC,GAAGD,cAAc4B,MAAMR,KAAK;CAAC,EAAA,GAAMS,IAAI,CAAA;AAC5E;AAEA,SAAgB2B,iBAAiB7B,OAAyD;CACxF,MAAM,CAACC,OAAOC,QAAQjC,WAAW+B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAO,gBAAQ7C,OAAcoE,aAAWpB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQpC,GAAGF,oBAAoB6B,MAAMR,KAAK;CAAC,EAAA,GAAMS,IAAI,CAAA;AACxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/spinner/spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/spinner/spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAOtD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,eAAe;;8EAWnB,CAAA;AAEF,KAAK,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAA;AAE3D,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAC5D,eAAe,GAAG;IAChB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CACvB,CAAA;AAEH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,kCAkB1C"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { cva } from "../../../lib/variants.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
4
|
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
5
|
import { LoaderCircle } from "lucide-solid";
|
|
5
6
|
import { splitProps } from "solid-js";
|
|
6
7
|
// src/components/ui/spinner/spinner.tsx
|
|
7
8
|
var _tmpl$ = /*#__PURE__*/ template(`<span class=visually-hidden>`);
|
|
9
|
+
var LoaderCircle$1 = fastIcon(LoaderCircle);
|
|
8
10
|
/**
|
|
9
11
|
* Spinner.
|
|
10
12
|
*
|
|
@@ -33,7 +35,7 @@ function Spinner(props) {
|
|
|
33
35
|
"size",
|
|
34
36
|
"label"
|
|
35
37
|
]);
|
|
36
|
-
return [createComponent(LoaderCircle, mergeProps({
|
|
38
|
+
return [createComponent(LoaderCircle$1, mergeProps({
|
|
37
39
|
"data-slot": "spinner",
|
|
38
40
|
role: "status",
|
|
39
41
|
get ["aria-label"]() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","names":["LoaderCircle","splitProps","cva","cn","spinnerVariants","variants","size","xs","sm","md","lg","xl","defaultVariants","label","Spinner","props","local","rest","_$createComponent","_$mergeProps","role","_$memo","undefined","class","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/spinner/spinner.tsx"],"sourcesContent":["import { LoaderCircle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\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, rest] = splitProps(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 {...rest}\n />\n {local.label === false ? null : (\n <span class=\"visually-hidden\">{local.label ?? 'Loading'}</span>\n )}\n </>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner.js","names":["LoaderCircle","LucideLoaderCircle","splitProps","cva","cn","fastIcon","spinnerVariants","variants","size","xs","sm","md","lg","xl","defaultVariants","label","Spinner","props","local","rest","_$createComponent","_$mergeProps","role","_$memo","undefined","class","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/spinner/spinner.tsx"],"sourcesContent":["import { LoaderCircle as LucideLoaderCircle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } 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, rest] = splitProps(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 {...rest}\n />\n {local.label === false ? null : (\n <span class=\"visually-hidden\">{local.label ?? 'Loading'}</span>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAMA,iBAAeK,SAASJ,YAAkB;;;;;;;;;;;;;AAchD,IAAMK,kBAAkBH,IAAI,yBAAyB;CACnDI,UAAU,EACRC,MAAM;EACJC,IAAI;EACJC,IAAI;EACJC,IAAI;EACJC,IAAI;EACJC,IAAI;CACN,EACF;CACAC,iBAAiB,EAAEN,MAAM,KAAK;AAChC,CAAC;AAUD,SAAgBQ,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EAAC;EAAS;EAAQ;CAA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AiE;IACjE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"status-chip.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,iBAAiB;;8EAa5B,CAAA;AAYF,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eA6ChD;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC,CAAA;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,eAeA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { cva } from "../../../lib/variants.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import { className, createComponent, effect, insert, mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { LazyTooltip } from "../tooltip/lazy-tooltip.js";
|
|
4
|
+
import { addEventListener, className, createComponent, effect, insert, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
|
|
5
5
|
import { Show, splitProps } from "solid-js";
|
|
6
6
|
// src/components/ui/status-chip/status-chip.tsx
|
|
7
7
|
var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=status-chip><span aria-hidden=true></span><span>`);
|
|
8
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<
|
|
9
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<
|
|
10
|
-
var _tmpl$4 = /*#__PURE__*/ template(`<
|
|
8
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<span class=inline-flex>`);
|
|
9
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<dl>`);
|
|
10
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<dt class=text-muted-foreground>`);
|
|
11
|
+
var _tmpl$5 = /*#__PURE__*/ template(`<div class="flex items-baseline justify-between gap-4"><dd>`);
|
|
11
12
|
/**
|
|
12
13
|
* StatusChip.
|
|
13
14
|
*
|
|
@@ -91,18 +92,22 @@ function StatusChip(props) {
|
|
|
91
92
|
return local.detail;
|
|
92
93
|
},
|
|
93
94
|
fallback: chip,
|
|
94
|
-
children: (detail) => createComponent(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
children: (detail) => createComponent(LazyTooltip, {
|
|
96
|
+
get content() {
|
|
97
|
+
return detail();
|
|
98
|
+
},
|
|
99
|
+
contentProps: { "data-slot": "tooltip-content" },
|
|
100
|
+
children: (tip) => (() => {
|
|
101
|
+
var _el$4 = _tmpl$2();
|
|
102
|
+
addEventListener(_el$4, "focus", tip.onFocus);
|
|
103
|
+
addEventListener(_el$4, "pointerenter", tip.onPointerEnter);
|
|
104
|
+
var _ref$ = tip.ref;
|
|
105
|
+
typeof _ref$ === "function" ? use(_ref$, _el$4) : tip.ref = _el$4;
|
|
106
|
+
insert(_el$4, chip);
|
|
107
|
+
effect(() => setAttribute(_el$4, "aria-describedby", tip.describedBy()));
|
|
108
|
+
return _el$4;
|
|
109
|
+
})()
|
|
110
|
+
})
|
|
106
111
|
});
|
|
107
112
|
}
|
|
108
113
|
/**
|
|
@@ -119,20 +124,20 @@ function StatusChip(props) {
|
|
|
119
124
|
*/
|
|
120
125
|
function StatusList(props) {
|
|
121
126
|
return (() => {
|
|
122
|
-
var _el$
|
|
123
|
-
insert(_el$
|
|
124
|
-
var _el$
|
|
125
|
-
insert(_el$
|
|
127
|
+
var _el$5 = _tmpl$3();
|
|
128
|
+
insert(_el$5, () => props.entries.map((entry) => (() => {
|
|
129
|
+
var _el$6 = _tmpl$5(), _el$8 = _el$6.firstChild;
|
|
130
|
+
insert(_el$6, createComponent(Show, {
|
|
126
131
|
get when() {
|
|
127
132
|
return !props.compact;
|
|
128
133
|
},
|
|
129
134
|
get children() {
|
|
130
|
-
var _el$
|
|
131
|
-
insert(_el$
|
|
132
|
-
return _el$
|
|
135
|
+
var _el$7 = _tmpl$4();
|
|
136
|
+
insert(_el$7, () => entry.name);
|
|
137
|
+
return _el$7;
|
|
133
138
|
}
|
|
134
|
-
}), _el$
|
|
135
|
-
insert(_el$
|
|
139
|
+
}), _el$8);
|
|
140
|
+
insert(_el$8, createComponent(StatusChip, {
|
|
136
141
|
get tone() {
|
|
137
142
|
return entry.tone;
|
|
138
143
|
},
|
|
@@ -143,11 +148,11 @@ function StatusList(props) {
|
|
|
143
148
|
return entry.detail;
|
|
144
149
|
}
|
|
145
150
|
}));
|
|
146
|
-
effect(() => className(_el$
|
|
147
|
-
return _el$
|
|
151
|
+
effect(() => className(_el$8, cn(!props.compact && "shrink-0")));
|
|
152
|
+
return _el$6;
|
|
148
153
|
})()));
|
|
149
|
-
effect(() => className(_el$
|
|
150
|
-
return _el$
|
|
154
|
+
effect(() => className(_el$5, cn("grid gap-2 text-sm", props.class)));
|
|
155
|
+
return _el$5;
|
|
151
156
|
})();
|
|
152
157
|
}
|
|
153
158
|
export { StatusChip, StatusList, statusDotVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-chip.js","names":["Show","splitProps","cva","cn","
|
|
1
|
+
{"version":3,"file":"status-chip.js","names":["Show","splitProps","cva","cn","LazyTooltip","statusDotVariants","variants","tone","neutral","success","warning","danger","info","pending","unknown","defaultVariants","labelTone","label","compact","detail","trailing","StatusChip","props","local","rest","chip","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_$spread","_$mergeProps","class","_$insert","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","_$createComponent","when","fallback","children","content","contentProps","tip","_el$4","_tmpl$2","_$addEventListener","onFocus","onPointerEnter","_ref$","ref","_$use","_$setAttribute","describedBy","name","StatusList","entries","_el$5","_tmpl$3","map","entry","_el$6","_tmpl$5","_el$8","_el$7","_tmpl$4"],"sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"sourcesContent":["import { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\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, rest] = splitProps(props, [\n 'tone',\n 'label',\n 'compact',\n 'detail',\n 'trailing',\n 'class',\n ])\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":";;;;;;;;;;;;;;;;;;;;;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D;EAAA,EAAA,CAAA,CAI9C,CAAC;EAAAhC,aAAAK,UAAAuB,OAVO7D,GAAG,sBAAsBmB,MAAMY,KAAK,CAAC,CAAA;EAAA,OAAA8B;CAAA,EAAA,CAAA;AAapD"}
|
|
@@ -28,6 +28,13 @@ export type SwitchProps = Omit<ComponentProps<typeof KobalteSwitch>, 'children'>
|
|
|
28
28
|
*/
|
|
29
29
|
children?: JSX.Element;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Without `children` it renders a native `role="switch"` checkbox and its
|
|
33
|
+
* painted track directly, for the same reason and with the same Kobalte
|
|
34
|
+
* contract as `Checkbox`. With `children` the caller composes the parts, so it
|
|
35
|
+
* renders through Kobalte, whose context `SwitchLabel` and `SwitchDescription`
|
|
36
|
+
* need.
|
|
37
|
+
*/
|
|
31
38
|
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
32
39
|
/**
|
|
33
40
|
* The switch's own label. Valid only inside a `<Switch>`: it is Kobalte's label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAcnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,EAAE,UAAU,CAAC,GAAG;IACjF,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAuBD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAwLxC;AA8ED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,eAK5E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAKxF"}
|