@vielzeug/refine 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/content/stepper/step.css.cjs +1 -1
  2. package/dist/content/stepper/step.css.cjs.map +1 -1
  3. package/dist/content/stepper/step.css.js +1 -1
  4. package/dist/content/stepper/step.css.js.map +1 -1
  5. package/dist/inputs/checkbox/checkbox.css.cjs +1 -1
  6. package/dist/inputs/checkbox/checkbox.css.cjs.map +1 -1
  7. package/dist/inputs/checkbox/checkbox.css.js +1 -1
  8. package/dist/inputs/checkbox/checkbox.css.js.map +1 -1
  9. package/dist/inputs/message-composer/message-composer.css.cjs +1 -1
  10. package/dist/inputs/message-composer/message-composer.css.cjs.map +1 -1
  11. package/dist/inputs/message-composer/message-composer.css.js +1 -1
  12. package/dist/inputs/message-composer/message-composer.css.js.map +1 -1
  13. package/dist/inputs/radio/radio.css.cjs +1 -1
  14. package/dist/inputs/radio/radio.css.cjs.map +1 -1
  15. package/dist/inputs/radio/radio.css.js +1 -1
  16. package/dist/inputs/radio/radio.css.js.map +1 -1
  17. package/dist/inputs/switch/switch.css.cjs +1 -1
  18. package/dist/inputs/switch/switch.css.cjs.map +1 -1
  19. package/dist/inputs/switch/switch.css.js +1 -1
  20. package/dist/inputs/switch/switch.css.js.map +1 -1
  21. package/dist/inputs/switch/switch.d.ts.map +1 -1
  22. package/dist/layout/navbar/navbar.css.cjs +1 -1
  23. package/dist/layout/navbar/navbar.css.cjs.map +1 -1
  24. package/dist/layout/navbar/navbar.css.js +1 -1
  25. package/dist/layout/navbar/navbar.css.js.map +1 -1
  26. package/dist/layout/sidebar/sidebar.d.ts +1 -0
  27. package/dist/layout/sidebar/sidebar.d.ts.map +1 -1
  28. package/dist/overlay/menu/menu.css.cjs +1 -1
  29. package/dist/overlay/menu/menu.css.cjs.map +1 -1
  30. package/dist/overlay/menu/menu.css.js +1 -1
  31. package/dist/overlay/menu/menu.css.js.map +1 -1
  32. package/dist/overlay/shared/use-floating-trigger.cjs +1 -1
  33. package/dist/overlay/shared/use-floating-trigger.cjs.map +1 -1
  34. package/dist/overlay/shared/use-floating-trigger.d.ts +3 -3
  35. package/dist/overlay/shared/use-floating-trigger.d.ts.map +1 -1
  36. package/dist/overlay/shared/use-floating-trigger.js +16 -4
  37. package/dist/overlay/shared/use-floating-trigger.js.map +1 -1
  38. package/dist/refine.cjs +61 -28
  39. package/dist/refine.cjs.map +1 -1
  40. package/dist/refine.iife.js +61 -28
  41. package/dist/refine.iife.js.map +1 -1
  42. package/dist/refine.js +61 -28
  43. package/dist/refine.js.map +1 -1
  44. package/dist/sidebar.cjs +10 -2
  45. package/dist/sidebar.cjs.map +1 -1
  46. package/dist/sidebar.js +10 -1
  47. package/dist/sidebar.js.map +1 -1
  48. package/dist/switch.cjs +28 -3
  49. package/dist/switch.cjs.map +1 -1
  50. package/dist/switch.js +54 -30
  51. package/dist/switch.js.map +1 -1
  52. package/package.json +2 -2
package/dist/sidebar.cjs CHANGED
@@ -6,7 +6,12 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
6
6
  aria-label="${e[`mobile-close-label`]}"
7
7
  ?hidden=${()=>!_.value||!v.value}
8
8
  @click=${()=>P(!1,`toggle`)}></button>
9
- <nav aria-label="${e.label}" part="nav" tabindex="-1">
9
+ <nav
10
+ aria-label="${e.label}"
11
+ aria-hidden=${()=>_.value&&!v.value?`true`:null}
12
+ part="nav"
13
+ tabindex="-1"
14
+ ?inert=${()=>_.value&&!v.value}>
10
15
  <div class="sidebar-header" part="header" ?hidden=${()=>!i()&&!e.collapsible.value}>
11
16
  <span class="sidebar-logo" ?hidden=${()=>!m()}>
12
17
  <slot name="logo"></slot>
@@ -84,7 +89,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
84
89
  <slot></slot>
85
90
  </div>
86
91
  </details>
87
- `},styles:[e.reducedMotionMixin,r.default]});var h=`ore-sidebar-item`;(0,a.define)(h,{props:{active:a.prop.bool(!1),"bottom-nav":a.prop.bool(!1),"bottom-nav-label":a.prop.string(),disabled:a.prop.bool(!1),href:a.prop.string(),rel:a.prop.string(),target:a.prop.string()},setup(e){let n=(0,a.useSlots)(),r=()=>n.has(`icon`).value,i=()=>n.has(`end`).value,s=(0,a.inject)(f);(0,a.bind)({attr:{"sidebar-bottom-nav":()=>s?.mode.value===`bottom-nav`&&!s?.mobileOpen.value||void 0,"sidebar-collapsed":()=>s?.collapsed.value?!0:void 0}});let c=()=>!!e.href.value&&!e.disabled.value,l=(0,o.computed)(()=>t.computeSafeRel(e.rel.value,e.target.value)),u=e=>{s?.closeOnSelect.value&&s.mobileOpen.value&&(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||queueMicrotask(s.closeMobile))},d=()=>a.html`
92
+ `},styles:[e.reducedMotionMixin,r.default]});var h=`ore-sidebar-item`;(0,a.define)(h,{props:{active:a.prop.bool(!1),"bottom-nav":a.prop.bool(!1),"bottom-nav-label":a.prop.string(),disabled:a.prop.bool(!1),href:a.prop.string(),label:a.prop.string(),rel:a.prop.string(),target:a.prop.string()},setup(e){let n=(0,a.useSlots)(),r=()=>n.has(`icon`).value,i=()=>n.has(`end`).value,s=(0,a.inject)(f);(0,a.bind)({attr:{"sidebar-bottom-nav":()=>s?.mode.value===`bottom-nav`&&!s?.mobileOpen.value||void 0,"sidebar-collapsed":()=>s?.collapsed.value?!0:void 0}});let c=()=>!!e.href.value&&!e.disabled.value,l=(0,o.computed)(()=>t.computeSafeRel(e.rel.value,e.target.value)),u=e=>{s?.closeOnSelect.value&&s.mobileOpen.value&&(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||queueMicrotask(s.closeMobile))},d=()=>a.html`
88
93
  <span class="item-icon" part="item-icon" ?hidden=${()=>!r()} aria-hidden="true">
89
94
  <slot name="icon"></slot>
90
95
  </span>
@@ -100,6 +105,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
100
105
  href="${e.href}"
101
106
  rel="${l}"
102
107
  target="${e.target}"
108
+ aria-label="${e.label}"
103
109
  aria-current="${()=>e.active.value?`page`:null}"
104
110
  @click=${u}>
105
111
  ${d()}
@@ -110,6 +116,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
110
116
  part="item"
111
117
  aria-disabled="true"
112
118
  tabindex="-1"
119
+ aria-label="${e.label}"
113
120
  aria-current="${()=>e.active.value?`page`:null}">
114
121
  ${d()}
115
122
  </div>
@@ -119,6 +126,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
119
126
  part="item"
120
127
  type="button"
121
128
  ?disabled="${e.disabled}"
129
+ aria-label="${e.label}"
122
130
  aria-current="${()=>e.active.value?`page`:null}"
123
131
  @click=${u}>
