@adea-ai/ui 0.162.6 → 0.162.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/about-dialog/about-dialog.js +5 -5
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +3 -3
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +22 -22
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.js +7 -7
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +5 -5
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +13 -13
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js +7 -7
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +9 -9
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js +5 -5
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +10 -10
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +117 -117
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +7 -7
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js +2 -2
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +7 -7
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +12 -12
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js +5 -5
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/prompt-input/prompt-input.js +3 -3
- package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
- package/dist/components/composites/queue/queue.js +13 -13
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +5 -5
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +16 -16
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +2 -2
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +2 -2
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js +5 -5
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js +5 -5
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +10 -10
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js +6 -6
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js +5 -5
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js +2 -2
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js +5 -5
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.js +1 -1
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +18 -18
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js +17 -17
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js +5 -5
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js +6 -6
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +1 -1
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +23 -23
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js +1 -1
- package/dist/components/conversation/busy-send-button.js +10 -10
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js +1 -1
- package/dist/components/conversation/composer-core.js +1 -1
- package/dist/components/conversation/composer-menu.js +2 -2
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +7 -7
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +5 -5
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -9
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js +13 -13
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/scroll-follow.js +1 -1
- package/dist/components/conversation/thread-panel.js +5 -5
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js +5 -5
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +7 -7
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js +2 -2
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +5 -5
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +2 -2
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +7 -7
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +5 -5
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js +1 -1
- package/dist/components/theme/appearance-panel.js +3 -3
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.js +3 -3
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/script-projection.js +1 -1
- package/dist/components/theme/theme-catalogue-source.js +1 -1
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +7 -7
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js +2 -2
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.js +1 -1
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-provider.js +1 -1
- package/dist/components/theme/theme-toggle.js +7 -7
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +13 -13
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js +12 -12
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +16 -16
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js +2 -2
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button-group/button-group.js +2 -2
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +8 -8
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js +2 -2
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js +8 -8
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js +2 -2
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +6 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js +6 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +7 -7
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +21 -21
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js +1 -1
- package/dist/components/ui/command/command.js +23 -23
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/detail-panel/detail-panel.js +5 -5
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +2 -2
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +21 -21
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js +2 -2
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js +14 -14
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js +5 -5
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +2 -2
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js +14 -14
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js +2 -2
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js +10 -10
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js +2 -2
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +2 -2
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js +2 -2
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js +2 -2
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +7 -7
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js +3 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +5 -5
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +28 -28
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js +15 -15
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js +5 -5
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +10 -10
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +9 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js +11 -11
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +21 -21
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js +5 -5
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js +6 -6
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js +5 -5
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js +5 -5
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +2 -2
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js +4 -4
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +7 -7
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +2 -2
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +7 -7
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js +6 -6
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js +7 -8
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
- package/dist/components/ui/tooltip/tooltip.js +10 -10
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js +19 -19
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js +2 -2
- package/dist/lib/accent-presets.js +1 -1
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/async-action.js +1 -1
- package/dist/lib/create-poll.js +1 -1
- package/dist/lib/create-poll.js.map +1 -1
- package/dist/lib/external-link.js +1 -1
- package/dist/lib/external-link.js.map +1 -1
- package/dist/lib/fast-icon.js +1 -1
- package/dist/lib/theme-css.js +1 -1
- package/dist/lib/theme-engine-light.js +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-records.js +1 -1
- package/dist/lib/themes.js +1 -1
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/vite/source-parser.js +1 -1
- package/dist/vite/tailwind-sources.js +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail-panel.js","names":["<aside\n class={cn(\n 'flex h-full min-h-0 flex-col overflow-hidden border-l border-border bg-card',\n local.class\n )}\n aria-label={local.label}\n {...rest}\n >\n {local.children}\n </aside>","<Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>","<div class=\"min-w-0\">\n <Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>\n <h2 id={titleId} class=\"truncate text-sm font-semibold text-foreground\">\n {local.title}\n </h2>\n {local.children}\n </div>","<div class=\"flex shrink-0 items-center gap-1\">\n {local.actions}\n <Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </div>","<Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>","<Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>","variant=\"ghost\"","size=\"icon-sm\"","onClick={() => dismiss()()}","<X aria-hidden=\"true\" />","<header\n class={cn(\n 'sticky top-0 z-(--z-sticky) flex shrink-0 items-start justify-between gap-3 border-b border-border bg-card px-4 py-3',\n local.class\n )}\n {...rest}\n >\n <div class=\"min-w-0\">\n <Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>\n <h2 id={titleId} class=\"truncate text-sm font-semibold text-foreground\">\n {local.title}\n </h2>\n {local.children}\n </div>\n <div class=\"flex shrink-0 items-center gap-1\">\n {local.actions}\n <Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </div>\n </header>","<div class={cn('min-h-0 flex-1 overflow-y-auto px-4 py-3', local.class)} {...rest}>\n {local.children}\n </div>","<div class=\"grid gap-2\">\n <h3 class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {local.title}\n </h3>\n <dl class={cn('grid gap-2', local.class)} {...rest}>\n {local.children}\n </dl>\n </div>","<div class=\"flex items-baseline justify-between gap-4 text-sm\">\n <dt class=\"text-muted-foreground\">{props.name}</dt>\n <dd class={cn('text-right', props.muted ? 'text-muted-foreground' : 'text-foreground')}>\n {props.value ?? '—'}\n </dd>\n </div>","X","LucideX","_$readShallow"],"sources":["../../../../src/components/ui/detail-panel/detail-panel.tsx"],"sourcesContent":["import { createUniqueId, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { X as LucideX } from '@lucide/solid'\nimport { Button } from '../button'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * DetailPanel.\n *\n * The companion surface to a list: something is selected over there, and its\n * detail is here. Every application grows one — an artifact, a task, a member, a\n * file, a commit — and every one of them is a header, a body, and a way to close.\n *\n * It is an `<aside>` with a label, not a `<div>`. That is the whole reason it is a\n * component: a detail panel is a *second region* next to the main content, and a\n * screen reader user needs to be able to skip to it, name it, and know when it\n * appeared. A div with a heading inside is invisible to that navigation. The\n * label is wired to the title by id, so the panel announces itself as the thing\n * it is showing rather than as \"complementary\".\n *\n * The header is sticky and the body scrolls, because a detail panel is usually\n * taller than its viewport and the close affordance must not scroll away — the\n * panel is dismissed far more often than it is read to the end.\n *\n * `DetailPanelSection` is the repeating unit of a detail body: a small caption\n * and its value. Definition-list semantics, because these are facets of one\n * subject rather than a table with columns to compare.\n */\nexport type DetailPanelProps = ComponentProps<'aside'> & {\n /** The panel's name, for its accessible label. Usually the selected item's name. */\n label: string\n}\n\nexport function DetailPanel(props: DetailPanelProps) {\n const local = props\n const rest = omit(props, 'label', 'class', 'children')\n\n return (\n <aside\n class={cn(\n 'flex h-full min-h-0 flex-col overflow-hidden border-l border-border bg-card',\n local.class\n )}\n aria-label={local.label}\n {...rest}\n >\n {local.children}\n </aside>\n )\n}\n\nexport type DetailPanelHeaderProps = ComponentProps<'header'> & {\n /** A small caption above the title: what kind of thing this is. */\n eyebrow?: string\n title: string\n /** Trailing controls, before the close button. */\n actions?: JSX.Element\n onDismiss?: () => void\n /** Accessible name for the dismiss control. Defaults to `Dismiss <title>`. */\n dismissLabel?: string\n}\n\nexport function DetailPanelHeader(props: DetailPanelHeaderProps) {\n const local = props\n const rest = omit(\n props,\n 'eyebrow',\n 'title',\n 'actions',\n 'onDismiss',\n 'dismissLabel',\n 'class',\n 'children'\n )\n const titleId = createUniqueId()\n\n return (\n <header\n class={cn(\n 'sticky top-0 z-(--z-sticky) flex shrink-0 items-start justify-between gap-3 border-b border-border bg-card px-4 py-3',\n local.class\n )}\n {...rest}\n >\n <div class=\"min-w-0\">\n <Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>\n <h2 id={titleId} class=\"truncate text-sm font-semibold text-foreground\">\n {local.title}\n </h2>\n {local.children}\n </div>\n <div class=\"flex shrink-0 items-center gap-1\">\n {local.actions}\n <Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </div>\n </header>\n )\n}\n\nexport function DetailPanelBody(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n\n return (\n <div class={cn('min-h-0 flex-1 overflow-y-auto px-4 py-3', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/**\n * A group of related facets. Renders a `<dl>`, so its children are\n * `DetailPanelField`s; a section whose content is not name/value pairs — a\n * preview, a list, a form — belongs directly in `DetailPanelBody` with its own\n * layout rather than inside this.\n */\nexport function DetailPanelSection(props: ComponentProps<'dl'> & { title: string }) {\n const local = props\n const rest = omit(props, 'title', 'class', 'children')\n\n return (\n <div class=\"grid gap-2\">\n <h3 class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {local.title}\n </h3>\n <dl class={cn('grid gap-2', local.class)} {...rest}>\n {local.children}\n </dl>\n </div>\n )\n}\n\n/**\n * One facet: a name and its value. `muted` is for a value that is absent or\n * unknown, so \"—\" reads as *no value* rather than as a value that happens to be\n * a dash.\n */\nexport function DetailPanelField(props: {\n name: string\n value?: JSX.Element\n /** Render the value in the muted colour: an absent, unknown, or inherited value. */\n muted?: boolean\n}) {\n return (\n <div class=\"flex items-baseline justify-between gap-4 text-sm\">\n <dt class=\"text-muted-foreground\">{props.name}</dt>\n <dd class={cn('text-right', props.muted ? 'text-muted-foreground' : 'text-foreground')}>\n {props.value ?? '—'}\n </dd>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,IAAMc,MAAI,SAASC,CAAO;AA6B1B,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd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|
+
{"version":3,"file":"detail-panel.js","names":["<aside\n class={cn(\n 'flex h-full min-h-0 flex-col overflow-hidden border-l border-border bg-card',\n local.class\n )}\n aria-label={local.label}\n {...rest}\n >\n {local.children}\n </aside>","<Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>","<div class=\"min-w-0\">\n <Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>\n <h2 id={titleId} class=\"truncate text-sm font-semibold text-foreground\">\n {local.title}\n </h2>\n {local.children}\n </div>","<div class=\"flex shrink-0 items-center gap-1\">\n {local.actions}\n <Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </div>","<Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>","<Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>","variant=\"ghost\"","size=\"icon-sm\"","onClick={() => dismiss()()}","<X aria-hidden=\"true\" />","<header\n class={cn(\n 'sticky top-0 z-(--z-sticky) flex shrink-0 items-start justify-between gap-3 border-b border-border bg-card px-4 py-3',\n local.class\n )}\n {...rest}\n >\n <div class=\"min-w-0\">\n <Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>\n <h2 id={titleId} class=\"truncate text-sm font-semibold text-foreground\">\n {local.title}\n </h2>\n {local.children}\n </div>\n <div class=\"flex shrink-0 items-center gap-1\">\n {local.actions}\n <Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </div>\n </header>","<div class={cn('min-h-0 flex-1 overflow-y-auto px-4 py-3', local.class)} {...rest}>\n {local.children}\n </div>","<div class=\"grid gap-2\">\n <h3 class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {local.title}\n </h3>\n <dl class={cn('grid gap-2', local.class)} {...rest}>\n {local.children}\n </dl>\n </div>","<div class=\"flex items-baseline justify-between gap-4 text-sm\">\n <dt class=\"text-muted-foreground\">{props.name}</dt>\n <dd class={cn('text-right', props.muted ? 'text-muted-foreground' : 'text-foreground')}>\n {props.value ?? '—'}\n </dd>\n </div>","LucideX","_$spread","_$insert","_$setAttribute","_$effect","_$readShallow","_$className"],"sources":["../../../../src/components/ui/detail-panel/detail-panel.tsx"],"sourcesContent":["import { createUniqueId, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { X as LucideX } from '@lucide/solid'\nimport { Button } from '../button'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * DetailPanel.\n *\n * The companion surface to a list: something is selected over there, and its\n * detail is here. Every application grows one — an artifact, a task, a member, a\n * file, a commit — and every one of them is a header, a body, and a way to close.\n *\n * It is an `<aside>` with a label, not a `<div>`. That is the whole reason it is a\n * component: a detail panel is a *second region* next to the main content, and a\n * screen reader user needs to be able to skip to it, name it, and know when it\n * appeared. A div with a heading inside is invisible to that navigation. The\n * label is wired to the title by id, so the panel announces itself as the thing\n * it is showing rather than as \"complementary\".\n *\n * The header is sticky and the body scrolls, because a detail panel is usually\n * taller than its viewport and the close affordance must not scroll away — the\n * panel is dismissed far more often than it is read to the end.\n *\n * `DetailPanelSection` is the repeating unit of a detail body: a small caption\n * and its value. Definition-list semantics, because these are facets of one\n * subject rather than a table with columns to compare.\n */\nexport type DetailPanelProps = ComponentProps<'aside'> & {\n /** The panel's name, for its accessible label. Usually the selected item's name. */\n label: string\n}\n\nexport function DetailPanel(props: DetailPanelProps) {\n const local = props\n const rest = omit(props, 'label', 'class', 'children')\n\n return (\n <aside\n class={cn(\n 'flex h-full min-h-0 flex-col overflow-hidden border-l border-border bg-card',\n local.class\n )}\n aria-label={local.label}\n {...rest}\n >\n {local.children}\n </aside>\n )\n}\n\nexport type DetailPanelHeaderProps = ComponentProps<'header'> & {\n /** A small caption above the title: what kind of thing this is. */\n eyebrow?: string\n title: string\n /** Trailing controls, before the close button. */\n actions?: JSX.Element\n onDismiss?: () => void\n /** Accessible name for the dismiss control. Defaults to `Dismiss <title>`. */\n dismissLabel?: string\n}\n\nexport function DetailPanelHeader(props: DetailPanelHeaderProps) {\n const local = props\n const rest = omit(\n props,\n 'eyebrow',\n 'title',\n 'actions',\n 'onDismiss',\n 'dismissLabel',\n 'class',\n 'children'\n )\n const titleId = createUniqueId()\n\n return (\n <header\n class={cn(\n 'sticky top-0 z-(--z-sticky) flex shrink-0 items-start justify-between gap-3 border-b border-border bg-card px-4 py-3',\n local.class\n )}\n {...rest}\n >\n <div class=\"min-w-0\">\n <Show when={local.eyebrow}>\n {(eyebrowSlot) => (\n <p class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {eyebrowSlot()}\n </p>\n )}\n </Show>\n <h2 id={titleId} class=\"truncate text-sm font-semibold text-foreground\">\n {local.title}\n </h2>\n {local.children}\n </div>\n <div class=\"flex shrink-0 items-center gap-1\">\n {local.actions}\n <Show when={local.onDismiss}>\n {(dismiss) => (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.dismissLabel ?? `Dismiss ${local.title}`}\n onClick={() => dismiss()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </div>\n </header>\n )\n}\n\nexport function DetailPanelBody(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n\n return (\n <div class={cn('min-h-0 flex-1 overflow-y-auto px-4 py-3', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/**\n * A group of related facets. Renders a `<dl>`, so its children are\n * `DetailPanelField`s; a section whose content is not name/value pairs — a\n * preview, a list, a form — belongs directly in `DetailPanelBody` with its own\n * layout rather than inside this.\n */\nexport function DetailPanelSection(props: ComponentProps<'dl'> & { title: string }) {\n const local = props\n const rest = omit(props, 'title', 'class', 'children')\n\n return (\n <div class=\"grid gap-2\">\n <h3 class=\"text-2xs font-semibold tracking-wide text-muted-foreground uppercase\">\n {local.title}\n </h3>\n <dl class={cn('grid gap-2', local.class)} {...rest}>\n {local.children}\n </dl>\n </div>\n )\n}\n\n/**\n * One facet: a name and its value. `muted` is for a value that is absent or\n * unknown, so \"—\" reads as *no value* rather than as a value that happens to be\n * a dash.\n */\nexport function DetailPanelField(props: {\n name: string\n value?: JSX.Element\n /** Render the value in the muted colour: an absent, unknown, or inherited value. */\n muted?: boolean\n}) {\n return (\n <div class=\"flex items-baseline justify-between gap-4 text-sm\">\n <dt class=\"text-muted-foreground\">{props.name}</dt>\n <dd class={cn('text-right', props.muted ? 'text-muted-foreground' : 'text-foreground')}>\n {props.value ?? '—'}\n </dd>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,IAAM,IAAI,SAASc,GAAO;AA6B1B,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,UAAU;CAGnD,IAAA,OAAA,OASO;CAHLC,OAAA,MAAA,CAAA;EALA,IAAA,UAAA;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|
2
|
+
import { createContext, onCleanup, onSettled, useContext } from "solid-js";
|
|
1
3
|
import { isKitInert, overlayScrim, overlayScrimMotion } from "../../../lib/overlay.js";
|
|
2
4
|
import { cn } from "../../../lib/utils.js";
|
|
3
5
|
import { TooltipEscapeTargetContext } from "../tooltip/tooltip.js";
|
|
4
|
-
import { className, createComponent, effect, insert, readShallow, ref, setAttribute, template } from "@solidjs/web";
|
|
5
|
-
import { createContext, onCleanup, onSettled, useContext } from "solid-js";
|
|
6
6
|
// src/components/ui/dialog/dialog-layer.tsx
|
|
7
7
|
var _tmpl$ = /* @__PURE__ */ template(`<div popover=manual>`);
|
|
8
8
|
var _tmpl$2 = /* @__PURE__ */ template(`<div aria-hidden=true data-slot=dialog-scrim>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-layer.js","names":["<TooltipEscapeTargetContext value={{ element: props.element, dismiss: () => root?.dismiss() }}>\n {props.children}\n </TooltipEscapeTargetContext>","ref={(el) => (element = el)}","<div\n ref={(el) => (element = el)}\n popover=\"manual\"\n // The browser styles a popover as a small, bordered, opaque box; the\n // positioner is a transparent window-sized grid.\n class={cn('h-auto w-auto overflow-visible border-0 bg-transparent text-inherit', props.class)}\n >\n {props.children}\n </div>","data-closed={props.open ? undefined : ''}","class={cn(overlayScrim, overlayScrimMotion, 'z-auto')}","<div\n aria-hidden=\"true\"\n data-slot=\"dialog-scrim\"\n data-expanded={props.open ? '' : undefined}\n data-closed={props.open ? undefined : ''}\n class={cn(overlayScrim, overlayScrimMotion, 'z-auto')}\n />","_$readShallow","_$setAttribute"],"sources":["../../../../src/components/ui/dialog/dialog-layer.tsx"],"sourcesContent":["import type { Accessor } from 'solid-js'\nimport type { JSX } from '@solidjs/web'\nimport { createContext, onCleanup, onSettled, useContext } from 'solid-js'\nimport { isKitInert, overlayScrim, overlayScrimMotion } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { TooltipEscapeTargetContext } from '../tooltip/tooltip'\n\n/**\n * The rules the kit's dialog-shaped layers share, on top of ui-sdk's dialog.\n * Private to the overlay kit: Dialog, AlertDialog, Sheet and Popover apply it.\n *\n * ui-sdk owns focus, Escape, outside presses, inertness and focus return: a\n * closing layer returns focus to its trigger, else to whatever had focus\n * before it opened, else to the nearest control after where the trigger was.\n * What is left here is the kit's public contract from the Kobalte era:\n *\n * 1. The content callbacks callers already pass (`onEscapeKeyDown`,\n * `onPointerDownOutside`, `onInteractOutside`, `onFocusOutside`,\n * `onOpenAutoFocus`, `onCloseAutoFocus`), each still able to\n * `preventDefault()` the dismissal or focus move it reports.\n * 2. `restoreFocusRef`, the control to return to when the opener is gone.\n * 3. An Escape a tooltip inside the layer took still closes the layer (see\n * `TooltipEscapeTargetContext`).\n */\n\n/** The event an outside-interaction callback receives, as Kobalte shaped it. */\nexport type OutsideInteractionEvent = CustomEvent<{ originalEvent: Event | undefined }>\n\nexport type LayerHandlers = {\n /** Escape is about to close the layer. `preventDefault()` keeps it open. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /** A press outside is about to close the layer. `preventDefault()` keeps it open. */\n onPointerDownOutside?: (event: OutsideInteractionEvent) => void\n /** Focus left and is about to close the layer. `preventDefault()` keeps it open. */\n onFocusOutside?: (event: OutsideInteractionEvent) => void\n /** Either of the two above. */\n onInteractOutside?: (event: OutsideInteractionEvent) => void\n /** Focus is about to move in. `preventDefault()` leaves focus where the handler put it. */\n onOpenAutoFocus?: (event: Event) => void\n /** Focus is about to return. `preventDefault()` leaves focus where the handler put it. */\n onCloseAutoFocus?: (event: Event) => void\n}\n\n/** The content props the layer consumes rather than forwards. */\nexport const layerHandlerProps = [\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n] as const\n\n/** Reads the Kobalte-era callbacks off a content's props, for `useLayerContent`. */\nexport const layerHandlers = (props: LayerHandlers) => (): LayerHandlers => ({\n onEscapeKeyDown: props.onEscapeKeyDown,\n onPointerDownOutside: props.onPointerDownOutside,\n onFocusOutside: props.onFocusOutside,\n onInteractOutside: props.onInteractOutside,\n onOpenAutoFocus: props.onOpenAutoFocus,\n onCloseAutoFocus: props.onCloseAutoFocus,\n})\n\ntype LayerChange = { reason: string; event?: Event; cancel: () => void }\n\nexport type LayerRoot = {\n /** The content registers its callbacks for the root's change handler to consult. */\n register: (handlers: () => LayerHandlers) => void\n /** Whether the content's callbacks refuse this change; the root then cancels it. */\n refuses: (open: boolean, details: LayerChange) => boolean\n /** Closes the layer as Escape would, through the same refusal check. */\n dismiss: () => void\n}\n\nexport const LayerRootContext = createContext<LayerRoot | null>(null)\n\n/**\n * Whether a focus move lands in another layer, such as a dialog opened from a\n * popover's own menu item. The layer under it stays open, as with Kobalte's\n * layer stack, where only the topmost layer dismissed on outside focus; focus\n * comes back to it when the layer above closes.\n */\nfunction focusEntersLayer(event: Event | undefined) {\n if (!(event instanceof FocusEvent)) return false\n const destination = event.type === 'focusout' ? event.relatedTarget : event.target\n return (\n destination instanceof Element &&\n destination.closest('[role=\"dialog\"], [role=\"alertdialog\"]') !== null\n )\n}\n\n/** The root half: hand `refuses` the root's `onOpenChange` details, `dismiss` closes it. */\nexport function createLayerRoot(dismiss: () => void): LayerRoot {\n let current: (() => LayerHandlers) | undefined\n return {\n register(handlers) {\n current = handlers\n onCleanup(() => {\n if (current === handlers) current = undefined\n })\n },\n refuses(open, details) {\n if (open) return false\n if (details.reason === 'focus-out' && focusEntersLayer(details.event)) return true\n if (!current) return false\n const handlers = current()\n if (details.reason === 'escape-key') {\n if (!handlers.onEscapeKeyDown) return false\n // ui-sdk has already prevented the key it handled; the callback gets\n // a fresh event so its own preventDefault() is the one that counts.\n const event = new KeyboardEvent('keydown', { key: 'Escape', cancelable: true })\n handlers.onEscapeKeyDown(event)\n return event.defaultPrevented\n }\n const outside = details.reason === 'outside-press'\n if (!outside && details.reason !== 'focus-out') return false\n const event = new CustomEvent(outside ? 'pointerdownoutside' : 'focusoutside', {\n cancelable: true,\n detail: { originalEvent: details.event },\n })\n if (outside) handlers.onPointerDownOutside?.(event)\n else handlers.onFocusOutside?.(event)\n handlers.onInteractOutside?.(event)\n return event.defaultPrevented\n },\n dismiss,\n }\n}\n\nconst FIRST_CONTROL =\n '[autofocus], button:not(:disabled), [href], input:not(:disabled):not([type=\"hidden\"]), ' +\n 'select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"]), ' +\n '[contenteditable]:not([contenteditable=\"false\"])'\n\n/** Runs a Kobalte-style autofocus callback on the content; true when it prevented the move. */\nfunction autoFocusPrevented(\n content: HTMLElement,\n type: string,\n handler: ((event: Event) => void) | undefined\n): boolean {\n if (!handler) return false\n const event = new CustomEvent(type, { cancelable: true })\n content.addEventListener(type, handler, { once: true })\n content.dispatchEvent(event)\n content.removeEventListener(type, handler)\n return event.defaultPrevented\n}\n\n/** Focus the handler moved somewhere outside the content, if it did. */\nfunction focusMovedOut(content: HTMLElement): HTMLElement | undefined {\n const active = content.ownerDocument.activeElement\n return active instanceof HTMLElement &&\n active !== content.ownerDocument.body &&\n !content.contains(active)\n ? active\n : undefined\n}\n\n/**\n * Where a prevented open autofocus leaves focus: wherever the handler put it,\n * inside the content (a chosen control) or outside it, as Kobalte left it.\n * Answering with that element ends ui-sdk's own search; only a handler that\n * left focus on `<body>` falls through to ui-sdk's default.\n */\nfunction focusLeftByHandler(content: HTMLElement): HTMLElement | undefined {\n const active = content.ownerDocument.activeElement\n return active instanceof HTMLElement && active !== content.ownerDocument.body ? active : undefined\n}\n\n/**\n * Works around a ui-sdk 0.1.0-beta.13 bug: a modal layer inerts the page\n * element by element (so live regions stay reachable) and ref-counts each one.\n * An element the app itself makes inert while the layer is open is one ui-sdk\n * already holds, so the app's write changes nothing ui-sdk can see, and on\n * close ui-sdk clears `inert` the app still wants. Focus could then return to\n * an opener the app had disabled. (Kobalte hid the page with `aria-hidden` and\n * never touched `inert`.) See ui-notes/ui-sdk-issue-inert.md.\n *\n * The guard records an `inert` write made over an existing `inert` (ui-sdk only\n * ever sets it on elements that lack it), and once the layer starts closing it\n * puts `inert` back on each of those the moment ui-sdk clears it. Drop it once\n * ui-sdk keeps app-set inertness itself.\n */\nfunction guardAppInert(content: HTMLElement) {\n const doc = content.ownerDocument\n const reasserted = new Set<Element>()\n let closing: Set<Element> | undefined\n const restore = () => {\n for (const element of closing ?? [])\n if (element.isConnected && !element.hasAttribute('inert')) element.setAttribute('inert', '')\n }\n const startClosing = () => {\n closing ??= new Set(reasserted)\n restore()\n return closing\n }\n // Records arrive in order, so the content losing `data-open` (ui-sdk's close)\n // separates the app's writes from ui-sdk's release that follows it. A layer\n // unmounted while open releases the page in its own cleanup, so records still\n // pending when the content goes (`final`) cannot be the app clearing `inert`.\n const read = (records: MutationRecord[], final = false) => {\n for (const record of records) {\n const element = record.target as Element\n if (element === content) {\n if (!content.hasAttribute('data-open') || record.attributeName === 'data-closed')\n startClosing()\n continue\n }\n if (closing || record.oldValue === null) continue\n // `oldValue` is set: `inert` was already there. Its state now says whether\n // this was a write over it (the app's) or a removal.\n if (isKitInert(element)) continue\n if (record.attributeName === 'inert' && element.hasAttribute('inert')) reasserted.add(element)\n else if (!final) reasserted.delete(element)\n }\n restore()\n }\n const observer = new MutationObserver((records) => read(records))\n observer.observe(doc, {\n subtree: true,\n attributes: true,\n attributeFilter: ['inert', 'data-open', 'data-closed'],\n attributeOldValue: true,\n })\n return {\n /** The layer is closing: from now on, keep what the app made inert. */\n close() {\n read(observer.takeRecords(), true)\n return startClosing()\n },\n stop() {\n read(observer.takeRecords())\n observer.disconnect()\n },\n }\n}\n\nexport type LayerContentOptions = {\n /** The content element, once it is on the page. */\n content: Accessor<HTMLElement | undefined>\n handlers: () => LayerHandlers\n /** `panel` focuses the content itself on open instead of its first control. */\n initialFocus?: () => 'first-control' | 'panel' | undefined\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\n/**\n * The content half: registers the callbacks with the root and returns the\n * `initialFocus` and `finalFocus` values to give ui-sdk's content part.\n */\nexport function useLayerContent(options: LayerContentOptions) {\n const root = useContext(LayerRootContext)\n root?.register(options.handlers)\n\n const initialFocus = () => {\n const panel = options.initialFocus?.() === 'panel'\n const handler = options.handlers().onOpenAutoFocus\n if (!handler) return panel ? ('content' as const) : ('auto' as const)\n return () => {\n const content = options.content()\n if (!content) return undefined\n if (autoFocusPrevented(content, 'openautofocus', handler)) return focusLeftByHandler(content)\n if (panel) return content\n return content.querySelector<HTMLElement>(FIRST_CONTROL) ?? content\n }\n }\n\n // Read when focus returns. Undefined falls through to ui-sdk's own chain\n // (the trigger, then the element focused before the layer opened, then the\n // nearest control after where the trigger was).\n let inertGuard: ReturnType<typeof guardAppInert> | undefined\n onSettled(() => {\n const content = options.content()\n if (!content) return\n const guard = (inertGuard = guardAppInert(content))\n return () => {\n guard.close()\n // ui-sdk may release the page after the content unmounts; keep the guard\n // until that task has run.\n setTimeout(() => guard.stop())\n }\n })\n\n const returnTarget = () => {\n // An element the app made inert stays inert, so ui-sdk's focus chain (which\n // skips inert elements) passes it over.\n inertGuard?.close()\n const fallback = options.restoreFocusRef?.()\n const content = options.content()\n if (\n content &&\n autoFocusPrevented(content, 'closeautofocus', options.handlers().onCloseAutoFocus)\n )\n return focusMovedOut(content)\n return fallback\n }\n const finalFocus = () => returnTarget\n\n return { initialFocus, finalFocus }\n}\n\n/**\n * Lets an Escape swallowed by a tooltip inside the layer close the layer. The\n * close goes through the root's refusal check, so the content's own\n * `onEscapeKeyDown` sees it first and a layer that blocks Escape (a dirty\n * form, a save in flight) stays blocked.\n */\nexport function LayerEscapeTarget(props: {\n element: Accessor<HTMLElement | undefined>\n children?: JSX.Element\n}) {\n const root = useContext(LayerRootContext)\n return (\n <TooltipEscapeTargetContext value={{ element: props.element, dismiss: () => root?.dismiss() }}>\n {props.children}\n </TooltipEscapeTargetContext>\n )\n}\n\n/**\n * A centred layer's positioner, shown in the browser's top layer.\n *\n * ui-sdk shows a dialog's content in the top layer itself, where its\n * containing block is always the viewport. The kit's panels are sized against\n * a positioner instead: `max-h-full` is the window less its 1rem inset, and\n * callers pass `h-full`, `max-h-full` and `w-full` relying on it. So the\n * content renders `inline` inside this element, and this element is the one\n * promoted to the top layer: it still stacks above a popover the dialog was\n * opened from, and a toast region (a ui-sdk persistent layer) re-raises itself\n * above it, as it did above Kobalte's `--z-dialog`. The z-index stays for an\n * engine without the popover API.\n */\nexport function TopLayerPositioner(props: { class?: string; children?: JSX.Element }) {\n let element: HTMLDivElement | undefined\n onSettled(() => {\n const el = element\n if (!el || typeof el.showPopover !== 'function') return\n try {\n el.showPopover()\n } catch {\n return\n }\n return () => {\n try {\n el.hidePopover()\n } catch {\n // Already hidden, or already out of the page.\n }\n }\n })\n return (\n <div\n ref={(el) => (element = el)}\n popover=\"manual\"\n // The browser styles a popover as a small, bordered, opaque box; the\n // positioner is a transparent window-sized grid.\n class={cn('h-auto w-auto overflow-visible border-0 bg-transparent text-inherit', props.class)}\n >\n {props.children}\n </div>\n )\n}\n\n/**\n * The scrim inside a centred layer's positioner. It sits behind the panel in\n * the positioner's own stacking context, so it drops the shared scrim's\n * z-index: a positive one there would paint it over the panel. It is not a\n * ui-sdk backdrop part, which would take a top-layer slot of its own below the\n * positioner; a press on it lands on the positioner, outside the panel.\n */\nexport function DialogScrim(props: { open: boolean }) {\n return (\n <div\n aria-hidden=\"true\"\n data-slot=\"dialog-scrim\"\n data-expanded={props.open ? '' : undefined}\n data-closed={props.open ? undefined : ''}\n class={cn(overlayScrim, overlayScrimMotion, 'z-auto')}\n />\n )\n}\n"],"mappings":";;;;;;;;;AA4CA,IAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,IAAa,iBAAiB,iBAA+C;CAC3E,iBAAiB,MAAM;CACvB,sBAAsB,MAAM;CAC5B,gBAAgB,MAAM;CACtB,mBAAmB,MAAM;CACzB,iBAAiB,MAAM;CACvB,kBAAkB,MAAM;AAC1B;AAaA,IAAa,mBAAmB,cA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xC,OACEA,gBAAAA,4BAAAA;EAA4B,IAAA,QAAA;GAAO,OAAA;IAAE,SAAS,MAAM;IAAS,eAAe,MAAM,QAAQ;GAAE;EAAC;EAA7F,IAAA,WAAA;GACG,OAAA,MAAM;EACmB;;AAEhC;;;;;;;;;;;;;;AAeA,SAAgB,mBAAmB,OAAmD;CACpF,IAAI;CACJ,gBAAgB;EACd,MAAM,KAAK;EACX,IAAI,CAAC,MAAM,OAAO,GAAG,gBAAgB,YAAY;EACjD,IAAI;GACF,GAAG,YAAY;EACjB,QAAQ;GACN;EACF;EACA,aAAa;GACX,IAAI;IACF,GAAG,YAAY;GACjB,QAAQ,CAER;EACF;CACF,CAAC;CAEC,IAAA,OAAA,OAQK;CAPH,UAAA;EAAM,QAAA,OAAQ,UAAU;CAAG,GAA3BC,IAA2B;CAD7B,OAAA,YAOE;EAAC,OAAA,MAAM;CAAQ,CACZ;CAHH,aAAAK,YAAO,GAAG,uEAAuE,MAAM,KAAK,CAAC,IAA7F,KAAA,QAAA;EAA6F,UAAA,MAAA,KAAA,GAAA;;CANjG,OACEJ;AAUJ;;;;;;;;AASA,SAAgB,YAAY,OAA0B;CAElD,IAAA,QAAA,QAMC;CAHC,aAAA;;GAAe,GAAA,MAAM,OAAO,KAAK,KAAA;GACjCC,GAAa,MAAM,OAAO,KAAA,IAAY;GACtCC,GAAAA,YAAO,GAAG,cAAc,oBAAoB,QAAQ,CAAC;EAFX;CAA1C,IAAA,EAAA,GAAA,GAAA,KAAA,QAAA;EAA0C,MAAA,KAAA,KAAAG,aAAA,OAAA,iBAAA,CAAA;EAC1C,MAAA,KAAA,KAAAA,aAAA,OAAA,eAAA,CAAwC;EACxC,UAAA,OAAA,GAAA,KAAA,CAAqD;CAFX,CAAA;CAJ9C,OACEF;AAQJ"}
|
|
1
|
+
{"version":3,"file":"dialog-layer.js","names":["<TooltipEscapeTargetContext value={{ element: props.element, dismiss: () => root?.dismiss() }}>\n {props.children}\n </TooltipEscapeTargetContext>","ref={(el) => (element = el)}","<div\n ref={(el) => (element = el)}\n popover=\"manual\"\n // The browser styles a popover as a small, bordered, opaque box; the\n // positioner is a transparent window-sized grid.\n class={cn('h-auto w-auto overflow-visible border-0 bg-transparent text-inherit', props.class)}\n >\n {props.children}\n </div>","data-closed={props.open ? undefined : ''}","class={cn(overlayScrim, overlayScrimMotion, 'z-auto')}","<div\n aria-hidden=\"true\"\n data-slot=\"dialog-scrim\"\n data-expanded={props.open ? '' : undefined}\n data-closed={props.open ? undefined : ''}\n class={cn(overlayScrim, overlayScrimMotion, 'z-auto')}\n />","_$ref","_$insert","_$effect","_$readShallow","_$className","_$setAttribute"],"sources":["../../../../src/components/ui/dialog/dialog-layer.tsx"],"sourcesContent":["import type { Accessor } from 'solid-js'\nimport type { JSX } from '@solidjs/web'\nimport { createContext, onCleanup, onSettled, useContext } from 'solid-js'\nimport { isKitInert, overlayScrim, overlayScrimMotion } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { TooltipEscapeTargetContext } from '../tooltip/tooltip'\n\n/**\n * The rules the kit's dialog-shaped layers share, on top of ui-sdk's dialog.\n * Private to the overlay kit: Dialog, AlertDialog, Sheet and Popover apply it.\n *\n * ui-sdk owns focus, Escape, outside presses, inertness and focus return: a\n * closing layer returns focus to its trigger, else to whatever had focus\n * before it opened, else to the nearest control after where the trigger was.\n * What is left here is the kit's public contract from the Kobalte era:\n *\n * 1. The content callbacks callers already pass (`onEscapeKeyDown`,\n * `onPointerDownOutside`, `onInteractOutside`, `onFocusOutside`,\n * `onOpenAutoFocus`, `onCloseAutoFocus`), each still able to\n * `preventDefault()` the dismissal or focus move it reports.\n * 2. `restoreFocusRef`, the control to return to when the opener is gone.\n * 3. An Escape a tooltip inside the layer took still closes the layer (see\n * `TooltipEscapeTargetContext`).\n */\n\n/** The event an outside-interaction callback receives, as Kobalte shaped it. */\nexport type OutsideInteractionEvent = CustomEvent<{ originalEvent: Event | undefined }>\n\nexport type LayerHandlers = {\n /** Escape is about to close the layer. `preventDefault()` keeps it open. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /** A press outside is about to close the layer. `preventDefault()` keeps it open. */\n onPointerDownOutside?: (event: OutsideInteractionEvent) => void\n /** Focus left and is about to close the layer. `preventDefault()` keeps it open. */\n onFocusOutside?: (event: OutsideInteractionEvent) => void\n /** Either of the two above. */\n onInteractOutside?: (event: OutsideInteractionEvent) => void\n /** Focus is about to move in. `preventDefault()` leaves focus where the handler put it. */\n onOpenAutoFocus?: (event: Event) => void\n /** Focus is about to return. `preventDefault()` leaves focus where the handler put it. */\n onCloseAutoFocus?: (event: Event) => void\n}\n\n/** The content props the layer consumes rather than forwards. */\nexport const layerHandlerProps = [\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n] as const\n\n/** Reads the Kobalte-era callbacks off a content's props, for `useLayerContent`. */\nexport const layerHandlers = (props: LayerHandlers) => (): LayerHandlers => ({\n onEscapeKeyDown: props.onEscapeKeyDown,\n onPointerDownOutside: props.onPointerDownOutside,\n onFocusOutside: props.onFocusOutside,\n onInteractOutside: props.onInteractOutside,\n onOpenAutoFocus: props.onOpenAutoFocus,\n onCloseAutoFocus: props.onCloseAutoFocus,\n})\n\ntype LayerChange = { reason: string; event?: Event; cancel: () => void }\n\nexport type LayerRoot = {\n /** The content registers its callbacks for the root's change handler to consult. */\n register: (handlers: () => LayerHandlers) => void\n /** Whether the content's callbacks refuse this change; the root then cancels it. */\n refuses: (open: boolean, details: LayerChange) => boolean\n /** Closes the layer as Escape would, through the same refusal check. */\n dismiss: () => void\n}\n\nexport const LayerRootContext = createContext<LayerRoot | null>(null)\n\n/**\n * Whether a focus move lands in another layer, such as a dialog opened from a\n * popover's own menu item. The layer under it stays open, as with Kobalte's\n * layer stack, where only the topmost layer dismissed on outside focus; focus\n * comes back to it when the layer above closes.\n */\nfunction focusEntersLayer(event: Event | undefined) {\n if (!(event instanceof FocusEvent)) return false\n const destination = event.type === 'focusout' ? event.relatedTarget : event.target\n return (\n destination instanceof Element &&\n destination.closest('[role=\"dialog\"], [role=\"alertdialog\"]') !== null\n )\n}\n\n/** The root half: hand `refuses` the root's `onOpenChange` details, `dismiss` closes it. */\nexport function createLayerRoot(dismiss: () => void): LayerRoot {\n let current: (() => LayerHandlers) | undefined\n return {\n register(handlers) {\n current = handlers\n onCleanup(() => {\n if (current === handlers) current = undefined\n })\n },\n refuses(open, details) {\n if (open) return false\n if (details.reason === 'focus-out' && focusEntersLayer(details.event)) return true\n if (!current) return false\n const handlers = current()\n if (details.reason === 'escape-key') {\n if (!handlers.onEscapeKeyDown) return false\n // ui-sdk has already prevented the key it handled; the callback gets\n // a fresh event so its own preventDefault() is the one that counts.\n const event = new KeyboardEvent('keydown', { key: 'Escape', cancelable: true })\n handlers.onEscapeKeyDown(event)\n return event.defaultPrevented\n }\n const outside = details.reason === 'outside-press'\n if (!outside && details.reason !== 'focus-out') return false\n const event = new CustomEvent(outside ? 'pointerdownoutside' : 'focusoutside', {\n cancelable: true,\n detail: { originalEvent: details.event },\n })\n if (outside) handlers.onPointerDownOutside?.(event)\n else handlers.onFocusOutside?.(event)\n handlers.onInteractOutside?.(event)\n return event.defaultPrevented\n },\n dismiss,\n }\n}\n\nconst FIRST_CONTROL =\n '[autofocus], button:not(:disabled), [href], input:not(:disabled):not([type=\"hidden\"]), ' +\n 'select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"]), ' +\n '[contenteditable]:not([contenteditable=\"false\"])'\n\n/** Runs a Kobalte-style autofocus callback on the content; true when it prevented the move. */\nfunction autoFocusPrevented(\n content: HTMLElement,\n type: string,\n handler: ((event: Event) => void) | undefined\n): boolean {\n if (!handler) return false\n const event = new CustomEvent(type, { cancelable: true })\n content.addEventListener(type, handler, { once: true })\n content.dispatchEvent(event)\n content.removeEventListener(type, handler)\n return event.defaultPrevented\n}\n\n/** Focus the handler moved somewhere outside the content, if it did. */\nfunction focusMovedOut(content: HTMLElement): HTMLElement | undefined {\n const active = content.ownerDocument.activeElement\n return active instanceof HTMLElement &&\n active !== content.ownerDocument.body &&\n !content.contains(active)\n ? active\n : undefined\n}\n\n/**\n * Where a prevented open autofocus leaves focus: wherever the handler put it,\n * inside the content (a chosen control) or outside it, as Kobalte left it.\n * Answering with that element ends ui-sdk's own search; only a handler that\n * left focus on `<body>` falls through to ui-sdk's default.\n */\nfunction focusLeftByHandler(content: HTMLElement): HTMLElement | undefined {\n const active = content.ownerDocument.activeElement\n return active instanceof HTMLElement && active !== content.ownerDocument.body ? active : undefined\n}\n\n/**\n * Works around a ui-sdk 0.1.0-beta.13 bug: a modal layer inerts the page\n * element by element (so live regions stay reachable) and ref-counts each one.\n * An element the app itself makes inert while the layer is open is one ui-sdk\n * already holds, so the app's write changes nothing ui-sdk can see, and on\n * close ui-sdk clears `inert` the app still wants. Focus could then return to\n * an opener the app had disabled. (Kobalte hid the page with `aria-hidden` and\n * never touched `inert`.) See ui-notes/ui-sdk-issue-inert.md.\n *\n * The guard records an `inert` write made over an existing `inert` (ui-sdk only\n * ever sets it on elements that lack it), and once the layer starts closing it\n * puts `inert` back on each of those the moment ui-sdk clears it. Drop it once\n * ui-sdk keeps app-set inertness itself.\n */\nfunction guardAppInert(content: HTMLElement) {\n const doc = content.ownerDocument\n const reasserted = new Set<Element>()\n let closing: Set<Element> | undefined\n const restore = () => {\n for (const element of closing ?? [])\n if (element.isConnected && !element.hasAttribute('inert')) element.setAttribute('inert', '')\n }\n const startClosing = () => {\n closing ??= new Set(reasserted)\n restore()\n return closing\n }\n // Records arrive in order, so the content losing `data-open` (ui-sdk's close)\n // separates the app's writes from ui-sdk's release that follows it. A layer\n // unmounted while open releases the page in its own cleanup, so records still\n // pending when the content goes (`final`) cannot be the app clearing `inert`.\n const read = (records: MutationRecord[], final = false) => {\n for (const record of records) {\n const element = record.target as Element\n if (element === content) {\n if (!content.hasAttribute('data-open') || record.attributeName === 'data-closed')\n startClosing()\n continue\n }\n if (closing || record.oldValue === null) continue\n // `oldValue` is set: `inert` was already there. Its state now says whether\n // this was a write over it (the app's) or a removal.\n if (isKitInert(element)) continue\n if (record.attributeName === 'inert' && element.hasAttribute('inert')) reasserted.add(element)\n else if (!final) reasserted.delete(element)\n }\n restore()\n }\n const observer = new MutationObserver((records) => read(records))\n observer.observe(doc, {\n subtree: true,\n attributes: true,\n attributeFilter: ['inert', 'data-open', 'data-closed'],\n attributeOldValue: true,\n })\n return {\n /** The layer is closing: from now on, keep what the app made inert. */\n close() {\n read(observer.takeRecords(), true)\n return startClosing()\n },\n stop() {\n read(observer.takeRecords())\n observer.disconnect()\n },\n }\n}\n\nexport type LayerContentOptions = {\n /** The content element, once it is on the page. */\n content: Accessor<HTMLElement | undefined>\n handlers: () => LayerHandlers\n /** `panel` focuses the content itself on open instead of its first control. */\n initialFocus?: () => 'first-control' | 'panel' | undefined\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\n/**\n * The content half: registers the callbacks with the root and returns the\n * `initialFocus` and `finalFocus` values to give ui-sdk's content part.\n */\nexport function useLayerContent(options: LayerContentOptions) {\n const root = useContext(LayerRootContext)\n root?.register(options.handlers)\n\n const initialFocus = () => {\n const panel = options.initialFocus?.() === 'panel'\n const handler = options.handlers().onOpenAutoFocus\n if (!handler) return panel ? ('content' as const) : ('auto' as const)\n return () => {\n const content = options.content()\n if (!content) return undefined\n if (autoFocusPrevented(content, 'openautofocus', handler)) return focusLeftByHandler(content)\n if (panel) return content\n return content.querySelector<HTMLElement>(FIRST_CONTROL) ?? content\n }\n }\n\n // Read when focus returns. Undefined falls through to ui-sdk's own chain\n // (the trigger, then the element focused before the layer opened, then the\n // nearest control after where the trigger was).\n let inertGuard: ReturnType<typeof guardAppInert> | undefined\n onSettled(() => {\n const content = options.content()\n if (!content) return\n const guard = (inertGuard = guardAppInert(content))\n return () => {\n guard.close()\n // ui-sdk may release the page after the content unmounts; keep the guard\n // until that task has run.\n setTimeout(() => guard.stop())\n }\n })\n\n const returnTarget = () => {\n // An element the app made inert stays inert, so ui-sdk's focus chain (which\n // skips inert elements) passes it over.\n inertGuard?.close()\n const fallback = options.restoreFocusRef?.()\n const content = options.content()\n if (\n content &&\n autoFocusPrevented(content, 'closeautofocus', options.handlers().onCloseAutoFocus)\n )\n return focusMovedOut(content)\n return fallback\n }\n const finalFocus = () => returnTarget\n\n return { initialFocus, finalFocus }\n}\n\n/**\n * Lets an Escape swallowed by a tooltip inside the layer close the layer. The\n * close goes through the root's refusal check, so the content's own\n * `onEscapeKeyDown` sees it first and a layer that blocks Escape (a dirty\n * form, a save in flight) stays blocked.\n */\nexport function LayerEscapeTarget(props: {\n element: Accessor<HTMLElement | undefined>\n children?: JSX.Element\n}) {\n const root = useContext(LayerRootContext)\n return (\n <TooltipEscapeTargetContext value={{ element: props.element, dismiss: () => root?.dismiss() }}>\n {props.children}\n </TooltipEscapeTargetContext>\n )\n}\n\n/**\n * A centred layer's positioner, shown in the browser's top layer.\n *\n * ui-sdk shows a dialog's content in the top layer itself, where its\n * containing block is always the viewport. The kit's panels are sized against\n * a positioner instead: `max-h-full` is the window less its 1rem inset, and\n * callers pass `h-full`, `max-h-full` and `w-full` relying on it. So the\n * content renders `inline` inside this element, and this element is the one\n * promoted to the top layer: it still stacks above a popover the dialog was\n * opened from, and a toast region (a ui-sdk persistent layer) re-raises itself\n * above it, as it did above Kobalte's `--z-dialog`. The z-index stays for an\n * engine without the popover API.\n */\nexport function TopLayerPositioner(props: { class?: string; children?: JSX.Element }) {\n let element: HTMLDivElement | undefined\n onSettled(() => {\n const el = element\n if (!el || typeof el.showPopover !== 'function') return\n try {\n el.showPopover()\n } catch {\n return\n }\n return () => {\n try {\n el.hidePopover()\n } catch {\n // Already hidden, or already out of the page.\n }\n }\n })\n return (\n <div\n ref={(el) => (element = el)}\n popover=\"manual\"\n // The browser styles a popover as a small, bordered, opaque box; the\n // positioner is a transparent window-sized grid.\n class={cn('h-auto w-auto overflow-visible border-0 bg-transparent text-inherit', props.class)}\n >\n {props.children}\n </div>\n )\n}\n\n/**\n * The scrim inside a centred layer's positioner. It sits behind the panel in\n * the positioner's own stacking context, so it drops the shared scrim's\n * z-index: a positive one there would paint it over the panel. It is not a\n * ui-sdk backdrop part, which would take a top-layer slot of its own below the\n * positioner; a press on it lands on the positioner, outside the panel.\n */\nexport function DialogScrim(props: { open: boolean }) {\n return (\n <div\n aria-hidden=\"true\"\n data-slot=\"dialog-scrim\"\n data-expanded={props.open ? '' : undefined}\n data-closed={props.open ? undefined : ''}\n class={cn(overlayScrim, overlayScrimMotion, 'z-auto')}\n />\n )\n}\n"],"mappings":";;;;;;;;;AA4CA,IAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,IAAa,iBAAiB,iBAA+C;CAC3E,iBAAiB,MAAM;CACvB,sBAAsB,MAAM;CAC5B,gBAAgB,MAAM;CACtB,mBAAmB,MAAM;CACzB,iBAAiB,MAAM;CACvB,kBAAkB,MAAM;AAC1B;AAaA,IAAa,mBAAmB,cAAgC,IAAI;;;;;;;AAQpE,SAAS,iBAAiB,OAA0B;CAClD,IAAI,EAAE,iBAAiB,aAAa,OAAO;CAC3C,MAAM,cAAc,MAAM,SAAS,aAAa,MAAM,gBAAgB,MAAM;CAC5E,OACE,uBAAuB,WACvB,YAAY,QAAQ,2CAAuC,MAAM;AAErE;;AAGA,SAAgB,gBAAgB,SAAgC;CAC9D,IAAI;CACJ,OAAO;EACL,SAAS,UAAU;GACjB,UAAU;GACV,gBAAgB;IACd,IAAI,YAAY,UAAU,UAAU,KAAA;GACtC,CAAC;EACH;EACA,QAAQ,MAAM,SAAS;GACrB,IAAI,MAAM,OAAO;GACjB,IAAI,QAAQ,WAAW,eAAe,iBAAiB,QAAQ,KAAK,GAAG,OAAO;GAC9E,IAAI,CAAC,SAAS,OAAO;GACrB,MAAM,WAAW,QAAQ;GACzB,IAAI,QAAQ,WAAW,cAAc;IACnC,IAAI,CAAC,SAAS,iBAAiB,OA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EAAuE,MAAM,KAAK,CAAC,IAA7F,KAAA,QAAA;EAA6FC,UAAA,MAAA,KAAA,GAAA;;CANjG,OACER;AAUJ;;;;;;;;AASA,SAAgB,YAAY,OAA0B;CAElD,IAAA,QAAA,QAMC;CAHCM,aAAA;;GAAe,GAAA,MAAM,OAAO,KAAK,KAAA;GACjCL,GAAa,MAAM,OAAO,KAAA,IAAY;GACtCC,GAAAA,YAAO,GAAG,cAAc,oBAAoB,QAAQ,CAAC;EAFX;CAA1C,IAAA,EAAA,GAAA,GAAA,KAAA,QAAA;EAA0C,MAAA,KAAA,KAAAO,aAAA,OAAA,iBAAA,CAAA;EAC1C,MAAA,KAAA,KAAAA,aAAA,OAAA,eAAA,CAAwC;EACxCD,UAAA,OAAA,GAAA,KAAA,CAAqD;CAFX,CAAA;CAJ9C,OACEL;AAQJ"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Portal, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
2
|
+
import { Dialog as Dialog$1, DialogBackdrop, DialogClose as DialogClose$1, DialogContent as DialogContent$1, DialogDescription as DialogDescription$1, DialogTitle as DialogTitle$1, DialogTrigger as DialogTrigger$1, createDialogController } from "@ui-sdk/solid/dialog";
|
|
3
|
+
import { X as X$1 } from "@lucide/solid";
|
|
4
|
+
import { Show, children, omit } from "solid-js";
|
|
1
5
|
import { dialogSurface, overlayCornerClose, overlayDescription, overlayFooter, overlayHeader, overlayMotion, overlayPositioner, overlayScrim, overlayScrimMotion, overlayTitle } from "../../../lib/overlay.js";
|
|
2
6
|
import { cn } from "../../../lib/utils.js";
|
|
3
7
|
import { Tooltip, TooltipContent, TooltipTrigger, asRender, expandedDiv, overlayContainer, triggerRender } from "../tooltip/tooltip.js";
|
|
4
8
|
import { DialogScrim, LayerEscapeTarget, LayerRootContext, TopLayerPositioner, createLayerRoot, layerHandlerProps, layerHandlers, useLayerContent } from "./dialog-layer.js";
|
|
5
9
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
6
10
|
import { forwardRef } from "../../../lib/refs.js";
|
|
7
|
-
import { Portal, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
8
|
-
import { X } from "@lucide/solid";
|
|
9
|
-
import { Show, children, omit } from "solid-js";
|
|
10
|
-
import { Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, createDialogController } from "@ui-sdk/solid/dialog";
|
|
11
11
|
// src/components/ui/dialog/dialog.tsx
|
|
12
12
|
var _tmpl$ = /* @__PURE__ */ template(`<button>`);
|
|
13
13
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
14
|
-
var X
|
|
14
|
+
var X = fastIcon(X$1);
|
|
15
15
|
/** The options a Kobalte-era root took that ui-sdk's root does not. */
|
|
16
16
|
var legacyRootProps = [
|
|
17
17
|
"preventScroll",
|
|
@@ -19,11 +19,11 @@ var legacyRootProps = [
|
|
|
19
19
|
"id",
|
|
20
20
|
"translations"
|
|
21
21
|
];
|
|
22
|
-
function Dialog
|
|
22
|
+
function Dialog(props) {
|
|
23
23
|
const controller = createDialogController();
|
|
24
24
|
const layer = createLayerRoot(() => controller.close({ reason: "escape-key" }));
|
|
25
25
|
const rest = omit(props, "children", "onOpenChange", ...legacyRootProps);
|
|
26
|
-
return createComponent(Dialog, mergeProps({ closeOnOutsidePress: true }, rest, {
|
|
26
|
+
return createComponent(Dialog$1, mergeProps({ closeOnOutsidePress: true }, rest, {
|
|
27
27
|
controller,
|
|
28
28
|
onOpenChange: (open, details) => {
|
|
29
29
|
if (layer.refuses(open, details)) return details.cancel();
|
|
@@ -39,8 +39,8 @@ function Dialog$1(props) {
|
|
|
39
39
|
}
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
|
-
function DialogTrigger
|
|
43
|
-
return createComponent(DialogTrigger, mergeProps(() => {
|
|
42
|
+
function DialogTrigger(props) {
|
|
43
|
+
return createComponent(DialogTrigger$1, mergeProps(() => {
|
|
44
44
|
return omit(props, "as");
|
|
45
45
|
}, { get render() {
|
|
46
46
|
return triggerRender(props.as, "button", () => props["data-slot"]);
|
|
@@ -79,7 +79,7 @@ var dialogContentSizes = {
|
|
|
79
79
|
lg: "max-w-2xl",
|
|
80
80
|
xl: "max-w-3xl"
|
|
81
81
|
};
|
|
82
|
-
function DialogContent
|
|
82
|
+
function DialogContent(props) {
|
|
83
83
|
let panel;
|
|
84
84
|
const rest = omit(props, "class", "children", "closeButton", "closeLabel", "positioner", "size", "initialFocus", "restoreFocusRef", "ref", ...layerHandlerProps);
|
|
85
85
|
const focus = useLayerContent({
|
|
@@ -94,7 +94,7 @@ function DialogContent$1(props) {
|
|
|
94
94
|
return overlayContainer();
|
|
95
95
|
},
|
|
96
96
|
get children() {
|
|
97
|
-
return createComponent(DialogContent, mergeProps({
|
|
97
|
+
return createComponent(DialogContent$1, mergeProps({
|
|
98
98
|
inline: true,
|
|
99
99
|
ref: (element) => {
|
|
100
100
|
panel = element;
|
|
@@ -140,7 +140,7 @@ function DialogContent$1(props) {
|
|
|
140
140
|
},
|
|
141
141
|
class: overlayCornerClose,
|
|
142
142
|
get children() {
|
|
143
|
-
return closeButton() ?? createComponent(X
|
|
143
|
+
return closeButton() ?? createComponent(X, { class: "size-4" });
|
|
144
144
|
}
|
|
145
145
|
}), createComponent(TooltipContent, { get children() {
|
|
146
146
|
return memo(() => {
|
|
@@ -158,7 +158,7 @@ function DialogContent$1(props) {
|
|
|
158
158
|
}
|
|
159
159
|
/** The corner close: a dialog Close part that keeps its own slot name for the kit's tests and styles. */
|
|
160
160
|
function CornerClose(props) {
|
|
161
|
-
return createComponent(DialogClose, mergeProps(props, { render: (closeProps) => (() => {
|
|
161
|
+
return createComponent(DialogClose$1, mergeProps(props, { render: (closeProps) => (() => {
|
|
162
162
|
var _el$ = _tmpl$();
|
|
163
163
|
spread(_el$, [closeProps, { "data-slot": "dialog-corner-close" }], false);
|
|
164
164
|
return _el$;
|
|
@@ -193,8 +193,8 @@ function DialogFooter(props) {
|
|
|
193
193
|
}, rest], false);
|
|
194
194
|
return _el$3;
|
|
195
195
|
}
|
|
196
|
-
function DialogTitle
|
|
197
|
-
return createComponent(DialogTitle, mergeProps({
|
|
196
|
+
function DialogTitle(props) {
|
|
197
|
+
return createComponent(DialogTitle$1, mergeProps({
|
|
198
198
|
get "class"() {
|
|
199
199
|
return cn(overlayTitle, props.class);
|
|
200
200
|
},
|
|
@@ -205,8 +205,8 @@ function DialogTitle$1(props) {
|
|
|
205
205
|
return omit(props, "class", "as");
|
|
206
206
|
}));
|
|
207
207
|
}
|
|
208
|
-
function DialogDescription
|
|
209
|
-
return createComponent(DialogDescription, mergeProps({
|
|
208
|
+
function DialogDescription(props) {
|
|
209
|
+
return createComponent(DialogDescription$1, mergeProps({
|
|
210
210
|
get "class"() {
|
|
211
211
|
return cn(overlayDescription, props.class);
|
|
212
212
|
},
|
|
@@ -223,8 +223,8 @@ function DialogDescription$1(props) {
|
|
|
223
223
|
* content draws. Take it as `as={Button}` so it carries the button's variants
|
|
224
224
|
* rather than a copied class string.
|
|
225
225
|
*/
|
|
226
|
-
function DialogClose
|
|
227
|
-
return createComponent(DialogClose, mergeProps({
|
|
226
|
+
function DialogClose(props) {
|
|
227
|
+
return createComponent(DialogClose$1, mergeProps({
|
|
228
228
|
get "class"() {
|
|
229
229
|
return cn("focus-ring", props.class);
|
|
230
230
|
},
|
|
@@ -236,7 +236,7 @@ function DialogClose$1(props) {
|
|
|
236
236
|
}));
|
|
237
237
|
}
|
|
238
238
|
/** The earlier name for `DialogClose`. */
|
|
239
|
-
var DialogCloseButton = DialogClose
|
|
240
|
-
export { Dialog
|
|
239
|
+
var DialogCloseButton = DialogClose;
|
|
240
|
+
export { Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogContentSizes };
|
|
241
241
|
|
|
242
242
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":["<UiDialog\n // A non-modal dialog closed on an outside press under Kobalte too.\n closeOnOutsidePress\n {...rest}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiDialog>","onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}","<LayerRootContext value={layer}>{props.children}</LayerRootContext>","value={layer}","<UiDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />","<Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>","<UiDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />","render={expandedDiv}","<Portal mount={overlayContainer()}>\n <UiDialogContent\n // Inline inside the kit's own top-layer positioner; see TopLayerPositioner.\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',\n dialogContentSizes[props.size ?? 'md'],\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>","<UiDialogContent\n // Inline inside the kit's own top-layer positioner; see TopLayerPositioner.\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',\n dialogContentSizes[props.size ?? 'md'],\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>","ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}","render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}","<TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>","<DialogScrim open={state.open} />","expandedDiv(panelProps, state)","<LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>","element={() => panel}","props.children","<Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>","<Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>","<TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>","as={CornerClose}","class={overlayCornerClose}","<X class=\"size-4\" />","class=\"size-4\"","<TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>","{props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}","<UiDialogClose\n {...props}\n render={(closeProps) => <button {...closeProps} data-slot=\"dialog-corner-close\" />}\n />","render={(closeProps) => <button {...closeProps} data-slot=\"dialog-corner-close\" />}","<div\n data-slot=\"dialog-header\"\n class={cn(overlayHeader, 'pe-6', { 'bg-muted': props.band }, props.class)}\n {...rest}\n />","<div data-slot=\"dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />","<UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiDialogClose\n class={cn('focus-ring', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","X","LucideX","Dialog","DialogTrigger","DialogContent","resolveChildren","DialogTitle","DialogDescription","DialogClose"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n createDialogController,\n Dialog as UiDialog,\n DialogBackdrop as UiDialogBackdrop,\n DialogClose as UiDialogClose,\n DialogContent as UiDialogContent,\n DialogDescription as UiDialogDescription,\n DialogTitle as UiDialogTitle,\n DialogTrigger as UiDialogTrigger,\n type DialogContentState,\n type DialogOpenChangeDetails,\n type DialogOptions,\n} from '@ui-sdk/solid/dialog'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport { X as LucideX } from '@lucide/solid'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { children as resolveChildren, Show, omit } from 'solid-js'\nimport { Portal } from '@solidjs/web'\nimport {\n dialogSurface,\n overlayCornerClose,\n overlayDescription,\n overlayFooter,\n overlayHeader,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayScrimMotion,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'\nimport {\n asRender,\n triggerRender,\n expandedDiv,\n overlayContainer,\n type WithAs,\n} from '../tooltip/tooltip'\nimport {\n createLayerRoot,\n LayerEscapeTarget,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n LayerRootContext,\n DialogScrim,\n TopLayerPositioner,\n useLayerContent,\n} from './dialog-layer'\nimport { fastIcon } from '#lib/fast-icon'\nimport { forwardRef } from '#lib/refs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task, on ui-sdk's dialog: it\n * traps focus, closes on Escape and on a press outside, makes the page inert\n * and locks its scroll. The panel renders into `<body>` (so it inherits\n * nothing from where it is written) inside a top-layer positioner, and\n * `DialogOverlay` dims what is behind it. Focus returns on close to the\n * trigger, or to whatever had it before the dialog opened (pass\n * `restoreFocusRef` when that control is gone by then, such as a menu row).\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport type DialogProps = Omit<DialogOptions, 'onOpenChange' | 'controller'> & {\n children?: JSX.Element\n /** The dialog wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: DialogOpenChangeDetails) => void\n /** Kept for the API: a modal dialog always locks the page's scroll. */\n preventScroll?: boolean\n /** Kept for the API: use `keepMounted` on the content to keep it in the page while closed. */\n forceMount?: boolean\n}\n\n/** The options a Kobalte-era root took that ui-sdk's root does not. */\nconst legacyRootProps = ['preventScroll', 'forceMount', 'id', 'translations'] as const\n\nexport function Dialog(props: DialogProps) {\n const controller = createDialogController()\n const layer = createLayerRoot(() => controller.close({ reason: 'escape-key' }))\n const rest = omit(\n props as DialogProps & { id?: string; translations?: unknown },\n 'children',\n 'onOpenChange',\n ...legacyRootProps\n )\n return (\n <UiDialog\n // A non-modal dialog closed on an outside press under Kobalte too.\n closeOnOutsidePress\n {...rest}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiDialog>\n )\n}\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements, State = object> = PartProps<\n Tag,\n State\n> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n [key: string]: unknown\n}\n\nexport function DialogTrigger(props: WithAs<ComponentProps<typeof UiDialogTrigger>>) {\n return (\n <UiDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />\n )\n}\n\n/** Renders its children into `<body>`. The content already does; kept for the API. */\nexport function DialogPortal(props: { children?: JSX.Element; mount?: Element }) {\n return <Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>\n}\n\n/**\n * The scrim, as a part of its own: a dialog-shaped layer whose content is not\n * the kit's centred panel (a sheet) draws it with this. `DialogContent`\n * already draws the same scrim inside its positioner.\n */\nexport function DialogOverlay(props: PartProps<'div'> & { class?: string }) {\n return (\n <UiDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />\n )\n}\n\ntype DialogContentOwnProps = {\n class?: string\n children?: JSX.Element\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /**\n * The corner close's accessible name. Defaults to \"Close\". Name it for the\n * dialog (\"Close version and updates\") when the footer also has a text\n * \"Close\", so the two controls do not share one name.\n */\n closeLabel?: string\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n /**\n * The panel's maximum width. `md` (32rem) is the default and right for a\n * confirmation or a short form; `sm` (28rem) for a single question; `lg`\n * (42rem) for a picker or a form with two columns; `xl` (48rem) for a\n * multi-step flow that needs a table or a preview beside its fields.\n */\n size?: DialogContentSize\n /**\n * Where focus lands on open. `first-control` (the default) is the first\n * tabbable control; `panel` focuses the panel itself, for a dialog whose\n * content should be read before an action is reached (an About box, an\n * update summary).\n */\n initialFocus?: 'first-control' | 'panel'\n /** The control to focus on close when the one focused before opening is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n}\n\nexport type DialogContentProps = Omit<\n PartProps<'div', DialogContentState>,\n keyof DialogContentOwnProps | keyof LayerHandlers | 'keepMounted' | 'inline' | 'render'\n> &\n DialogContentOwnProps &\n LayerHandlers\n\n/** The dialog width ladder, so a caller picks a rung instead of a `max-w-*`. */\nexport const dialogContentSizes = {\n sm: 'max-w-md',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n xl: 'max-w-3xl',\n} as const\n\nexport type DialogContentSize = keyof typeof dialogContentSizes\n\nexport function DialogContent(props: DialogContentProps) {\n let panel: HTMLDivElement | undefined\n const rest = omit(\n props,\n 'class',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'positioner',\n 'size',\n 'initialFocus',\n 'restoreFocusRef',\n 'ref',\n ...layerHandlerProps\n )\n const focus = useLayerContent({\n content: () => panel,\n handlers: layerHandlers(props),\n initialFocus: () => props.initialFocus,\n restoreFocusRef: () => props.restoreFocusRef?.(),\n })\n\n const closeButton = resolveChildren(() => props.closeButton)\n return (\n <Portal mount={overlayContainer()}>\n <UiDialogContent\n // Inline inside the kit's own top-layer positioner; see TopLayerPositioner.\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',\n dialogContentSizes[props.size ?? 'md'],\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>\n )\n}\n\n/** The corner close: a dialog Close part that keeps its own slot name for the kit's tests and styles. */\nfunction CornerClose(props: Record<string, unknown>) {\n return (\n <UiDialogClose\n {...props}\n render={(closeProps) => <button {...closeProps} data-slot=\"dialog-corner-close\" />}\n />\n )\n}\n\n/**\n * The dialog's title block. `band` steps it onto the elevation ladder's\n * subtle-fill rung (`--muted`), the same treatment as the sheet parts' band —\n * for the dialog family whose panel anatomy matches a sheet's (a title band\n * over a full-bleed shell, such as a settings dialog) rather than the centred\n * modal's documented flat surface. See `SheetFooter` for the rung's rationale.\n */\nexport function DialogHeader(props: ComponentProps<'div'> & { band?: boolean }) {\n const rest = omit(props, 'class', 'band')\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn(overlayHeader, 'pe-6', { 'bg-muted': props.band }, props.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div data-slot=\"dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />\n}\n\nexport function DialogTitle(props: PolymorphicPartProps<'h2'> & { class?: string }) {\n return (\n <UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function DialogDescription(props: PolymorphicPartProps<'p'> & { class?: string }) {\n return (\n <UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/**\n * A close control of the caller's own, polymorphic — for a footer's text\n * \"Cancel\" or \"Close\", which is a different control from the corner icon the\n * content draws. Take it as `as={Button}` so it carries the button's variants\n * rather than a copied class string.\n */\nexport function DialogClose(props: WithAs<ComponentProps<typeof UiDialogClose>>) {\n return (\n <UiDialogClose\n class={cn('focus-ring', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/** The earlier name for `DialogClose`. */\nexport const DialogCloseButton = DialogClose\n"],"mappings":";;;;;;;;;;;;;AAuDA,IAAMkC,MAAI,SAASC,CAAO;;AA4B1B,IAAM,kBAAkB;CAAC;CAAiB;CAAc;CAAM;AAAc;AAE5E,SAAgBC,SAAO,OAAoB;CACzC,MAAM,aAAa,uBAAuB;CAC1C,MAAM,QAAQ,sBAAsB,WAAW,MAAM,EAAE,QAAQ,aAAa,CAAC,CAAC;CAC9E,MAAM,OAAO,KACX,OACA,YACA,gBACA,GAAG,eACL;CACA,OACEpC,gBAAAA,QAAAA,WAAAA,EAEE,qBAAA,KASQ,GARJ,MAHN;EAIc;EACZC,eAAe,MAAM,YAAY;GAC/B,IAAI,MAAM,QAAQ,MAAM,OAAO,GAAG,OAAO,QAAQ,OAAO;GACxD,MAAM,eAAe,MAAM,OAAO;EACpC;EARF,IAAA,WAAA;GAUEC,OAAAA,gBAAAA,kBAAAA;IAAkBC,OAAO;IAAzB,IAAA,WAAA;KAAiC,OAAA,MAAM;IAA2B;;EAC1D;;AAEd;AAWA,SAAgBkC,gBAAc,OAAuD;CACnF,OACEjC,gBAAAA,eAAAA,iBACE;EAAI,OAAA,KAAK,OAAO,IAAI;CAAC,GADvB,EAEE,IAAA,SAAA;EAAQ,OAAA,cAAc,MAAM,IAAI,gBAAgB,MAAM,YAAY;CAAC,EACpE,CAAA,CAAA;AAEL;;AAGA,SAAgB,aAAa,OAAoD;CAC/E,OAAOC,gBAAAA,QAAAA;EAAQ,IAAA,QAAA;GAAO,OAAA,MAAM,SAAS,iBAAiB;EAAC;EAAhD,IAAA,WAAA;GAAmD,OAAA,MAAM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UiDialog\n // A non-modal dialog closed on an outside press under Kobalte too.\n closeOnOutsidePress\n {...rest}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiDialog>","onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}","<LayerRootContext value={layer}>{props.children}</LayerRootContext>","value={layer}","<UiDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />","<Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>","<UiDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />","render={expandedDiv}","<Portal mount={overlayContainer()}>\n <UiDialogContent\n // Inline inside the kit's own top-layer positioner; see TopLayerPositioner.\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',\n dialogContentSizes[props.size ?? 'md'],\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>","<UiDialogContent\n // Inline inside the kit's own top-layer positioner; see TopLayerPositioner.\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',\n dialogContentSizes[props.size ?? 'md'],\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>","ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}","render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}","<TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>","<DialogScrim open={state.open} />","expandedDiv(panelProps, state)","<LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>","element={() => panel}","props.children","<Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>","<Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>","<TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>","as={CornerClose}","class={overlayCornerClose}","<X class=\"size-4\" />","class=\"size-4\"","<TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>","{props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}","<UiDialogClose\n {...props}\n render={(closeProps) => <button {...closeProps} data-slot=\"dialog-corner-close\" />}\n />","render={(closeProps) => <button {...closeProps} data-slot=\"dialog-corner-close\" />}","<div\n data-slot=\"dialog-header\"\n class={cn(overlayHeader, 'pe-6', { 'bg-muted': props.band }, props.class)}\n {...rest}\n />","<div data-slot=\"dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />","<UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiDialogClose\n class={cn('focus-ring', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","LucideX","resolveChildren","_$spread"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n createDialogController,\n Dialog as UiDialog,\n DialogBackdrop as UiDialogBackdrop,\n DialogClose as UiDialogClose,\n DialogContent as UiDialogContent,\n DialogDescription as UiDialogDescription,\n DialogTitle as UiDialogTitle,\n DialogTrigger as UiDialogTrigger,\n type DialogContentState,\n type DialogOpenChangeDetails,\n type DialogOptions,\n} from '@ui-sdk/solid/dialog'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport { X as LucideX } from '@lucide/solid'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { children as resolveChildren, Show, omit } from 'solid-js'\nimport { Portal } from '@solidjs/web'\nimport {\n dialogSurface,\n overlayCornerClose,\n overlayDescription,\n overlayFooter,\n overlayHeader,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayScrimMotion,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'\nimport {\n asRender,\n triggerRender,\n expandedDiv,\n overlayContainer,\n type WithAs,\n} from '../tooltip/tooltip'\nimport {\n createLayerRoot,\n LayerEscapeTarget,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n LayerRootContext,\n DialogScrim,\n TopLayerPositioner,\n useLayerContent,\n} from './dialog-layer'\nimport { fastIcon } from '#lib/fast-icon'\nimport { forwardRef } from '#lib/refs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task, on ui-sdk's dialog: it\n * traps focus, closes on Escape and on a press outside, makes the page inert\n * and locks its scroll. The panel renders into `<body>` (so it inherits\n * nothing from where it is written) inside a top-layer positioner, and\n * `DialogOverlay` dims what is behind it. Focus returns on close to the\n * trigger, or to whatever had it before the dialog opened (pass\n * `restoreFocusRef` when that control is gone by then, such as a menu row).\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport type DialogProps = Omit<DialogOptions, 'onOpenChange' | 'controller'> & {\n children?: JSX.Element\n /** The dialog wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: DialogOpenChangeDetails) => void\n /** Kept for the API: a modal dialog always locks the page's scroll. */\n preventScroll?: boolean\n /** Kept for the API: use `keepMounted` on the content to keep it in the page while closed. */\n forceMount?: boolean\n}\n\n/** The options a Kobalte-era root took that ui-sdk's root does not. */\nconst legacyRootProps = ['preventScroll', 'forceMount', 'id', 'translations'] as const\n\nexport function Dialog(props: DialogProps) {\n const controller = createDialogController()\n const layer = createLayerRoot(() => controller.close({ reason: 'escape-key' }))\n const rest = omit(\n props as DialogProps & { id?: string; translations?: unknown },\n 'children',\n 'onOpenChange',\n ...legacyRootProps\n )\n return (\n <UiDialog\n // A non-modal dialog closed on an outside press under Kobalte too.\n closeOnOutsidePress\n {...rest}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiDialog>\n )\n}\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements, State = object> = PartProps<\n Tag,\n State\n> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n [key: string]: unknown\n}\n\nexport function DialogTrigger(props: WithAs<ComponentProps<typeof UiDialogTrigger>>) {\n return (\n <UiDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />\n )\n}\n\n/** Renders its children into `<body>`. The content already does; kept for the API. */\nexport function DialogPortal(props: { children?: JSX.Element; mount?: Element }) {\n return <Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>\n}\n\n/**\n * The scrim, as a part of its own: a dialog-shaped layer whose content is not\n * the kit's centred panel (a sheet) draws it with this. `DialogContent`\n * already draws the same scrim inside its positioner.\n */\nexport function DialogOverlay(props: PartProps<'div'> & { class?: string }) {\n return (\n <UiDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />\n )\n}\n\ntype DialogContentOwnProps = {\n class?: string\n children?: JSX.Element\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /**\n * The corner close's accessible name. Defaults to \"Close\". Name it for the\n * dialog (\"Close version and updates\") when the footer also has a text\n * \"Close\", so the two controls do not share one name.\n */\n closeLabel?: string\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n /**\n * The panel's maximum width. `md` (32rem) is the default and right for a\n * confirmation or a short form; `sm` (28rem) for a single question; `lg`\n * (42rem) for a picker or a form with two columns; `xl` (48rem) for a\n * multi-step flow that needs a table or a preview beside its fields.\n */\n size?: DialogContentSize\n /**\n * Where focus lands on open. `first-control` (the default) is the first\n * tabbable control; `panel` focuses the panel itself, for a dialog whose\n * content should be read before an action is reached (an About box, an\n * update summary).\n */\n initialFocus?: 'first-control' | 'panel'\n /** The control to focus on close when the one focused before opening is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n}\n\nexport type DialogContentProps = Omit<\n PartProps<'div', DialogContentState>,\n keyof DialogContentOwnProps | keyof LayerHandlers | 'keepMounted' | 'inline' | 'render'\n> &\n DialogContentOwnProps &\n LayerHandlers\n\n/** The dialog width ladder, so a caller picks a rung instead of a `max-w-*`. */\nexport const dialogContentSizes = {\n sm: 'max-w-md',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n xl: 'max-w-3xl',\n} as const\n\nexport type DialogContentSize = keyof typeof dialogContentSizes\n\nexport function DialogContent(props: DialogContentProps) {\n let panel: HTMLDivElement | undefined\n const rest = omit(\n props,\n 'class',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'positioner',\n 'size',\n 'initialFocus',\n 'restoreFocusRef',\n 'ref',\n ...layerHandlerProps\n )\n const focus = useLayerContent({\n content: () => panel,\n handlers: layerHandlers(props),\n initialFocus: () => props.initialFocus,\n restoreFocusRef: () => props.restoreFocusRef?.(),\n })\n\n const closeButton = resolveChildren(() => props.closeButton)\n return (\n <Portal mount={overlayContainer()}>\n <UiDialogContent\n // Inline inside the kit's own top-layer positioner; see TopLayerPositioner.\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',\n dialogContentSizes[props.size ?? 'md'],\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner\n class={cn(overlayPositioner, props.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}\n >\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>\n {props.children}\n <Show when={closeButton() !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment. */}\n <Tooltip>\n <TooltipTrigger\n as={CornerClose}\n aria-label={props.closeLabel ?? 'Close'}\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>\n {props.closeLabel ? `${props.closeLabel}.` : 'Close dialog.'}\n </TooltipContent>\n </Tooltip>\n </Show>\n </LayerEscapeTarget>\n </UiDialogContent>\n </Portal>\n )\n}\n\n/** The corner close: a dialog Close part that keeps its own slot name for the kit's tests and styles. */\nfunction CornerClose(props: Record<string, unknown>) {\n return (\n <UiDialogClose\n {...props}\n render={(closeProps) => <button {...closeProps} data-slot=\"dialog-corner-close\" />}\n />\n )\n}\n\n/**\n * The dialog's title block. `band` steps it onto the elevation ladder's\n * subtle-fill rung (`--muted`), the same treatment as the sheet parts' band —\n * for the dialog family whose panel anatomy matches a sheet's (a title band\n * over a full-bleed shell, such as a settings dialog) rather than the centred\n * modal's documented flat surface. See `SheetFooter` for the rung's rationale.\n */\nexport function DialogHeader(props: ComponentProps<'div'> & { band?: boolean }) {\n const rest = omit(props, 'class', 'band')\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn(overlayHeader, 'pe-6', { 'bg-muted': props.band }, props.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div data-slot=\"dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />\n}\n\nexport function DialogTitle(props: PolymorphicPartProps<'h2'> & { class?: string }) {\n return (\n <UiDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function DialogDescription(props: PolymorphicPartProps<'p'> & { class?: string }) {\n return (\n <UiDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/**\n * A close control of the caller's own, polymorphic — for a footer's text\n * \"Cancel\" or \"Close\", which is a different control from the corner icon the\n * content draws. Take it as `as={Button}` so it carries the button's variants\n * rather than a copied class string.\n */\nexport function DialogClose(props: WithAs<ComponentProps<typeof UiDialogClose>>) {\n return (\n <UiDialogClose\n class={cn('focus-ring', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/** The earlier name for `DialogClose`. */\nexport const DialogCloseButton = DialogClose\n"],"mappings":";;;;;;;;;;;;;AAuDA,IAAM,IAAI,SAASkC,GAAO;;AA4B1B,IAAM,kBAAkB;CAAC;CAAiB;CAAc;CAAM;AAAc;AAE5E,SAAgB,OAAO,OAAoB;CACzC,MAAM,aAAa,uBAAuB;CAC1C,MAAM,QAAQ,sBAAsB,WAAW,MAAM,EAAE,QAAQ,aAAa,CAAC,CAAC;CAC9E,MAAM,OAAO,KACX,OACA,YACA,gBACA,GAAG,eACL;CACA,OACElC,gBAAAA,UAAAA,WAAAA,EAEE,qBAAA,KASQ,GARJ,MAHN;EAIc;EACZC,eAAe,MAAM,YAAY;GAC/B,IAAI,MAAM,QAAQ,MAAM,OAAO,GAAG,OAAO,QAAQ,OAAO;GACxD,MAAM,eAAe,MAAM,OAAO;EACpC;EARF,IAAA,WAAA;GAUEC,OAAAA,gBAAAA,kBAAAA;IAAkBC,OAAO;IAAzB,IAAA,WAAA;KAAiC,OAAA,MAAM;IAA2B;;EAC1D;;AAEd;AAWA,SAAgB,cAAc,OAAuD;CACnF,OACEC,gBAAAA,iBAAAA,iBACE;EAAI,OAAA,KAAK,OAAO,IAAI;CAAC,GADvB,EAEE,IAAA,SAAA;EAAQ,OAAA,cAAc,MAAM,IAAI,gBAAgB,MAAM,YAAY;CAAC,EACpE,CAAA,CAAA;AAEL;;AAGA,SAAgB,aAAa,OAAoD;CAC/E,OAAOC,gBAAAA,QAAAA;EAAQ,IAAA,QAAA;GAAO,OAAA,MAAM,SAAS,iBAAiB;EAAC;EAAhD,IAAA,WAAA;GAAmD,OAAA,MAAM;EAAiB;;AACnF;;;;;;AAOA,SAAgB,cAAc,OAA8C;CAC1E,OACEC,gBAAAA,gBAAAA,WA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ponent, delegateEvents, effect, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
|
|
4
2
|
import { For, createMemo, omit } from "solid-js";
|
|
3
|
+
import { cva } from "../../../lib/variants.js";
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
// src/components/ui/diff-block/diff-block.tsx
|
|
6
6
|
var _tmpl$ = /* @__PURE__ */ template(`<div><div class="flex items-center justify-between gap-2 border-b border-border px-3 py-1"><span class="flex min-w-0 items-baseline gap-2"><span class="truncate font-code text-code text-foreground"></span><span class="shrink-0 font-code text-code text-muted-foreground"><span class=text-foreground>+</span> <span class=text-foreground>−</span></span></span></div><div class="scroll-fade overflow-x-auto"tabindex=0 role=region><div class=min-w-fit>`);
|
|
7
7
|
var _tmpl$2 = /* @__PURE__ */ template(`<div><span class="w-4 shrink-0 text-center select-none"aria-hidden=true></span><span class="min-w-0 whitespace-pre pr-4"><span class=visually-hidden>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-block.js","names":["<For each={lines()}>\n {(line) => (\n <div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>\n )}\n </For>","<div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>","<p class=\"px-3 py-1 text-xs text-muted-foreground italic\">Generating diff…</p>","<div\n class={cn('overflow-hidden rounded-xl border border-border bg-card', local.class)}\n {...rest}\n >\n <div class=\"flex items-center justify-between gap-2 border-b border-border px-3 py-1\">\n <span class=\"flex min-w-0 items-baseline gap-2\">\n <span class=\"truncate font-code text-code text-foreground\">{name()}</span>\n {/* The counts are text, so the summary survives greyscale and a reader\n who cannot separate the two line tones still gets the shape of it. */}\n <span class=\"shrink-0 font-code text-code text-muted-foreground\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </span>\n {local.actions}\n </div>\n <div\n class=\"scroll-fade overflow-x-auto\"\n tabindex=\"0\"\n role=\"region\"\n aria-label={`Diff for ${name()}`}\n >\n <div class=\"min-w-fit\">\n <For each={lines()}>\n {(line) => (\n <div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>\n )}\n </For>\n </div>\n <Show when={!local.complete}>\n <p class=\"px-3 py-1 text-xs text-muted-foreground italic\">Generating diff…</p>\n </Show>\n </div>\n </div>","<button\n type=\"button\"\n class={cn(\n 'flex w-full items-baseline justify-between gap-3 rounded-md px-2 py-1 text-left font-code text-code hover:bg-muted',\n props.class\n )}\n onClick={() => props.onSelect?.()}\n >\n <span class=\"truncate text-foreground\">{name()}</span>\n <span class=\"shrink-0 text-code\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </button>","_$readShallow"],"sources":["../../../../src/components/ui/diff-block/diff-block.tsx"],"sourcesContent":["import { createMemo, For, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * DiffBlock.\n *\n * A unified diff, classified and toned. Parsing lives here because the\n * classification is the part that is easy to get subtly wrong and impossible to\n * fix from a caller: whether a line is an addition, a deletion, a hunk header,\n * a file header, or context depends on state — a line beginning with `+++` is a\n * file header *before* the first hunk and an added line beginning with `++`\n * *inside* one, and a renderer that tested prefixes without that state would\n * mis-colour real patches.\n *\n * The line grammar:\n *\n * | Prefix | Meaning |\n * | --- | --- |\n * | `diff --git`, `index`, `---`, `+++` (before a hunk) | file header |\n * | `@@` | hunk header |\n * | `+` | addition |\n * | `-` | deletion |\n * | `\\` | the \"no newline at end of file\" marker |\n * | anything else, including a leading space | context |\n *\n * Tones are pairs of surface and text, so an addition is readable in both\n * polarities and with any accent, the greens and reds are the theme's own\n * `success` and `destructive` at low alpha, not fixed hexes. Colour is never the\n * only signal: the gutter carries `+` or `-` as well, which is what makes the\n * block usable in greyscale and by anyone who cannot separate the two hues.\n *\n * Split (side-by-side) view is deliberately not implemented. It is a different\n * layout algorithm, pairing deletions with additions across hunks, and a\n * half-correct one is worse than none. `view=\"unified\"` is the only value, and\n * the prop exists so that adding the second is not a breaking change.\n */\n\nexport type DiffLineKind = 'add' | 'delete' | 'context' | 'hunk' | 'header' | 'meta'\n\nexport type DiffLine = Readonly<{\n kind: DiffLineKind\n /** The line without its diff prefix. */\n text: string\n /** The prefix as written: `+`, `-`, a space, or nothing for a header. */\n marker: string\n /** The old-side line number, when the line exists on the old side. */\n oldLine?: number\n /** The new-side line number, when the line exists on the new side. */\n newLine?: number\n}>\n\nconst HUNK_HEADER = /^@@ -(\\d+)(?:,\\d+)? \\+(\\d+)(?:,\\d+)? @@/\n\n/**\n * Classify a unified diff.\n *\n * `headerState` is what makes `---` and `+++` unambiguous: git writes them as\n * file headers before the first `@@` and as content after it, and the two need\n * different tones. `oldLine`/`newLine` are tracked so the gutter can number both\n * sides, the numbers a reader uses to find the change in their editor.\n */\nexport function parseDiff(patch: string): readonly DiffLine[] {\n const lines: DiffLine[] = []\n let inHunk = false\n let oldLine = 0\n let newLine = 0\n\n for (const raw of patch.replace(/\\n$/, '').split('\\n')) {\n if (HUNK_HEADER.test(raw)) {\n const match = HUNK_HEADER.exec(raw)!\n oldLine = Number(match[1])\n newLine = Number(match[2])\n inHunk = true\n lines.push({ kind: 'hunk', text: raw, marker: '' })\n continue\n }\n\n if (!inHunk) {\n const isFileHeader =\n raw.startsWith('diff --git') ||\n raw.startsWith('index ') ||\n raw.startsWith('new file') ||\n raw.startsWith('deleted file') ||\n raw.startsWith('similarity index') ||\n raw.startsWith('rename ') ||\n raw.startsWith('--- ') ||\n raw.startsWith('+++ ')\n lines.push({ kind: isFileHeader ? 'header' : 'meta', text: raw, marker: '' })\n continue\n }\n\n if (raw.startsWith('\\\\')) {\n lines.push({ kind: 'meta', text: raw, marker: '' })\n continue\n }\n\n const marker = raw[0] ?? ' '\n if (marker === '+') {\n lines.push({ kind: 'add', text: raw.slice(1), marker, newLine })\n newLine += 1\n } else if (marker === '-') {\n lines.push({ kind: 'delete', text: raw.slice(1), marker, oldLine })\n oldLine += 1\n } else {\n lines.push({ kind: 'context', text: raw.slice(1), marker: ' ', oldLine, newLine })\n oldLine += 1\n newLine += 1\n }\n }\n\n return lines\n}\n\n/**\n * Whether a line gets gutter numbers. A hunk header and a file header are\n * structural, so numbering them would put a number on a line that has none.\n */\nfunction numbered(line: DiffLine, show: boolean | undefined): boolean {\n return Boolean(show) && line.kind !== 'hunk' && line.kind !== 'header' && line.kind !== 'meta'\n}\n\n/** The counts a diff summary reports: how much was added and removed. */\nexport function diffStats(\n lines: readonly DiffLine[]\n): Readonly<{ added: number; removed: number }> {\n let added = 0\n let removed = 0\n for (const line of lines) {\n if (line.kind === 'add') added += 1\n else if (line.kind === 'delete') removed += 1\n }\n return { added, removed }\n}\n\n/**\n * The target path from a unified diff's file header. Prefers `+++ b/<path>`,\n * git's explicit new-side marker, and skips `/dev/null`, which marks an added\n * or deleted side rather than naming a file. Only lines outside a hunk are\n * considered, for the same reason the parser tracks state.\n */\nexport function diffTargetPath(patch: string): string | null {\n for (const line of patch.split('\\n')) {\n if (line.startsWith('@@')) break\n const git = /^\\+\\+\\+ b\\/(.+?)(?:\\t|$)/.exec(line)\n if (git) return git[1]!\n const plain = /^\\+\\+\\+ ([^\\s/][^\\t]*?)(?:\\t|$)/.exec(line)\n if (plain && plain[1] !== '/dev/null') return plain[1]!\n const fromHeader = /^diff --git a\\/.+ b\\/(.+)/.exec(line)\n if (fromHeader) return fromHeader[1]!\n }\n return null\n}\n\nexport const diffLineVariants = cva('flex items-baseline font-code text-code', {\n variants: {\n kind: {\n add: 'bg-success-subtle text-foreground',\n delete: 'bg-destructive-subtle text-foreground',\n context: 'text-foreground',\n hunk: 'bg-muted text-muted-foreground',\n header: 'bg-muted font-semibold text-foreground',\n meta: 'text-muted-foreground italic',\n },\n },\n defaultVariants: { kind: 'context' },\n})\n\nexport type DiffBlockProps = Omit<ComponentProps<'div'>, 'children'> &\n VariantProps<typeof diffLineVariants> & {\n /** The unified diff. */\n patch: string\n /** A filename. Defaults to the path in the patch's header, or \"diff\". */\n title?: string\n /** False while the patch is still streaming. */\n complete?: boolean\n /** Show the two line-number gutters. Off for a fragment with no line numbers. */\n showLineNumbers?: boolean\n /** Extra header controls. */\n actions?: JSX.Element\n }\n\nexport function DiffBlock(props: DiffBlockProps) {\n const local = props\n const rest = omit(props, 'patch', 'title', 'complete', 'showLineNumbers', 'actions', 'class')\n\n const lines = createMemo(() => parseDiff(local.patch))\n const stats = createMemo(() => diffStats(lines()))\n const name = () => local.title ?? diffTargetPath(local.patch)?.split('/').pop() ?? 'diff'\n\n return (\n <div\n class={cn('overflow-hidden rounded-xl border border-border bg-card', local.class)}\n {...rest}\n >\n <div class=\"flex items-center justify-between gap-2 border-b border-border px-3 py-1\">\n <span class=\"flex min-w-0 items-baseline gap-2\">\n <span class=\"truncate font-code text-code text-foreground\">{name()}</span>\n {/* The counts are text, so the summary survives greyscale and a reader\n who cannot separate the two line tones still gets the shape of it. */}\n <span class=\"shrink-0 font-code text-code text-muted-foreground\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </span>\n {local.actions}\n </div>\n <div\n class=\"scroll-fade overflow-x-auto\"\n tabindex=\"0\"\n role=\"region\"\n aria-label={`Diff for ${name()}`}\n >\n <div class=\"min-w-fit\">\n <For each={lines()}>\n {(line) => (\n <div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>\n )}\n </For>\n </div>\n <Show when={!local.complete}>\n <p class=\"px-3 py-1 text-xs text-muted-foreground italic\">Generating diff…</p>\n </Show>\n </div>\n </div>\n )\n}\n\n/**\n * A diff summary line, for a list of changes rather than one patch: the file and\n * its counts. Uses `CodeBlock`'s height rules and nothing else, because a summary\n * is a row and not a surface.\n */\nexport function DiffSummary(props: { patch: string; class?: string; onSelect?: () => void }) {\n const stats = createMemo(() => diffStats(parseDiff(props.patch)))\n const name = () => diffTargetPath(props.patch) ?? 'diff'\n\n return (\n <button\n type=\"button\"\n class={cn(\n 'flex w-full items-baseline justify-between gap-3 rounded-md px-2 py-1 text-left font-code text-code hover:bg-muted',\n props.class\n )}\n onClick={() => props.onSelect?.()}\n >\n <span class=\"truncate text-foreground\">{name()}</span>\n <span class=\"shrink-0 text-code\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;AAqDA,IAAM,cAAc;;;;;;;;;AAUpB,SAAgB,UAAU,OAAoC;CA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"diff-block.js","names":["<For each={lines()}>\n {(line) => (\n <div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>\n )}\n </For>","<div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>","<p class=\"px-3 py-1 text-xs text-muted-foreground italic\">Generating diff…</p>","<div\n class={cn('overflow-hidden rounded-xl border border-border bg-card', local.class)}\n {...rest}\n >\n <div class=\"flex items-center justify-between gap-2 border-b border-border px-3 py-1\">\n <span class=\"flex min-w-0 items-baseline gap-2\">\n <span class=\"truncate font-code text-code text-foreground\">{name()}</span>\n {/* The counts are text, so the summary survives greyscale and a reader\n who cannot separate the two line tones still gets the shape of it. */}\n <span class=\"shrink-0 font-code text-code text-muted-foreground\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </span>\n {local.actions}\n </div>\n <div\n class=\"scroll-fade overflow-x-auto\"\n tabindex=\"0\"\n role=\"region\"\n aria-label={`Diff for ${name()}`}\n >\n <div class=\"min-w-fit\">\n <For each={lines()}>\n {(line) => (\n <div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>\n )}\n </For>\n </div>\n <Show when={!local.complete}>\n <p class=\"px-3 py-1 text-xs text-muted-foreground italic\">Generating diff…</p>\n </Show>\n </div>\n </div>","<button\n type=\"button\"\n class={cn(\n 'flex w-full items-baseline justify-between gap-3 rounded-md px-2 py-1 text-left font-code text-code hover:bg-muted',\n props.class\n )}\n onClick={() => props.onSelect?.()}\n >\n <span class=\"truncate text-foreground\">{name()}</span>\n <span class=\"shrink-0 text-code\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </button>","_$spread","_$insert","_$effect","_$readShallow","_$className","_$setAttribute"],"sources":["../../../../src/components/ui/diff-block/diff-block.tsx"],"sourcesContent":["import { createMemo, For, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * DiffBlock.\n *\n * A unified diff, classified and toned. Parsing lives here because the\n * classification is the part that is easy to get subtly wrong and impossible to\n * fix from a caller: whether a line is an addition, a deletion, a hunk header,\n * a file header, or context depends on state — a line beginning with `+++` is a\n * file header *before* the first hunk and an added line beginning with `++`\n * *inside* one, and a renderer that tested prefixes without that state would\n * mis-colour real patches.\n *\n * The line grammar:\n *\n * | Prefix | Meaning |\n * | --- | --- |\n * | `diff --git`, `index`, `---`, `+++` (before a hunk) | file header |\n * | `@@` | hunk header |\n * | `+` | addition |\n * | `-` | deletion |\n * | `\\` | the \"no newline at end of file\" marker |\n * | anything else, including a leading space | context |\n *\n * Tones are pairs of surface and text, so an addition is readable in both\n * polarities and with any accent, the greens and reds are the theme's own\n * `success` and `destructive` at low alpha, not fixed hexes. Colour is never the\n * only signal: the gutter carries `+` or `-` as well, which is what makes the\n * block usable in greyscale and by anyone who cannot separate the two hues.\n *\n * Split (side-by-side) view is deliberately not implemented. It is a different\n * layout algorithm, pairing deletions with additions across hunks, and a\n * half-correct one is worse than none. `view=\"unified\"` is the only value, and\n * the prop exists so that adding the second is not a breaking change.\n */\n\nexport type DiffLineKind = 'add' | 'delete' | 'context' | 'hunk' | 'header' | 'meta'\n\nexport type DiffLine = Readonly<{\n kind: DiffLineKind\n /** The line without its diff prefix. */\n text: string\n /** The prefix as written: `+`, `-`, a space, or nothing for a header. */\n marker: string\n /** The old-side line number, when the line exists on the old side. */\n oldLine?: number\n /** The new-side line number, when the line exists on the new side. */\n newLine?: number\n}>\n\nconst HUNK_HEADER = /^@@ -(\\d+)(?:,\\d+)? \\+(\\d+)(?:,\\d+)? @@/\n\n/**\n * Classify a unified diff.\n *\n * `headerState` is what makes `---` and `+++` unambiguous: git writes them as\n * file headers before the first `@@` and as content after it, and the two need\n * different tones. `oldLine`/`newLine` are tracked so the gutter can number both\n * sides, the numbers a reader uses to find the change in their editor.\n */\nexport function parseDiff(patch: string): readonly DiffLine[] {\n const lines: DiffLine[] = []\n let inHunk = false\n let oldLine = 0\n let newLine = 0\n\n for (const raw of patch.replace(/\\n$/, '').split('\\n')) {\n if (HUNK_HEADER.test(raw)) {\n const match = HUNK_HEADER.exec(raw)!\n oldLine = Number(match[1])\n newLine = Number(match[2])\n inHunk = true\n lines.push({ kind: 'hunk', text: raw, marker: '' })\n continue\n }\n\n if (!inHunk) {\n const isFileHeader =\n raw.startsWith('diff --git') ||\n raw.startsWith('index ') ||\n raw.startsWith('new file') ||\n raw.startsWith('deleted file') ||\n raw.startsWith('similarity index') ||\n raw.startsWith('rename ') ||\n raw.startsWith('--- ') ||\n raw.startsWith('+++ ')\n lines.push({ kind: isFileHeader ? 'header' : 'meta', text: raw, marker: '' })\n continue\n }\n\n if (raw.startsWith('\\\\')) {\n lines.push({ kind: 'meta', text: raw, marker: '' })\n continue\n }\n\n const marker = raw[0] ?? ' '\n if (marker === '+') {\n lines.push({ kind: 'add', text: raw.slice(1), marker, newLine })\n newLine += 1\n } else if (marker === '-') {\n lines.push({ kind: 'delete', text: raw.slice(1), marker, oldLine })\n oldLine += 1\n } else {\n lines.push({ kind: 'context', text: raw.slice(1), marker: ' ', oldLine, newLine })\n oldLine += 1\n newLine += 1\n }\n }\n\n return lines\n}\n\n/**\n * Whether a line gets gutter numbers. A hunk header and a file header are\n * structural, so numbering them would put a number on a line that has none.\n */\nfunction numbered(line: DiffLine, show: boolean | undefined): boolean {\n return Boolean(show) && line.kind !== 'hunk' && line.kind !== 'header' && line.kind !== 'meta'\n}\n\n/** The counts a diff summary reports: how much was added and removed. */\nexport function diffStats(\n lines: readonly DiffLine[]\n): Readonly<{ added: number; removed: number }> {\n let added = 0\n let removed = 0\n for (const line of lines) {\n if (line.kind === 'add') added += 1\n else if (line.kind === 'delete') removed += 1\n }\n return { added, removed }\n}\n\n/**\n * The target path from a unified diff's file header. Prefers `+++ b/<path>`,\n * git's explicit new-side marker, and skips `/dev/null`, which marks an added\n * or deleted side rather than naming a file. Only lines outside a hunk are\n * considered, for the same reason the parser tracks state.\n */\nexport function diffTargetPath(patch: string): string | null {\n for (const line of patch.split('\\n')) {\n if (line.startsWith('@@')) break\n const git = /^\\+\\+\\+ b\\/(.+?)(?:\\t|$)/.exec(line)\n if (git) return git[1]!\n const plain = /^\\+\\+\\+ ([^\\s/][^\\t]*?)(?:\\t|$)/.exec(line)\n if (plain && plain[1] !== '/dev/null') return plain[1]!\n const fromHeader = /^diff --git a\\/.+ b\\/(.+)/.exec(line)\n if (fromHeader) return fromHeader[1]!\n }\n return null\n}\n\nexport const diffLineVariants = cva('flex items-baseline font-code text-code', {\n variants: {\n kind: {\n add: 'bg-success-subtle text-foreground',\n delete: 'bg-destructive-subtle text-foreground',\n context: 'text-foreground',\n hunk: 'bg-muted text-muted-foreground',\n header: 'bg-muted font-semibold text-foreground',\n meta: 'text-muted-foreground italic',\n },\n },\n defaultVariants: { kind: 'context' },\n})\n\nexport type DiffBlockProps = Omit<ComponentProps<'div'>, 'children'> &\n VariantProps<typeof diffLineVariants> & {\n /** The unified diff. */\n patch: string\n /** A filename. Defaults to the path in the patch's header, or \"diff\". */\n title?: string\n /** False while the patch is still streaming. */\n complete?: boolean\n /** Show the two line-number gutters. Off for a fragment with no line numbers. */\n showLineNumbers?: boolean\n /** Extra header controls. */\n actions?: JSX.Element\n }\n\nexport function DiffBlock(props: DiffBlockProps) {\n const local = props\n const rest = omit(props, 'patch', 'title', 'complete', 'showLineNumbers', 'actions', 'class')\n\n const lines = createMemo(() => parseDiff(local.patch))\n const stats = createMemo(() => diffStats(lines()))\n const name = () => local.title ?? diffTargetPath(local.patch)?.split('/').pop() ?? 'diff'\n\n return (\n <div\n class={cn('overflow-hidden rounded-xl border border-border bg-card', local.class)}\n {...rest}\n >\n <div class=\"flex items-center justify-between gap-2 border-b border-border px-3 py-1\">\n <span class=\"flex min-w-0 items-baseline gap-2\">\n <span class=\"truncate font-code text-code text-foreground\">{name()}</span>\n {/* The counts are text, so the summary survives greyscale and a reader\n who cannot separate the two line tones still gets the shape of it. */}\n <span class=\"shrink-0 font-code text-code text-muted-foreground\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </span>\n {local.actions}\n </div>\n <div\n class=\"scroll-fade overflow-x-auto\"\n tabindex=\"0\"\n role=\"region\"\n aria-label={`Diff for ${name()}`}\n >\n <div class=\"min-w-fit\">\n <For each={lines()}>\n {(line) => (\n <div class={diffLineVariants({ kind: line.kind })}>\n <Show when={numbered(line, local.showLineNumbers)}>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.oldLine ?? ''}\n </span>\n <span\n class=\"w-10 shrink-0 pr-2 text-right text-code text-muted-foreground tabular-nums select-none\"\n aria-hidden=\"true\"\n >\n {line.newLine ?? ''}\n </span>\n </Show>\n {/* The marker is the signal that is not a colour. */}\n <span class=\"w-4 shrink-0 text-center select-none\" aria-hidden=\"true\">\n {line.kind === 'add' ? '+' : line.kind === 'delete' ? '−' : ''}\n </span>\n <span class=\"min-w-0 whitespace-pre pr-4\">\n {/* A screen reader gets the kind as a word, not a glyph. */}\n <span class=\"visually-hidden\">\n {line.kind === 'add' ? 'Added: ' : line.kind === 'delete' ? 'Removed: ' : ''}\n </span>\n {line.text || ' '}\n </span>\n </div>\n )}\n </For>\n </div>\n <Show when={!local.complete}>\n <p class=\"px-3 py-1 text-xs text-muted-foreground italic\">Generating diff…</p>\n </Show>\n </div>\n </div>\n )\n}\n\n/**\n * A diff summary line, for a list of changes rather than one patch: the file and\n * its counts. Uses `CodeBlock`'s height rules and nothing else, because a summary\n * is a row and not a surface.\n */\nexport function DiffSummary(props: { patch: string; class?: string; onSelect?: () => void }) {\n const stats = createMemo(() => diffStats(parseDiff(props.patch)))\n const name = () => diffTargetPath(props.patch) ?? 'diff'\n\n return (\n <button\n type=\"button\"\n class={cn(\n 'flex w-full items-baseline justify-between gap-3 rounded-md px-2 py-1 text-left font-code text-code hover:bg-muted',\n props.class\n )}\n onClick={() => props.onSelect?.()}\n >\n <span class=\"truncate text-foreground\">{name()}</span>\n <span class=\"shrink-0 text-code\">\n <span class=\"text-foreground\">+{stats().added}</span>{' '}\n <span class=\"text-foreground\">−{stats().removed}</span>\n </span>\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;AAqDA,IAAM,cAAc;;;;;;;;;AAUpB,SAAgB,UAAU,OAAoC;CAC5D,MAAM,QAAoB,CAAC;CAC3B,IAAI,SAAS;CACb,IAAI,UAAU;CACd,IAAI,UAAU;CAEd,KAAK,MAAM,OAAO,MAAM,QAAQ,OAAO,EAAE,CAAC,CAAC,MAAM,IAAI,GAAG;EACtD,IAAI,YAAY,KAAK,GAAG,GAAG;GACzB,MAAM,QAAQ,YAAY,KAAK,GAAG;GAClC,UAAU,OAAO,MAAM,EAAE;GACzB,UAAU,OAAO,MAAM,EAAE;GACzB,SAAS;GACT,MAAM,KAAK;IAAE,MAAM;IAAQ,MAAM;IAAK,QAAQ;GAAG,CAAC;GAClD;EACF;EAEA,IAAI,CAAC,QAAQ;GACX,MAAM,eACJ,IAAI,WAAW,YAAY,KAC3B,IAAI,WAAW,QAAQ,KACvB,IAAI,WAAW,UAAU,KACzB,IAAI,WAAW,cAAc,KAC7B,IAAI,WAAW,kBAAkB,KACjC,IAAI,WAAW,SAAS,KACxB,IAAI,WAAW,MAAM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