@adea-ai/ui 0.162.14 → 0.162.16
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/accent-picker/accent-picker.js +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +2 -2
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/settings/settings.js +1 -1
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/tree/tree.js +1 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/conversation/thread-panel.js +1 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +1 -1
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +2 -2
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +1 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +2 -2
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.js +1 -1
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +1 -1
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +1 -1
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +3 -3
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/field/field.js +2 -2
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.js +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +1 -1
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +1 -1
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +2 -2
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +1 -1
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/slider/slider.js +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/switch/switch.js +1 -1
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +1 -1
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -1
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +1 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/trace/trace.js +1 -1
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +1 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +2 -2
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/variants.d.ts +1 -1
- package/dist/lib/variants.d.ts.map +1 -1
- package/dist/lib/variants.js +1 -1
- package/dist/lib/variants.js.map +1 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +1 -1
- package/dist/r/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +1 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +1 -1
- package/dist/r/src/components/composites/settings/settings.tsx +1 -1
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +1 -1
- package/dist/r/src/components/composites/tree/tree.tsx +1 -1
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +1 -1
- package/dist/r/src/components/layout/app-shell/skip-link.tsx +1 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +1 -1
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +2 -2
- package/dist/r/src/components/ui/accordion/accordion.tsx +1 -1
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
- package/dist/r/src/components/ui/attachment/attachment.tsx +2 -2
- package/dist/r/src/components/ui/board/board.tsx +2 -2
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
- package/dist/r/src/components/ui/button/button.tsx +1 -1
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +1 -1
- package/dist/r/src/components/ui/collapsible/collapsible.tsx +1 -1
- package/dist/r/src/components/ui/combobox/combobox.tsx +3 -3
- package/dist/r/src/components/ui/field/field.tsx +2 -2
- package/dist/r/src/components/ui/input/input-control.tsx +1 -1
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
- package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/dist/r/src/components/ui/menubar/menubar.tsx +1 -1
- package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +1 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +2 -2
- package/dist/r/src/components/ui/scroll-area/scroll-area.tsx +1 -1
- package/dist/r/src/components/ui/select/select.tsx +1 -1
- package/dist/r/src/components/ui/slider/slider.tsx +1 -1
- package/dist/r/src/components/ui/switch/switch.tsx +1 -1
- package/dist/r/src/components/ui/tabs/tabs.tsx +1 -1
- package/dist/r/src/components/ui/text-link/text-link.tsx +1 -1
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
- package/dist/r/src/components/ui/toast/toast.tsx +1 -1
- package/dist/r/src/components/ui/trace/trace.tsx +1 -1
- package/dist/r/src/lib/overlay.ts +1 -1
- package/dist/r/src/lib/tokens.ts +4 -2
- package/dist/r/src/lib/variants.ts +1 -1
- package/dist/r/src/styles/base.css +35 -7
- package/dist/vite/tailwind-sources.d.ts.map +1 -1
- package/dist/vite/tailwind-sources.js +16 -5
- package/dist/vite/tailwind-sources.js.map +1 -1
- package/package.json +1 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +1 -1
- package/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
- package/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
- package/src/components/composites/confirmation/confirmation.tsx +1 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/src/components/composites/list-row/list-row-control.tsx +1 -1
- package/src/components/composites/settings/settings.tsx +1 -1
- package/src/components/composites/stack-trace/stack-trace.tsx +1 -1
- package/src/components/composites/tree/tree.tsx +1 -1
- package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
- package/src/components/conversation/thread-panel.tsx +1 -1
- package/src/components/layout/app-shell/skip-link.tsx +1 -1
- package/src/components/layout/side-rail/side-rail.tsx +1 -1
- package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
- package/src/components/layout/top-bar/top-bar.tsx +2 -2
- package/src/components/ui/accordion/accordion.tsx +1 -1
- package/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
- package/src/components/ui/attachment/attachment.tsx +2 -2
- package/src/components/ui/board/board.tsx +2 -2
- package/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
- package/src/components/ui/button/button.tsx +1 -1
- package/src/components/ui/checkbox/checkbox.tsx +1 -1
- package/src/components/ui/collapsible/collapsible.tsx +1 -1
- package/src/components/ui/combobox/combobox.tsx +3 -3
- package/src/components/ui/field/field.tsx +2 -2
- package/src/components/ui/input/input-control.tsx +1 -1
- package/src/components/ui/input-group/input-group.tsx +1 -1
- package/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/src/components/ui/menubar/menubar.tsx +1 -1
- package/src/components/ui/native-select/native-select.tsx +1 -1
- package/src/components/ui/pagination/pagination.tsx +1 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +1 -1
- package/src/components/ui/radio-group/radio-group.tsx +2 -2
- package/src/components/ui/scroll-area/scroll-area.tsx +1 -1
- package/src/components/ui/select/select.tsx +1 -1
- package/src/components/ui/slider/slider.tsx +1 -1
- package/src/components/ui/switch/switch.tsx +1 -1
- package/src/components/ui/tabs/tabs.tsx +1 -1
- package/src/components/ui/text-link/text-link.tsx +1 -1
- package/src/components/ui/textarea/textarea.tsx +1 -1
- package/src/components/ui/toast/toast.tsx +1 -1
- package/src/components/ui/trace/trace.tsx +1 -1
- package/src/lib/overlay.ts +1 -1
- package/src/lib/tokens.ts +4 -2
- package/src/lib/variants.ts +1 -1
- package/src/styles/base.css +35 -7
- package/src/vite/tailwind-sources.ts +20 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-rail.js","names":["<Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />","<SideRailContext value={value}>\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n </SideRailContext>","<Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>","as=\"nav\"","<div\n data-slot=\"side-rail-header\"\n class={cn(\n 'h-topbar flex shrink-0 items-center gap-2.5 px-3 group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"side-rail-content\"\n class={cn(\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"side-rail-footer\"\n class={cn(\n 'flex shrink-0 flex-col gap-0.5 border-t border-sidebar-border px-2 py-2',\n local.class\n )}\n {...rest}\n />","<Show when={local.label}>\n {(labelSlot) => (\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {labelSlot()}\n </div>\n )}\n </Show>","<div data-slot=\"side-rail-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <Show when={local.label}>\n {(labelSlot) => (\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {labelSlot()}\n </div>\n )}\n </Show>\n {local.children}\n </div>","<Show when={props.position} keyed>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>\n </Portal>\n )}\n </Show>","<Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>\n </Portal>","<div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>","<Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>","<KbdChord keys={shortcut()} class=\"shrink-0\" />","class=\"shrink-0\"","top: `${position.top}px`","left: `${position.left}px`","height: `${position.height}px`","class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}","<Polymorphic\n as={local.as ?? 'a'}\n ref={tip.setRow}\n aria-current={local.active ? 'page' : undefined}\n aria-keyshortcuts={local.keyshortcuts}\n data-active={local.active ? '' : undefined}\n class={cn(\n sideRailItemClass,\n 'relative',\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n local.class\n )}\n onPointerEnter={tip.show}\n onPointerLeave={tip.hide}\n onFocus={tip.show}\n onBlur={tip.hide}\n {...(rest as Record<string, unknown>)}\n >\n <span class=\"flex size-5 shrink-0 items-center justify-center [&_svg]:size-5\">\n {local.children}\n </span>\n\n <span class=\"min-w-0 flex-1 truncate text-start group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n\n {/*\n * One element, two placements, because the badge is caller content and a DOM\n * node cannot be in two places. Expanded, it is a trailing count in the row's\n * flow, after the label — over the icon it would cover the glyph the row is\n * recognised by. Collapsed, there is no label to trail, so it leaves the flow\n * and pins to the icon's top-end corner: anchored to the row's centre (where\n * the centred icon sits) and pushed out by 14px, the icon's half-width plus\n * the 4px overhang, so a wider count grows back over the icon rather than past\n * the rail's edge.\n */}\n <Show when={local.badge}>\n {(badgeSlot) => (\n <span\n data-slot=\"side-rail-badge\"\n class=\"flex shrink-0 items-center justify-center group-data-[collapsed=true]/rail:absolute group-data-[collapsed=true]/rail:end-1/2 group-data-[collapsed=true]/rail:top-1/2 group-data-[collapsed=true]/rail:-me-3.5 group-data-[collapsed=true]/rail:-mt-3.5\"\n >\n {badgeSlot()}\n </span>\n )}\n </Show>\n\n <Show when={trailing() === undefined && local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>\n\n <Show when={trailing()}>\n {(trailingSlot) => <span class=\"ms-auto shrink-0\">{trailingSlot()}</span>}\n </Show>\n </Polymorphic>","ref={tip.setRow}","<Show when={local.badge}>\n {(badgeSlot) => (\n <span\n data-slot=\"side-rail-badge\"\n class=\"flex shrink-0 items-center justify-center group-data-[collapsed=true]/rail:absolute group-data-[collapsed=true]/rail:end-1/2 group-data-[collapsed=true]/rail:top-1/2 group-data-[collapsed=true]/rail:-me-3.5 group-data-[collapsed=true]/rail:-mt-3.5\"\n >\n {badgeSlot()}\n </span>\n )}\n </Show>","<Show when={trailing() === undefined && local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>","trailing() === undefined && local.shortcut","<KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />","size=\"compact\"","class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"","<Show when={trailing()}>\n {(trailingSlot) => <span class=\"ms-auto shrink-0\">{trailingSlot()}</span>}\n </Show>","<RailTip\n position={tip.position()}\n icon={local.children}\n label={local.label}\n active={local.active}\n shortcut={local.shortcut}\n />","type=\"button\"","<Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>","<RailTip position={tip.position()} icon={local.children} label={local.label} />","_$spread","_$insert","_$effect","_$readShallow","_$className","_$setStyleProperty","resolveChildren"],"sources":["../../../../src/components/layout/side-rail/side-rail.tsx"],"sourcesContent":["import type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport {\n children as resolveChildren,\n Show,\n createMemo,\n createSignal,\n omit,\n useContext,\n} from 'solid-js'\nimport { Dynamic, Portal } from '@solidjs/web'\nimport { tooltipTip } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { KbdChord } from '../../ui/kbd'\nimport { SideRailContext } from './side-rail-context'\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * polymorphic props these components have always taken.\n */\nexport type PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\n/** Renders the caller's `as`, which arrives in the spread props, or the default tag. */\nfunction Polymorphic(props: Record<string, unknown> & { as?: ValidComponent }) {\n return <Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />\n}\n\n/**\n * SideRail.\n *\n * The narrow, persistent column of top-level destinations at the window's leading\n * edge: the app mark, the primary sections, and a footer for account and settings.\n * It is the one piece of chrome that is always on screen, which is why it is a\n * component rather than something each view arranges.\n *\n * Two forms, one component. Collapsed it is an icon column; expanded it carries\n * labels. Both widths come from `--rail-width` (56px) and `--rail-width-expanded`\n * (236px), so an app cannot pick its own and end up a few pixels out of step with\n * the app beside it.\n *\n * The rail does not own its collapsed state; the app does. That state has to\n * survive a reload and usually lives with the rest of the window preferences, and\n * a rail that kept it privately could not be restored.\n */\nexport type SideRailProps<T extends ValidComponent = 'nav'> = PolymorphicProps<\n T,\n {\n class?: string\n collapsed?: boolean\n 'aria-label'?: string\n }\n>\n\nexport function SideRail<T extends ValidComponent = 'nav'>(props: SideRailProps<T>) {\n const local = props as SideRailProps\n const rest = omit(props as SideRailProps, 'class', 'collapsed', 'aria-label', 'children')\n\n const collapsed = createMemo(() => local.collapsed ?? false)\n const value = {\n collapsed,\n width: createMemo(() => (collapsed() ? 'var(--rail-width)' : 'var(--rail-width-expanded)')),\n }\n\n return (\n <SideRailContext value={value}>\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n </SideRailContext>\n )\n}\n\n/** The header slot: the app mark, and the product name when there is room. */\nexport function SideRailHeader(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"side-rail-header\"\n class={cn(\n 'h-topbar flex shrink-0 items-center gap-2.5 px-3 group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The scrolling middle. Keeps the header and the footer pinned. */\nexport function SideRailContent(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"side-rail-content\"\n class={cn(\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The pinned footer: account, settings, help. */\nexport function SideRailFooter(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"side-rail-footer\"\n class={cn(\n 'flex shrink-0 flex-col gap-0.5 border-t border-sidebar-border px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A titled group of rail destinations. The title hides when collapsed. */\nexport function SideRailSection(props: ComponentProps<'div'> & { label?: string }) {\n const local = props\n const rest = omit(props, 'class', 'label', 'children')\n\n return (\n <div data-slot=\"side-rail-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <Show when={local.label}>\n {(labelSlot) => (\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {labelSlot()}\n </div>\n )}\n </Show>\n {local.children}\n </div>\n )\n}\n\nconst sideRailItemClass = [\n 'group/rail-item flex h-rail-item min-w-0 w-full items-center gap-2.5 rounded-md px-3 text-sm font-medium',\n 'group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n 'transition-[color,background-color,transform] ease-out outline-none select-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n /*\n * The donor's row scales up slightly under the pointer and down under a press.\n * It is a CSS transform rather than a motion-library gesture because the two are\n * the same thing here and the transform costs nothing at runtime: no wrapper\n * element, no listener, and it works on whatever element a caller renders the row\n * as — an anchor, a button, a router's own link.\n *\n * The collapsed rail opts out: a 1.02 scale on a 56px column pushes the row past\n * the rail's own edge, which reads as a glitch rather than as feedback.\n */\n 'hover:scale-[1.02] active:scale-[0.97] group-data-[collapsed=true]/rail:hover:scale-100 group-data-[collapsed=true]/rail:active:scale-[0.98]',\n '[&_svg]:size-5 [&_svg]:shrink-0',\n].join(' ')\n\n/*\n * The rail's states are accent-driven: the icon carries `--primary` on hover and\n * on the active destination, and both states draw the accent's own tint rather\n * than a neutral fill, so the rail reads as the app's accent chroma instead of a\n * grey column. The active label stays on `sidebar-foreground` because the accent\n * presets guarantee their 3:1 interaction minimum against the surface, not the\n * 4.5:1 small text owes; the icon is a graphic and rides the accent.\n */\nconst sideRailItemStateClass = {\n active: 'bg-primary-subtle text-sidebar-foreground [&_svg]:text-primary',\n idle: 'text-sidebar-muted-foreground hover:bg-primary-subtle/60 hover:text-primary',\n}\n\nconst TIP_GAP_PX = 8\n\ntype TipPosition = { top: number; left: number; height: number }\n\n/** The collapsed rail's tip state for one row; see `SideRailItem` for its treatment. */\nfunction createRailTip() {\n const rail = useContext(SideRailContext)\n const [row, setRow] = createSignal<HTMLElement>()\n const [position, setPosition] = createSignal<TipPosition | null>(null)\n return {\n setRow,\n position,\n show: () => {\n const element = row()\n if (!element || !rail?.collapsed()) return\n const rect = element.getBoundingClientRect()\n setPosition({ top: rect.top, left: rect.right + TIP_GAP_PX, height: rect.height })\n },\n hide: () => setPosition(null),\n }\n}\n\nfunction RailTip(props: {\n position: TipPosition | null\n icon: JSX.Element\n label: string\n active?: boolean\n shortcut?: string\n}) {\n return (\n /* The portal can finish an effect after the tooltip closes; capture its position. */\n <Show when={props.position} keyed>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>\n </Portal>\n )}\n </Show>\n )\n}\n\n/**\n * A rail destination.\n *\n * ## The tooltip is the rail's hover affordance, not a generic bubble\n *\n * Collapsed, the row has no text, so the label has to come from somewhere. This\n * ports the donor's treatment rather than using a standard tooltip, because the\n * details are what make it read as part of the rail:\n *\n * - It is **flush with the row**: positioned at the row's own top and given the\n * row's own height, so it continues the row outward instead of floating near\n * it. A centred bubble with an arrow reads as a separate object.\n * - It **repeats the icon**, which anchors it to the row it belongs to.\n * - It carries the **keyboard chord**, which is the one piece of information a\n * collapsed rail otherwise cannot show.\n * - It opens on **hover and on focus**, so a keyboard user gets the same label a\n * pointer user does.\n * - It is `pointer-events-none` and `aria-hidden`: the row already carries the\n * name (as a visually hidden span when collapsed), so this is decoration and\n * must never be the accessible name.\n *\n * ## The chord on the row\n *\n * Expanded, the row shows its chord on hover and on focus — and the chord is\n * declared once to assistive technology through `aria-keyshortcuts` rather than\n * being read out as glyphs. The visible badge is `aria-hidden` for that reason.\n */\nexport type SideRailItemProps<T extends ValidComponent = 'a'> = PolymorphicProps<\n T,\n {\n class?: string\n /** Marks the item as the current destination. */\n active?: boolean\n /**\n * The item's accessible name. Required, and always in the accessibility tree:\n * collapsed it moves into the tooltip and a visually hidden span rather than\n * being deleted.\n */\n label: string\n /**\n * A count or a dot. Expanded, it trails the label at the row's end; collapsed,\n * it moves onto the icon's corner, so the rail never loses it.\n */\n badge?: JSX.Element\n /** An indicator pinned to the trailing edge in the expanded form. */\n trailing?: JSX.Element\n /** The chord as it should be drawn, e.g. `⌘1`. Shown on hover and focus. */\n shortcut?: string\n /**\n * The same chord in the ARIA grammar, e.g. `Meta+1`. Declared to assistive\n * technology instead of the display glyphs, which are not a keyboard shortcut\n * a screen reader can parse. Supply it whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n>\n\nexport function SideRailItem<T extends ValidComponent = 'a'>(props: SideRailItemProps<T>) {\n const local = props as SideRailItemProps\n const rest = omit(\n props as SideRailItemProps,\n 'as',\n 'class',\n 'active',\n 'label',\n 'badge',\n 'trailing',\n 'shortcut',\n 'keyshortcuts',\n 'children'\n )\n\n const tip = createRailTip()\n const trailing = resolveChildren(() => local.trailing)\n\n return (\n <>\n <Polymorphic\n as={local.as ?? 'a'}\n ref={tip.setRow}\n aria-current={local.active ? 'page' : undefined}\n aria-keyshortcuts={local.keyshortcuts}\n data-active={local.active ? '' : undefined}\n class={cn(\n sideRailItemClass,\n 'relative',\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n local.class\n )}\n onPointerEnter={tip.show}\n onPointerLeave={tip.hide}\n onFocus={tip.show}\n onBlur={tip.hide}\n {...(rest as Record<string, unknown>)}\n >\n <span class=\"flex size-5 shrink-0 items-center justify-center [&_svg]:size-5\">\n {local.children}\n </span>\n\n <span class=\"min-w-0 flex-1 truncate text-start group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n\n {/*\n * One element, two placements, because the badge is caller content and a DOM\n * node cannot be in two places. Expanded, it is a trailing count in the row's\n * flow, after the label — over the icon it would cover the glyph the row is\n * recognised by. Collapsed, there is no label to trail, so it leaves the flow\n * and pins to the icon's top-end corner: anchored to the row's centre (where\n * the centred icon sits) and pushed out by 14px, the icon's half-width plus\n * the 4px overhang, so a wider count grows back over the icon rather than past\n * the rail's edge.\n */}\n <Show when={local.badge}>\n {(badgeSlot) => (\n <span\n data-slot=\"side-rail-badge\"\n class=\"flex shrink-0 items-center justify-center group-data-[collapsed=true]/rail:absolute group-data-[collapsed=true]/rail:end-1/2 group-data-[collapsed=true]/rail:top-1/2 group-data-[collapsed=true]/rail:-me-3.5 group-data-[collapsed=true]/rail:-mt-3.5\"\n >\n {badgeSlot()}\n </span>\n )}\n </Show>\n\n <Show when={trailing() === undefined && local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>\n\n <Show when={trailing()}>\n {(trailingSlot) => <span class=\"ms-auto shrink-0\">{trailingSlot()}</span>}\n </Show>\n </Polymorphic>\n\n <RailTip\n position={tip.position()}\n icon={local.children}\n label={local.label}\n active={local.active}\n shortcut={local.shortcut}\n />\n </>\n )\n}\n\n/** A non-navigating rail control: a collapse toggle, a \"new\" action. */\nexport function SideRailButton(\n props: Omit<ComponentProps<'button'>, 'type'> & {\n label: string\n shortcut?: string\n active?: boolean\n }\n) {\n const local = props\n const rest = omit(props, 'class', 'label', 'shortcut', 'children', 'active')\n const tip = createRailTip()\n\n return (\n <>\n <button\n type=\"button\"\n ref={tip.setRow}\n aria-label={local.label}\n data-active={local.active ? 'true' : undefined}\n onPointerEnter={tip.show}\n onPointerLeave={tip.hide}\n onFocus={tip.show}\n onBlur={tip.hide}\n class={cn(\n sideRailItemClass,\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n <span class=\"flex size-5 shrink-0 items-center justify-center [&_svg]:size-5\">\n {local.children}\n </span>\n <span class=\"min-w-0 flex-1 truncate text-start group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n <Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>\n </button>\n\n <RailTip position={tip.position()} icon={local.children} label={local.label} />\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,SAAS,YAAY,OAA0D;CAC7E,OAAOA,gBAAAA,SAAAA,WAAAA,EAAS,IAAA,YAAA;EAAW,OAAA,MAAM,MAAM;CAAK,EAA0B,SAAxB;EAAI,OAAA,KAAK,OAAO,IAAI;CAAC,CAAG,CAAA;AACxE;AA4BA,SAAgB,SAA2C,OAAyB;CAClF,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAwB,SAAS,aAAa,cAAc,UAAU;CAExF,MAAM,YAAY,iBAAiB,MAAM,aAAa,KAAK;CAC3D,MAAM,QAAQ;EACZ;EACA,OAAO,iBAAkB,UAAU,IAAI,sBAAsB,4BAA6B;CAC5F;CAEA,OACEC,gBAAAA,iBAAAA;EAAwB;EAAxB,IAAA,WAAA;GACEC,OAAAA,gBAAAA,aAAAA,WAAAA;IACEC,IAAG;IACH,IAAA,eAAA;KAAY,OAAA,MAAM,iBAAiB;IAAS;IAI5C,IAAA,mBAAA;KAAgB,OAAA,UAA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QAuBEH,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,MAAM;GAAQ;GAA1BA,WACI,aACAN,gBAAAA,UAAAA;IACE,IAAA,OAAA;KAAM,OAAA,SAAS;IAAC;IAChBC,MAAK;IACLC,OAAM;GACP,CAAA;EAEC,CAAA,GA/BR,IAgCQ;EAhCR,OAAA;CAgCQ,EAAA,CAAA,GAERK,gBAAAA,SAAAA;EAAS,IAAA,WAAA;GAAU,OAAA,IAAI,SAAS;EAAC;EAAE,IAAA,OAAA;GAAM,OAAA,MAAM;EAAQ;EAAE,IAAA,QAAA;GAAO,OAAA,MAAM;EAAK;CAAG,CAAA,CAlC/E;AAqCL"}
|
|
1
|
+
{"version":3,"file":"side-rail.js","names":["<Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />","<SideRailContext value={value}>\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n </SideRailContext>","<Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>","as=\"nav\"","<div\n data-slot=\"side-rail-header\"\n class={cn(\n 'h-topbar flex shrink-0 items-center gap-2.5 px-3 group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"side-rail-content\"\n class={cn(\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"side-rail-footer\"\n class={cn(\n 'flex shrink-0 flex-col gap-0.5 border-t border-sidebar-border px-2 py-2',\n local.class\n )}\n {...rest}\n />","<Show when={local.label}>\n {(labelSlot) => (\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {labelSlot()}\n </div>\n )}\n </Show>","<div data-slot=\"side-rail-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <Show when={local.label}>\n {(labelSlot) => (\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {labelSlot()}\n </div>\n )}\n </Show>\n {local.children}\n </div>","<Show when={props.position} keyed>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>\n </Portal>\n )}\n </Show>","<Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>\n </Portal>","<div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>","<Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>","<KbdChord keys={shortcut()} class=\"shrink-0\" />","class=\"shrink-0\"","top: `${position.top}px`","left: `${position.left}px`","height: `${position.height}px`","class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}","<Polymorphic\n as={local.as ?? 'a'}\n ref={tip.setRow}\n aria-current={local.active ? 'page' : undefined}\n aria-keyshortcuts={local.keyshortcuts}\n data-active={local.active ? '' : undefined}\n class={cn(\n sideRailItemClass,\n 'relative',\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n local.class\n )}\n onPointerEnter={tip.show}\n onPointerLeave={tip.hide}\n onFocus={tip.show}\n onBlur={tip.hide}\n {...(rest as Record<string, unknown>)}\n >\n <span class=\"flex size-5 shrink-0 items-center justify-center [&_svg]:size-5\">\n {local.children}\n </span>\n\n <span class=\"min-w-0 flex-1 truncate text-start group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n\n {/*\n * One element, two placements, because the badge is caller content and a DOM\n * node cannot be in two places. Expanded, it is a trailing count in the row's\n * flow, after the label — over the icon it would cover the glyph the row is\n * recognised by. Collapsed, there is no label to trail, so it leaves the flow\n * and pins to the icon's top-end corner: anchored to the row's centre (where\n * the centred icon sits) and pushed out by 14px, the icon's half-width plus\n * the 4px overhang, so a wider count grows back over the icon rather than past\n * the rail's edge.\n */}\n <Show when={local.badge}>\n {(badgeSlot) => (\n <span\n data-slot=\"side-rail-badge\"\n class=\"flex shrink-0 items-center justify-center group-data-[collapsed=true]/rail:absolute group-data-[collapsed=true]/rail:end-1/2 group-data-[collapsed=true]/rail:top-1/2 group-data-[collapsed=true]/rail:-me-3.5 group-data-[collapsed=true]/rail:-mt-3.5\"\n >\n {badgeSlot()}\n </span>\n )}\n </Show>\n\n <Show when={trailing() === undefined && local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>\n\n <Show when={trailing()}>\n {(trailingSlot) => <span class=\"ms-auto shrink-0\">{trailingSlot()}</span>}\n </Show>\n </Polymorphic>","ref={tip.setRow}","<Show when={local.badge}>\n {(badgeSlot) => (\n <span\n data-slot=\"side-rail-badge\"\n class=\"flex shrink-0 items-center justify-center group-data-[collapsed=true]/rail:absolute group-data-[collapsed=true]/rail:end-1/2 group-data-[collapsed=true]/rail:top-1/2 group-data-[collapsed=true]/rail:-me-3.5 group-data-[collapsed=true]/rail:-mt-3.5\"\n >\n {badgeSlot()}\n </span>\n )}\n </Show>","<Show when={trailing() === undefined && local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>","trailing() === undefined && local.shortcut","<KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />","size=\"compact\"","class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"","<Show when={trailing()}>\n {(trailingSlot) => <span class=\"ms-auto shrink-0\">{trailingSlot()}</span>}\n </Show>","<RailTip\n position={tip.position()}\n icon={local.children}\n label={local.label}\n active={local.active}\n shortcut={local.shortcut}\n />","type=\"button\"","<Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>","<RailTip position={tip.position()} icon={local.children} label={local.label} />","_$spread","_$insert","_$effect","_$readShallow","_$className","_$setStyleProperty","resolveChildren"],"sources":["../../../../src/components/layout/side-rail/side-rail.tsx"],"sourcesContent":["import type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport {\n children as resolveChildren,\n Show,\n createMemo,\n createSignal,\n omit,\n useContext,\n} from 'solid-js'\nimport { Dynamic, Portal } from '@solidjs/web'\nimport { tooltipTip } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { KbdChord } from '../../ui/kbd'\nimport { SideRailContext } from './side-rail-context'\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * polymorphic props these components have always taken.\n */\nexport type PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\n/** Renders the caller's `as`, which arrives in the spread props, or the default tag. */\nfunction Polymorphic(props: Record<string, unknown> & { as?: ValidComponent }) {\n return <Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />\n}\n\n/**\n * SideRail.\n *\n * The narrow, persistent column of top-level destinations at the window's leading\n * edge: the app mark, the primary sections, and a footer for account and settings.\n * It is the one piece of chrome that is always on screen, which is why it is a\n * component rather than something each view arranges.\n *\n * Two forms, one component. Collapsed it is an icon column; expanded it carries\n * labels. Both widths come from `--rail-width` (56px) and `--rail-width-expanded`\n * (236px), so an app cannot pick its own and end up a few pixels out of step with\n * the app beside it.\n *\n * The rail does not own its collapsed state; the app does. That state has to\n * survive a reload and usually lives with the rest of the window preferences, and\n * a rail that kept it privately could not be restored.\n */\nexport type SideRailProps<T extends ValidComponent = 'nav'> = PolymorphicProps<\n T,\n {\n class?: string\n collapsed?: boolean\n 'aria-label'?: string\n }\n>\n\nexport function SideRail<T extends ValidComponent = 'nav'>(props: SideRailProps<T>) {\n const local = props as SideRailProps\n const rest = omit(props as SideRailProps, 'class', 'collapsed', 'aria-label', 'children')\n\n const collapsed = createMemo(() => local.collapsed ?? false)\n const value = {\n collapsed,\n width: createMemo(() => (collapsed() ? 'var(--rail-width)' : 'var(--rail-width-expanded)')),\n }\n\n return (\n <SideRailContext value={value}>\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n </SideRailContext>\n )\n}\n\n/** The header slot: the app mark, and the product name when there is room. */\nexport function SideRailHeader(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"side-rail-header\"\n class={cn(\n 'h-topbar flex shrink-0 items-center gap-2.5 px-3 group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The scrolling middle. Keeps the header and the footer pinned. */\nexport function SideRailContent(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"side-rail-content\"\n class={cn(\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The pinned footer: account, settings, help. */\nexport function SideRailFooter(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"side-rail-footer\"\n class={cn(\n 'flex shrink-0 flex-col gap-0.5 border-t border-sidebar-border px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A titled group of rail destinations. The title hides when collapsed. */\nexport function SideRailSection(props: ComponentProps<'div'> & { label?: string }) {\n const local = props\n const rest = omit(props, 'class', 'label', 'children')\n\n return (\n <div data-slot=\"side-rail-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <Show when={local.label}>\n {(labelSlot) => (\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {labelSlot()}\n </div>\n )}\n </Show>\n {local.children}\n </div>\n )\n}\n\nconst sideRailItemClass = [\n 'group/rail-item flex h-rail-item min-w-0 w-full items-center gap-2.5 rounded-md px-3 text-sm font-medium',\n 'group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n 'transition-[color,background-color,transform] ease-out outline-none select-none',\n 'focus-visible:border-ring focus-visible:focus-outline-inset',\n /*\n * The donor's row scales up slightly under the pointer and down under a press.\n * It is a CSS transform rather than a motion-library gesture because the two are\n * the same thing here and the transform costs nothing at runtime: no wrapper\n * element, no listener, and it works on whatever element a caller renders the row\n * as — an anchor, a button, a router's own link.\n *\n * The collapsed rail opts out: a 1.02 scale on a 56px column pushes the row past\n * the rail's own edge, which reads as a glitch rather than as feedback.\n */\n 'hover:scale-[1.02] active:scale-[0.97] group-data-[collapsed=true]/rail:hover:scale-100 group-data-[collapsed=true]/rail:active:scale-[0.98]',\n '[&_svg]:size-5 [&_svg]:shrink-0',\n].join(' ')\n\n/*\n * The rail's states are accent-driven: the icon carries `--primary` on hover and\n * on the active destination, and both states draw the accent's own tint rather\n * than a neutral fill, so the rail reads as the app's accent chroma instead of a\n * grey column. The active label stays on `sidebar-foreground` because the accent\n * presets guarantee their 3:1 interaction minimum against the surface, not the\n * 4.5:1 small text owes; the icon is a graphic and rides the accent.\n */\nconst sideRailItemStateClass = {\n active: 'bg-primary-subtle text-sidebar-foreground [&_svg]:text-primary',\n idle: 'text-sidebar-muted-foreground hover:bg-primary-subtle/60 hover:text-primary',\n}\n\nconst TIP_GAP_PX = 8\n\ntype TipPosition = { top: number; left: number; height: number }\n\n/** The collapsed rail's tip state for one row; see `SideRailItem` for its treatment. */\nfunction createRailTip() {\n const rail = useContext(SideRailContext)\n const [row, setRow] = createSignal<HTMLElement>()\n const [position, setPosition] = createSignal<TipPosition | null>(null)\n return {\n setRow,\n position,\n show: () => {\n const element = row()\n if (!element || !rail?.collapsed()) return\n const rect = element.getBoundingClientRect()\n setPosition({ top: rect.top, left: rect.right + TIP_GAP_PX, height: rect.height })\n },\n hide: () => setPosition(null),\n }\n}\n\nfunction RailTip(props: {\n position: TipPosition | null\n icon: JSX.Element\n label: string\n active?: boolean\n shortcut?: string\n}) {\n return (\n /* The portal can finish an effect after the tooltip closes; capture its position. */\n <Show when={props.position} keyed>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n tooltipTip,\n 'pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 ps-3 pe-3 whitespace-nowrap'\n )}\n style={{\n top: `${position.top}px`,\n left: `${position.left}px`,\n height: `${position.height}px`,\n }}\n >\n <span\n class={cn('flex size-5 shrink-0 items-center justify-center [&_svg]:size-5', {\n 'text-primary': props.active,\n })}\n >\n {props.icon}\n </span>\n {props.label}\n <Show when={props.shortcut}>\n {(shortcut) => <KbdChord keys={shortcut()} class=\"shrink-0\" />}\n </Show>\n </div>\n </Portal>\n )}\n </Show>\n )\n}\n\n/**\n * A rail destination.\n *\n * ## The tooltip is the rail's hover affordance, not a generic bubble\n *\n * Collapsed, the row has no text, so the label has to come from somewhere. This\n * ports the donor's treatment rather than using a standard tooltip, because the\n * details are what make it read as part of the rail:\n *\n * - It is **flush with the row**: positioned at the row's own top and given the\n * row's own height, so it continues the row outward instead of floating near\n * it. A centred bubble with an arrow reads as a separate object.\n * - It **repeats the icon**, which anchors it to the row it belongs to.\n * - It carries the **keyboard chord**, which is the one piece of information a\n * collapsed rail otherwise cannot show.\n * - It opens on **hover and on focus**, so a keyboard user gets the same label a\n * pointer user does.\n * - It is `pointer-events-none` and `aria-hidden`: the row already carries the\n * name (as a visually hidden span when collapsed), so this is decoration and\n * must never be the accessible name.\n *\n * ## The chord on the row\n *\n * Expanded, the row shows its chord on hover and on focus — and the chord is\n * declared once to assistive technology through `aria-keyshortcuts` rather than\n * being read out as glyphs. The visible badge is `aria-hidden` for that reason.\n */\nexport type SideRailItemProps<T extends ValidComponent = 'a'> = PolymorphicProps<\n T,\n {\n class?: string\n /** Marks the item as the current destination. */\n active?: boolean\n /**\n * The item's accessible name. Required, and always in the accessibility tree:\n * collapsed it moves into the tooltip and a visually hidden span rather than\n * being deleted.\n */\n label: string\n /**\n * A count or a dot. Expanded, it trails the label at the row's end; collapsed,\n * it moves onto the icon's corner, so the rail never loses it.\n */\n badge?: JSX.Element\n /** An indicator pinned to the trailing edge in the expanded form. */\n trailing?: JSX.Element\n /** The chord as it should be drawn, e.g. `⌘1`. Shown on hover and focus. */\n shortcut?: string\n /**\n * The same chord in the ARIA grammar, e.g. `Meta+1`. Declared to assistive\n * technology instead of the display glyphs, which are not a keyboard shortcut\n * a screen reader can parse. Supply it whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n>\n\nexport function SideRailItem<T extends ValidComponent = 'a'>(props: SideRailItemProps<T>) {\n const local = props as SideRailItemProps\n const rest = omit(\n props as SideRailItemProps,\n 'as',\n 'class',\n 'active',\n 'label',\n 'badge',\n 'trailing',\n 'shortcut',\n 'keyshortcuts',\n 'children'\n )\n\n const tip = createRailTip()\n const trailing = resolveChildren(() => local.trailing)\n\n return (\n <>\n <Polymorphic\n as={local.as ?? 'a'}\n ref={tip.setRow}\n aria-current={local.active ? 'page' : undefined}\n aria-keyshortcuts={local.keyshortcuts}\n data-active={local.active ? '' : undefined}\n class={cn(\n sideRailItemClass,\n 'relative',\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n local.class\n )}\n onPointerEnter={tip.show}\n onPointerLeave={tip.hide}\n onFocus={tip.show}\n onBlur={tip.hide}\n {...(rest as Record<string, unknown>)}\n >\n <span class=\"flex size-5 shrink-0 items-center justify-center [&_svg]:size-5\">\n {local.children}\n </span>\n\n <span class=\"min-w-0 flex-1 truncate text-start group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n\n {/*\n * One element, two placements, because the badge is caller content and a DOM\n * node cannot be in two places. Expanded, it is a trailing count in the row's\n * flow, after the label — over the icon it would cover the glyph the row is\n * recognised by. Collapsed, there is no label to trail, so it leaves the flow\n * and pins to the icon's top-end corner: anchored to the row's centre (where\n * the centred icon sits) and pushed out by 14px, the icon's half-width plus\n * the 4px overhang, so a wider count grows back over the icon rather than past\n * the rail's edge.\n */}\n <Show when={local.badge}>\n {(badgeSlot) => (\n <span\n data-slot=\"side-rail-badge\"\n class=\"flex shrink-0 items-center justify-center group-data-[collapsed=true]/rail:absolute group-data-[collapsed=true]/rail:end-1/2 group-data-[collapsed=true]/rail:top-1/2 group-data-[collapsed=true]/rail:-me-3.5 group-data-[collapsed=true]/rail:-mt-3.5\"\n >\n {badgeSlot()}\n </span>\n )}\n </Show>\n\n <Show when={trailing() === undefined && local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>\n\n <Show when={trailing()}>\n {(trailingSlot) => <span class=\"ms-auto shrink-0\">{trailingSlot()}</span>}\n </Show>\n </Polymorphic>\n\n <RailTip\n position={tip.position()}\n icon={local.children}\n label={local.label}\n active={local.active}\n shortcut={local.shortcut}\n />\n </>\n )\n}\n\n/** A non-navigating rail control: a collapse toggle, a \"new\" action. */\nexport function SideRailButton(\n props: Omit<ComponentProps<'button'>, 'type'> & {\n label: string\n shortcut?: string\n active?: boolean\n }\n) {\n const local = props\n const rest = omit(props, 'class', 'label', 'shortcut', 'children', 'active')\n const tip = createRailTip()\n\n return (\n <>\n <button\n type=\"button\"\n ref={tip.setRow}\n aria-label={local.label}\n data-active={local.active ? 'true' : undefined}\n onPointerEnter={tip.show}\n onPointerLeave={tip.hide}\n onFocus={tip.show}\n onBlur={tip.hide}\n class={cn(\n sideRailItemClass,\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n <span class=\"flex size-5 shrink-0 items-center justify-center [&_svg]:size-5\">\n {local.children}\n </span>\n <span class=\"min-w-0 flex-1 truncate text-start group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n <Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord\n keys={shortcut()}\n size=\"compact\"\n class=\"shrink-0 opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n />\n )}\n </Show>\n </button>\n\n <RailTip position={tip.position()} icon={local.children} label={local.label} />\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,SAAS,YAAY,OAA0D;CAC7E,OAAOA,gBAAAA,SAAAA,WAAAA,EAAS,IAAA,YAAA;EAAW,OAAA,MAAM,MAAM;CAAK,EAA0B,SAAxB;EAAI,OAAA,KAAK,OAAO,IAAI;CAAC,CAAG,CAAA;AACxE;AA4BA,SAAgB,SAA2C,OAAyB;CAClF,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAwB,SAAS,aAAa,cAAc,UAAU;CAExF,MAAM,YAAY,iBAAiB,MAAM,aAAa,KAAK;CAC3D,MAAM,QAAQ;EACZ;EACA,OAAO,iBAAkB,UAAU,IAAI,sBAAsB,4BAA6B;CAC5F;CAEA,OACEC,gBAAAA,iBAAAA;EAAwB;EAAxB,IAAA,WAAA;GACEC,OAAAA,gBAAAA,aAAAA,WAAAA;IACEC,IAAG;IACH,IAAA,eAAA;KAAY,OAAA,MAAM,iBAAiB;IAAS;IAI5C,IAAA,mBAAA;KAAgB,OAAA,UAAU,IAAI,SAAS;IAAO;IAC9C,IAAA,UAAA;KAAO,OAAA,GACL,8GACA,4CACA;MAAE,UAAU,UAAU;MAAG,mBAAmB,CAAC,UAAU;KAAE,GACzD,MAAM,KACR;IAAC;GAIU,GAHN,MAbP,EAAA,IAAA,WAAA;IAeG,OAAA,MAAM;GACI,EAAA,CAAA,CAAA;EACE;;AAErB;;AAGA,SAAgB,eAAe,OAA8B;CAC3D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,OAAA,OAOC;CADC6B,OAAA,MAAA,CAAA;EALA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,0IACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,KAAA;CAPR,OACE5B;AASJ;;AAGA,SAAgB,gBAAgB,OA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min-w-0 items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium",
|
|
8
8
|
"whitespace-nowrap transition-colors ease-out outline-none select-none [@media(any-pointer:coarse)]:min-h-11",
|
|
9
|
-
"focus-visible:border-ring focus-visible:
|
|
9
|
+
"focus-visible:border-ring focus-visible:focus-outline-inset",
|
|
10
10
|
"[&_svg]:size-4 [&_svg]:shrink-0"
|
|
11
11
|
].join(" ");
|
|
12
12
|
var sidebarNavItemStateClass = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nav-classes.js","names":[],"sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav-classes.ts"],"sourcesContent":["/**\n * A sidebar row. Exported classes, so a caller's own element can match it.\n * Any coarse pointer gets a 44px target without changing desktop density.\n */\nexport const sidebarNavItemClass = [\n 'group/nav-item relative flex min-w-0 items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium',\n 'whitespace-nowrap transition-colors ease-out outline-none select-none [@media(any-pointer:coarse)]:min-h-11',\n 'focus-visible:border-ring focus-visible:
|
|
1
|
+
{"version":3,"file":"sidebar-nav-classes.js","names":[],"sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav-classes.ts"],"sourcesContent":["/**\n * A sidebar row. Exported classes, so a caller's own element can match it.\n * Any coarse pointer gets a 44px target without changing desktop density.\n */\nexport const sidebarNavItemClass = [\n 'group/nav-item relative flex min-w-0 items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium',\n 'whitespace-nowrap transition-colors ease-out outline-none select-none [@media(any-pointer:coarse)]:min-h-11',\n 'focus-visible:border-ring focus-visible:focus-outline-inset',\n '[&_svg]:size-4 [&_svg]:shrink-0',\n].join(' ')\n\nexport const sidebarNavItemStateClass = {\n active: 'bg-primary-subtle text-foreground',\n idle: 'text-muted-foreground hover:bg-surface-hover hover:text-foreground',\n}\n"],"mappings":";;;;;AAIA,IAAa,sBAAsB;CACjC;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAEV,IAAa,2BAA2B;CACtC,QAAQ;CACR,MAAM;AACR"}
|
|
@@ -180,7 +180,7 @@ function SidebarNavSection(props) {
|
|
|
180
180
|
trigger.onReorder?.(event.key === "ArrowUp" ? "up" : "down");
|
|
181
181
|
},
|
|
182
182
|
get "class"() {
|
|
183
|
-
return cn("flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:
|
|
183
|
+
return cn("flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:focus-outline-inset [@media(any-pointer:coarse)]:min-h-11", "-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0", local.active ? "text-foreground" : "text-sidebar-muted-foreground");
|
|
184
184
|
}
|
|
185
185
|
}], true);
|
|
186
186
|
insert(_el$10, heading);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nav.js","names":["<Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />","<Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Section'}\n class={cn(\n 'bg-sidebar text-sidebar-foreground flex h-full w-sidebar min-w-0 max-w-full shrink-0 flex-col border-e border-sidebar-border',\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>","as=\"nav\"","<div\n data-slot=\"sidebar-nav-header\"\n class={cn('flex h-topbar shrink-0 items-center justify-between gap-2 px-3', local.class)}\n {...rest}\n />","<Polymorphic\n as=\"div\"\n data-slot=\"sidebar-nav-title\"\n class={cn('truncate text-sm font-semibold tracking-tight', local.class)}\n {...(rest as ComponentProps<'div'>)}\n />","as=\"div\"","<div\n data-slot=\"sidebar-nav-content\"\n class={cn(\n /* A stable gutter keeps rows from shifting sideways when the list\n grows past the fold and the scrollbar appears. */\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 py-2 [scrollbar-gutter:stable]',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"sidebar-nav-footer\"\n class={cn('flex shrink-0 items-center gap-1 border-t border-sidebar-border p-2', local.class)}\n {...rest}\n />","<Show when={local.collapsible}>\n <ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 shrink-0 text-muted-foreground transition-transform ease-out', {\n 'rotate-90': open(),\n })}\n />\n </Show>","<ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 shrink-0 text-muted-foreground transition-transform ease-out', {\n 'rotate-90': open(),\n })}\n />","<Show when={local.count !== undefined}>\n {/* A string: this Solid 2 build inserts a dynamic `0` as empty text. */}\n <span class=\"shrink-0 tabular-nums text-muted-foreground\">{String(local.count)}</span>\n </Show>","<Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>","local.headingAs ? local.label : undefined","<Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>","type=\"button\"","onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}","onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}","<div\n data-slot=\"sidebar-nav-section-header\"\n data-active={local.active ? '' : undefined}\n class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}\n >\n <Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>\n <Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>\n </div>","<Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>","class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}","<div data-slot=\"sidebar-nav-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <div\n data-slot=\"sidebar-nav-section-header\"\n data-active={local.active ? '' : undefined}\n class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}\n >\n <Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>\n <Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>\n </div>\n <Show when={!local.collapsible || open()}>\n <div class=\"flex flex-col gap-0.5\">{local.children}</div>\n </Show>\n </div>","<div\n data-slot=\"sidebar-nav-row\"\n class={cn(\n 'group/sidebar-nav-row flex min-w-0 flex-wrap items-center gap-0.5 [&>[data-slot=sidebar-nav-item]]:flex-1 [&>[data-slot=sidebar-nav-item]]:basis-36',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.actions}>\n {(actionsSlot) => (\n <span\n data-slot=\"sidebar-nav-row-actions\"\n class=\"ms-auto flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity ease-out group-hover/sidebar-nav-row:opacity-100 group-focus-within/sidebar-nav-row:opacity-100 has-[[aria-haspopup=menu][aria-expanded=true]]:opacity-100 has-[[aria-haspopup=true][aria-expanded=true]]:opacity-100 [@media(any-pointer:coarse)]:opacity-100\"\n >\n {actionsSlot()}\n </span>\n )}\n </Show>\n </div>","<Show when={local.actions}>\n {(actionsSlot) => (\n <span\n data-slot=\"sidebar-nav-row-actions\"\n class=\"ms-auto flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity ease-out group-hover/sidebar-nav-row:opacity-100 group-focus-within/sidebar-nav-row:opacity-100 has-[[aria-haspopup=menu][aria-expanded=true]]:opacity-100 has-[[aria-haspopup=true][aria-expanded=true]]:opacity-100 [@media(any-pointer:coarse)]:opacity-100\"\n >\n {actionsSlot()}\n </span>\n )}\n </Show>","<span\n data-slot=\"sidebar-nav-label\"\n class={cn('min-w-0 flex-1 truncate text-start', local.class)}\n {...rest}\n />","<Polymorphic\n as=\"a\"\n data-slot=\"sidebar-nav-item\"\n aria-current={local.active ? 'page' : undefined}\n data-active={local.active ? '' : undefined}\n class={cn(\n sidebarNavItemClass,\n local.active ? sidebarNavItemStateClass.active : sidebarNavItemStateClass.idle,\n { 'ps-8': local.nested },\n local.class\n )}\n {...(rest as ComponentProps<'a'>)}\n >\n {local.children}\n <Show when={local.trailing}>\n {(trailingSlot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1\">{trailingSlot()}</span>\n )}\n </Show>\n </Polymorphic>","as=\"a\"","local.children","<Show when={local.trailing}>\n {(trailingSlot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1\">{trailingSlot()}</span>\n )}\n </Show>","<button\n type=\"button\"\n class={cn(\n sidebarNavItemClass,\n sidebarNavItemStateClass.idle,\n 'w-full disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>","LucideChevronRight","_$spread","_$insert","_$effect","_$readShallow","_$className","_$setAttribute"],"sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav.tsx"],"sourcesContent":["import { ChevronRight as LucideChevronRight } from '@lucide/solid'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { Dynamic } from '@solidjs/web'\nimport { Show, createSignal, omit } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { sidebarNavItemClass, sidebarNavItemStateClass } from './sidebar-nav-classes'\nimport { fastIcon } from '#lib/fast-icon'\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * polymorphic props these components have always taken.\n */\nexport type PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\n/** Renders the caller's `as`, which arrives in the spread props, or the default tag. */\nfunction Polymorphic(props: Record<string, unknown> & { as?: ValidComponent }) {\n return <Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />\n}\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronRight = fastIcon(LucideChevronRight)\n\n/**\n * SidebarNav.\n *\n * The secondary navigation column: the list of things inside the destination\n * the rail selected — projects, sessions, files, threads. It is a different\n * object from the rail, not a wider version of it, which is why it is a separate\n * component rather than the rail with labels on.\n *\n * Rows share one recipe with the rail's, so a row in a sidebar and a row in a\n * rail read as the same kind of thing at the same density. That recipe is\n * exactly KiroCrew's nav row: `text-sm font-medium`, `gap-2.5`, `px-3 py-2`,\n * `rounded-md`, `transition-colors`.\n *\n * The width comes from `--sidebar-width`. Sections collapse by default only when\n * the caller says so, because a section that starts collapsed and holds the\n * user's own work is a hidden default.\n */\nexport type SidebarNavProps<T extends ValidComponent = 'nav'> = PolymorphicProps<\n T,\n { class?: string; 'aria-label'?: string }\n>\n\nexport function SidebarNav<T extends ValidComponent = 'nav'>(props: SidebarNavProps<T>) {\n const local = props as SidebarNavProps\n const rest = omit(props as SidebarNavProps, 'class', 'aria-label', 'children')\n\n return (\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Section'}\n class={cn(\n 'bg-sidebar text-sidebar-foreground flex h-full w-sidebar min-w-0 max-w-full shrink-0 flex-col border-e border-sidebar-border',\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n )\n}\n\nexport function SidebarNavHeader(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sidebar-nav-header\"\n class={cn('flex h-topbar shrink-0 items-center justify-between gap-2 px-3', local.class)}\n {...rest}\n />\n )\n}\n\nexport type SidebarNavTitleProps<T extends ValidComponent = 'div'> = PolymorphicProps<\n T,\n { class?: string }\n>\n\nexport function SidebarNavTitle<T extends ValidComponent = 'div'>(props: SidebarNavTitleProps<T>) {\n const local = props as SidebarNavTitleProps\n const rest = omit(props as SidebarNavTitleProps, 'class')\n return (\n <Polymorphic\n as=\"div\"\n data-slot=\"sidebar-nav-title\"\n class={cn('truncate text-sm font-semibold tracking-tight', local.class)}\n {...(rest as ComponentProps<'div'>)}\n />\n )\n}\n\n/** The scrolling middle of the sidebar. */\nexport function SidebarNavContent(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sidebar-nav-content\"\n class={cn(\n /* A stable gutter keeps rows from shifting sideways when the list\n grows past the fold and the scrollbar appears. */\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 py-2 [scrollbar-gutter:stable]',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SidebarNavFooter(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sidebar-nav-footer\"\n class={cn('flex shrink-0 items-center gap-1 border-t border-sidebar-border p-2', local.class)}\n {...rest}\n />\n )\n}\n\n/** Props forwarded to a collapsible section's disclosure button. */\nexport type SidebarNavSectionTriggerProps = Omit<\n ComponentProps<'button'>,\n 'type' | 'aria-expanded' | 'onClick' | 'onKeyDown' | 'children' | 'class' | 'style'\n> & {\n /** Called for Alt+ArrowUp/Down; the host owns ordering and row identity. */\n onReorder?: (direction: 'up' | 'down') => void\n /** Runs before the section toggle and may cancel it with `preventDefault()`. */\n onClick?: ComponentProps<'button'>['onClick']\n /** Runs before shared Alt+Arrow handling and may cancel it with `preventDefault()`. */\n onKeyDown?: ComponentProps<'button'>['onKeyDown']\n}\n\n/**\n * A titled, collapsible group. Collapsible because a list of projects\n * inevitably outgrows the column, and the user needs to put the ones they are\n * not using away *without* them disappearing into a menu.\n *\n * The disclosure is a plain `aria-expanded` button rather than Kobalte's\n * Collapsible: the disclosure pattern needs no focus or keyboard management,\n * only that attribute and the conditional children, so a primitive would add\n * context and a wrapper without adding behaviour.\n */\nexport type SidebarNavSectionProps = ComponentProps<'div'> & {\n label: string\n /** Render a disclosure control instead of a plain heading. */\n collapsible?: boolean\n defaultOpen?: boolean\n /** Mark the current project/group without changing its disclosure state. */\n active?: boolean\n /** Controlled disclosure state. When supplied, the host owns changes. */\n open?: boolean\n /** Called for user-initiated disclosure changes. */\n onOpenChange?: (open: boolean) => void\n /** Native props and reorder callbacks for the disclosure control. */\n triggerProps?: SidebarNavSectionTriggerProps\n /** Count shown beside the label. */\n count?: number\n /** A control at the trailing edge of the heading row. */\n action?: JSX.Element\n /**\n * When the trailing action shows. `hover` (default) reveals it on hover or\n * focus; `always` keeps it visible, for a section whose primary action is\n * creating its first item.\n */\n actionVisibility?: 'hover' | 'always'\n /** Semantic heading element for a host's section hierarchy. */\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\nexport function SidebarNavSection(props: SidebarNavSectionProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'label',\n 'collapsible',\n 'defaultOpen',\n 'active',\n 'open',\n 'onOpenChange',\n 'triggerProps',\n 'count',\n 'action',\n 'actionVisibility',\n 'headingAs',\n 'children'\n )\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? true)\n const open = () => local.open ?? uncontrolledOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n }\n\n const trigger = local.triggerProps ?? {}\n const triggerRest = omit(local.triggerProps ?? {}, 'onClick', 'onKeyDown', 'onReorder')\n\n const heading = (\n <>\n <Show when={local.collapsible}>\n <ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 shrink-0 text-muted-foreground transition-transform ease-out', {\n 'rotate-90': open(),\n })}\n />\n </Show>\n <span class=\"min-w-0 flex-1 truncate text-start\">{local.label}</span>\n <Show when={local.count !== undefined}>\n {/* A string: this Solid 2 build inserts a dynamic `0` as empty text. */}\n <span class=\"shrink-0 tabular-nums text-muted-foreground\">{String(local.count)}</span>\n </Show>\n </>\n )\n\n return (\n <div data-slot=\"sidebar-nav-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <div\n data-slot=\"sidebar-nav-section-header\"\n data-active={local.active ? '' : undefined}\n class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}\n >\n <Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>\n <Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>\n </div>\n <Show when={!local.collapsible || open()}>\n <div class=\"flex flex-col gap-0.5\">{local.children}</div>\n </Show>\n </div>\n )\n}\n\nexport type SidebarNavRowProps = ComponentProps<'div'> & {\n /** Adjacent controls, outside the navigation item's interactive element. */\n actions?: JSX.Element\n}\n\n/**\n * A navigation item and its adjacent controls. Actions stay outside the item\n * to avoid nested buttons; touch, keyboard focus, and expanded menus expose\n * them without requiring a pointer hover. A narrow lane or enlarged text\n * may move actions onto a second line rather than clipping the label or controls.\n */\nexport function SidebarNavRow(props: SidebarNavRowProps) {\n const local = props\n const rest = omit(props, 'class', 'children', 'actions')\n return (\n <div\n data-slot=\"sidebar-nav-row\"\n class={cn(\n 'group/sidebar-nav-row flex min-w-0 flex-wrap items-center gap-0.5 [&>[data-slot=sidebar-nav-item]]:flex-1 [&>[data-slot=sidebar-nav-item]]:basis-36',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.actions}>\n {(actionsSlot) => (\n <span\n data-slot=\"sidebar-nav-row-actions\"\n class=\"ms-auto flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity ease-out group-hover/sidebar-nav-row:opacity-100 group-focus-within/sidebar-nav-row:opacity-100 has-[[aria-haspopup=menu][aria-expanded=true]]:opacity-100 has-[[aria-haspopup=true][aria-expanded=true]]:opacity-100 [@media(any-pointer:coarse)]:opacity-100\"\n >\n {actionsSlot()}\n </span>\n )}\n </Show>\n </div>\n )\n}\n\n/** Row text may truncate visually; its complete content remains the accessible name. */\nexport function SidebarNavLabel(props: ComponentProps<'span'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <span\n data-slot=\"sidebar-nav-label\"\n class={cn('min-w-0 flex-1 truncate text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport type SidebarNavItemProps<T extends ValidComponent = 'a'> = PolymorphicProps<\n T,\n {\n class?: string\n active?: boolean\n /** Indent one level, for a child row such as a branch under a project. */\n nested?: boolean\n /** Trailing slot: a count, a status dot, a hover action. */\n trailing?: JSX.Element\n }\n>\n\nexport function SidebarNavItem<T extends ValidComponent = 'a'>(props: SidebarNavItemProps<T>) {\n const local = props as SidebarNavItemProps\n const rest = omit(\n props as SidebarNavItemProps,\n 'class',\n 'active',\n 'nested',\n 'trailing',\n 'children'\n )\n\n return (\n <Polymorphic\n as=\"a\"\n data-slot=\"sidebar-nav-item\"\n aria-current={local.active ? 'page' : undefined}\n data-active={local.active ? '' : undefined}\n class={cn(\n sidebarNavItemClass,\n local.active ? sidebarNavItemStateClass.active : sidebarNavItemStateClass.idle,\n { 'ps-8': local.nested },\n local.class\n )}\n {...(rest as ComponentProps<'a'>)}\n >\n {local.children}\n <Show when={local.trailing}>\n {(trailingSlot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1\">{trailingSlot()}</span>\n )}\n </Show>\n </Polymorphic>\n )\n}\n\n/** A row that is a button rather than a destination — \"New project\". */\nexport function SidebarNavButton(props: ComponentProps<'button'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n\n return (\n <button\n type=\"button\"\n class={cn(\n sidebarNavItemClass,\n sidebarNavItemStateClass.idle,\n 'w-full disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,YAAY,OAA0D;CAC7E,OAAOA,gBAAAA,SAAAA,WAAAA,EAAS,IAAA,YAAA;EAAW,OAAA,MAAM,MAAM;CAAK,EAA0B,SAAxB;EAAI,OAAA,KAAK,OAAO,IAAI;CAAC,CAAG,CAAA;AACxE;AAGA,IAAM,eAAe,SAAS6B,cAAkB;AAwBhD,SAAgB,WAA6C,OAA2B;CACtF,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAA0B,SAAS,cAAc,UAAU;CAE7E,OACE5B,gBAAAA,aAAAA,WAAAA;EACEC,IAAG;EACH,IAAA,eAAA;GAAY,OAAA,MAAM,iBAAiB;EAAS;EAC5C,IAAA,UAAA;GAAO,OAAA,GACL,gIACA,MAAM,KACR;EAAC;CAIU,GAHN,MAPP,EAAA,IAAA,WAAA;EASG,OAAA,MAAM;CACI,EAAA,CAAA,CAAA;AAEjB;AAEA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,OAAA,OAIC;CADC4B,OAAA,MAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,kEAAkE,MAAM,KAAK;EAAC;CAChF,GAAJ,IAAA,GAAA,KAAA;CAJR,OACE3B;AAMJ;AAOA,SAAgB,gBAAkD,OAAgC;CAChG,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAA+B,OAAO;CACxD,OACEC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GAAc,OAAA,MAAM,SAAS,SAAS,KAAA;EAAS;EAC/C,IAAA,gBAAA;GAAa,OAAA,MAAM,SAAS,KAAK,KAAA;EAAS;EAC1C,IAAA,UAAA;GAAO,OAAA,GACL,qBACA,MAAM,SAAS,yBAAyB,SAAS,yBAAyB,MAC1E,EAAE,QAAQ,MAAM,OAAO,GACvB,MAAM,KACR;EAAC;CASU,GARN,MAXP,EAAA,IAAA,WAAA;EAYC,OAAA,CACEC,WAAAA;GAAM,OAAA,MAAA;EAAO,CAAA,GACdC,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,MAAM;GAAQ;GAA1BA,WACI,wBACA;IAA6E,IAAA,SAAA,SAAA;IAA7EI,OAAA,QAAwD,YAAqB;IAA7E,OAAA;GAA6E,EAAA,CAAA;EAE3E,CAAA,CALP;CAMY,EAAA,CAAA,CAAA;AAEjB;;AAGA,SAAgB,iBAAiB,OAAiC;CAChE,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAG1C,IAAA,SAAA,QAWQ;CAHND,OAAA,QAAA,CAAA;EAPAhB,MAAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,qBACA,yBAAyB,MACzB,2DACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CARNiB,OAAA,cAUE;EAAC,OAAA,MAAM;CAAQ,CACT;CAZV,OACEH;AAaJ"}
|
|
1
|
+
{"version":3,"file":"sidebar-nav.js","names":["<Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />","<Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Section'}\n class={cn(\n 'bg-sidebar text-sidebar-foreground flex h-full w-sidebar min-w-0 max-w-full shrink-0 flex-col border-e border-sidebar-border',\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>","as=\"nav\"","<div\n data-slot=\"sidebar-nav-header\"\n class={cn('flex h-topbar shrink-0 items-center justify-between gap-2 px-3', local.class)}\n {...rest}\n />","<Polymorphic\n as=\"div\"\n data-slot=\"sidebar-nav-title\"\n class={cn('truncate text-sm font-semibold tracking-tight', local.class)}\n {...(rest as ComponentProps<'div'>)}\n />","as=\"div\"","<div\n data-slot=\"sidebar-nav-content\"\n class={cn(\n /* A stable gutter keeps rows from shifting sideways when the list\n grows past the fold and the scrollbar appears. */\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 py-2 [scrollbar-gutter:stable]',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"sidebar-nav-footer\"\n class={cn('flex shrink-0 items-center gap-1 border-t border-sidebar-border p-2', local.class)}\n {...rest}\n />","<Show when={local.collapsible}>\n <ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 shrink-0 text-muted-foreground transition-transform ease-out', {\n 'rotate-90': open(),\n })}\n />\n </Show>","<ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 shrink-0 text-muted-foreground transition-transform ease-out', {\n 'rotate-90': open(),\n })}\n />","<Show when={local.count !== undefined}>\n {/* A string: this Solid 2 build inserts a dynamic `0` as empty text. */}\n <span class=\"shrink-0 tabular-nums text-muted-foreground\">{String(local.count)}</span>\n </Show>","<Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:focus-outline-inset [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>","local.headingAs ? local.label : undefined","<Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:focus-outline-inset [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>","type=\"button\"","onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}","onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}","<div\n data-slot=\"sidebar-nav-section-header\"\n data-active={local.active ? '' : undefined}\n class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}\n >\n <Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:focus-outline-inset [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>\n <Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>\n </div>","<Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>","class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}","<div data-slot=\"sidebar-nav-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <div\n data-slot=\"sidebar-nav-section-header\"\n data-active={local.active ? '' : undefined}\n class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}\n >\n <Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:focus-outline-inset [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>\n <Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>\n </div>\n <Show when={!local.collapsible || open()}>\n <div class=\"flex flex-col gap-0.5\">{local.children}</div>\n </Show>\n </div>","<div\n data-slot=\"sidebar-nav-row\"\n class={cn(\n 'group/sidebar-nav-row flex min-w-0 flex-wrap items-center gap-0.5 [&>[data-slot=sidebar-nav-item]]:flex-1 [&>[data-slot=sidebar-nav-item]]:basis-36',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.actions}>\n {(actionsSlot) => (\n <span\n data-slot=\"sidebar-nav-row-actions\"\n class=\"ms-auto flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity ease-out group-hover/sidebar-nav-row:opacity-100 group-focus-within/sidebar-nav-row:opacity-100 has-[[aria-haspopup=menu][aria-expanded=true]]:opacity-100 has-[[aria-haspopup=true][aria-expanded=true]]:opacity-100 [@media(any-pointer:coarse)]:opacity-100\"\n >\n {actionsSlot()}\n </span>\n )}\n </Show>\n </div>","<Show when={local.actions}>\n {(actionsSlot) => (\n <span\n data-slot=\"sidebar-nav-row-actions\"\n class=\"ms-auto flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity ease-out group-hover/sidebar-nav-row:opacity-100 group-focus-within/sidebar-nav-row:opacity-100 has-[[aria-haspopup=menu][aria-expanded=true]]:opacity-100 has-[[aria-haspopup=true][aria-expanded=true]]:opacity-100 [@media(any-pointer:coarse)]:opacity-100\"\n >\n {actionsSlot()}\n </span>\n )}\n </Show>","<span\n data-slot=\"sidebar-nav-label\"\n class={cn('min-w-0 flex-1 truncate text-start', local.class)}\n {...rest}\n />","<Polymorphic\n as=\"a\"\n data-slot=\"sidebar-nav-item\"\n aria-current={local.active ? 'page' : undefined}\n data-active={local.active ? '' : undefined}\n class={cn(\n sidebarNavItemClass,\n local.active ? sidebarNavItemStateClass.active : sidebarNavItemStateClass.idle,\n { 'ps-8': local.nested },\n local.class\n )}\n {...(rest as ComponentProps<'a'>)}\n >\n {local.children}\n <Show when={local.trailing}>\n {(trailingSlot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1\">{trailingSlot()}</span>\n )}\n </Show>\n </Polymorphic>","as=\"a\"","local.children","<Show when={local.trailing}>\n {(trailingSlot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1\">{trailingSlot()}</span>\n )}\n </Show>","<button\n type=\"button\"\n class={cn(\n sidebarNavItemClass,\n sidebarNavItemStateClass.idle,\n 'w-full disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>","LucideChevronRight","_$spread","_$insert","_$effect","_$readShallow","_$className","_$setAttribute"],"sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav.tsx"],"sourcesContent":["import { ChevronRight as LucideChevronRight } from '@lucide/solid'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { Dynamic } from '@solidjs/web'\nimport { Show, createSignal, omit } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { sidebarNavItemClass, sidebarNavItemStateClass } from './sidebar-nav-classes'\nimport { fastIcon } from '#lib/fast-icon'\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * polymorphic props these components have always taken.\n */\nexport type PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\n/** Renders the caller's `as`, which arrives in the spread props, or the default tag. */\nfunction Polymorphic(props: Record<string, unknown> & { as?: ValidComponent }) {\n return <Dynamic component={props.as ?? 'div'} {...omit(props, 'as')} />\n}\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronRight = fastIcon(LucideChevronRight)\n\n/**\n * SidebarNav.\n *\n * The secondary navigation column: the list of things inside the destination\n * the rail selected — projects, sessions, files, threads. It is a different\n * object from the rail, not a wider version of it, which is why it is a separate\n * component rather than the rail with labels on.\n *\n * Rows share one recipe with the rail's, so a row in a sidebar and a row in a\n * rail read as the same kind of thing at the same density. That recipe is\n * exactly KiroCrew's nav row: `text-sm font-medium`, `gap-2.5`, `px-3 py-2`,\n * `rounded-md`, `transition-colors`.\n *\n * The width comes from `--sidebar-width`. Sections collapse by default only when\n * the caller says so, because a section that starts collapsed and holds the\n * user's own work is a hidden default.\n */\nexport type SidebarNavProps<T extends ValidComponent = 'nav'> = PolymorphicProps<\n T,\n { class?: string; 'aria-label'?: string }\n>\n\nexport function SidebarNav<T extends ValidComponent = 'nav'>(props: SidebarNavProps<T>) {\n const local = props as SidebarNavProps\n const rest = omit(props as SidebarNavProps, 'class', 'aria-label', 'children')\n\n return (\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Section'}\n class={cn(\n 'bg-sidebar text-sidebar-foreground flex h-full w-sidebar min-w-0 max-w-full shrink-0 flex-col border-e border-sidebar-border',\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n )\n}\n\nexport function SidebarNavHeader(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sidebar-nav-header\"\n class={cn('flex h-topbar shrink-0 items-center justify-between gap-2 px-3', local.class)}\n {...rest}\n />\n )\n}\n\nexport type SidebarNavTitleProps<T extends ValidComponent = 'div'> = PolymorphicProps<\n T,\n { class?: string }\n>\n\nexport function SidebarNavTitle<T extends ValidComponent = 'div'>(props: SidebarNavTitleProps<T>) {\n const local = props as SidebarNavTitleProps\n const rest = omit(props as SidebarNavTitleProps, 'class')\n return (\n <Polymorphic\n as=\"div\"\n data-slot=\"sidebar-nav-title\"\n class={cn('truncate text-sm font-semibold tracking-tight', local.class)}\n {...(rest as ComponentProps<'div'>)}\n />\n )\n}\n\n/** The scrolling middle of the sidebar. */\nexport function SidebarNavContent(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sidebar-nav-content\"\n class={cn(\n /* A stable gutter keeps rows from shifting sideways when the list\n grows past the fold and the scrollbar appears. */\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 py-2 [scrollbar-gutter:stable]',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SidebarNavFooter(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"sidebar-nav-footer\"\n class={cn('flex shrink-0 items-center gap-1 border-t border-sidebar-border p-2', local.class)}\n {...rest}\n />\n )\n}\n\n/** Props forwarded to a collapsible section's disclosure button. */\nexport type SidebarNavSectionTriggerProps = Omit<\n ComponentProps<'button'>,\n 'type' | 'aria-expanded' | 'onClick' | 'onKeyDown' | 'children' | 'class' | 'style'\n> & {\n /** Called for Alt+ArrowUp/Down; the host owns ordering and row identity. */\n onReorder?: (direction: 'up' | 'down') => void\n /** Runs before the section toggle and may cancel it with `preventDefault()`. */\n onClick?: ComponentProps<'button'>['onClick']\n /** Runs before shared Alt+Arrow handling and may cancel it with `preventDefault()`. */\n onKeyDown?: ComponentProps<'button'>['onKeyDown']\n}\n\n/**\n * A titled, collapsible group. Collapsible because a list of projects\n * inevitably outgrows the column, and the user needs to put the ones they are\n * not using away *without* them disappearing into a menu.\n *\n * The disclosure is a plain `aria-expanded` button rather than Kobalte's\n * Collapsible: the disclosure pattern needs no focus or keyboard management,\n * only that attribute and the conditional children, so a primitive would add\n * context and a wrapper without adding behaviour.\n */\nexport type SidebarNavSectionProps = ComponentProps<'div'> & {\n label: string\n /** Render a disclosure control instead of a plain heading. */\n collapsible?: boolean\n defaultOpen?: boolean\n /** Mark the current project/group without changing its disclosure state. */\n active?: boolean\n /** Controlled disclosure state. When supplied, the host owns changes. */\n open?: boolean\n /** Called for user-initiated disclosure changes. */\n onOpenChange?: (open: boolean) => void\n /** Native props and reorder callbacks for the disclosure control. */\n triggerProps?: SidebarNavSectionTriggerProps\n /** Count shown beside the label. */\n count?: number\n /** A control at the trailing edge of the heading row. */\n action?: JSX.Element\n /**\n * When the trailing action shows. `hover` (default) reveals it on hover or\n * focus; `always` keeps it visible, for a section whose primary action is\n * creating its first item.\n */\n actionVisibility?: 'hover' | 'always'\n /** Semantic heading element for a host's section hierarchy. */\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\nexport function SidebarNavSection(props: SidebarNavSectionProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'label',\n 'collapsible',\n 'defaultOpen',\n 'active',\n 'open',\n 'onOpenChange',\n 'triggerProps',\n 'count',\n 'action',\n 'actionVisibility',\n 'headingAs',\n 'children'\n )\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? true)\n const open = () => local.open ?? uncontrolledOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n }\n\n const trigger = local.triggerProps ?? {}\n const triggerRest = omit(local.triggerProps ?? {}, 'onClick', 'onKeyDown', 'onReorder')\n\n const heading = (\n <>\n <Show when={local.collapsible}>\n <ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 shrink-0 text-muted-foreground transition-transform ease-out', {\n 'rotate-90': open(),\n })}\n />\n </Show>\n <span class=\"min-w-0 flex-1 truncate text-start\">{local.label}</span>\n <Show when={local.count !== undefined}>\n {/* A string: this Solid 2 build inserts a dynamic `0` as empty text. */}\n <span class=\"shrink-0 tabular-nums text-muted-foreground\">{String(local.count)}</span>\n </Show>\n </>\n )\n\n return (\n <div data-slot=\"sidebar-nav-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <div\n data-slot=\"sidebar-nav-section-header\"\n data-active={local.active ? '' : undefined}\n class={cn(\n 'group/section-header flex items-center gap-1 rounded-md px-2 py-1.5',\n { '[@media(any-pointer:coarse)]:py-0': local.collapsible },\n local.active ? 'bg-primary-subtle text-foreground' : 'hover:bg-sidebar-accent/60'\n )}\n >\n <Polymorphic\n as={local.headingAs ?? 'div'}\n aria-label={local.headingAs ? local.label : undefined}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 text-2xs font-medium tracking-wide uppercase',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n <Show when={local.collapsible} fallback={heading}>\n <button\n {...(triggerRest as ComponentProps<'button'>)}\n type=\"button\"\n aria-expanded={open() ? 'true' : 'false'}\n aria-current={local.active ? 'page' : triggerRest['aria-current']}\n onClick={(event) => {\n callHandler(trigger.onClick, event)\n if (event.defaultPrevented) return\n setOpen(!open())\n }}\n onKeyDown={(event) => {\n callHandler(trigger.onKeyDown, event)\n if (event.defaultPrevented || !event.altKey) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n event.stopPropagation()\n trigger.onReorder?.(event.key === 'ArrowUp' ? 'up' : 'down')\n }}\n class={cn(\n 'flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-2xs font-medium tracking-wide uppercase outline-none transition-colors ease-out hover:text-sidebar-foreground focus-visible:border-ring focus-visible:focus-outline-inset [@media(any-pointer:coarse)]:min-h-11',\n /* WCAG 2.5.8: the row's vertical padding sits on the header, so\n the bare label would be a ~16px target. Stretch the button\n across that padding; the row's height does not change. A\n coarse pointer already gets min-h-11 on an unpadded row. */\n '-my-1.5 py-1.5 [@media(any-pointer:coarse)]:my-0 [@media(any-pointer:coarse)]:py-0',\n local.active ? 'text-foreground' : 'text-sidebar-muted-foreground'\n )}\n >\n {heading}\n </button>\n </Show>\n </Polymorphic>\n <Show when={local.action}>\n {(actionSlot) => (\n <span\n data-slot=\"sidebar-nav-section-action\"\n class={cn('shrink-0', {\n 'opacity-0 transition-opacity ease-out group-hover/section-header:opacity-100 focus-within:opacity-100 [@media(any-pointer:coarse)]:opacity-100':\n local.actionVisibility !== 'always',\n })}\n >\n {actionSlot()}\n </span>\n )}\n </Show>\n </div>\n <Show when={!local.collapsible || open()}>\n <div class=\"flex flex-col gap-0.5\">{local.children}</div>\n </Show>\n </div>\n )\n}\n\nexport type SidebarNavRowProps = ComponentProps<'div'> & {\n /** Adjacent controls, outside the navigation item's interactive element. */\n actions?: JSX.Element\n}\n\n/**\n * A navigation item and its adjacent controls. Actions stay outside the item\n * to avoid nested buttons; touch, keyboard focus, and expanded menus expose\n * them without requiring a pointer hover. A narrow lane or enlarged text\n * may move actions onto a second line rather than clipping the label or controls.\n */\nexport function SidebarNavRow(props: SidebarNavRowProps) {\n const local = props\n const rest = omit(props, 'class', 'children', 'actions')\n return (\n <div\n data-slot=\"sidebar-nav-row\"\n class={cn(\n 'group/sidebar-nav-row flex min-w-0 flex-wrap items-center gap-0.5 [&>[data-slot=sidebar-nav-item]]:flex-1 [&>[data-slot=sidebar-nav-item]]:basis-36',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.actions}>\n {(actionsSlot) => (\n <span\n data-slot=\"sidebar-nav-row-actions\"\n class=\"ms-auto flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity ease-out group-hover/sidebar-nav-row:opacity-100 group-focus-within/sidebar-nav-row:opacity-100 has-[[aria-haspopup=menu][aria-expanded=true]]:opacity-100 has-[[aria-haspopup=true][aria-expanded=true]]:opacity-100 [@media(any-pointer:coarse)]:opacity-100\"\n >\n {actionsSlot()}\n </span>\n )}\n </Show>\n </div>\n )\n}\n\n/** Row text may truncate visually; its complete content remains the accessible name. */\nexport function SidebarNavLabel(props: ComponentProps<'span'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <span\n data-slot=\"sidebar-nav-label\"\n class={cn('min-w-0 flex-1 truncate text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport type SidebarNavItemProps<T extends ValidComponent = 'a'> = PolymorphicProps<\n T,\n {\n class?: string\n active?: boolean\n /** Indent one level, for a child row such as a branch under a project. */\n nested?: boolean\n /** Trailing slot: a count, a status dot, a hover action. */\n trailing?: JSX.Element\n }\n>\n\nexport function SidebarNavItem<T extends ValidComponent = 'a'>(props: SidebarNavItemProps<T>) {\n const local = props as SidebarNavItemProps\n const rest = omit(\n props as SidebarNavItemProps,\n 'class',\n 'active',\n 'nested',\n 'trailing',\n 'children'\n )\n\n return (\n <Polymorphic\n as=\"a\"\n data-slot=\"sidebar-nav-item\"\n aria-current={local.active ? 'page' : undefined}\n data-active={local.active ? '' : undefined}\n class={cn(\n sidebarNavItemClass,\n local.active ? sidebarNavItemStateClass.active : sidebarNavItemStateClass.idle,\n { 'ps-8': local.nested },\n local.class\n )}\n {...(rest as ComponentProps<'a'>)}\n >\n {local.children}\n <Show when={local.trailing}>\n {(trailingSlot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1\">{trailingSlot()}</span>\n )}\n </Show>\n </Polymorphic>\n )\n}\n\n/** A row that is a button rather than a destination — \"New project\". */\nexport function SidebarNavButton(props: ComponentProps<'button'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n\n return (\n <button\n type=\"button\"\n class={cn(\n sidebarNavItemClass,\n sidebarNavItemStateClass.idle,\n 'w-full disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,YAAY,OAA0D;CAC7E,OAAOA,gBAAAA,SAAAA,WAAAA,EAAS,IAAA,YAAA;EAAW,OAAA,MAAM,MAAM;CAAK,EAA0B,SAAxB;EAAI,OAAA,KAAK,OAAO,IAAI;CAAC,CAAG,CAAA;AACxE;AAGA,IAAM,eAAe,SAAS6B,cAAkB;AAwBhD,SAAgB,WAA6C,OAA2B;CACtF,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAA0B,SAAS,cAAc,UAAU;CAE7E,OACE5B,gBAAAA,aAAAA,WAAAA;EACEC,IAAG;EACH,IAAA,eAAA;GAAY,OAAA,MAAM,iBAAiB;EAAS;EAC5C,IAAA,UAAA;GAAO,OAAA,GACL,gIACA,MAAM,KACR;EAAC;CAIU,GAHN,MAPP,EAAA,IAAA,WAAA;EASG,OAAA,MAAM;CACI,EAAA,CAAA,CAAA;AAEjB;AAEA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,OAAA,OAIC;CADC4B,OAAA,MAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,kEAAkE,MAAM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AA+C,OAA+B;CAC5F,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,UACA,UACA,YACA,UACF;CAEA,OACEC,gBAAAA,aAAAA,WAAAA;EACEC,IAAG;EACH,aAAU;EACV,IAAA,iBAAA;GAAc,OAAA,MAAM,SAAS,SAAS,KAAA;EAAS;EAC/C,IAAA,gBAAA;GAAa,OAAA,MAAM,SAAS,KAAK,KAAA;EAAS;EAC1C,IAAA,UAAA;GAAO,OAAA,GACL,qBACA,MAAM,SAAS,yBAAyB,SAAS,yBAAyB,MAC1E,EAAE,QAAQ,MAAM,OAAO,GACvB,MAAM,KACR;EAAC;CASU,GARN,MAXP,EAAA,IAAA,WAAA;EAYC,OAAA,CACEC,WAAAA;GAAM,OAAA,MAAA;EAAO,CAAA,GACdC,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,MAAM;GAAQ;GAA1BA,WACI,wBACA;IAA6E,IAAA,SAAA,SAAA;IAA7EI,OAAA,QAAwD,YAAqB;IAA7E,OAAA;GAA6E,EAAA,CAAA;EAE3E,CAAA,CALP;CAMY,EAAA,CAAA,CAAA;AAEjB;;AAGA,SAAgB,iBAAiB,OAAiC;CAChE,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAG1C,IAAA,SAAA,QAWQ;CAHND,OAAA,QAAA,CAAA;EAPAhB,MAAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,qBACA,yBAAyB,MACzB,2DACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CARNiB,OAAA,cAUE;EAAC,OAAA,MAAM;CAAQ,CACT;CAZV,OACEH;AAaJ"}
|
|
@@ -88,7 +88,7 @@ function TopBarSearch(props) {
|
|
|
88
88
|
type: "button",
|
|
89
89
|
"data-slot": "top-bar-search",
|
|
90
90
|
get "class"() {
|
|
91
|
-
return cn("text-muted-foreground flex h-control-md w-full min-w-(--control-height-md) items-center justify-center gap-2 rounded-md border border-input px-3 text-sm sm:justify-start", "transition-colors ease-out outline-none", "hover:bg-surface-hover hover:text-foreground", "focus-visible:border-ring focus-visible:
|
|
91
|
+
return cn("text-muted-foreground flex h-control-md w-full min-w-(--control-height-md) items-center justify-center gap-2 rounded-md border border-input px-3 text-sm sm:justify-start", "transition-colors ease-out outline-none", "hover:bg-surface-hover hover:text-foreground", "focus-visible:border-ring focus-visible:focus-outline", "window-no-drag", local.class);
|
|
92
92
|
},
|
|
93
93
|
get "aria-keyshortcuts"() {
|
|
94
94
|
return local.keyshortcuts;
|
|
@@ -128,7 +128,7 @@ function TopBarPill(props) {
|
|
|
128
128
|
type: "button",
|
|
129
129
|
"data-slot": "top-bar-pill",
|
|
130
130
|
get "class"() {
|
|
131
|
-
return cn("text-muted-foreground inline-flex h-control-sm shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium", "transition-colors ease-out outline-none", "hover:border-input hover:text-foreground", "focus-visible:border-ring focus-visible:
|
|
131
|
+
return cn("text-muted-foreground inline-flex h-control-sm shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium", "transition-colors ease-out outline-none", "hover:border-input hover:text-foreground", "focus-visible:border-ring focus-visible:focus-outline", "window-no-drag [&_svg]:size-3.5 [&_svg]:shrink-0", local.class);
|
|
132
132
|
}
|
|
133
133
|
}, rest], true);
|
|
134
134
|
insert(_el$8, () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-bar.js","names":["<header\n data-slot=\"top-bar\"\n class={cn(\n 'h-topbar relative z-(--z-sticky) grid shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 border-b border-border bg-card text-card-foreground md:grid-cols-[minmax(0,1fr)_clamp(240px,22vw,480px)_minmax(0,1fr)]',\n /* The bar is its own container so its children can move to a second\n row by the row's width in rem, which enlarged text shrinks. The\n first row keeps the bar's height (less the 1px bottom border); the\n second only exists when the centre has dropped onto it. */\n local.centerWidth === 'wide' &&\n '@container/top-bar h-auto grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] grid-rows-[minmax(calc(var(--topbar-height)-1px),auto)] gap-x-2 gap-y-0 md:grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] xl:grid-cols-[minmax(0,1fr)_clamp(240px,32vw,672px)_minmax(0,1fr)] [&>:nth-child(2)]:@max-[19rem]/top-bar:col-span-full [&>:nth-child(2)]:@max-[19rem]/top-bar:row-start-2 [&>:nth-child(2)]:@max-[19rem]/top-bar:pb-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-span-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-start-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:row-start-1',\n windowChromeClass(local),\n local.class\n )}\n {...rest}\n />","onFocusIn={(event) => {\n if (event.target instanceof HTMLElement) {\n event.target.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }\n callHandler(local.onFocusIn, event)\n }}","<div\n data-slot=\"top-bar-section\"\n class={cn(\n 'window-no-drag flex min-w-0 items-center gap-2 overflow-x-auto overflow-y-hidden',\n local.align === 'end' && 'md:justify-end-safe',\n local.align !== 'end' && 'justify-start',\n local.class\n )}\n onFocusIn={(event) => {\n if (event.target instanceof HTMLElement) {\n event.target.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }\n callHandler(local.onFocusIn, event)\n }}\n {...rest}\n />","<div\n data-slot=\"top-bar-title\"\n class={cn(\n /* The title slot sits in the drag region; a link, button or field\n placed in it (a breadcrumb, a view's search) must stay pressable. */\n 'truncate text-sm font-medium [&_:is(a,button,input)]:window-no-drag',\n local.align === 'center' && 'text-center',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"top-bar-breadcrumb\"\n class={cn(\n 'flex min-w-0 items-center gap-1.5 text-sm [&_:is(a,button,input)]:window-no-drag',\n local.class\n )}\n {...rest}\n />","type=\"button\"","<Search aria-hidden=\"true\" class=\"size-4 shrink-0 sm:hidden\" />","class=\"size-4 shrink-0 sm:hidden\"","<button\n type=\"button\"\n data-slot=\"top-bar-search\"\n class={cn(\n 'text-muted-foreground flex h-control-md w-full min-w-(--control-height-md) items-center justify-center gap-2 rounded-md border border-input px-3 text-sm sm:justify-start',\n 'transition-colors ease-out outline-none',\n 'hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'window-no-drag',\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Search aria-hidden=\"true\" class=\"size-4 shrink-0 sm:hidden\" />\n <span class=\"sr-only sm:not-sr-only sm:truncate\">{local.placeholder ?? 'Search'}</span>\n <Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />\n )}\n </Show>\n </button>","<Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />\n )}\n </Show>","<KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />","class=\"ms-auto hidden shrink-0 sm:inline-flex\"","<button\n type=\"button\"\n data-slot=\"top-bar-pill\"\n class={cn(\n 'text-muted-foreground inline-flex h-control-sm shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:border-input hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'window-no-drag [&_svg]:size-3.5 [&_svg]:shrink-0',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <span>{local.label}</span>\n </button>","LucideSearch","_$spread","_$insert"],"sources":["../../../../src/components/layout/top-bar/top-bar.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { Show, omit } from 'solid-js'\nimport { Search as LucideSearch } from '@lucide/solid'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { KbdChord } from '../../ui/kbd'\nimport { windowChromeClass, type WindowChromeProps } from './window-chrome'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Search = fastIcon(LucideSearch)\n\n/**\n * TopBar.\n *\n * The window's title row and primary toolbar. Three tracks: a leading group, a\n * centred search, and a trailing group. On wide screens the search is a fixed\n * function of the window width and the side groups are equal remainders. On\n * narrow screens the middle track yields space to the controls, and each side\n * group scrolls when necessary so keyboard focus can reveal every action.\n *\n * The centre track is sized for a lone search field. A bar whose centre holds\n * more than that, such as a search plus an action beside it, passes\n * `centerWidth=\"wide\"`: the centre then stays fluid below 1280px, with each\n * side group sized to its content but capped between 30% and 40% of the row\n * (a longer group scrolls instead): the cap is 30% on the narrowest rows and\n * grows to 40% as the row widens, so full side groups never squeeze the\n * centre's search out of it and enlarged text never pushes a short leading\n * control such as a navigation toggle out of the row. Above 1280px it takes a\n * wider fixed track.\n *\n * A wide bar also never squeezes its centre to nothing. When the row is\n * narrower than 19rem (measured in rem, so enlarged text reaches it at a wider\n * window) the centre moves to a second row of its own and the two side groups\n * share the first, the trailing group taking the remainder beside the leading\n * group's cap, so the leading and trailing controls and the whole centre each\n * keep a full row instead of fighting for one. The bar grows from one row\n * to two only then. The wide layout places the leading group, centre and\n * trailing group as its first, second and third children.\n *\n * On a frameless desktop window this row is also the drag region, so it carries\n * `window-drag` and the controls inside it opt back out. `macos-inset` and\n * `windows-inset` reserve the space the native window controls occupy, which is\n * why the row can look off-centre in a frameless window and be correct: it is\n * centred in the space the user can actually see.\n */\nexport type TopBarProps = Omit<ComponentProps<'header'>, 'draggable'> &\n WindowChromeProps & {\n /**\n * How wide the centre track is. `field` (default) suits a lone search field.\n * `wide` suits a centre that also holds an action: fluid below 1280px between\n * side groups sized to their content and capped between 30% and 40% of the\n * row (a longer group scrolls), then a clamp of 32vw up to 672px between equal\n * side tracks.\n * Below a 19rem row the centre drops to a second row of its own.\n */\n centerWidth?: 'field' | 'wide'\n }\n\nexport function TopBar(props: TopBarProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'draggable',\n 'macosInset',\n 'windowsInset',\n 'glass',\n 'centerWidth'\n )\n\n return (\n <header\n data-slot=\"top-bar\"\n class={cn(\n 'h-topbar relative z-(--z-sticky) grid shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 border-b border-border bg-card text-card-foreground md:grid-cols-[minmax(0,1fr)_clamp(240px,22vw,480px)_minmax(0,1fr)]',\n /* The bar is its own container so its children can move to a second\n row by the row's width in rem, which enlarged text shrinks. The\n first row keeps the bar's height (less the 1px bottom border); the\n second only exists when the centre has dropped onto it. */\n local.centerWidth === 'wide' &&\n '@container/top-bar h-auto grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] grid-rows-[minmax(calc(var(--topbar-height)-1px),auto)] gap-x-2 gap-y-0 md:grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] xl:grid-cols-[minmax(0,1fr)_clamp(240px,32vw,672px)_minmax(0,1fr)] [&>:nth-child(2)]:@max-[19rem]/top-bar:col-span-full [&>:nth-child(2)]:@max-[19rem]/top-bar:row-start-2 [&>:nth-child(2)]:@max-[19rem]/top-bar:pb-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-span-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-start-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:row-start-1',\n windowChromeClass(local),\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A scrollable side group; equal wide-screen tracks centre the search. */\nexport function TopBarSection(props: ComponentProps<'div'> & { align?: 'start' | 'end' }) {\n const local = props\n const rest = omit(props, 'class', 'align', 'onFocusIn')\n\n return (\n <div\n data-slot=\"top-bar-section\"\n class={cn(\n 'window-no-drag flex min-w-0 items-center gap-2 overflow-x-auto overflow-y-hidden',\n local.align === 'end' && 'md:justify-end-safe',\n local.align !== 'end' && 'justify-start',\n local.class\n )}\n onFocusIn={(event) => {\n if (event.target instanceof HTMLElement) {\n event.target.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }\n callHandler(local.onFocusIn, event)\n }}\n {...rest}\n />\n )\n}\n\nexport function TopBarTitle(\n props: ComponentProps<'div'> & {\n /** Aligns text within this slot; it does not position the slot. */\n align?: 'start' | 'center'\n }\n) {\n const local = props\n const rest = omit(props, 'class', 'align')\n return (\n <div\n data-slot=\"top-bar-title\"\n class={cn(\n /* The title slot sits in the drag region; a link, button or field\n placed in it (a breadcrumb, a view's search) must stay pressable. */\n 'truncate text-sm font-medium [&_:is(a,button,input)]:window-no-drag',\n local.align === 'center' && 'text-center',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A breadcrumb or path readout that yields to the actions when space runs out. */\nexport function TopBarBreadcrumb(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"top-bar-breadcrumb\"\n class={cn(\n 'flex min-w-0 items-center gap-1.5 text-sm [&_:is(a,button,input)]:window-no-drag',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type TopBarSearchProps = ComponentProps<'button'> & {\n /** The hint shown inside the field, e.g. \"Search projects and files\". */\n placeholder?: string\n /** The shortcut chip drawn at the trailing edge, e.g. \"⌘K\". */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+K`. The chip is\n * `aria-hidden` — reading it out would pollute the button's accessible\n * name — so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n}\n\n/**\n * The search affordance in the middle track.\n *\n * It is a button, not an input, and that is deliberate: clicking it opens the\n * command palette, which already owns the input, the ranking and the keyboard\n * handling. A second live input here would be a second source of truth for the\n * same query. It is styled to read as a field because that is what it behaves\n * like from the user's side.\n */\nexport function TopBarSearch(props: TopBarSearchProps) {\n const local = props\n const rest = omit(props, 'class', 'placeholder', 'shortcut', 'keyshortcuts')\n\n return (\n <button\n type=\"button\"\n data-slot=\"top-bar-search\"\n class={cn(\n 'text-muted-foreground flex h-control-md w-full min-w-(--control-height-md) items-center justify-center gap-2 rounded-md border border-input px-3 text-sm sm:justify-start',\n 'transition-colors ease-out outline-none',\n 'hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'window-no-drag',\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Search aria-hidden=\"true\" class=\"size-4 shrink-0 sm:hidden\" />\n <span class=\"sr-only sm:not-sr-only sm:truncate\">{local.placeholder ?? 'Search'}</span>\n <Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />\n )}\n </Show>\n </button>\n )\n}\n\n/**\n * A labelled top-bar control — the readouts KiroCrew puts in the trailing\n * group. Container queries on the group decide which of these survive a narrow\n * window; a caller marks the cheap-to-drop ones and the group handles the rest.\n */\nexport function TopBarPill(props: ComponentProps<'button'> & { label: string }) {\n const local = props\n const rest = omit(props, 'class', 'label', 'children')\n\n return (\n <button\n type=\"button\"\n data-slot=\"top-bar-pill\"\n class={cn(\n 'text-muted-foreground inline-flex h-control-sm shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:border-input hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'window-no-drag [&_svg]:size-3.5 [&_svg]:shrink-0',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <span>{local.label}</span>\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAM,SAAS,SAASa,QAAY;AAiDpC,SAAgB,OAAO,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;CAAK,CAAO;CAf7B,OACEH;AAiBJ"}
|
|
1
|
+
{"version":3,"file":"top-bar.js","names":["<header\n data-slot=\"top-bar\"\n class={cn(\n 'h-topbar relative z-(--z-sticky) grid shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 border-b border-border bg-card text-card-foreground md:grid-cols-[minmax(0,1fr)_clamp(240px,22vw,480px)_minmax(0,1fr)]',\n /* The bar is its own container so its children can move to a second\n row by the row's width in rem, which enlarged text shrinks. The\n first row keeps the bar's height (less the 1px bottom border); the\n second only exists when the centre has dropped onto it. */\n local.centerWidth === 'wide' &&\n '@container/top-bar h-auto grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] grid-rows-[minmax(calc(var(--topbar-height)-1px),auto)] gap-x-2 gap-y-0 md:grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] xl:grid-cols-[minmax(0,1fr)_clamp(240px,32vw,672px)_minmax(0,1fr)] [&>:nth-child(2)]:@max-[19rem]/top-bar:col-span-full [&>:nth-child(2)]:@max-[19rem]/top-bar:row-start-2 [&>:nth-child(2)]:@max-[19rem]/top-bar:pb-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-span-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-start-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:row-start-1',\n windowChromeClass(local),\n local.class\n )}\n {...rest}\n />","onFocusIn={(event) => {\n if (event.target instanceof HTMLElement) {\n event.target.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }\n callHandler(local.onFocusIn, event)\n }}","<div\n data-slot=\"top-bar-section\"\n class={cn(\n 'window-no-drag flex min-w-0 items-center gap-2 overflow-x-auto overflow-y-hidden',\n local.align === 'end' && 'md:justify-end-safe',\n local.align !== 'end' && 'justify-start',\n local.class\n )}\n onFocusIn={(event) => {\n if (event.target instanceof HTMLElement) {\n event.target.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }\n callHandler(local.onFocusIn, event)\n }}\n {...rest}\n />","<div\n data-slot=\"top-bar-title\"\n class={cn(\n /* The title slot sits in the drag region; a link, button or field\n placed in it (a breadcrumb, a view's search) must stay pressable. */\n 'truncate text-sm font-medium [&_:is(a,button,input)]:window-no-drag',\n local.align === 'center' && 'text-center',\n local.class\n )}\n {...rest}\n />","<div\n data-slot=\"top-bar-breadcrumb\"\n class={cn(\n 'flex min-w-0 items-center gap-1.5 text-sm [&_:is(a,button,input)]:window-no-drag',\n local.class\n )}\n {...rest}\n />","type=\"button\"","<Search aria-hidden=\"true\" class=\"size-4 shrink-0 sm:hidden\" />","class=\"size-4 shrink-0 sm:hidden\"","<button\n type=\"button\"\n data-slot=\"top-bar-search\"\n class={cn(\n 'text-muted-foreground flex h-control-md w-full min-w-(--control-height-md) items-center justify-center gap-2 rounded-md border border-input px-3 text-sm sm:justify-start',\n 'transition-colors ease-out outline-none',\n 'hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'window-no-drag',\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Search aria-hidden=\"true\" class=\"size-4 shrink-0 sm:hidden\" />\n <span class=\"sr-only sm:not-sr-only sm:truncate\">{local.placeholder ?? 'Search'}</span>\n <Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />\n )}\n </Show>\n </button>","<Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />\n )}\n </Show>","<KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />","class=\"ms-auto hidden shrink-0 sm:inline-flex\"","<button\n type=\"button\"\n data-slot=\"top-bar-pill\"\n class={cn(\n 'text-muted-foreground inline-flex h-control-sm shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:border-input hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'window-no-drag [&_svg]:size-3.5 [&_svg]:shrink-0',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <span>{local.label}</span>\n </button>","LucideSearch","_$spread","_$insert"],"sources":["../../../../src/components/layout/top-bar/top-bar.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { Show, omit } from 'solid-js'\nimport { Search as LucideSearch } from '@lucide/solid'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { KbdChord } from '../../ui/kbd'\nimport { windowChromeClass, type WindowChromeProps } from './window-chrome'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Search = fastIcon(LucideSearch)\n\n/**\n * TopBar.\n *\n * The window's title row and primary toolbar. Three tracks: a leading group, a\n * centred search, and a trailing group. On wide screens the search is a fixed\n * function of the window width and the side groups are equal remainders. On\n * narrow screens the middle track yields space to the controls, and each side\n * group scrolls when necessary so keyboard focus can reveal every action.\n *\n * The centre track is sized for a lone search field. A bar whose centre holds\n * more than that, such as a search plus an action beside it, passes\n * `centerWidth=\"wide\"`: the centre then stays fluid below 1280px, with each\n * side group sized to its content but capped between 30% and 40% of the row\n * (a longer group scrolls instead): the cap is 30% on the narrowest rows and\n * grows to 40% as the row widens, so full side groups never squeeze the\n * centre's search out of it and enlarged text never pushes a short leading\n * control such as a navigation toggle out of the row. Above 1280px it takes a\n * wider fixed track.\n *\n * A wide bar also never squeezes its centre to nothing. When the row is\n * narrower than 19rem (measured in rem, so enlarged text reaches it at a wider\n * window) the centre moves to a second row of its own and the two side groups\n * share the first, the trailing group taking the remainder beside the leading\n * group's cap, so the leading and trailing controls and the whole centre each\n * keep a full row instead of fighting for one. The bar grows from one row\n * to two only then. The wide layout places the leading group, centre and\n * trailing group as its first, second and third children.\n *\n * On a frameless desktop window this row is also the drag region, so it carries\n * `window-drag` and the controls inside it opt back out. `macos-inset` and\n * `windows-inset` reserve the space the native window controls occupy, which is\n * why the row can look off-centre in a frameless window and be correct: it is\n * centred in the space the user can actually see.\n */\nexport type TopBarProps = Omit<ComponentProps<'header'>, 'draggable'> &\n WindowChromeProps & {\n /**\n * How wide the centre track is. `field` (default) suits a lone search field.\n * `wide` suits a centre that also holds an action: fluid below 1280px between\n * side groups sized to their content and capped between 30% and 40% of the\n * row (a longer group scrolls), then a clamp of 32vw up to 672px between equal\n * side tracks.\n * Below a 19rem row the centre drops to a second row of its own.\n */\n centerWidth?: 'field' | 'wide'\n }\n\nexport function TopBar(props: TopBarProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'draggable',\n 'macosInset',\n 'windowsInset',\n 'glass',\n 'centerWidth'\n )\n\n return (\n <header\n data-slot=\"top-bar\"\n class={cn(\n 'h-topbar relative z-(--z-sticky) grid shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 border-b border-border bg-card text-card-foreground md:grid-cols-[minmax(0,1fr)_clamp(240px,22vw,480px)_minmax(0,1fr)]',\n /* The bar is its own container so its children can move to a second\n row by the row's width in rem, which enlarged text shrinks. The\n first row keeps the bar's height (less the 1px bottom border); the\n second only exists when the centre has dropped onto it. */\n local.centerWidth === 'wide' &&\n '@container/top-bar h-auto grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] grid-rows-[minmax(calc(var(--topbar-height)-1px),auto)] gap-x-2 gap-y-0 md:grid-cols-[fit-content(max(30%,min(40%,calc(50%-3.75rem))))_minmax(0,1fr)_fit-content(max(30%,min(40%,calc(50%-3.75rem))))] xl:grid-cols-[minmax(0,1fr)_clamp(240px,32vw,672px)_minmax(0,1fr)] [&>:nth-child(2)]:@max-[19rem]/top-bar:col-span-full [&>:nth-child(2)]:@max-[19rem]/top-bar:row-start-2 [&>:nth-child(2)]:@max-[19rem]/top-bar:pb-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-span-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:col-start-2 [&>:nth-child(3)]:@max-[19rem]/top-bar:row-start-1',\n windowChromeClass(local),\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A scrollable side group; equal wide-screen tracks centre the search. */\nexport function TopBarSection(props: ComponentProps<'div'> & { align?: 'start' | 'end' }) {\n const local = props\n const rest = omit(props, 'class', 'align', 'onFocusIn')\n\n return (\n <div\n data-slot=\"top-bar-section\"\n class={cn(\n 'window-no-drag flex min-w-0 items-center gap-2 overflow-x-auto overflow-y-hidden',\n local.align === 'end' && 'md:justify-end-safe',\n local.align !== 'end' && 'justify-start',\n local.class\n )}\n onFocusIn={(event) => {\n if (event.target instanceof HTMLElement) {\n event.target.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }\n callHandler(local.onFocusIn, event)\n }}\n {...rest}\n />\n )\n}\n\nexport function TopBarTitle(\n props: ComponentProps<'div'> & {\n /** Aligns text within this slot; it does not position the slot. */\n align?: 'start' | 'center'\n }\n) {\n const local = props\n const rest = omit(props, 'class', 'align')\n return (\n <div\n data-slot=\"top-bar-title\"\n class={cn(\n /* The title slot sits in the drag region; a link, button or field\n placed in it (a breadcrumb, a view's search) must stay pressable. */\n 'truncate text-sm font-medium [&_:is(a,button,input)]:window-no-drag',\n local.align === 'center' && 'text-center',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A breadcrumb or path readout that yields to the actions when space runs out. */\nexport function TopBarBreadcrumb(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"top-bar-breadcrumb\"\n class={cn(\n 'flex min-w-0 items-center gap-1.5 text-sm [&_:is(a,button,input)]:window-no-drag',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type TopBarSearchProps = ComponentProps<'button'> & {\n /** The hint shown inside the field, e.g. \"Search projects and files\". */\n placeholder?: string\n /** The shortcut chip drawn at the trailing edge, e.g. \"⌘K\". */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+K`. The chip is\n * `aria-hidden` — reading it out would pollute the button's accessible\n * name — so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n}\n\n/**\n * The search affordance in the middle track.\n *\n * It is a button, not an input, and that is deliberate: clicking it opens the\n * command palette, which already owns the input, the ranking and the keyboard\n * handling. A second live input here would be a second source of truth for the\n * same query. It is styled to read as a field because that is what it behaves\n * like from the user's side.\n */\nexport function TopBarSearch(props: TopBarSearchProps) {\n const local = props\n const rest = omit(props, 'class', 'placeholder', 'shortcut', 'keyshortcuts')\n\n return (\n <button\n type=\"button\"\n data-slot=\"top-bar-search\"\n class={cn(\n 'text-muted-foreground flex h-control-md w-full min-w-(--control-height-md) items-center justify-center gap-2 rounded-md border border-input px-3 text-sm sm:justify-start',\n 'transition-colors ease-out outline-none',\n 'hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'window-no-drag',\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Search aria-hidden=\"true\" class=\"size-4 shrink-0 sm:hidden\" />\n <span class=\"sr-only sm:not-sr-only sm:truncate\">{local.placeholder ?? 'Search'}</span>\n <Show when={local.shortcut}>\n {(shortcut) => (\n <KbdChord keys={shortcut()} class=\"ms-auto hidden shrink-0 sm:inline-flex\" />\n )}\n </Show>\n </button>\n )\n}\n\n/**\n * A labelled top-bar control — the readouts KiroCrew puts in the trailing\n * group. Container queries on the group decide which of these survive a narrow\n * window; a caller marks the cheap-to-drop ones and the group handles the rest.\n */\nexport function TopBarPill(props: ComponentProps<'button'> & { label: string }) {\n const local = props\n const rest = omit(props, 'class', 'label', 'children')\n\n return (\n <button\n type=\"button\"\n data-slot=\"top-bar-pill\"\n class={cn(\n 'text-muted-foreground inline-flex h-control-sm shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:border-input hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'window-no-drag [&_svg]:size-3.5 [&_svg]:shrink-0',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <span>{local.label}</span>\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAM,SAAS,SAASa,QAAY;AAiDpC,SAAgB,OAAO,OAAoB;CACzC,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,aACA,cACA,gBACA,SACA,aACF;CAGE,IAAA,OAAA,OAcC;CADCC,OAAA,MAAA,CAAA;EAZA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,yOAKA,MAAM,gBAAgB,UACpB,+sBACF,kBAAkB,KAAK,GACvB,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,KAAA;CAdR,OACEd;AAgBJ;;AAGA,SAAgB,cAAc,OAA4D;CACxF,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,WAAW;CAGpD,IAAA,QAAA,QAeC;CADCc,OAAA,OAAA,CAAA;EAbA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,oFACA,MAAM,UAAU,SAAS,uBACzB,MAAM,UAAU,SAAS,iBACzB,MAAM,KACR;EAAC;EACDb,YAAY,UAAU;GACpB,IAAI,MAAM,kBAAkB,aAC1B,MAAM,OAAO,eAAe;IAAE,OAAO;IAAW,QAAQ;GAAU,CAAC;GAErE,YAAY,MAAM,WAAW,KAAK;EACpC;CACQ,GAAJ,IAAA,GAAA,KAAA;CAfR,OACEC;AAiBJ;AAEA,SAAgB,YACd,OAIA;CACA,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,OAAO;CAEvC,IAAA,QAAA,QAUC;CADCY,OAAA,OAAA,CAAA;EARA,aAAA;EACA,IAAA,UAAA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AAS,UAAU;CAGnD,IAAA,QAAA,QAeQ;CADN,IAAA,QAAA,MAAA;CAHAM,OAAA,OAAA,CAAA;EAVAT,MAAAA;EACA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,2IACA,2CACA,4CACA,yDACA,oDACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAXNU,OAAA,aAaE;EAAC,OAAA,MAAM;CAAQ,GAbjBH,KAeQ;CADNG,OAAA,aAAM;EAAC,OAAA,MAAM;CAAK,CAAO;CAf7B,OACEH;AAiBJ"}
|
|
@@ -31,7 +31,7 @@ function AccordionTrigger(props) {
|
|
|
31
31
|
class: "flex",
|
|
32
32
|
get children() {
|
|
33
33
|
return createComponent(AccordionTrigger$1, mergeProps({ get "class"() {
|
|
34
|
-
return cn("group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium", "transition-colors ease-out outline-none", "hover:text-foreground", "focus-visible:border-ring focus-visible:
|
|
34
|
+
return cn("group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium", "transition-colors ease-out outline-none", "hover:text-foreground", "focus-visible:border-ring focus-visible:focus-outline", "disabled:pointer-events-none disabled:opacity-50", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", props.class);
|
|
35
35
|
} }, rest, { get children() {
|
|
36
36
|
return [memo(() => {
|
|
37
37
|
return props.children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":["<SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />","onValueChange={(value) => props.onChange?.(value)}","<SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />","<SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:text-foreground',\n 'focus-visible:border-ring focus-visible:
|
|
1
|
+
{"version":3,"file":"accordion.js","names":["<SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />","onValueChange={(value) => props.onChange?.(value)}","<SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />","<SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>\n </SdkAccordionHeader>","class=\"flex\"","<SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>","props.children","<ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />","class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"","<SdkAccordionPanel\n class={cn('overflow-hidden text-sm', props.class as string)}\n keepMounted={props.forceMount}\n {...rest}\n >\n <div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>\n </SdkAccordionPanel>","<div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>","LucideChevronDown","_$insert"],"sources":["../../../../src/components/ui/accordion/accordion.tsx"],"sourcesContent":["import {\n Accordion as SdkAccordion,\n AccordionHeader as SdkAccordionHeader,\n AccordionItem as SdkAccordionItem,\n AccordionPanel as SdkAccordionPanel,\n AccordionTrigger as SdkAccordionTrigger,\n} from '@ui-sdk/solid/accordion'\nimport { ChevronDown as LucideChevronDown } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\n\n/**\n * Accordion.\n *\n * A list of collapsible sections. `collapsible` lets the user close the open\n * section; without it (the default) one section stays open once any is, which\n * is what a settings page usually wants and a FAQ usually does not.\n *\n * Built on ui-sdk's Accordion: the trigger is a real button inside an `h3`\n * with `aria-expanded`, and the panel is `aria-labelledby` the trigger, so the\n * relationship survives even when the panel is empty. A disabled trigger stays\n * focusable and says so with `aria-disabled`.\n */\nexport type AccordionProps = Omit<\n ComponentProps<typeof SdkAccordion>,\n 'onValueChange' | 'onChange' | 'value' | 'defaultValue'\n> & {\n /** The open items' values. Pass it to control the accordion. */\n value?: string[]\n /** The items open at first, when uncontrolled. */\n defaultValue?: string[]\n /** Called with the open items' values. */\n onChange?: (value: string[]) => void\n}\n\nexport function Accordion(props: AccordionProps) {\n const rest = omit(props, 'class', 'onChange', 'collapsible')\n return (\n <SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />\n )\n}\n\nexport function AccordionItem(props: ComponentProps<typeof SdkAccordionItem>) {\n const rest = omit(props, 'class')\n return (\n <SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />\n )\n}\n\nexport function AccordionTrigger(props: ComponentProps<typeof SdkAccordionTrigger>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:text-foreground',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>\n </SdkAccordionHeader>\n )\n}\n\nexport type AccordionContentProps = ComponentProps<typeof SdkAccordionPanel> & {\n /** Keeps the panel in the page, hidden, while its item is closed. */\n forceMount?: boolean\n}\n\nexport function AccordionContent(props: AccordionContentProps) {\n const rest = omit(props, 'class', 'children', 'forceMount')\n return (\n <SdkAccordionPanel\n class={cn('overflow-hidden text-sm', props.class as string)}\n keepMounted={props.forceMount}\n {...rest}\n >\n <div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>\n </SdkAccordionPanel>\n )\n}\n"],"mappings":";;;;;;;;AAcA,IAAM,cAAc,SAASW,aAAiB;AA0B9C,SAAgB,UAAU,OAAuB;CAC/C,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY,aAAa;CAC3D,OACEX,gBAAAA,aAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,wBAAwB,MAAM,KAAe;EAAC;EACxD,IAAA,cAAA;GAAa,OAAA,MAAM,eAAe;EAAK;EACvCC,gBAAgB,UAAU,MAAM,WAAW,KAAK;CAEjD,GADK,IACL,CAAA;AAEL;AAEA,SAAgB,cAAc,OAAgD;CAC5E,MAAM,OAAO,KAAK,OAAO,OAAO;CAChC,OACEC,gBAAAA,iBAAAA,WAAAA,EACE,IAAA,UAAA;EAAO,OAAA,GAAG,0CAA0C,MAAM,KAAe;CAAC,EAE3E,GADK,IACL,CAAA;AAEL;AAEA,SAAgB,iBAAiB,OAAmD;CAClF,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE5C,OACEC,gBAAAA,iBAAAA;EAAoBC,OAAM;EAA1B,IAAA,WAAA;GACEC,OAAAA,gBAAAA,oBAAAA,WAAAA,EACE,IAAA,UAAA;IAAO,OAAA,GAKL,qGACA,2CACA,yBACA,yDACA,oDACA,kEACA,MAAM,KACR;GAAC,EAQkB,GAPf,MAdN,EAAA,IAAA,WAAA;IAeC,OAAA,CACEC,WAAAA;KAAM,OAAA,MAAA;IAAO,CAAA,GACdC,gBAAAA,aAAAA;KACEC,OAAM;KACN,eAAY;IACb,CAAA,CAJF;GAKoB,EAAA,CAAA,CAAA;EACH;;AAExB;AAOA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY,YAAY;CAC1D,OACEC,gBAAAA,gBAAAA,WAAAA;EACE,IAAA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