124
132
  ${d()}
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.cjs","names":[],"sources":["../src/layout/sidebar/sidebar.ts"],"sourcesContent":["import {\n bind,\n createContext,\n define,\n getHost,\n html,\n inject,\n onCleanup,\n onMounted,\n prop,\n provide,\n useEmit,\n useSlots,\n} from '@vielzeug/ore';\nimport { computed, fromSubscribable, type Readable, signal, watch } from '@vielzeug/ripple';\nimport { createElementSize, createMediaQuery, SentinelUnavailableError } from '@vielzeug/sentinel';\n\nimport '../../content/icon/icon';\nimport { coarsePointerMixin, reducedMotionMixin } from '../../styles';\nimport { computeSafeRel } from '../../utils';\nimport sidebarStyles from './sidebar.css?inline';\nimport groupStyles from './sidebar-group.css?inline';\nimport itemStyles from './sidebar-item.css?inline';\n\n// ─── Types ────────────────────────────────────────────────────────────────\n\ntype SidebarVariant = 'floating' | 'inset';\ntype SidebarCollapseSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMobileSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMode = 'bottom-nav' | 'collapsed' | 'default';\n\ntype BottomNavItem = {\n active: boolean;\n disabled: boolean;\n href?: string;\n iconName?: string;\n label: string;\n source: HTMLElement;\n};\n\nconst parseMaxWidthPx = (query: string | undefined): number | undefined => {\n const value = String(query ?? '').trim();\n\n if (!value) return undefined;\n\n const match = /max-width\\s*:\\s*([0-9]+(?:\\.[0-9]+)?)px/i.exec(value);\n\n if (!match) return undefined;\n\n const parsed = Number.parseFloat(match[1]);\n\n return Number.isFinite(parsed) ? parsed : undefined;\n};\n\nconst resolveContainerElement = (el: HTMLElement): HTMLElement | null => {\n let container = el.parentElement;\n\n while (container?.tagName.toLowerCase() === 'ore-grid-item') {\n container = container.parentElement;\n }\n\n return container;\n};\n\nconst readContainerWidth = (el: HTMLElement): number => {\n const parentWidth = resolveContainerElement(el)?.clientWidth ?? 0;\n\n if (parentWidth > 0) return parentWidth;\n\n return el.offsetWidth;\n};\n\nconst deepActiveElement = (): HTMLElement | null => {\n let active = document.activeElement as HTMLElement | null;\n\n while (active?.shadowRoot?.activeElement instanceof HTMLElement) {\n active = active.shadowRoot.activeElement;\n }\n\n return active;\n};\n\n/** Context provided by `ore-sidebar` to its `ore-sidebar-group` and `ore-sidebar-item` children. */\nexport type SidebarContext = {\n closeMobile: () => void;\n closeOnSelect: Readable<boolean>;\n collapsed: Readable<boolean>;\n mobileOpen: Readable<boolean>;\n mode: Readable<SidebarMode>;\n variant: Readable<SidebarVariant | undefined>;\n};\n\n/** Injection key for the sidebar context. */\nexport const SIDEBAR_CTX = createContext<SidebarContext>('SidebarContext');\n\n// ─── ore-sidebar styles ──────────────────────────────────────────────────────\n\n/** ore-sidebar element interface */\nexport type SidebarElement = HTMLElement &\n OreSidebarProps & {\n /** Close the drawer in bottom-nav mode. */\n closeMobile(): void;\n /** Open the drawer in bottom-nav mode. */\n openMobile(): void;\n /** Set collapsed state imperatively. */\n setCollapsed(next: boolean): void;\n /** Toggle between collapsed and expanded. */\n toggle(): void;\n /** Toggle the drawer in bottom-nav mode. */\n toggleMobile(): void;\n };\n\n/** Sidebar component properties */\n\nexport type OreSidebarEvents = {\n 'collapsed-change': { collapsed: boolean; source: SidebarCollapseSource };\n 'mobile-open-change': { open: boolean; source: SidebarMobileSource };\n};\n\nexport type OreSidebarGroupEvents = {\n 'open-change': { open: boolean };\n};\n\nexport type OreSidebarProps = {\n /** CSS media query that switches the sidebar to bottom navigation mode */\n 'bottom-nav-at'?: string;\n 'close-on-select'?: boolean;\n /** Controlled collapsed state */\n collapsed?: boolean;\n /** Whether the sidebar supports collapsing */\n collapsible?: boolean;\n 'collapse-label'?: string;\n /** Evaluate responsive and bottom-nav breakpoints against container width only. */\n 'container-breakpoints'?: boolean;\n /** Initial collapsed state in uncontrolled mode */\n 'default-collapsed'?: boolean;\n 'expand-label'?: string;\n /**\n * Accessible label for the navigation landmark.\n * Use to distinguish multiple navigation regions on a page.\n * @default 'Sidebar navigation'\n */\n label?: string;\n 'mobile-close-label'?: string;\n /**\n * CSS media query that, when it matches, automatically collapses the sidebar.\n * Unset by default — no automatic collapse.\n * @example 'responsive=\"(max-width: 768px)\"'\n */\n responsive?: string;\n /** Visual style variant */\n variant?: SidebarVariant;\n};\n\n/**\n * `ore-sidebar` — A collapsible navigation sidebar with group and item support.\n *\n * @element ore-sidebar\n * @element ore-sidebar-group - Labelled group of navigation items\n * @element ore-sidebar-item - Individual navigation link or button\n *\n * @attr {boolean} collapsed - Controlled collapsed state\n * @attr {boolean} default-collapsed - Initial collapsed state for uncontrolled sidebars\n * @attr {boolean} collapsible - Show the collapse toggle button\n * @attr {string} variant - Visual variant: 'floating' | 'inset'\n * @attr {string} label - Accessible aria-label for the nav landmark\n *\n * @fires collapsed-change - Fired when collapsed state changes. detail: { collapsed: boolean; source: string }\n * @fires mobile-open-change - Fired when mobile overlay open state changes. detail: { open: boolean; source: string }\n *\n * @slot header - Branding or logo content above the nav\n * @slot - Navigation content (ore-sidebar-group / ore-sidebar-item)\n * @slot footer - Footer content below the nav (user info, settings, etc.)\n *\n * @cssprop --sidebar-width - Expanded sidebar width (default: 16rem)\n * @cssprop --sidebar-collapsed-width - Collapsed sidebar width (default: 3.5rem)\n * @cssprop --sidebar-bg - Sidebar background color\n * @cssprop --sidebar-border-color - Border color\n *\n * @part mobile-backdrop - Backdrop shown for mobile overlays.\n * @part nav - Navigation container.\n * @part header - Header container.\n * @part toggle-btn - Shadow part for the `toggle-btn` element.\n * @part content - Content container.\n * @part footer - Footer container.\n * @part bottom-bar - Bottom bar container.\n * @part group - Group container.\n * @part group-header - Group header container.\n * @part group-icon - Group icon container.\n * @part group-label - Group label container.\n * @part group-items - Group items container.\n * @part item-icon - Leading item icon container.\n * @part item-label - Item label container.\n * @part item-end - Trailing item content container.\n * @part item - Item root element.\n * @example\n * ```html\n * <ore-sidebar collapsible label=\"App navigation\">\n * <span slot=\"header\">My App</span>\n * <ore-sidebar-group label=\"Main\">\n * <ore-sidebar-item href=\"/dashboard\" active>Dashboard</ore-sidebar-item>\n * <ore-sidebar-item href=\"/settings\">Settings</ore-sidebar-item>\n * </ore-sidebar-group>\n * </ore-sidebar>\n *\n * <!-- Auto-collapse on mobile -->\n * <ore-sidebar collapsible responsive=\"(max-width: 768px)\">...</ore-sidebar>\n * ```\n */\nexport const SIDEBAR_TAG = 'ore-sidebar' as const;\ndefine<OreSidebarProps>(SIDEBAR_TAG, {\n props: {\n 'bottom-nav-at': prop.string(),\n 'close-on-select': prop.bool(false),\n 'collapse-label': prop.string('Collapse sidebar'),\n collapsed: prop.bool(false),\n collapsible: prop.bool(false),\n 'container-breakpoints': prop.bool(false),\n 'default-collapsed': prop.bool(false),\n 'expand-label': prop.string('Expand sidebar'),\n label: prop.string('Sidebar navigation'),\n 'mobile-close-label': prop.string('Close sidebar'),\n responsive: prop.string(),\n variant: prop.string<SidebarVariant>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreSidebarEvents>();\n const slots = useSlots();\n\n const hasHeader = () => slots.has('header').value;\n const hasFooter = () => slots.has('footer').value;\n const hasLogo = () => slots.has('logo').value;\n\n const isControlled = signal(el.hasAttribute('collapsed'));\n const collapsedState = signal(isControlled.value ? el.hasAttribute('collapsed') : props['default-collapsed'].value);\n const isBottomNav = signal(false);\n const isMobileOpen = signal(false);\n const bottomNavItems = signal<BottomNavItem[]>([]);\n const responsiveMediaMatches = signal(false);\n const responsiveSizeMatches = signal(false);\n const responsiveMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props.responsive.value));\n const hasResponsiveQuery = signal(Boolean(String(props.responsive.value ?? '').trim()));\n const bottomNavMediaMatches = signal(false);\n const bottomNavSizeMatches = signal(false);\n const bottomNavMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props['bottom-nav-at'].value));\n const isPreviewMode = signal(false);\n let focusReturnTarget: HTMLElement | null = null;\n\n const isCollapsed = () => collapsedState.value;\n const mode = computed<SidebarMode>(() => {\n if (isBottomNav.value) return 'bottom-nav';\n\n return collapsedState.value ? 'collapsed' : 'default';\n });\n\n const applyResponsiveState = () => {\n const useContainerBreakpoints = props['container-breakpoints'].value;\n const responsiveMatched = useContainerBreakpoints\n ? responsiveSizeMatches.value\n : responsiveMediaMatches.value || responsiveSizeMatches.value;\n const bottomMatched = useContainerBreakpoints\n ? bottomNavSizeMatches.value\n : bottomNavMediaMatches.value || bottomNavSizeMatches.value;\n\n // If the mobile drawer is currently open, stay in bottom-nav mode\n // regardless of the responsive match. This prevents the drawer from\n // disappearing mid-animation or if forced open via the API on desktop.\n if (!isMobileOpen.value) {\n isBottomNav.value = bottomMatched;\n }\n\n if (!bottomMatched && !isMobileOpen.value) {\n setMobileOpen(false, 'responsive');\n }\n\n if (hasResponsiveQuery.value) {\n setCollapsed(responsiveMatched, 'responsive');\n }\n };\n\n const readBottomNavItems = () => {\n const directItems = slots\n .elements()\n .value.filter(\n (item): item is HTMLElement =>\n item instanceof HTMLElement && item.tagName.toLowerCase() === 'ore-sidebar-item',\n );\n const promotedItems = [...el.querySelectorAll<HTMLElement>('ore-sidebar-item[bottom-nav]')];\n const sourceItems = promotedItems.length > 0 ? promotedItems : directItems;\n const next = sourceItems.map((item, index) => {\n const el = item;\n const iconSlotEl =\n (el.querySelector(':scope > [slot=\"icon\"]') as HTMLElement | null) ??\n (el.querySelector('[slot=\"icon\"]') as HTMLElement | null);\n const directIconName =\n iconSlotEl?.tagName.toLowerCase() === 'ore-icon' ? iconSlotEl.getAttribute('name') : null;\n const nestedIconName = iconSlotEl?.querySelector('ore-icon')?.getAttribute('name') ?? null;\n const rawLabel = (el.textContent ?? '').trim();\n\n return {\n active: el.hasAttribute('active'),\n disabled: el.hasAttribute('disabled'),\n href: el.getAttribute('href') ?? undefined,\n iconName: directIconName ?? nestedIconName ?? undefined,\n label: el.getAttribute('bottom-nav-label')?.trim() || rawLabel || `Item ${index + 1}`,\n source: el,\n } satisfies BottomNavItem;\n });\n\n bottomNavItems.value = next;\n };\n\n provide(SIDEBAR_CTX, {\n closeMobile: () => setMobileOpen(false, 'toggle'),\n closeOnSelect: props['close-on-select'],\n collapsed: computed(() => !isBottomNav.value && collapsedState.value) as Readable<boolean>,\n mobileOpen: computed(() => isBottomNav.value && isMobileOpen.value) as Readable<boolean>,\n mode: mode as Readable<SidebarMode>,\n variant: props.variant,\n });\n\n const setCollapsed = (next: boolean, source: SidebarCollapseSource) => {\n if (isCollapsed() === next) return;\n\n if (!isControlled.value) {\n collapsedState.value = next;\n }\n\n emit('collapsed-change', { collapsed: next, source });\n };\n\n const setMobileOpen = (next: boolean, source: SidebarMobileSource) => {\n const open = Boolean(next);\n\n if (open && !isBottomNav.value) {\n isBottomNav.value = true;\n }\n\n if (!isBottomNav.value && !open) {\n if (isMobileOpen.value) {\n isMobileOpen.value = false;\n }\n\n return;\n }\n\n if (isMobileOpen.value === open) return;\n\n if (open) focusReturnTarget = deepActiveElement();\n\n isMobileOpen.value = open;\n\n // If closing, re-evaluate responsive state to potentially exit forced bottom-nav mode\n if (!open) {\n applyResponsiveState();\n queueMicrotask(() => {\n if (focusReturnTarget?.isConnected) focusReturnTarget.focus();\n focusReturnTarget = null;\n });\n } else {\n queueMicrotask(() => el.shadowRoot?.querySelector<HTMLElement>('nav')?.focus());\n }\n\n emit('mobile-open-change', { open, source });\n };\n\n const doToggle = () => {\n setCollapsed(!isCollapsed(), 'toggle');\n };\n\n const sidebarEl = el as SidebarElement;\n\n sidebarEl.setCollapsed = (next) => setCollapsed(Boolean(next), 'api');\n sidebarEl.toggle = doToggle;\n sidebarEl.openMobile = () => setMobileOpen(true, 'api');\n sidebarEl.closeMobile = () => setMobileOpen(false, 'api');\n sidebarEl.toggleMobile = () => setMobileOpen(!isMobileOpen.value, 'toggle');\n\n bind({\n attr: {\n 'data-bottom-nav': () => (isBottomNav.value ? true : undefined),\n 'data-collapsed': () => (isCollapsed() && !isBottomNav.value ? true : undefined),\n 'data-has-logo': () => (hasLogo() ? true : undefined),\n 'data-mobile-open': () => (isBottomNav.value && isMobileOpen.value ? true : undefined),\n 'data-preview-mode': () => (isPreviewMode.value ? true : undefined),\n },\n });\n\n onMounted(() => {\n // Suppress transitions during initial layout so the sidebar doesn't\n // animate from a collapsed/0 state before the first ResizeObserver fires.\n el.setAttribute('data-no-transition', '');\n\n let transitionUnlocked = false;\n const unlockTransition = () => {\n if (transitionUnlocked) return;\n\n transitionUnlocked = true;\n el.removeAttribute('data-no-transition');\n };\n\n // Fallback: unlock after two frames in case ResizeObserver doesn't fire.\n requestAnimationFrame(() => requestAnimationFrame(unlockTransition));\n\n let mediaCleanup: (() => void) | undefined;\n let bottomNavCleanup: (() => void) | undefined;\n const itemObservers = new Map<HTMLElement, MutationObserver>();\n const observer = new MutationObserver(() => {\n if (!el.hasAttribute('collapsed') && !isControlled.value) return;\n\n isControlled.value = true;\n collapsedState.value = el.hasAttribute('collapsed');\n });\n\n observer.observe(el, {\n attributeFilter: ['collapsed'],\n attributes: true,\n });\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !isMobileOpen.value) return;\n\n event.preventDefault();\n setMobileOpen(false, 'toggle');\n };\n el.addEventListener('keydown', closeOnEscape);\n\n watch(\n props.responsive,\n (query) => {\n mediaCleanup?.();\n mediaCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n hasResponsiveQuery.value = Boolean(mediaQuery);\n responsiveMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n responsiveMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && responsiveMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n responsiveMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n mediaCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n watch(\n props['bottom-nav-at'],\n (query) => {\n bottomNavCleanup?.();\n bottomNavCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n bottomNavMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n bottomNavMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && bottomNavMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n bottomNavMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n bottomNavCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n const stopResizeEffect =\n typeof ResizeObserver === 'function'\n ? (() => {\n const hostSize = createElementSize(el);\n onCleanup(() => hostSize.dispose());\n const hostSizeSignal = fromSubscribable(hostSize, { signal: hostSize.disposalSignal });\n\n const wrapperEl = el.parentElement;\n const containerEl = resolveContainerElement(el);\n const wrapperSize = wrapperEl ? createElementSize(wrapperEl) : undefined;\n const parentSize = containerEl && containerEl !== wrapperEl ? createElementSize(containerEl) : undefined;\n\n if (wrapperSize) {\n onCleanup(() => wrapperSize.dispose());\n }\n if (parentSize) {\n onCleanup(() => parentSize.dispose());\n }\n\n const wrapperSizeSignal = wrapperSize\n ? fromSubscribable(wrapperSize, { signal: wrapperSize.disposalSignal })\n : undefined;\n const parentSizeSignal = parentSize\n ? fromSubscribable(parentSize, { signal: parentSize.disposalSignal })\n : undefined;\n\n let rafId: number | undefined;\n\n const onResize = () => {\n if (rafId !== undefined) cancelAnimationFrame(rafId);\n\n rafId = requestAnimationFrame(() => {\n const resolvedContainer = resolveContainerElement(el);\n const width = readContainerWidth(el);\n const responsiveWasMatched = responsiveSizeMatches.value;\n const bottomNavWasMatched = bottomNavSizeMatches.value;\n const parentWidth = resolvedContainer?.clientWidth ?? 0;\n\n isPreviewMode.value = parentWidth > 0 && parentWidth < window.innerWidth;\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n\n if (\n responsiveWasMatched !== responsiveSizeMatches.value ||\n bottomNavWasMatched !== bottomNavSizeMatches.value\n ) {\n applyResponsiveState();\n }\n\n unlockTransition();\n });\n };\n\n return watch(\n computed(() => [\n hostSizeSignal.value?.width,\n hostSizeSignal.value?.height,\n wrapperSizeSignal?.value?.width,\n wrapperSizeSignal?.value?.height,\n parentSizeSignal?.value?.width,\n parentSizeSignal?.value?.height,\n ]),\n onResize,\n );\n })()\n : undefined;\n\n const bindItemObservers = (items: HTMLElement[]) => {\n const set = new Set(items);\n\n for (const [item, cleanup] of itemObservers) {\n if (set.has(item)) continue;\n\n cleanup.disconnect();\n itemObservers.delete(item);\n }\n\n for (const item of items) {\n if (itemObservers.has(item)) continue;\n\n const itemObserver = new MutationObserver(() => {\n // Only update if in bottom-nav mode to minimize re-renders\n if (isBottomNav.value) {\n readBottomNavItems();\n }\n });\n\n // Watch attributes and content that affect bottom-nav rendering.\n itemObserver.observe(item, {\n attributeFilter: ['active', 'bottom-nav', 'bottom-nav-label', 'disabled', 'href'],\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n });\n itemObservers.set(item, itemObserver);\n }\n };\n\n const syncBottomNavItems = () => {\n bindItemObservers([...el.querySelectorAll<HTMLElement>('ore-sidebar-item')]);\n readBottomNavItems();\n };\n watch(slots.elements(), syncBottomNavItems, { immediate: true });\n const nestedItemsObserver = new MutationObserver(syncBottomNavItems);\n nestedItemsObserver.observe(el, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n nestedItemsObserver.disconnect();\n el.removeEventListener('keydown', closeOnEscape);\n mediaCleanup?.();\n bottomNavCleanup?.();\n stopResizeEffect?.dispose();\n\n for (const itemObserver of itemObservers.values()) {\n itemObserver.disconnect();\n }\n\n itemObservers.clear();\n };\n });\n\n return html`\n <button\n class=\"mobile-backdrop\"\n part=\"mobile-backdrop\"\n type=\"button\"\n aria-label=\"${props['mobile-close-label']}\"\n ?hidden=${() => !isBottomNav.value || !isMobileOpen.value}\n @click=${() => setMobileOpen(false, 'toggle')}></button>\n <nav aria-label=\"${props.label}\" part=\"nav\" tabindex=\"-1\">\n <div class=\"sidebar-header\" part=\"header\" ?hidden=${() => !hasHeader() && !props.collapsible.value}>\n <span class=\"sidebar-logo\" ?hidden=${() => !hasLogo()}>\n <slot name=\"logo\"></slot>\n </span>\n <span class=\"sidebar-header-content\">\n <slot name=\"header\"></slot>\n </span>\n <button\n class=\"toggle-btn\"\n part=\"toggle-btn\"\n type=\"button\"\n ?hidden=${() => !props.collapsible.value}\n aria-label=\"${() => (isCollapsed() ? props['expand-label'].value : props['collapse-label'].value)}\"\n aria-expanded=\"${() => !isCollapsed()}\"\n @click=\"${doToggle}\">\n <ore-icon\n class=\"toggle-icon\"\n name=${() => (isCollapsed() ? 'panel-left-open' : 'panel-left-close')}\n size=\"18\"\n stroke-width=\"2\"\n aria-hidden=\"true\"></ore-icon>\n </button>\n </div>\n <div class=\"sidebar-content\" part=\"content\">\n <slot></slot>\n </div>\n <div class=\"sidebar-footer\" part=\"footer\" ?hidden=${() => !hasFooter()}>\n <slot name=\"footer\"></slot>\n </div>\n </nav>\n\n <div class=\"bottom-bar\" part=\"bottom-bar\" ?hidden=${() => !isBottomNav.value}>\n ${() =>\n bottomNavItems.value.map((item) => {\n const className = `bottom-tab${item.active ? ' bottom-tab-active' : ''}`;\n\n if (item.href && !item.disabled) {\n return html`\n <a\n class=\"${className}\"\n href=\"${item.href}\"\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\">\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </a>\n `;\n }\n\n return html`\n <button\n class=\"${className}\"\n type=\"button\"\n ?disabled=${item.disabled}\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\"\n @click=${() => item.source.click()}>\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </button>\n `;\n })}\n </div>\n `;\n },\n styles: [coarsePointerMixin, reducedMotionMixin, sidebarStyles],\n});\n\n// ─── ore-sidebar-group styles ────────────────────────────────────────────────\n\n/** Sidebar group properties */\nexport type OreSidebarGroupProps = {\n /** Whether this group can be collapsed */\n collapsible?: boolean;\n /** Initial open state in uncontrolled mode */\n 'default-open'?: boolean;\n /** Accessible label for the group */\n label?: string;\n /** Controlled open state */\n open?: boolean;\n};\n\n/**\n * `ore-sidebar-group` — A labelled section within `ore-sidebar`.\n *\n * @element ore-sidebar-group\n *\n * @attr {string} label - Group label text\n * @attr {boolean} collapsible - Whether this group can be toggled open/closed\n * @attr {boolean} open - Controlled expanded state\n * @attr {boolean} default-open - Initial expanded state in uncontrolled mode\n *\n * @fires open-change - Fired when the group open state changes (collapsible groups only). detail: { open: boolean }\n *\n * @slot - Navigation items (`ore-sidebar-item`)\n * @slot icon - Icon displayed before the label\n *\n * @example\n * ```html\n * <ore-sidebar-group label=\"Main\" collapsible open>\n * <ore-sidebar-item href=\"/home\">Home</ore-sidebar-item>\n * </ore-sidebar-group>\n * ```\n */\nexport const SIDEBAR_GROUP_TAG = 'ore-sidebar-group' as const;\ndefine<OreSidebarGroupProps>(SIDEBAR_GROUP_TAG, {\n props: {\n collapsible: prop.bool(false),\n 'default-open': prop.bool(true),\n label: prop.string(),\n open: {\n default: undefined as boolean | undefined,\n parse: (value: string | null) => (value == null ? undefined : value === '' || value === 'true'),\n reflect: false,\n },\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isControlled = () => props.open.value !== undefined;\n const openState = signal(props['default-open'].value);\n const isOpen = computed(() => {\n if (!props.collapsible.value) return true;\n\n if (isControlled()) return props.open.value ?? false;\n\n return openState.value;\n });\n\n watch(props.open, (value) => {\n if (value === undefined) return;\n\n openState.value = value;\n });\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n },\n });\n\n return html`\n <details class=\"group\" part=\"group\" ?open=${isOpen}>\n <summary\n class=\"group-header\"\n part=\"group-header\"\n aria-expanded=\"${() => (props.collapsible.value ? String(props.open.value) : null)}\"\n @click=${(e: MouseEvent) => {\n if (!props.collapsible.value) {\n e.preventDefault();\n }\n }}>\n <span class=\"group-icon\" part=\"group-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"group-label\" part=\"group-label\">${props.label}</span>\n <span class=\"chevron\" ?hidden=${() => !props.collapsible.value} aria-hidden=\"true\">\n <ore-icon name=\"chevron-right\" size=\"12\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </summary>\n <div class=\"group-items\" part=\"group-items\" role=\"list\">\n <slot></slot>\n </div>\n </details>\n `;\n },\n styles: [reducedMotionMixin, groupStyles],\n});\n\n// ─── ore-sidebar-item styles ─────────────────────────────────────────────────\n\n/** Sidebar item properties */\nexport type OreSidebarItemProps = {\n /** Whether this item represents the current page/section */\n active?: boolean;\n 'bottom-nav'?: boolean;\n 'bottom-nav-label'?: string;\n /** Whether this item is disabled */\n disabled?: boolean;\n /** Navigation href — renders an `<a>` when set, otherwise a `<button>` */\n href?: string;\n /**\n * Relationship of the linked URL (`rel` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n rel?: string;\n /**\n * Browsing context for the link (`target` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n target?: string;\n};\n\n/**\n * `ore-sidebar-item` — An individual navigation item in a `ore-sidebar`.\n *\n * Renders as an `<a>` when `href` is provided, otherwise as a `<button>`.\n * Marks the active page via `aria-current=\"page\"` when the `active` attribute is set.\n *\n * @element ore-sidebar-item\n *\n * @attr {string} href - Link URL; renders an anchor when set\n * @attr {boolean} active - Marks the item as the current page\n * @attr {boolean} disabled - Disables the item\n * @attr {string} rel - Anchor `rel` attribute (links only)\n * @attr {string} target - Anchor `target` attribute (links only)\n *\n * @slot - Label text\n * @slot icon - Leading icon\n * @slot end - Trailing content (badge, shortcut, arrow, etc.)\n *\n * @cssprop --sidebar-item-color - Default text color\n * @cssprop --sidebar-item-hover-bg - Hover background\n * @cssprop --sidebar-item-hover-color - Hover text color\n * @cssprop --sidebar-item-active-bg - Active background\n * @cssprop --sidebar-item-active-color - Active text color\n * @cssprop --sidebar-item-indicator - Active indicator bar color\n *\n * @part item - The inner anchor or button element\n * @part item-icon - The icon wrapper\n * @part item-label - The label wrapper\n * @part item-end - The trailing content wrapper\n *\n * @example\n * ```html\n * <ore-sidebar-item href=\"/dashboard\" active>\n * <span slot=\"icon\">🏠</span>\n * Dashboard\n * </ore-sidebar-item>\n *\n * <ore-sidebar-item href=\"/users\">\n * <span slot=\"icon\">👤</span>\n * Users\n * <ore-badge slot=\"end\" color=\"primary\">3</ore-badge>\n * </ore-sidebar-item>\n * ```\n */\nexport const SIDEBAR_ITEM_TAG = 'ore-sidebar-item' as const;\ndefine<OreSidebarItemProps>(SIDEBAR_ITEM_TAG, {\n props: {\n active: prop.bool(false),\n 'bottom-nav': prop.bool(false),\n 'bottom-nav-label': prop.string(),\n disabled: prop.bool(false),\n href: prop.string(),\n rel: prop.string(),\n target: prop.string(),\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const hasEnd = () => slots.has('end').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isLink = () => !!props.href.value && !props.disabled.value;\n\n // Prevent reverse tabnapping: auto-inject noopener + noreferrer for _blank links.\n const effectiveRel = computed(() => computeSafeRel(props.rel.value, props.target.value));\n const closeMobileOnSelect = (event: MouseEvent) => {\n if (!sidebarCtx?.closeOnSelect.value || !sidebarCtx.mobileOpen.value) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\n queueMicrotask(sidebarCtx.closeMobile);\n };\n\n const renderItemContent = () => html`\n <span class=\"item-icon\" part=\"item-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"item-label\" part=\"item-label\"><slot></slot></span>\n <span class=\"item-end\" part=\"item-end\" ?hidden=${() => !hasEnd()}>\n <slot name=\"end\"></slot>\n </span>\n `;\n\n return html`\n ${() => {\n if (isLink()) {\n return html`\n <a\n class=\"item\"\n part=\"item\"\n href=\"${props.href}\"\n rel=\"${effectiveRel}\"\n target=\"${props.target}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </a>\n `;\n }\n\n if (props.disabled.value) {\n return html`\n <div\n class=\"item\"\n part=\"item\"\n aria-disabled=\"true\"\n tabindex=\"-1\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\">\n ${renderItemContent()}\n </div>\n `;\n }\n\n return html`\n <button\n class=\"item\"\n part=\"item\"\n type=\"button\"\n ?disabled=\"${props.disabled}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </button>\n `;\n }}\n `;\n },\n styles: [coarsePointerMixin, itemStyles],\n});\n"],"mappings":"4YAwCA,IAAM,EAAmB,GAAkD,CACzE,IAAM,EAAQ,OAAO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,GAAY,WAAW,OAAe,IAAA,GACpF,wBAA4B,GAAY,UAAU,MAAQ,GAAO,IAAA,EACnE,CACF,CAAC,EAED,IAAM,MAAe,CAAC,CAAC,EAAM,KAAK,OAAS,CAAC,EAAM,SAAS,MAGrD,GAAA,EAAe,EAAA,SAAA,KAAe,EAAA,eAAe,EAAM,IAAI,MAAO,EAAM,OAAO,KAAK,CAAC,EACjF,EAAuB,GAAsB,CAC5C,GAAY,cAAc,OAAU,EAAW,WAAW,QAC3D,EAAM,SAAW,GAAK,EAAM,SAAW,EAAM,SAAW,EAAM,UAAY,EAAM,QAEpF,eAAe,EAAW,WAAW,EACvC,EAEM,MAA0B,EAAA,IAAI;6DACuB,CAAC,EAAQ,EAAE;;;;2DAIb,CAAC,EAAO,EAAE;;;MAKnE,MAAO,GAAA,IAAI;YAEH,EAAO,EACF,EAAA,IAAI;;;;sBAIC,EAAM,KAAK;qBACZ,EAAa;wBACV,EAAM,OAAO;kCACA,EAAM,OAAO,MAAQ,OAAS,KAAM;uBAClD,EAAoB;gBAC3B,EAAkB,EAAE;;YAKxB,EAAM,SAAS,MACV,EAAA,IAAI;;;;;;kCAMgB,EAAM,OAAO,MAAQ,OAAS,KAAM;gBACzD,EAAkB,EAAE;;YAKrB,EAAA,IAAI;;;;;yBAKM,EAAM,SAAS;gCACL,EAAM,OAAO,MAAQ,OAAS,KAAM;qBAClD,EAAoB;cAC3B,EAAkB,EAAE;;UAG1B;KAEN,EACA,OAAQ,CAAC,EAAA,mBAAoB,EAAA,OAAU,CACzC,CAAC"}
1
+ {"version":3,"file":"sidebar.cjs","names":[],"sources":["../src/layout/sidebar/sidebar.ts"],"sourcesContent":["import {\n bind,\n createContext,\n define,\n getHost,\n html,\n inject,\n onCleanup,\n onMounted,\n prop,\n provide,\n useEmit,\n useSlots,\n} from '@vielzeug/ore';\nimport { computed, fromSubscribable, type Readable, signal, watch } from '@vielzeug/ripple';\nimport { createElementSize, createMediaQuery, SentinelUnavailableError } from '@vielzeug/sentinel';\n\nimport '../../content/icon/icon';\nimport { coarsePointerMixin, reducedMotionMixin } from '../../styles';\nimport { computeSafeRel } from '../../utils';\nimport sidebarStyles from './sidebar.css?inline';\nimport groupStyles from './sidebar-group.css?inline';\nimport itemStyles from './sidebar-item.css?inline';\n\n// ─── Types ────────────────────────────────────────────────────────────────\n\ntype SidebarVariant = 'floating' | 'inset';\ntype SidebarCollapseSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMobileSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMode = 'bottom-nav' | 'collapsed' | 'default';\n\ntype BottomNavItem = {\n active: boolean;\n disabled: boolean;\n href?: string;\n iconName?: string;\n label: string;\n source: HTMLElement;\n};\n\nconst parseMaxWidthPx = (query: string | undefined): number | undefined => {\n const value = String(query ?? '').trim();\n\n if (!value) return undefined;\n\n const match = /max-width\\s*:\\s*([0-9]+(?:\\.[0-9]+)?)px/i.exec(value);\n\n if (!match) return undefined;\n\n const parsed = Number.parseFloat(match[1]);\n\n return Number.isFinite(parsed) ? parsed : undefined;\n};\n\nconst resolveContainerElement = (el: HTMLElement): HTMLElement | null => {\n let container = el.parentElement;\n\n while (container?.tagName.toLowerCase() === 'ore-grid-item') {\n container = container.parentElement;\n }\n\n return container;\n};\n\nconst readContainerWidth = (el: HTMLElement): number => {\n const parentWidth = resolveContainerElement(el)?.clientWidth ?? 0;\n\n if (parentWidth > 0) return parentWidth;\n\n return el.offsetWidth;\n};\n\nconst deepActiveElement = (): HTMLElement | null => {\n let active = document.activeElement as HTMLElement | null;\n\n while (active?.shadowRoot?.activeElement instanceof HTMLElement) {\n active = active.shadowRoot.activeElement;\n }\n\n return active;\n};\n\n/** Context provided by `ore-sidebar` to its `ore-sidebar-group` and `ore-sidebar-item` children. */\nexport type SidebarContext = {\n closeMobile: () => void;\n closeOnSelect: Readable<boolean>;\n collapsed: Readable<boolean>;\n mobileOpen: Readable<boolean>;\n mode: Readable<SidebarMode>;\n variant: Readable<SidebarVariant | undefined>;\n};\n\n/** Injection key for the sidebar context. */\nexport const SIDEBAR_CTX = createContext<SidebarContext>('SidebarContext');\n\n// ─── ore-sidebar styles ──────────────────────────────────────────────────────\n\n/** ore-sidebar element interface */\nexport type SidebarElement = HTMLElement &\n OreSidebarProps & {\n /** Close the drawer in bottom-nav mode. */\n closeMobile(): void;\n /** Open the drawer in bottom-nav mode. */\n openMobile(): void;\n /** Set collapsed state imperatively. */\n setCollapsed(next: boolean): void;\n /** Toggle between collapsed and expanded. */\n toggle(): void;\n /** Toggle the drawer in bottom-nav mode. */\n toggleMobile(): void;\n };\n\n/** Sidebar component properties */\n\nexport type OreSidebarEvents = {\n 'collapsed-change': { collapsed: boolean; source: SidebarCollapseSource };\n 'mobile-open-change': { open: boolean; source: SidebarMobileSource };\n};\n\nexport type OreSidebarGroupEvents = {\n 'open-change': { open: boolean };\n};\n\nexport type OreSidebarProps = {\n /** CSS media query that switches the sidebar to bottom navigation mode */\n 'bottom-nav-at'?: string;\n 'close-on-select'?: boolean;\n /** Controlled collapsed state */\n collapsed?: boolean;\n /** Whether the sidebar supports collapsing */\n collapsible?: boolean;\n 'collapse-label'?: string;\n /** Evaluate responsive and bottom-nav breakpoints against container width only. */\n 'container-breakpoints'?: boolean;\n /** Initial collapsed state in uncontrolled mode */\n 'default-collapsed'?: boolean;\n 'expand-label'?: string;\n /**\n * Accessible label for the navigation landmark.\n * Use to distinguish multiple navigation regions on a page.\n * @default 'Sidebar navigation'\n */\n label?: string;\n 'mobile-close-label'?: string;\n /**\n * CSS media query that, when it matches, automatically collapses the sidebar.\n * Unset by default — no automatic collapse.\n * @example 'responsive=\"(max-width: 768px)\"'\n */\n responsive?: string;\n /** Visual style variant */\n variant?: SidebarVariant;\n};\n\n/**\n * `ore-sidebar` — A collapsible navigation sidebar with group and item support.\n *\n * @element ore-sidebar\n * @element ore-sidebar-group - Labelled group of navigation items\n * @element ore-sidebar-item - Individual navigation link or button\n *\n * @attr {boolean} collapsed - Controlled collapsed state\n * @attr {boolean} default-collapsed - Initial collapsed state for uncontrolled sidebars\n * @attr {boolean} collapsible - Show the collapse toggle button\n * @attr {string} variant - Visual variant: 'floating' | 'inset'\n * @attr {string} label - Accessible aria-label for the nav landmark\n *\n * @fires collapsed-change - Fired when collapsed state changes. detail: { collapsed: boolean; source: string }\n * @fires mobile-open-change - Fired when mobile overlay open state changes. detail: { open: boolean; source: string }\n *\n * @slot header - Branding or logo content above the nav\n * @slot - Navigation content (ore-sidebar-group / ore-sidebar-item)\n * @slot footer - Footer content below the nav (user info, settings, etc.)\n *\n * @cssprop --sidebar-width - Expanded sidebar width (default: 16rem)\n * @cssprop --sidebar-collapsed-width - Collapsed sidebar width (default: 3.5rem)\n * @cssprop --sidebar-bg - Sidebar background color\n * @cssprop --sidebar-border-color - Border color\n *\n * @part mobile-backdrop - Backdrop shown for mobile overlays.\n * @part nav - Navigation container.\n * @part header - Header container.\n * @part toggle-btn - Shadow part for the `toggle-btn` element.\n * @part content - Content container.\n * @part footer - Footer container.\n * @part bottom-bar - Bottom bar container.\n * @part group - Group container.\n * @part group-header - Group header container.\n * @part group-icon - Group icon container.\n * @part group-label - Group label container.\n * @part group-items - Group items container.\n * @part item-icon - Leading item icon container.\n * @part item-label - Item label container.\n * @part item-end - Trailing item content container.\n * @part item - Item root element.\n * @example\n * ```html\n * <ore-sidebar collapsible label=\"App navigation\">\n * <span slot=\"header\">My App</span>\n * <ore-sidebar-group label=\"Main\">\n * <ore-sidebar-item href=\"/dashboard\" active>Dashboard</ore-sidebar-item>\n * <ore-sidebar-item href=\"/settings\">Settings</ore-sidebar-item>\n * </ore-sidebar-group>\n * </ore-sidebar>\n *\n * <!-- Auto-collapse on mobile -->\n * <ore-sidebar collapsible responsive=\"(max-width: 768px)\">...</ore-sidebar>\n * ```\n */\nexport const SIDEBAR_TAG = 'ore-sidebar' as const;\ndefine<OreSidebarProps>(SIDEBAR_TAG, {\n props: {\n 'bottom-nav-at': prop.string(),\n 'close-on-select': prop.bool(false),\n 'collapse-label': prop.string('Collapse sidebar'),\n collapsed: prop.bool(false),\n collapsible: prop.bool(false),\n 'container-breakpoints': prop.bool(false),\n 'default-collapsed': prop.bool(false),\n 'expand-label': prop.string('Expand sidebar'),\n label: prop.string('Sidebar navigation'),\n 'mobile-close-label': prop.string('Close sidebar'),\n responsive: prop.string(),\n variant: prop.string<SidebarVariant>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreSidebarEvents>();\n const slots = useSlots();\n\n const hasHeader = () => slots.has('header').value;\n const hasFooter = () => slots.has('footer').value;\n const hasLogo = () => slots.has('logo').value;\n\n const isControlled = signal(el.hasAttribute('collapsed'));\n const collapsedState = signal(isControlled.value ? el.hasAttribute('collapsed') : props['default-collapsed'].value);\n const isBottomNav = signal(false);\n const isMobileOpen = signal(false);\n const bottomNavItems = signal<BottomNavItem[]>([]);\n const responsiveMediaMatches = signal(false);\n const responsiveSizeMatches = signal(false);\n const responsiveMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props.responsive.value));\n const hasResponsiveQuery = signal(Boolean(String(props.responsive.value ?? '').trim()));\n const bottomNavMediaMatches = signal(false);\n const bottomNavSizeMatches = signal(false);\n const bottomNavMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props['bottom-nav-at'].value));\n const isPreviewMode = signal(false);\n let focusReturnTarget: HTMLElement | null = null;\n\n const isCollapsed = () => collapsedState.value;\n const mode = computed<SidebarMode>(() => {\n if (isBottomNav.value) return 'bottom-nav';\n\n return collapsedState.value ? 'collapsed' : 'default';\n });\n\n const applyResponsiveState = () => {\n const useContainerBreakpoints = props['container-breakpoints'].value;\n const responsiveMatched = useContainerBreakpoints\n ? responsiveSizeMatches.value\n : responsiveMediaMatches.value || responsiveSizeMatches.value;\n const bottomMatched = useContainerBreakpoints\n ? bottomNavSizeMatches.value\n : bottomNavMediaMatches.value || bottomNavSizeMatches.value;\n\n // If the mobile drawer is currently open, stay in bottom-nav mode\n // regardless of the responsive match. This prevents the drawer from\n // disappearing mid-animation or if forced open via the API on desktop.\n if (!isMobileOpen.value) {\n isBottomNav.value = bottomMatched;\n }\n\n if (!bottomMatched && !isMobileOpen.value) {\n setMobileOpen(false, 'responsive');\n }\n\n if (hasResponsiveQuery.value) {\n setCollapsed(responsiveMatched, 'responsive');\n }\n };\n\n const readBottomNavItems = () => {\n const directItems = slots\n .elements()\n .value.filter(\n (item): item is HTMLElement =>\n item instanceof HTMLElement && item.tagName.toLowerCase() === 'ore-sidebar-item',\n );\n const promotedItems = [...el.querySelectorAll<HTMLElement>('ore-sidebar-item[bottom-nav]')];\n const sourceItems = promotedItems.length > 0 ? promotedItems : directItems;\n const next = sourceItems.map((item, index) => {\n const el = item;\n const iconSlotEl =\n (el.querySelector(':scope > [slot=\"icon\"]') as HTMLElement | null) ??\n (el.querySelector('[slot=\"icon\"]') as HTMLElement | null);\n const directIconName =\n iconSlotEl?.tagName.toLowerCase() === 'ore-icon' ? iconSlotEl.getAttribute('name') : null;\n const nestedIconName = iconSlotEl?.querySelector('ore-icon')?.getAttribute('name') ?? null;\n const rawLabel = (el.textContent ?? '').trim();\n\n return {\n active: el.hasAttribute('active'),\n disabled: el.hasAttribute('disabled'),\n href: el.getAttribute('href') ?? undefined,\n iconName: directIconName ?? nestedIconName ?? undefined,\n label: el.getAttribute('bottom-nav-label')?.trim() || rawLabel || `Item ${index + 1}`,\n source: el,\n } satisfies BottomNavItem;\n });\n\n bottomNavItems.value = next;\n };\n\n provide(SIDEBAR_CTX, {\n closeMobile: () => setMobileOpen(false, 'toggle'),\n closeOnSelect: props['close-on-select'],\n collapsed: computed(() => !isBottomNav.value && collapsedState.value) as Readable<boolean>,\n mobileOpen: computed(() => isBottomNav.value && isMobileOpen.value) as Readable<boolean>,\n mode: mode as Readable<SidebarMode>,\n variant: props.variant,\n });\n\n const setCollapsed = (next: boolean, source: SidebarCollapseSource) => {\n if (isCollapsed() === next) return;\n\n if (!isControlled.value) {\n collapsedState.value = next;\n }\n\n emit('collapsed-change', { collapsed: next, source });\n };\n\n const setMobileOpen = (next: boolean, source: SidebarMobileSource) => {\n const open = Boolean(next);\n\n if (open && !isBottomNav.value) {\n isBottomNav.value = true;\n }\n\n if (!isBottomNav.value && !open) {\n if (isMobileOpen.value) {\n isMobileOpen.value = false;\n }\n\n return;\n }\n\n if (isMobileOpen.value === open) return;\n\n if (open) focusReturnTarget = deepActiveElement();\n\n isMobileOpen.value = open;\n\n // If closing, re-evaluate responsive state to potentially exit forced bottom-nav mode\n if (!open) {\n applyResponsiveState();\n queueMicrotask(() => {\n if (focusReturnTarget?.isConnected) focusReturnTarget.focus();\n focusReturnTarget = null;\n });\n } else {\n queueMicrotask(() => el.shadowRoot?.querySelector<HTMLElement>('nav')?.focus());\n }\n\n emit('mobile-open-change', { open, source });\n };\n\n const doToggle = () => {\n setCollapsed(!isCollapsed(), 'toggle');\n };\n\n const sidebarEl = el as SidebarElement;\n\n sidebarEl.setCollapsed = (next) => setCollapsed(Boolean(next), 'api');\n sidebarEl.toggle = doToggle;\n sidebarEl.openMobile = () => setMobileOpen(true, 'api');\n sidebarEl.closeMobile = () => setMobileOpen(false, 'api');\n sidebarEl.toggleMobile = () => setMobileOpen(!isMobileOpen.value, 'toggle');\n\n bind({\n attr: {\n 'data-bottom-nav': () => (isBottomNav.value ? true : undefined),\n 'data-collapsed': () => (isCollapsed() && !isBottomNav.value ? true : undefined),\n 'data-has-logo': () => (hasLogo() ? true : undefined),\n 'data-mobile-open': () => (isBottomNav.value && isMobileOpen.value ? true : undefined),\n 'data-preview-mode': () => (isPreviewMode.value ? true : undefined),\n },\n });\n\n onMounted(() => {\n // Suppress transitions during initial layout so the sidebar doesn't\n // animate from a collapsed/0 state before the first ResizeObserver fires.\n el.setAttribute('data-no-transition', '');\n\n let transitionUnlocked = false;\n const unlockTransition = () => {\n if (transitionUnlocked) return;\n\n transitionUnlocked = true;\n el.removeAttribute('data-no-transition');\n };\n\n // Fallback: unlock after two frames in case ResizeObserver doesn't fire.\n requestAnimationFrame(() => requestAnimationFrame(unlockTransition));\n\n let mediaCleanup: (() => void) | undefined;\n let bottomNavCleanup: (() => void) | undefined;\n const itemObservers = new Map<HTMLElement, MutationObserver>();\n const observer = new MutationObserver(() => {\n if (!el.hasAttribute('collapsed') && !isControlled.value) return;\n\n isControlled.value = true;\n collapsedState.value = el.hasAttribute('collapsed');\n });\n\n observer.observe(el, {\n attributeFilter: ['collapsed'],\n attributes: true,\n });\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !isMobileOpen.value) return;\n\n event.preventDefault();\n setMobileOpen(false, 'toggle');\n };\n el.addEventListener('keydown', closeOnEscape);\n\n watch(\n props.responsive,\n (query) => {\n mediaCleanup?.();\n mediaCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n hasResponsiveQuery.value = Boolean(mediaQuery);\n responsiveMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n responsiveMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && responsiveMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n responsiveMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n mediaCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n watch(\n props['bottom-nav-at'],\n (query) => {\n bottomNavCleanup?.();\n bottomNavCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n bottomNavMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n bottomNavMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && bottomNavMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n bottomNavMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n bottomNavCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n const stopResizeEffect =\n typeof ResizeObserver === 'function'\n ? (() => {\n const hostSize = createElementSize(el);\n onCleanup(() => hostSize.dispose());\n const hostSizeSignal = fromSubscribable(hostSize, { signal: hostSize.disposalSignal });\n\n const wrapperEl = el.parentElement;\n const containerEl = resolveContainerElement(el);\n const wrapperSize = wrapperEl ? createElementSize(wrapperEl) : undefined;\n const parentSize = containerEl && containerEl !== wrapperEl ? createElementSize(containerEl) : undefined;\n\n if (wrapperSize) {\n onCleanup(() => wrapperSize.dispose());\n }\n if (parentSize) {\n onCleanup(() => parentSize.dispose());\n }\n\n const wrapperSizeSignal = wrapperSize\n ? fromSubscribable(wrapperSize, { signal: wrapperSize.disposalSignal })\n : undefined;\n const parentSizeSignal = parentSize\n ? fromSubscribable(parentSize, { signal: parentSize.disposalSignal })\n : undefined;\n\n let rafId: number | undefined;\n\n const onResize = () => {\n if (rafId !== undefined) cancelAnimationFrame(rafId);\n\n rafId = requestAnimationFrame(() => {\n const resolvedContainer = resolveContainerElement(el);\n const width = readContainerWidth(el);\n const responsiveWasMatched = responsiveSizeMatches.value;\n const bottomNavWasMatched = bottomNavSizeMatches.value;\n const parentWidth = resolvedContainer?.clientWidth ?? 0;\n\n isPreviewMode.value = parentWidth > 0 && parentWidth < window.innerWidth;\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n\n if (\n responsiveWasMatched !== responsiveSizeMatches.value ||\n bottomNavWasMatched !== bottomNavSizeMatches.value\n ) {\n applyResponsiveState();\n }\n\n unlockTransition();\n });\n };\n\n return watch(\n computed(() => [\n hostSizeSignal.value?.width,\n hostSizeSignal.value?.height,\n wrapperSizeSignal?.value?.width,\n wrapperSizeSignal?.value?.height,\n parentSizeSignal?.value?.width,\n parentSizeSignal?.value?.height,\n ]),\n onResize,\n );\n })()\n : undefined;\n\n const bindItemObservers = (items: HTMLElement[]) => {\n const set = new Set(items);\n\n for (const [item, cleanup] of itemObservers) {\n if (set.has(item)) continue;\n\n cleanup.disconnect();\n itemObservers.delete(item);\n }\n\n for (const item of items) {\n if (itemObservers.has(item)) continue;\n\n const itemObserver = new MutationObserver(() => {\n // Only update if in bottom-nav mode to minimize re-renders\n if (isBottomNav.value) {\n readBottomNavItems();\n }\n });\n\n // Watch attributes and content that affect bottom-nav rendering.\n itemObserver.observe(item, {\n attributeFilter: ['active', 'bottom-nav', 'bottom-nav-label', 'disabled', 'href'],\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n });\n itemObservers.set(item, itemObserver);\n }\n };\n\n const syncBottomNavItems = () => {\n bindItemObservers([...el.querySelectorAll<HTMLElement>('ore-sidebar-item')]);\n readBottomNavItems();\n };\n watch(slots.elements(), syncBottomNavItems, { immediate: true });\n const nestedItemsObserver = new MutationObserver(syncBottomNavItems);\n nestedItemsObserver.observe(el, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n nestedItemsObserver.disconnect();\n el.removeEventListener('keydown', closeOnEscape);\n mediaCleanup?.();\n bottomNavCleanup?.();\n stopResizeEffect?.dispose();\n\n for (const itemObserver of itemObservers.values()) {\n itemObserver.disconnect();\n }\n\n itemObservers.clear();\n };\n });\n\n return html`\n <button\n class=\"mobile-backdrop\"\n part=\"mobile-backdrop\"\n type=\"button\"\n aria-label=\"${props['mobile-close-label']}\"\n ?hidden=${() => !isBottomNav.value || !isMobileOpen.value}\n @click=${() => setMobileOpen(false, 'toggle')}></button>\n <nav\n aria-label=\"${props.label}\"\n aria-hidden=${() => (isBottomNav.value && !isMobileOpen.value ? 'true' : null)}\n part=\"nav\"\n tabindex=\"-1\"\n ?inert=${() => isBottomNav.value && !isMobileOpen.value}>\n <div class=\"sidebar-header\" part=\"header\" ?hidden=${() => !hasHeader() && !props.collapsible.value}>\n <span class=\"sidebar-logo\" ?hidden=${() => !hasLogo()}>\n <slot name=\"logo\"></slot>\n </span>\n <span class=\"sidebar-header-content\">\n <slot name=\"header\"></slot>\n </span>\n <button\n class=\"toggle-btn\"\n part=\"toggle-btn\"\n type=\"button\"\n ?hidden=${() => !props.collapsible.value}\n aria-label=\"${() => (isCollapsed() ? props['expand-label'].value : props['collapse-label'].value)}\"\n aria-expanded=\"${() => !isCollapsed()}\"\n @click=\"${doToggle}\">\n <ore-icon\n class=\"toggle-icon\"\n name=${() => (isCollapsed() ? 'panel-left-open' : 'panel-left-close')}\n size=\"18\"\n stroke-width=\"2\"\n aria-hidden=\"true\"></ore-icon>\n </button>\n </div>\n <div class=\"sidebar-content\" part=\"content\">\n <slot></slot>\n </div>\n <div class=\"sidebar-footer\" part=\"footer\" ?hidden=${() => !hasFooter()}>\n <slot name=\"footer\"></slot>\n </div>\n </nav>\n\n <div class=\"bottom-bar\" part=\"bottom-bar\" ?hidden=${() => !isBottomNav.value}>\n ${() =>\n bottomNavItems.value.map((item) => {\n const className = `bottom-tab${item.active ? ' bottom-tab-active' : ''}`;\n\n if (item.href && !item.disabled) {\n return html`\n <a\n class=\"${className}\"\n href=\"${item.href}\"\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\">\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </a>\n `;\n }\n\n return html`\n <button\n class=\"${className}\"\n type=\"button\"\n ?disabled=${item.disabled}\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\"\n @click=${() => item.source.click()}>\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </button>\n `;\n })}\n </div>\n `;\n },\n styles: [coarsePointerMixin, reducedMotionMixin, sidebarStyles],\n});\n\n// ─── ore-sidebar-group styles ────────────────────────────────────────────────\n\n/** Sidebar group properties */\nexport type OreSidebarGroupProps = {\n /** Whether this group can be collapsed */\n collapsible?: boolean;\n /** Initial open state in uncontrolled mode */\n 'default-open'?: boolean;\n /** Accessible label for the group */\n label?: string;\n /** Controlled open state */\n open?: boolean;\n};\n\n/**\n * `ore-sidebar-group` — A labelled section within `ore-sidebar`.\n *\n * @element ore-sidebar-group\n *\n * @attr {string} label - Group label text\n * @attr {boolean} collapsible - Whether this group can be toggled open/closed\n * @attr {boolean} open - Controlled expanded state\n * @attr {boolean} default-open - Initial expanded state in uncontrolled mode\n *\n * @fires open-change - Fired when the group open state changes (collapsible groups only). detail: { open: boolean }\n *\n * @slot - Navigation items (`ore-sidebar-item`)\n * @slot icon - Icon displayed before the label\n *\n * @example\n * ```html\n * <ore-sidebar-group label=\"Main\" collapsible open>\n * <ore-sidebar-item href=\"/home\">Home</ore-sidebar-item>\n * </ore-sidebar-group>\n * ```\n */\nexport const SIDEBAR_GROUP_TAG = 'ore-sidebar-group' as const;\ndefine<OreSidebarGroupProps>(SIDEBAR_GROUP_TAG, {\n props: {\n collapsible: prop.bool(false),\n 'default-open': prop.bool(true),\n label: prop.string(),\n open: {\n default: undefined as boolean | undefined,\n parse: (value: string | null) => (value == null ? undefined : value === '' || value === 'true'),\n reflect: false,\n },\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isControlled = () => props.open.value !== undefined;\n const openState = signal(props['default-open'].value);\n const isOpen = computed(() => {\n if (!props.collapsible.value) return true;\n\n if (isControlled()) return props.open.value ?? false;\n\n return openState.value;\n });\n\n watch(props.open, (value) => {\n if (value === undefined) return;\n\n openState.value = value;\n });\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n },\n });\n\n return html`\n <details class=\"group\" part=\"group\" ?open=${isOpen}>\n <summary\n class=\"group-header\"\n part=\"group-header\"\n aria-expanded=\"${() => (props.collapsible.value ? String(props.open.value) : null)}\"\n @click=${(e: MouseEvent) => {\n if (!props.collapsible.value) {\n e.preventDefault();\n }\n }}>\n <span class=\"group-icon\" part=\"group-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"group-label\" part=\"group-label\">${props.label}</span>\n <span class=\"chevron\" ?hidden=${() => !props.collapsible.value} aria-hidden=\"true\">\n <ore-icon name=\"chevron-right\" size=\"12\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </summary>\n <div class=\"group-items\" part=\"group-items\" role=\"list\">\n <slot></slot>\n </div>\n </details>\n `;\n },\n styles: [reducedMotionMixin, groupStyles],\n});\n\n// ─── ore-sidebar-item styles ─────────────────────────────────────────────────\n\n/** Sidebar item properties */\nexport type OreSidebarItemProps = {\n /** Whether this item represents the current page/section */\n active?: boolean;\n 'bottom-nav'?: boolean;\n 'bottom-nav-label'?: string;\n /** Whether this item is disabled */\n disabled?: boolean;\n /** Navigation href — renders an `<a>` when set, otherwise a `<button>` */\n href?: string;\n label?: string;\n /**\n * Relationship of the linked URL (`rel` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n rel?: string;\n /**\n * Browsing context for the link (`target` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n target?: string;\n};\n\n/**\n * `ore-sidebar-item` — An individual navigation item in a `ore-sidebar`.\n *\n * Renders as an `<a>` when `href` is provided, otherwise as a `<button>`.\n * Marks the active page via `aria-current=\"page\"` when the `active` attribute is set.\n *\n * @element ore-sidebar-item\n *\n * @attr {string} href - Link URL; renders an anchor when set\n * @attr {boolean} active - Marks the item as the current page\n * @attr {boolean} disabled - Disables the item\n * @attr {string} rel - Anchor `rel` attribute (links only)\n * @attr {string} target - Anchor `target` attribute (links only)\n *\n * @slot - Label text\n * @slot icon - Leading icon\n * @slot end - Trailing content (badge, shortcut, arrow, etc.)\n *\n * @cssprop --sidebar-item-color - Default text color\n * @cssprop --sidebar-item-hover-bg - Hover background\n * @cssprop --sidebar-item-hover-color - Hover text color\n * @cssprop --sidebar-item-active-bg - Active background\n * @cssprop --sidebar-item-active-color - Active text color\n * @cssprop --sidebar-item-indicator - Active indicator bar color\n *\n * @part item - The inner anchor or button element\n * @part item-icon - The icon wrapper\n * @part item-label - The label wrapper\n * @part item-end - The trailing content wrapper\n *\n * @example\n * ```html\n * <ore-sidebar-item href=\"/dashboard\" active>\n * <span slot=\"icon\">🏠</span>\n * Dashboard\n * </ore-sidebar-item>\n *\n * <ore-sidebar-item href=\"/users\">\n * <span slot=\"icon\">👤</span>\n * Users\n * <ore-badge slot=\"end\" color=\"primary\">3</ore-badge>\n * </ore-sidebar-item>\n * ```\n */\nexport const SIDEBAR_ITEM_TAG = 'ore-sidebar-item' as const;\ndefine<OreSidebarItemProps>(SIDEBAR_ITEM_TAG, {\n props: {\n active: prop.bool(false),\n 'bottom-nav': prop.bool(false),\n 'bottom-nav-label': prop.string(),\n disabled: prop.bool(false),\n href: prop.string(),\n label: prop.string(),\n rel: prop.string(),\n target: prop.string(),\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const hasEnd = () => slots.has('end').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isLink = () => !!props.href.value && !props.disabled.value;\n\n // Prevent reverse tabnapping: auto-inject noopener + noreferrer for _blank links.\n const effectiveRel = computed(() => computeSafeRel(props.rel.value, props.target.value));\n const closeMobileOnSelect = (event: MouseEvent) => {\n if (!sidebarCtx?.closeOnSelect.value || !sidebarCtx.mobileOpen.value) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\n queueMicrotask(sidebarCtx.closeMobile);\n };\n\n const renderItemContent = () => html`\n <span class=\"item-icon\" part=\"item-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"item-label\" part=\"item-label\"><slot></slot></span>\n <span class=\"item-end\" part=\"item-end\" ?hidden=${() => !hasEnd()}>\n <slot name=\"end\"></slot>\n </span>\n `;\n\n return html`\n ${() => {\n if (isLink()) {\n return html`\n <a\n class=\"item\"\n part=\"item\"\n href=\"${props.href}\"\n rel=\"${effectiveRel}\"\n target=\"${props.target}\"\n aria-label=\"${props.label}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </a>\n `;\n }\n\n if (props.disabled.value) {\n return html`\n <div\n class=\"item\"\n part=\"item\"\n aria-disabled=\"true\"\n tabindex=\"-1\"\n aria-label=\"${props.label}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\">\n ${renderItemContent()}\n </div>\n `;\n }\n\n return html`\n <button\n class=\"item\"\n part=\"item\"\n type=\"button\"\n ?disabled=\"${props.disabled}\"\n aria-label=\"${props.label}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </button>\n `;\n }}\n `;\n },\n styles: [coarsePointerMixin, itemStyles],\n});\n"],"mappings":"4YAwCA,IAAM,EAAmB,GAAkD,CACzE,IAAM,EAAQ,OAAO,GAAS,EAAE,CAAC,CAAC,KAAK,EAEvC,GAAI,CAAC,EAAO,OAEZ,IAAM,EAAQ,2CAA2C,KAAK,CAAK,EAEnE,GAAI,CAAC,EAAO,OAEZ,IAAM,EAAS,OAAO,WAAW,EAAM,EAAE,EAEzC,OAAO,OAAO,SAAS,CAAM,EAAI,EAAS,IAAA,EAC5C,EAEM,EAA2B,GAAwC,CACvE,IAAI,EAAY,EAAG,cAEnB,KAAO,GAAW,QAAQ,YAAY,IAAM,iBAC1C,EAAY,EAAU,cAGxB,OAAO,CACT,EAEM,EAAsB,GAA4B,CACtD,IAAM,EAAc,EAAwB,CAAE,CAAC,EAAE,aAAe,EAIhE,OAFI,EAAc,EAAU,EAErB,EAAG,WACZ,EAEM,MAA8C,CAClD,IAAI,EAAS,SAAS,cAEtB,KAAO,GAAQ,YAAY,yBAAyB,aAClD,EAAS,EAAO,WAAW,cAG7B,OAAO,CACT,EAaa,GAAA,EAAc,EAAA,cAAA,CAA8B,gBAAgB,EAoH5D,EAAc,eAC3B,EAAA,EAA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A,IAAI;;;;sBAIC,EAAM,KAAK;qBACZ,EAAa;wBACV,EAAM,OAAO;4BACT,EAAM,MAAM;kCACH,EAAM,OAAO,MAAQ,OAAS,KAAM;uBAClD,EAAoB;gBAC3B,EAAkB,EAAE;;YAKxB,EAAM,SAAS,MACV,EAAA,IAAI;;;;;;4BAMO,EAAM,MAAM;kCACH,EAAM,OAAO,MAAQ,OAAS,KAAM;gBACzD,EAAkB,EAAE;;YAKrB,EAAA,IAAI;;;;;yBAKM,EAAM,SAAS;0BACd,EAAM,MAAM;gCACH,EAAM,OAAO,MAAQ,OAAS,KAAM;qBAClD,EAAoB;cAC3B,EAAkB,EAAE;;UAG1B;KAEN,EACA,OAAQ,CAAC,EAAA,mBAAoB,EAAA,OAAU,CACzC,CAAC"}
package/dist/sidebar.js CHANGED
@@ -206,7 +206,12 @@ c(A, {
206
206
  aria-label="${e["mobile-close-label"]}"
207
207
  ?hidden=${() => !m.value || !A.value}
208
208
  @click=${() => K(!1, "toggle")}></button>
209
- <nav aria-label="${e.label}" part="nav" tabindex="-1">
209
+ <nav
210
+ aria-label="${e.label}"
211
+ aria-hidden=${() => m.value && !A.value ? "true" : null}
212
+ part="nav"
213
+ tabindex="-1"
214
+ ?inert=${() => m.value && !A.value}>
210
215
  <div class="sidebar-header" part="header" ?hidden=${() => !i() && !e.collapsible.value}>
211
216
  <span class="sidebar-logo" ?hidden=${() => !s()}>
212
217
  <slot name="logo"></slot>
@@ -330,6 +335,7 @@ c(M, {
330
335
  "bottom-nav-label": m.string(),
331
336
  disabled: m.bool(!1),
332
337
  href: m.string(),
338
+ label: m.string(),
333
339
  rel: m.string(),
334
340
  target: m.string()
335
341
  },
@@ -358,6 +364,7 @@ c(M, {
358
364
  href="${e.href}"
359
365
  rel="${c}"
360
366
  target="${e.target}"
367
+ aria-label="${e.label}"
361
368
  aria-current="${() => e.active.value ? "page" : null}"
362
369
  @click=${l}>
363
370
  ${f()}
@@ -368,6 +375,7 @@ c(M, {
368
375
  part="item"
369
376
  aria-disabled="true"
370
377
  tabindex="-1"
378
+ aria-label="${e.label}"
371
379
  aria-current="${() => e.active.value ? "page" : null}">
372
380
  ${f()}
373
381
  </div>
@@ -377,6 +385,7 @@ c(M, {
377
385
  part="item"
378
386
  type="button"
379
387
  ?disabled="${e.disabled}"
388
+ aria-label="${e.label}"
380
389
  aria-current="${() => e.active.value ? "page" : null}"
381
390
  @click=${l}>
382
391
  ${f()}
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","names":[],"sources":["../src/layout/sidebar/sidebar.ts"],"sourcesContent":["import {\n bind,\n createContext,\n define,\n getHost,\n html,\n inject,\n onCleanup,\n onMounted,\n prop,\n provide,\n useEmit,\n useSlots,\n} from '@vielzeug/ore';\nimport { computed, fromSubscribable, type Readable, signal, watch } from '@vielzeug/ripple';\nimport { createElementSize, createMediaQuery, SentinelUnavailableError } from '@vielzeug/sentinel';\n\nimport '../../content/icon/icon';\nimport { coarsePointerMixin, reducedMotionMixin } from '../../styles';\nimport { computeSafeRel } from '../../utils';\nimport sidebarStyles from './sidebar.css?inline';\nimport groupStyles from './sidebar-group.css?inline';\nimport itemStyles from './sidebar-item.css?inline';\n\n// ─── Types ────────────────────────────────────────────────────────────────\n\ntype SidebarVariant = 'floating' | 'inset';\ntype SidebarCollapseSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMobileSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMode = 'bottom-nav' | 'collapsed' | 'default';\n\ntype BottomNavItem = {\n active: boolean;\n disabled: boolean;\n href?: string;\n iconName?: string;\n label: string;\n source: HTMLElement;\n};\n\nconst parseMaxWidthPx = (query: string | undefined): number | undefined => {\n const value = String(query ?? '').trim();\n\n if (!value) return undefined;\n\n const match = /max-width\\s*:\\s*([0-9]+(?:\\.[0-9]+)?)px/i.exec(value);\n\n if (!match) return undefined;\n\n const parsed = Number.parseFloat(match[1]);\n\n return Number.isFinite(parsed) ? parsed : undefined;\n};\n\nconst resolveContainerElement = (el: HTMLElement): HTMLElement | null => {\n let container = el.parentElement;\n\n while (container?.tagName.toLowerCase() === 'ore-grid-item') {\n container = container.parentElement;\n }\n\n return container;\n};\n\nconst readContainerWidth = (el: HTMLElement): number => {\n const parentWidth = resolveContainerElement(el)?.clientWidth ?? 0;\n\n if (parentWidth > 0) return parentWidth;\n\n return el.offsetWidth;\n};\n\nconst deepActiveElement = (): HTMLElement | null => {\n let active = document.activeElement as HTMLElement | null;\n\n while (active?.shadowRoot?.activeElement instanceof HTMLElement) {\n active = active.shadowRoot.activeElement;\n }\n\n return active;\n};\n\n/** Context provided by `ore-sidebar` to its `ore-sidebar-group` and `ore-sidebar-item` children. */\nexport type SidebarContext = {\n closeMobile: () => void;\n closeOnSelect: Readable<boolean>;\n collapsed: Readable<boolean>;\n mobileOpen: Readable<boolean>;\n mode: Readable<SidebarMode>;\n variant: Readable<SidebarVariant | undefined>;\n};\n\n/** Injection key for the sidebar context. */\nexport const SIDEBAR_CTX = createContext<SidebarContext>('SidebarContext');\n\n// ─── ore-sidebar styles ──────────────────────────────────────────────────────\n\n/** ore-sidebar element interface */\nexport type SidebarElement = HTMLElement &\n OreSidebarProps & {\n /** Close the drawer in bottom-nav mode. */\n closeMobile(): void;\n /** Open the drawer in bottom-nav mode. */\n openMobile(): void;\n /** Set collapsed state imperatively. */\n setCollapsed(next: boolean): void;\n /** Toggle between collapsed and expanded. */\n toggle(): void;\n /** Toggle the drawer in bottom-nav mode. */\n toggleMobile(): void;\n };\n\n/** Sidebar component properties */\n\nexport type OreSidebarEvents = {\n 'collapsed-change': { collapsed: boolean; source: SidebarCollapseSource };\n 'mobile-open-change': { open: boolean; source: SidebarMobileSource };\n};\n\nexport type OreSidebarGroupEvents = {\n 'open-change': { open: boolean };\n};\n\nexport type OreSidebarProps = {\n /** CSS media query that switches the sidebar to bottom navigation mode */\n 'bottom-nav-at'?: string;\n 'close-on-select'?: boolean;\n /** Controlled collapsed state */\n collapsed?: boolean;\n /** Whether the sidebar supports collapsing */\n collapsible?: boolean;\n 'collapse-label'?: string;\n /** Evaluate responsive and bottom-nav breakpoints against container width only. */\n 'container-breakpoints'?: boolean;\n /** Initial collapsed state in uncontrolled mode */\n 'default-collapsed'?: boolean;\n 'expand-label'?: string;\n /**\n * Accessible label for the navigation landmark.\n * Use to distinguish multiple navigation regions on a page.\n * @default 'Sidebar navigation'\n */\n label?: string;\n 'mobile-close-label'?: string;\n /**\n * CSS media query that, when it matches, automatically collapses the sidebar.\n * Unset by default — no automatic collapse.\n * @example 'responsive=\"(max-width: 768px)\"'\n */\n responsive?: string;\n /** Visual style variant */\n variant?: SidebarVariant;\n};\n\n/**\n * `ore-sidebar` — A collapsible navigation sidebar with group and item support.\n *\n * @element ore-sidebar\n * @element ore-sidebar-group - Labelled group of navigation items\n * @element ore-sidebar-item - Individual navigation link or button\n *\n * @attr {boolean} collapsed - Controlled collapsed state\n * @attr {boolean} default-collapsed - Initial collapsed state for uncontrolled sidebars\n * @attr {boolean} collapsible - Show the collapse toggle button\n * @attr {string} variant - Visual variant: 'floating' | 'inset'\n * @attr {string} label - Accessible aria-label for the nav landmark\n *\n * @fires collapsed-change - Fired when collapsed state changes. detail: { collapsed: boolean; source: string }\n * @fires mobile-open-change - Fired when mobile overlay open state changes. detail: { open: boolean; source: string }\n *\n * @slot header - Branding or logo content above the nav\n * @slot - Navigation content (ore-sidebar-group / ore-sidebar-item)\n * @slot footer - Footer content below the nav (user info, settings, etc.)\n *\n * @cssprop --sidebar-width - Expanded sidebar width (default: 16rem)\n * @cssprop --sidebar-collapsed-width - Collapsed sidebar width (default: 3.5rem)\n * @cssprop --sidebar-bg - Sidebar background color\n * @cssprop --sidebar-border-color - Border color\n *\n * @part mobile-backdrop - Backdrop shown for mobile overlays.\n * @part nav - Navigation container.\n * @part header - Header container.\n * @part toggle-btn - Shadow part for the `toggle-btn` element.\n * @part content - Content container.\n * @part footer - Footer container.\n * @part bottom-bar - Bottom bar container.\n * @part group - Group container.\n * @part group-header - Group header container.\n * @part group-icon - Group icon container.\n * @part group-label - Group label container.\n * @part group-items - Group items container.\n * @part item-icon - Leading item icon container.\n * @part item-label - Item label container.\n * @part item-end - Trailing item content container.\n * @part item - Item root element.\n * @example\n * ```html\n * <ore-sidebar collapsible label=\"App navigation\">\n * <span slot=\"header\">My App</span>\n * <ore-sidebar-group label=\"Main\">\n * <ore-sidebar-item href=\"/dashboard\" active>Dashboard</ore-sidebar-item>\n * <ore-sidebar-item href=\"/settings\">Settings</ore-sidebar-item>\n * </ore-sidebar-group>\n * </ore-sidebar>\n *\n * <!-- Auto-collapse on mobile -->\n * <ore-sidebar collapsible responsive=\"(max-width: 768px)\">...</ore-sidebar>\n * ```\n */\nexport const SIDEBAR_TAG = 'ore-sidebar' as const;\ndefine<OreSidebarProps>(SIDEBAR_TAG, {\n props: {\n 'bottom-nav-at': prop.string(),\n 'close-on-select': prop.bool(false),\n 'collapse-label': prop.string('Collapse sidebar'),\n collapsed: prop.bool(false),\n collapsible: prop.bool(false),\n 'container-breakpoints': prop.bool(false),\n 'default-collapsed': prop.bool(false),\n 'expand-label': prop.string('Expand sidebar'),\n label: prop.string('Sidebar navigation'),\n 'mobile-close-label': prop.string('Close sidebar'),\n responsive: prop.string(),\n variant: prop.string<SidebarVariant>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreSidebarEvents>();\n const slots = useSlots();\n\n const hasHeader = () => slots.has('header').value;\n const hasFooter = () => slots.has('footer').value;\n const hasLogo = () => slots.has('logo').value;\n\n const isControlled = signal(el.hasAttribute('collapsed'));\n const collapsedState = signal(isControlled.value ? el.hasAttribute('collapsed') : props['default-collapsed'].value);\n const isBottomNav = signal(false);\n const isMobileOpen = signal(false);\n const bottomNavItems = signal<BottomNavItem[]>([]);\n const responsiveMediaMatches = signal(false);\n const responsiveSizeMatches = signal(false);\n const responsiveMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props.responsive.value));\n const hasResponsiveQuery = signal(Boolean(String(props.responsive.value ?? '').trim()));\n const bottomNavMediaMatches = signal(false);\n const bottomNavSizeMatches = signal(false);\n const bottomNavMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props['bottom-nav-at'].value));\n const isPreviewMode = signal(false);\n let focusReturnTarget: HTMLElement | null = null;\n\n const isCollapsed = () => collapsedState.value;\n const mode = computed<SidebarMode>(() => {\n if (isBottomNav.value) return 'bottom-nav';\n\n return collapsedState.value ? 'collapsed' : 'default';\n });\n\n const applyResponsiveState = () => {\n const useContainerBreakpoints = props['container-breakpoints'].value;\n const responsiveMatched = useContainerBreakpoints\n ? responsiveSizeMatches.value\n : responsiveMediaMatches.value || responsiveSizeMatches.value;\n const bottomMatched = useContainerBreakpoints\n ? bottomNavSizeMatches.value\n : bottomNavMediaMatches.value || bottomNavSizeMatches.value;\n\n // If the mobile drawer is currently open, stay in bottom-nav mode\n // regardless of the responsive match. This prevents the drawer from\n // disappearing mid-animation or if forced open via the API on desktop.\n if (!isMobileOpen.value) {\n isBottomNav.value = bottomMatched;\n }\n\n if (!bottomMatched && !isMobileOpen.value) {\n setMobileOpen(false, 'responsive');\n }\n\n if (hasResponsiveQuery.value) {\n setCollapsed(responsiveMatched, 'responsive');\n }\n };\n\n const readBottomNavItems = () => {\n const directItems = slots\n .elements()\n .value.filter(\n (item): item is HTMLElement =>\n item instanceof HTMLElement && item.tagName.toLowerCase() === 'ore-sidebar-item',\n );\n const promotedItems = [...el.querySelectorAll<HTMLElement>('ore-sidebar-item[bottom-nav]')];\n const sourceItems = promotedItems.length > 0 ? promotedItems : directItems;\n const next = sourceItems.map((item, index) => {\n const el = item;\n const iconSlotEl =\n (el.querySelector(':scope > [slot=\"icon\"]') as HTMLElement | null) ??\n (el.querySelector('[slot=\"icon\"]') as HTMLElement | null);\n const directIconName =\n iconSlotEl?.tagName.toLowerCase() === 'ore-icon' ? iconSlotEl.getAttribute('name') : null;\n const nestedIconName = iconSlotEl?.querySelector('ore-icon')?.getAttribute('name') ?? null;\n const rawLabel = (el.textContent ?? '').trim();\n\n return {\n active: el.hasAttribute('active'),\n disabled: el.hasAttribute('disabled'),\n href: el.getAttribute('href') ?? undefined,\n iconName: directIconName ?? nestedIconName ?? undefined,\n label: el.getAttribute('bottom-nav-label')?.trim() || rawLabel || `Item ${index + 1}`,\n source: el,\n } satisfies BottomNavItem;\n });\n\n bottomNavItems.value = next;\n };\n\n provide(SIDEBAR_CTX, {\n closeMobile: () => setMobileOpen(false, 'toggle'),\n closeOnSelect: props['close-on-select'],\n collapsed: computed(() => !isBottomNav.value && collapsedState.value) as Readable<boolean>,\n mobileOpen: computed(() => isBottomNav.value && isMobileOpen.value) as Readable<boolean>,\n mode: mode as Readable<SidebarMode>,\n variant: props.variant,\n });\n\n const setCollapsed = (next: boolean, source: SidebarCollapseSource) => {\n if (isCollapsed() === next) return;\n\n if (!isControlled.value) {\n collapsedState.value = next;\n }\n\n emit('collapsed-change', { collapsed: next, source });\n };\n\n const setMobileOpen = (next: boolean, source: SidebarMobileSource) => {\n const open = Boolean(next);\n\n if (open && !isBottomNav.value) {\n isBottomNav.value = true;\n }\n\n if (!isBottomNav.value && !open) {\n if (isMobileOpen.value) {\n isMobileOpen.value = false;\n }\n\n return;\n }\n\n if (isMobileOpen.value === open) return;\n\n if (open) focusReturnTarget = deepActiveElement();\n\n isMobileOpen.value = open;\n\n // If closing, re-evaluate responsive state to potentially exit forced bottom-nav mode\n if (!open) {\n applyResponsiveState();\n queueMicrotask(() => {\n if (focusReturnTarget?.isConnected) focusReturnTarget.focus();\n focusReturnTarget = null;\n });\n } else {\n queueMicrotask(() => el.shadowRoot?.querySelector<HTMLElement>('nav')?.focus());\n }\n\n emit('mobile-open-change', { open, source });\n };\n\n const doToggle = () => {\n setCollapsed(!isCollapsed(), 'toggle');\n };\n\n const sidebarEl = el as SidebarElement;\n\n sidebarEl.setCollapsed = (next) => setCollapsed(Boolean(next), 'api');\n sidebarEl.toggle = doToggle;\n sidebarEl.openMobile = () => setMobileOpen(true, 'api');\n sidebarEl.closeMobile = () => setMobileOpen(false, 'api');\n sidebarEl.toggleMobile = () => setMobileOpen(!isMobileOpen.value, 'toggle');\n\n bind({\n attr: {\n 'data-bottom-nav': () => (isBottomNav.value ? true : undefined),\n 'data-collapsed': () => (isCollapsed() && !isBottomNav.value ? true : undefined),\n 'data-has-logo': () => (hasLogo() ? true : undefined),\n 'data-mobile-open': () => (isBottomNav.value && isMobileOpen.value ? true : undefined),\n 'data-preview-mode': () => (isPreviewMode.value ? true : undefined),\n },\n });\n\n onMounted(() => {\n // Suppress transitions during initial layout so the sidebar doesn't\n // animate from a collapsed/0 state before the first ResizeObserver fires.\n el.setAttribute('data-no-transition', '');\n\n let transitionUnlocked = false;\n const unlockTransition = () => {\n if (transitionUnlocked) return;\n\n transitionUnlocked = true;\n el.removeAttribute('data-no-transition');\n };\n\n // Fallback: unlock after two frames in case ResizeObserver doesn't fire.\n requestAnimationFrame(() => requestAnimationFrame(unlockTransition));\n\n let mediaCleanup: (() => void) | undefined;\n let bottomNavCleanup: (() => void) | undefined;\n const itemObservers = new Map<HTMLElement, MutationObserver>();\n const observer = new MutationObserver(() => {\n if (!el.hasAttribute('collapsed') && !isControlled.value) return;\n\n isControlled.value = true;\n collapsedState.value = el.hasAttribute('collapsed');\n });\n\n observer.observe(el, {\n attributeFilter: ['collapsed'],\n attributes: true,\n });\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !isMobileOpen.value) return;\n\n event.preventDefault();\n setMobileOpen(false, 'toggle');\n };\n el.addEventListener('keydown', closeOnEscape);\n\n watch(\n props.responsive,\n (query) => {\n mediaCleanup?.();\n mediaCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n hasResponsiveQuery.value = Boolean(mediaQuery);\n responsiveMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n responsiveMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && responsiveMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n responsiveMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n mediaCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n watch(\n props['bottom-nav-at'],\n (query) => {\n bottomNavCleanup?.();\n bottomNavCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n bottomNavMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n bottomNavMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && bottomNavMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n bottomNavMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n bottomNavCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n const stopResizeEffect =\n typeof ResizeObserver === 'function'\n ? (() => {\n const hostSize = createElementSize(el);\n onCleanup(() => hostSize.dispose());\n const hostSizeSignal = fromSubscribable(hostSize, { signal: hostSize.disposalSignal });\n\n const wrapperEl = el.parentElement;\n const containerEl = resolveContainerElement(el);\n const wrapperSize = wrapperEl ? createElementSize(wrapperEl) : undefined;\n const parentSize = containerEl && containerEl !== wrapperEl ? createElementSize(containerEl) : undefined;\n\n if (wrapperSize) {\n onCleanup(() => wrapperSize.dispose());\n }\n if (parentSize) {\n onCleanup(() => parentSize.dispose());\n }\n\n const wrapperSizeSignal = wrapperSize\n ? fromSubscribable(wrapperSize, { signal: wrapperSize.disposalSignal })\n : undefined;\n const parentSizeSignal = parentSize\n ? fromSubscribable(parentSize, { signal: parentSize.disposalSignal })\n : undefined;\n\n let rafId: number | undefined;\n\n const onResize = () => {\n if (rafId !== undefined) cancelAnimationFrame(rafId);\n\n rafId = requestAnimationFrame(() => {\n const resolvedContainer = resolveContainerElement(el);\n const width = readContainerWidth(el);\n const responsiveWasMatched = responsiveSizeMatches.value;\n const bottomNavWasMatched = bottomNavSizeMatches.value;\n const parentWidth = resolvedContainer?.clientWidth ?? 0;\n\n isPreviewMode.value = parentWidth > 0 && parentWidth < window.innerWidth;\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n\n if (\n responsiveWasMatched !== responsiveSizeMatches.value ||\n bottomNavWasMatched !== bottomNavSizeMatches.value\n ) {\n applyResponsiveState();\n }\n\n unlockTransition();\n });\n };\n\n return watch(\n computed(() => [\n hostSizeSignal.value?.width,\n hostSizeSignal.value?.height,\n wrapperSizeSignal?.value?.width,\n wrapperSizeSignal?.value?.height,\n parentSizeSignal?.value?.width,\n parentSizeSignal?.value?.height,\n ]),\n onResize,\n );\n })()\n : undefined;\n\n const bindItemObservers = (items: HTMLElement[]) => {\n const set = new Set(items);\n\n for (const [item, cleanup] of itemObservers) {\n if (set.has(item)) continue;\n\n cleanup.disconnect();\n itemObservers.delete(item);\n }\n\n for (const item of items) {\n if (itemObservers.has(item)) continue;\n\n const itemObserver = new MutationObserver(() => {\n // Only update if in bottom-nav mode to minimize re-renders\n if (isBottomNav.value) {\n readBottomNavItems();\n }\n });\n\n // Watch attributes and content that affect bottom-nav rendering.\n itemObserver.observe(item, {\n attributeFilter: ['active', 'bottom-nav', 'bottom-nav-label', 'disabled', 'href'],\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n });\n itemObservers.set(item, itemObserver);\n }\n };\n\n const syncBottomNavItems = () => {\n bindItemObservers([...el.querySelectorAll<HTMLElement>('ore-sidebar-item')]);\n readBottomNavItems();\n };\n watch(slots.elements(), syncBottomNavItems, { immediate: true });\n const nestedItemsObserver = new MutationObserver(syncBottomNavItems);\n nestedItemsObserver.observe(el, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n nestedItemsObserver.disconnect();\n el.removeEventListener('keydown', closeOnEscape);\n mediaCleanup?.();\n bottomNavCleanup?.();\n stopResizeEffect?.dispose();\n\n for (const itemObserver of itemObservers.values()) {\n itemObserver.disconnect();\n }\n\n itemObservers.clear();\n };\n });\n\n return html`\n <button\n class=\"mobile-backdrop\"\n part=\"mobile-backdrop\"\n type=\"button\"\n aria-label=\"${props['mobile-close-label']}\"\n ?hidden=${() => !isBottomNav.value || !isMobileOpen.value}\n @click=${() => setMobileOpen(false, 'toggle')}></button>\n <nav aria-label=\"${props.label}\" part=\"nav\" tabindex=\"-1\">\n <div class=\"sidebar-header\" part=\"header\" ?hidden=${() => !hasHeader() && !props.collapsible.value}>\n <span class=\"sidebar-logo\" ?hidden=${() => !hasLogo()}>\n <slot name=\"logo\"></slot>\n </span>\n <span class=\"sidebar-header-content\">\n <slot name=\"header\"></slot>\n </span>\n <button\n class=\"toggle-btn\"\n part=\"toggle-btn\"\n type=\"button\"\n ?hidden=${() => !props.collapsible.value}\n aria-label=\"${() => (isCollapsed() ? props['expand-label'].value : props['collapse-label'].value)}\"\n aria-expanded=\"${() => !isCollapsed()}\"\n @click=\"${doToggle}\">\n <ore-icon\n class=\"toggle-icon\"\n name=${() => (isCollapsed() ? 'panel-left-open' : 'panel-left-close')}\n size=\"18\"\n stroke-width=\"2\"\n aria-hidden=\"true\"></ore-icon>\n </button>\n </div>\n <div class=\"sidebar-content\" part=\"content\">\n <slot></slot>\n </div>\n <div class=\"sidebar-footer\" part=\"footer\" ?hidden=${() => !hasFooter()}>\n <slot name=\"footer\"></slot>\n </div>\n </nav>\n\n <div class=\"bottom-bar\" part=\"bottom-bar\" ?hidden=${() => !isBottomNav.value}>\n ${() =>\n bottomNavItems.value.map((item) => {\n const className = `bottom-tab${item.active ? ' bottom-tab-active' : ''}`;\n\n if (item.href && !item.disabled) {\n return html`\n <a\n class=\"${className}\"\n href=\"${item.href}\"\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\">\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </a>\n `;\n }\n\n return html`\n <button\n class=\"${className}\"\n type=\"button\"\n ?disabled=${item.disabled}\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\"\n @click=${() => item.source.click()}>\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </button>\n `;\n })}\n </div>\n `;\n },\n styles: [coarsePointerMixin, reducedMotionMixin, sidebarStyles],\n});\n\n// ─── ore-sidebar-group styles ────────────────────────────────────────────────\n\n/** Sidebar group properties */\nexport type OreSidebarGroupProps = {\n /** Whether this group can be collapsed */\n collapsible?: boolean;\n /** Initial open state in uncontrolled mode */\n 'default-open'?: boolean;\n /** Accessible label for the group */\n label?: string;\n /** Controlled open state */\n open?: boolean;\n};\n\n/**\n * `ore-sidebar-group` — A labelled section within `ore-sidebar`.\n *\n * @element ore-sidebar-group\n *\n * @attr {string} label - Group label text\n * @attr {boolean} collapsible - Whether this group can be toggled open/closed\n * @attr {boolean} open - Controlled expanded state\n * @attr {boolean} default-open - Initial expanded state in uncontrolled mode\n *\n * @fires open-change - Fired when the group open state changes (collapsible groups only). detail: { open: boolean }\n *\n * @slot - Navigation items (`ore-sidebar-item`)\n * @slot icon - Icon displayed before the label\n *\n * @example\n * ```html\n * <ore-sidebar-group label=\"Main\" collapsible open>\n * <ore-sidebar-item href=\"/home\">Home</ore-sidebar-item>\n * </ore-sidebar-group>\n * ```\n */\nexport const SIDEBAR_GROUP_TAG = 'ore-sidebar-group' as const;\ndefine<OreSidebarGroupProps>(SIDEBAR_GROUP_TAG, {\n props: {\n collapsible: prop.bool(false),\n 'default-open': prop.bool(true),\n label: prop.string(),\n open: {\n default: undefined as boolean | undefined,\n parse: (value: string | null) => (value == null ? undefined : value === '' || value === 'true'),\n reflect: false,\n },\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isControlled = () => props.open.value !== undefined;\n const openState = signal(props['default-open'].value);\n const isOpen = computed(() => {\n if (!props.collapsible.value) return true;\n\n if (isControlled()) return props.open.value ?? false;\n\n return openState.value;\n });\n\n watch(props.open, (value) => {\n if (value === undefined) return;\n\n openState.value = value;\n });\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n },\n });\n\n return html`\n <details class=\"group\" part=\"group\" ?open=${isOpen}>\n <summary\n class=\"group-header\"\n part=\"group-header\"\n aria-expanded=\"${() => (props.collapsible.value ? String(props.open.value) : null)}\"\n @click=${(e: MouseEvent) => {\n if (!props.collapsible.value) {\n e.preventDefault();\n }\n }}>\n <span class=\"group-icon\" part=\"group-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"group-label\" part=\"group-label\">${props.label}</span>\n <span class=\"chevron\" ?hidden=${() => !props.collapsible.value} aria-hidden=\"true\">\n <ore-icon name=\"chevron-right\" size=\"12\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </summary>\n <div class=\"group-items\" part=\"group-items\" role=\"list\">\n <slot></slot>\n </div>\n </details>\n `;\n },\n styles: [reducedMotionMixin, groupStyles],\n});\n\n// ─── ore-sidebar-item styles ─────────────────────────────────────────────────\n\n/** Sidebar item properties */\nexport type OreSidebarItemProps = {\n /** Whether this item represents the current page/section */\n active?: boolean;\n 'bottom-nav'?: boolean;\n 'bottom-nav-label'?: string;\n /** Whether this item is disabled */\n disabled?: boolean;\n /** Navigation href — renders an `<a>` when set, otherwise a `<button>` */\n href?: string;\n /**\n * Relationship of the linked URL (`rel` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n rel?: string;\n /**\n * Browsing context for the link (`target` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n target?: string;\n};\n\n/**\n * `ore-sidebar-item` — An individual navigation item in a `ore-sidebar`.\n *\n * Renders as an `<a>` when `href` is provided, otherwise as a `<button>`.\n * Marks the active page via `aria-current=\"page\"` when the `active` attribute is set.\n *\n * @element ore-sidebar-item\n *\n * @attr {string} href - Link URL; renders an anchor when set\n * @attr {boolean} active - Marks the item as the current page\n * @attr {boolean} disabled - Disables the item\n * @attr {string} rel - Anchor `rel` attribute (links only)\n * @attr {string} target - Anchor `target` attribute (links only)\n *\n * @slot - Label text\n * @slot icon - Leading icon\n * @slot end - Trailing content (badge, shortcut, arrow, etc.)\n *\n * @cssprop --sidebar-item-color - Default text color\n * @cssprop --sidebar-item-hover-bg - Hover background\n * @cssprop --sidebar-item-hover-color - Hover text color\n * @cssprop --sidebar-item-active-bg - Active background\n * @cssprop --sidebar-item-active-color - Active text color\n * @cssprop --sidebar-item-indicator - Active indicator bar color\n *\n * @part item - The inner anchor or button element\n * @part item-icon - The icon wrapper\n * @part item-label - The label wrapper\n * @part item-end - The trailing content wrapper\n *\n * @example\n * ```html\n * <ore-sidebar-item href=\"/dashboard\" active>\n * <span slot=\"icon\">🏠</span>\n * Dashboard\n * </ore-sidebar-item>\n *\n * <ore-sidebar-item href=\"/users\">\n * <span slot=\"icon\">👤</span>\n * Users\n * <ore-badge slot=\"end\" color=\"primary\">3</ore-badge>\n * </ore-sidebar-item>\n * ```\n */\nexport const SIDEBAR_ITEM_TAG = 'ore-sidebar-item' as const;\ndefine<OreSidebarItemProps>(SIDEBAR_ITEM_TAG, {\n props: {\n active: prop.bool(false),\n 'bottom-nav': prop.bool(false),\n 'bottom-nav-label': prop.string(),\n disabled: prop.bool(false),\n href: prop.string(),\n rel: prop.string(),\n target: prop.string(),\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const hasEnd = () => slots.has('end').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isLink = () => !!props.href.value && !props.disabled.value;\n\n // Prevent reverse tabnapping: auto-inject noopener + noreferrer for _blank links.\n const effectiveRel = computed(() => computeSafeRel(props.rel.value, props.target.value));\n const closeMobileOnSelect = (event: MouseEvent) => {\n if (!sidebarCtx?.closeOnSelect.value || !sidebarCtx.mobileOpen.value) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\n queueMicrotask(sidebarCtx.closeMobile);\n };\n\n const renderItemContent = () => html`\n <span class=\"item-icon\" part=\"item-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"item-label\" part=\"item-label\"><slot></slot></span>\n <span class=\"item-end\" part=\"item-end\" ?hidden=${() => !hasEnd()}>\n <slot name=\"end\"></slot>\n </span>\n `;\n\n return html`\n ${() => {\n if (isLink()) {\n return html`\n <a\n class=\"item\"\n part=\"item\"\n href=\"${props.href}\"\n rel=\"${effectiveRel}\"\n target=\"${props.target}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </a>\n `;\n }\n\n if (props.disabled.value) {\n return html`\n <div\n class=\"item\"\n part=\"item\"\n aria-disabled=\"true\"\n tabindex=\"-1\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\">\n ${renderItemContent()}\n </div>\n `;\n }\n\n return html`\n <button\n class=\"item\"\n part=\"item\"\n type=\"button\"\n ?disabled=\"${props.disabled}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </button>\n `;\n }}\n `;\n },\n styles: [coarsePointerMixin, itemStyles],\n});\n"],"mappings":";;;;;;;;;AAwCA,IAAM,KAAmB,MAAkD;CACzE,IAAM,IAAQ,OAAO,KAAS,EAAE,CAAC,CAAC,KAAK;CAEvC,IAAI,CAAC,GAAO;CAEZ,IAAM,IAAQ,2CAA2C,KAAK,CAAK;CAEnE,IAAI,CAAC,GAAO;CAEZ,IAAM,IAAS,OAAO,WAAW,EAAM,EAAE;CAEzC,OAAO,OAAO,SAAS,CAAM,IAAI,IAAS,KAAA;AAC5C,GAEM,KAA2B,MAAwC;CACvE,IAAI,IAAY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,EAAM,KAAK,SAAS,CAAC,EAAM,SAAS,OAGrD,IAAe,QAAe,EAAe,EAAM,IAAI,OAAO,EAAM,OAAO,KAAK,CAAC,GACjF,KAAuB,MAAsB;GAC7C,AAAC,GAAY,cAAc,SAAU,EAAW,WAAW,UAC3D,EAAM,WAAW,KAAK,EAAM,WAAW,EAAM,WAAW,EAAM,YAAY,EAAM,UAEpF,eAAe,EAAW,WAAW;EACvC,GAEM,UAA0B,CAAI;+DACuB,CAAC,EAAQ,EAAE;;;;6DAIb,CAAC,EAAO,EAAE;;;;EAKnE,OAAO,CAAI;cAEH,EAAO,IACF,CAAI;;;;sBAIC,EAAM,KAAK;qBACZ,EAAa;wBACV,EAAM,OAAO;oCACA,EAAM,OAAO,QAAQ,SAAS,KAAM;uBAClD,EAAoB;gBAC3B,EAAkB,EAAE;;cAKxB,EAAM,SAAS,QACV,CAAI;;;;;;oCAMgB,EAAM,OAAO,QAAQ,SAAS,KAAM;gBACzD,EAAkB,EAAE;;cAKrB,CAAI;;;;;yBAKM,EAAM,SAAS;kCACL,EAAM,OAAO,QAAQ,SAAS,KAAM;qBAClD,EAAoB;cAC3B,EAAkB,EAAE;;UAG1B;;CAEN;CACA,QAAQ,CAAC,GAAoB,CAAU;AACzC,CAAC"}
1
+ {"version":3,"file":"sidebar.js","names":[],"sources":["../src/layout/sidebar/sidebar.ts"],"sourcesContent":["import {\n bind,\n createContext,\n define,\n getHost,\n html,\n inject,\n onCleanup,\n onMounted,\n prop,\n provide,\n useEmit,\n useSlots,\n} from '@vielzeug/ore';\nimport { computed, fromSubscribable, type Readable, signal, watch } from '@vielzeug/ripple';\nimport { createElementSize, createMediaQuery, SentinelUnavailableError } from '@vielzeug/sentinel';\n\nimport '../../content/icon/icon';\nimport { coarsePointerMixin, reducedMotionMixin } from '../../styles';\nimport { computeSafeRel } from '../../utils';\nimport sidebarStyles from './sidebar.css?inline';\nimport groupStyles from './sidebar-group.css?inline';\nimport itemStyles from './sidebar-item.css?inline';\n\n// ─── Types ────────────────────────────────────────────────────────────────\n\ntype SidebarVariant = 'floating' | 'inset';\ntype SidebarCollapseSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMobileSource = 'api' | 'responsive' | 'toggle';\ntype SidebarMode = 'bottom-nav' | 'collapsed' | 'default';\n\ntype BottomNavItem = {\n active: boolean;\n disabled: boolean;\n href?: string;\n iconName?: string;\n label: string;\n source: HTMLElement;\n};\n\nconst parseMaxWidthPx = (query: string | undefined): number | undefined => {\n const value = String(query ?? '').trim();\n\n if (!value) return undefined;\n\n const match = /max-width\\s*:\\s*([0-9]+(?:\\.[0-9]+)?)px/i.exec(value);\n\n if (!match) return undefined;\n\n const parsed = Number.parseFloat(match[1]);\n\n return Number.isFinite(parsed) ? parsed : undefined;\n};\n\nconst resolveContainerElement = (el: HTMLElement): HTMLElement | null => {\n let container = el.parentElement;\n\n while (container?.tagName.toLowerCase() === 'ore-grid-item') {\n container = container.parentElement;\n }\n\n return container;\n};\n\nconst readContainerWidth = (el: HTMLElement): number => {\n const parentWidth = resolveContainerElement(el)?.clientWidth ?? 0;\n\n if (parentWidth > 0) return parentWidth;\n\n return el.offsetWidth;\n};\n\nconst deepActiveElement = (): HTMLElement | null => {\n let active = document.activeElement as HTMLElement | null;\n\n while (active?.shadowRoot?.activeElement instanceof HTMLElement) {\n active = active.shadowRoot.activeElement;\n }\n\n return active;\n};\n\n/** Context provided by `ore-sidebar` to its `ore-sidebar-group` and `ore-sidebar-item` children. */\nexport type SidebarContext = {\n closeMobile: () => void;\n closeOnSelect: Readable<boolean>;\n collapsed: Readable<boolean>;\n mobileOpen: Readable<boolean>;\n mode: Readable<SidebarMode>;\n variant: Readable<SidebarVariant | undefined>;\n};\n\n/** Injection key for the sidebar context. */\nexport const SIDEBAR_CTX = createContext<SidebarContext>('SidebarContext');\n\n// ─── ore-sidebar styles ──────────────────────────────────────────────────────\n\n/** ore-sidebar element interface */\nexport type SidebarElement = HTMLElement &\n OreSidebarProps & {\n /** Close the drawer in bottom-nav mode. */\n closeMobile(): void;\n /** Open the drawer in bottom-nav mode. */\n openMobile(): void;\n /** Set collapsed state imperatively. */\n setCollapsed(next: boolean): void;\n /** Toggle between collapsed and expanded. */\n toggle(): void;\n /** Toggle the drawer in bottom-nav mode. */\n toggleMobile(): void;\n };\n\n/** Sidebar component properties */\n\nexport type OreSidebarEvents = {\n 'collapsed-change': { collapsed: boolean; source: SidebarCollapseSource };\n 'mobile-open-change': { open: boolean; source: SidebarMobileSource };\n};\n\nexport type OreSidebarGroupEvents = {\n 'open-change': { open: boolean };\n};\n\nexport type OreSidebarProps = {\n /** CSS media query that switches the sidebar to bottom navigation mode */\n 'bottom-nav-at'?: string;\n 'close-on-select'?: boolean;\n /** Controlled collapsed state */\n collapsed?: boolean;\n /** Whether the sidebar supports collapsing */\n collapsible?: boolean;\n 'collapse-label'?: string;\n /** Evaluate responsive and bottom-nav breakpoints against container width only. */\n 'container-breakpoints'?: boolean;\n /** Initial collapsed state in uncontrolled mode */\n 'default-collapsed'?: boolean;\n 'expand-label'?: string;\n /**\n * Accessible label for the navigation landmark.\n * Use to distinguish multiple navigation regions on a page.\n * @default 'Sidebar navigation'\n */\n label?: string;\n 'mobile-close-label'?: string;\n /**\n * CSS media query that, when it matches, automatically collapses the sidebar.\n * Unset by default — no automatic collapse.\n * @example 'responsive=\"(max-width: 768px)\"'\n */\n responsive?: string;\n /** Visual style variant */\n variant?: SidebarVariant;\n};\n\n/**\n * `ore-sidebar` — A collapsible navigation sidebar with group and item support.\n *\n * @element ore-sidebar\n * @element ore-sidebar-group - Labelled group of navigation items\n * @element ore-sidebar-item - Individual navigation link or button\n *\n * @attr {boolean} collapsed - Controlled collapsed state\n * @attr {boolean} default-collapsed - Initial collapsed state for uncontrolled sidebars\n * @attr {boolean} collapsible - Show the collapse toggle button\n * @attr {string} variant - Visual variant: 'floating' | 'inset'\n * @attr {string} label - Accessible aria-label for the nav landmark\n *\n * @fires collapsed-change - Fired when collapsed state changes. detail: { collapsed: boolean; source: string }\n * @fires mobile-open-change - Fired when mobile overlay open state changes. detail: { open: boolean; source: string }\n *\n * @slot header - Branding or logo content above the nav\n * @slot - Navigation content (ore-sidebar-group / ore-sidebar-item)\n * @slot footer - Footer content below the nav (user info, settings, etc.)\n *\n * @cssprop --sidebar-width - Expanded sidebar width (default: 16rem)\n * @cssprop --sidebar-collapsed-width - Collapsed sidebar width (default: 3.5rem)\n * @cssprop --sidebar-bg - Sidebar background color\n * @cssprop --sidebar-border-color - Border color\n *\n * @part mobile-backdrop - Backdrop shown for mobile overlays.\n * @part nav - Navigation container.\n * @part header - Header container.\n * @part toggle-btn - Shadow part for the `toggle-btn` element.\n * @part content - Content container.\n * @part footer - Footer container.\n * @part bottom-bar - Bottom bar container.\n * @part group - Group container.\n * @part group-header - Group header container.\n * @part group-icon - Group icon container.\n * @part group-label - Group label container.\n * @part group-items - Group items container.\n * @part item-icon - Leading item icon container.\n * @part item-label - Item label container.\n * @part item-end - Trailing item content container.\n * @part item - Item root element.\n * @example\n * ```html\n * <ore-sidebar collapsible label=\"App navigation\">\n * <span slot=\"header\">My App</span>\n * <ore-sidebar-group label=\"Main\">\n * <ore-sidebar-item href=\"/dashboard\" active>Dashboard</ore-sidebar-item>\n * <ore-sidebar-item href=\"/settings\">Settings</ore-sidebar-item>\n * </ore-sidebar-group>\n * </ore-sidebar>\n *\n * <!-- Auto-collapse on mobile -->\n * <ore-sidebar collapsible responsive=\"(max-width: 768px)\">...</ore-sidebar>\n * ```\n */\nexport const SIDEBAR_TAG = 'ore-sidebar' as const;\ndefine<OreSidebarProps>(SIDEBAR_TAG, {\n props: {\n 'bottom-nav-at': prop.string(),\n 'close-on-select': prop.bool(false),\n 'collapse-label': prop.string('Collapse sidebar'),\n collapsed: prop.bool(false),\n collapsible: prop.bool(false),\n 'container-breakpoints': prop.bool(false),\n 'default-collapsed': prop.bool(false),\n 'expand-label': prop.string('Expand sidebar'),\n label: prop.string('Sidebar navigation'),\n 'mobile-close-label': prop.string('Close sidebar'),\n responsive: prop.string(),\n variant: prop.string<SidebarVariant>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreSidebarEvents>();\n const slots = useSlots();\n\n const hasHeader = () => slots.has('header').value;\n const hasFooter = () => slots.has('footer').value;\n const hasLogo = () => slots.has('logo').value;\n\n const isControlled = signal(el.hasAttribute('collapsed'));\n const collapsedState = signal(isControlled.value ? el.hasAttribute('collapsed') : props['default-collapsed'].value);\n const isBottomNav = signal(false);\n const isMobileOpen = signal(false);\n const bottomNavItems = signal<BottomNavItem[]>([]);\n const responsiveMediaMatches = signal(false);\n const responsiveSizeMatches = signal(false);\n const responsiveMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props.responsive.value));\n const hasResponsiveQuery = signal(Boolean(String(props.responsive.value ?? '').trim()));\n const bottomNavMediaMatches = signal(false);\n const bottomNavSizeMatches = signal(false);\n const bottomNavMaxWidthPx = signal<number | undefined>(parseMaxWidthPx(props['bottom-nav-at'].value));\n const isPreviewMode = signal(false);\n let focusReturnTarget: HTMLElement | null = null;\n\n const isCollapsed = () => collapsedState.value;\n const mode = computed<SidebarMode>(() => {\n if (isBottomNav.value) return 'bottom-nav';\n\n return collapsedState.value ? 'collapsed' : 'default';\n });\n\n const applyResponsiveState = () => {\n const useContainerBreakpoints = props['container-breakpoints'].value;\n const responsiveMatched = useContainerBreakpoints\n ? responsiveSizeMatches.value\n : responsiveMediaMatches.value || responsiveSizeMatches.value;\n const bottomMatched = useContainerBreakpoints\n ? bottomNavSizeMatches.value\n : bottomNavMediaMatches.value || bottomNavSizeMatches.value;\n\n // If the mobile drawer is currently open, stay in bottom-nav mode\n // regardless of the responsive match. This prevents the drawer from\n // disappearing mid-animation or if forced open via the API on desktop.\n if (!isMobileOpen.value) {\n isBottomNav.value = bottomMatched;\n }\n\n if (!bottomMatched && !isMobileOpen.value) {\n setMobileOpen(false, 'responsive');\n }\n\n if (hasResponsiveQuery.value) {\n setCollapsed(responsiveMatched, 'responsive');\n }\n };\n\n const readBottomNavItems = () => {\n const directItems = slots\n .elements()\n .value.filter(\n (item): item is HTMLElement =>\n item instanceof HTMLElement && item.tagName.toLowerCase() === 'ore-sidebar-item',\n );\n const promotedItems = [...el.querySelectorAll<HTMLElement>('ore-sidebar-item[bottom-nav]')];\n const sourceItems = promotedItems.length > 0 ? promotedItems : directItems;\n const next = sourceItems.map((item, index) => {\n const el = item;\n const iconSlotEl =\n (el.querySelector(':scope > [slot=\"icon\"]') as HTMLElement | null) ??\n (el.querySelector('[slot=\"icon\"]') as HTMLElement | null);\n const directIconName =\n iconSlotEl?.tagName.toLowerCase() === 'ore-icon' ? iconSlotEl.getAttribute('name') : null;\n const nestedIconName = iconSlotEl?.querySelector('ore-icon')?.getAttribute('name') ?? null;\n const rawLabel = (el.textContent ?? '').trim();\n\n return {\n active: el.hasAttribute('active'),\n disabled: el.hasAttribute('disabled'),\n href: el.getAttribute('href') ?? undefined,\n iconName: directIconName ?? nestedIconName ?? undefined,\n label: el.getAttribute('bottom-nav-label')?.trim() || rawLabel || `Item ${index + 1}`,\n source: el,\n } satisfies BottomNavItem;\n });\n\n bottomNavItems.value = next;\n };\n\n provide(SIDEBAR_CTX, {\n closeMobile: () => setMobileOpen(false, 'toggle'),\n closeOnSelect: props['close-on-select'],\n collapsed: computed(() => !isBottomNav.value && collapsedState.value) as Readable<boolean>,\n mobileOpen: computed(() => isBottomNav.value && isMobileOpen.value) as Readable<boolean>,\n mode: mode as Readable<SidebarMode>,\n variant: props.variant,\n });\n\n const setCollapsed = (next: boolean, source: SidebarCollapseSource) => {\n if (isCollapsed() === next) return;\n\n if (!isControlled.value) {\n collapsedState.value = next;\n }\n\n emit('collapsed-change', { collapsed: next, source });\n };\n\n const setMobileOpen = (next: boolean, source: SidebarMobileSource) => {\n const open = Boolean(next);\n\n if (open && !isBottomNav.value) {\n isBottomNav.value = true;\n }\n\n if (!isBottomNav.value && !open) {\n if (isMobileOpen.value) {\n isMobileOpen.value = false;\n }\n\n return;\n }\n\n if (isMobileOpen.value === open) return;\n\n if (open) focusReturnTarget = deepActiveElement();\n\n isMobileOpen.value = open;\n\n // If closing, re-evaluate responsive state to potentially exit forced bottom-nav mode\n if (!open) {\n applyResponsiveState();\n queueMicrotask(() => {\n if (focusReturnTarget?.isConnected) focusReturnTarget.focus();\n focusReturnTarget = null;\n });\n } else {\n queueMicrotask(() => el.shadowRoot?.querySelector<HTMLElement>('nav')?.focus());\n }\n\n emit('mobile-open-change', { open, source });\n };\n\n const doToggle = () => {\n setCollapsed(!isCollapsed(), 'toggle');\n };\n\n const sidebarEl = el as SidebarElement;\n\n sidebarEl.setCollapsed = (next) => setCollapsed(Boolean(next), 'api');\n sidebarEl.toggle = doToggle;\n sidebarEl.openMobile = () => setMobileOpen(true, 'api');\n sidebarEl.closeMobile = () => setMobileOpen(false, 'api');\n sidebarEl.toggleMobile = () => setMobileOpen(!isMobileOpen.value, 'toggle');\n\n bind({\n attr: {\n 'data-bottom-nav': () => (isBottomNav.value ? true : undefined),\n 'data-collapsed': () => (isCollapsed() && !isBottomNav.value ? true : undefined),\n 'data-has-logo': () => (hasLogo() ? true : undefined),\n 'data-mobile-open': () => (isBottomNav.value && isMobileOpen.value ? true : undefined),\n 'data-preview-mode': () => (isPreviewMode.value ? true : undefined),\n },\n });\n\n onMounted(() => {\n // Suppress transitions during initial layout so the sidebar doesn't\n // animate from a collapsed/0 state before the first ResizeObserver fires.\n el.setAttribute('data-no-transition', '');\n\n let transitionUnlocked = false;\n const unlockTransition = () => {\n if (transitionUnlocked) return;\n\n transitionUnlocked = true;\n el.removeAttribute('data-no-transition');\n };\n\n // Fallback: unlock after two frames in case ResizeObserver doesn't fire.\n requestAnimationFrame(() => requestAnimationFrame(unlockTransition));\n\n let mediaCleanup: (() => void) | undefined;\n let bottomNavCleanup: (() => void) | undefined;\n const itemObservers = new Map<HTMLElement, MutationObserver>();\n const observer = new MutationObserver(() => {\n if (!el.hasAttribute('collapsed') && !isControlled.value) return;\n\n isControlled.value = true;\n collapsedState.value = el.hasAttribute('collapsed');\n });\n\n observer.observe(el, {\n attributeFilter: ['collapsed'],\n attributes: true,\n });\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !isMobileOpen.value) return;\n\n event.preventDefault();\n setMobileOpen(false, 'toggle');\n };\n el.addEventListener('keydown', closeOnEscape);\n\n watch(\n props.responsive,\n (query) => {\n mediaCleanup?.();\n mediaCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n hasResponsiveQuery.value = Boolean(mediaQuery);\n responsiveMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n responsiveMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && responsiveMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n responsiveMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n mediaCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n watch(\n props['bottom-nav-at'],\n (query) => {\n bottomNavCleanup?.();\n bottomNavCleanup = undefined;\n\n const mediaQuery = String(query ?? '').trim();\n\n bottomNavMaxWidthPx.value = parseMaxWidthPx(mediaQuery);\n bottomNavMediaMatches.value = false;\n\n const width = readContainerWidth(el);\n\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n applyResponsiveState();\n\n // For parseable max-width queries, keep behavior container-driven.\n // This avoids preview viewport controls being overridden by window width.\n if (props['container-breakpoints'].value && bottomNavMaxWidthPx.value != null) {\n return;\n }\n\n if (!mediaQuery) {\n return;\n }\n\n try {\n const mediaHandle = createMediaQuery(mediaQuery);\n const syncMedia = (state: ReturnType<typeof mediaHandle.getSnapshot>) => {\n if (state) {\n bottomNavMediaMatches.value = state.matches;\n applyResponsiveState();\n }\n };\n\n syncMedia(mediaHandle.getSnapshot());\n\n const mediaCleanupFn = watch(\n fromSubscribable(mediaHandle, { signal: mediaHandle.disposalSignal }),\n syncMedia,\n );\n bottomNavCleanup = () => {\n mediaCleanupFn.dispose();\n mediaHandle.dispose();\n };\n } catch (error) {\n if (!(error instanceof SentinelUnavailableError)) throw error;\n }\n },\n { immediate: true },\n );\n\n const stopResizeEffect =\n typeof ResizeObserver === 'function'\n ? (() => {\n const hostSize = createElementSize(el);\n onCleanup(() => hostSize.dispose());\n const hostSizeSignal = fromSubscribable(hostSize, { signal: hostSize.disposalSignal });\n\n const wrapperEl = el.parentElement;\n const containerEl = resolveContainerElement(el);\n const wrapperSize = wrapperEl ? createElementSize(wrapperEl) : undefined;\n const parentSize = containerEl && containerEl !== wrapperEl ? createElementSize(containerEl) : undefined;\n\n if (wrapperSize) {\n onCleanup(() => wrapperSize.dispose());\n }\n if (parentSize) {\n onCleanup(() => parentSize.dispose());\n }\n\n const wrapperSizeSignal = wrapperSize\n ? fromSubscribable(wrapperSize, { signal: wrapperSize.disposalSignal })\n : undefined;\n const parentSizeSignal = parentSize\n ? fromSubscribable(parentSize, { signal: parentSize.disposalSignal })\n : undefined;\n\n let rafId: number | undefined;\n\n const onResize = () => {\n if (rafId !== undefined) cancelAnimationFrame(rafId);\n\n rafId = requestAnimationFrame(() => {\n const resolvedContainer = resolveContainerElement(el);\n const width = readContainerWidth(el);\n const responsiveWasMatched = responsiveSizeMatches.value;\n const bottomNavWasMatched = bottomNavSizeMatches.value;\n const parentWidth = resolvedContainer?.clientWidth ?? 0;\n\n isPreviewMode.value = parentWidth > 0 && parentWidth < window.innerWidth;\n\n responsiveSizeMatches.value =\n width > 0 && responsiveMaxWidthPx.value != null ? width <= responsiveMaxWidthPx.value : false;\n bottomNavSizeMatches.value =\n width > 0 && bottomNavMaxWidthPx.value != null ? width <= bottomNavMaxWidthPx.value : false;\n\n if (\n responsiveWasMatched !== responsiveSizeMatches.value ||\n bottomNavWasMatched !== bottomNavSizeMatches.value\n ) {\n applyResponsiveState();\n }\n\n unlockTransition();\n });\n };\n\n return watch(\n computed(() => [\n hostSizeSignal.value?.width,\n hostSizeSignal.value?.height,\n wrapperSizeSignal?.value?.width,\n wrapperSizeSignal?.value?.height,\n parentSizeSignal?.value?.width,\n parentSizeSignal?.value?.height,\n ]),\n onResize,\n );\n })()\n : undefined;\n\n const bindItemObservers = (items: HTMLElement[]) => {\n const set = new Set(items);\n\n for (const [item, cleanup] of itemObservers) {\n if (set.has(item)) continue;\n\n cleanup.disconnect();\n itemObservers.delete(item);\n }\n\n for (const item of items) {\n if (itemObservers.has(item)) continue;\n\n const itemObserver = new MutationObserver(() => {\n // Only update if in bottom-nav mode to minimize re-renders\n if (isBottomNav.value) {\n readBottomNavItems();\n }\n });\n\n // Watch attributes and content that affect bottom-nav rendering.\n itemObserver.observe(item, {\n attributeFilter: ['active', 'bottom-nav', 'bottom-nav-label', 'disabled', 'href'],\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n });\n itemObservers.set(item, itemObserver);\n }\n };\n\n const syncBottomNavItems = () => {\n bindItemObservers([...el.querySelectorAll<HTMLElement>('ore-sidebar-item')]);\n readBottomNavItems();\n };\n watch(slots.elements(), syncBottomNavItems, { immediate: true });\n const nestedItemsObserver = new MutationObserver(syncBottomNavItems);\n nestedItemsObserver.observe(el, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n nestedItemsObserver.disconnect();\n el.removeEventListener('keydown', closeOnEscape);\n mediaCleanup?.();\n bottomNavCleanup?.();\n stopResizeEffect?.dispose();\n\n for (const itemObserver of itemObservers.values()) {\n itemObserver.disconnect();\n }\n\n itemObservers.clear();\n };\n });\n\n return html`\n <button\n class=\"mobile-backdrop\"\n part=\"mobile-backdrop\"\n type=\"button\"\n aria-label=\"${props['mobile-close-label']}\"\n ?hidden=${() => !isBottomNav.value || !isMobileOpen.value}\n @click=${() => setMobileOpen(false, 'toggle')}></button>\n <nav\n aria-label=\"${props.label}\"\n aria-hidden=${() => (isBottomNav.value && !isMobileOpen.value ? 'true' : null)}\n part=\"nav\"\n tabindex=\"-1\"\n ?inert=${() => isBottomNav.value && !isMobileOpen.value}>\n <div class=\"sidebar-header\" part=\"header\" ?hidden=${() => !hasHeader() && !props.collapsible.value}>\n <span class=\"sidebar-logo\" ?hidden=${() => !hasLogo()}>\n <slot name=\"logo\"></slot>\n </span>\n <span class=\"sidebar-header-content\">\n <slot name=\"header\"></slot>\n </span>\n <button\n class=\"toggle-btn\"\n part=\"toggle-btn\"\n type=\"button\"\n ?hidden=${() => !props.collapsible.value}\n aria-label=\"${() => (isCollapsed() ? props['expand-label'].value : props['collapse-label'].value)}\"\n aria-expanded=\"${() => !isCollapsed()}\"\n @click=\"${doToggle}\">\n <ore-icon\n class=\"toggle-icon\"\n name=${() => (isCollapsed() ? 'panel-left-open' : 'panel-left-close')}\n size=\"18\"\n stroke-width=\"2\"\n aria-hidden=\"true\"></ore-icon>\n </button>\n </div>\n <div class=\"sidebar-content\" part=\"content\">\n <slot></slot>\n </div>\n <div class=\"sidebar-footer\" part=\"footer\" ?hidden=${() => !hasFooter()}>\n <slot name=\"footer\"></slot>\n </div>\n </nav>\n\n <div class=\"bottom-bar\" part=\"bottom-bar\" ?hidden=${() => !isBottomNav.value}>\n ${() =>\n bottomNavItems.value.map((item) => {\n const className = `bottom-tab${item.active ? ' bottom-tab-active' : ''}`;\n\n if (item.href && !item.disabled) {\n return html`\n <a\n class=\"${className}\"\n href=\"${item.href}\"\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\">\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </a>\n `;\n }\n\n return html`\n <button\n class=\"${className}\"\n type=\"button\"\n ?disabled=${item.disabled}\n aria-current=\"${item.active ? 'page' : null}\"\n data-active=\"${item.active ? 'true' : null}\"\n @click=${() => item.source.click()}>\n <span class=\"bottom-tab-icon\" aria-hidden=\"true\" ?hidden=${() => !item.iconName}>\n <ore-icon name=\"${item.iconName}\" size=\"18\" stroke-width=\"2\"></ore-icon>\n </span>\n <span class=\"bottom-tab-label\">${item.label}</span>\n </button>\n `;\n })}\n </div>\n `;\n },\n styles: [coarsePointerMixin, reducedMotionMixin, sidebarStyles],\n});\n\n// ─── ore-sidebar-group styles ────────────────────────────────────────────────\n\n/** Sidebar group properties */\nexport type OreSidebarGroupProps = {\n /** Whether this group can be collapsed */\n collapsible?: boolean;\n /** Initial open state in uncontrolled mode */\n 'default-open'?: boolean;\n /** Accessible label for the group */\n label?: string;\n /** Controlled open state */\n open?: boolean;\n};\n\n/**\n * `ore-sidebar-group` — A labelled section within `ore-sidebar`.\n *\n * @element ore-sidebar-group\n *\n * @attr {string} label - Group label text\n * @attr {boolean} collapsible - Whether this group can be toggled open/closed\n * @attr {boolean} open - Controlled expanded state\n * @attr {boolean} default-open - Initial expanded state in uncontrolled mode\n *\n * @fires open-change - Fired when the group open state changes (collapsible groups only). detail: { open: boolean }\n *\n * @slot - Navigation items (`ore-sidebar-item`)\n * @slot icon - Icon displayed before the label\n *\n * @example\n * ```html\n * <ore-sidebar-group label=\"Main\" collapsible open>\n * <ore-sidebar-item href=\"/home\">Home</ore-sidebar-item>\n * </ore-sidebar-group>\n * ```\n */\nexport const SIDEBAR_GROUP_TAG = 'ore-sidebar-group' as const;\ndefine<OreSidebarGroupProps>(SIDEBAR_GROUP_TAG, {\n props: {\n collapsible: prop.bool(false),\n 'default-open': prop.bool(true),\n label: prop.string(),\n open: {\n default: undefined as boolean | undefined,\n parse: (value: string | null) => (value == null ? undefined : value === '' || value === 'true'),\n reflect: false,\n },\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isControlled = () => props.open.value !== undefined;\n const openState = signal(props['default-open'].value);\n const isOpen = computed(() => {\n if (!props.collapsible.value) return true;\n\n if (isControlled()) return props.open.value ?? false;\n\n return openState.value;\n });\n\n watch(props.open, (value) => {\n if (value === undefined) return;\n\n openState.value = value;\n });\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n },\n });\n\n return html`\n <details class=\"group\" part=\"group\" ?open=${isOpen}>\n <summary\n class=\"group-header\"\n part=\"group-header\"\n aria-expanded=\"${() => (props.collapsible.value ? String(props.open.value) : null)}\"\n @click=${(e: MouseEvent) => {\n if (!props.collapsible.value) {\n e.preventDefault();\n }\n }}>\n <span class=\"group-icon\" part=\"group-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"group-label\" part=\"group-label\">${props.label}</span>\n <span class=\"chevron\" ?hidden=${() => !props.collapsible.value} aria-hidden=\"true\">\n <ore-icon name=\"chevron-right\" size=\"12\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </summary>\n <div class=\"group-items\" part=\"group-items\" role=\"list\">\n <slot></slot>\n </div>\n </details>\n `;\n },\n styles: [reducedMotionMixin, groupStyles],\n});\n\n// ─── ore-sidebar-item styles ─────────────────────────────────────────────────\n\n/** Sidebar item properties */\nexport type OreSidebarItemProps = {\n /** Whether this item represents the current page/section */\n active?: boolean;\n 'bottom-nav'?: boolean;\n 'bottom-nav-label'?: string;\n /** Whether this item is disabled */\n disabled?: boolean;\n /** Navigation href — renders an `<a>` when set, otherwise a `<button>` */\n href?: string;\n label?: string;\n /**\n * Relationship of the linked URL (`rel` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n rel?: string;\n /**\n * Browsing context for the link (`target` attribute on the inner `<a>`).\n * Only applies when `href` is set.\n */\n target?: string;\n};\n\n/**\n * `ore-sidebar-item` — An individual navigation item in a `ore-sidebar`.\n *\n * Renders as an `<a>` when `href` is provided, otherwise as a `<button>`.\n * Marks the active page via `aria-current=\"page\"` when the `active` attribute is set.\n *\n * @element ore-sidebar-item\n *\n * @attr {string} href - Link URL; renders an anchor when set\n * @attr {boolean} active - Marks the item as the current page\n * @attr {boolean} disabled - Disables the item\n * @attr {string} rel - Anchor `rel` attribute (links only)\n * @attr {string} target - Anchor `target` attribute (links only)\n *\n * @slot - Label text\n * @slot icon - Leading icon\n * @slot end - Trailing content (badge, shortcut, arrow, etc.)\n *\n * @cssprop --sidebar-item-color - Default text color\n * @cssprop --sidebar-item-hover-bg - Hover background\n * @cssprop --sidebar-item-hover-color - Hover text color\n * @cssprop --sidebar-item-active-bg - Active background\n * @cssprop --sidebar-item-active-color - Active text color\n * @cssprop --sidebar-item-indicator - Active indicator bar color\n *\n * @part item - The inner anchor or button element\n * @part item-icon - The icon wrapper\n * @part item-label - The label wrapper\n * @part item-end - The trailing content wrapper\n *\n * @example\n * ```html\n * <ore-sidebar-item href=\"/dashboard\" active>\n * <span slot=\"icon\">🏠</span>\n * Dashboard\n * </ore-sidebar-item>\n *\n * <ore-sidebar-item href=\"/users\">\n * <span slot=\"icon\">👤</span>\n * Users\n * <ore-badge slot=\"end\" color=\"primary\">3</ore-badge>\n * </ore-sidebar-item>\n * ```\n */\nexport const SIDEBAR_ITEM_TAG = 'ore-sidebar-item' as const;\ndefine<OreSidebarItemProps>(SIDEBAR_ITEM_TAG, {\n props: {\n active: prop.bool(false),\n 'bottom-nav': prop.bool(false),\n 'bottom-nav-label': prop.string(),\n disabled: prop.bool(false),\n href: prop.string(),\n label: prop.string(),\n rel: prop.string(),\n target: prop.string(),\n },\n setup(props) {\n const slots = useSlots();\n\n const hasIcon = () => slots.has('icon').value;\n const hasEnd = () => slots.has('end').value;\n const sidebarCtx = inject(SIDEBAR_CTX);\n\n bind({\n attr: {\n 'sidebar-bottom-nav': () =>\n sidebarCtx?.mode.value === 'bottom-nav' && !sidebarCtx?.mobileOpen.value ? true : undefined,\n 'sidebar-collapsed': () => (sidebarCtx?.collapsed.value ? true : undefined),\n },\n });\n\n const isLink = () => !!props.href.value && !props.disabled.value;\n\n // Prevent reverse tabnapping: auto-inject noopener + noreferrer for _blank links.\n const effectiveRel = computed(() => computeSafeRel(props.rel.value, props.target.value));\n const closeMobileOnSelect = (event: MouseEvent) => {\n if (!sidebarCtx?.closeOnSelect.value || !sidebarCtx.mobileOpen.value) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\n queueMicrotask(sidebarCtx.closeMobile);\n };\n\n const renderItemContent = () => html`\n <span class=\"item-icon\" part=\"item-icon\" ?hidden=${() => !hasIcon()} aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"item-label\" part=\"item-label\"><slot></slot></span>\n <span class=\"item-end\" part=\"item-end\" ?hidden=${() => !hasEnd()}>\n <slot name=\"end\"></slot>\n </span>\n `;\n\n return html`\n ${() => {\n if (isLink()) {\n return html`\n <a\n class=\"item\"\n part=\"item\"\n href=\"${props.href}\"\n rel=\"${effectiveRel}\"\n target=\"${props.target}\"\n aria-label=\"${props.label}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </a>\n `;\n }\n\n if (props.disabled.value) {\n return html`\n <div\n class=\"item\"\n part=\"item\"\n aria-disabled=\"true\"\n tabindex=\"-1\"\n aria-label=\"${props.label}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\">\n ${renderItemContent()}\n </div>\n `;\n }\n\n return html`\n <button\n class=\"item\"\n part=\"item\"\n type=\"button\"\n ?disabled=\"${props.disabled}\"\n aria-label=\"${props.label}\"\n aria-current=\"${() => (props.active.value ? 'page' : null)}\"\n @click=${closeMobileOnSelect}>\n ${renderItemContent()}\n </button>\n `;\n }}\n `;\n },\n styles: [coarsePointerMixin, itemStyles],\n});\n"],"mappings":";;;;;;;;;AAwCA,IAAM,KAAmB,MAAkD;CACzE,IAAM,IAAQ,OAAO,KAAS,EAAE,CAAC,CAAC,KAAK;CAEvC,IAAI,CAAC,GAAO;CAEZ,IAAM,IAAQ,2CAA2C,KAAK,CAAK;CAEnE,IAAI,CAAC,GAAO;CAEZ,IAAM,IAAS,OAAO,WAAW,EAAM,EAAE;CAEzC,OAAO,OAAO,SAAS,CAAM,IAAI,IAAS,KAAA;AAC5C,GAEM,KAA2B,MAAwC;CACvE,IAAI,IAAY,EAAG;CAEnB,OAAO,GAAW,QAAQ,YAAY,MAAM,kBAC1C,IAAY,EAAU;CAGxB,OAAO;AACT,GAEM,KAAsB,MAA4B;CACtD,IAAM,IAAc,EAAwB,CAAE,CAAC,EAAE,eAAe;CAIhE,OAFI,IAAc,IAAU,IAErB,EAAG;AACZ,GAEM,UAA8C;CAClD,IAAI,IAAS,SAAS;CAEtB,OAAO,GAAQ,YAAY,yBAAyB,cAClD,IAAS,EAAO,WAAW;CAG7B,OAAO;AACT,GAaa,IAAc,EAA8B,gBAAgB,GAoH5D,IAAc;AAC3B,EAAwB,GAAa;CACnC,OAAO;EACL,iBAAiB,EAAK,OAAO;EAC7B,mBAAmB,EAAK,KAAK,EAAK;EAClC,kBAAkB,EAAK,OAAO,kBAAkB;EAChD,WAAW,EAAK,KAAK,EAAK;EAC1B,aAAa,EAAK,KAAK,EAAK;EAC5B,yBAAyB,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