@kerfjs/ui 5.0.0-beta.61 → 5.0.0-beta.63

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 (191) hide show
  1. package/README.md +4 -0
  2. package/ai/component-catalog-extension.schema.json +13 -0
  3. package/ai/component-catalog.json +20 -7
  4. package/ai/component-composition.json +17 -3
  5. package/ai/components/list-item.md +1 -1
  6. package/ai/components/pane.md +3 -2
  7. package/ai/components/select.md +1 -0
  8. package/ai/components/toolbar-text.md +2 -1
  9. package/ai/components/workbench.md +3 -2
  10. package/ai/public-api-signatures-v1.md +162 -48
  11. package/ai/skill.md +11 -5
  12. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  13. package/analyzer/index.mjs +3 -2
  14. package/catalog-projection-cli.mjs +96 -0
  15. package/catalog-projection.d.mts +55 -0
  16. package/catalog-projection.mjs +62 -0
  17. package/dist/browser/catalog.js +1 -1
  18. package/dist/browser/collapsible-panel.js +2 -0
  19. package/dist/browser/nav-stack.js +1 -0
  20. package/dist/browser/split-view.js +1 -0
  21. package/dist/browser/toolbar-control-group.js +1 -0
  22. package/dist/browser/workbench.js +1 -0
  23. package/dist/catalog-resources.d.ts +1 -1
  24. package/dist/catalog.d.ts +1 -1
  25. package/dist/catalog.js +11 -10
  26. package/dist/catalog.js.map +1 -1
  27. package/dist/chip.d.ts +9 -3
  28. package/dist/chip.js +1 -1
  29. package/dist/{chunk-EZVNC4J6.js → chunk-3BYFWTP3.js} +7 -3
  30. package/dist/chunk-3BYFWTP3.js.map +1 -0
  31. package/dist/{chunk-5Q3N6EV7.js → chunk-5IJ6UGNZ.js} +3 -3
  32. package/dist/{chunk-5Q3N6EV7.js.map → chunk-5IJ6UGNZ.js.map} +1 -1
  33. package/dist/chunk-7AKGPBCC.js +76 -0
  34. package/dist/chunk-7AKGPBCC.js.map +1 -0
  35. package/dist/{chunk-KROD7KZK.js → chunk-AUVG54KC.js} +2 -2
  36. package/dist/{chunk-KROD7KZK.js.map → chunk-AUVG54KC.js.map} +1 -1
  37. package/dist/{chunk-AUKT3KMG.js → chunk-CQHN45XR.js} +17 -2
  38. package/dist/chunk-CQHN45XR.js.map +1 -0
  39. package/dist/{chunk-SWVW56CV.js → chunk-EN4LDR5Y.js} +2 -2
  40. package/dist/{chunk-SWVW56CV.js.map → chunk-EN4LDR5Y.js.map} +1 -1
  41. package/dist/{chunk-TEYARRAK.js → chunk-F7OCOBTG.js} +5 -2
  42. package/dist/chunk-F7OCOBTG.js.map +1 -0
  43. package/dist/{chunk-5PESG2VP.js → chunk-HXCMWANP.js} +6 -5
  44. package/dist/chunk-HXCMWANP.js.map +1 -0
  45. package/dist/{chunk-NYL63PSD.js → chunk-IA4D5XNT.js} +61 -10
  46. package/dist/chunk-IA4D5XNT.js.map +1 -0
  47. package/dist/{chunk-F4QMLOXJ.js → chunk-IAOAZUOO.js} +2 -2
  48. package/dist/{chunk-F4QMLOXJ.js.map → chunk-IAOAZUOO.js.map} +1 -1
  49. package/dist/{chunk-Y74NWGQW.js → chunk-KFYANKJI.js} +66 -22
  50. package/dist/chunk-KFYANKJI.js.map +1 -0
  51. package/dist/chunk-MOSIE4Z2.js +51 -0
  52. package/dist/chunk-MOSIE4Z2.js.map +1 -0
  53. package/dist/{chunk-7JUBXOIV.js → chunk-NXWE5S57.js} +25 -6
  54. package/dist/chunk-NXWE5S57.js.map +1 -0
  55. package/dist/{chunk-NNMLEDMD.js → chunk-OBAFAH5B.js} +36 -8
  56. package/dist/chunk-OBAFAH5B.js.map +1 -0
  57. package/dist/{chunk-A3CKOW2R.js → chunk-R75GGNWY.js} +123 -20
  58. package/dist/chunk-R75GGNWY.js.map +1 -0
  59. package/dist/chunk-RGS4WX2M.js +44 -0
  60. package/dist/chunk-RGS4WX2M.js.map +1 -0
  61. package/dist/{chunk-N3GKMPDW.js → chunk-RKTTF3L4.js} +3 -1
  62. package/dist/chunk-RKTTF3L4.js.map +1 -0
  63. package/dist/{chunk-RRB26JRJ.js → chunk-RTJNJTG3.js} +2 -2
  64. package/dist/{chunk-RRB26JRJ.js.map → chunk-RTJNJTG3.js.map} +1 -1
  65. package/dist/{chunk-EAC4CDY7.js → chunk-SMZGAPCU.js} +15 -2
  66. package/dist/chunk-SMZGAPCU.js.map +1 -0
  67. package/dist/{chunk-C4OYOKWX.js → chunk-UA6JW52D.js} +36 -2
  68. package/dist/chunk-UA6JW52D.js.map +1 -0
  69. package/dist/{chunk-3SXMEK3B.js → chunk-V3DX3K65.js} +1 -1
  70. package/dist/chunk-V3DX3K65.js.map +1 -0
  71. package/dist/{chunk-6ZXOQEAN.js → chunk-WF75U3V4.js} +7 -1
  72. package/dist/chunk-WF75U3V4.js.map +1 -0
  73. package/dist/{chunk-VCBTX62E.js → chunk-ZRWXFDDS.js} +2 -2
  74. package/dist/chunk-ZRWXFDDS.js.map +1 -0
  75. package/dist/collapsible-panel.d.ts +18 -7
  76. package/dist/collapsible-panel.js +19 -3
  77. package/dist/collapsible-panel.js.map +1 -1
  78. package/dist/content-item.d.ts +36 -5
  79. package/dist/content-item.js +1 -1
  80. package/dist/disclosure-arrow.js +2 -1
  81. package/dist/index.d.ts +3 -3
  82. package/dist/index.js +22 -22
  83. package/dist/list-action-row.js +1 -1
  84. package/dist/list-header.js +1 -1
  85. package/dist/list-item.js +1 -1
  86. package/dist/lucide-icon.d.ts +5 -2
  87. package/dist/lucide-icon.js +2 -1
  88. package/dist/nav-stack.d.ts +3 -1
  89. package/dist/nav-stack.js +2 -1
  90. package/dist/pane.d.ts +10 -4
  91. package/dist/pane.js +1 -1
  92. package/dist/{panel-toolbar-DqwtBxQL.d.ts → panel-toolbar-DDKh4uKd.d.ts} +11 -2
  93. package/dist/popup-menu-register.js +38 -1
  94. package/dist/popup-menu-register.js.map +1 -1
  95. package/dist/popup-menu.d.ts +2 -2
  96. package/dist/popup-menu.js +1 -1
  97. package/dist/select.d.ts +2 -0
  98. package/dist/select.js +1 -1
  99. package/dist/split-view.d.ts +1 -1
  100. package/dist/split-view.js +2 -1
  101. package/dist/split-view.js.map +1 -1
  102. package/dist/styles/app-tab.css +84 -0
  103. package/dist/styles/chip.css +14 -0
  104. package/dist/styles/content-item.css +36 -0
  105. package/dist/styles/list-action-row.css +4 -3
  106. package/dist/styles/list-header.css +4 -3
  107. package/dist/styles/list-item.css +21 -11
  108. package/dist/styles/lucide-icon.css +5 -0
  109. package/dist/styles/nav-stack.css +13 -0
  110. package/dist/styles/pane.css +36 -2
  111. package/dist/styles/popup-menu.css +15 -10
  112. package/dist/styles/resizable-region.css +9 -0
  113. package/dist/styles/select.css +26 -0
  114. package/dist/styles/split-view.css +6 -0
  115. package/dist/styles/sunken-panel.css +7 -0
  116. package/dist/styles/tab-bar.css +3 -0
  117. package/dist/styles/tab-scaffold.css +13 -0
  118. package/dist/styles/text.css +29 -0
  119. package/dist/styles/token-search-field.css +29 -6
  120. package/dist/styles/toolbar-control-group.css +35 -0
  121. package/dist/styles/toolbar-text.css +15 -6
  122. package/dist/styles/toolbar.css +7 -0
  123. package/dist/styles/workbench.css +260 -90
  124. package/dist/sunken-panel.d.ts +6 -1
  125. package/dist/sunken-panel.js +1 -1
  126. package/dist/tab-bar.d.ts +6 -2
  127. package/dist/tab-bar.js +1 -1
  128. package/dist/tab-scaffold.d.ts +3 -0
  129. package/dist/tab-scaffold.js +1 -0
  130. package/dist/tab-scaffold.js.map +1 -1
  131. package/dist/text.d.ts +14 -3
  132. package/dist/text.js +1 -1
  133. package/dist/token-search-field.js +2 -1
  134. package/dist/toolbar-control-group.d.ts +5 -1
  135. package/dist/toolbar-control-group.js +2 -1
  136. package/dist/toolbar-text.d.ts +1 -1
  137. package/dist/toolbar-text.js +1 -1
  138. package/dist/toolbar.d.ts +7 -4
  139. package/dist/toolbar.js +1 -1
  140. package/dist/wire-catalog.js +1 -1
  141. package/dist/wire-content-items.d.ts +9 -0
  142. package/dist/wire-content-items.js +62 -0
  143. package/dist/wire-content-items.js.map +1 -0
  144. package/dist/wire-tab-bars.js +1 -1
  145. package/dist/wire-token-search-fields.js +2 -1
  146. package/dist/wire-workbench.d.ts +7 -0
  147. package/dist/wire-workbench.js +1 -1
  148. package/dist/workbench.d.ts +24 -8
  149. package/dist/workbench.js +2 -1
  150. package/docs/accessibility.md +21 -5
  151. package/docs/catalog.md +36 -0
  152. package/docs/collapsible-panel.md +12 -4
  153. package/docs/component-contract.md +10 -4
  154. package/docs/component-selection.md +65 -15
  155. package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -1
  156. package/docs/design/templates/toolbar/title-and-actions.svg +1 -1
  157. package/docs/design/templates/toolbar-dark.svg +1 -1
  158. package/docs/design/templates/toolbar.svg +1 -1
  159. package/docs/examples/component-catalog-extension.json +6 -0
  160. package/docs/layout.md +61 -3
  161. package/docs/nav-stack.md +5 -0
  162. package/docs/split-view.md +5 -0
  163. package/docs/sunken-panel.md +30 -1
  164. package/docs/tab-scaffold.md +5 -0
  165. package/docs/ui-analyzer.md +4 -0
  166. package/docs/webawesome-theme.md +36 -6
  167. package/docs/workbench.md +60 -14
  168. package/llms.txt +12 -4
  169. package/package.json +16 -2
  170. package/scripts/component-catalog-extension-validation.mjs +28 -0
  171. package/dist/chunk-3SXMEK3B.js.map +0 -1
  172. package/dist/chunk-4R777DUZ.js +0 -34
  173. package/dist/chunk-4R777DUZ.js.map +0 -1
  174. package/dist/chunk-5PESG2VP.js.map +0 -1
  175. package/dist/chunk-6ZXOQEAN.js.map +0 -1
  176. package/dist/chunk-7JUBXOIV.js.map +0 -1
  177. package/dist/chunk-A3CKOW2R.js.map +0 -1
  178. package/dist/chunk-AUKT3KMG.js.map +0 -1
  179. package/dist/chunk-C4OYOKWX.js.map +0 -1
  180. package/dist/chunk-EAC4CDY7.js.map +0 -1
  181. package/dist/chunk-EZVNC4J6.js.map +0 -1
  182. package/dist/chunk-MA73TA6D.js +0 -42
  183. package/dist/chunk-MA73TA6D.js.map +0 -1
  184. package/dist/chunk-MERWRTBG.js +0 -45
  185. package/dist/chunk-MERWRTBG.js.map +0 -1
  186. package/dist/chunk-N3GKMPDW.js.map +0 -1
  187. package/dist/chunk-NNMLEDMD.js.map +0 -1
  188. package/dist/chunk-NYL63PSD.js.map +0 -1
  189. package/dist/chunk-TEYARRAK.js.map +0 -1
  190. package/dist/chunk-VCBTX62E.js.map +0 -1
  191. package/dist/chunk-Y74NWGQW.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/wire-tab-bars.ts"],"names":["target"],"mappings":";AAkCA,IAAM,mBAAA,GAAsB,EAAA;AAC5B,IAAM,6BAAA,GAAgC,GAAA;AACtC,IAAM,6BAAA,GAAgC,GAAA;AAE/B,SAAS,WAAA,CACd,KAAA,EACA,KAAA,EACA,QAAA,EACA,UACA,QAAA,EACK;AACL,EAAA,IAAI,QAAA,KAAa,QAAA,EAAU,OAAO,CAAC,GAAG,KAAK,CAAA;AAC3C,EAAA,MAAM,MAAA,GAAS,MAAM,IAAA,CAAK,CAAC,SAAS,KAAA,CAAM,IAAI,MAAM,QAAQ,CAAA;AAC5D,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,KAAA,CAAM,IAAA,CAAK,CAAC,IAAA,KAAS,KAAA,CAAM,IAAI,CAAA,KAAM,QAAQ,CAAA;AAC3D,IAAA,OAAO,CAAC,GAAG,KAAK,CAAA;AAClB,EAAA,MAAM,SAAA,GAAY,MAAM,MAAA,CAAO,CAAC,SAAS,KAAA,CAAM,IAAI,MAAM,QAAQ,CAAA;AACjE,EAAA,MAAM,WAAA,GAAc,UAAU,SAAA,CAAU,CAAC,SAAS,KAAA,CAAM,IAAI,MAAM,QAAQ,CAAA;AAC1E,EAAA,SAAA,CAAU,OAAO,WAAA,IAAe,QAAA,KAAa,UAAU,CAAA,GAAI,CAAA,CAAA,EAAI,GAAG,MAAM,CAAA;AACxE,EAAA,OAAO,SAAA;AACT;AAEA,SAAS,QAAQ,MAAA,EAAiD;AAChE,EAAA,OAAO,kBAAkB,OAAA,GACpB,MAAA,CAAO,OAAA,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A,CAAK,mBAAA,CAAoB,YAAY,UAAU,CAAA;AAC/C,IAAA,IAAA,CAAK,mBAAA,CAAoB,QAAQ,MAAM,CAAA;AACvC,IAAA,IAAA,CAAK,mBAAA,CAAoB,WAAW,KAAK,CAAA;AACzC,IAAA,IAAA,CAAK,mBAAA,CAAoB,WAAW,SAAS,CAAA;AAC7C,IAAA,IAAA,CAAK,mBAAA,CAAoB,WAAW,SAAS,CAAA;AAAA,EAC/C,CAAA;AACF","file":"chunk-C4OYOKWX.js","sourcesContent":["import type { TabActivation } from './tab-bar.js';\n\nexport type TabReorderSource = 'pointer' | 'keyboard';\nexport type TabDropPosition = 'before' | 'after';\n\nexport interface TabReorder {\n barId: string;\n sourceId: string;\n targetId: string;\n position: TabDropPosition;\n source: TabReorderSource;\n}\n\nexport type { TabActivation } from './tab-bar.js';\n\nexport interface WireTabBarsOptions {\n onReorder: (change: TabReorder) => void;\n /**\n * How arrow / Home / End keys activate tabs (default `'automatic'`):\n * - `'automatic'` moves roving focus **and** selects the focused tab (clicks it).\n * - `'manual'` moves roving focus only; the user selects with Enter / Space / click\n * (the ARIA Tabs manual-activation pattern). Use this when activation is a heavy or\n * side-effecting action (e.g. a tab that loads a project) so arrowing through the\n * strip doesn't trigger it on every tab.\n *\n * A per-bar `data-tab-activation=\"manual\" | \"automatic\"` attribute (see the `TabBar`\n * `activation` prop) overrides this option for that strip.\n */\n activation?: TabActivation;\n}\n\ntype TabRoot = HTMLElement;\ntype TabBarRoot = HTMLElement;\n\nconst AUTO_SCROLL_EDGE_PX = 56;\nconst AUTO_SCROLL_MIN_PX_PER_SECOND = 180;\nconst AUTO_SCROLL_MAX_PX_PER_SECOND = 900;\n\nexport function reorderTabs<T>(\n items: readonly T[],\n getId: (item: T) => string,\n sourceId: string,\n targetId: string,\n position: TabDropPosition,\n): T[] {\n if (sourceId === targetId) return [...items];\n const source = items.find((item) => getId(item) === sourceId);\n if (!source || !items.some((item) => getId(item) === targetId))\n return [...items];\n const remaining = items.filter((item) => getId(item) !== sourceId);\n const targetIndex = remaining.findIndex((item) => getId(item) === targetId);\n remaining.splice(targetIndex + (position === 'after' ? 1 : 0), 0, source);\n return remaining;\n}\n\nfunction tabRoot(target: EventTarget | null): TabRoot | undefined {\n return target instanceof Element\n ? (target.closest<TabRoot>('[data-component=\"app-tab\"]') ?? undefined)\n : undefined;\n}\n\nfunction tabBar(tab: TabRoot): TabBarRoot | undefined {\n return tab.closest<TabBarRoot>('[data-component=\"tab-bar\"]') ?? undefined;\n}\n\nfunction tabId(tab: TabRoot): string | undefined {\n return tab.dataset.tabId || undefined;\n}\n\nfunction barId(bar: TabBarRoot): string | undefined {\n return bar.dataset.tabBarId || undefined;\n}\n\nfunction positionFor(event: DragEvent, tab: TabRoot): TabDropPosition {\n const bounds = tab.getBoundingClientRect();\n return event.clientX < bounds.left + bounds.width / 2 ? 'before' : 'after';\n}\n\nfunction tabsIn(bar: TabBarRoot): HTMLButtonElement[] {\n return [\n ...bar.querySelectorAll<HTMLButtonElement>(\n '[data-kui-tab-list] [role=\"tab\"]',\n ),\n ];\n}\n\nfunction reveal(tab: HTMLElement | null | undefined): void {\n tab?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n if (\n tab\n ?.closest('[data-kui-tab-list]')\n ?.querySelector(':scope > .kui-app-tab[data-pinned=\"true\"]')\n )\n revealInStrip(tab);\n}\n\n/**\n * Scroll a tab's own strip, and nothing else, so the tab is fully visible.\n * Used for selection changes the application makes without focus (adding and\n * selecting a tab): unlike `scrollIntoView`, it never scrolls the page to a\n * bar that is out of view.\n */\nfunction revealInStrip(tab: HTMLElement): void {\n const strip = tab.closest<HTMLElement>('[data-kui-tab-list]');\n if (!strip || strip.scrollWidth <= strip.clientWidth) return;\n const bounds = strip.getBoundingClientRect();\n const box = tab.getBoundingClientRect();\n const pinned = strip.querySelector<HTMLElement>(\n ':scope > .kui-app-tab[data-pinned=\"true\"]',\n );\n if (pinned?.contains(tab)) return;\n const pinnedBox = pinned?.getBoundingClientRect();\n if (\n strip.ownerDocument.defaultView?.getComputedStyle(strip).direction === 'rtl'\n ) {\n const right = pinnedBox\n ? Math.min(bounds.right, pinnedBox.left)\n : bounds.right;\n if (box.right > right) strip.scrollLeft += box.right - right;\n else if (box.left < bounds.left)\n strip.scrollLeft -= Math.min(bounds.left - box.left, right - box.right);\n return;\n }\n const left = pinnedBox ? Math.max(bounds.left, pinnedBox.right) : bounds.left;\n if (box.left < left) strip.scrollLeft -= left - box.left;\n else if (box.right > bounds.right)\n strip.scrollLeft += Math.min(box.right - bounds.right, box.left - left);\n}\n\n/** The selected tab button of every bar below root, keyed by bar. */\nfunction selectedTabs(root: HTMLElement | Document) {\n const selected = new Map<TabBarRoot, HTMLElement>();\n root\n .querySelectorAll<HTMLElement>(\n '[data-kui-tab-list] [role=\"tab\"][aria-selected=\"true\"]',\n )\n .forEach((button) => {\n const tab = tabRoot(button);\n const bar = tab && tabBar(tab);\n if (bar && !selected.has(bar)) selected.set(bar, button);\n });\n return selected;\n}\n\n/** Wire reordering and keyboard navigation while leaving controlled state in the application. */\nexport function wireTabBars(\n root: HTMLElement | Document,\n { onReorder, activation = 'automatic' }: WireTabBarsOptions,\n): () => void {\n const ownerDocument = (\n root.nodeType === 9 ? (root as Document) : root.ownerDocument\n )!;\n const view = ownerDocument.defaultView!;\n let autoScroll:\n | {\n strip: HTMLElement;\n velocity: number;\n frame: number | undefined;\n previousTime: number | undefined;\n }\n | undefined;\n const stopAutoScroll = () => {\n if (!autoScroll) return;\n if (autoScroll.frame !== undefined)\n view.cancelAnimationFrame(autoScroll.frame);\n delete autoScroll.strip.dataset.tabAutoscroll;\n autoScroll = undefined;\n };\n const runAutoScroll = (time: number) => {\n const current = autoScroll;\n if (!current) return;\n current.frame = undefined;\n const elapsed =\n current.previousTime === undefined\n ? 1000 / 60\n : Math.min(40, Math.max(1, time - current.previousTime));\n current.previousTime = time;\n const maximum = Math.max(\n 0,\n current.strip.scrollWidth - current.strip.clientWidth,\n );\n const previous = current.strip.scrollLeft;\n current.strip.scrollLeft = Math.max(\n 0,\n Math.min(maximum, previous + (current.velocity * elapsed) / 1000),\n );\n if (current.strip.scrollLeft === previous) {\n stopAutoScroll();\n return;\n }\n current.frame = view.requestAnimationFrame(runAutoScroll);\n };\n const updateAutoScroll = (event: DragEvent, strip: HTMLElement) => {\n if (strip.scrollWidth <= strip.clientWidth) {\n stopAutoScroll();\n return;\n }\n const bounds = strip.getBoundingClientRect();\n const edge = Math.min(AUTO_SCROLL_EDGE_PX, bounds.width / 3);\n const startDistance = event.clientX - bounds.left;\n const endDistance = bounds.right - event.clientX;\n let direction = 0;\n let strength = 0;\n if (startDistance >= 0 && startDistance < edge) {\n direction = -1;\n strength = 1 - startDistance / edge;\n } else if (endDistance >= 0 && endDistance < edge) {\n direction = 1;\n strength = 1 - endDistance / edge;\n }\n if (direction === 0) {\n stopAutoScroll();\n return;\n }\n const maximum = Math.max(0, strip.scrollWidth - strip.clientWidth);\n if (\n (direction < 0 && strip.scrollLeft <= 0) ||\n (direction > 0 && strip.scrollLeft >= maximum)\n ) {\n stopAutoScroll();\n return;\n }\n const speed =\n AUTO_SCROLL_MIN_PX_PER_SECOND +\n (AUTO_SCROLL_MAX_PX_PER_SECOND - AUTO_SCROLL_MIN_PX_PER_SECOND) *\n strength *\n strength;\n if (autoScroll?.strip !== strip) stopAutoScroll();\n autoScroll ??= {\n strip,\n velocity: 0,\n frame: undefined,\n previousTime: undefined,\n };\n autoScroll.velocity = direction * speed;\n strip.dataset.tabAutoscroll = direction < 0 ? 'start' : 'end';\n autoScroll.frame ??= view.requestAnimationFrame(runAutoScroll);\n };\n let dragged: { barId: string; tabId: string } | undefined;\n const clearDropPositions = () =>\n root\n .querySelectorAll<HTMLElement>('[data-tab-drop-position]')\n .forEach((tab) => delete tab.dataset.tabDropPosition);\n const clear = () => {\n stopAutoScroll();\n dragged = undefined;\n root\n .querySelectorAll<HTMLElement>(\n '[data-tab-dragging], [data-tab-drop-position]',\n )\n .forEach((tab) => {\n delete tab.dataset.tabDragging;\n delete tab.dataset.tabDropPosition;\n });\n };\n let disposed = false;\n const afterControlledRender = (sourceBarId: string, sourceTabId: string) =>\n globalThis.queueMicrotask(() => {\n if (disposed) return;\n const tab = [\n ...root.querySelectorAll<TabRoot>('[data-component=\"app-tab\"]'),\n ].find((candidate) => {\n const candidateBar = tabBar(candidate);\n return (\n tabId(candidate) === sourceTabId &&\n candidateBar !== undefined &&\n barId(candidateBar) === sourceBarId\n );\n });\n const button = tab?.querySelector<HTMLButtonElement>('[role=\"tab\"]');\n button?.focus();\n reveal(button);\n });\n\n const onDragStart = (event: Event) => {\n const dragEvent = event as DragEvent;\n const tab = tabRoot(event.target);\n const bar = tab && tabBar(tab);\n const sourceId = tab && tabId(tab);\n const sourceBarId = bar && barId(bar);\n if (\n !tab ||\n tab.getAttribute('draggable') !== 'true' ||\n !sourceId ||\n !sourceBarId\n )\n return;\n dragged = { barId: sourceBarId, tabId: sourceId };\n tab.dataset.tabDragging = 'true';\n if (dragEvent.dataTransfer) {\n dragEvent.dataTransfer.effectAllowed = 'move';\n dragEvent.dataTransfer.setData(\n 'application/x-kerf-tab',\n `${sourceBarId}:${sourceId}`,\n );\n }\n };\n const onDragOver = (event: Event) => {\n const dragEvent = event as DragEvent;\n const tab = tabRoot(event.target);\n const bar =\n event.target instanceof Element\n ? (event.target.closest<TabBarRoot>('[data-component=\"tab-bar\"]') ??\n undefined)\n : undefined;\n const targetId = tab && tabId(tab);\n const targetBarId = bar && barId(bar);\n if (!dragged || !bar || targetBarId !== dragged.barId) {\n stopAutoScroll();\n clearDropPositions();\n return;\n }\n dragEvent.preventDefault();\n const strip = bar.querySelector<HTMLElement>('[data-kui-tab-list]');\n if (strip) updateAutoScroll(dragEvent, strip);\n else stopAutoScroll();\n clearDropPositions();\n if (!tab || !targetId || targetId === dragged.tabId) return;\n tab.dataset.tabDropPosition = positionFor(dragEvent, tab);\n if (dragEvent.dataTransfer) dragEvent.dataTransfer.dropEffect = 'move';\n };\n const onDrop = (event: Event) => {\n const dragEvent = event as DragEvent;\n const tab = tabRoot(event.target);\n const bar = tab && tabBar(tab);\n const targetId = tab && tabId(tab);\n const targetBarId = bar && barId(bar);\n if (\n !dragged ||\n !tab ||\n !targetId ||\n targetId === dragged.tabId ||\n targetBarId !== dragged.barId\n ) {\n clear();\n return;\n }\n dragEvent.preventDefault();\n const change: TabReorder = {\n barId: dragged.barId,\n sourceId: dragged.tabId,\n targetId,\n position: positionFor(dragEvent, tab),\n source: 'pointer',\n };\n clear();\n onReorder(change);\n afterControlledRender(change.barId, change.sourceId);\n };\n const onKeyDown = (event: Event) => {\n const keyboardEvent = event as KeyboardEvent;\n const button =\n event.target instanceof Element\n ? event.target.closest<HTMLButtonElement>('[role=\"tab\"]')\n : null;\n const tab = button && tabRoot(button);\n const bar = tab && tabBar(tab);\n if (!button || !tab || !bar) return;\n if (keyboardEvent.key === 'Delete' || keyboardEvent.key === 'Backspace') {\n const close = tab.querySelector<HTMLButtonElement>('.kui-app-tab__close');\n if (!close) return;\n keyboardEvent.preventDefault();\n close.click();\n return;\n }\n const tabs = tabsIn(bar);\n const current = tabs.indexOf(button);\n if (current < 0) return;\n if (\n keyboardEvent.altKey &&\n keyboardEvent.shiftKey &&\n (keyboardEvent.key === 'ArrowLeft' || keyboardEvent.key === 'ArrowRight')\n ) {\n const target =\n tabs[current + (keyboardEvent.key === 'ArrowLeft' ? -1 : 1)];\n const sourceId = tabId(tab);\n const targetRoot = target && tabRoot(target);\n const targetId = targetRoot && tabId(targetRoot);\n const sourceBarId = barId(bar);\n if (\n !target ||\n !sourceId ||\n !targetId ||\n !sourceBarId ||\n tab.getAttribute('draggable') !== 'true'\n )\n return;\n keyboardEvent.preventDefault();\n onReorder({\n barId: sourceBarId,\n sourceId,\n targetId,\n position: keyboardEvent.key === 'ArrowLeft' ? 'before' : 'after',\n source: 'keyboard',\n });\n afterControlledRender(sourceBarId, sourceId);\n return;\n }\n let next: number | undefined;\n if (keyboardEvent.key === 'ArrowRight') next = (current + 1) % tabs.length;\n else if (keyboardEvent.key === 'ArrowLeft')\n next = (current - 1 + tabs.length) % tabs.length;\n else if (keyboardEvent.key === 'Home') next = 0;\n else if (keyboardEvent.key === 'End') next = tabs.length - 1;\n if (next === undefined) return;\n keyboardEvent.preventDefault();\n // A per-bar data-tab-activation attribute overrides the wireTabBars option.\n const perBar = bar.dataset.tabActivation;\n const mode: TabActivation =\n perBar === 'manual' || perBar === 'automatic' ? perBar : activation;\n const target = tabs[next]!;\n target.focus();\n // Manual activation moves roving focus only; the user selects with Enter / Space\n // (native on the tab <button>) or click. Automatic also selects the focused tab.\n if (mode === 'automatic') {\n target.click();\n // Activation can synchronously replace the controlled strip. Resolve the\n // logical tab again after rendering instead of leaving focus on a dead node.\n if (!target.isConnected)\n afterControlledRender(\n bar.dataset.tabBarId!,\n tabRoot(target)!.dataset.tabId!,\n );\n }\n reveal(target);\n };\n const onFocusIn = (event: Event) => {\n const tab =\n event.target instanceof HTMLElement &&\n event.target.matches('[role=\"tab\"]')\n ? event.target\n : undefined;\n reveal(tab);\n };\n\n root.addEventListener('dragstart', onDragStart);\n root.addEventListener('dragover', onDragOver);\n root.addEventListener('drop', onDrop);\n root.addEventListener('dragend', clear);\n root.addEventListener('keydown', onKeyDown);\n root.addEventListener('focusin', onFocusIn);\n root\n .querySelectorAll<HTMLElement>(\n '[data-kui-tab-list] [role=\"tab\"][aria-selected=\"true\"]',\n )\n .forEach(reveal);\n\n // Reveal a tab the application selects without focus (for example a tab it\n // adds and selects) once its controlled render lands. Only a change of a\n // bar's selected tab reveals, so a re-render that keeps the selection never\n // pulls a strip the user scrolled back to it.\n const selectedIds = new Map<string, string>();\n const recordSelection = () => {\n const changed: HTMLElement[] = [];\n for (const [bar, button] of selectedTabs(root)) {\n const id = barId(bar);\n const tab = tabRoot(button);\n const selectedId = tab && tabId(tab);\n if (!id || !selectedId) continue;\n if (selectedIds.has(id) && selectedIds.get(id) !== selectedId)\n changed.push(button);\n selectedIds.set(id, selectedId);\n }\n return changed;\n };\n recordSelection();\n const selectionObserver = new view.MutationObserver(() => {\n if (disposed) return;\n for (const button of recordSelection())\n if (ownerDocument.activeElement !== button) revealInStrip(button);\n });\n selectionObserver.observe(root, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['aria-selected'],\n });\n\n return () => {\n disposed = true;\n selectionObserver.disconnect();\n clear();\n root.removeEventListener('dragstart', onDragStart);\n root.removeEventListener('dragover', onDragOver);\n root.removeEventListener('drop', onDrop);\n root.removeEventListener('dragend', clear);\n root.removeEventListener('keydown', onKeyDown);\n root.removeEventListener('focusin', onFocusIn);\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/chip.tsx"],"names":[],"mappings":";;;AAgCO,SAAS,IAAA,CAAK;AAAA,EACnB,QAAA;AAAA,EACA,IAAA,GAAO,SAAA;AAAA,EACP,UAAA,GAAa,OAAA;AAAA,EACb,KAAA,GAAQ,MAAA;AAAA,EACR,IAAA,GAAO,SAAA;AAAA,EACP,QAAA,GAAW,KAAA;AAAA,EACX,MAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAc;AACZ,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,CAAA,SAAA,EAAY,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MACpC,gBAAA,EAAe,MAAA;AAAA,MACf,WAAA,EAAW,IAAA;AAAA,MACX,iBAAA,EAAiB,UAAA;AAAA,MACjB,YAAA,EAAY,KAAA;AAAA,MACZ,WAAA,EAAW,IAAA;AAAA,MACX,eAAA,EAAe,WAAW,EAAA,GAAK,MAAA;AAAA,MAC/B,cAAA,EAAc,MAAA;AAAA,MACd,IAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,iBAAA,EAAmB,QAAA,EAAS,CAAA;AAAA,QACvC,MAAA,CAAO,iBAAiB,MAAA,mBACvB,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,kBAAA;AAAA,YACN,IAAA,EAAK,QAAA;AAAA,YACL,eAAa,MAAA,CAAO,YAAA;AAAA,YACpB,cAAY,MAAA,CAAO,WAAA;AAAA,YACnB,QAAA;AAAA,YAEA,QAAA,kBAAA,GAAA,CAAC,SAAI,OAAA,EAAQ,WAAA,EAAY,OAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,aAAA,EAAY,MAAA,EAC1D,QAAA,kBAAA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,CAAA,EAAE,sCAAA;AAAA,gBACF,IAAA,EAAK,MAAA;AAAA,gBACL,MAAA,EAAO,cAAA;AAAA,gBACP,cAAA,EAAa,MAAA;AAAA,gBACb,gBAAA,EAAe;AAAA;AAAA,aACjB,EACF;AAAA;AAAA,SACF,GACE;AAAA;AAAA;AAAA,GACN;AAEJ","file":"chunk-EAC4CDY7.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport type {\n BadgeAppearance,\n BadgeShape,\n BadgeSize,\n BadgeTone,\n} from './badge.js';\n\ninterface ChipCommonProps {\n /** Visible, non-interactive chip content. */\n children: SafeHtml | string | number;\n tone?: BadgeTone;\n appearance?: BadgeAppearance;\n shape?: BadgeShape;\n size?: BadgeSize;\n disabled?: boolean;\n /** Record identifier available to an application delegated action handler. */\n itemId?: string;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/** A removable chip needs both a delegated action and a specific accessible name. */\nexport type ChipProps = ChipCommonProps &\n (\n | { removeAction: string; removeLabel: string }\n | { removeAction?: never; removeLabel?: never }\n );\n\n/** A short label with an optional native remove button. The application owns removal. */\nexport function Chip({\n children,\n tone = 'neutral',\n appearance = 'quiet',\n shape = 'pill',\n size = 'default',\n disabled = false,\n itemId,\n className = '',\n slot,\n ...remove\n}: ChipProps) {\n return (\n <span\n class={`kui-chip ${className}`.trim()}\n data-component=\"chip\"\n data-tone={tone}\n data-appearance={appearance}\n data-shape={shape}\n data-size={size}\n data-disabled={disabled ? '' : undefined}\n data-item-id={itemId}\n slot={slot}\n >\n <span class=\"kui-chip__label\">{children}</span>\n {remove.removeAction !== undefined ? (\n <button\n class=\"kui-chip__remove\"\n type=\"button\"\n data-action={remove.removeAction}\n aria-label={remove.removeLabel}\n disabled={disabled}\n >\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path\n d=\"M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n </span>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/pane.tsx"],"names":[],"mappings":";;;AAgBA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,uBAAA;AAAA,EACA,sBAAA;AAAA,EACA,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA,2BAAA;AAAA,EACA,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,YAAA,GAA6C;AAAA,EACjD,aAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAiGA,SAAS,WAAA,CACP,OAAA,EACA,QAAA,EACA,SAAA,EACA,KAAA,EACA;AACA,EAAA,MAAM,UAAA,GAAa;AAAA,IACjB,KAAA,EAAO,CAAA,8BAAA,EAAiC,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,IACzD,YAAA,EAAc;AAAA,GAChB;AACA,EAAA,IAAI,YAAY,MAAA,EAAQ,2BAAQ,MAAA,EAAA,EAAM,GAAG,YAAa,QAAA,EAAS,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YAAA,EAAc,KAAA;AAAA,IACd;AAAA,GACF;AAEA,EAAA,IAAI,YAAY,SAAA,EAAW,2BAAQ,SAAA,EAAA,EAAS,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACjE,EAAA,IAAI,YAAY,OAAA,EAAS,2BAAQ,OAAA,EAAA,EAAO,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAC7D,EAAA,IAAI,YAAY,MAAA,EAAQ,2BAAQ,MAAA,EAAA,EAAM,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAC3D,EAAA,IAAI,YAAY,SAAA,EAAW,2BAAQ,SAAA,EAAA,EAAS,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACjE,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,UAAA,EAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACpC","file":"chunk-EZVNC4J6.js","sourcesContent":["import { filterDataAttributes } from './extension-attributes.js';\nimport type { KerfUiContent } from './semantic-content.js';\n\n/**\n * Logical pane sides: where a {@link Pane} can show a separator and where it can\n * compensate for a device safe-area inset.\n */\nexport type PaneSeparatorSide =\n 'block-start' | 'block-end' | 'inline-start' | 'inline-end';\n\n/** Semantic root elements supported by {@link Pane}. */\nexport type PaneElement = 'article' | 'aside' | 'div' | 'main' | 'section';\n\n/** Semantic elements supported by the scrolling content slot. */\nexport type PaneContentElement = 'div' | 'main' | 'nav' | 'section';\n\nconst paneProtectedAttributes = new Set([\n 'data-component',\n 'data-chrome-placement',\n 'data-chrome-dividers',\n 'data-separator-block-start',\n 'data-separator-block-end',\n 'data-separator-inline-start',\n 'data-separator-inline-end',\n 'data-safe-area-block-start',\n 'data-safe-area-block-end',\n 'data-safe-area-inline-start',\n 'data-safe-area-inline-end',\n]);\n\nconst allPaneSides: readonly PaneSeparatorSide[] = [\n 'block-start',\n 'block-end',\n 'inline-start',\n 'inline-end',\n];\n\ntype PaneRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-separator-block-start'?: never;\n 'data-separator-block-end'?: never;\n 'data-separator-inline-start'?: never;\n 'data-separator-inline-end'?: never;\n 'data-safe-area-block-start'?: never;\n 'data-safe-area-block-end'?: never;\n 'data-safe-area-inline-start'?: never;\n 'data-safe-area-inline-end'?: never;\n 'data-chrome-placement'?: never;\n 'data-chrome-dividers'?: never;\n }\n>;\n\n/** How a Pane's header and footer relate to its scrolling content. */\nexport type PaneChromePlacement = 'fixed' | 'auto';\n\n/**\n * When a Pane draws the divider between its pinned header or footer and its\n * scrolling content: `scroll` while content is scrolled away beneath that\n * chrome, as `wireScrollDividers` reports; `always`; or `none`.\n */\nexport type PaneChromeDividers = 'scroll' | 'always' | 'none';\n\nexport interface PaneProps {\n /** Optional fixed chrome above the scrolling content, arranged vertically. */\n header?: KerfUiContent;\n /** The pane's primary vertical, scrolling content stack. */\n children?: KerfUiContent;\n /** Optional fixed chrome below the scrolling content. */\n footer?: KerfUiContent;\n /**\n * Whether the header and footer stay pinned around the scrolling content.\n * `fixed` (default) always pins them. `auto` pins them while the pane is\n * tall enough, and below 480px of height (30rem, so it scales with the text\n * size) lets the whole pane scroll as one column, so tall chrome can never\n * squeeze the content to nothing.\n */\n chromePlacement?: PaneChromePlacement;\n /**\n * The divider under the header and over the footer, where they meet the\n * scrolling content. `scroll` (default) shows the header's divider only\n * while the content is scrolled down, and the footer's only while more\n * content lies below — never when the content fits — once\n * `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above\n * the pane; unwired, neither shows. `always` shows both; `none` neither.\n * The line is drawn inside the chrome, so no state moves the content.\n */\n chromeDividers?: PaneChromeDividers;\n /** Root semantics. Defaults to `div`. */\n element?: PaneElement;\n /** Scrolling content semantics. Defaults to `div`. */\n contentElement?: PaneContentElement;\n /** Independent logical-edge separator lines. Defaults to none. */\n separators?: readonly PaneSeparatorSide[];\n /**\n * Sides on which the pane may compensate for a device safe-area inset.\n * Defaults to every side: the pane pads its slots for each side that still\n * reaches an unsafe screen edge, as its surrounding layout reports, while its\n * background and separators paint through. List only the sides an app-owned\n * layout places at a screen edge, or pass `[]` to opt out.\n */\n safeAreaEdges?: readonly PaneSeparatorSide[];\n id?: string;\n /** Accessible name for a landmark root such as `aside` or `main`. */\n label?: string;\n /** Accessible name for a landmark scrolling slot such as `nav`. */\n contentLabel?: string;\n className?: string;\n headerClassName?: string;\n contentClassName?: string;\n footerClassName?: string;\n /** Safe `data-*` metadata; Pane-owned structural attributes remain protected. */\n rootAttributes?: PaneRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * A pane's configuration, apart from its content and styling hooks: the props a\n * composite that renders a `Pane` for the app (a Workbench panel or work area,\n * or a CollapsiblePanel) forwards, so the app configures that pane instead of\n * styling it. An omitted or `undefined` field keeps the composite's default.\n */\nexport type PaneConfig = Pick<\n PaneProps,\n | 'contentElement'\n | 'contentLabel'\n | 'separators'\n | 'safeAreaEdges'\n | 'chromeDividers'\n>;\n\nfunction paneContent(\n element: PaneContentElement,\n children: KerfUiContent,\n className: string,\n label: string | undefined,\n) {\n const attributes = {\n class: `kui-pane__content kui-content ${className}`.trim(),\n 'aria-label': label,\n };\n if (element === 'main') return <main {...attributes}>{children}</main>;\n if (element === 'nav') return <nav {...attributes}>{children}</nav>;\n if (element === 'section')\n return <section {...attributes}>{children}</section>;\n return <div {...attributes}>{children}</div>;\n}\n\n/**\n * An unpadded application column with optional fixed header/footer slots and one\n * scrolling vertical content owner. Separator lines are independently opt-in on\n * each logical edge, so the same component works as a sidebar, main area,\n * inspector, or dialog column.\n */\nexport function Pane({\n header,\n children,\n footer,\n chromePlacement = 'fixed',\n chromeDividers = 'scroll',\n element = 'div',\n contentElement = 'div',\n separators = [],\n safeAreaEdges = allPaneSides,\n id,\n label,\n contentLabel,\n className = '',\n headerClassName = '',\n contentClassName = '',\n footerClassName = '',\n rootAttributes = {},\n slot,\n}: PaneProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n paneProtectedAttributes,\n );\n const content = paneContent(\n contentElement,\n children,\n contentClassName,\n contentLabel,\n );\n const body = (\n <>\n {header === undefined ? null : (\n <header\n class={`kui-pane__header kui-pane__toolbar ${headerClassName}`.trim()}\n >\n {header}\n </header>\n )}\n {content}\n {footer === undefined ? null : (\n <footer class={`kui-pane__footer ${footerClassName}`.trim()}>\n {footer}\n </footer>\n )}\n </>\n );\n const attributes = {\n ...safeRootAttributes,\n class: `kui-pane ${className}`.trim(),\n id,\n 'data-component': 'pane',\n 'data-chrome-placement': chromePlacement === 'auto' ? 'auto' : undefined,\n 'data-chrome-dividers':\n chromeDividers === 'always' || chromeDividers === 'none'\n ? chromeDividers\n : undefined,\n 'data-separator-block-start': String(separators.includes('block-start')),\n 'data-separator-block-end': String(separators.includes('block-end')),\n 'data-separator-inline-start': String(separators.includes('inline-start')),\n 'data-separator-inline-end': String(separators.includes('inline-end')),\n 'data-safe-area-block-start': String(safeAreaEdges.includes('block-start')),\n 'data-safe-area-block-end': String(safeAreaEdges.includes('block-end')),\n 'data-safe-area-inline-start': String(\n safeAreaEdges.includes('inline-start'),\n ),\n 'data-safe-area-inline-end': String(safeAreaEdges.includes('inline-end')),\n 'aria-label': label,\n slot,\n };\n\n if (element === 'article') return <article {...attributes}>{body}</article>;\n if (element === 'aside') return <aside {...attributes}>{body}</aside>;\n if (element === 'main') return <main {...attributes}>{body}</main>;\n if (element === 'section') return <section {...attributes}>{body}</section>;\n return <div {...attributes}>{body}</div>;\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { filterDataAttributes } from './chunk-SRSJO5QE.js';
2
- import { jsx } from 'kerfjs/jsx-runtime';
3
-
4
- var contentItemProtectedAttributes = /* @__PURE__ */ new Set(["data-component"]);
5
- function ContentItem({
6
- children,
7
- frame = "none",
8
- shape = "rounded",
9
- ariaLabel,
10
- focusTarget = false,
11
- className = "",
12
- rootAttributes = {},
13
- slot
14
- }) {
15
- const safeRootAttributes = filterDataAttributes(
16
- rootAttributes,
17
- contentItemProtectedAttributes
18
- );
19
- const cls = [
20
- "kui-content-item",
21
- shape === "pill" ? "kui-content-item--pill" : "",
22
- frame === "framed" ? "kui-content-item--framed" : "",
23
- className
24
- ].filter(Boolean).join(" ");
25
- return /* @__PURE__ */ jsx(
26
- "div",
27
- {
28
- ...safeRootAttributes,
29
- class: cls,
30
- "data-component": "content-item",
31
- role: ariaLabel ? "region" : void 0,
32
- "aria-label": ariaLabel,
33
- tabindex: focusTarget ? "-1" : void 0,
34
- slot,
35
- children
36
- }
37
- );
38
- }
39
-
40
- export { ContentItem };
41
-
42
- //# sourceMappingURL=chunk-MA73TA6D.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/content-item.tsx"],"names":[],"mappings":";;;AASA,IAAM,8BAAA,mBAAiC,IAAI,GAAA,CAAI,CAAC,gBAAgB,CAAC,CAAA;AA0C1D,SAAS,WAAA,CAAY;AAAA,EAC1B,QAAA;AAAA,EACA,KAAA,GAAQ,MAAA;AAAA,EACR,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA;AAAA,EACA,WAAA,GAAc,KAAA;AAAA,EACd,SAAA,GAAY,EAAA;AAAA,EACZ,iBAAiB,EAAC;AAAA,EAClB;AACF,CAAA,EAAqB;AACnB,EAAA,MAAM,kBAAA,GAAqB,oBAAA;AAAA,IACzB,cAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,GAAA,GAAM;AAAA,IACV,kBAAA;AAAA,IACA,KAAA,KAAU,SAAS,wBAAA,GAA2B,EAAA;AAAA,IAC9C,KAAA,KAAU,WAAW,0BAAA,GAA6B,EAAA;AAAA,IAClD;AAAA,GACF,CACG,MAAA,CAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AACX,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,kBAAA;AAAA,MACJ,KAAA,EAAO,GAAA;AAAA,MACP,gBAAA,EAAe,cAAA;AAAA,MACf,IAAA,EAAM,YAAY,QAAA,GAAW,MAAA;AAAA,MAC7B,YAAA,EAAY,SAAA;AAAA,MACZ,QAAA,EAAU,cAAc,IAAA,GAAO,MAAA;AAAA,MAC/B,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-MA73TA6D.js","sourcesContent":["import { filterDataAttributes } from './extension-attributes.js';\nimport type { KerfUiContent } from './semantic-content.js';\n\n/** Whether the item's always-reserved 1px border is transparent or visible. */\nexport type ContentItemFrame = 'none' | 'framed';\n\n/** Corner shape: the 12px rounded rectangle or the 22px pill. */\nexport type ContentItemShape = 'rounded' | 'pill';\n\nconst contentItemProtectedAttributes = new Set(['data-component']);\n\ntype ContentItemRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n }\n>;\n\nexport interface ContentItemProps {\n /** Item content; a plain string is allowed for bare copy. */\n children?: KerfUiContent | string;\n /**\n * `framed` paints the standard neutral border in the 1px the item always\n * reserves, so framing never changes geometry. Frame only an item that\n * marks a real distinction. Defaults to `none` (transparent border).\n */\n frame?: ContentItemFrame;\n /** Corner shape. Defaults to `rounded`. */\n shape?: ContentItemShape;\n /**\n * Names the item as a distinct region (`role=\"region\"`). Omit it for an\n * ordinary item, which stays a non-landmark grouping.\n */\n ariaLabel?: string;\n /**\n * Makes the item a programmatic focus target (`tabindex=\"-1\"`, never a tab\n * stop), for example the preferred initial focus of a NavStack view when\n * combined with `data-nav-focus` in `rootAttributes`.\n */\n focusTarget?: boolean;\n className?: string;\n /** Safe `data-*` metadata; component-owned structural attributes stay protected. */\n rootAttributes?: ContentItemRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * One self-contained `.kui-content` child: an 8px inline margin, a real 1px\n * border (transparent unless `framed`), 8px padding, and a rounded or pill\n * radius. It owns that whole geometry, so wrappers must not add more.\n */\nexport function ContentItem({\n children,\n frame = 'none',\n shape = 'rounded',\n ariaLabel,\n focusTarget = false,\n className = '',\n rootAttributes = {},\n slot,\n}: ContentItemProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n contentItemProtectedAttributes,\n );\n const cls = [\n 'kui-content-item',\n shape === 'pill' ? 'kui-content-item--pill' : '',\n frame === 'framed' ? 'kui-content-item--framed' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div\n {...safeRootAttributes}\n class={cls}\n data-component=\"content-item\"\n role={ariaLabel ? 'region' : undefined}\n aria-label={ariaLabel}\n tabindex={focusTarget ? '-1' : undefined}\n slot={slot}\n >\n {children}\n </div>\n );\n}\n"]}
@@ -1,45 +0,0 @@
1
- import { jsxs, jsx } from 'kerfjs/jsx-runtime';
2
-
3
- // src/toolbar.tsx
4
- var claim = (edges, side) => edges?.includes(side) ? "true" : void 0;
5
- function Toolbar({
6
- leading,
7
- center,
8
- trailing,
9
- label,
10
- dividerSides = "",
11
- centerAlign = "center",
12
- responsive = "none",
13
- responsiveAt = "narrow",
14
- safeAreaEdges,
15
- className = "",
16
- slot
17
- }) {
18
- return /* @__PURE__ */ jsxs(
19
- "header",
20
- {
21
- class: `kui-toolbar ${className}`.trim(),
22
- "data-component": "toolbar",
23
- "divider-sides": dividerSides || void 0,
24
- "data-has-center": String(Boolean(center)),
25
- "data-center-align": centerAlign,
26
- "data-responsive": responsive,
27
- "data-responsive-at": responsiveAt,
28
- "data-safe-area-block-start": claim(safeAreaEdges, "block-start"),
29
- "data-safe-area-block-end": claim(safeAreaEdges, "block-end"),
30
- "data-safe-area-inline-start": claim(safeAreaEdges, "inline-start"),
31
- "data-safe-area-inline-end": claim(safeAreaEdges, "inline-end"),
32
- "aria-label": label,
33
- slot,
34
- children: [
35
- /* @__PURE__ */ jsx("div", { class: "kui-toolbar__leading", children: leading }),
36
- /* @__PURE__ */ jsx("div", { class: "kui-toolbar__center", children: center }),
37
- /* @__PURE__ */ jsx("div", { class: "kui-toolbar__trailing", children: trailing })
38
- ]
39
- }
40
- );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,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,sBAAA,EAAwB,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,wBAC3C,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,qBAAA,EAAuB,QAAA,EAAA,MAAA,EAAO,CAAA;AAAA,wBACzC,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,uBAAA,EAAyB,QAAA,EAAA,QAAA,EAAS;AAAA;AAAA;AAAA,GAC/C;AAEJ","file":"chunk-MERWRTBG.js","sourcesContent":["import type { PaneSeparatorSide } from './pane.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport type { Sides } from './sides.js';\n\nexport interface ToolbarProps {\n leading?: KerfUiContent;\n center?: KerfUiContent;\n trailing?: KerfUiContent;\n label?: string;\n /**\n * Physical divider edges in canonical top/right/bottom/left order, drawn\n * always. Defaults to none: a toolbar pinned over or under scrolling content\n * gets its divider from the scroll state instead — a `Pane` draws the line\n * between its chrome and content while content is scrolled away beneath it,\n * and `wireScrollDividers` `targets` can name a toolbar as chrome, which\n * then draws its facing side the same way.\n */\n dividerSides?: Sides;\n /** Horizontal treatment of the center zone. Defaults to centered content. */\n centerAlign?: 'center' | 'stretch';\n /**\n * Component-owned responsive layout; applications choose the policy rather\n * than restyling toolbar internals. Under every policy the trailing zone\n * wraps its groups instead of clipping an action, and the center zone keeps\n * its whole content width: when the zones do not fit one row, the leading\n * title truncates with an ellipsis rather than the center overlapping it.\n * - `none` keeps one row; the leading identity truncates first.\n * - `stack` stacks the zones at `responsiveAt`, wrapping stacked control\n * groups onto further rows.\n * - `wrap` keeps one row while every zone fits at its natural width, and\n * otherwise moves the trailing zone below a whole leading identity.\n * - `center-priority` gives an expanded center control the full row.\n * - `trailing-priority` moves an expanded trailing control to a full row\n * below the leading identity at `responsiveAt`.\n */\n responsive?:\n 'none' | 'stack' | 'wrap' | 'center-priority' | 'trailing-priority';\n /** Container width at which `stack` or `trailing-priority` activates. */\n responsiveAt?: 'compact' | 'narrow';\n /**\n * Screen edges this toolbar claims for device safe-area compensation, for an\n * app bar or bottom bar that sits directly at a screen edge rather than in a\n * Pane header or footer. Each listed side pads by the inset its surrounding\n * layout reports through `--kui-edge-inset-*`, or the full device inset when\n * nothing routes that edge, while the toolbar's box and dividers paint\n * through. Omitted, the toolbar pads only the inline edges an owner such as\n * a Pane header hands it, and never a block edge.\n */\n safeAreaEdges?: readonly PaneSeparatorSide[];\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * A toolbar's configuration, apart from its content: the props a composite\n * that renders a `Toolbar` for the app (a Workbench or CollapsiblePanel\n * toolbar) forwards, so the app configures that toolbar instead of styling it.\n */\nexport type ToolbarConfig = Pick<\n ToolbarProps,\n | 'dividerSides'\n | 'centerAlign'\n | 'responsive'\n | 'responsiveAt'\n | 'safeAreaEdges'\n>;\n\nconst claim = (\n edges: readonly PaneSeparatorSide[] | undefined,\n side: PaneSeparatorSide,\n) => (edges?.includes(side) ? 'true' : undefined);\n\nexport function Toolbar({\n leading,\n center,\n trailing,\n label,\n dividerSides = '',\n centerAlign = 'center',\n responsive = 'none',\n responsiveAt = 'narrow',\n safeAreaEdges,\n className = '',\n slot,\n}: ToolbarProps) {\n return (\n <header\n class={`kui-toolbar ${className}`.trim()}\n data-component=\"toolbar\"\n divider-sides={dividerSides || undefined}\n data-has-center={String(Boolean(center))}\n data-center-align={centerAlign}\n data-responsive={responsive}\n data-responsive-at={responsiveAt}\n data-safe-area-block-start={claim(safeAreaEdges, 'block-start')}\n data-safe-area-block-end={claim(safeAreaEdges, 'block-end')}\n data-safe-area-inline-start={claim(safeAreaEdges, 'inline-start')}\n data-safe-area-inline-end={claim(safeAreaEdges, 'inline-end')}\n aria-label={label}\n slot={slot}\n >\n <div class=\"kui-toolbar__leading\">{leading}</div>\n <div class=\"kui-toolbar__center\">{center}</div>\n <div class=\"kui-toolbar__trailing\">{trailing}</div>\n </header>\n );\n}\n\nexport type { Sides } from './s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A,EAAI,KAAA,EAAM,oBAAoB,QAAA,EAAA,GAAA,EAAI;AAAA;AAAA;AAAA,GAC7C;AAEJ","file":"chunk-N3GKMPDW.js","sourcesContent":["import type { KerfUiContent } from './semantic-content.js';\n\nexport type TabActivation = 'automatic' | 'manual';\nexport type TabBarAllocation = 'intrinsic' | 'fill';\nexport type TabBarPresentation = 'rail' | 'segmented' | 'inspector';\nexport type TabBarTrailingPlacement = 'separate' | 'adjacent';\n\nexport interface TabBarProps {\n id: string;\n label: string;\n children: KerfUiContent;\n leading?: KerfUiContent;\n trailing?: KerfUiContent;\n /**\n * Action pinned to the far edge of the bar. Combine with an adjacent `trailing`\n * action when the tab-local and workspace-level actions must remain distinct.\n */\n end?: KerfUiContent;\n className?: string;\n /**\n * Keyboard activation mode for this strip, emitted as `data-tab-activation` for\n * `wireTabBars` to read (overrides its `activation` option). `'automatic'` (default)\n * selects on arrow / Home / End; `'manual'` moves roving focus only and the user\n * selects with Enter / Space / click — use it when selecting a tab is a heavy action.\n */\n activation?: TabActivation;\n /** How available strip width is allocated across child AppTabs. */\n allocation?: TabBarAllocation;\n /** Named strip chrome for application rails, segmented tabs, or inspectors. */\n presentation?: TabBarPresentation;\n /** Keep a trailing action beside the final tab or at the far edge of the bar. */\n trailingPlacement?: TabBarTrailingPlacement;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/** Render a controlled tab strip. The application owns selection, order, and persistence. */\nexport function TabBar({\n id,\n label,\n children,\n leading,\n trailing,\n end,\n className = '',\n activation,\n allocation = 'intrinsic',\n presentation = 'rail',\n trailingPlacement = 'separate',\n slot,\n}: TabBarProps) {\n return (\n <nav\n class={`kui-tab-bar ${className}`.trim()}\n data-component=\"tab-bar\"\n data-tab-bar-id={id}\n data-tab-activation={activation}\n data-allocation={allocation}\n data-presentation={presentation}\n data-trailing-placement={trailingPlacement}\n aria-label={label}\n slot={slot}\n >\n {leading && <div class=\"kui-tab-bar__leading\">{leading}</div>}\n <div\n class=\"kui-tab-bar__tabs\"\n role=\"tablist\"\n aria-label={label}\n data-kui-tab-list\n >\n {children}\n </div>\n {trailing && <div class=\"kui-tab-bar__trailing\">{trailing}</div>}\n {end && <div class=\"kui-tab-bar__end\">{end}</div>}\n </nav>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/workbench-overlays.ts","../src/wire-workbench.ts"],"names":["active","element","effect","selector"],"mappings":";;;;AAiBA,IAAM,eAAA,GAAqD;AAAA,EACzD,QAAA,EAAU,uCAAA;AAAA,EACV,SAAA,EAAW,wCAAA;AAAA,EACX,YAAA,EAAc;AAChB,CAAA;AAEA,IAAM,cAAA,GAAoD;AAAA,EACxD,QAAA,EAAU,MAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA,EAAc;AAChB,CAAA;AAEA,IAAM,SAAA,GACJ,iJAAA;AAUF,IAAM,UAAA,GAAa,CAAC,OAAA,KAClB,CAAC,GAAG,OAAA,CAAQ,gBAAA,CAA8B,SAAS,CAAC,CAAA,CAAE,MAAA;AAAA,EACpD,CAAC,OAAA,KACC,OAAO,QAAQ,eAAA,KAAoB,UAAA,IACnC,QAAQ,eAAA;AACZ,CAAA;AAwCK,SAAS,qBAAA,CACd,IAAA,EACA,aAAA,EACA,MAAA,EACA,YAAY,KAAA,EACA;AACZ,EAAA,MAAM,gBAAgB,IAAA,CAAK,aAAA;AAC3B,EAAA,MAAM,YAA+B,EAAC;AAGtC,EAAA,MAAM,YAAqC,EAAC;AAC5C,EAAA,MAAM,OAAA,uBAAc,GAAA,EAAwC;AAM5D,EAAA,IAAI,YAAA;AAMJ,EAAA,IAAI,SAAA;AAEJ,EAAA,MAAM,YAAA,GAAe,CAAC,KAAA,KACpB,aAAA,EAAc,EAAG,cAA2B,eAAA,CAAgB,KAAA,CAAM,GAAG,CAAC,CAAA,IACtE,IAAA;AAEF,EAAA,MAAM,UAAA,GAAa,CAAC,OAAA,KAClB,OAAA,CAAQ,QAAQ,YAAA,KAAi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AS,CAAA,EAAG;AAC/C,IAAA,MAAMC,SAAAA,GAAW,CAAA,gCAAA,EAAmC,MAAA,CAAO,EAAE,CAAC,CAAA,CAAA,CAAA;AAC9D,IAAA,SAAA,CAAU,IAAA;AAAA,MACR,qBAAA;AAAA,QACE,IAAA;AAAA,QACA,MACE,KAAK,OAAA,CAAQA,SAAQ,IACjB,IAAA,GACA,IAAA,CAAK,cAA2BA,SAAQ,CAAA;AAAA,QAC9C,aAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAM;AACX,IAAA,UAAA,IAAa;AACb,IAAA,UAAA,GAAa,MAAA;AACb,IAAA,KAAA,MAAW,OAAA,IAAW,SAAA,CAAU,MAAA,CAAO,CAAC,GAAG,OAAA,EAAQ;AAAA,EACrD,CAAA;AACF","file":"chunk-NNMLEDMD.js","sourcesContent":["// The transient-overlay behavior `wireWorkbench` gives Workbench panels that\n// present as overlays: a responsive overlay starts collapsed when its\n// breakpoint begins to apply, an open overlay takes focus and keeps Tab inside\n// it, and it closes on Escape or a press outside it. It mirrors `wireSidebar`'s\n// compact overlay (the ARIA dialog pattern). Internal.\n\nimport { effect, type Signal } from 'kerfjs';\n\nimport type { WorkbenchPanelKey } from './workbench-resize.js';\n\n/** A Workbench panel whose app-owned `collapsed` signal the wiring may write. */\nexport interface WorkbenchOverlayPanel {\n key: WorkbenchPanelKey;\n collapsed: Signal<boolean>;\n}\n\n/** Each panel's own element, never a nested Workbench's. */\nconst PANEL_SELECTORS: Record<WorkbenchPanelKey, string> = {\n leftRail: ':scope > [data-workbench-rail=\"left\"]',\n rightRail: ':scope > [data-workbench-rail=\"right\"]',\n bottomDrawer: ':scope > .kui-workbench__center > [data-workbench-drawer]',\n};\n\nconst RESTORE_PANELS: Record<WorkbenchPanelKey, string> = {\n leftRail: 'left',\n rightRail: 'right',\n bottomDrawer: 'bottom',\n};\n\nconst FOCUSABLE =\n 'a[href],area[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * The panel's focusable controls, in tab order. Only an open panel is ever\n * asked. The selector drops disabled controls and `tabindex=\"-1\"`; a\n * rendered control the CSS hides (the separator of a panel whose responsive\n * overlay breakpoint applies is `display: none`) is dropped too, or Tab would\n * wrap from a control focus can never reach. Where `checkVisibility` is\n * missing, every matched control counts.\n */\nconst focusables = (element: HTMLElement): HTMLElement[] =>\n [...element.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (control) =>\n typeof control.checkVisibility !== 'function' ||\n control.checkVisibility(),\n );\n\n/**\n * Wire transient overlay behavior for the given panels of the Workbench that\n * `findWorkbench` returns (looked up on use, so the Workbench may render after\n * wire-up). The app still owns each `collapsed` signal; this wiring only\n * writes it:\n *\n * - When a panel's `responsiveOverlayAt` breakpoint begins to apply (at\n * wire-up, on first render, or on a crossing), its inline collapsed state is\n * remembered and the panel collapses, so no overlay covers the work area\n * until the user opens it. When the breakpoint stops applying (or on\n * disposal) the remembered state comes back. These presentation changes\n * skip the collapse motion.\n * - A panel that opens while it presents as an overlay takes focus: its\n * first focusable control (else the panel itself) is focused, without\n * scrolling its sliding content. While an overlay is open, Tab and\n * Shift+Tab cycle through the controls of the overlay that holds focus\n * (else the most recently opened one) and never reach the work area it\n * covers — the ARIA dialog pattern `wireSidebar`'s compact overlay follows.\n * Inline panels are left alone.\n * - Escape closes the open overlay panel that holds focus, else the most\n * recently opened one; a press that starts and ends outside an open overlay\n * panel closes it. Static `presentation: \"overlay\"` panels are included.\n * - Focus stranded in a panel that closes — however it closed, including\n * through the app's own control inside it — returns to the control that\n * had it when the panel opened, else to the panel's restore control, else\n * to a control outside it whose `aria-controls` names the panel (or an\n * element inside it). The last covers a panel that was already open at\n * wire-up, which has no recorded opener. Focus a press inside the panel\n * dropped to the body counts as stranded too: Safari and macOS WebKit\n * never focus a clicked button, so pressing the panel's own close control\n * blurs the focused control before the click closes the panel. Focus the\n * user has since moved to any element is left where it is.\n * - With `exclusive`, a panel that opens while it presents as an overlay\n * closes every other open overlay panel, so overlays never cover each\n * other's controls. Inline panels are never closed by it.\n *\n * Returns a disposer.\n */\nexport function wireWorkbenchOverlays(\n root: HTMLElement,\n findWorkbench: () => HTMLElement | null,\n panels: readonly WorkbenchOverlayPanel[],\n exclusive = false,\n): () => void {\n const ownerDocument = root.ownerDocument;\n const disposers: Array<() => void> = [];\n // Open panels, most recently opened last, and each one's opener: the\n // control that had focus when it opened.\n const openOrder: WorkbenchOverlayPanel[] = [];\n const openers = new Map<WorkbenchOverlayPanel, HTMLElement>();\n // The open panel the latest press started in while focus was inside it,\n // until focus next lands anywhere. Safari and macOS WebKit never focus a\n // clicked button, so pressing a panel's own close control blurs the focused\n // control to the body before the click closes the panel; this is how the\n // close still counts as leaving focus stranded in it.\n let pressedFocus: WorkbenchOverlayPanel | undefined;\n /**\n * The `aria-controls` control a click just activated, kept for a couple of\n * frames: the toggle a panel opens or closes from, even once the app's\n * render has removed it.\n */\n let activated: HTMLElement | undefined;\n\n const panelElement = (panel: WorkbenchOverlayPanel): HTMLElement | null =>\n findWorkbench()?.querySelector<HTMLElement>(PANEL_SELECTORS[panel.key]) ??\n null;\n /** Whether the panel's responsive overlay breakpoint currently applies. */\n const responsive = (element: HTMLElement): boolean =>\n element.dataset.presentation === 'inline' &&\n element.hasAttribute('data-responsive-overlay-at') &&\n globalThis.getComputedStyle(element).position === 'absolute';\n const overlaid = (element: HTMLElement): boolean =>\n element.dataset.presentation === 'overlay' || responsive(element);\n\n /** Where focus goes when a panel it was in closes. */\n const restoreTarget = (\n panel: WorkbenchOverlayPanel,\n element: HTMLElement | null,\n ): HTMLElement | undefined => {\n const opener = openers.get(panel);\n // An opener inside another panel that has closed since (an exclusive\n // overlay closes the one it was opened from) would strand focus there too.\n if (\n opener?.isConnected &&\n !element?.contains(opener) &&\n !panels.some(\n (other) =>\n other.collapsed.peek() && panelElement(other)?.contains(opener),\n )\n )\n return opener;\n const side = RESTORE_PANELS[panel.key];\n const restore = findWorkbench()\n ?.querySelector<HTMLElement>(\n `.kui-workbench__restore[data-panel=\"${side}\"]`,\n )\n ?.querySelector<HTMLElement>(FOCUSABLE);\n return restore ?? (element ? controller(element) : undefined);\n };\n /**\n * A control outside the panel that names it, or an element inside it, in\n * its `aria-controls`: the app's toggle for a panel with no opener.\n */\n const controller = (element: HTMLElement): HTMLElement | undefined => {\n const ids = new Set(\n [element, ...element.querySelectorAll('[id]')].map((node) => node.id),\n );\n ids.delete('');\n return [\n ...ownerDocument.querySelectorAll<HTMLElement>('[aria-controls]'),\n ].find(\n (control) =>\n !element.contains(control) &&\n control.matches(FOCUSABLE) &&\n control\n .getAttribute('aria-controls')!\n .split(/\\s+/)\n .some((id) => ids.has(id)),\n );\n };\n /** Whether a control's `aria-controls` (always present) names panel `id`. */\n const namesPanel = (control: Element, id: string): boolean =>\n control.getAttribute('aria-controls')!.split(/\\s+/).includes(id);\n /** The panel's own control for itself: its toggle inside it. */\n const controlInside = (element: HTMLElement): HTMLElement | undefined =>\n [...element.querySelectorAll<HTMLElement>('[aria-controls]')].find(\n (control) =>\n control.matches(FOCUSABLE) && namesPanel(control, element.id),\n );\n const rescueFocus = (panel: WorkbenchOverlayPanel): void => {\n const element = panelElement(panel);\n const target = restoreTarget(panel, element);\n if (target) {\n target.focus();\n return;\n }\n // An app that renders its restore control after this write has not\n // produced it yet; look again once the current batch settles.\n globalThis.queueMicrotask(() => {\n if (!panel.collapsed.peek()) return;\n const later = restoreTarget(panel, panelElement(panel));\n const active = ownerDocument.activeElement;\n if (later) later.focus();\n else if (active instanceof HTMLElement && element?.contains(active))\n active.blur();\n });\n };\n\n /**\n * A presentation-driven write: no collapse motion, because nothing the user\n * did moved the panel. The app's render has normally applied the new state\n * by the time the write returns, so the content's transition is suspended\n * across one style flush.\n */\n const adapt = (\n panel: WorkbenchOverlayPanel,\n element: HTMLElement,\n collapsed: boolean,\n ): void => {\n if (panel.collapsed.peek() === collapsed) return;\n const stranded = collapsed && element.contains(ownerDocument.activeElement);\n panel.collapsed.value = collapsed;\n // Every Workbench panel renders its content wrapper, and never with a\n // style of its own, so the attribute goes again once the flush is done.\n const content = element.querySelector<HTMLElement>(\n ':scope > .kui-workbench__panel-content',\n )!;\n content.style.transition = 'none';\n void globalThis.getComputedStyle(content).transform;\n content.removeAttribute('style');\n // The collapse effect has normally returned the focus already; on\n // disposal, after the effects are gone, this is what returns it.\n if (stranded && element.contains(ownerDocument.activeElement))\n rescueFocus(panel);\n };\n\n // The inline collapsed state of each panel whose responsive overlay\n // currently applies, restored when it stops applying.\n const inlineState = new Map<WorkbenchOverlayPanel, boolean>();\n const sync = (): void => {\n for (const panel of panels) {\n const element = panelElement(panel);\n if (!element) continue;\n const active = responsive(element);\n if (active && !inlineState.has(panel)) {\n inlineState.set(panel, panel.collapsed.peek());\n adapt(panel, element, true);\n } else if (!active && inlineState.has(panel)) {\n const remembered = inlineState.get(panel)!;\n inlineState.delete(panel);\n adapt(panel, element, remembered);\n }\n }\n };\n\n // The Workbench is its own breakpoint container, so its size is what moves a\n // panel across the breakpoint. It may render after wire-up or be replaced,\n // and the app may change a presentation, so both are observed too.\n let observed: HTMLElement | null = null;\n const resizeObserver =\n typeof globalThis.ResizeObserver === 'function'\n ? new globalThis.ResizeObserver(() => sync())\n : undefined;\n /** Observe the current Workbench; whether it changed. */\n const track = (): boolean => {\n const workbench = findWorkbench();\n if (workbench === observed) return false;\n if (observed) resizeObserver?.unobserve(observed);\n observed = workbench;\n if (workbench) resizeObserver?.observe(workbench);\n return true;\n };\n const mutationObserver = new MutationObserver((records) => {\n if (track() || records.some((record) => record.type === 'attributes'))\n sync();\n });\n mutationObserver.observe(root, {\n attributes: true,\n attributeFilter: ['data-presentation', 'data-responsive-overlay-at'],\n childList: true,\n subtree: true,\n });\n // The breakpoints are in rem, so a root font-size change (a text-size\n // setting applied after load) moves a panel across them without resizing\n // the Workbench. A 1rem probe outside the app's tree reports that change.\n const remProbe = ownerDocument.createElement('div');\n remProbe.setAttribute('aria-hidden', 'true');\n remProbe.style.cssText =\n 'position:absolute;width:1rem;height:0;overflow:hidden;visibility:hidden;pointer-events:none';\n if (resizeObserver) {\n ownerDocument.body.append(remProbe);\n resizeObserver.observe(remProbe);\n }\n disposers.push(() => {\n mutationObserver.disconnect();\n resizeObserver?.disconnect();\n remProbe.remove();\n });\n track();\n sync();\n\n for (const panel of panels) {\n let previous = panel.collapsed.peek();\n if (!previous) openOrder.push(panel);\n disposers.push(\n effect(() => {\n const collapsed = panel.collapsed.value;\n if (collapsed === previous) return;\n previous = collapsed;\n const index = openOrder.indexOf(panel);\n if (index >= 0) openOrder.splice(index, 1);\n if (collapsed) {\n // Whatever closed the panel — Escape, an outside press, a\n // breakpoint, or the app's own control inside it — focus left in\n // it would be stranded in a hidden panel. So would focus that a\n // press inside it dropped to the body (see `pressedFocus`).\n const active = ownerDocument.activeElement;\n const element = panelElement(panel);\n if (\n element?.contains(active) ||\n // The panel's own control closed it (focused or not), so hand\n // focus to the control that reopens it.\n (activated !== undefined && element?.contains(activated)) ||\n (pressedFocus === panel &&\n (active === null || active === ownerDocument.body))\n )\n rescueFocus(panel);\n return;\n }\n openOrder.push(panel);\n const element = panelElement(panel);\n const active = ownerDocument.activeElement;\n if (\n active instanceof HTMLElement &&\n active !== ownerDocument.body &&\n !element?.contains(active)\n )\n openers.set(panel, active);\n else openers.delete(panel);\n // A focused toggle the app's render removes as the panel opens — a\n // Workbench toolbar toggle leaves the work-area toolbar for the\n // panel's own — would drop focus to the body. Hand it to the panel's\n // own control for it, so a keyboard user keeps their place. The\n // render may land before this effect (the toggle is gone already, so\n // the activated control stands in for the opener) or after it, in a\n // microtask or a later frame.\n const toggle =\n openers.get(panel) ??\n (activated && element && namesPanel(activated, element.id)\n ? activated\n : undefined);\n if (toggle) {\n const handOff = (frames: number): void => {\n const focused = ownerDocument.activeElement;\n if (panel.collapsed.peek()) return;\n if (toggle.isConnected) {\n if (toggle === focused && frames > 0)\n globalThis.requestAnimationFrame(() => handOff(frames - 1));\n return;\n }\n if (focused !== null && focused !== ownerDocument.body) return;\n const current = panelElement(panel);\n if (current) controlInside(current)?.focus({ preventScroll: true });\n };\n globalThis.queueMicrotask(() => handOff(5));\n }\n if (!element || !overlaid(element)) return;\n // Opening an overlay closes the others. Their collapse effects run\n // after this one, by which time focus has moved into this panel, so\n // none of them hands it back to an opener.\n if (exclusive)\n for (const [other] of openOverlays())\n if (other !== panel) other.collapsed.value = true;\n // An overlay covers the work area, so focus moves in with it rather\n // than staying on a control it may cover. Without preventScroll the\n // browser scrolls the panel's clipped, still-sliding content to reveal\n // the target, which then unwinds as the slide finishes.\n (focusables(element)[0] ?? element).focus({ preventScroll: true });\n }),\n );\n }\n\n /** The open overlay panels with their elements, most recent last. */\n const openOverlays = (): Array<[WorkbenchOverlayPanel, HTMLElement]> =>\n openOrder.flatMap((panel): Array<[WorkbenchOverlayPanel, HTMLElement]> => {\n const element = panelElement(panel);\n return !panel.collapsed.peek() && element && overlaid(element)\n ? [[panel, element]]\n : [];\n });\n\n const onKeydown = (event: KeyboardEvent): void => {\n if (\n (event.key !== 'Escape' && event.key !== 'Tab') ||\n event.defaultPrevented\n )\n return;\n const open = openOverlays();\n if (open.length === 0) return;\n const active = ownerDocument.activeElement;\n const [panel, element] =\n open.find(([, candidate]) => candidate.contains(active)) ??\n open[open.length - 1]!;\n if (event.key === 'Escape') {\n event.preventDefault();\n // The collapse effect returns focus stranded inside it.\n panel.collapsed.value = true;\n return;\n }\n // Tab stays inside the open overlay: it wraps at either end, and focus\n // that is somewhere else (the app moved it, or the panel had no control\n // to take it when it opened) comes back in.\n const items = focusables(element);\n if (items.length === 0) return;\n const first = items[0]!;\n const last = items[items.length - 1]!;\n const inside = element.contains(active);\n if (event.shiftKey && (!inside || active === first)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && (!inside || active === last)) {\n event.preventDefault();\n first.focus();\n }\n };\n\n // An outside press closes an open overlay when it both starts and ends\n // outside it. Deciding at the click lets an app toggle that closes the panel\n // run first, and a press that opens a panel never closes it.\n let pressed: WorkbenchOverlayPanel[] = [];\n const onPointerdown = (event: PointerEvent): void => {\n const path = event.composedPath();\n pressed = openOverlays()\n .filter(([, element]) => !path.includes(element))\n .map(([panel]) => panel);\n // Before the press's default action moves focus: the open panel it\n // started in, when focus was inside that panel too.\n const active = ownerDocument.activeElement;\n pressedFocus = panels.find((panel) => {\n if (panel.collapsed.peek()) return false;\n const element = panelElement(panel);\n return !!element && path.includes(element) && element.contains(active);\n });\n };\n // Focus landing anywhere is a deliberate move the rescue must not undo.\n const onFocusin = (): void => {\n pressedFocus = undefined;\n };\n const onClick = (event: MouseEvent): void => {\n const candidates = pressed;\n pressed = [];\n const path = event.composedPath();\n for (const [panel, element] of openOverlays())\n if (candidates.includes(panel) && !path.includes(element))\n panel.collapsed.value = true;\n };\n const onActivate = (event: MouseEvent): void => {\n const target = event.target;\n const control =\n target instanceof Element\n ? target.closest<HTMLElement>('[aria-controls]')\n : null;\n // Recorded whether or not it took focus: Safari and macOS WebKit never\n // focus a clicked button.\n if (!control) return;\n activated = control;\n // The collapse effect may run after the click's dispatch (the app can\n // batch its write), so keep the control for a couple of frames.\n globalThis.requestAnimationFrame(() =>\n globalThis.requestAnimationFrame(() => {\n if (activated === control) activated = undefined;\n }),\n );\n };\n ownerDocument.addEventListener('keydown', onKeydown);\n ownerDocument.addEventListener('pointerdown', onPointerdown, true);\n ownerDocument.addEventListener('click', onActivate, true);\n ownerDocument.addEventListener('click', onClick);\n ownerDocument.addEventListener('focusin', onFocusin, true);\n disposers.push(() => {\n ownerDocument.removeEventListener('keydown', onKeydown);\n ownerDocument.removeEventListener('pointerdown', onPointerdown, true);\n ownerDocument.removeEventListener('click', onActivate, true);\n ownerDocument.removeEventListener('click', onClick);\n ownerDocument.removeEventListener('focusin', onFocusin, true);\n });\n\n return () => {\n for (const dispose of disposers.splice(0)) dispose();\n // After every observer and effect is gone, so handing the inline state\n // back cannot re-enter the wiring.\n for (const [panel, remembered] of inlineState) {\n const element = panelElement(panel);\n if (element) adapt(panel, element, remembered);\n else panel.collapsed.value = remembered;\n }\n inlineState.clear();\n };\n}\n","import { effect, type ReadonlySignal, type Signal } from 'kerfjs';\n\nimport type { DeviceClass } from './device-class.js';\nimport { type ResizeLimit, wireResizeHandles } from './resize-wiring.js';\nimport {\n wireWorkbenchOverlays,\n type WorkbenchOverlayPanel,\n} from './workbench-overlays.js';\nimport {\n type WorkbenchPanelKey,\n workbenchRegionId,\n} from './workbench-resize.js';\n\nexport type { WorkbenchPanelKey };\n\n/** Minimal `localStorage`-shaped store, so the persistence hook is testable. */\nexport interface WorkbenchStorage {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n}\n\n/** One Workbench panel's app-owned state. */\nexport interface WireWorkbenchPanel {\n /**\n * The app-owned size signal a `resizable` panel renders as its `size`.\n * `wireWorkbench` writes each committed resize here; collapsing never\n * touches it, so an expanded panel returns at the size it had. Omit it for\n * a panel that is not resizable.\n */\n size?: Signal<number>;\n /**\n * When set with `size`, the size is loaded from and saved to `storage`\n * under this key, so the panel remembers the user's size.\n */\n storageKey?: string;\n /**\n * The app-owned signal the panel renders as its `collapsed`. With it (and\n * `dismissOverlays`, on by default) `wireWorkbench` treats the panel as a\n * transient overlay while it presents as one: it collapses when its\n * `responsiveOverlayAt` breakpoint begins to apply and gets its inline state\n * back when the breakpoint stops applying, an open overlay takes focus and\n * keeps Tab inside it, and it closes on Escape or a press outside it.\n */\n collapsed?: Signal<boolean>;\n}\n\n/** A resize the user made, after `wireWorkbench` wrote it to the size signal. */\nexport interface WorkbenchResize {\n panel: WorkbenchPanelKey;\n size: number;\n source: 'keyboard' | 'pointer';\n}\n\nexport interface WireWorkbenchOptions {\n /** The `id` the `Workbench` was rendered with. */\n id: string;\n /**\n * The wired panels, keyed like the `Workbench` props. Render a panel given\n * a `size` with `resizable` and `size={panel.size.value}`, and one given a\n * `collapsed` signal with `collapsed={panel.collapsed.value}`.\n */\n panels: Partial<Record<WorkbenchPanelKey, WireWorkbenchPanel>>;\n /**\n * When provided, resizing is suspended while `deviceClass.compact` is true —\n * the classes where rails become overlay drawers or are replaced.\n */\n deviceClass?: ReadonlySignal<DeviceClass>;\n /** Persistence store (default `globalThis.localStorage`, if present). */\n storage?: WorkbenchStorage;\n /** Keyboard step in px (default 16). */\n step?: number;\n /** Shift+arrow step in px (default 64). */\n largeStep?: number;\n /** Called after each committed resize. */\n onResize?: (change: WorkbenchResize) => void;\n /**\n * Treat the panels given a `collapsed` signal as transient overlays while\n * they present as overlays (default `true`), like `wireSidebar`'s compact\n * overlay: a panel whose `responsiveOverlayAt` breakpoint begins to apply\n * starts collapsed, with no collapse motion, and gets its inline collapsed\n * state back when the breakpoint stops applying (and on disposal); an open\n * overlay panel, responsive or `presentation: \"overlay\"`, closes on Escape\n * or a press that starts and ends outside it. A panel that opens as an\n * overlay takes focus on its first focusable control, and while it is open\n * Tab and Shift+Tab cycle through its controls instead of reaching the\n * work area it covers (the ARIA dialog pattern of `wireSidebar`'s compact\n * overlay); inline panels never move focus. Focus stranded in a closing\n * panel — however it closed, the app's own control inside it included —\n * returns to the control that had it when the panel opened, else to the\n * panel's restore control, else to a control outside the panel whose\n * `aria-controls` names it (each panel's `id` is its region id, e.g.\n * `studio-left-rail`) — the fallback for a panel already open at wire-up.\n * An opener inside a panel that has closed since is skipped. `false` leaves\n * every `collapsed` write and all focus handling to the app.\n */\n dismissOverlays?: boolean;\n /**\n * Keep overlays exclusive (default `true`), like `wireSidebar`'s\n * `exclusiveCompact`: when a panel opens while it presents as an overlay,\n * every other open overlay panel — rails and the bottom drawer alike —\n * closes, so one overlay never covers another's controls. Panels presenting\n * inline are never closed by it. Applies only with `dismissOverlays`.\n */\n exclusiveOverlays?: boolean;\n}\n\nfunction defaultStorage(): WorkbenchStorage | undefined {\n try {\n return globalThis.localStorage ?? undefined;\n } catch {\n return undefined;\n }\n}\n\n/** A stored size, or undefined when the stored text is not a usable size. */\nfunction storedSize(text: string | null) {\n if (text === null) return undefined;\n const size = Number(text);\n return Number.isFinite(size) && size > 0 ? Math.round(size) : undefined;\n}\n\n/** A double-quoted CSS attribute-selector value. */\nconst quoted = (value: string) =>\n `\"${value.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"')}\"`;\n\nconst px = (value: string) => Number.parseFloat(value) || 0;\n\n/**\n * The largest size a resizable panel may take while the work area keeps its\n * minimum: for a rail, its minimum width (the Workbench's `mainMinSize`,\n * rendered as `data-main-min-size`) — the Workbench width, less that minimum,\n * the other in-flow rails as shown, and the rail's own safe-area extent and\n * border; for the bottom drawer, its minimum height (`mainMinHeight`, rendered\n * as `data-main-min-height`) — the work-area column's height, less that\n * minimum and the drawer's own safe-area extent and border. A panel the\n * container has already squeezed is held at the size it shows, so it can\n * shrink but not grow. Without layout (no box yet) or a minimum, the panel's\n * own maximum stands.\n */\nconst mainRoomLimit: ResizeLimit = (region, { max }) => {\n const horizontal = region.dataset.axis === 'horizontal';\n // A rail's parent is the Workbench; the drawer's is the work-area column.\n const container = region.parentElement;\n const workbench = horizontal ? container : container?.parentElement;\n const mainMin = Number(\n horizontal\n ? workbench?.dataset.mainMinSize\n : workbench?.dataset.mainMinHeight,\n );\n if (!container || !(mainMin > 0)) return max;\n const box = container.getBoundingClientRect();\n const room = horizontal ? box.width : box.height;\n if (room <= 0) return max;\n let others = 0;\n if (horizontal)\n for (const rail of container.children) {\n if (\n rail === region ||\n !rail.matches('.kui-workbench__rail') ||\n globalThis.getComputedStyle(rail).position === 'absolute'\n )\n continue;\n others += rail.getBoundingClientRect().width;\n }\n const style = globalThis.getComputedStyle(region);\n const size = px(region.style.getPropertyValue('--kui-resizable-region-size'));\n const border =\n style.boxSizing === 'border-box'\n ? 0\n : horizontal\n ? px(style.borderInlineStartWidth) + px(style.borderInlineEndWidth)\n : px(style.borderBlockStartWidth) + px(style.borderBlockEndWidth);\n // The track is the size plus the panel's safe-area extent (its flex basis).\n const extent = px(style.flexBasis) - size + border;\n return Math.floor(room - Math.min(mainMin, room) - others - extent);\n};\n\n/**\n * Wire a `Workbench`'s panels. For `resizable` panels given a `size` signal:\n * pointer drags and arrow / Shift+arrow / Home / End on each panel's\n * separator, clamped to the panel's limits and to the room that leaves the\n * work area its minimum width and height, committed to the app-owned size signals.\n * Optional persistence loads and saves each size; optional `deviceClass`\n * suspends resizing on compact classes. Collapse stays the app's `collapsed`\n * flag and never changes a size. For panels given a `collapsed` signal,\n * overlays are transient (`dismissOverlays`): a responsive overlay starts\n * collapsed, an open overlay takes focus and keeps Tab inside it, it closes\n * on Escape or an outside press, and\n * opening one overlay closes the others (`exclusiveOverlays`). Returns a disposer. See `docs/23-app-layouts.md` §3.3.\n */\nexport function wireWorkbench(\n root: HTMLElement,\n {\n id,\n panels,\n deviceClass,\n storage = defaultStorage(),\n step,\n largeStep,\n onResize,\n dismissOverlays = true,\n exclusiveOverlays = true,\n }: WireWorkbenchOptions,\n): () => void {\n const keys = Object.keys(panels) as WorkbenchPanelKey[];\n const entries = keys.flatMap((key) => {\n const size = panels[key]?.size;\n return size\n ? [\n {\n key,\n size,\n storageKey: panels[key]!.storageKey,\n regionId: workbenchRegionId(id, key),\n },\n ]\n : [];\n });\n const byRegion = new Map(entries.map((entry) => [entry.regionId, entry]));\n const disposers: Array<() => void> = [];\n\n // Seed from storage before any effect runs, so the first render after\n // wire-up already has the remembered size; then mirror every size change.\n for (const { size, storageKey } of entries) {\n if (!storageKey || !storage) continue;\n const seed = storedSize(storage.getItem(storageKey));\n if (seed !== undefined) size.value = seed;\n disposers.push(\n effect(() => {\n storage.setItem(storageKey, String(size.value));\n }),\n );\n }\n\n // Each panel is matched by its own region id, so this wiring never drives a\n // ResizableRegion or another Workbench below the same root.\n const selector = entries\n .map(\n ({ regionId }) =>\n `[data-resizable=\"true\"][data-region-id=${quoted(regionId)}]`,\n )\n .join(', ');\n const start = () =>\n wireResizeHandles(\n root,\n {\n step,\n largeStep,\n onCommit: ({ id: regionId, size, source }) => {\n // The selector only matches configured panels.\n const entry = byRegion.get(regionId)!;\n entry.size.value = size;\n onResize?.({ panel: entry.key, size, source });\n },\n },\n selector,\n mainRoomLimit,\n );\n\n let stopResize: (() => void) | undefined;\n if (selector) {\n if (deviceClass) {\n disposers.push(\n effect(() => {\n const compact = deviceClass.value.compact;\n stopResize?.();\n stopResize = compact ? undefined : start();\n }),\n );\n } else {\n stopResize = start();\n }\n }\n\n const overlayPanels = keys.flatMap((key): WorkbenchOverlayPanel[] => {\n const collapsed = panels[key]?.collapsed;\n return collapsed ? [{ key, collapsed }] : [];\n });\n if (dismissOverlays && overlayPanels.length > 0) {\n const selector = `[data-component=\"workbench\"][id=${quoted(id)}]`;\n disposers.push(\n wireWorkbenchOverlays(\n root,\n () =>\n root.matches(selector)\n ? root\n : root.querySelector<HTMLElement>(selector),\n overlayPanels,\n exclusiveOverlays,\n ),\n );\n }\n\n return () => {\n stopResize?.();\n stopResize = undefined;\n for (const dispose of disposers.splice(0)) dispose();\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/panel-toolbar.tsx"],"names":[],"mappings":";;;;;;;AA2BO,SAAS,0BAAA,CACd,MACA,SAAA,EACkE;AAClE,EAAA,IAAI,IAAA,KAAS,MAAA;AACX,IAAA,OAAO,SAAA,GACH,EAAE,IAAA,EAAM,aAAA,EAAe,IAAA,EAAM,iBAAA,EAAkB,GAC/C,EAAE,IAAA,EAAM,cAAA,EAAgB,IAAA,EAAM,kBAAA,EAAmB;AACvD,EAAA,IAAI,IAAA,KAAS,OAAA;AACX,IAAA,OAAO,SAAA,GACH,EAAE,IAAA,EAAM,cAAA,EAAgB,IAAA,EAAM,kBAAA,EAAmB,GACjD,EAAE,IAAA,EAAM,eAAA,EAAiB,IAAA,EAAM,mBAAA,EAAoB;AACzD,EAAA,OAAO,SAAA,GACH,EAAE,IAAA,EAAM,eAAA,EAAiB,IAAA,EAAM,mBAAA,EAAoB,GACnD,EAAE,IAAA,EAAM,gBAAA,EAAkB,IAAA,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W,kBAAA,CAAmB,OAAO,CAAA,EAAG;AACtC,MAAA,MAAA,CAAO,KAAK,OAAO,CAAA;AAAA,IACrB;AAAA,EACF,CAAA;AACA,EAAA,OAAA,CAAQ,QAAQ,OAAO,CAAA;AACvB,EAAA,OAAA,CAAQ,QAAQ,MAAM,CAAA;AACtB,EAAA,OAAA,CAAQ,QAAQ,QAAQ,CAAA;AACxB,EAAA,OAAO;AAAA,IACL,GAAG,MAAA;AAAA,IACH,OAAA,CAAQ,SACJ,gBAAA,CAAiB,IAAA,EAAM,QAAQ,MAAA,EAAQ,IAAA,EAAM,UAAU,CAAA,GACvD;AAAA,GACN,CAAE,OAAO,CAAC,KAAA,KAAU,UAAU,MAAA,IAAa,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,KAAK,CAAA;AAC9E","file":"chunk-NYL63PSD.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport {\n PanelBottomClose,\n PanelBottomOpen,\n PanelLeftClose,\n PanelLeftOpen,\n PanelRightClose,\n PanelRightOpen,\n} from 'lucide';\n\nimport { LucideIcon } from './lucide-icon.js';\nimport { Pane, type PaneConfig } from './pane.js';\nimport { isRelocatableGroup } from './panel-toolbar-group.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport { Toolbar, type ToolbarConfig } from './toolbar.js';\nimport { ToolbarControlGroup } from './toolbar-control-group.js';\n\n/** Which edge a collapsible panel docks to. */\nexport type PanelSide = 'left' | 'right' | 'bottom';\n\n/**\n * The standard collapse/expand icon for a panel `side` and `collapsed` state,\n * so every app's sidebars and drawers use one recognizable convention:\n * `PanelLeft*` for a left rail, `PanelRight*` for a right rail, `PanelBottom*`\n * for a bottom drawer — the `Close` glyph while open, the `Open` glyph while\n * collapsed. Exposed so an app can render its own toggle affordance.\n */\nexport function collapsiblePanelToggleIcon(\n side: PanelSide,\n collapsed: boolean,\n): { icon: Parameters<typeof LucideIcon>[0]['icon']; name: string } {\n if (side === 'left')\n return collapsed\n ? { icon: PanelLeftOpen, name: 'panel-left-open' }\n : { icon: PanelLeftClose, name: 'panel-left-close' };\n if (side === 'right')\n return collapsed\n ? { icon: PanelRightOpen, name: 'panel-right-open' }\n : { icon: PanelRightClose, name: 'panel-right-close' };\n return collapsed\n ? { icon: PanelBottomOpen, name: 'panel-bottom-open' }\n : { icon: PanelBottomClose, name: 'panel-bottom-close' };\n}\n\n/**\n * The standard collapse toggle a panel toolbar renders. The app handles the\n * button's `data-action` and flips its own `collapsed` flag.\n */\nexport interface PanelToggle {\n /** The `data-action` the toggle button carries. */\n action: string;\n /** The panel's short name, for the accessible \"Show …\" / \"Hide …\" label. */\n name: string;\n /** Accessible label while the panel is collapsed. Defaults to `Show {name}`. */\n showLabel?: string;\n /** Accessible label while the panel is open. Defaults to `Hide {name}`. */\n hideLabel?: string;\n}\n\n/**\n * A collapsible panel's top toolbar, composed so its groups follow the\n * panel's open state.\n *\n * - `title` precedes the `leading` zone. Groups may appear in any of the\n * `leading`, `center`, and `trailing` zones while the panel is open.\n * - Groups marked `relocateOnCollapse` move to the work area's toolbar while\n * the panel is collapsed, preserving their order across the three zones.\n * - `toggle` is always the last group: in the panel's toolbar while it is\n * open, and right after the relocated groups in the work area's toolbar\n * while it is collapsed.\n *\n * Relocated content renders in both places while the panel is collapsed (the\n * panel's copy is inert), so give it no `id`s. Pass groups directly or in\n * arrays so their render-time annotation remains available to the panel.\n *\n * The toolbar's configuration (`dividerSides`, `centerAlign`, `responsive`,\n * `responsiveAt`, `safeAreaEdges`) forwards to its `Toolbar`. It draws no\n * divider of its own: the panel's `Pane` draws the line under it while the\n * content is scrolled (its `chromeDividers`, wired by `wireScrollDividers`).\n */\nexport interface PanelToolbar extends ToolbarConfig {\n /** Accessible name of the panel's toolbar. */\n label: string;\n title?: KerfUiContent;\n leading?: KerfUiContent;\n center?: KerfUiContent;\n trailing?: KerfUiContent;\n toggle?: PanelToggle;\n}\n\n/** Owner-specific attributes a toggle button carries (its wiring hooks). */\nexport type PanelToggleAttributes = Readonly<Record<string, string>>;\n\n/** The standard toggle, alone in a borderless group. */\nexport function panelToggleGroup(\n side: PanelSide,\n toggle: PanelToggle,\n collapsed: boolean,\n attributes: PanelToggleAttributes,\n): SafeHtml {\n const glyph = collapsiblePanelToggleIcon(side, collapsed);\n return (\n <ToolbarControlGroup label={toggle.name} appearance=\"borderless\" single>\n <button\n type=\"button\"\n {...attributes}\n data-action={toggle.action}\n aria-expanded={String(!collapsed)}\n aria-label={\n collapsed\n ? (toggle.showLabel ?? `Show ${toggle.name}`)\n : (toggle.hideLabel ?? `Hide ${toggle.name}`)\n }\n >\n <LucideIcon icon={glyph.icon} name={glyph.name} />\n </button>\n </ToolbarControlGroup>\n );\n}\n\n/**\n * The panel's own toolbar: content keeps its chosen zones and the toggle trails.\n */\nexport function composedPanelToolbar(\n toolbar: PanelToolbar,\n side: PanelSide,\n collapsed: boolean,\n attributes: PanelToggleAttributes,\n): SafeHtml {\n return (\n <Toolbar\n label={toolbar.label}\n dividerSides={toolbar.dividerSides}\n centerAlign={toolbar.centerAlign}\n responsive={toolbar.responsive}\n responsiveAt={toolbar.responsiveAt}\n safeAreaEdges={toolbar.safeAreaEdges}\n center={toolbar.center}\n leading={\n <>\n {toolbar.title}\n {toolbar.leading}\n </>\n }\n trailing={\n <>\n {toolbar.trailing}\n {toolbar.toggle\n ? panelToggleGroup(side, toolbar.toggle, collapsed, attributes)\n : null}\n </>\n }\n />\n );\n}\n\n/**\n * A toolbar panel's body: its content in a `Pane` under its composed toolbar,\n * with its optional `footer` below. The panel's `pane` configuration forwards\n * to that `Pane`; an omitted or `undefined` field keeps the `Pane` default.\n */\nexport function composedPanelBody({\n toolbar,\n side,\n collapsed,\n attributes,\n pane,\n footer,\n content,\n}: {\n toolbar: PanelToolbar;\n side: PanelSide;\n collapsed: boolean;\n attributes: PanelToggleAttributes;\n pane: PaneConfig | undefined;\n footer: KerfUiContent;\n content: KerfUiContent;\n}): SafeHtml {\n return (\n <Pane\n header={composedPanelToolbar(toolbar, side, collapsed, attributes)}\n footer={footer}\n contentElement={pane?.contentElement}\n contentLabel={pane?.contentLabel}\n separators={pane?.separators}\n safeAreaEdges={pane?.safeAreaEdges}\n chromeDividers={pane?.chromeDividers}\n >\n {content}\n </Pane>\n );\n}\n\n/**\n * The groups a collapsed panel hands to the work area, in zone order, then its\n * toggle. Empty while the panel is open or has no toolbar.\n */\nexport function relocatedPanelGroups(\n toolbar: PanelToolbar | undefined,\n side: PanelSide,\n collapsed: boolean,\n attributes: PanelToggleAttributes,\n): KerfUiContent[] {\n if (!collapsed || !toolbar) return [];\n const groups: KerfUiContent[] = [];\n const collect = (content: KerfUiContent): void => {\n if (Array.isArray(content)) {\n for (const item of content) collect(item);\n } else if (isRelocatableGroup(content)) {\n groups.push(content);\n }\n };\n collect(toolbar.leading);\n collect(toolbar.center);\n collect(toolbar.trailing);\n return [\n ...groups,\n toolbar.toggle\n ? panelToggleGroup(side, toolbar.toggle, true, attributes)\n : null,\n ].filter((group) => group !== undefined && group !== null && group !== false);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/select.tsx"],"names":[],"mappings":";;;;;;AAqIA,SAAS,aAAA,GAAgB;AACvB,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,OAAA,EAAQ,aAAA,EAAc,aAAA,EAAY,QACrC,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,0KAAA,EAA2K,CAAA,EACrL,CAAA;AAEJ;AAEO,SAAS,OAA6B,KAAA,EAA2B;AACtE,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA,GAAY,EAAA;AAAA,IACZ,eAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA,GAAW,KAAA;AAAA,IACX,OAAA,GAAU,KAAA;AAAA,IACV,WAAA,GAAc,KAAA;AAAA,IACd,YAAA,GAAe,MAAA;AAAA,IACf,IAAA,GAAO,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,IAAK,UAAU,MAAA,GAAS,CAAA,GAAI,kCAAkC,EAAE,CAAA,CAAA;AAAA,YACnG,IAAA,EAAK,OAAA;AAAA,YACL,YAAA,EAAY,KAAA;AAAA,YAEZ,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,yBAAA,EAA2B,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,cAC5C,OAAA,CAAQ,OAAO,CAAC,MAAA,KAAW,OAAO,KAAA,KAAU,KAAK,CAAA,CAAE,GAAA,CAAI,MAAM;AAAA;AAAA;AAAA,SAEjE,CAAA;AAAA,QACA,KAAA,CAAM,QAAA,KAAa,KAAA,CAAM,cAAA,IAAkB,MAAM,UAAA,CAAA,oBAChD,IAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,qBAAA;AAAA,YACN,IAAA,EAAK,OAAA;AAAA,YACL,cAAY,KAAA,IAAS,SAAA;AAAA,YAEpB,QAAA,EAAA;AAAA,cAAA,KAAA,CAAM,cAAA,oBACL,GAAA;AAAA,gBAAC,QAAA;AAAA,gBAAA;AAAA,kBACC,KAAA,EAAM,oBAAA;AAAA,kBACN,IAAA,EAAK,QAAA;AAAA,kBACL,oBAAA,EAAmB,KAAA;AAAA,kBAElB,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA,eACT;AAAA,cAED,MAAM,UAAA,oBACL,GAAA;AAAA,gBAAC,QAAA;AAAA,gBAAA;AAAA,kBACC,KAAA,EAAM,oBAAA;AAAA,kBACN,IAAA,EAAK,QAAA;AAAA,kBACL,oBAAA,EAAmB,OAAA;AAAA,kBAElB,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA;AACT;AAAA;AAAA;AAEJ;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-TEYARRAK.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport { Badge } from './badge.js';\nimport { type CssForegroundColor, em } from './css-values.js';\nimport { LucideIcon, type LucideNode } from './lucide-icon.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport { Skeleton } from './skeleton.js';\n\nexport interface SelectChoice<Value extends string = string> {\n value: Value;\n label: string;\n icon?: LucideNode;\n iconName?: string;\n /**\n * Foreground color for the optional icon: a semantic foreground token such\n * as `uiColor('success-on-quiet')`, or an application-owned\n * `foregroundColorVar('--app-icon-color')`. Fill tokens such as\n * `uiColor('success-fill-quiet')` are pale background tints and do not\n * type-check.\n */\n color?: CssForegroundColor;\n group?: string;\n /** Keep an unavailable choice visible but prevent selection. */\n disabled?: boolean;\n /** Optional explanation exposed as the disabled option's native tooltip. */\n disabledReason?: string;\n /**\n * Draw a divider between this choice and the previous choice in the same\n * list. A group boundary is already a separator, so the first choice of a\n * group (or of the whole menu) never draws a second one.\n */\n separatorBefore?: boolean;\n}\n\ntype SelectAccessibleName =\n { label: string; ariaLabel?: string } | { label?: never; ariaLabel: string };\n\nexport type SelectPresentation = 'form' | 'toolbar-borderless' | 'navigation';\nexport type SelectSize = 'default' | 'compact';\nexport type SelectSelectedPresentation = 'label' | 'icon-only';\nexport type SelectFocusRingOwner = 'select' | 'group';\nexport type SelectTriggerWidth = 'fit-content' | 'max-content' | 'fill';\n\ninterface SelectBaseProps<Value extends string = string> {\n name: string;\n choices: readonly SelectChoice<Value>[];\n className?: string;\n /** Empty-value hint text shown in the closed control (the native select placeholder). */\n placeholderText?: string;\n /** Supporting text shown below the control and associated with its combobox. */\n hint?: string;\n disabled?: boolean;\n fitMenu?: boolean;\n /** Render as an unanimated loading skeleton: the label above a static, empty control box. */\n placeholder?: boolean;\n /** Form (default), borderless toolbar, or intrinsic navigation chrome. */\n presentation?: SelectPresentation;\n size?: SelectSize;\n /** Closed trigger width; omit to keep the presentation's default. */\n triggerWidth?: SelectTriggerWidth;\n /** Let an enclosing ToolbarControlGroup paint the composed focus ring. */\n focusRingOwner?: SelectFocusRingOwner;\n /** Maximum closed-control label width in CSS pixels before ellipsis. */\n labelMaxWidth?: number;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/** One chosen value (the default). */\nexport interface SelectSingleValueProps<Value extends string = string> {\n multiple?: false;\n value: NoInfer<Value>;\n renderSelected?: (choice: SelectChoice<Value>) => SafeHtml;\n /** Show only the selected choice icon while retaining the Select's accessible name. */\n selectedPresentation?: SelectSelectedPresentation;\n triggerIcon?: never;\n selectAllLabel?: never;\n clearLabel?: never;\n}\n\n/**\n * Any number of chosen values. The popup stays open while the person toggles\n * choices and closes on an outside click, Escape, or focus leaving; the closed\n * control summarizes the chosen labels in choice order.\n */\nexport interface SelectMultipleLabelProps<Value extends string = string> {\n multiple: true;\n value: readonly NoInfer<Value>[];\n renderSelected?: never;\n selectedPresentation?: 'label';\n triggerIcon?: never;\n /** Opt in to a footer action that selects every enabled choice. */\n selectAllLabel?: string;\n /** Opt in to a footer action that clears the current selection. */\n clearLabel?: string;\n}\n\n/**\n * A multiple Select drawn as an icon-only toolbar trigger, such as a\n * \"Filter by label\" funnel. No single choice is selected, so the trigger shows\n * a fixed `triggerIcon` naming the menu's purpose; while any choice is chosen\n * a count badge sits beside it, and the combobox's accessible name ends with\n * the chosen labels in choice order.\n */\nexport interface SelectMultipleIconProps<Value extends string = string> {\n multiple: true;\n value: readonly NoInfer<Value>[];\n renderSelected?: never;\n selectedPresentation: 'icon-only';\n /**\n * The trigger's fixed icon, typically a `LucideIcon` naming the menu's\n * purpose (a funnel for a filter), independent of the selection.\n */\n triggerIcon: KerfUiContent;\n /** Opt in to a footer action that selects every enabled choice. */\n selectAllLabel?: string;\n /** Opt in to a footer action that clears the current selection. */\n clearLabel?: string;\n}\n\nexport type SelectMultipleValueProps<Value extends string = string> =\n SelectMultipleLabelProps<Value> | SelectMultipleIconProps<Value>;\n\nexport type SelectProps<Value extends string = string> =\n SelectBaseProps<Value> &\n SelectAccessibleName &\n (SelectSingleValueProps<Value> | SelectMultipleValueProps<Value>);\n\n// The closed wa-select's disclosure glyph: Web Awesome's system `chevron-down`,\n// Font Awesome Free 7.0.0 by @fontawesome (https://fontawesome.com), licensed\n// CC BY 4.0 (https://fontawesome.com/license/free). The placeholder draws the\n// same path so the loading box matches the live control without registering\n// Web Awesome.\nfunction SelectChevron() {\n return (\n <svg viewBox=\"0 0 448 512\" aria-hidden=\"true\">\n <path d=\"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\"></path>\n </svg>\n );\n}\n\nexport function Select<Value extends string>(props: SelectProps<Value>) {\n const {\n name,\n label,\n ariaLabel,\n choices,\n className = '',\n placeholderText,\n hint,\n disabled = false,\n fitMenu = false,\n placeholder = false,\n presentation = 'form',\n size = 'default',\n triggerWidth,\n focusRingOwner = 'select',\n labelMaxWidth,\n slot,\n } = props;\n const multiple = props.multiple === true;\n const values: readonly Value[] = props.multiple ? props.value : [props.value];\n const renderSelected = props.multiple ? undefined : props.renderSelected;\n const selectedPresentation: SelectSelectedPresentation =\n props.selectedPresentation ?? 'label';\n // A multiple icon-only trigger shows a fixed icon naming the menu's\n // purpose instead of a selected choice's icon.\n const iconTrigger =\n props.multiple && props.selectedPresentation === 'icon-only';\n const triggerIcon = iconTrigger ? props.triggerIcon : undefined;\n if (placeholder) {\n return (\n <div\n class={`kui-select kui-select--placeholder ${className}`.trim()}\n data-component=\"select\"\n data-placeholder=\"true\"\n data-presentation={presentation}\n data-size={size}\n data-trigger-width={triggerWidth}\n data-selected-presentation={selectedPresentation}\n data-focus-ring-owner={focusRingOwner}\n aria-busy=\"true\"\n style={\n labelMaxWidth === undefined\n ? undefined\n : `--kui-select-label-max-width:${labelMaxWidth}px`\n }\n slot={slot}\n >\n {label && <span class=\"kui-select__placeholder-label\">{label}</span>}\n <span\n class=\"kui-select__placeholder-box\"\n aria-label={ariaLabel}\n role=\"img\"\n >\n <Skeleton width={em(10)} />\n <span class=\"kui-select__placeholder-chevron\" aria-hidden=\"true\">\n <SelectChevron />\n </span>\n </span>\n {hint && <span class=\"kui-select__placeholder-hint\">{hint}</span>}\n </div>\n );\n }\n // A multiple Select summarizes its choices in the display text instead of\n // leading with one selected icon.\n const selected = multiple\n ? undefined\n : choices.find((choice) => choice.value === values[0] && !choice.disabled);\n const chosenCount = iconTrigger\n ? choices.filter(\n (choice) => !choice.disabled && values.includes(choice.value),\n ).length\n : 0;\n const icon = (choice: SelectChoice<Value>, selectedIcon = false) => (\n <span\n data-key={`${name}:${choice.value}:${selectedIcon ? 'selected' : 'option'}`}\n data-morph-skip\n slot=\"start\"\n class={`kui-select__icon${selectedIcon ? ' kui-select__icon--selected' : ''}`}\n style={choice.color ? `color:${choice.color}` : undefined}\n >\n {choice.icon ? (\n <LucideIcon\n icon={choice.icon}\n name={\n choice.iconName ?? choice.label.toLowerCase().replaceAll(' ', '-')\n }\n />\n ) : null}\n </span>\n );\n const option = (choice: SelectChoice<Value>, index: number) => (\n <>\n {/* Web Awesome sets the divider's role and aria-orientation on its\n host once, so a template that omits them would lose them to the\n next kerf re-render's morph for good. Render them explicitly, with\n the orientation it reflects (see the wa-select note below). */}\n {choice.separatorBefore && index > 0 && (\n <wa-divider\n orientation=\"horizontal\"\n role=\"separator\"\n aria-orientation=\"horizontal\"\n ></wa-divider>\n )}\n <wa-option\n value={choice.value}\n selected={multiple && !choice.disabled && values.includes(choice.value)}\n disabled={choice.disabled}\n title={choice.disabled ? choice.disabledReason : undefined}\n >\n {choice.icon ? icon(choice) : null}\n {choice.label}\n </wa-option>\n </>\n );\n const groups = [\n ...new Set(\n choices\n .map((choice) => choice.group)\n .filter((group): group is string => Boolean(group)),\n ),\n ];\n const ungrouped = choices.filter((choice) => !choice.group);\n // Web Awesome names its shadow combobox from the label, not the host's\n // aria-label. Keep ariaLabel-only names available without visible chrome.\n // A multiple Select's value is its selected options (the value attribute\n // holds only one string), kept in sync by @kerfjs/ui/select/register.\n // size/appearance/placement are Web Awesome's defaults, which it reflects\n // onto the host; rendering them keeps a re-render's morph from stripping\n // them and forcing a Lit update to put them back.\n return (\n <wa-select\n size=\"m\"\n appearance=\"outlined\"\n placement=\"bottom\"\n class={`kui-select${renderSelected ? ' kui-select--custom-selected' : ''}${fitMenu ? ' kui-select--fit-menu' : ''}${!label ? ' kui-select--label-hidden' : ''} ${className}`.trim()}\n data-component=\"select\"\n data-presentation={presentation}\n data-size={size}\n data-trigger-width={triggerWidth}\n data-selected-presentation={selectedPresentation}\n data-focus-ring-owner={focusRingOwner}\n name={name}\n label={label || ariaLabel}\n aria-label={ariaLabel}\n multiple={multiple}\n value={multiple ? undefined : values[0]}\n placeholder={placeholderText}\n hint={hint}\n disabled={disabled}\n style={\n labelMaxWidth === undefined\n ? undefined\n : `--kui-select-label-max-width:${labelMaxWidth}px`\n }\n slot={slot}\n >\n {iconTrigger && (\n <>\n {/* The accessible name ends with the chosen labels, which\n @kerfjs/ui/select/register writes into the summary. */}\n <span slot=\"label\" data-key={`${name}:trigger-label`}>\n {label || ariaLabel}\n <span class=\"kui-select__name-summary\" data-morph-skip></span>\n </span>\n <span\n data-key={`${name}:trigger-icon`}\n slot=\"start\"\n class=\"kui-select__icon kui-select__icon--selected kui-select__trigger-icon\"\n >\n {triggerIcon}\n </span>\n {chosenCount > 0 && (\n <Badge slot=\"end\" tone=\"brand\" size=\"compact\" ariaHidden>\n {chosenCount}\n </Badge>\n )}\n </>\n )}\n {selected &&\n (renderSelected ? (\n <span\n data-key={`${name}:${values[0]}:custom-selected`}\n slot=\"start\"\n class=\"kui-select__custom-selected\"\n >\n <span class=\"kui-select__custom-selected-content\">\n {renderSelected(selected)}\n </span>\n </span>\n ) : selected.icon ? (\n icon(selected, true)\n ) : null)}\n {ungrouped.map(option)}\n {groups.map((group, index) => (\n <div\n class={`kui-select__group${index > 0 || ungrouped.length > 0 ? ' kui-select__group--separated' : ''}`}\n role=\"group\"\n aria-label={group}\n >\n <span class=\"kui-select__group-title\">{group}</span>\n {choices.filter((choice) => choice.group === group).map(option)}\n </div>\n ))}\n {props.multiple && (props.selectAllLabel || props.clearLabel) && (\n <div\n class=\"kui-select__actions\"\n role=\"group\"\n aria-label={label || ariaLabel}\n >\n {props.selectAllLabel && (\n <button\n class=\"kui-select__action\"\n type=\"button\"\n data-select-action=\"all\"\n >\n {props.selectAllLabel}\n </button>\n )}\n {props.clearLabel && (\n <button\n class=\"kui-select__action\"\n type=\"button\"\n data-select-action=\"clear\"\n >\n {props.clearLabel}\n </button>\n )}\n </div>\n )}\n </wa-select>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/popup-menu.tsx"],"names":[],"mappings":";;;AAiGA,SAAS,WAAW,KAAA,EAAkC;AACpD,EAAA,IAAI,IAAA,GAAO,UAAA;AACX,EAAA,KAAA,MAAW,SAAA,IAAa,KAAA,CAAM,IAAA,CAAK,IAAQ,CAAA,EAAG;AAC5C,IAAA,IAAA,IAAQ,SAAA,CAAU,YAAY,CAAC,CAAA;AAC/B,IAAA,IAAA,GAAO,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,QAAU,CAAA;AAAA,EACnC;AACA,EAAA,OAAA,CAAQ,IAAA,KAAS,CAAA,EAAG,QAAA,CAAS,EAAE,CAAA;AACjC;AAEA,SAAS,SAAS,KAAA,EAA+B;AAC/C,EAAA,IAAI,KAAA,CAAM,IAAA,KAAS,SAAA,EAAW,OAAO,GAAA;AACrC,EAAA,IAAI,MAAM,IAAA,KAAS,SAAA,EAAW,OAAO,CAAA,CAAA,EAAI,MAAM,KAAK,CAAA,CAAA;AACpD,EAAA,OAAO;AAAA,IACL,KAAA,CAAM,KAAA;AAAA,IACN,MAAM,MAAA,IAAU,EAAA;AAAA,IAChB,MAAM,KAAA,IAAS,EAAA;AAAA,IACf,KAAA,CAAM,WAAW,GAAA,GAAM,GAAA;AAAA,IACvB,KAAA,CAAM,UAAU,GAAA,GAAM,GAAA;AAAA,IACtB,MAAM,IAAA,IAAQ,EAAA;AAA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A,EAAK,KAAA,EAAM,uBAAA,EAAyB,QAAA,EAAA,KAAA,EAAM;AAAA;AAAA;AAAA,SAE/C;AAAA,QAED,MAAM,GAAA,CAAI,CAAC,KAAA,KAAU,WAAA,CAAY,KAAK,CAAC;AAAA;AAAA;AAAA,GAC1C;AAEJ","file":"chunk-VCBTX62E.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport type { KerfUiContent } from './semantic-content.js';\n\nexport type PopupMenuPlacement =\n 'bottom-start' | 'bottom' | 'bottom-end' | 'top-start' | 'top' | 'top-end';\n\ntype PopupMenuDataAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-action'?: never;\n 'data-component'?: never;\n 'data-key'?: never;\n 'data-morph-skip-children'?: never;\n }\n>;\n\n/** One command in the menu. */\nexport interface PopupMenuItem {\n kind?: 'item';\n label: string;\n /** Delegated `data-action` the app handles when the item is chosen. */\n action?: string;\n /** Native `wa-dropdown-item` value, reported by its `wa-select` event. */\n value?: string;\n /** Leading icon, typically a `LucideIcon`; it is placed in the item's icon slot. */\n icon?: SafeHtml;\n /** A checked menu choice, including nested choices. */\n checked?: boolean;\n /** Trailing safe content, such as a selected-choice tick. */\n details?: SafeHtml;\n /** Destructive command styling. */\n tone?: 'default' | 'danger';\n disabled?: boolean;\n /** Native tooltip text for a disabled command. */\n disabledReason?: string;\n /** Application `data-*` metadata such as a record id. */\n attributes?: PopupMenuDataAttributes;\n /** Child commands, headings, and dividers opened by hover or keyboard navigation. */\n submenu?: readonly PopupMenuEntry[];\n}\n\n/** A labeled group heading; items that follow it belong to the group. */\nexport interface PopupMenuHeading {\n kind: 'heading';\n label: string;\n}\n\n/** A separator between groups of items. */\nexport interface PopupMenuDivider {\n kind: 'divider';\n}\n\nexport type PopupMenuEntry =\n PopupMenuItem | PopupMenuHeading | PopupMenuDivider;\n\ntype PopupMenuTriggerName =\n | {\n /** Visible trigger text, which is also its accessible name. */\n text: string;\n label?: never;\n }\n | {\n text?: never;\n /**\n * Accessible name of an icon-only trigger, rendered as visually hidden\n * slotted text (a Web Awesome button takes its name from its content).\n */\n label: string;\n };\n\ntype PopupMenuTrigger =\n | (PopupMenuTriggerName & { context?: false })\n | {\n context: true;\n label: string;\n text?: never;\n icon?: never;\n caret?: never;\n disabled?: never;\n };\n\nexport type PopupMenuProps = PopupMenuTrigger & {\n /** Trigger icon, typically a `LucideIcon`, before any visible text. */\n icon?: KerfUiContent;\n items: readonly PopupMenuEntry[];\n /** Where the menu opens relative to its trigger. Defaults to `bottom-start`. */\n placement?: PopupMenuPlacement;\n /** Show the disclosure caret after the trigger content. Defaults to true. */\n caret?: boolean;\n disabled?: boolean;\n /** Application `data-*` metadata on the menu root. */\n rootAttributes?: PopupMenuDataAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n};\n\n/** A short, stable FNV-1a digest of the trigger and item structure. */\nfunction contentKey(parts: readonly string[]): string {\n let hash = 0x811c9dc5;\n for (const character of parts.join('\\u0000')) {\n hash ^= character.codePointAt(0)!;\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(36);\n}\n\nfunction entryKey(entry: PopupMenuEntry): string {\n if (entry.kind === 'divider') return '-';\n if (entry.kind === 'heading') return `#${entry.label}`;\n return [\n entry.label,\n entry.action ?? '',\n entry.value ?? '',\n entry.disabled ? '1' : '0',\n entry.checked ? '1' : '0',\n entry.tone ?? '',\n entry.disabledReason ?? '',\n String(entry.icon ?? ''),\n String(entry.details ?? ''),\n JSON.stringify(entry.attributes ?? {}),\n ...(entry.submenu ?? []).map(entryKey),\n ].join('\\u0001');\n}\n\nfunction renderEntry(entry: PopupMenuEntry, nested = false) {\n if (entry.kind === 'divider')\n return <wa-divider slot={nested ? 'submenu' : undefined}></wa-divider>;\n // A group title styled like the Select's group title. It is not a slotted\n // h1-h6, whose Web Awesome group-label metrics are !important.\n if (entry.kind === 'heading')\n return (\n <div\n class=\"kui-popup-menu__heading\"\n slot={nested ? 'submenu' : undefined}\n >\n {entry.label}\n </div>\n );\n return (\n <wa-dropdown-item\n {...(entry.attributes ?? {})}\n slot={nested ? 'submenu' : undefined}\n data-action={entry.action}\n value={entry.value}\n type={entry.checked === undefined ? undefined : 'checkbox'}\n checked={entry.checked}\n variant={entry.tone === 'danger' ? 'danger' : undefined}\n disabled={entry.disabled}\n title={entry.disabled ? entry.disabledReason : undefined}\n >\n {entry.icon ? (\n <span slot=\"icon\" class=\"kui-popup-menu__icon\">\n {entry.icon}\n </span>\n ) : null}\n {entry.label}\n {entry.details ? (\n <span slot=\"details\" class=\"kui-popup-menu__details\">\n {entry.details}\n </span>\n ) : entry.submenu ? (\n <span slot=\"details\"></span>\n ) : null}\n {entry.submenu?.map((child) => renderEntry(child, true))}\n </wa-dropdown-item>\n );\n}\n\n/** A rendered context PopupMenu with Web Awesome's controlled open state. */\nexport type PopupMenuElement = HTMLElement & { open: boolean };\n\n/** Open a context PopupMenu at viewport pointer coordinates. */\nexport function openPopupMenuAt(\n menu: PopupMenuElement,\n x: number,\n y: number,\n): void {\n menu.style.setProperty('--kui-popup-menu-context-x', `${x}px`);\n menu.style.setProperty('--kui-popup-menu-context-y', `${y}px`);\n menu.open = true;\n}\n\n/** Close a programmatically opened PopupMenu. */\nexport function closePopupMenu(menu: PopupMenuElement): void {\n menu.open = false;\n}\n\n/**\n * An action menu: a trigger button that opens a list of commands. Renders the\n * `wa-dropdown` root directly, so a `single` `ToolbarControlGroup` (with\n * `nestedDropdown`) or a `PopupSurface` sizes and insets it as usual. Items\n * dispatch through delegated `data-action`s; the app owns the commands and any\n * open-state reaction. Import `@kerfjs/ui/popup-menu/register` once to register\n * the Web Awesome elements.\n */\nexport function PopupMenu({\n text,\n label,\n icon,\n items,\n placement = 'bottom-start',\n caret = true,\n disabled = false,\n rootAttributes = {},\n slot,\n context = false,\n}: PopupMenuProps) {\n // Web Awesome owns the trigger and item DOM once upgraded, so the morph\n // skips the children; the content key rebuilds the menu when they change.\n const key = `kui-popup-menu-${contentKey([\n text ?? '',\n label ?? '',\n String(icon ?? ''),\n String(caret),\n String(disabled),\n String(context),\n ...items.map(entryKey),\n ])}`;\n // size=\"m\" is Web Awesome's reflected default; rendering it keeps a\n // re-render's morph from stripping it and forcing a Lit update.\n return (\n <wa-dropdown\n size=\"m\"\n {...rootAttributes}\n class=\"kui-popup-menu\"\n data-component=\"popup-menu\"\n data-key={key}\n data-morph-skip-children\n data-trigger={context ? 'context' : 'button'}\n placement={placement}\n slot={slot}\n >\n {context ? (\n <button\n type=\"button\"\n slot=\"trigger\"\n class=\"kui-popup-menu__context-anchor\"\n aria-label={label}\n aria-hidden=\"true\"\n tabindex={-1}\n ></button>\n ) : (\n <wa-button\n slot=\"trigger\"\n appearance=\"plain\"\n with-caret={caret}\n disabled={disabled}\n >\n {icon}\n {text ? (\n <span>{text}</span>\n ) : (\n <span class=\"kui-popup-menu__label\">{label}</span>\n )}\n </wa-button>\n )}\n {items.map((entry) => renderEntry(entry))}\n </wa-dropdown>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/workbench-toolbars.tsx","../src/workbench.tsx"],"names":["jsx","jsxs"],"mappings":";;;;;;;;;AAgEA,IAAM,KAAA,GAA8C;AAAA,EAClD,QAAA,EAAU,MAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA,EAAc;AAChB,CAAA;AAeA,IAAM,gBAAA,GAAmB,CACvB,WAAA,EACA,GAAA,MAC2B;AAAA,EAC3B,uBAAA,EAAyB,MAAM,GAAG,CAAA;AAAA;AAAA;AAAA,EAGlC,UAAA,EAAY,CAAA,EAAG,iBAAA,CAAkB,WAAA,EAAa,GAAG,CAAC,CAAA,OAAA,CAAA;AAAA,EAClD,eAAA,EAAiB,iBAAA,CAAkB,WAAA,EAAa,GAAG;AACrD,CAAA,CAAA;AAMO,SAAS,eAAA,CACd,WAAA,EACA,GAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO,oBAAA;AAAA,IACL,KAAA,EAAO,OAAA;AAA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A,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,uBAAA,EACT,QAAA,EAAA;AAAA,0BAAAD,IAAC,KAAA,EAAA,EAAI,KAAA,EAAM,qBAAA,EAAsB,qBAAA,EAAmB,MACjD,QAAA,EAAA,QAAA,CAAS;AAAA,YACR,WAAA,EAAa,EAAA;AAAA,YACb,IAAA;AAAA,YACA,WAAA;AAAA,YACA,UAAA;AAAA,YACA,UAAA;AAAA,YACA,iBAAA;AAAA,YACA,mBAAA;AAAA,YACA,mBAAA;AAAA,YACA,QAAA;AAAA,YACA,cAAA;AAAA,YACA,cAAA;AAAA,YACA,QAAA;AAAA,YACA,SAAA;AAAA,YACA;AAAA,WACD,CAAA,EACH,CAAA;AAAA,UACC,gCAAgBA,GAAAA,CAAC,MAAA,EAAA,EAAO,EAAA,EAAQ,OAAO,YAAA,EAAc,CAAA;AAAA,UACrD,OAAA;AAAA,YACC,YAAA;AAAA,YACA,QAAA;AAAA,YACA,YAAA;AAAA,YACA,eAAA;AAAA,cACE,EAAA;AAAA,cACA,cAAA;AAAA,cACA,YAAA;AAAA,cACA,QAAQ,iBAAiB;AAAA;AAC3B;AACF,SAAA,EACF,CAAA;AAAA,QACC,SAAA,oBAAaA,GAAAA,CAAC,IAAA,EAAA,EAAK,IAAQ,IAAA,EAAK,OAAA,EAAQ,OAAO,SAAA,EAAW,CAAA;AAAA,QAC1D,OAAA;AAAA,UACC,SAAA;AAAA,UACA,OAAA;AAAA,UACA,YAAA;AAAA,UACA,gBAAgB,EAAA,EAAI,WAAA,EAAa,SAAA,EAAW,OAAA,CAAQ,WAAW,CAAC;AAAA;AAClE;AAAA;AAAA,GACF;AAEJ","file":"chunk-Y74NWGQW.js","sourcesContent":["import {\n FloatingToolbar,\n type FloatingToolbarPosition,\n} from './floating-toolbar.js';\nimport { List, type ListConfig } from './list.js';\nimport { Pane, type PaneConfig } from './pane.js';\nimport {\n composedPanelBody,\n type PanelSide,\n type PanelToggle,\n type PanelToggleAttributes,\n type PanelToolbar,\n relocatedPanelGroups,\n} from './panel-toolbar.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport { Toolbar, type ToolbarConfig } from './toolbar.js';\nimport {\n type WorkbenchPanelKey,\n workbenchRegionId,\n} from './workbench-resize.js';\n\n/** The standard toggle a Workbench renders for a panel (see {@link PanelToggle}). */\nexport type WorkbenchPanelToggle = PanelToggle;\n\n/**\n * A Workbench panel's top toolbar, composed by the Workbench so its groups can\n * follow the panel's open state (see {@link PanelToolbar} for the roles).\n * A collapsed rail's marked groups and toggle go to the leading edge of\n * `mainToolbar` (left rail) or its trailing edge (right rail); a collapsed\n * drawer's go to the trailing edge of `mainBottomToolbar`, else to a\n * `FloatingToolbar` in the work area's bottom-end corner.\n */\nexport type WorkbenchPanelToolbar = PanelToolbar;\n\n/**\n * The work area's top toolbar; collapsed rails add their groups to it. Its\n * configuration forwards to its `Toolbar`. It draws no divider of its own by\n * default: the work area's `Pane` draws one under its header chrome, wherever\n * that chrome ends, while `main` is scrolled (`mainPane.chromeDividers`).\n */\nexport interface WorkbenchMainToolbar extends ToolbarConfig {\n label: string;\n /** The work area's title, usually an extra-large `ToolbarText`. */\n title?: KerfUiContent;\n /** Groups after the title. */\n leading?: KerfUiContent;\n center?: KerfUiContent;\n /** Groups at the trailing edge, before a collapsed right rail's groups. */\n trailing?: KerfUiContent;\n}\n\n/**\n * The work area's bottom toolbar; a collapsed drawer adds its groups to it.\n * Its configuration forwards to its `Toolbar`. It draws no divider of its own\n * by default: the work area's `Pane` draws one over its footer chrome while\n * more of `main` lies below (`mainPane.chromeDividers`).\n */\nexport interface WorkbenchMainBottomToolbar extends ToolbarConfig {\n label: string;\n leading?: KerfUiContent;\n center?: KerfUiContent;\n trailing?: KerfUiContent;\n}\n\nconst SIDES: Record<WorkbenchPanelKey, PanelSide> = {\n leftRail: 'left',\n rightRail: 'right',\n bottomDrawer: 'bottom',\n};\n\n/** A panel as far as its toolbar is concerned. */\nexport interface WorkbenchToolbarPanel {\n toolbar?: WorkbenchPanelToolbar;\n footer?: KerfUiContent;\n /** Configuration for the `Pane` a `toolbar` panel's content renders in. */\n pane?: PaneConfig;\n content: KerfUiContent;\n collapsed?: boolean;\n /** The corner a collapsed panel's restore controls float in. */\n restorePosition?: FloatingToolbarPosition;\n}\n\n/** A Workbench toggle's wiring hooks: its side, morph key, and panel. */\nconst toggleAttributes = (\n workbenchId: string,\n key: WorkbenchPanelKey,\n): PanelToggleAttributes => ({\n 'data-workbench-toggle': SIDES[key],\n // Keyed, so the morph removes a toggle that leaves a toolbar instead of\n // reusing its (possibly focused) button for a different control.\n 'data-key': `${workbenchRegionId(workbenchId, key)}-toggle`,\n 'aria-controls': workbenchRegionId(workbenchId, key),\n});\n\n/**\n * The groups a collapsed panel hands to the work area: its marked groups,\n * then its toggle. Empty while the panel is open or has no toolbar.\n */\nexport function relocatedGroups(\n workbenchId: string,\n key: WorkbenchPanelKey,\n panel: WorkbenchToolbarPanel | undefined,\n): KerfUiContent[] {\n return relocatedPanelGroups(\n panel?.toolbar,\n SIDES[key],\n Boolean(panel?.collapsed),\n toggleAttributes(workbenchId, key),\n );\n}\n\n/**\n * A panel's content, wrapped in a `Pane` under its composed toolbar when it\n * has one (with its optional `footer` below). Without a toolbar the content\n * renders as given.\n */\nexport function panelBody(\n workbenchId: string,\n key: WorkbenchPanelKey,\n panel: WorkbenchToolbarPanel,\n) {\n const toolbar = panel.toolbar;\n if (!toolbar) return panel.content;\n return composedPanelBody({\n toolbar,\n side: SIDES[key],\n collapsed: Boolean(panel.collapsed),\n attributes: toggleAttributes(workbenchId, key),\n pane: panel.pane,\n footer: panel.footer,\n content: panel.content,\n });\n}\n\n/**\n * The work area's `mainHeader` / `mainFooter` chrome in a `List` carrying the\n * app's configuration; an omitted or `undefined` field keeps the `List`\n * default (no divider: the work area's `Pane` draws its chrome dividers).\n */\nfunction chromeList(content: KerfUiContent, config: ListConfig | undefined) {\n return (\n <List\n dividerSides={config?.dividerSides}\n gap={config?.gap}\n hAlign={config?.hAlign}\n vAlign={config?.vAlign}\n textInsets={config?.textInsets}\n controlInsets={config?.controlInsets}\n >\n {content}\n </List>\n );\n}\n\n/**\n * Whether the work area's header or footer chrome stays pinned (`fixed`),\n * scrolls away with the content (`scroll`), or stays pinned while the work\n * area is tall enough and scrolls with the content when it is short (`auto`,\n * the Pane's `chromePlacement=\"auto\"`; it applies to the pinned header and\n * footer together).\n */\nexport type WorkbenchChromePlacement = 'fixed' | 'scroll' | 'auto';\n\n/**\n * The work area: the app's `main` in a `Pane` (configured by `mainPane`)\n * under `mainToolbar` and any `mainHeader` list, and above any `mainFooter`\n * list and `mainBottomToolbar` (the header and footer lists configured by\n * `mainHeaderList` / `mainFooterList`), with each collapsed panel's groups\n * added to the toolbar on its side. Without any of that chrome, `main`\n * renders as given and `mainPane` is ignored.\n */\nexport function mainBody({\n workbenchId,\n main,\n mainToolbar,\n mainHeader,\n mainFooter,\n mainBottomToolbar,\n mainHeaderPlacement = 'fixed',\n mainFooterPlacement = 'fixed',\n mainPane,\n mainHeaderList,\n mainFooterList,\n leftRail,\n rightRail,\n bottomDrawer,\n}: {\n workbenchId: string;\n main: KerfUiContent;\n mainToolbar?: WorkbenchMainToolbar;\n mainHeader?: KerfUiContent;\n mainFooter?: KerfUiContent;\n mainBottomToolbar?: WorkbenchMainBottomToolbar;\n mainHeaderPlacement?: WorkbenchChromePlacement;\n mainFooterPlacement?: WorkbenchChromePlacement;\n mainPane?: PaneConfig;\n mainHeaderList?: ListConfig;\n mainFooterList?: ListConfig;\n leftRail?: WorkbenchToolbarPanel;\n rightRail?: WorkbenchToolbarPanel;\n bottomDrawer?: WorkbenchToolbarPanel;\n}) {\n if (!mainToolbar && !mainBottomToolbar && !mainHeader && !mainFooter)\n return main;\n const left = relocatedGroups(workbenchId, 'leftRail', leftRail);\n const right = relocatedGroups(workbenchId, 'rightRail', rightRail);\n const drawer = mainBottomToolbar\n ? relocatedGroups(workbenchId, 'bottomDrawer', bottomDrawer)\n : [];\n // The Pane draws one divider under the header chrome and one over the\n // footer chrome, wherever that chrome ends, from the scroll state.\n const header =\n !mainToolbar && !mainHeader ? undefined : (\n <>\n {mainToolbar ? (\n <Toolbar\n label={mainToolbar.label}\n dividerSides={mainToolbar.dividerSides}\n centerAlign={mainToolbar.centerAlign}\n responsive={mainToolbar.responsive}\n responsiveAt={mainToolbar.responsiveAt}\n safeAreaEdges={mainToolbar.safeAreaEdges}\n leading={\n <>\n {left}\n {mainToolbar.title}\n {mainToolbar.leading}\n </>\n }\n center={mainToolbar.center}\n trailing={\n <>\n {mainToolbar.trailing}\n {right}\n </>\n }\n />\n ) : null}\n {mainHeader ? chromeList(mainHeader, mainHeaderList) : null}\n </>\n );\n const footer =\n !mainFooter && !mainBottomToolbar ? undefined : (\n <>\n {mainFooter ? chromeList(mainFooter, mainFooterList) : null}\n {mainBottomToolbar ? (\n <Toolbar\n label={mainBottomToolbar.label}\n dividerSides={mainBottomToolbar.dividerSides}\n centerAlign={mainBottomToolbar.centerAlign}\n responsive={mainBottomToolbar.responsive}\n responsiveAt={mainBottomToolbar.responsiveAt}\n safeAreaEdges={mainBottomToolbar.safeAreaEdges}\n leading={mainBottomToolbar.leading}\n center={mainBottomToolbar.center}\n trailing={\n <>\n {mainBottomToolbar.trailing}\n {drawer}\n </>\n }\n />\n ) : null}\n </>\n );\n const scrollHeader = mainHeaderPlacement === 'scroll';\n const scrollFooter = mainFooterPlacement === 'scroll';\n return (\n <Pane\n header={scrollHeader ? undefined : header}\n footer={scrollFooter ? undefined : footer}\n chromePlacement={\n mainHeaderPlacement === 'auto' || mainFooterPlacement === 'auto'\n ? 'auto'\n : 'fixed'\n }\n contentElement={mainPane?.contentElement}\n contentLabel={mainPane?.contentLabel}\n separators={mainPane?.separators}\n safeAreaEdges={mainPane?.safeAreaEdges}\n chromeDividers={mainPane?.chromeDividers}\n >\n {scrollHeader || scrollFooter ? (\n // Chrome that scrolls joins the content in one gapless column that\n // fills the scroller, so it scrolls away with the content.\n <List flex>\n {scrollHeader ? header : null}\n {main}\n {scrollFooter ? footer : null}\n </List>\n ) : (\n main\n )}\n </Pane>\n );\n}\n\n/**\n * A collapsed panel's groups when the work area has no toolbar on its side\n * to take them: a `FloatingToolbar` for the panel's restore corner, so the\n * panel can always be reopened.\n */\nexport function floatingRestore(\n workbenchId: string,\n key: WorkbenchPanelKey,\n panel: WorkbenchToolbarPanel | undefined,\n hasTargetToolbar: boolean,\n) {\n if (hasTargetToolbar) return undefined;\n const groups = relocatedGroups(workbenchId, key, panel);\n if (groups.length === 0) return undefined;\n return (\n <FloatingToolbar\n label={panel!.toolbar!.label}\n position={\n panel!.restorePosition ??\n (key === 'leftRail' ? 'bottom-start' : 'bottom-end')\n }\n >\n {groups}\n </FloatingToolbar>\n );\n}\n","import type { SafeHtml } from 'kerfjs';\n\nimport type { ListConfig } from './list.js';\nimport type { PaneConfig } from './pane.js';\nimport {\n clampRegionSize,\n type ResizableRegionAxis,\n type ResizableRegionCollapseMotion,\n type ResizableRegionContentOverflow,\n type ResizableRegionEdge,\n type ResizableRegionPresentation,\n type ResizableRegionRestorePosition,\n type ResizableRegionSeparator,\n} from './resizable-region.js';\nimport { ResizeGrip } from './resize-grip.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport {\n WORKBENCH_MAIN_MIN_HEIGHT,\n WORKBENCH_MAIN_MIN_SIZE,\n WORKBENCH_RESIZE_DEFAULTS,\n type WorkbenchPanelKey,\n workbenchRegionId,\n} from './workbench-resize.js';\nimport {\n floatingRestore,\n mainBody,\n panelBody,\n type WorkbenchChromePlacement,\n type WorkbenchMainBottomToolbar,\n type WorkbenchMainToolbar,\n type WorkbenchPanelToolbar,\n} from './workbench-toolbars.js';\n\nexport type {\n WorkbenchChromePlacement,\n WorkbenchMainBottomToolbar,\n WorkbenchMainToolbar,\n WorkbenchPanelToggle,\n WorkbenchPanelToolbar,\n} from './workbench-toolbars.js';\n\n/**\n * The Workbench container breakpoint below which a panel presents as an\n * overlay: `narrow` (704px or less) or `compact` (448px or less) — the same\n * breakpoints as `ResizableRegion`'s `responsiveFillAt` — or `never` to keep\n * it inline at every width.\n */\nexport type WorkbenchResponsiveOverlayAt = 'compact' | 'narrow' | 'never';\n\n/**\n * How wide a rail's overlay is in a compact (448px or less) Workbench: `inset`\n * fills the Workbench less a dismiss margin on the side away from the rail's\n * edge, so a press beside it closes it; `full` fills the Workbench.\n */\nexport type WorkbenchCompactOverlay = 'inset' | 'full';\n\n/** Drag-resize limits for a resizable Workbench panel, in px. */\nexport interface WorkbenchPanelResizable {\n /** Smallest size (default 180 for a rail, 120 for the drawer). */\n min?: number;\n /** Largest size (default 480). */\n max?: number;\n}\n\n/** A collapsible Workbench panel — a side rail or the bottom drawer. */\nexport interface WorkbenchPanel {\n content: KerfUiContent;\n /**\n * The panel's top toolbar, composed by the Workbench: its marked groups\n * and standard `toggle` move to the work area's toolbar while the panel is\n * collapsed. With it, `content` renders in a `Pane` below the toolbar.\n */\n toolbar?: WorkbenchPanelToolbar;\n /** Optional bottom toolbar under a `toolbar` panel's content. */\n footer?: KerfUiContent;\n /**\n * Configuration for a `toolbar` panel's `Pane` (`contentElement`,\n * `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`) — for example\n * `{ contentElement: 'nav', contentLabel: 'Sections' }` for a navigation\n * rail. Omitted or `undefined` fields keep the `Pane` defaults. Ignored\n * without a `toolbar`, where `content` renders as given.\n */\n pane?: PaneConfig;\n /** Whether the panel is currently collapsed (the app owns this). */\n collapsed?: boolean;\n /**\n * Rail width, or drawer height, in px. Overrides the CSS default. For a\n * resizable panel it is the current size (default 280 for a rail, 220 for\n * the drawer), clamped to the limits; the app owns it and `wireWorkbench`\n * reports each resize.\n */\n size?: number;\n /**\n * Opt in to drag and keyboard resizing on the panel's inner separator:\n * `true` for the default limits, or `{ min, max }`. Off by default. Pair it\n * with `wireWorkbench` from `@kerfjs/ui/wire-workbench`.\n */\n resizable?: boolean | WorkbenchPanelResizable;\n /** Accessible name for the panel region. */\n label?: string;\n separator?: ResizableRegionSeparator;\n collapseMotion?: ResizableRegionCollapseMotion;\n contentOverflow?: ResizableRegionContentOverflow;\n presentation?: ResizableRegionPresentation;\n /**\n * Present the panel as an overlay, without a separator, below a Workbench\n * container breakpoint, and inline above it — the CSS decides, so the app\n * needs no device-class check. A rail overlays from its side at full\n * height, over the work area and an open drawer; the bottom drawer\n * overlays the bottom of the work-area column. Rails default to `narrow`\n * (pass `never` to keep one inline); the drawer defaults to inline.\n */\n responsiveOverlayAt?: WorkbenchResponsiveOverlayAt;\n /**\n * A rail's overlay width in a compact Workbench (default `inset`: the\n * Workbench less `--kui-workbench-overlay-dismiss-margin`, 44px). Ignored\n * by the drawer.\n */\n compactOverlay?: WorkbenchCompactOverlay;\n /**\n * Control shown while collapsed, in a safe-area-aware corner of the\n * Workbench (not the viewport); the bottom drawer's sits in the work-area\n * column. Prefer `toolbar.toggle`, which the Workbench relocates into the\n * work area's toolbar (or this corner when that toolbar is absent).\n */\n restoreControl?: SafeHtml;\n restorePosition?: ResizableRegionRestorePosition;\n}\n\nexport interface WorkbenchProps {\n /**\n * The Workbench's `id`. Each panel's `id` derives from it —\n * `<id>-left-rail`, `<id>-right-rail`, `<id>-bottom-drawer` — so a toggle\n * can name the panel it shows and hides with `aria-controls`.\n */\n id: string;\n label: string;\n /** The central work area. */\n main: KerfUiContent;\n /**\n * The work area's top toolbar. A collapsed left rail's marked groups\n * and toggle lead it; a collapsed right rail's trail it. With it, `main`\n * renders in a `Pane` below the toolbar.\n */\n mainToolbar?: WorkbenchMainToolbar;\n /**\n * Fixed content under `mainToolbar` — supporting copy such as a\n * description — divided from the scrolling `main` below it.\n */\n mainHeader?: KerfUiContent;\n /**\n * Fixed content over `mainBottomToolbar` — a status line or a resource\n * toolbar — divided from the scrolling `main` above it.\n */\n mainFooter?: KerfUiContent;\n /**\n * The work area's bottom toolbar. A collapsed drawer's marked groups and\n * toggle trail it; without it they float in the work area's corner.\n */\n mainBottomToolbar?: WorkbenchMainBottomToolbar;\n /**\n * Whether `mainToolbar` and `mainHeader` stay pinned (`fixed`, default),\n * scroll away with `main` (`scroll`) — useful where large text would leave\n * pinned chrome little room — or stay pinned while the work area is tall\n * enough and scroll with `main` when it is short (`auto`).\n */\n mainHeaderPlacement?: WorkbenchChromePlacement;\n /** The same for `mainFooter` and `mainBottomToolbar` (default `fixed`). */\n mainFooterPlacement?: WorkbenchChromePlacement;\n /**\n * Configuration for the work area's `Pane` (`contentElement`,\n * `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`), which it has whenever it\n * has a toolbar, `mainHeader`, or `mainFooter`; without that chrome, `main`\n * renders as given and this is ignored. Omitted or `undefined` fields keep\n * the `Pane` defaults.\n */\n mainPane?: PaneConfig;\n /**\n * Configuration for the `List` that holds `mainHeader` (`gap`, `hAlign`,\n * `vAlign`, `dividerSides`, `textInsets`, `controlInsets`). Omitted or\n * `undefined` fields keep the defaults (no divider: the work area's\n * `Pane` draws the line under its header chrome).\n */\n mainHeaderList?: ListConfig;\n /**\n * The same for the `List` that holds `mainFooter` (no divider by default:\n * the work area's `Pane` draws the line over its footer chrome).\n */\n mainFooterList?: ListConfig;\n leftRail?: WorkbenchPanel;\n rightRail?: WorkbenchPanel;\n bottomDrawer?: WorkbenchPanel;\n /**\n * Minimum width, in px, the work area keeps beside the inline rails, fixed\n * or `resizable` (default 320; `0` turns it off). Resizing a rail stops\n * where the work area would drop below it, and inline rails shrink\n * proportionally when the Workbench gets narrower. Workbenches without a\n * rail ignore it.\n */\n mainMinSize?: number;\n /**\n * Minimum height, in px, the work area keeps above an inline bottom drawer,\n * fixed or `resizable` (default 120; `0` turns it off) — the drawer's\n * counterpart of `mainMinSize`. Resizing the drawer stops where the work\n * area would drop below it, and the drawer shrinks when the Workbench gets\n * shorter. Workbenches without a drawer ignore it.\n */\n mainMinHeight?: number;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\ninterface ResolvedResize {\n regionId: string;\n axis: ResizableRegionAxis;\n edge: ResizableRegionEdge;\n size: number;\n min: number;\n max: number;\n}\n\n/**\n * Each panel's separator is its inner edge. Growing the left rail moves that\n * edge toward the inline end; growing the right rail or the drawer moves it\n * toward the start — the same edge vocabulary `ResizableRegion` uses.\n */\nconst EDGES: Record<WorkbenchPanelKey, ResizableRegionEdge> = {\n leftRail: 'end',\n rightRail: 'start',\n bottomDrawer: 'start',\n};\n\nconst DEFAULT_LABELS: Record<WorkbenchPanelKey, string> = {\n leftRail: 'left rail',\n rightRail: 'right rail',\n bottomDrawer: 'bottom drawer',\n};\n\nfunction resolveResize(\n id: string,\n key: WorkbenchPanelKey,\n panel: WorkbenchPanel,\n): ResolvedResize | undefined {\n if (!panel.resizable) return undefined;\n const defaults = WORKBENCH_RESIZE_DEFAULTS[key];\n const limits = panel.resizable === true ? {} : panel.resizable;\n const min = limits.min ?? defaults.min;\n const max = Math.max(min, limits.max ?? defaults.max);\n return {\n regionId: workbenchRegionId(id, key),\n axis: key === 'bottomDrawer' ? 'vertical' : 'horizontal',\n edge: EDGES[key],\n size: clampRegionSize(panel.size ?? defaults.size, min, max),\n min,\n max,\n };\n}\n\n/** The attributes a resizable panel adds for the resize wiring to read. */\nconst resizeAttributes = (resize: ResolvedResize | undefined) =>\n resize\n ? {\n 'data-resizable': 'true',\n 'data-region-id': resize.regionId,\n 'data-axis': resize.axis,\n 'data-edge': resize.edge,\n }\n : {};\n\n/**\n * A resizable panel's size lives in the resize wiring's track property, so a\n * drag or key press resizes the panel before the app re-renders; the CSS maps\n * it onto the rail width or drawer height.\n */\nfunction panelStyle(\n panel: WorkbenchPanel,\n resize: ResolvedResize | undefined,\n sizeProperty: string,\n) {\n if (resize) return `--kui-resizable-region-size:${resize.size}px`;\n return panel.size ? `${sizeProperty}: ${panel.size}px` : undefined;\n}\n\n/**\n * The separator a resizable panel owns: the same focusable `role=\"separator\"`\n * contract a `ResizableRegion` handle carries, so one resize wiring drives\n * both. It leaves the tab order while the panel is collapsed or not inline.\n */\nfunction PanelHandle({\n panel,\n resize,\n label,\n}: {\n panel: WorkbenchPanel;\n resize: ResolvedResize;\n label: string;\n}) {\n const inert =\n Boolean(panel.collapsed) || (panel.presentation ?? 'inline') !== 'inline';\n return (\n <div\n class=\"kui-workbench__handle\"\n role=\"separator\"\n tabindex={inert ? '-1' : '0'}\n aria-label={`Resize ${label}`}\n aria-orientation={\n resize.axis === 'horizontal' ? 'vertical' : 'horizontal'\n }\n aria-valuemin={resize.min}\n aria-valuemax={resize.max}\n aria-valuenow={resize.size}\n aria-hidden={inert ? 'true' : undefined}\n data-kui-resize-handle\n data-region-id={resize.regionId}\n >\n <span class=\"kui-workbench__handle-icon\" aria-hidden=\"true\">\n <ResizeGrip axis={resize.axis} />\n </span>\n </div>\n );\n}\n\n/**\n * A collapsed panel leaves the accessibility tree as a whole, like a collapsed\n * `CollapsiblePanel`: its content and separator are already inert or hidden,\n * so the labeled landmark would otherwise stay behind, empty, for a screen\n * reader to land on. Its restore control renders outside it and stays\n * reachable.\n */\nfunction hiddenFromAccessibility(panel: WorkbenchPanel) {\n return panel.collapsed || panel.presentation === 'hidden'\n ? ('true' as const)\n : undefined;\n}\n\n/** A breakpoint's attribute value; `never` (or none) renders no attribute. */\nconst responsiveAt = (at: WorkbenchResponsiveOverlayAt | undefined) =>\n at === 'never' ? undefined : at;\n\nfunction Rail({\n id,\n side,\n panel,\n}: {\n id: string;\n side: 'left' | 'right';\n panel: WorkbenchPanel;\n}) {\n const key: WorkbenchPanelKey = side === 'left' ? 'leftRail' : 'rightRail';\n const resize = resolveResize(id, key, panel);\n return (\n <aside\n id={workbenchRegionId(id, key)}\n class={`kui-workbench__rail kui-workbench__rail--${side}`}\n data-workbench-rail={side}\n data-collapsed={String(panel.collapsed ?? false)}\n data-separator={panel.separator ?? 'auto'}\n data-collapse-motion={panel.collapseMotion ?? 'slide'}\n data-content-overflow={panel.contentOverflow ?? 'clip'}\n data-presentation={panel.presentation ?? 'inline'}\n data-responsive-overlay-at={responsiveAt(\n panel.responsiveOverlayAt ?? 'narrow',\n )}\n data-compact-overlay={panel.compactOverlay ?? 'inset'}\n {...resizeAttributes(resize)}\n aria-label={panel.label || undefined}\n aria-hidden={hiddenFromAccessibility(panel)}\n inert={Boolean(panel.collapsed)}\n style={panelStyle(panel, resize, '--kui-workbench-rail-width')}\n >\n <div\n class=\"kui-workbench__panel-content\"\n data-workbench-panel-content\n inert={Boolean(panel.collapsed)}\n >\n {panelBody(id, key, panel)}\n </div>\n {resize && (\n <PanelHandle\n panel={panel}\n resize={resize}\n label={panel.label || DEFAULT_LABELS[key]}\n />\n )}\n </aside>\n );\n}\n\nfunction Drawer({ id, panel }: { id: string; panel: WorkbenchPanel }) {\n const resize = resolveResize(id, 'bottomDrawer', panel);\n return (\n <section\n id={workbenchRegionId(id, 'bottomDrawer')}\n class=\"kui-workbench__drawer\"\n data-workbench-drawer\n data-collapsed={String(panel.collapsed ?? false)}\n data-separator={panel.separator ?? 'auto'}\n data-collapse-motion={panel.collapseMotion ?? 'slide'}\n data-content-overflow={panel.contentOverflow ?? 'clip'}\n data-presentation={panel.presentation ?? 'inline'}\n data-responsive-overlay-at={responsiveAt(panel.responsiveOverlayAt)}\n {...resizeAttributes(resize)}\n aria-label={panel.label || undefined}\n aria-hidden={hiddenFromAccessibility(panel)}\n inert={Boolean(panel.collapsed)}\n style={panelStyle(panel, resize, '--kui-workbench-drawer-height')}\n >\n <div\n class=\"kui-workbench__panel-content\"\n data-workbench-panel-content\n inert={Boolean(panel.collapsed)}\n >\n {panelBody(id, 'bottomDrawer', panel)}\n </div>\n {resize && (\n <PanelHandle\n panel={panel}\n resize={resize}\n label={panel.label || DEFAULT_LABELS.bottomDrawer}\n />\n )}\n </section>\n );\n}\n\n/** A collapsed panel's restore control, outside the clipped panel. */\nfunction restore(\n panel: WorkbenchPanel | undefined,\n side: 'left' | 'right' | 'bottom',\n position: ResizableRegionRestorePosition,\n generated: SafeHtml | undefined,\n) {\n const control = panel?.restoreControl ?? generated;\n if (!panel?.collapsed || !control || panel.presentation === 'hidden')\n return '';\n return (\n <div\n class=\"kui-workbench__restore\"\n data-panel={side}\n data-position={panel.restorePosition ?? position}\n >\n {control}\n </div>\n );\n}\n\n/**\n * The Xcode-like multi-panel workspace: a collapsible left rail, right rail, and\n * bottom drawer around a central work area (any absent). Collapsing snaps the\n * panel's track to zero in one reflow while its fixed-size content slides out via\n * a composited transform — the instant-width / sliding-content technique, so the\n * work area relayouts once, not per frame. Bottom-drawer content stays anchored\n * to the shell's stable bottom edge throughout that transition. The app owns\n * each `collapsed` flag; the collapse is pure CSS. A collapsed panel renders\n * `inert` and `aria-hidden`, so neither Tab nor assistive technology reaches\n * controls that have slid out of view or an empty landmark (its restore control\n * lives outside it and stays reachable). A panel may opt in to drag and keyboard resizing with\n * `resizable`, which `wireWorkbench` drives. See `docs/23-app-layouts.md` §3.3.\n */\nexport function Workbench({\n id,\n label,\n main,\n leftRail,\n rightRail,\n bottomDrawer,\n mainToolbar,\n mainHeader,\n mainFooter,\n mainBottomToolbar,\n mainHeaderPlacement,\n mainFooterPlacement,\n mainPane,\n mainHeaderList,\n mainFooterList,\n mainMinSize = WORKBENCH_MAIN_MIN_SIZE,\n mainMinHeight = WORKBENCH_MAIN_MIN_HEIGHT,\n className = '',\n slot,\n}: WorkbenchProps) {\n // Each work-area minimum applies only on an axis a panel shares with it:\n // the width beside a rail, the height above the drawer.\n const px = (value: number) => Math.max(0, Math.round(value));\n const mainMin = leftRail || rightRail ? px(mainMinSize) : undefined;\n const mainMinBlock = bottomDrawer ? px(mainMinHeight) : undefined;\n const style = [\n mainMin === undefined ? '' : `--_kui-workbench-main-min-width:${mainMin}px`,\n mainMinBlock === undefined\n ? ''\n : `--_kui-workbench-main-min-height:${mainMinBlock}px`,\n ]\n .filter(Boolean)\n .join(';');\n return (\n <section\n class={`kui-workbench ${className}`.trim()}\n id={id}\n data-component=\"workbench\"\n data-main-min-size={mainMin === undefined ? undefined : String(mainMin)}\n data-main-min-height={\n mainMinBlock === undefined ? undefined : String(mainMinBlock)\n }\n style={style || undefined}\n aria-label={label}\n slot={slot}\n >\n {leftRail && <Rail id={id} side=\"left\" panel={leftRail} />}\n {restore(\n leftRail,\n 'left',\n 'bottom-start',\n floatingRestore(id, 'leftRail', leftRail, Boolean(mainToolbar)),\n )}\n <div class=\"kui-workbench__center\">\n <div class=\"kui-workbench__main\" data-workbench-main>\n {mainBody({\n workbenchId: id,\n main,\n mainToolbar,\n mainHeader,\n mainFooter,\n mainBottomToolbar,\n mainHeaderPlacement,\n mainFooterPlacement,\n mainPane,\n mainHeaderList,\n mainFooterList,\n leftRail,\n rightRail,\n bottomDrawer,\n })}\n </div>\n {bottomDrawer && <Drawer id={id} panel={bottomDrawer} />}\n {restore(\n bottomDrawer,\n 'bottom',\n 'bottom-end',\n floatingRestore(\n id,\n 'bottomDrawer',\n bottomDrawer,\n Boolean(mainBottomToolbar),\n ),\n )}\n </div>\n {rightRail && <Rail id={id} side=\"right\" panel={rightRail} />}\n {restore(\n rightRail,\n 'right',\n 'bottom-end',\n floatingRestore(id, 'rightRail', rightRail, Boolean(mainToolbar)),\n )}\n </section>\n );\n}\n"]}