@adea-ai/ui 0.152.1 → 0.152.3
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 +2 -2
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +3 -3
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +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.map +1 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +3 -0
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +1 -1
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +3 -3
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +3 -3
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js.map +1 -1
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js.map +1 -1
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +1 -1
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +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.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +1 -1
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +1 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider.js.map +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js.map +1 -1
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/r/about-dialog.json +1 -1
- package/dist/r/accordion.json +1 -1
- package/dist/r/account-menu.json +1 -1
- package/dist/r/alert.json +1 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/attachment.json +1 -1
- package/dist/r/breadcrumb.json +1 -1
- package/dist/r/calendar.json +1 -1
- package/dist/r/carousel.json +1 -1
- package/dist/r/catalog-browser.json +1 -1
- package/dist/r/chain-of-thought.json +1 -1
- package/dist/r/chat.json +1 -1
- package/dist/r/checkbox.json +1 -1
- package/dist/r/checkpoint.json +1 -1
- package/dist/r/code-block.json +1 -1
- package/dist/r/combobox.json +1 -1
- package/dist/r/command.json +1 -1
- package/dist/r/confirmation.json +1 -1
- package/dist/r/context.json +1 -1
- package/dist/r/conversation.json +1 -1
- package/dist/r/detail-panel.json +1 -1
- package/dist/r/dialog.json +1 -1
- package/dist/r/dropdown-menu.json +1 -1
- package/dist/r/empty.json +1 -1
- package/dist/r/file-tree.json +1 -1
- package/dist/r/floating-preview.json +1 -1
- package/dist/r/help-center.json +1 -1
- package/dist/r/icon-picker.json +1 -1
- package/dist/r/inline-citation.json +1 -1
- package/dist/r/lib.json +1 -1
- package/dist/r/message-scroller.json +1 -1
- package/dist/r/model-selector.json +1 -1
- package/dist/r/native-select.json +1 -1
- package/dist/r/navigation-menu.json +1 -1
- package/dist/r/pagination.json +1 -1
- package/dist/r/pixel-resize-handle.json +1 -1
- package/dist/r/plan.json +1 -1
- package/dist/r/questionnaire.json +1 -1
- package/dist/r/queue.json +1 -1
- package/dist/r/radio-group.json +1 -1
- package/dist/r/reasoning.json +1 -1
- package/dist/r/registry.json +65 -65
- package/dist/r/resizable.json +1 -1
- package/dist/r/scene-controls.json +1 -1
- package/dist/r/select.json +1 -1
- package/dist/r/settings.json +1 -1
- package/dist/r/sheet.json +1 -1
- package/dist/r/shell-rail.json +1 -1
- package/dist/r/sidebar-nav.json +1 -1
- package/dist/r/sources.json +1 -1
- package/dist/r/spinner.json +1 -1
- package/dist/r/split-layout.json +1 -1
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +2 -2
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -1
- package/dist/r/src/components/composites/terminal/terminal.tsx +2 -2
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +3 -3
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +3 -5
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/dist/r/src/components/conversation/message-composer.tsx +1 -2
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +1 -1
- package/dist/r/src/components/theme/appearance-panel.tsx +2 -4
- package/dist/r/stack-trace.json +1 -1
- package/dist/r/stat.json +1 -1
- package/dist/r/subagent.json +1 -1
- package/dist/r/task.json +1 -1
- package/dist/r/terminal.json +1 -1
- package/dist/r/test-results.json +1 -1
- package/dist/r/theming.json +1 -1
- package/dist/r/toast.json +1 -1
- package/dist/r/tool.json +1 -1
- package/dist/r/top-bar.json +1 -1
- package/dist/r/trace.json +1 -1
- package/dist/r/tree.json +1 -1
- package/dist/r/update-dialog.json +1 -1
- package/dist/r/workspace-switcher.json +1 -1
- package/dist/vite/tailwind-sources.d.ts.map +1 -1
- package/dist/vite/tailwind-sources.js +49 -9
- package/dist/vite/tailwind-sources.js.map +1 -1
- package/package.json +11 -11
- package/registry.json +65 -65
- package/src/components/composites/about-dialog/about-dialog.tsx +2 -2
- package/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
- package/src/components/composites/model-selector/model-selector.tsx +4 -1
- package/src/components/composites/terminal/terminal.tsx +2 -2
- package/src/components/composites/update-dialog/channel-control.tsx +3 -3
- package/src/components/composites/update-dialog/update-dialog.tsx +3 -5
- package/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/src/components/conversation/message-composer.tsx +1 -2
- package/src/components/layout/split-layout/split-layout.tsx +1 -1
- package/src/components/theme/appearance-panel.tsx +2 -4
- package/src/vite/tailwind-sources.ts +67 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextual-sidebar.js","names":["Accessor","JSX","Show","createEffect","createMemo","createSignal","createUniqueId","onCleanup","untrack","MD_BREAKPOINT","cn","SidebarNav","SidebarNavContent","SidebarNavFooter","SidebarNavHeader","SidebarNavTitle","PixelResizeHandle","MobileModule","MobileLoad","error","ContextualSidebarRenderContext","mobile","portalMount","HTMLElement","ContextualSidebarModeTransition","phase","from","to","desktopSidebar","ContextualSidebarProps","id","label","title","titleVisibility","open","onOpenChange","responsiveMode","onResponsiveModeTransition","event","width","minimum","maximum","step","wideViewportAtLoad","resizeLabel","resizeGrip","restoreFocusRef","onSidebarElement","element","sidebarClass","sheetClass","headerClass","contentClass","footerClass","headingAs","header","context","Element","content","footer","onWidthChange","onWidthCommit","ContextualSidebar","props","isMobile","setIsMobile","mobileLoad","setMobileLoad","mobileLoadGeneration","mobileLoadPending","mobileLoadSettled","responsiveModeInitialized","transitionGeneration","pendingMode","disposed","transition","next","closeStaleOpen","previous","changed","generation","undefined","const","loadMobile","queueMicrotask","then","module","mobileMount","setMobileMount","connected","mount","isConnected","mode","wasMobile","media","MediaQueryList","viewportListener","removeEventListener","shouldCloseStaleOpen","Boolean","mediaQuery","window","matchMedia","updateViewport","nextIsMobile","matches","wasNarrow","addEventListener","renderSidebar","navigationId","_$createComponent","as","aria-label","aria-hidden","inert","data-open","String","ref","node","class","children","when","side","value","grip","controls","onChange","onCommit","fallback","_$memo","_wide","keyed","loaded","MobileSidebar","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport {\n Show,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n untrack,\n} from 'solid-js'\nimport { MD_BREAKPOINT } from '#lib/breakpoints'\nimport { cn } from '#lib/utils'\nimport {\n SidebarNav,\n SidebarNavContent,\n SidebarNavFooter,\n SidebarNavHeader,\n SidebarNavTitle,\n} from '../sidebar-nav'\nimport { PixelResizeHandle } from '../pixel-resize-handle'\n\ntype MobileModule = typeof import('./mobile-contextual-sidebar')\ntype MobileLoad = MobileModule | { error: unknown }\n\nexport type ContextualSidebarRenderContext = {\n /** Whether the slot is being rendered inside the modal mobile sheet. */\n mobile: boolean\n /** Mount nested popovers and menus inside the mobile dialog's accessibility tree. */\n portalMount(): HTMLElement | undefined\n}\n\nexport type ContextualSidebarModeTransition = {\n phase: 'before' | 'after'\n from: 'desktop' | 'mobile'\n to: 'desktop' | 'mobile'\n desktopSidebar: HTMLElement | undefined\n}\n\nexport type ContextualSidebarProps = {\n /** Stable host id prefix; generated when omitted. */\n id?: string\n /** Landmark name shared by the desktop and mobile navigation. */\n label: string\n /** Visible navigation title and mobile dialog title. */\n title: string\n /**\n * Where the title row shows. `always` (default) draws it on desktop and in\n * the mobile sheet; `mobile` keeps the desktop title for assistive\n * technology only and drops the desktop row, for hosts whose top bar\n * already names the context. A `header` slot keeps the row visible.\n */\n titleVisibility?: 'always' | 'mobile'\n /** Host-controlled expanded state for the desktop panel and mobile dialog. */\n open: boolean\n onOpenChange(open: boolean): void\n /**\n * Presentation mode. `auto` (default) uses the built-in viewport breakpoint;\n * hosts can select `desktop` or the shared mobile `Sheet` themselves.\n */\n responsiveMode?: 'auto' | 'desktop' | 'mobile'\n /**\n * Coordinate host layout before a runtime mode change and after its DOM settles.\n * A superseded transition or unmounted sidebar does not emit an after phase.\n * Initial mode resolution does not emit either phase.\n */\n onResponsiveModeTransition?(event: ContextualSidebarModeTransition): void\n /** Current host-owned pixel width, reflected by the resize handle. */\n width: number\n minimum: number\n maximum: number\n step?: number\n /** Pass the host's initial viewport seed to distinguish stale desktop state. */\n wideViewportAtLoad?: boolean\n resizeLabel?: string\n /**\n * The resize edge's grip: the quieter rung by default, or the bordered chip\n * for hosts that want the heavier affordance.\n */\n resizeGrip?: 'chip' | 'rung'\n /** Stable external opener used when the modal mobile sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Called with the nav node so a host can project width onto its layout root. */\n onSidebarElement?: (element: HTMLElement | undefined, mobile: boolean) => void\n /** Host-owned layout classes applied to both nav instances. */\n sidebarClass?: string\n /** Host-owned responsive constraints for the modal sheet. */\n sheetClass?: string\n headerClass?: string\n contentClass?: string\n footerClass?: string\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n /** Optional action/content slot alongside the shared heading. */\n header?(context: ContextualSidebarRenderContext): JSX.Element\n /** View-specific navigation rows, projects, rooms, files, or sessions. */\n content(context: ContextualSidebarRenderContext): JSX.Element\n /** Optional view-specific footer, such as an archive affordance. */\n footer?(context: ContextualSidebarRenderContext): JSX.Element\n onWidthChange(width: number): void\n onWidthCommit?(width: number): void\n}\n\n/**\n * ContextualSidebar.\n *\n * Shared navigation geometry and interaction policy for an application's\n * contextual sidebar. The host keeps ownership of the actual grid width,\n * persisted preference, open state, and view-specific navigation content.\n */\nexport function ContextualSidebar(props: ContextualSidebarProps) {\n const [isMobile, setIsMobile] = createSignal(false)\n const [mobileLoad, setMobileLoad] = createSignal<MobileLoad>()\n let mobileLoadGeneration = 0\n let mobileLoadPending = false\n let mobileLoadSettled = false\n let responsiveModeInitialized = false\n let desktopSidebar: HTMLElement | undefined\n let transitionGeneration = 0\n let pendingMode: boolean | undefined\n let disposed = false\n onCleanup(() => {\n disposed = true\n transitionGeneration += 1\n })\n\n const transition = (next: boolean, closeStaleOpen: boolean) => {\n // The host may synchronously update its props from either callback, which\n // re-enters the responsive effect before this transition has finished.\n if (pendingMode === next) return\n const previous = untrack(isMobile)\n const changed = responsiveModeInitialized && previous !== next\n const generation =\n changed || pendingMode !== undefined ? ++transitionGeneration : transitionGeneration\n pendingMode = next\n const event = {\n from: previous ? ('mobile' as const) : ('desktop' as const),\n to: next ? ('mobile' as const) : ('desktop' as const),\n desktopSidebar,\n }\n try {\n if (changed) untrack(() => props.onResponsiveModeTransition?.({ ...event, phase: 'before' }))\n if (disposed || generation !== transitionGeneration) return\n if (closeStaleOpen) untrack(() => props.onOpenChange(false))\n if (disposed || generation !== transitionGeneration) return\n if (next) loadMobile()\n setIsMobile(next)\n if (changed) {\n queueMicrotask(() => {\n if (!disposed && generation === transitionGeneration && untrack(isMobile) === next)\n untrack(() => props.onResponsiveModeTransition?.({ ...event, phase: 'after' }))\n })\n }\n } finally {\n if (generation === transitionGeneration) pendingMode = undefined\n }\n }\n // Keep the resolved component mounted across viewport changes for Sheet cleanup.\n const loadMobile = () => {\n if (mobileLoadPending || mobileLoadSettled) return\n mobileLoadPending = true\n const generation = ++mobileLoadGeneration\n // Native module caching shares successful loads without keeping a rejected promise.\n void import('./mobile-contextual-sidebar').then(\n (module) => {\n if (generation === mobileLoadGeneration) {\n mobileLoadPending = false\n mobileLoadSettled = true\n setMobileLoad(module)\n }\n },\n (error: unknown) => {\n if (generation === mobileLoadGeneration) {\n mobileLoadPending = false\n mobileLoadSettled = true\n setMobileLoad({ error })\n }\n }\n )\n }\n const [mobileMount, setMobileMount] = createSignal<\n { element: HTMLElement; connected: boolean } | undefined\n >()\n const id = props.id ?? `contextual-sidebar-${createUniqueId()}`\n const resizeLabel = () => props.resizeLabel ?? `Resize ${props.label}`\n const portalMount = () => {\n const mount = mobileMount()\n return mount?.connected && mount.element.isConnected ? mount.element : undefined\n }\n\n const responsiveMode = createMemo(() => props.responsiveMode ?? 'auto')\n createEffect(() => {\n const mode = responsiveMode()\n const wasMobile = untrack(isMobile)\n let media: MediaQueryList | undefined\n let viewportListener: (() => void) | undefined\n\n onCleanup(() => {\n mobileLoadGeneration += 1\n mobileLoadPending = false\n if (media && viewportListener) media.removeEventListener('change', viewportListener)\n })\n\n if (mode === 'desktop') {\n transition(false, false)\n } else if (mode === 'mobile') {\n // An explicit host transition into mobile must not briefly open a Sheet\n // with stale desktop-expanded state. An initial wide-loaded seed still\n // marks an open value as stale, including in host-selected mobile mode.\n const shouldCloseStaleOpen = responsiveModeInitialized\n ? !wasMobile && untrack(() => props.open)\n : untrack(() => props.wideViewportAtLoad && props.open)\n transition(true, Boolean(shouldCloseStaleOpen))\n } else {\n const mediaQuery = window.matchMedia(`(max-width: ${MD_BREAKPOINT})`)\n media = mediaQuery\n const updateViewport = () => {\n const nextIsMobile = mediaQuery.matches\n const wasNarrow = untrack(isMobile)\n // Close before mounting a modal. A desktop-expanded host state is not\n // mobile intent, and opening the Sheet for one frame can steal focus.\n transition(nextIsMobile, nextIsMobile && !wasNarrow)\n }\n viewportListener = updateViewport\n\n // Preserve a narrow-boot open intent. Initial auto and mobile modes use\n // the viewport seed to clear stale state; runtime transitions close it.\n const shouldCloseStaleOpen =\n media.matches &&\n (!responsiveModeInitialized\n ? untrack(() => props.wideViewportAtLoad && props.open)\n : !wasMobile)\n transition(media.matches, Boolean(shouldCloseStaleOpen))\n if (!disposed) mediaQuery.addEventListener('change', updateViewport)\n }\n\n responsiveModeInitialized = true\n })\n\n const renderSidebar = (mobile: boolean) => {\n let element: HTMLElement | undefined\n const context: ContextualSidebarRenderContext = {\n mobile,\n portalMount: () => (mobile ? portalMount() : undefined),\n }\n const navigationId = `${id}-${mobile ? 'mobile' : 'desktop'}`\n\n onCleanup(() => {\n if (mobile && mobileMount()?.element === element) setMobileMount(undefined)\n if (!mobile && desktopSidebar === element) desktopSidebar = undefined\n element = undefined\n props.onSidebarElement?.(undefined, mobile)\n })\n\n return (\n <SidebarNav\n as=\"aside\"\n id={navigationId}\n aria-label={props.label}\n aria-hidden={!mobile && !props.open ? 'true' : undefined}\n inert={!mobile && !props.open}\n data-contextual-sidebar={mobile ? 'mobile' : 'desktop'}\n data-open={mobile ? undefined : String(props.open)}\n ref={(node) => {\n element = node\n if (!mobile) desktopSidebar = node\n if (mobile) {\n setMobileMount({ element: node, connected: node.isConnected })\n queueMicrotask(() => {\n if (node.isConnected && mobileMount()?.element === node)\n setMobileMount({ element: node, connected: true })\n })\n }\n props.onSidebarElement?.(node, mobile)\n }}\n class={cn('relative h-full w-full max-w-full', props.sidebarClass)}\n >\n <Show when={!mobile && props.open}>\n <PixelResizeHandle\n // The ruler spans the sidebar as a pointer-events-none overlay; lift\n // it above the neighbouring pane so the edge stays grabbable.\n class=\"z-(--z-docked)\"\n side=\"left\"\n value={props.width}\n minimum={props.minimum}\n maximum={props.maximum}\n step={props.step}\n label={resizeLabel()}\n grip={props.resizeGrip ?? 'rung'}\n controls={navigationId}\n onChange={props.onWidthChange}\n onCommit={props.onWidthCommit}\n />\n </Show>\n <Show when={!mobile || mobileMount()?.connected}>\n <Show\n when={mobile || props.titleVisibility !== 'mobile' || props.header}\n fallback={\n <SidebarNavTitle as={props.headingAs ?? 'h2'} class=\"sr-only\">\n {props.title}\n </SidebarNavTitle>\n }\n >\n <SidebarNavHeader class={cn(mobile && 'pe-12', props.headerClass)}>\n <SidebarNavTitle as={props.headingAs ?? 'h2'}>{props.title}</SidebarNavTitle>\n {props.header?.(context)}\n </SidebarNavHeader>\n </Show>\n <SidebarNavContent class={props.contentClass}>{props.content(context)}</SidebarNavContent>\n {props.footer ? (\n <SidebarNavFooter class={props.footerClass}>{props.footer(context)}</SidebarNavFooter>\n ) : null}\n </Show>\n </SidebarNav>\n )\n }\n\n return (\n <>\n <Show when={!isMobile()}>{(_wide) => renderSidebar(false)}</Show>\n <Show when={mobileLoad()} keyed>\n {(loaded) => {\n if ('error' in loaded) throw loaded.error\n return (\n <loaded.MobileSidebar\n open={isMobile() && props.open}\n onOpenChange={props.onOpenChange}\n label={props.label}\n sheet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AAUtB,cAAc,KAAK;CAAC,CAAA,GAAAE,gBACxD5G,MAAI;EAAA,IAACuH,OAAI;GAAA,OAAEvD,WAAW;EAAC;EAAEiE,OAAK;EAAAX,WAC3BY,WAAW;GACX,IAAI,WAAWA,QAAQ,MAAMA,OAAOjH;GACpC,OAAA2F,gBACGsB,OAAOC,eAAa;IAAA,IACnBnG,OAAI;KAAA,OAAE+F,WAAA,CAAA,CAAAjE,SAAS,CAAC,CAAA,CAAA,KAAID,MAAM7B;IAAI;IAAA,IAC9BC,eAAY;KAAA,OAAE4B,MAAM5B;IAAY;IAAA,IAChCJ,QAAK;KAAA,OAAEgC,MAAMhC;IAAK;IAAA,IAClBmB,aAAU;KAAA,OAAEa,MAAMb;IAAU;IAAA,IAC5BJ,kBAAe;KAAA,OAAEiB,MAAMjB;IAAe;IACtC8D,qBAAqBA,cAAc,IAAI;GAAC,CAAA;EAG9C;CAAC,CAAA,CAAA;AAIT"}
|
|
1
|
+
{"version":3,"file":"contextual-sidebar.js","names":["Show","createEffect","createMemo","createSignal","createUniqueId","onCleanup","untrack","MD_BREAKPOINT","cn","SidebarNav","SidebarNavContent","SidebarNavFooter","SidebarNavHeader","SidebarNavTitle","PixelResizeHandle","error","mobile","portalMount","phase","from","to","desktopSidebar","id","label","title","titleVisibility","open","onOpenChange","responsiveMode","onResponsiveModeTransition","event","width","minimum","maximum","step","wideViewportAtLoad","resizeLabel","resizeGrip","restoreFocusRef","onSidebarElement","element","sidebarClass","sheetClass","headerClass","contentClass","footerClass","headingAs","header","context","content","footer","onWidthChange","onWidthCommit","ContextualSidebar","props","isMobile","setIsMobile","mobileLoad","setMobileLoad","mobileLoadGeneration","mobileLoadPending","mobileLoadSettled","responsiveModeInitialized","transitionGeneration","pendingMode","disposed","transition","next","closeStaleOpen","previous","changed","generation","undefined","loadMobile","queueMicrotask","then","module","mobileMount","setMobileMount","connected","mount","isConnected","mode","wasMobile","media","viewportListener","removeEventListener","shouldCloseStaleOpen","Boolean","mediaQuery","window","matchMedia","updateViewport","nextIsMobile","matches","wasNarrow","addEventListener","renderSidebar","navigationId","_$createComponent","as","inert","String","ref","node","children","when","side","value","grip","controls","onChange","onCommit","fallback","_$memo","_wide","keyed","loaded","MobileSidebar"],"sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport {\n Show,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n untrack,\n} from 'solid-js'\nimport { MD_BREAKPOINT } from '#lib/breakpoints'\nimport { cn } from '#lib/utils'\nimport {\n SidebarNav,\n SidebarNavContent,\n SidebarNavFooter,\n SidebarNavHeader,\n SidebarNavTitle,\n} from '../sidebar-nav'\nimport { PixelResizeHandle } from '../pixel-resize-handle'\n\ntype MobileModule = typeof import('./mobile-contextual-sidebar')\ntype MobileLoad = MobileModule | { error: unknown }\n\nexport type ContextualSidebarRenderContext = {\n /** Whether the slot is being rendered inside the modal mobile sheet. */\n mobile: boolean\n /** Mount nested popovers and menus inside the mobile dialog's accessibility tree. */\n portalMount(): HTMLElement | undefined\n}\n\nexport type ContextualSidebarModeTransition = {\n phase: 'before' | 'after'\n from: 'desktop' | 'mobile'\n to: 'desktop' | 'mobile'\n desktopSidebar: HTMLElement | undefined\n}\n\nexport type ContextualSidebarProps = {\n /** Stable host id prefix; generated when omitted. */\n id?: string\n /** Landmark name shared by the desktop and mobile navigation. */\n label: string\n /** Visible navigation title and mobile dialog title. */\n title: string\n /**\n * Where the title row shows. `always` (default) draws it on desktop and in\n * the mobile sheet; `mobile` keeps the desktop title for assistive\n * technology only and drops the desktop row, for hosts whose top bar\n * already names the context. A `header` slot keeps the row visible.\n */\n titleVisibility?: 'always' | 'mobile'\n /** Host-controlled expanded state for the desktop panel and mobile dialog. */\n open: boolean\n onOpenChange(open: boolean): void\n /**\n * Presentation mode. `auto` (default) uses the built-in viewport breakpoint;\n * hosts can select `desktop` or the shared mobile `Sheet` themselves.\n */\n responsiveMode?: 'auto' | 'desktop' | 'mobile'\n /**\n * Coordinate host layout before a runtime mode change and after its DOM settles.\n * A superseded transition or unmounted sidebar does not emit an after phase.\n * Initial mode resolution does not emit either phase.\n */\n onResponsiveModeTransition?(event: ContextualSidebarModeTransition): void\n /** Current host-owned pixel width, reflected by the resize handle. */\n width: number\n minimum: number\n maximum: number\n step?: number\n /** Pass the host's initial viewport seed to distinguish stale desktop state. */\n wideViewportAtLoad?: boolean\n resizeLabel?: string\n /**\n * The resize edge's grip: the quieter rung by default, or the bordered chip\n * for hosts that want the heavier affordance.\n */\n resizeGrip?: 'chip' | 'rung'\n /** Stable external opener used when the modal mobile sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Called with the nav node so a host can project width onto its layout root. */\n onSidebarElement?: (element: HTMLElement | undefined, mobile: boolean) => void\n /** Host-owned layout classes applied to both nav instances. */\n sidebarClass?: string\n /** Host-owned responsive constraints for the modal sheet. */\n sheetClass?: string\n headerClass?: string\n contentClass?: string\n footerClass?: string\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n /** Optional action/content slot alongside the shared heading. */\n header?(context: ContextualSidebarRenderContext): JSX.Element\n /** View-specific navigation rows, projects, rooms, files, or sessions. */\n content(context: ContextualSidebarRenderContext): JSX.Element\n /** Optional view-specific footer, such as an archive affordance. */\n footer?(context: ContextualSidebarRenderContext): JSX.Element\n onWidthChange(width: number): void\n onWidthCommit?(width: number): void\n}\n\n/**\n * ContextualSidebar.\n *\n * Shared navigation geometry and interaction policy for an application's\n * contextual sidebar. The host keeps ownership of the actual grid width,\n * persisted preference, open state, and view-specific navigation content.\n */\nexport function ContextualSidebar(props: ContextualSidebarProps) {\n const [isMobile, setIsMobile] = createSignal(false)\n const [mobileLoad, setMobileLoad] = createSignal<MobileLoad>()\n let mobileLoadGeneration = 0\n let mobileLoadPending = false\n let mobileLoadSettled = false\n let responsiveModeInitialized = false\n let desktopSidebar: HTMLElement | undefined\n let transitionGeneration = 0\n let pendingMode: boolean | undefined\n let disposed = false\n onCleanup(() => {\n disposed = true\n transitionGeneration += 1\n })\n\n const transition = (next: boolean, closeStaleOpen: boolean) => {\n // The host may synchronously update its props from either callback, which\n // re-enters the responsive effect before this transition has finished.\n if (pendingMode === next) return\n const previous = untrack(isMobile)\n const changed = responsiveModeInitialized && previous !== next\n const generation =\n changed || pendingMode !== undefined ? ++transitionGeneration : transitionGeneration\n pendingMode = next\n const event = {\n from: previous ? ('mobile' as const) : ('desktop' as const),\n to: next ? ('mobile' as const) : ('desktop' as const),\n desktopSidebar,\n }\n try {\n if (changed) untrack(() => props.onResponsiveModeTransition?.({ ...event, phase: 'before' }))\n if (disposed || generation !== transitionGeneration) return\n if (closeStaleOpen) untrack(() => props.onOpenChange(false))\n if (disposed || generation !== transitionGeneration) return\n if (next) loadMobile()\n setIsMobile(next)\n if (changed) {\n queueMicrotask(() => {\n if (!disposed && generation === transitionGeneration && untrack(isMobile) === next)\n untrack(() => props.onResponsiveModeTransition?.({ ...event, phase: 'after' }))\n })\n }\n } finally {\n if (generation === transitionGeneration) pendingMode = undefined\n }\n }\n // Keep the resolved component mounted across viewport changes for Sheet cleanup.\n const loadMobile = () => {\n if (mobileLoadPending || mobileLoadSettled) return\n mobileLoadPending = true\n const generation = ++mobileLoadGeneration\n // Native module caching shares successful loads without keeping a rejected promise.\n void import('./mobile-contextual-sidebar').then(\n (module) => {\n if (generation === mobileLoadGeneration) {\n mobileLoadPending = false\n mobileLoadSettled = true\n setMobileLoad(module)\n }\n },\n (error: unknown) => {\n if (generation === mobileLoadGeneration) {\n mobileLoadPending = false\n mobileLoadSettled = true\n setMobileLoad({ error })\n }\n }\n )\n }\n const [mobileMount, setMobileMount] = createSignal<\n { element: HTMLElement; connected: boolean } | undefined\n >()\n const id = props.id ?? `contextual-sidebar-${createUniqueId()}`\n const resizeLabel = () => props.resizeLabel ?? `Resize ${props.label}`\n const portalMount = () => {\n const mount = mobileMount()\n return mount?.connected && mount.element.isConnected ? mount.element : undefined\n }\n\n const responsiveMode = createMemo(() => props.responsiveMode ?? 'auto')\n createEffect(() => {\n const mode = responsiveMode()\n const wasMobile = untrack(isMobile)\n let media: MediaQueryList | undefined\n let viewportListener: (() => void) | undefined\n\n onCleanup(() => {\n mobileLoadGeneration += 1\n mobileLoadPending = false\n if (media && viewportListener) media.removeEventListener('change', viewportListener)\n })\n\n if (mode === 'desktop') {\n transition(false, false)\n } else if (mode === 'mobile') {\n // An explicit host transition into mobile must not briefly open a Sheet\n // with stale desktop-expanded state. An initial wide-loaded seed still\n // marks an open value as stale, including in host-selected mobile mode.\n const shouldCloseStaleOpen = responsiveModeInitialized\n ? !wasMobile && untrack(() => props.open)\n : untrack(() => props.wideViewportAtLoad && props.open)\n transition(true, Boolean(shouldCloseStaleOpen))\n } else {\n const mediaQuery = window.matchMedia(`(max-width: ${MD_BREAKPOINT})`)\n media = mediaQuery\n const updateViewport = () => {\n const nextIsMobile = mediaQuery.matches\n const wasNarrow = untrack(isMobile)\n // Close before mounting a modal. A desktop-expanded host state is not\n // mobile intent, and opening the Sheet for one frame can steal focus.\n transition(nextIsMobile, nextIsMobile && !wasNarrow)\n }\n viewportListener = updateViewport\n\n // Preserve a narrow-boot open intent. Initial auto and mobile modes use\n // the viewport seed to clear stale state; runtime transitions close it.\n const shouldCloseStaleOpen =\n media.matches &&\n (!responsiveModeInitialized\n ? untrack(() => props.wideViewportAtLoad && props.open)\n : !wasMobile)\n transition(media.matches, Boolean(shouldCloseStaleOpen))\n if (!disposed) mediaQuery.addEventListener('change', updateViewport)\n }\n\n responsiveModeInitialized = true\n })\n\n const renderSidebar = (mobile: boolean) => {\n let element: HTMLElement | undefined\n const context: ContextualSidebarRenderContext = {\n mobile,\n portalMount: () => (mobile ? portalMount() : undefined),\n }\n const navigationId = `${id}-${mobile ? 'mobile' : 'desktop'}`\n\n onCleanup(() => {\n if (mobile && mobileMount()?.element === element) setMobileMount(undefined)\n if (!mobile && desktopSidebar === element) desktopSidebar = undefined\n element = undefined\n props.onSidebarElement?.(undefined, mobile)\n })\n\n return (\n <SidebarNav\n as=\"aside\"\n id={navigationId}\n aria-label={props.label}\n aria-hidden={!mobile && !props.open ? 'true' : undefined}\n inert={!mobile && !props.open}\n data-contextual-sidebar={mobile ? 'mobile' : 'desktop'}\n data-open={mobile ? undefined : String(props.open)}\n ref={(node) => {\n element = node\n if (!mobile) desktopSidebar = node\n if (mobile) {\n setMobileMount({ element: node, connected: node.isConnected })\n queueMicrotask(() => {\n if (node.isConnected && mobileMount()?.element === node)\n setMobileMount({ element: node, connected: true })\n })\n }\n props.onSidebarElement?.(node, mobile)\n }}\n class={cn('relative h-full w-full max-w-full', props.sidebarClass)}\n >\n <Show when={!mobile && props.open}>\n <PixelResizeHandle\n // The ruler spans the sidebar as a pointer-events-none overlay; lift\n // it above the neighbouring pane so the edge stays grabbable.\n class=\"z-(--z-docked)\"\n side=\"left\"\n value={props.width}\n minimum={props.minimum}\n maximum={props.maximum}\n step={props.step}\n label={resizeLabel()}\n grip={props.resizeGrip ?? 'rung'}\n controls={navigationId}\n onChange={props.onWidthChange}\n onCommit={props.onWidthCommit}\n />\n </Show>\n <Show when={!mobile || mobileMount()?.connected}>\n <Show\n when={mobile || props.titleVisibility !== 'mobile' || props.header}\n fallback={\n <SidebarNavTitle as={props.headingAs ?? 'h2'} class=\"sr-only\">\n {props.title}\n </SidebarNavTitle>\n }\n >\n <SidebarNavHeader class={cn(mobile && 'pe-12', props.headerClass)}>\n <SidebarNavTitle as={props.headingAs ?? 'h2'}>{props.title}</SidebarNavTitle>\n {props.header?.(context)}\n </SidebarNavHeader>\n </Show>\n <SidebarNavContent class={props.contentClass}>{props.content(context)}</SidebarNavContent>\n {props.footer ? (\n <SidebarNavFooter class={props.footerClass}>{props.footer(context)}</SidebarNavFooter>\n ) : null}\n </Show>\n </SidebarNav>\n )\n }\n\n return (\n <>\n <Show when={!isMobile()}>{(_wide) => renderSidebar(false)}</Show>\n <Show when={mobileLoad()} keyed>\n {(loaded) => {\n if ('error' in loaded) throw loaded.error\n return (\n <loaded.MobileSidebar\n open={isMobile() && props.open}\n onOpenChange={props.onOpenChange}\n label={props.label}\n sheetClass={props.sheetClass}\n restoreFocusRef={props.restoreFocusRef}\n renderSidebar={() => renderSidebar(true)}\n />\n )\n }}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA4GA,SAAgBqD,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,UAAUC,eAAerD,aAAa,KAAK;CAClD,MAAM,CAACsD,YAAYC,iBAAiBvD,aAAyB;CAC7D,IAAIwD,uBAAuB;CAC3B,IAAIC,oBAAoB;CACxB,IAAIC,oBAAoB;CACxB,IAAIC,4BAA4B;CAChC,IAAIzC;CACJ,IAAI0C,uBAAuB;CAC3B,IAAIC;CACJ,IAAIC,WAAW;CACf5D,gBAAgB;EACd4D,WAAW;EACXF,wBAAwB;CAC1B,CAAC;CAED,MAAMG,cAAcC,MAAeC,mBAA4B;EAG7D,IAAIJ,gBAAgBG,MAAM;EAC1B,MAAME,WAAW/D,QAAQiD,QAAQ;EACjC,MAAMe,UAAUR,6BAA6BO,aAAaF;EAC1D,MAAMI,aACJD,WAAWN,gBAAgBQ,KAAAA,IAAY,EAAET,uBAAuBA;EAClEC,cAAcG;EACd,MAAMrC,QAAQ;GACZX,MAAMkD,WAAY,WAAsB;GACxCjD,IAAI+C,OAAQ,WAAsB;GAClC9C;EACF;EACA,IAAI;GACF,IAAIiD,SAAShE,cAAcgD,MAAMzB,6BAA6B;IAAE,GAAGC;IAAOZ,OAAO;GAAS,CAAC,CAAC;GAC5F,IAAI+C,YAAYM,eAAeR,sBAAsB;GACrD,IAAIK,gBAAgB9D,cAAcgD,MAAM3B,aAAa,KAAK,CAAC;GAC3D,IAAIsC,YAAYM,eAAeR,sBAAsB;GACrD,IAAII,MAAMM,WAAW;GACrBjB,YAAYW,IAAI;GAChB,IAAIG,SACFI,qBAAqB;IACnB,IAAI,CAACT,YAAYM,eA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AEA,OAAA,CAAAmD,gBAEKnG,MAAI;EAAA,IAAC0G,OAAI;GAAA,OAAE,CAACnD,SAAS;EAAC;EAAAkD,WAAIU,UAAUlB,cAAc,KAAK;CAAC,CAAA,GAAAE,gBACxDnG,MAAI;EAAA,IAAC0G,OAAI;GAAA,OAAEjD,WAAW;EAAC;EAAE2D,OAAK;EAAAX,WAC3BY,WAAW;GACX,IAAI,WAAWA,QAAQ,MAAMA,OAAOtG;GACpC,OAAAoF,gBACGkB,OAAOC,eAAa;IAAA,IACnB5F,OAAI;KAAA,OAAEwF,WAAA,CAAA,CAAA3D,SAAS,CAAC,CAAA,CAAA,KAAID,MAAM5B;IAAI;IAAA,IAC9BC,eAAY;KAAA,OAAE2B,MAAM3B;IAAY;IAAA,IAChCJ,QAAK;KAAA,OAAE+B,MAAM/B;IAAK;IAAA,IAClBmB,aAAU;KAAA,OAAEY,MAAMZ;IAAU;IAAA,IAC5BJ,kBAAe;KAAA,OAAEgB,MAAMhB;IAAe;IACtC2D,qBAAqBA,cAAc,IAAI;GAAC,CAAA;EAG9C;CAAC,CAAA,CAAA;AAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-contextual-sidebar.js","names":["
|
|
1
|
+
{"version":3,"file":"mobile-contextual-sidebar.js","names":["cn","Sheet","SheetContent","open","onOpenChange","label","sheetClass","restoreFocusRef","renderSidebar","MobileSidebar","props","_$createComponent","children","side"],"sources":["../../../../src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Sheet, SheetContent } from '../../ui/sheet'\n\nexport type MobileContextualSidebarProps = {\n open: boolean\n onOpenChange(open: boolean): void\n label: string\n sheetClass?: string\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n renderSidebar(): JSX.Element\n}\n\n/** Sheet wrappers are loaded only when a contextual sidebar enters mobile mode. */\nexport function MobileSidebar(props: MobileContextualSidebarProps) {\n return (\n <Sheet open={props.open} onOpenChange={props.onOpenChange}>\n <SheetContent\n side=\"start\"\n aria-label={props.label}\n // The sheet leaves the app rail visible beside it: at most 19rem, never\n // under 9rem, and otherwise the viewport less the rail's width.\n class={cn(\n 'w-[min(19rem,max(9rem,calc(100vw-var(--rail-width))))] max-w-[min(19rem,max(9rem,calc(100vw-var(--rail-width))))] gap-0 p-0',\n props.sheetClass\n )}\n restoreFocusRef={props.restoreFocusRef}\n >\n {props.renderSidebar()}\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;AAcA,SAAgBS,cAAcC,OAAqC;CACjE,OAAAC,gBACGV,OAAK;EAAA,IAACE,OAAI;GAAA,OAAEO,MAAMP;EAAI;EAAA,IAAEC,eAAY;GAAA,OAAEM,MAAMN;EAAY;EAAA,IAAAQ,WAAA;GAAA,OAAAD,gBACtDT,cAAY;IACXW,MAAI;IAAA,KAAA,gBAAA;KAAA,OACQH,MAAML;IAAK;IAAA,KAAA,WAAA;KAAA,OAGhBL,GACL,+HACAU,MAAMJ,UACR;IAAC;IAAA,IACDC,kBAAe;KAAA,OAAEG,MAAMH;IAAe;IAAA,IAAAK,WAAA;KAAA,OAErCF,MAAMF,cAAc;IAAC;GAAA,CAAA;EAAA;CAAA,CAAA;AAI9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-preview.js","names":["createEffect","createSignal","onCleanup","onMount","on","JSX","Move","X","ActionButton","ScrollArea","FloatingPreviewFrame","FloatingPreviewResizeDirection","FloatingPreviewSize","resolveFloatingPreviewFrame","resizeFloatingPreview","directions","direction","class","glyph","FloatingPreviewProps","label","source","onClose","actions","Element","children","FloatingPreview","props","frame","setFrame","x","y","width","height","bounds","HTMLDivElement","observer","ResizeObserver","gesture","id","start","measure","rect","getBoundingClientRect","current","position","container","const","defer","observe","disconnect","event","PointerEvent","button","preventDefault","stopPropagation","pointerId","clientX","clientY","currentTarget","HTMLElement","setPointerCapture","move","delta","end","undefined","keyboardMove","KeyboardEvent","key","keyboardResize","startsWith","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_ref$","_$use","_$insert","_$createComponent","type","variant","size","aria-label","tooltip","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onLostPointerCapture","onKeyDown","_c$","_$memo","onClick","role","tabIndex","map","className","_el$5","_tmpl$2","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","e","_$setAttribute","t","a","_$setStyleProperty","o","i","n","_$use","_$createComponent","_$memo","_$setAttribute","_$setStyleProperty"],"sources":["../../../../src/components/layout/floating-preview/floating-preview.tsx"],"sourcesContent":["import { createEffect, createSignal, onCleanup, onMount, on, type JSX } from 'solid-js'\nimport { Move, X } from 'lucide-solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n type FloatingPreviewFrame,\n type FloatingPreviewResizeDirection,\n type FloatingPreviewSize,\n resolveFloatingPreviewFrame,\n resizeFloatingPreview,\n} from './model'\n\nconst directions: readonly {\n direction: FloatingPreviewResizeDirection\n class: string\n glyph: string\n}[] = [\n {\n direction: 'north',\n class: 'absolute -top-3 right-6 left-6 h-control-xs w-auto cursor-ns-resize touch-none',\n glyph: '↕',\n },\n {\n direction: 'south',\n class: 'absolute -bottom-3 right-6 left-6 h-control-xs w-auto cursor-ns-resize touch-none',\n glyph: '↕',\n },\n {\n direction: 'east',\n class: 'absolute -right-3 top-6 bottom-6 w-6 h-auto cursor-ew-resize touch-none',\n glyph: '↔',\n },\n {\n direction: 'west',\n class: 'absolute -left-3 top-6 bottom-6 w-6 h-auto cursor-ew-resize touch-none',\n glyph: '↔',\n },\n {\n direction: 'northwest',\n class: 'absolute -top-3 -left-3 size-control-xs cursor-nwse-resize touch-none',\n glyph: '↖',\n },\n {\n direction: 'northeast',\n class: 'absolute -top-3 -right-3 size-control-xs cursor-nesw-resize touch-none',\n glyph: '↗',\n },\n {\n direction: 'southwest',\n class: 'absolute -bottom-3 -left-3 size-control-xs cursor-nesw-resize touch-none',\n glyph: '↙',\n },\n {\n direction: 'southeast',\n class: 'absolute -bottom-3 -right-3 size-control-xs cursor-nwse-resize touch-none',\n glyph: '↘',\n },\n]\n\nexport type FloatingPreviewProps = {\n label: string\n source: FloatingPreviewSize\n onClose?: () => void\n actions?: JSX.Element\n children: JSX.Element\n}\n\n/** A host-bounded movable preview frame. Content and actions remain caller-owned. */\nexport function FloatingPreview(props: FloatingPreviewProps) {\n const [frame, setFrame] = createSignal<FloatingPreviewFrame>({ x: 0, y: 0, width: 1, height: 1 })\n // oxlint-disable-next-line no-unassigned-vars -- assigned through Solid's ref callback.\n let bounds: HTMLDivElement | undefined\n let observer: ResizeObserver | undefined\n let gesture:\n | {\n id: number\n x: number\n y: number\n start: FloatingPreviewFrame\n direction: FloatingPreviewResizeDirection | null\n }\n | undefined\n\n const measure = () => {\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n setFrame((current) =>\n resolveFloatingPreviewFrame({\n width: current.width > 1 ? current.width : null,\n position: current.width > 1 ? { x: current.x, y: current.y } : null,\n source: props.source,\n container: { width: rect.width, height: rect.height },\n })\n )\n }\n createEffect(\n on(\n () => [props.source.width, props.source.height] as const,\n () => measure(),\n { defer: true }\n )\n )\n onMount(() => {\n if (bounds) {\n observer = new ResizeObserver(measure)\n observer.observe(bounds)\n measure()\n }\n })\n onCleanup(() => observer?.disconnect())\n\n function start(event: PointerEvent, direction: FloatingPreviewResizeDirection | null) {\n if (event.button !== 0 || gesture) return\n event.preventDefault()\n event.stopPropagation()\n gesture = { id: event.pointerId, x: event.clientX, y: event.clientY, start: frame(), direction }\n ;(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId)\n }\n function move(event: PointerEvent) {\n if (!gesture || gesture.id !== event.pointerId) return\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n const container = { width: rect.width, height: rect.height }\n const delta = { x: event.clientX - gesture.x, y: event.clientY - gesture.y }\n setFrame(\n gesture.direction\n ? resizeFloatingPreview({\n start: gesture.start,\n direction: gesture.direction,\n delta,\n source: props.source,\n container,\n })\n : resolveFloatingPreviewFrame({\n width: gesture.start.width,\n position: { x: gesture.start.x + delta.x, y: gesture.start.y + delta.y },\n source: props.source,\n container,\n })\n )\n }\n function end(event: PointerEvent) {\n if (gesture?.id === event.pointerId) gesture = undefined\n }\n function keyboardMove(event: KeyboardEvent) {\n const delta = { x: 0, y: 0 }\n if (event.key === 'ArrowLeft') delta.x = -10\n else if (event.key === 'ArrowRight') delta.x = 10\n else if (event.key === 'ArrowUp') delta.y = -10\n else if (event.key === 'ArrowDown') delta.y = 10\n else return\n event.preventDefault()\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n const current = frame()\n setFrame(\n resolveFloatingPreviewFrame({\n width: current.width,\n position: { x: current.x + delta.x, y: current.y + delta.y },\n source: props.source,\n container: { width: rect.width, height: rect.height },\n })\n )\n }\n function keyboardResize(event: KeyboardEvent, direction: FloatingPreviewResizeDirection) {\n if (!event.key.startsWith('Arrow')) return\n event.preventDefault()\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n const delta = {\n x: event.key === 'ArrowRight' ? 10 : event.key === 'ArrowLeft' ? -10 : 0,\n y: event.key === 'ArrowDown' ? 10 : event.key === 'ArrowUp' ? -10 : 0,\n }\n setFrame(\n resizeFloatingPreview({\n start: frame(),\n direction,\n delta,\n source: props.source,\n container: { width: rect.width, height: rect.height },\n })\n )\n }\n\n return (\n <div\n ref={bounds}\n class=\"pointer-events-none absolute inset-0 z-(--z-sticky) overflow-hidden\"\n aria-label={props.label}\n >\n <section\n class=\"pointer-events-auto absolute flex flex-col overflow-visible rounded-lg border border-border bg-card text-card-foreground shadow-lg\"\n aria-label={props.label}\n style={{\n left: `${frame().x}px`,\n top: `${frame().y}px`,\n width: `${frame().width}px`,\n height: `${frame().height}px`,\n }}\n >\n <header class=\"flex h-control-sm items-center gap-1 border-b border-border p-1\">\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n class=\"flex-1 cursor-move touch-none\"\n aria-label={`Move ${props.label}`}\n tooltip={`Move ${props.label}. Use arrow keys to adjust its position.`}\n onPointerDown={(event) => start(event, null)}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onLostPointerCapture={end}\n onKeyDown={keyboardMove}\n >\n <>\n <Move aria-hidden=\"true\" />\n Move\n </>\n </ActionButton>\n <div class=\"flex items-center gap-1\">{props.actions}</div>\n {props.onClose && (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={`Close ${props.label}`}\n tooltip={`Close ${props.label}.`}\n onClick={props.onClose}\n >\n <X aria-hidden=\"true\" />\n </ActionButton>\n )}\n </header>\n <ScrollArea role=\"region\" aria-label={`${props.label} content`} class=\"flex-1\" tabIndex={0}>\n {props.children}\n </ScrollArea>\n {directions.map(({ direction, class: className, glyph }) => (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n class={className}\n data-direction={direction}\n aria-label={`Resize ${props.label} ${direction}`}\n tooltip={`Resize ${props.label} from the ${direction} edge. Use arrow keys to resize.`}\n onPointerDown={(event) => start(event, direction)}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onLostPointerCapture={end}\n onKeyDown={(event) => keyboardResize(event, direction)}\n >\n <span aria-hidden=\"true\">{glyph}</span>\n </ActionButton>\n ))}\n </section>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAYA,IAAMe,aAIA;CACJ;EACEC,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;E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AAA,IAAA0E,QAAAC,QAAA;IAAArB,OAAAoB,OAE5BjF,KAAK;IAAA,OAAAiF;GAAA;EAAA,CAAA,CAElC,GAAC,IAAA;EAAAE,QAAAC,QAAA;GAAA,IAAAC,MAnEQ5E,MAAMP,OAAKoF,OAIT7E,MAAMP,OAAKqF,OAEf,GAAG7E,MAAM,CAAC,CAACE,EAAC,KAAI4E,OACjB,GAAG9E,MAAM,CAAC,CAACG,EAAC,KAAI4E,OACd,GAAG/E,MAAM,CAAC,CAACI,MAAK,KAAI4E,OACnB,GAAGhF,MAAM,CAAC,CAACK,OAAM;GAAIsE,QAAAD,IAAAO,KAAAC,aAAAvC,MAAA,cAAA+B,IAAAO,IAAAN,GAAA;GAAAC,SAAAF,IAAAS,KAAAD,aAAArC,OAAA,cAAA6B,IAAAS,IAAAP,IAAA;GAAAC,SAAAH,IAAAU,KAAAC,iBAAAxC,OAAA,QAAA6B,IAAAU,IAAAP,IAAA;GAAAC,SAAAJ,IAAAY,KAAAD,iBAAAxC,OAAA,OAAA6B,IAAAY,IAAAR,IAAA;GAAAC,SAAAL,IAAAa,KAAAF,iBAAAxC,OAAA,SAAA6B,IAAAa,IAAAR,IAAA;GAAAC,SAAAN,IAAAc,KAAAH,iBAAAxC,OAAA,UAAA6B,IAAAc,IAAAR,IAAA;GAAA,OAAAN;EAAA,GAAA;GAAAO,GAAA5C,KAAAA;GAAA8C,GAAA9C,KAAAA;GAAA+C,GAAA/C,KAAAA;GAAAiD,GAAAjD,KAAAA;GAAAkD,GAAAlD,KAAAA;GAAAmD,GAAAnD,KAAAA;EAAA,CAAA;EAAA,OAAAM;CAAA,EAAA,CAAA;AA8DvC"}
|
|
1
|
+
{"version":3,"file":"floating-preview.js","names":["createEffect","createSignal","onCleanup","onMount","on","Move","X","ActionButton","ScrollArea","resolveFloatingPreviewFrame","resizeFloatingPreview","directions","direction","class","glyph","label","source","onClose","actions","children","FloatingPreview","props","frame","setFrame","x","y","width","height","bounds","observer","ResizeObserver","gesture","id","start","measure","rect","getBoundingClientRect","current","position","container","defer","observe","disconnect","event","button","preventDefault","stopPropagation","pointerId","clientX","clientY","currentTarget","setPointerCapture","move","delta","end","undefined","keyboardMove","key","keyboardResize","startsWith","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_ref$","_$use","_$insert","_$createComponent","type","variant","size","tooltip","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onLostPointerCapture","onKeyDown","_c$","_$memo","onClick","role","tabIndex","map","className","_el$5","_tmpl$2","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","e","_$setAttribute","t","a","_$setStyleProperty","o","i","n"],"sources":["../../../../src/components/layout/floating-preview/floating-preview.tsx"],"sourcesContent":["import { createEffect, createSignal, onCleanup, onMount, on, type JSX } from 'solid-js'\nimport { Move, X } from 'lucide-solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n type FloatingPreviewFrame,\n type FloatingPreviewResizeDirection,\n type FloatingPreviewSize,\n resolveFloatingPreviewFrame,\n resizeFloatingPreview,\n} from './model'\n\nconst directions: readonly {\n direction: FloatingPreviewResizeDirection\n class: string\n glyph: string\n}[] = [\n {\n direction: 'north',\n class: 'absolute -top-3 right-6 left-6 h-control-xs w-auto cursor-ns-resize touch-none',\n glyph: '↕',\n },\n {\n direction: 'south',\n class: 'absolute -bottom-3 right-6 left-6 h-control-xs w-auto cursor-ns-resize touch-none',\n glyph: '↕',\n },\n {\n direction: 'east',\n class: 'absolute -right-3 top-6 bottom-6 w-6 h-auto cursor-ew-resize touch-none',\n glyph: '↔',\n },\n {\n direction: 'west',\n class: 'absolute -left-3 top-6 bottom-6 w-6 h-auto cursor-ew-resize touch-none',\n glyph: '↔',\n },\n {\n direction: 'northwest',\n class: 'absolute -top-3 -left-3 size-control-xs cursor-nwse-resize touch-none',\n glyph: '↖',\n },\n {\n direction: 'northeast',\n class: 'absolute -top-3 -right-3 size-control-xs cursor-nesw-resize touch-none',\n glyph: '↗',\n },\n {\n direction: 'southwest',\n class: 'absolute -bottom-3 -left-3 size-control-xs cursor-nesw-resize touch-none',\n glyph: '↙',\n },\n {\n direction: 'southeast',\n class: 'absolute -bottom-3 -right-3 size-control-xs cursor-nwse-resize touch-none',\n glyph: '↘',\n },\n]\n\nexport type FloatingPreviewProps = {\n label: string\n source: FloatingPreviewSize\n onClose?: () => void\n actions?: JSX.Element\n children: JSX.Element\n}\n\n/** A host-bounded movable preview frame. Content and actions remain caller-owned. */\nexport function FloatingPreview(props: FloatingPreviewProps) {\n const [frame, setFrame] = createSignal<FloatingPreviewFrame>({ x: 0, y: 0, width: 1, height: 1 })\n // oxlint-disable-next-line no-unassigned-vars -- assigned through Solid's ref callback.\n let bounds: HTMLDivElement | undefined\n let observer: ResizeObserver | undefined\n let gesture:\n | {\n id: number\n x: number\n y: number\n start: FloatingPreviewFrame\n direction: FloatingPreviewResizeDirection | null\n }\n | undefined\n\n const measure = () => {\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n setFrame((current) =>\n resolveFloatingPreviewFrame({\n width: current.width > 1 ? current.width : null,\n position: current.width > 1 ? { x: current.x, y: current.y } : null,\n source: props.source,\n container: { width: rect.width, height: rect.height },\n })\n )\n }\n createEffect(\n on(\n () => [props.source.width, props.source.height] as const,\n () => measure(),\n { defer: true }\n )\n )\n onMount(() => {\n if (bounds) {\n observer = new ResizeObserver(measure)\n observer.observe(bounds)\n measure()\n }\n })\n onCleanup(() => observer?.disconnect())\n\n function start(event: PointerEvent, direction: FloatingPreviewResizeDirection | null) {\n if (event.button !== 0 || gesture) return\n event.preventDefault()\n event.stopPropagation()\n gesture = { id: event.pointerId, x: event.clientX, y: event.clientY, start: frame(), direction }\n ;(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId)\n }\n function move(event: PointerEvent) {\n if (!gesture || gesture.id !== event.pointerId) return\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n const container = { width: rect.width, height: rect.height }\n const delta = { x: event.clientX - gesture.x, y: event.clientY - gesture.y }\n setFrame(\n gesture.direction\n ? resizeFloatingPreview({\n start: gesture.start,\n direction: gesture.direction,\n delta,\n source: props.source,\n container,\n })\n : resolveFloatingPreviewFrame({\n width: gesture.start.width,\n position: { x: gesture.start.x + delta.x, y: gesture.start.y + delta.y },\n source: props.source,\n container,\n })\n )\n }\n function end(event: PointerEvent) {\n if (gesture?.id === event.pointerId) gesture = undefined\n }\n function keyboardMove(event: KeyboardEvent) {\n const delta = { x: 0, y: 0 }\n if (event.key === 'ArrowLeft') delta.x = -10\n else if (event.key === 'ArrowRight') delta.x = 10\n else if (event.key === 'ArrowUp') delta.y = -10\n else if (event.key === 'ArrowDown') delta.y = 10\n else return\n event.preventDefault()\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n const current = frame()\n setFrame(\n resolveFloatingPreviewFrame({\n width: current.width,\n position: { x: current.x + delta.x, y: current.y + delta.y },\n source: props.source,\n container: { width: rect.width, height: rect.height },\n })\n )\n }\n function keyboardResize(event: KeyboardEvent, direction: FloatingPreviewResizeDirection) {\n if (!event.key.startsWith('Arrow')) return\n event.preventDefault()\n const rect = bounds?.getBoundingClientRect()\n if (!rect) return\n const delta = {\n x: event.key === 'ArrowRight' ? 10 : event.key === 'ArrowLeft' ? -10 : 0,\n y: event.key === 'ArrowDown' ? 10 : event.key === 'ArrowUp' ? -10 : 0,\n }\n setFrame(\n resizeFloatingPreview({\n start: frame(),\n direction,\n delta,\n source: props.source,\n container: { width: rect.width, height: rect.height },\n })\n )\n }\n\n return (\n <div\n ref={bounds}\n class=\"pointer-events-none absolute inset-0 z-(--z-sticky) overflow-hidden\"\n aria-label={props.label}\n >\n <section\n class=\"pointer-events-auto absolute flex flex-col overflow-visible rounded-lg border border-border bg-card text-card-foreground shadow-lg\"\n aria-label={props.label}\n style={{\n left: `${frame().x}px`,\n top: `${frame().y}px`,\n width: `${frame().width}px`,\n height: `${frame().height}px`,\n }}\n >\n <header class=\"flex h-control-sm items-center gap-1 border-b border-border p-1\">\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n class=\"flex-1 cursor-move touch-none\"\n aria-label={`Move ${props.label}`}\n tooltip={`Move ${props.label}. Use arrow keys to adjust its position.`}\n onPointerDown={(event) => start(event, null)}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onLostPointerCapture={end}\n onKeyDown={keyboardMove}\n >\n <>\n <Move aria-hidden=\"true\" />\n Move\n </>\n </ActionButton>\n <div class=\"flex items-center gap-1\">{props.actions}</div>\n {props.onClose && (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={`Close ${props.label}`}\n tooltip={`Close ${props.label}.`}\n onClick={props.onClose}\n >\n <X aria-hidden=\"true\" />\n </ActionButton>\n )}\n </header>\n <ScrollArea role=\"region\" aria-label={`${props.label} content`} class=\"flex-1\" tabIndex={0}>\n {props.children}\n </ScrollArea>\n {directions.map(({ direction, class: className, glyph }) => (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n class={className}\n data-direction={direction}\n aria-label={`Resize ${props.label} ${direction}`}\n tooltip={`Resize ${props.label} from the ${direction} edge. Use arrow keys to resize.`}\n onPointerDown={(event) => start(event, direction)}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onLostPointerCapture={end}\n onKeyDown={(event) => keyboardResize(event, direction)}\n >\n <span aria-hidden=\"true\">{glyph}</span>\n </ActionButton>\n ))}\n </section>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAYA,IAAMW,aAIA;CACJ;EACEC,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC,OAAO;EACPC,OAAO;CACT;CACA;EACEF,WAAW;EACXC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AO,WAAA;IAAA,IAAAoE,QAAAC,QAAA;IAAApB,OAAAmB,OAE5BzE,KAAK;IAAA,OAAAyE;GAAA;EAAA,CAAA,CAElC,GAAC,IAAA;EAAAE,QAAAC,QAAA;GAAA,IAAAC,MAnEQtE,MAAMN,OAAK6E,OAITvE,MAAMN,OAAK8E,OAEf,GAAGvE,MAAM,CAAC,CAACE,EAAC,KAAIsE,OACjB,GAAGxE,MAAM,CAAC,CAACG,EAAC,KAAIsE,OACd,GAAGzE,MAAM,CAAC,CAACI,MAAK,KAAIsE,OACnB,GAAG1E,MAAM,CAAC,CAACK,OAAM;GAAIgE,QAAAD,IAAAO,KAAAC,aAAAtC,MAAA,cAAA8B,IAAAO,IAAAN,GAAA;GAAAC,SAAAF,IAAAS,KAAAD,aAAApC,OAAA,cAAA4B,IAAAS,IAAAP,IAAA;GAAAC,SAAAH,IAAAU,KAAAC,iBAAAvC,OAAA,QAAA4B,IAAAU,IAAAP,IAAA;GAAAC,SAAAJ,IAAAY,KAAAD,iBAAAvC,OAAA,OAAA4B,IAAAY,IAAAR,IAAA;GAAAC,SAAAL,IAAAa,KAAAF,iBAAAvC,OAAA,SAAA4B,IAAAa,IAAAR,IAAA;GAAAC,SAAAN,IAAAc,KAAAH,iBAAAvC,OAAA,UAAA4B,IAAAc,IAAAR,IAAA;GAAA,OAAAN;EAAA,GAAA;GAAAO,GAAA1C,KAAAA;GAAA4C,GAAA5C,KAAAA;GAAA6C,GAAA7C,KAAAA;GAAA+C,GAAA/C,KAAAA;GAAAgD,GAAAhD,KAAAA;GAAAiD,GAAAjD,KAAAA;EAAA,CAAA;EAAA,OAAAK;CAAA,EAAA,CAAA;AA8DvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orbit-layout.js","names":["
|
|
1
|
+
{"version":3,"file":"orbit-layout.js","names":["createContext","createMemo","splitProps","useContext","cn","DEFAULT_ORBIT_RADIUS","OrbitRadiusContext","OrbitModeContext","resolveRadius","radius","Number","isFinite","Math","max","trim","style","mode","OrbitLayout","props","local","rest","_$createComponent","Provider","value","children","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","index","count","OrbitItem","inheritedRadius","inheritedMode","undefined","angle","trunc","PI","positionStyle","top","left","translate","_el$2"],"sources":["../../../../src/components/layout/orbit-layout/orbit-layout.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { createContext, createMemo, splitProps, useContext, type Accessor } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/** A CSS length or expression used to place an item away from the orbit center. */\nexport type OrbitRadius = number | string\nexport type OrbitLayoutMode = 'radial' | 'flow'\n\nconst DEFAULT_ORBIT_RADIUS = 'calc(50% - 2rem)'\nconst OrbitRadiusContext = createContext<Accessor<string>>()\nconst OrbitModeContext = createContext<Accessor<OrbitLayoutMode>>()\n\nfunction resolveRadius(radius: OrbitRadius | undefined): string {\n if (typeof radius === 'number') return `${Number.isFinite(radius) ? Math.max(0, radius) : 0}px`\n return radius?.trim() || DEFAULT_ORBIT_RADIUS\n}\n\n/**\n * OrbitLayout.\n *\n * Provides a positioned canvas and a shared radius for its OrbitItems. It does\n * not assign list semantics or alter DOM order: callers choose semantics, and\n * keyboard and screen-reader order remain the source order of the children.\n */\nexport type OrbitLayoutProps = Omit<ComponentProps<'div'>, 'style'> & {\n /** JSX style props are owned by this geometry primitive. */\n style?: never\n /** Responsive radius used by every OrbitItem unless that item overrides it. */\n radius?: OrbitRadius\n /** `flow` places items in source order; `radial` positions them around the host. */\n mode?: OrbitLayoutMode\n}\n\nexport function OrbitLayout(props: OrbitLayoutProps) {\n const [local, rest] = splitProps(props, ['class', 'radius', 'mode', 'style', 'children'])\n const radius = createMemo(() => resolveRadius(local.radius))\n const mode = createMemo(() => local.mode ?? 'radial')\n\n return (\n <OrbitRadiusContext.Provider value={radius}>\n <OrbitModeContext.Provider value={mode}>\n <div\n {...rest}\n data-slot=\"orbit-layout\"\n class={cn(mode() === 'flow' ? 'grid gap-3' : 'relative size-full', local.class)}\n >\n {local.children}\n </div>\n </OrbitModeContext.Provider>\n </OrbitRadiusContext.Provider>\n )\n}\n\n/**\n * OrbitItem.\n *\n * Positions one ordinary child around its OrbitLayout. This is geometry only:\n * the wrapper has no role, tabindex, or interaction of its own.\n */\nexport type OrbitItemProps = Omit<ComponentProps<'div'>, 'style'> & {\n /** JSX style props are owned by this geometry primitive. */\n style?: never\n /**\n * Zero-based position in the rendered sequence. Index 0 sits at three o'clock\n * (the positive x axis) and the sequence runs clockwise, because the y axis\n * points down the screen: with four items, 0 is east, 1 south, 2 west, 3 north.\n */\n index: number\n /** Number of items sharing this orbit. */\n count: number\n /** Per-item override for OrbitLayout's responsive radius. */\n radius?: OrbitRadius\n}\n\nexport function OrbitItem(props: OrbitItemProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'index',\n 'count',\n 'radius',\n 'style',\n 'children',\n ])\n const inheritedRadius = useContext(OrbitRadiusContext)\n const inheritedMode = useContext(OrbitModeContext)\n const mode = () => inheritedMode?.() ?? 'radial'\n const radius = () =>\n local.radius !== undefined\n ? resolveRadius(local.radius)\n : (inheritedRadius?.() ?? DEFAULT_ORBIT_RADIUS)\n const angle = createMemo(() => {\n const count = Number.isFinite(local.count) ? Math.max(1, Math.trunc(local.count)) : 1\n const rawIndex = Number.isFinite(local.index) ? Math.trunc(local.index) : 0\n const index = ((rawIndex % count) + count) % count\n return `${(index / count) * Math.PI * 2}rad`\n })\n const positionStyle = () =>\n mode() === 'flow'\n ? undefined\n : {\n top: `calc(50% + sin(${angle()}) * ${radius()})`,\n left: `calc(50% + cos(${angle()}) * ${radius()})`,\n translate: '-50% -50%',\n }\n\n return (\n <div\n {...rest}\n data-slot=\"orbit-item\"\n class={cn(mode() === 'flow' ? undefined : 'absolute', local.class)}\n style={positionStyle()}\n >\n {local.children}\n </div>\n )\n}\n"],"mappings":";;;;;AAQA,IAAMK,uBAAuB;AAC7B,IAAMC,qBAAqBN,cAAgC;AAC3D,IAAMO,mBAAmBP,cAA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AAQtB,OAAOC,SAASQ,MAAMa,KAAK,IAAIpB,KAAKC,IAAI,GAAGD,KAAK0B,MAAMnB,MAAMa,KAAK,CAAC,IAAI;EAGpF,OAAO,KAFUtB,OAAOC,SAASQ,MAAMY,KAAK,IAAInB,KAAK0B,MAAMnB,MAAMY,KAAK,IAAI,KAC/CC,QAASA,SAASA,QAC1BA,QAASpB,KAAK2B,KAAK,EAAC;CACzC,CAAC;CACD,MAAMC,sBACJxB,KAAK,MAAM,SACPoB,KAAAA,IACA;EACEK,KAAK,kBAAkBJ,MAAM,EAAC,MAAO5B,OAAO,EAAC;EAC7CiC,MAAM,kBAAkBL,MAAM,EAAC,MAAO5B,OAAO,EAAC;EAC9CkC,WAAW;CACb;CAEN,cAAA;EAAA,IAAAC,QAAAlB,OAAA;EAAAC,OAAAiB,OAAAhB,WAEQR,MAAI;GAAA,aACE;GAAY,KAAA,WAAA;IAAA,OACfhB,GAAGY,KAAK,MAAM,SAASoB,KAAAA,IAAY,YAAYjB,MAAMU,KAAK;GAAC;GAAA,IAClEd,QAAK;IAAA,OAAEyB,cAAc;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAAV,OAAAc,aAErBzB,MAAMK,QAAQ;EAAA,OAAAoB;CAAA,EAAA,CAAA;AAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","names":["
|
|
1
|
+
{"version":3,"file":"page.js","names":["Show","splitProps","cn","Heading","headingVariants","PageHeader","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","PageHeaderContent","_el$2","_tmpl$2","PageHeaderTitle","_el$3","_tmpl$3","size","PageHeaderDescription","_el$4","_tmpl$4","PageHeaderActions","_el$5","_tmpl$5","PageSection","title","description","action","_el$6","_tmpl$9","_$insert","_$createComponent","when","children","_el$7","_tmpl$8","_el$8","firstChild","_el$9","_tmpl$6","_el$0","_tmpl$7","Page","_el$1","_tmpl$0"],"sources":["../../../../src/components/layout/page/page.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Heading, headingVariants } from '../../ui/typography'\n\n/**\n * PageHeader.\n *\n * The title block at the top of a scrollable page: where the user is, what this\n * page is, and the actions that apply to the whole of it.\n *\n * The action slot is single and singular on purpose. A page header with four\n * equally-weighted buttons has not decided what the page is for; the design\n * system can only make that look tidy, not make it true. Put the primary action\n * here and the rest in an overflow menu or on the rows they belong to.\n */\nexport function PageHeader(props: ComponentProps<'header'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <header\n data-slot=\"page-header\"\n class={cn(\n 'flex shrink-0 flex-wrap items-start justify-between gap-x-4 gap-y-3 px-5 pt-5 pb-4',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function PageHeaderContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"page-header-content\"\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PageHeaderTitle(props: ComponentProps<'h1'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <h1\n data-slot=\"page-header-title\"\n class={cn(headingVariants({ size: 'page' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function PageHeaderDescription(props: ComponentProps<'p'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <p\n data-slot=\"page-header-description\"\n class={cn('max-w-prose text-sm text-muted-foreground text-pretty', local.class)}\n {...rest}\n />\n )\n}\n\n/** The trailing action group. One primary action, at most. */\nexport function PageHeaderActions(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"page-header-actions\"\n class={cn('flex shrink-0 items-center gap-2', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * A section inside a page, with an optional title and a description.\n * Sections are separated by space rather than by rules — a page of boxed\n * sections reads as a dashboard, and most pages are not one.\n */\nexport function PageSection(\n props: ComponentProps<'section'> & { title?: string; description?: string; action?: JSX.Element }\n) {\n const [local, rest] = splitProps(props, ['class', 'title', 'description', 'action', 'children'])\n\n return (\n <section\n data-slot=\"page-section\"\n class={cn('flex flex-col gap-3 px-5 py-4', local.class)}\n {...rest}\n >\n <Show when={local.title}>\n <div class=\"flex items-baseline justify-between gap-3\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <Heading size=\"section\">{local.title}</Heading>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {local.description}\n </p>\n </Show>\n </div>\n <Show when={local.action}>\n <div class=\"flex shrink-0 items-center gap-2\">{local.action}</div>\n </Show>\n </div>\n </Show>\n {local.children}\n </section>\n )\n}\n\n/** The scroll container a page's header and sections sit in. */\nexport function Page(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAgBK,WAAWC,OAAiC;CAC1D,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GACL,sFACAK,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBK,kBAAkBR,OAA8B;CAC9D,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAS,QAAAC,QAAA;EAAAL,OAAAI,OAAAH,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GAAG,+BAA+BK,MAAMM,KAAK;EAAC,EAAA,GACjDL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAO;CAAA,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
1
|
+
{"version":3,"file":"panel.js","names":["Show","splitProps","cn","Panel","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","PanelCard","_$createComponent","PanelHeader","_el$2","_tmpl$2","PanelTitle","_el$3","_tmpl$3","PanelDescription","_el$4","_tmpl$4","PanelActions","_el$5","_tmpl$5","PanelToolbar","_el$6","_tmpl$6","PanelBody","bare","_el$7","_tmpl$7","PanelFooter","_el$8","_tmpl$8","PanelPlaceholder","_el$9","_tmpl$9","_$insert","when","children"],"sources":["../../../../src/components/layout/panel/panel.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Panel.\n *\n * A titled region inside the content area — an editor, an inspector, a list, a\n * terminal. It is the third level of surface after the shell and the sidebar,\n * and like them its parts are fixed: a header with a title and a toolbar, a\n * scrolling body, an optional footer.\n *\n * The body scrolls and the header does not, which is the whole reason this is a\n * component. A panel whose header scrolls away loses the name of what the user\n * is looking at, and every hand-built panel gets this wrong at least once.\n *\n * Component props are `title`-agnostic on purpose: the panel does not decide\n * how large its title is, so an inspector's title and an editor's title agree.\n */\nexport function Panel(props: ComponentProps<'section'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <section\n data-slot=\"panel\"\n class={cn(\n 'bg-surface flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A panel whose surface is raised, for a panel floating over the canvas. */\nexport function PanelCard(props: ComponentProps<'section'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <Panel\n class={cn(\n 'bg-card m-2 h-[calc(100%-1rem)] rounded-xl border border-border shadow-xs',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function PanelHeader(props: ComponentProps<'header'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <header\n data-slot=\"panel-header\"\n class={cn(\n 'flex min-h-(--topbar-height) shrink-0 items-center gap-2 border-b border-border px-3',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function PanelTitle(props: ComponentProps<'h2'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <h2\n data-slot=\"panel-title\"\n class={cn('min-w-0 truncate text-sm font-semibold tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PanelDescription(props: ComponentProps<'p'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <p\n data-slot=\"panel-description\"\n class={cn('truncate text-xs text-muted-foreground', local.class)}\n {...rest}\n />\n )\n}\n\n/** The trailing group in a panel header: buttons, tabs, a menu. */\nexport function PanelActions(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"panel-actions\"\n class={cn('ms-auto flex shrink-0 items-center gap-1', local.class)}\n {...rest}\n />\n )\n}\n\n/** A secondary row under the header: a toolbar, tabs, a filter bar. */\nexport function PanelToolbar(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"panel-toolbar\"\n class={cn(\n 'flex min-h-9 shrink-0 items-center gap-1.5 border-b border-border px-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * The scrolling region.\n *\n * `min-h-0` is required and easy to omit: a flex child's default `min-height`\n * is its content, so without it a long body pushes the panel past its parent\n * instead of scrolling.\n */\nexport function PanelBody(\n props: ComponentProps<'div'> & { /** Remove the default padding. */ bare?: boolean }\n) {\n const [local, rest] = splitProps(props, ['class', 'bare'])\n\n return (\n <div\n data-slot=\"panel-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto', { 'p-3': !local.bare }, local.class)}\n {...rest}\n />\n )\n}\n\nexport function PanelFooter(props: ComponentProps<'footer'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <footer\n data-slot=\"panel-footer\"\n class={cn('flex shrink-0 items-center gap-2 border-t border-border px-3 py-2', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The centered message a panel shows when it has no content. Distinct from\n * `Empty`, which is a full-page state with room for media and actions; this is\n * the in-pane version, sized for a column.\n */\nexport function PanelPlaceholder(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <div\n data-slot=\"panel-placeholder\"\n class={cn(\n 'text-muted-foreground flex h-full min-h-32 flex-col items-center justify-center gap-2 p-6 text-center text-sm',\n local.class\n )}\n {...rest}\n >\n <Show when={local.children}>{local.children}</Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAgBG,MAAMC,OAAkC;CACtD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GACL,0EACAG,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd;;AAGA,SAAgBK,UAAUR,OAAkC;CAC1D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAS,gBACGV,OAAKO,WAAA,EAAA,KAAA,WAAA;EAAA,OACGR,GACL,6EACAG,MAAMM,KACR;CAAC,EAAA,GACGL,IAAI,CAAA;AAGd;AAEA,SAAgBQ,YAAYV,OAAiC;CAC3D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAW,QAAAC,QAAA;EAAAP,OAAAM,OAAAL,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GACL,wFACAG,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAS;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,WAAWb,OAA6B;CACtD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO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AEzD,cAAA;EAAA,IAAA2B,QAAAC,QAAA;EAAAvB,OAAAsB,OAAArB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GAAG,kCAAkC,EAAE,OAAO,CAACG,MAAMyB,KAAK,GAAGzB,MAAMM,KAAK;EAAC,EAAA,GAC5EL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAyB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,YAAY7B,OAAiC;CAC3D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAA8B,QAAAC,QAAA;EAAA1B,OAAAyB,OAAAxB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GAAG,qEAAqEG,MAAMM,KAAK;EAAC,EAAA,GACvFL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA4B;CAAA,EAAA,CAAA;AAGd;;;;;;AAOA,SAAgBE,iBAAiBhC,OAA8B;CAC7D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAiC,QAAAC,QAAA;EAAA7B,OAAA4B,OAAA3B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GACL,iHACAG,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAiC,OAAAF,OAAAxB,gBAEPb,MAAI;GAAA,IAACwC,OAAI;IAAA,OAAEnC,MAAMoC;GAAQ;GAAA,IAAAA,WAAA;IAAA,OAAGpC,MAAMoC;GAAQ;EAAA,CAAA,CAAA;EAAA,OAAAJ;CAAA,EAAA,CAAA;AAGjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixel-pane.js","names":["
|
|
1
|
+
{"version":3,"file":"pixel-pane.js","names":["splitProps","cn","width","PixelPane","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","undefined","style","fixedStyle","basis","Math","max","round","declarations","trim","endsWith"],"sources":["../../../../src/components/layout/pixel-pane/pixel-pane.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelPaneProps = ComponentProps<'div'> & {\n /**\n * The pane's width in CSS pixels, owned by the host. Without it the pane\n * takes the space the fixed panes leave.\n */\n width?: number\n}\n\n/**\n * PixelPane.\n *\n * One pane of a row whose widths the host keeps (for example beside a\n * `PixelResizeHandle`): a fixed pixel width, or the remaining space. It exists\n * so a consumer can give a pane a computed width without a style attribute of\n * its own, and so every such pane behaves the same way: it never grows past its\n * width, clips what does not fit, and gives way before the row overflows if the\n * host's widths briefly exceed the space (a window being resized).\n */\nexport function PixelPane(props: PixelPaneProps) {\n const [local, rest] = splitProps(props, ['width', 'class', 'style'])\n\n return (\n <div\n data-slot=\"pixel-pane\"\n {...rest}\n class={cn(\n 'min-h-0 min-w-0 overflow-hidden',\n local.width === undefined ? 'flex-1' : 'grow-0 shrink',\n local.class\n )}\n style={fixedStyle(local.style, local.width)}\n />\n )\n}\n\n/**\n * The pane's style with its width applied last, so the host's width wins over a\n * `flex-basis` of the caller's own. A string style stays a string and an object\n * style stays an object; both keep every declaration they came with.\n */\nfunction fixedStyle(\n style: JSX.CSSProperties | string | undefined,\n width: number | undefined\n): JSX.CSSProperties | string | undefined {\n if (width === undefined) return style\n const basis = `${Math.max(0, Math.round(width))}px`\n if (typeof style === 'string') {\n const declarations = style.trim()\n const separator = declarations === '' || declarations.endsWith(';') ? '' : ';'\n return `${declarations}${separator}flex-basis:${basis}`\n }\n return { ...style, 'flex-basis': basis }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAgBG,UAAUC,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO;EAAC;EAAS;EAAS;CAAO,CAAC;CAEnE,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAGQJ,MAAI;GAAA,KAAA,WAAA;IAAA,OACDL,GACL,mCACAI,MAAMH,UAAUU,KAAAA,IAAY,WAAW,iBACvCP,MAAMM,KACR;GAAC;GAAA,IACDE,QAAK;IAAA,OAAEC,WAAWT,MAAMQ,OAAOR,MAAMH,KAAK;GAAC;EAAA,CAAA,GAAA,OAAA,KAAA;EAAA,OAAAK;CAAA,EAAA,CAAA;AAGjD;;;;;;AAOA,SAASO,WACPD,OACAX,OACwC;CACxC,IAAIA,UAAUU,KAAAA,GAAW,OAAOC;CAChC,MAAME,QAAQ,GAAGC,KAAKC,IAAI,GAAGD,KAAKE,MAAMhB,KAAK,CAAC,EAAC;CAC/C,IAAI,OAAOW,UAAU,UAAU;EAC7B,MAAMM,eAAeN,MAAMO,KAAK;EAEhC,OAAO,GAAGD,eADQA,iBAAiB,MAAMA,aAAaE,SAAS,GAAG,IAAI,KAAK,IACzC,aAAcN;CAClD;CACA,OAAO;EAAE,GAAGF;EAAO,cAAcE;CAAM;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixel-resize-handle.js","names":["GripVertical","createSignal","onCleanup","cn","resizeGripClass","resizeGripIconClass","resizeSeparatorClass","PixelResizeHandleProps","side","value","minimum","maximum","step","label","controls","class","grip","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","isRight","bounded","next","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","HTMLElement","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","move","KEY_DIRECTION","Record","ArrowLeft","ArrowRight","_el$","_tmpl$","_el$2","firstChild","$$keyup","event","includes","key","$$keydown","preventDefault","direction","addEventListener","$$pointerup","$$pointermove","delta","clientX","$$pointerdown","button","isPrimary","currentTarget","focus","setPointerCapture","_$insert","_c$","_$memo","_el$3","_tmpl$2","_$createComponent","_$effect","_$className","chip","_el$4","_tmpl$3","rung","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","_v$8","_v$9","_v$0","_v$1","e","t","_$setStyleProperty","a","_$setAttribute","o","i","n","s","h","r","d","l","_$delegateEvents","_$memo","_$createComponent","_$className","_$setStyleProperty","_$setAttribute","_$delegateEvents"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { GripVertical } from 'lucide-solid'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from '#lib/resize-separator'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n /**\n * The grip drawn on the edge: the quieter rung by default, or the bordered\n * chip for hosts that want the heavier affordance.\n */\n grip?: 'chip' | 'rung'\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and draws the grip at the matching left or\n * right edge.\n *\n * The ruler is a single separator positioned inside a box as wide as the\n * maximum, so it needs no panel-group geometry (and none of the split-layout\n * code that comes with one): arrow keys move it by `step` along its visual\n * edge, Home and End jump to the bounds, and a pointer drag is captured on the\n * handle so cancellation and lost capture end the gesture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const isRight = () => props.side === 'right'\n const bounded = (next: number) => Math.min(maximum(), Math.max(minimum(), Math.round(next)))\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n const move = (next: number) => {\n if (next !== value()) props.onChange(next)\n }\n // Arrow keys describe physical movement of the handle: on a right-edge pane\n // moving the handle left widens the pane.\n const KEY_DIRECTION: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 }\n\n return (\n <div\n class={cn(\n 'pointer-events-none absolute inset-y-0',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n style={{ width: `${maximum()}px` }}\n >\n <div\n role=\"separator\"\n tabIndex={0}\n aria-orientation=\"vertical\"\n aria-label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n style={{ left: `${isRight() ? maximum() - value() : value()}px` }}\n class={cn(\n resizeSeparatorClass(props.grip ?? 'rung'),\n 'pointer-events-auto absolute inset-y-0 w-px cursor-pointer'\n )}\n onPointerDown={(event) => {\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n move(bounded(current.startValue + delta))\n }}\n onPointerUp={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n const direction = KEY_DIRECTION[event.key]\n if (direction !== undefined) {\n event.preventDefault()\n interacting = true\n move(bounded(value() + direction * (isRight() ? -1 : 1) * (props.step ?? 16)))\n } else if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n interacting = true\n move(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) endKeyboard()\n }}\n >\n {props.grip === 'chip' ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n )}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgBmB,kBAAkBC,OAA+B;CAC/D,MAAMT,gBAAgBU,KAAKC,IAAI,GAAGF,MAAMT,OAAO;CAC/C,MAAMD,gBAAgBW,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAI,GAAGF,MAAMV,OAAO,CAAC;CACpE,MAAMD,cAAcY,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAIZ,QAAQ,GAAGW,KAAKG,MAAMJ,MAAMX,KAAK,CAAC,CAAC;CACpF,MAAMgB,gBAAgBL,MAAMZ,SAAS;CACrC,MAAMkB,WAAWC,SAAiBN,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAIZ,QAAQ,GAAGW,KAAKG,MAAMG,IAAI,CAAC,CAAC;CAC3F,MAAMC,eAAeR,MAAMF,WAAWT,MAAM,CAAC;CAC7C,IAAIoB,cAAc;CAClB,MAAM,CAACC,MAAMC,WAAW9B,a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hD,OAAA,iBAAAgC,IAAAmB,IAAAb,IAAA;GAAAC,SAAAP,IAAAoB,KAAAJ,aAAAhD,OAAA,iBAAAgC,IAAAoB,IAAAb,IAAA;GAAAC,SAAAR,IAAAqB,KAAAL,aAAAhD,OAAA,kBAAAgC,IAAAqB,IAAAb,IAAA;GAAAC,SAAAT,IAAAsB,KAAAN,aAAAhD,OAAA,iBAAAgC,IAAAsB,IAAAb,IAAA;GAAAC,SAAAV,IAAAuB,KAAAT,iBAAA9C,OAAA,QAAAgC,IAAAuB,IAAAb,IAAA;GAAAC,SAAAX,IAAAwB,KAAA7B,UAAA3B,OAAAgC,IAAAwB,IAAAb,IAAA;GAAA,OAAAX;EAAA,GAAA;GAAAY,GAAAxD,KAAAA;GAAAyD,GAAAzD,KAAAA;GAAA2D,GAAA3D,KAAAA;GAAA6D,GAAA7D,KAAAA;GAAA8D,GAAA9D,KAAAA;GAAA+D,GAAA/D,KAAAA;GAAAgE,GAAAhE,KAAAA;GAAAiE,GAAAjE,KAAAA;GAAAkE,GAAAlE,KAAAA;GAAAmE,GAAAnE,KAAAA;GAAAoE,GAAApE,KAAAA;EAAA,CAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAsET;AAAC2D,eAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"pixel-resize-handle.js","names":["GripVertical","createSignal","onCleanup","cn","resizeGripClass","resizeGripIconClass","resizeSeparatorClass","side","value","minimum","maximum","step","label","controls","class","grip","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","isRight","bounded","next","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","move","KEY_DIRECTION","ArrowLeft","ArrowRight","_el$","_tmpl$","_el$2","firstChild","$$keyup","event","includes","key","$$keydown","preventDefault","direction","addEventListener","$$pointerup","$$pointermove","delta","clientX","$$pointerdown","button","isPrimary","currentTarget","focus","setPointerCapture","_$insert","_c$","_$memo","_el$3","_tmpl$2","_$createComponent","_$effect","_$className","chip","_el$4","_tmpl$3","rung","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","_v$8","_v$9","_v$0","_v$1","e","t","_$setStyleProperty","a","_$setAttribute","o","i","n","s","h","r","d","l","_$delegateEvents"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { GripVertical } from 'lucide-solid'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from '#lib/resize-separator'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n /**\n * The grip drawn on the edge: the quieter rung by default, or the bordered\n * chip for hosts that want the heavier affordance.\n */\n grip?: 'chip' | 'rung'\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and draws the grip at the matching left or\n * right edge.\n *\n * The ruler is a single separator positioned inside a box as wide as the\n * maximum, so it needs no panel-group geometry (and none of the split-layout\n * code that comes with one): arrow keys move it by `step` along its visual\n * edge, Home and End jump to the bounds, and a pointer drag is captured on the\n * handle so cancellation and lost capture end the gesture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const isRight = () => props.side === 'right'\n const bounded = (next: number) => Math.min(maximum(), Math.max(minimum(), Math.round(next)))\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n const move = (next: number) => {\n if (next !== value()) props.onChange(next)\n }\n // Arrow keys describe physical movement of the handle: on a right-edge pane\n // moving the handle left widens the pane.\n const KEY_DIRECTION: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 }\n\n return (\n <div\n class={cn(\n 'pointer-events-none absolute inset-y-0',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n style={{ width: `${maximum()}px` }}\n >\n <div\n role=\"separator\"\n tabIndex={0}\n aria-orientation=\"vertical\"\n aria-label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n style={{ left: `${isRight() ? maximum() - value() : value()}px` }}\n class={cn(\n resizeSeparatorClass(props.grip ?? 'rung'),\n 'pointer-events-auto absolute inset-y-0 w-px cursor-pointer'\n )}\n onPointerDown={(event) => {\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n move(bounded(current.startValue + delta))\n }}\n onPointerUp={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n const direction = KEY_DIRECTION[event.key]\n if (direction !== undefined) {\n event.preventDefault()\n interacting = true\n move(bounded(value() + direction * (isRight() ? -1 : 1) * (props.step ?? 16)))\n } else if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n interacting = true\n move(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) endKeyboard()\n }}\n >\n {props.grip === 'chip' ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n )}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgBkB,kBAAkBC,OAA+B;CAC/D,MAAMT,gBAAgBU,KAAKC,IAAI,GAAGF,MAAMT,OAAO;CAC/C,MAAMD,gBAAgBW,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAI,GAAGF,MAAMV,OAAO,CAAC;CACpE,MAAMD,cAAcY,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAIZ,QAAQ,GAAGW,KAAKG,MAAMJ,MAAMX,KAAK,CAAC,CAAC;CACpF,MAAMgB,gBAAgBL,MAAMZ,SAAS;CACrC,MAAMkB,WAAWC,SAAiBN,KAAKE,IAAIZ,QAAQ,GAAGU,KAAKC,IAAIZ,QAAQ,GAAGW,KAAKG,MAAMG,IAAI,CAAC,CAAC;C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IAAAkB,KAAAF,aAAAhD,OAAA,iBAAAgC,IAAAkB,IAAAb,IAAA;GAAAC,SAAAN,IAAAmB,KAAAH,aAAAhD,OAAA,iBAAAgC,IAAAmB,IAAAb,IAAA;GAAAC,SAAAP,IAAAoB,KAAAJ,aAAAhD,OAAA,iBAAAgC,IAAAoB,IAAAb,IAAA;GAAAC,SAAAR,IAAAqB,KAAAL,aAAAhD,OAAA,kBAAAgC,IAAAqB,IAAAb,IAAA;GAAAC,SAAAT,IAAAsB,KAAAN,aAAAhD,OAAA,iBAAAgC,IAAAsB,IAAAb,IAAA;GAAAC,SAAAV,IAAAuB,KAAAT,iBAAA9C,OAAA,QAAAgC,IAAAuB,IAAAb,IAAA;GAAAC,SAAAX,IAAAwB,KAAA7B,UAAA3B,OAAAgC,IAAAwB,IAAAb,IAAA;GAAA,OAAAX;EAAA,GAAA;GAAAY,GAAAvD,KAAAA;GAAAwD,GAAAxD,KAAAA;GAAA0D,GAAA1D,KAAAA;GAAA4D,GAAA5D,KAAAA;GAAA6D,GAAA7D,KAAAA;GAAA8D,GAAA9D,KAAAA;GAAA+D,GAAA/D,KAAAA;GAAAgE,GAAAhE,KAAAA;GAAAiE,GAAAjE,KAAAA;GAAAkE,GAAAlE,KAAAA;GAAAmE,GAAAnE,KAAAA;EAAA,CAAA;EAAA,OAAAS;CAAA,EAAA,CAAA;AAsET;AAAC2D,eAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-rail.js","names":["Search","
|
|
1
|
+
{"version":3,"file":"shell-rail.js","names":["Search","children","For","Show","splitProps","cn","Kbd","KbdGroup","Separator","SideRail","SideRailContent","SideRailFooter","SideRailHeader","SideRailItem","mark","onSearch","searchLabel","searchKeyshortcuts","searchKeys","footer","ShellRail","props","local","rest","content","_$createComponent","_$mergeProps","collapsed","class","_el$","_tmpl$","_$insert","when","_el$2","_tmpl$2","as","type","label","keyshortcuts","shortcut","join","onClick","length","size","each","key","_$memo"],"sources":["../../../../src/components/layout/shell-rail/shell-rail.tsx"],"sourcesContent":["import { Search } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { children, For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Kbd, KbdGroup } from '../../ui/kbd'\nimport { Separator } from '../../ui/separator'\nimport {\n SideRail,\n SideRailContent,\n SideRailFooter,\n SideRailHeader,\n SideRailItem,\n} from '../side-rail'\n\n/**\n * ShellRail.\n *\n * The side rail both applications put at the window's leading edge: always the\n * collapsed icon column, with the app's mark at the top, a search entry point\n * under it, the app's destinations in the middle and a footer for account and\n * settings.\n *\n * The rail is never the thing the sidebar toggle collapses. The toggle belongs\n * to the sidebar beside the rail, which is why this component takes no\n * `collapsed` prop: a rail that could be expanded would be a second sidebar,\n * and the two apps would drift on which of them the toggle meant.\n *\n * Destinations are the caller's: pass `SideRailItem`s (or a `SideRailSection`)\n * as children. The mark, the search row and the footer are slots with the\n * geometry decided here, so the rail's rhythm cannot differ between apps.\n */\nexport type ShellRailProps = Omit<ComponentProps<'nav'>, 'children'> & {\n /** The app's mark. Decorative: the rail names itself through `aria-label`. */\n mark: JSX.Element\n /** Opens search. Omit to leave the search row out. */\n onSearch?: () => void\n /** The search row's accessible name. */\n searchLabel?: string\n /** The chord as it is announced, e.g. `Meta+K Control+K`. */\n searchKeyshortcuts?: string\n /** The cap labels drawn under the icon, in press order, e.g. `['⌘', 'K']`. */\n searchKeys?: readonly string[]\n /** Destinations between the search row and the footer. */\n children?: JSX.Element\n /** Account, plugins, settings. Pinned to the rail's foot. */\n footer?: JSX.Element\n}\n\nexport function ShellRail(props: ShellRailProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'mark',\n 'onSearch',\n 'searchLabel',\n 'searchKeyshortcuts',\n 'searchKeys',\n 'children',\n 'footer',\n 'aria-label',\n ])\n\n // Resolve the footer once: reading a JSX prop twice builds two copies.\n const footer = children(() => local.footer)\n const content = children(() => local.children)\n\n return (\n <SideRail\n collapsed\n data-slot=\"shell-rail\"\n aria-label={local['aria-label'] ?? 'Global navigation'}\n class={cn('relative z-(--z-sticky) min-w-0', local.class)}\n {...rest}\n >\n <SideRailHeader data-slot=\"shell-rail-header\" class=\"h-auto justify-center px-0 pt-1\">\n <span\n data-slot=\"shell-rail-mark\"\n aria-hidden=\"true\"\n class=\"flex h-rail-item items-center justify-center\"\n >\n {local.mark}\n </span>\n </SideRailHeader>\n\n <SideRailContent data-slot=\"shell-rail-content\" class=\"pt-0.5\">\n <Show when={local.onSearch}>\n <div data-slot=\"shell-rail-search\" class=\"flex min-w-0 flex-col gap-0.5\">\n <SideRailItem\n as=\"button\"\n type=\"button\"\n label={local.searchLabel ?? 'Search'}\n aria-label={local.searchLabel ?? 'Search'}\n keyshortcuts={local.searchKeyshortcuts}\n shortcut={local.searchKeys?.join('')}\n onClick={() => local.onSearch?.()}\n >\n <Search aria-hidden=\"true\" />\n </SideRailItem>\n {/* The chord is drawn as key caps under the icon: the one row that\n advertises a shortcut. The accessible chord stays on the row. */}\n <Show when={local.searchKeys?.length}>\n <KbdGroup\n size=\"compact\"\n class=\"justify-center pb-1\"\n data-slot=\"shell-rail-search-keys\"\n >\n <For each={local.searchKeys}>{(key) => <Kbd size=\"compact\">{key}</Kbd>}</For>\n </KbdGroup>\n </Show>\n </div>\n <Separator class=\"my-1\" />\n </Show>\n {content()}\n </SideRailContent>\n\n <Show when={footer()}>\n <SideRailFooter data-slot=\"shell-rail-footer\">{footer()}</SideRailFooter>\n </Show>\n </SideRail>\n )\n}\n"],"mappings":";;;;;;;;;;AAgDA,SAAgBoB,UAAUC,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAY,CACb;CAGD,MAAMF,SAASlB,eAAeqB,MAAMH,MAAM;CAC1C,MAAMK,UAAUvB,eAAeqB,MAAMrB,QAAQ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WAAA;YAAA,OAAAwB,gBAIHvB,KAAG;aAAA,IAAC0C,OAAI;cAAA,OAAEtB,MAAMJ;aAAU;aAAAjB,WAAI4C,QAAGpB,gBAAMnB,KAAG;cAACqC,MAAI;cAAA1C,UAAY4C;aAAG,CAAA;YAAO,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA,GAAA,IAAA;QAAA,OAAAZ;OAAA,EAAA,CAAA,GAAAR,gBAI3EjB,WAAS,EAAA,SAAA,OAAA,CAAA,CAAA;MAAA;KAAA,CAAA,GAAAsC,WAEXtB,QAAQ,CAAC,CAAA;IAAA;GAAA,CAAA;GAAAC,gBAGXtB,MAAI;IAAA,IAAC6B,OAAI;KAAA,OAAEb,OAAO;IAAC;IAAA,IAAAlB,WAAA;KAAA,OAAAwB,gBACjBd,gBAAc;MAAA,aAAA;MAAA,IAAAV,WAAA;OAAA,OAAgCkB,OAAO;MAAC;KAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAI/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-top-bar.js","names":["ComponentProps","JSX","children","Show","splitProps","cn","Separator","windowChromeClass","WindowChromeProps","ShellTopBarProps","Omit","navigation","Element","sidebarToggle","workspace","sidebarOpen","alignSidebarAtNarrow","sidebarWidth","breadcrumb","search","actions","ShellTopBar","props","local","rest","_el$","_tmpl$8","_el$2","firstChild","_$spread","_$mergeProps","class","macosInset","style","_$memo","undefined","_$insert","_$createComponent","when","_el$3","_tmpl$","_el$4","_tmpl$2","_el$5","_tmpl$3","orientation","_el$6","_tmpl$4","_tmpl$5","_el$8","_tmpl$6","_el$9","_tmpl$7","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","_$mergeProps","_$memo","_$createComponent","_$setAttribute","_$className"],"sources":["../../../../src/components/layout/shell-top-bar/shell-top-bar.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { children, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Separator } from '../../ui/separator'\nimport { windowChromeClass, type WindowChromeProps } from '../top-bar/window-chrome'\n\n/**\n * ShellTopBar.\n *\n * The window's top bar as both applications draw it. It has two halves with a\n * vertical divider between them:\n *\n * - **Leading**: history arrows, the sidebar toggle and the workspace\n * switcher, in that order. This is the part that belongs to the window.\n * - **Content**: breadcrumbs, search and the view's actions. This is the part\n * that belongs to the view, and it always sits to the right of the divider.\n *\n * ## Why the divider tracks the sidebar\n *\n * When the host marks an inline sidebar open, the divider lands on the sidebar's\n * trailing edge, so the bar reads as the rail and sidebar's header on one side\n * and the content's header on the other. The bar spans the rail and the sidebar\n * (they sit under it), so the leading half is as wide as `--rail-width` plus the\n * sidebar's width less the bar's own start padding. The host publishes the width\n * as `--shell-sidebar-width` on an ancestor; the fallback of 17rem matches the\n * default sidebar. The default behavior keeps the leading half with its controls\n * below 48rem. A host that keeps the sidebar inline at narrow widths opts into\n * `alignSidebarAtNarrow` so the divider still tracks it.\n *\n * ## Narrow windows\n *\n * The bar is its own container. Below 34rem the search drops to a row of its\n * own so the leading controls, the breadcrumb and the actions keep their room;\n * the breadcrumb is the first thing to truncate.\n *\n * The bar never spills past its window. When the leading controls are wider than\n * the window (a 320px viewport at 200% text), they wrap onto a second row inside\n * the leading half instead of being cut off or pushing the page sideways, and\n * the actions are capped to the bar and scroll if they are still too wide.\n *\n * On a frameless desktop window the bar is the drag region (`draggable`) and\n * every control opts back out; `macosInset` and `windowsInset` reserve the\n * native window controls.\n */\nexport type ShellTopBarProps = Omit<ComponentProps<'header'>, 'children'> &\n WindowChromeProps & {\n /** History arrows. Rendered first, left of the sidebar toggle. */\n navigation?: JSX.Element\n sidebarToggle?: JSX.Element\n workspace?: JSX.Element\n /**\n * Whether the sidebar is open. Its width applies at wide widths by default.\n */\n sidebarOpen?: boolean\n /**\n * Also align the open sidebar below the default 48rem breakpoint. Use this\n * when the host keeps the sidebar inline at narrow widths; drawer layouts keep\n * the default controls-only leading half.\n */\n alignSidebarAtNarrow?: boolean\n /**\n * The open sidebar's width in pixels. Published as `--shell-sidebar-width` on\n * the bar so the divider tracks a resizable sidebar; leave it unset to use an\n * ancestor's variable or the 17rem default.\n */\n sidebarWidth?: number\n /** Breadcrumbs or the view's title. Takes the free space and truncates first. */\n breadcrumb?: JSX.Element\n search?: JSX.Element\n /** The view's actions, at the trailing edge. */\n actions?: JSX.Element\n }\n\nexport function ShellTopBar(props: ShellTopBarProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'navigation',\n 'sidebarToggle',\n 'workspace',\n 'sidebarOpen',\n 'alignSidebarAtNarrow',\n 'sidebarWidth',\n 'breadcrumb',\n 'search',\n 'actions',\n 'draggable',\n 'macosInset',\n 'windowsInset',\n 'glass',\n ])\n\n // Resolve each slot once: a JSX prop is a getter that builds its elements on\n // every read, so testing it with `Show` and then rendering it would build\n // (and run the refs of) two copies.\n const navigation = children(() => local.navigation)\n const sidebarToggle = children(() => local.sidebarToggle)\n const workspace = children(() => local.workspace)\n const breadcrumb = children(() => local.breadcrumb)\n const search = children(() => local.search)\n const actions = children(() => local.actions)\n\n return (\n <header\n data-slot=\"shell-top-bar\"\n class={cn(\n /* Rows are one pixel short of the top bar height so the bottom border keeps\n the bar at exactly --topbar-height, like the shared TopBar: docked\n panels and sidebar headers measure from that edge. */\n '@container/shell-top-bar relative z-(--z-sticky) flex min-h-topbar shrink-0 flex-wrap items-center border-b border-border bg-card text-card-foreground',\n windowChromeClass(local),\n /* The leading half subtracts the start inset from its width. */\n local.macosInset ? '[--shell-top-bar-inset:84px]' : '[--shell-top-bar-inset:0.75rem]',\n local.class\n )}\n style={\n local.sidebarWidth === undefined\n ? undefined\n : { '--shell-sidebar-width': `${local.sidebarWidth}px` }\n }\n {...rest}\n >\n <div\n data-slot=\"shell-top-bar-leading\"\n data-sidebar-open={local.sidebarOpen ? 'true' : 'false'}\n class={cn(\n 'window-no-drag flex min-h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',\n /* Open sidebar: preserve wide-only alignment unless the host opts into\n the same geometry below the breakpoint. */\n local.sidebarOpen &&\n (local.alignSidebarAtNarrow\n ? 'w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]'\n : 'md:w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]')\n )}\n >\n <Show when={navigation()}>\n <div data-slot=\"shell-top-bar-navigation\" class=\"flex shrink-0 items-center gap-2\">\n {navigation()}\n </div>\n </Show>\n <Show when={sidebarToggle()}>\n <div data-slot=\"shell-top-bar-toggle\" class=\"flex shrink-0 items-center\">\n {sidebarToggle()}\n </div>\n </Show>\n <Show when={workspace()}>\n <div data-slot=\"shell-top-bar-workspace\" class=\"flex min-w-0 items-center\">\n {workspace()}\n </div>\n </Show>\n </div>\n <Separator\n orientation=\"vertical\"\n data-slot=\"shell-top-bar-divider\"\n aria-hidden=\"true\"\n class=\"data-[orientation=vertical]:h-5\"\n />\n <Show when={breadcrumb()}>\n <div\n data-slot=\"shell-top-bar-breadcrumb\"\n class=\"window-no-drag flex h-[calc(var(--topbar-height)-1px)] min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag\"\n >\n {breadcrumb()}\n </div>\n </Show>\n <Show when={!breadcrumb()}>\n <div class=\"min-w-0 flex-1\" aria-hidden=\"true\" />\n </Show>\n <Show when={search()}>\n <div\n data-slot=\"shell-top-bar-search\"\n class=\"window-no-drag min-w-0 max-w-md shrink basis-72 px-3 @max-[34rem]/shell-top-bar:order-last @max-[34rem]/shell-top-bar:max-w-none @max-[34rem]/shell-top-bar:basis-full @max-[34rem]/shell-top-bar:pb-2\"\n >\n {search()}\n </div>\n </Show>\n <Show when={actions()}>\n <div\n data-slot=\"shell-top-bar-actions\"\n class=\"window-no-drag flex h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 items-center gap-2 over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A,IAAAC,MAzDShC,MAAMR,cAAc,SAAS,SAAOyC,OAChDnD,GACL,sIAGAkB,MAAMR,gBACHQ,MAAMP,uBACH,4FACA,6FACR;GAACuC,QAAAD,IAAAG,KAAAC,aAAA/B,OAAA,qBAAA2B,IAAAG,IAAAF,GAAA;GAAAC,SAAAF,IAAAK,KAAAC,UAAAjC,OAAA2B,IAAAK,IAAAH,IAAA;GAAA,OAAAF;EAAA,GAAA;GAAAG,GAAAtB,KAAAA;GAAAwB,GAAAxB,KAAAA;EAAA,CAAA;EAAA,OAAAV;CAAA,EAAA,CAAA;AAqDT"}
|
|
1
|
+
{"version":3,"file":"shell-top-bar.js","names":["children","Show","splitProps","cn","Separator","windowChromeClass","navigation","sidebarToggle","workspace","sidebarOpen","alignSidebarAtNarrow","sidebarWidth","breadcrumb","search","actions","ShellTopBar","props","local","rest","_el$","_tmpl$8","_el$2","firstChild","_$spread","_$mergeProps","class","macosInset","style","_$memo","undefined","_$insert","_$createComponent","when","_el$3","_tmpl$","_el$4","_tmpl$2","_el$5","_tmpl$3","orientation","_el$6","_tmpl$4","_tmpl$5","_el$8","_tmpl$6","_el$9","_tmpl$7","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_$className"],"sources":["../../../../src/components/layout/shell-top-bar/shell-top-bar.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { children, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Separator } from '../../ui/separator'\nimport { windowChromeClass, type WindowChromeProps } from '../top-bar/window-chrome'\n\n/**\n * ShellTopBar.\n *\n * The window's top bar as both applications draw it. It has two halves with a\n * vertical divider between them:\n *\n * - **Leading**: history arrows, the sidebar toggle and the workspace\n * switcher, in that order. This is the part that belongs to the window.\n * - **Content**: breadcrumbs, search and the view's actions. This is the part\n * that belongs to the view, and it always sits to the right of the divider.\n *\n * ## Why the divider tracks the sidebar\n *\n * When the host marks an inline sidebar open, the divider lands on the sidebar's\n * trailing edge, so the bar reads as the rail and sidebar's header on one side\n * and the content's header on the other. The bar spans the rail and the sidebar\n * (they sit under it), so the leading half is as wide as `--rail-width` plus the\n * sidebar's width less the bar's own start padding. The host publishes the width\n * as `--shell-sidebar-width` on an ancestor; the fallback of 17rem matches the\n * default sidebar. The default behavior keeps the leading half with its controls\n * below 48rem. A host that keeps the sidebar inline at narrow widths opts into\n * `alignSidebarAtNarrow` so the divider still tracks it.\n *\n * ## Narrow windows\n *\n * The bar is its own container. Below 34rem the search drops to a row of its\n * own so the leading controls, the breadcrumb and the actions keep their room;\n * the breadcrumb is the first thing to truncate.\n *\n * The bar never spills past its window. When the leading controls are wider than\n * the window (a 320px viewport at 200% text), they wrap onto a second row inside\n * the leading half instead of being cut off or pushing the page sideways, and\n * the actions are capped to the bar and scroll if they are still too wide.\n *\n * On a frameless desktop window the bar is the drag region (`draggable`) and\n * every control opts back out; `macosInset` and `windowsInset` reserve the\n * native window controls.\n */\nexport type ShellTopBarProps = Omit<ComponentProps<'header'>, 'children'> &\n WindowChromeProps & {\n /** History arrows. Rendered first, left of the sidebar toggle. */\n navigation?: JSX.Element\n sidebarToggle?: JSX.Element\n workspace?: JSX.Element\n /**\n * Whether the sidebar is open. Its width applies at wide widths by default.\n */\n sidebarOpen?: boolean\n /**\n * Also align the open sidebar below the default 48rem breakpoint. Use this\n * when the host keeps the sidebar inline at narrow widths; drawer layouts keep\n * the default controls-only leading half.\n */\n alignSidebarAtNarrow?: boolean\n /**\n * The open sidebar's width in pixels. Published as `--shell-sidebar-width` on\n * the bar so the divider tracks a resizable sidebar; leave it unset to use an\n * ancestor's variable or the 17rem default.\n */\n sidebarWidth?: number\n /** Breadcrumbs or the view's title. Takes the free space and truncates first. */\n breadcrumb?: JSX.Element\n search?: JSX.Element\n /** The view's actions, at the trailing edge. */\n actions?: JSX.Element\n }\n\nexport function ShellTopBar(props: ShellTopBarProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'navigation',\n 'sidebarToggle',\n 'workspace',\n 'sidebarOpen',\n 'alignSidebarAtNarrow',\n 'sidebarWidth',\n 'breadcrumb',\n 'search',\n 'actions',\n 'draggable',\n 'macosInset',\n 'windowsInset',\n 'glass',\n ])\n\n // Resolve each slot once: a JSX prop is a getter that builds its elements on\n // every read, so testing it with `Show` and then rendering it would build\n // (and run the refs of) two copies.\n const navigation = children(() => local.navigation)\n const sidebarToggle = children(() => local.sidebarToggle)\n const workspace = children(() => local.workspace)\n const breadcrumb = children(() => local.breadcrumb)\n const search = children(() => local.search)\n const actions = children(() => local.actions)\n\n return (\n <header\n data-slot=\"shell-top-bar\"\n class={cn(\n /* Rows are one pixel short of the top bar height so the bottom border keeps\n the bar at exactly --topbar-height, like the shared TopBar: docked\n panels and sidebar headers measure from that edge. */\n '@container/shell-top-bar relative z-(--z-sticky) flex min-h-topbar shrink-0 flex-wrap items-center border-b border-border bg-card text-card-foreground',\n windowChromeClass(local),\n /* The leading half subtracts the start inset from its width. */\n local.macosInset ? '[--shell-top-bar-inset:84px]' : '[--shell-top-bar-inset:0.75rem]',\n local.class\n )}\n style={\n local.sidebarWidth === undefined\n ? undefined\n : { '--shell-sidebar-width': `${local.sidebarWidth}px` }\n }\n {...rest}\n >\n <div\n data-slot=\"shell-top-bar-leading\"\n data-sidebar-open={local.sidebarOpen ? 'true' : 'false'}\n class={cn(\n 'window-no-drag flex min-h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',\n /* Open sidebar: preserve wide-only alignment unless the host opts into\n the same geometry below the breakpoint. */\n local.sidebarOpen &&\n (local.alignSidebarAtNarrow\n ? 'w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]'\n : 'md:w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]')\n )}\n >\n <Show when={navigation()}>\n <div data-slot=\"shell-top-bar-navigation\" class=\"flex shrink-0 items-center gap-2\">\n {navigation()}\n </div>\n </Show>\n <Show when={sidebarToggle()}>\n <div data-slot=\"shell-top-bar-toggle\" class=\"flex shrink-0 items-center\">\n {sidebarToggle()}\n </div>\n </Show>\n <Show when={workspace()}>\n <div data-slot=\"shell-top-bar-workspace\" class=\"flex min-w-0 items-center\">\n {workspace()}\n </div>\n </Show>\n </div>\n <Separator\n orientation=\"vertical\"\n data-slot=\"shell-top-bar-divider\"\n aria-hidden=\"true\"\n class=\"data-[orientation=vertical]:h-5\"\n />\n <Show when={breadcrumb()}>\n <div\n data-slot=\"shell-top-bar-breadcrumb\"\n class=\"window-no-drag flex h-[calc(var(--topbar-height)-1px)] min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag\"\n >\n {breadcrumb()}\n </div>\n </Show>\n <Show when={!breadcrumb()}>\n <div class=\"min-w-0 flex-1\" aria-hidden=\"true\" />\n </Show>\n <Show when={search()}>\n <div\n data-slot=\"shell-top-bar-search\"\n class=\"window-no-drag min-w-0 max-w-md shrink basis-72 px-3 @max-[34rem]/shell-top-bar:order-last @max-[34rem]/shell-top-bar:max-w-none @max-[34rem]/shell-top-bar:basis-full @max-[34rem]/shell-top-bar:pb-2\"\n >\n {search()}\n </div>\n </Show>\n <Show when={actions()}>\n <div\n data-slot=\"shell-top-bar-actions\"\n class=\"window-no-drag flex h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5\"\n >\n {actions()}\n </div>\n </Show>\n </header>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAyEA,SAAgBe,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAKD,MAAMV,aAAaN,eAAeiB,MAAMX,UAAU;CAClD,MAAMC,gBAAgBP,eAAeiB,MAAMV,aAAa;C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