@k2b/ui 0.64.0 → 0.65.0

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 (214) hide show
  1. package/dist/base.css +3 -6
  2. package/dist/browser/actions/ContextMenu.js +1 -3
  3. package/dist/browser/actions/ContextMenu.js.map +1 -1
  4. package/dist/browser/actions/Dropdown.js +15 -69
  5. package/dist/browser/actions/Dropdown.js.map +1 -1
  6. package/dist/browser/actions/SortableList.js +1 -1
  7. package/dist/browser/actions/SortableList.js.map +1 -1
  8. package/dist/browser/actions/ViewTabs.js +5 -9
  9. package/dist/browser/actions/ViewTabs.js.map +1 -1
  10. package/dist/browser/actions/drag-and-drop.js +1 -1
  11. package/dist/browser/actions/drag-and-drop.js.map +1 -1
  12. package/dist/browser/actions/index.js.map +1 -1
  13. package/dist/browser/actions/menu-sheet.js +18 -80
  14. package/dist/browser/actions/menu-sheet.js.map +1 -1
  15. package/dist/browser/content/DataTable.js +197 -285
  16. package/dist/browser/content/DataTable.js.map +1 -1
  17. package/dist/browser/content/MessageRow.js +139 -115
  18. package/dist/browser/content/MessageRow.js.map +1 -1
  19. package/dist/browser/content/ProgressPath.js +25 -30
  20. package/dist/browser/content/ProgressPath.js.map +1 -1
  21. package/dist/browser/content/index.js +0 -2
  22. package/dist/browser/content/index.js.map +1 -1
  23. package/dist/browser/feedback/dialog-core.js +0 -11
  24. package/dist/browser/feedback/dialog-core.js.map +1 -1
  25. package/dist/browser/internal/field.js +2 -2
  26. package/dist/browser/internal/field.js.map +1 -1
  27. package/dist/browser/intl/messages.js +1 -1
  28. package/dist/browser/intl/messages.js.map +1 -1
  29. package/dist/browser/layout/AppWorkspace.js +8 -16
  30. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  31. package/dist/browser/layout/Breadcrumbs.js +42 -188
  32. package/dist/browser/layout/Breadcrumbs.js.map +1 -1
  33. package/dist/browser/layout/DetailPanel.js +205 -209
  34. package/dist/browser/layout/DetailPanel.js.map +1 -1
  35. package/dist/browser/layout/PanelDialog.js +88 -176
  36. package/dist/browser/layout/PanelDialog.js.map +1 -1
  37. package/dist/browser/layout/app-workspace-controller.js +5 -12
  38. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  39. package/dist/browser/layout/app-workspace-state.js +2 -2
  40. package/dist/browser/layout/app-workspace-state.js.map +1 -1
  41. package/dist/browser/layout/index.js +0 -2
  42. package/dist/browser/layout/index.js.map +1 -1
  43. package/dist/browser/layout/workspace-messages.js +2 -12
  44. package/dist/browser/layout/workspace-messages.js.map +1 -1
  45. package/dist/browser/surfaces/NoticeCard.js +57 -69
  46. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  47. package/dist/browser/surfaces/Placeholder.js +5 -17
  48. package/dist/browser/surfaces/Placeholder.js.map +1 -1
  49. package/dist/browser/surfaces/Section.js +7 -22
  50. package/dist/browser/surfaces/Section.js.map +1 -1
  51. package/dist/browser/surfaces/StatusBadge.js +1 -5
  52. package/dist/browser/surfaces/StatusBadge.js.map +1 -1
  53. package/dist/browser/surfaces/index.js +0 -4
  54. package/dist/browser/surfaces/index.js.map +1 -1
  55. package/dist/ssr/actions/ContextMenu.js +1 -3
  56. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  57. package/dist/ssr/actions/Dropdown.js +15 -69
  58. package/dist/ssr/actions/Dropdown.js.map +1 -1
  59. package/dist/ssr/actions/SortableList.js +1 -1
  60. package/dist/ssr/actions/SortableList.js.map +1 -1
  61. package/dist/ssr/actions/ViewTabs.js +5 -9
  62. package/dist/ssr/actions/ViewTabs.js.map +1 -1
  63. package/dist/ssr/actions/drag-and-drop.js +1 -1
  64. package/dist/ssr/actions/drag-and-drop.js.map +1 -1
  65. package/dist/ssr/actions/index.js.map +1 -1
  66. package/dist/ssr/actions/menu-sheet.js +10 -62
  67. package/dist/ssr/actions/menu-sheet.js.map +1 -1
  68. package/dist/ssr/content/DataTable.js +54 -64
  69. package/dist/ssr/content/DataTable.js.map +1 -1
  70. package/dist/ssr/content/MessageRow.js +30 -10
  71. package/dist/ssr/content/MessageRow.js.map +1 -1
  72. package/dist/ssr/content/ProgressPath.js +8 -14
  73. package/dist/ssr/content/ProgressPath.js.map +1 -1
  74. package/dist/ssr/content/index.js +0 -2
  75. package/dist/ssr/content/index.js.map +1 -1
  76. package/dist/ssr/feedback/dialog-core.js +0 -11
  77. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  78. package/dist/ssr/internal/field.js +2 -2
  79. package/dist/ssr/internal/field.js.map +1 -1
  80. package/dist/ssr/intl/messages.js +1 -1
  81. package/dist/ssr/intl/messages.js.map +1 -1
  82. package/dist/ssr/layout/AppWorkspace.js +8 -16
  83. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  84. package/dist/ssr/layout/Breadcrumbs.js +26 -140
  85. package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
  86. package/dist/ssr/layout/DetailPanel.js +68 -70
  87. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  88. package/dist/ssr/layout/PanelDialog.js +8 -82
  89. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  90. package/dist/ssr/layout/app-workspace-controller.js +5 -12
  91. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  92. package/dist/ssr/layout/app-workspace-state.js +2 -2
  93. package/dist/ssr/layout/app-workspace-state.js.map +1 -1
  94. package/dist/ssr/layout/index.js +0 -2
  95. package/dist/ssr/layout/index.js.map +1 -1
  96. package/dist/ssr/layout/workspace-messages.js +2 -12
  97. package/dist/ssr/layout/workspace-messages.js.map +1 -1
  98. package/dist/ssr/surfaces/NoticeCard.js +5 -7
  99. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  100. package/dist/ssr/surfaces/Placeholder.js +4 -15
  101. package/dist/ssr/surfaces/Placeholder.js.map +1 -1
  102. package/dist/ssr/surfaces/Section.js +4 -7
  103. package/dist/ssr/surfaces/Section.js.map +1 -1
  104. package/dist/ssr/surfaces/StatusBadge.js +1 -5
  105. package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
  106. package/dist/ssr/surfaces/index.js +0 -4
  107. package/dist/ssr/surfaces/index.js.map +1 -1
  108. package/dist/styles.css +1 -1
  109. package/dist/types/actions/Dropdown.d.ts +1 -35
  110. package/dist/types/actions/ViewTabs.d.ts +2 -3
  111. package/dist/types/actions/index.d.ts +1 -1
  112. package/dist/types/actions/menu-sheet.d.ts +1 -3
  113. package/dist/types/content/DataTable.d.ts +0 -19
  114. package/dist/types/content/MessageRow.d.ts +11 -0
  115. package/dist/types/content/ProgressPath.d.ts +6 -12
  116. package/dist/types/content/index.d.ts +0 -2
  117. package/dist/types/feedback/dialog-core.d.ts +0 -5
  118. package/dist/types/layout/AppWorkspace.d.ts +2 -10
  119. package/dist/types/layout/Breadcrumbs.d.ts +5 -10
  120. package/dist/types/layout/PanelDialog.d.ts +0 -19
  121. package/dist/types/layout/app-workspace-state.d.ts +2 -2
  122. package/dist/types/layout/index.d.ts +1 -5
  123. package/dist/types/layout/workspace-messages.d.ts +0 -5
  124. package/dist/types/surfaces/NoticeCard.d.ts +4 -6
  125. package/dist/types/surfaces/Placeholder.d.ts +0 -7
  126. package/dist/types/surfaces/Section.d.ts +2 -8
  127. package/dist/types/surfaces/StatusBadge.d.ts +1 -2
  128. package/dist/types/surfaces/index.d.ts +1 -9
  129. package/package.json +2 -7
  130. package/dist/browser/actions/menu-sheet-messages.js +0 -26
  131. package/dist/browser/actions/menu-sheet-messages.js.map +0 -1
  132. package/dist/browser/actions/menu-submenu-panel.js +0 -392
  133. package/dist/browser/actions/menu-submenu-panel.js.map +0 -1
  134. package/dist/browser/content/FileName.js +0 -68
  135. package/dist/browser/content/FileName.js.map +0 -1
  136. package/dist/browser/content/TaskRow.js +0 -129
  137. package/dist/browser/content/TaskRow.js.map +0 -1
  138. package/dist/browser/content/progress-path-messages.js +0 -22
  139. package/dist/browser/content/progress-path-messages.js.map +0 -1
  140. package/dist/browser/feedback/dialog-foot.js +0 -45
  141. package/dist/browser/feedback/dialog-foot.js.map +0 -1
  142. package/dist/browser/internal/renders-something.js +0 -3
  143. package/dist/browser/internal/renders-something.js.map +0 -1
  144. package/dist/browser/layout/FloatingPill.js +0 -33
  145. package/dist/browser/layout/FloatingPill.js.map +0 -1
  146. package/dist/browser/layout/StatusRow.js +0 -174
  147. package/dist/browser/layout/StatusRow.js.map +0 -1
  148. package/dist/browser/layout/panel-dialog-error.js +0 -44
  149. package/dist/browser/layout/panel-dialog-error.js.map +0 -1
  150. package/dist/browser/layout/panel-sheet-handle.js +0 -86
  151. package/dist/browser/layout/panel-sheet-handle.js.map +0 -1
  152. package/dist/browser/layout-check.js +0 -232
  153. package/dist/browser/layout-check.js.map +0 -1
  154. package/dist/browser/surfaces/Area.js +0 -205
  155. package/dist/browser/surfaces/Area.js.map +0 -1
  156. package/dist/browser/surfaces/FactGroup.js +0 -148
  157. package/dist/browser/surfaces/FactGroup.js.map +0 -1
  158. package/dist/browser/surfaces/FieldGrid.js +0 -34
  159. package/dist/browser/surfaces/FieldGrid.js.map +0 -1
  160. package/dist/browser/surfaces/RowGroup.js +0 -82
  161. package/dist/browser/surfaces/RowGroup.js.map +0 -1
  162. package/dist/browser/surfaces/flat-block-messages.js +0 -37
  163. package/dist/browser/surfaces/flat-block-messages.js.map +0 -1
  164. package/dist/ssr/actions/menu-sheet-messages.js +0 -26
  165. package/dist/ssr/actions/menu-sheet-messages.js.map +0 -1
  166. package/dist/ssr/actions/menu-submenu-panel.js +0 -295
  167. package/dist/ssr/actions/menu-submenu-panel.js.map +0 -1
  168. package/dist/ssr/content/FileName.js +0 -46
  169. package/dist/ssr/content/FileName.js.map +0 -1
  170. package/dist/ssr/content/TaskRow.js +0 -95
  171. package/dist/ssr/content/TaskRow.js.map +0 -1
  172. package/dist/ssr/content/progress-path-messages.js +0 -22
  173. package/dist/ssr/content/progress-path-messages.js.map +0 -1
  174. package/dist/ssr/feedback/dialog-foot.js +0 -45
  175. package/dist/ssr/feedback/dialog-foot.js.map +0 -1
  176. package/dist/ssr/internal/renders-something.js +0 -3
  177. package/dist/ssr/internal/renders-something.js.map +0 -1
  178. package/dist/ssr/layout/FloatingPill.js +0 -16
  179. package/dist/ssr/layout/FloatingPill.js.map +0 -1
  180. package/dist/ssr/layout/StatusRow.js +0 -93
  181. package/dist/ssr/layout/StatusRow.js.map +0 -1
  182. package/dist/ssr/layout/panel-dialog-error.js +0 -28
  183. package/dist/ssr/layout/panel-dialog-error.js.map +0 -1
  184. package/dist/ssr/layout/panel-sheet-handle.js +0 -66
  185. package/dist/ssr/layout/panel-sheet-handle.js.map +0 -1
  186. package/dist/ssr/layout-check.js +0 -232
  187. package/dist/ssr/layout-check.js.map +0 -1
  188. package/dist/ssr/surfaces/Area.js +0 -147
  189. package/dist/ssr/surfaces/Area.js.map +0 -1
  190. package/dist/ssr/surfaces/FactGroup.js +0 -106
  191. package/dist/ssr/surfaces/FactGroup.js.map +0 -1
  192. package/dist/ssr/surfaces/FieldGrid.js +0 -22
  193. package/dist/ssr/surfaces/FieldGrid.js.map +0 -1
  194. package/dist/ssr/surfaces/RowGroup.js +0 -60
  195. package/dist/ssr/surfaces/RowGroup.js.map +0 -1
  196. package/dist/ssr/surfaces/flat-block-messages.js +0 -37
  197. package/dist/ssr/surfaces/flat-block-messages.js.map +0 -1
  198. package/dist/types/actions/menu-sheet-messages.d.ts +0 -11
  199. package/dist/types/actions/menu-submenu-panel.d.ts +0 -27
  200. package/dist/types/content/FileName.d.ts +0 -23
  201. package/dist/types/content/TaskRow.d.ts +0 -33
  202. package/dist/types/content/progress-path-messages.d.ts +0 -8
  203. package/dist/types/feedback/dialog-foot.d.ts +0 -9
  204. package/dist/types/internal/renders-something.d.ts +0 -2
  205. package/dist/types/layout/FloatingPill.d.ts +0 -20
  206. package/dist/types/layout/StatusRow.d.ts +0 -54
  207. package/dist/types/layout/panel-dialog-error.d.ts +0 -9
  208. package/dist/types/layout/panel-sheet-handle.d.ts +0 -8
  209. package/dist/types/layout-check.d.ts +0 -52
  210. package/dist/types/surfaces/Area.d.ts +0 -38
  211. package/dist/types/surfaces/FactGroup.d.ts +0 -33
  212. package/dist/types/surfaces/FieldGrid.d.ts +0 -14
  213. package/dist/types/surfaces/RowGroup.d.ts +0 -20
  214. package/dist/types/surfaces/flat-block-messages.d.ts +0 -16
@@ -5,8 +5,8 @@ export const APP_WORKSPACE_SIDEBAR_MIN = 176;
5
5
  export const APP_WORKSPACE_SIDEBAR_MAX = 360;
6
6
  /** Absolute persistence envelope for sidebars with an app-defined wider max. */
7
7
  const APP_WORKSPACE_SIDEBAR_STATE_MAX = 960;
8
- /** The detail column starts at 23.75 rem (380 px, K9) and keeps between 20 and 40 rem. */
9
- export const APP_WORKSPACE_DETAIL_DEFAULT = 380;
8
+ /** The floating detail panel starts at 26 rem and keeps between 20 and 40 rem. */
9
+ export const APP_WORKSPACE_DETAIL_DEFAULT = 416;
10
10
  export const APP_WORKSPACE_DETAIL_MIN = 320;
11
11
  export const APP_WORKSPACE_DETAIL_MAX = 640;
12
12
  export const APP_WORKSPACE_DRAWER_DEFAULT = 240;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["layout/app-workspace-state.ts"],"sourcesContent":["export type AppWorkspaceLayoutState = {\n version: 2;\n sidebarWidth?: number;\n sidebarCollapsed?: boolean;\n paneWidths?: Record<string, number>;\n detailWidths?: Record<string, number>;\n drawerHeights?: Record<string, number>;\n};\n\nexport const APP_WORKSPACE_SIDEBAR_DEFAULT = 208;\nexport const APP_WORKSPACE_SIDEBAR_COLLAPSED = 64;\nexport const APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD = 128;\nexport const APP_WORKSPACE_SIDEBAR_MIN = 176;\nexport const APP_WORKSPACE_SIDEBAR_MAX = 360;\n/** Absolute persistence envelope for sidebars with an app-defined wider max. */\nconst APP_WORKSPACE_SIDEBAR_STATE_MAX = 960;\n/** The detail column starts at 23.75 rem (380 px, K9) and keeps between 20 and 40 rem. */\nexport const APP_WORKSPACE_DETAIL_DEFAULT = 380;\nexport const APP_WORKSPACE_DETAIL_MIN = 320;\nexport const APP_WORKSPACE_DETAIL_MAX = 640;\nexport const APP_WORKSPACE_DRAWER_DEFAULT = 240;\nexport const APP_WORKSPACE_DRAWER_MIN = 160;\nexport const APP_WORKSPACE_DRAWER_MAX = 560;\n/** Space `appWorkspaceResizeLimits` always reserves for the main region. */\nexport const APP_WORKSPACE_MAIN_MIN = 320;\nexport const APP_WORKSPACE_MAIN_MIN_HEIGHT = 240;\nexport const APP_WORKSPACE_PANE_DEFAULT = 320;\nexport const APP_WORKSPACE_PANE_MIN = 240;\nexport const APP_WORKSPACE_PANE_MAX = 640;\n\n/** Persistence envelope; each pane still applies its own runtime limits. */\nconst APP_WORKSPACE_PANE_STATE_MIN = 160;\nconst APP_WORKSPACE_PANE_STATE_MAX = 960;\n\nexport type AppWorkspaceResizeKind = \"sidebar\" | \"pane\" | \"detail\" | \"drawer\";\n\nexport const appWorkspaceResizeLimits = (options: {\n kind: AppWorkspaceResizeKind;\n workspaceSize: number;\n reservedSize: number;\n min?: number;\n max?: number;\n sidebarCollapsible?: boolean;\n}): { min: number; max: number } => {\n const min =\n options.min ??\n (options.kind === \"sidebar\"\n ? options.sidebarCollapsible\n ? APP_WORKSPACE_SIDEBAR_COLLAPSED\n : APP_WORKSPACE_SIDEBAR_MIN\n : options.kind === \"detail\"\n ? APP_WORKSPACE_DETAIL_MIN\n : options.kind === \"pane\"\n ? APP_WORKSPACE_PANE_MIN\n : APP_WORKSPACE_DRAWER_MIN);\n const configuredMax =\n options.max ??\n (options.kind === \"sidebar\"\n ? APP_WORKSPACE_SIDEBAR_MAX\n : options.kind === \"detail\"\n ? APP_WORKSPACE_DETAIL_MAX\n : options.kind === \"pane\"\n ? APP_WORKSPACE_PANE_MAX\n : APP_WORKSPACE_DRAWER_MAX);\n const mainMinimum = options.kind === \"drawer\" ? APP_WORKSPACE_MAIN_MIN_HEIGHT : APP_WORKSPACE_MAIN_MIN;\n return { min, max: Math.max(min, Math.min(configuredMax, options.workspaceSize - options.reservedSize - mainMinimum)) };\n};\n\n/**\n * Fits preferred auxiliary pane widths into a shared budget without giving\n * DOM order priority. Minimums are reserved first; remaining space is shared\n * in proportion to how much each pane still needs to reach its preference.\n */\nexport const fitAppWorkspacePaneSizes = (panes: ReadonlyArray<{ desired: number; min: number }>, availableSize: number): number[] => {\n const sizes = panes.map((pane) => pane.min);\n const minimumTotal = sizes.reduce((total, size) => total + size, 0);\n const desiredTotal = panes.reduce((total, pane) => total + pane.desired, 0);\n const budget = Math.max(0, Math.floor(availableSize));\n if (desiredTotal <= budget) return panes.map((pane) => pane.desired);\n if (budget <= minimumTotal) return sizes;\n\n const extraBudget = budget - minimumTotal;\n const desiredExtra = desiredTotal - minimumTotal;\n const fractions = panes.map((pane, index) => {\n const raw = ((pane.desired - pane.min) * extraBudget) / desiredExtra;\n const extra = Math.floor(raw);\n sizes[index]! += extra;\n return { fraction: raw - extra, index };\n });\n let remainder = extraBudget - sizes.reduce((total, size, index) => total + size - panes[index]!.min, 0);\n fractions.sort((a, b) => b.fraction - a.fraction || a.index - b.index);\n for (const { index } of fractions) {\n if (remainder-- <= 0) break;\n sizes[index]! += 1;\n }\n return sizes;\n};\n\nexport const shouldCollapseAppWorkspaceSidebar = (width: number, collapsible: boolean): boolean =>\n collapsible && width < APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD;\n\nexport const resolveAppWorkspaceSidebarWidth = (\n width: number,\n maxWidth: number,\n collapsible: boolean,\n): { width: number; collapsed: boolean } =>\n shouldCollapseAppWorkspaceSidebar(width, collapsible)\n ? { width: APP_WORKSPACE_SIDEBAR_COLLAPSED, collapsed: true }\n : { width: Math.round(Math.min(maxWidth, Math.max(APP_WORKSPACE_SIDEBAR_MIN, width))), collapsed: false };\n\nconst finiteSize = (value: unknown, min: number, max: number) =>\n typeof value === \"number\" && Number.isFinite(value) ? Math.round(Math.min(max, Math.max(min, value))) : undefined;\n\nexport const safeAppWorkspacePanelId = (panelId: string): string => (isStableUiId(panelId) ? panelId : \"\");\n\nconst normalizeSizes = (value: unknown, min: number, max: number) => {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return undefined;\n const entries = Object.entries(value)\n .slice(0, 16)\n .flatMap(([key, size]) => {\n const normalized = finiteSize(size, min, max);\n return isStableUiId(key) && normalized !== undefined ? [[key, normalized] as const] : [];\n });\n return entries.length ? Object.fromEntries(entries) : undefined;\n};\n\nexport const appWorkspacePanelVariable = (kind: \"pane\" | \"detail\" | \"drawer\", panelId: string): string =>\n `--k2b-workspace-${kind}-${assertStableUiId(panelId, \"AppWorkspace panel id\")}-${kind === \"drawer\" ? \"height\" : \"width\"}`;\n\nexport const normalizeAppWorkspaceLayoutState = (value: unknown): AppWorkspaceLayoutState | null => {\n if (!value || typeof value !== \"object\") return null;\n const candidate = value as Record<string, unknown>;\n if (candidate.version !== 1 && candidate.version !== 2) return null;\n const sidebarWidth = finiteSize(candidate.sidebarWidth, APP_WORKSPACE_SIDEBAR_MIN, APP_WORKSPACE_SIDEBAR_STATE_MAX);\n const sidebarCollapsed = typeof candidate.sidebarCollapsed === \"boolean\" ? candidate.sidebarCollapsed : undefined;\n // Keyed panel maps only exist from version 2 on; a version-1 payload that\n // carries them was not written by this component and is not trusted.\n const legacy = candidate.version === 1;\n const paneWidths = legacy ? undefined : normalizeSizes(candidate.paneWidths, APP_WORKSPACE_PANE_STATE_MIN, APP_WORKSPACE_PANE_STATE_MAX);\n const detailWidths = legacy\n ? (() => {\n const width = finiteSize(candidate.detailWidth, APP_WORKSPACE_DETAIL_MIN, APP_WORKSPACE_DETAIL_MAX);\n return width === undefined ? undefined : { primary: width };\n })()\n : normalizeSizes(candidate.detailWidths, APP_WORKSPACE_DETAIL_MIN, APP_WORKSPACE_DETAIL_MAX);\n const drawerHeights = legacy ? undefined : normalizeSizes(candidate.drawerHeights, APP_WORKSPACE_DRAWER_MIN, APP_WORKSPACE_DRAWER_MAX);\n return sidebarWidth === undefined && sidebarCollapsed === undefined && !paneWidths && !detailWidths && !drawerHeights\n ? null\n : { version: 2, sidebarWidth, sidebarCollapsed, paneWidths, detailWidths, drawerHeights };\n};\n\nexport const parseAppWorkspaceLayoutState = (value: string | null | undefined): AppWorkspaceLayoutState | null => {\n if (!value) return null;\n try {\n return normalizeAppWorkspaceLayoutState(JSON.parse(decodeURIComponent(value)));\n } catch {\n return null;\n }\n};\n\nexport const serializeAppWorkspaceLayoutState = (state: AppWorkspaceLayoutState): string =>\n encodeURIComponent(JSON.stringify(normalizeAppWorkspaceLayoutState(state) ?? { version: 2 }));\n\nexport const appWorkspaceLayoutStyle = (state: AppWorkspaceLayoutState | null | undefined): string | undefined => {\n if (!state) return undefined;\n const declarations = [\n state.sidebarCollapsed\n ? `--k2b-workspace-sidebar-width:${APP_WORKSPACE_SIDEBAR_COLLAPSED}px`\n : state.sidebarWidth === undefined\n ? null\n : `--k2b-workspace-sidebar-width:${state.sidebarWidth}px`,\n ...Object.entries(state.paneWidths ?? {}).map(([id, width]) => `${appWorkspacePanelVariable(\"pane\", id)}:${width}px`),\n ...Object.entries(state.detailWidths ?? {}).map(([id, width]) => `${appWorkspacePanelVariable(\"detail\", id)}:${width}px`),\n ...Object.entries(state.drawerHeights ?? {}).map(([id, height]) => `${appWorkspacePanelVariable(\"drawer\", id)}:${height}px`),\n ].filter(Boolean);\n return declarations.length ? declarations.join(\";\") : undefined;\n};\n\nimport { assertStableUiId, isStableUiId } from \"./stable-id\";\n"],"mappings":"AASA,OAAO,MAAM,6BAA6B,GAAG,GAAG;AAChD,OAAO,MAAM,+BAA+B,GAAG,EAAE;AACjD,OAAO,MAAM,wCAAwC,GAAG,GAAG;AAC3D,OAAO,MAAM,yBAAyB,GAAG,GAAG;AAC5C,OAAO,MAAM,yBAAyB,GAAG,GAAG;AAC5C;AACA,MAAM,+BAA+B,GAAG,GAAG;AAC3C;AACA,OAAO,MAAM,4BAA4B,GAAG,GAAG;AAC/C,OAAO,MAAM,wBAAwB,GAAG,GAAG;AAC3C,OAAO,M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;AAAE,CAAC,CAAC,CAAC;AAE/F,OAAO,MAAM,uBAAuB,GAAI,KAAiD,IAAyB;EAChH,IAAI,CAAC,KAAK,EAAE,OAAO,SAAS;EAC5B,MAAM,YAAY,GAAG,CACnB,KAAK,CAAC,gBAAgB,GAClB,iCAAiC,+BAA+B,IAAI,GACpE,KAAK,CAAC,YAAY,KAAK,SAAS,GAC9B,IAAI,GACJ,iCAAiC,KAAK,CAAC,YAAY,IAAI,EAC7D,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,GAAG,yBAAyB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,EACrH,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,GAAG,yBAAyB,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,EACzH,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,GAAG,yBAAyB,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,MAAM,IAAI,CAAC,CAC7H,CAAC,MAAM,CAAC,OAAO,CAAC;EACjB,OAAO,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS;AACjE,CAAC;AAED,SAAS,gBAAgB,EAAE,YAAY,QAAQ,aAAa","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["layout/app-workspace-state.ts"],"sourcesContent":["export type AppWorkspaceLayoutState = {\n version: 2;\n sidebarWidth?: number;\n sidebarCollapsed?: boolean;\n paneWidths?: Record<string, number>;\n detailWidths?: Record<string, number>;\n drawerHeights?: Record<string, number>;\n};\n\nexport const APP_WORKSPACE_SIDEBAR_DEFAULT = 208;\nexport const APP_WORKSPACE_SIDEBAR_COLLAPSED = 64;\nexport const APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD = 128;\nexport const APP_WORKSPACE_SIDEBAR_MIN = 176;\nexport const APP_WORKSPACE_SIDEBAR_MAX = 360;\n/** Absolute persistence envelope for sidebars with an app-defined wider max. */\nconst APP_WORKSPACE_SIDEBAR_STATE_MAX = 960;\n/** The floating detail panel starts at 26 rem and keeps between 20 and 40 rem. */\nexport const APP_WORKSPACE_DETAIL_DEFAULT = 416;\nexport const APP_WORKSPACE_DETAIL_MIN = 320;\nexport const APP_WORKSPACE_DETAIL_MAX = 640;\nexport const APP_WORKSPACE_DRAWER_DEFAULT = 240;\nexport const APP_WORKSPACE_DRAWER_MIN = 160;\nexport const APP_WORKSPACE_DRAWER_MAX = 560;\n/** Space `appWorkspaceResizeLimits` always reserves for the main region. */\nexport const APP_WORKSPACE_MAIN_MIN = 320;\nexport const APP_WORKSPACE_MAIN_MIN_HEIGHT = 240;\nexport const APP_WORKSPACE_PANE_DEFAULT = 320;\nexport const APP_WORKSPACE_PANE_MIN = 240;\nexport const APP_WORKSPACE_PANE_MAX = 640;\n\n/** Persistence envelope; each pane still applies its own runtime limits. */\nconst APP_WORKSPACE_PANE_STATE_MIN = 160;\nconst APP_WORKSPACE_PANE_STATE_MAX = 960;\n\nexport type AppWorkspaceResizeKind = \"sidebar\" | \"pane\" | \"detail\" | \"drawer\";\n\nexport const appWorkspaceResizeLimits = (options: {\n kind: AppWorkspaceResizeKind;\n workspaceSize: number;\n reservedSize: number;\n min?: number;\n max?: number;\n sidebarCollapsible?: boolean;\n}): { min: number; max: number } => {\n const min =\n options.min ??\n (options.kind === \"sidebar\"\n ? options.sidebarCollapsible\n ? APP_WORKSPACE_SIDEBAR_COLLAPSED\n : APP_WORKSPACE_SIDEBAR_MIN\n : options.kind === \"detail\"\n ? APP_WORKSPACE_DETAIL_MIN\n : options.kind === \"pane\"\n ? APP_WORKSPACE_PANE_MIN\n : APP_WORKSPACE_DRAWER_MIN);\n const configuredMax =\n options.max ??\n (options.kind === \"sidebar\"\n ? APP_WORKSPACE_SIDEBAR_MAX\n : options.kind === \"detail\"\n ? APP_WORKSPACE_DETAIL_MAX\n : options.kind === \"pane\"\n ? APP_WORKSPACE_PANE_MAX\n : APP_WORKSPACE_DRAWER_MAX);\n const mainMinimum = options.kind === \"drawer\" ? APP_WORKSPACE_MAIN_MIN_HEIGHT : APP_WORKSPACE_MAIN_MIN;\n return { min, max: Math.max(min, Math.min(configuredMax, options.workspaceSize - options.reservedSize - mainMinimum)) };\n};\n\n/**\n * Fits preferred auxiliary pane widths into a shared budget without giving\n * DOM order priority. Minimums are reserved first; remaining space is shared\n * in proportion to how much each pane still needs to reach its preference.\n */\nexport const fitAppWorkspacePaneSizes = (panes: ReadonlyArray<{ desired: number; min: number }>, availableSize: number): number[] => {\n const sizes = panes.map((pane) => pane.min);\n const minimumTotal = sizes.reduce((total, size) => total + size, 0);\n const desiredTotal = panes.reduce((total, pane) => total + pane.desired, 0);\n const budget = Math.max(0, Math.floor(availableSize));\n if (desiredTotal <= budget) return panes.map((pane) => pane.desired);\n if (budget <= minimumTotal) return sizes;\n\n const extraBudget = budget - minimumTotal;\n const desiredExtra = desiredTotal - minimumTotal;\n const fractions = panes.map((pane, index) => {\n const raw = ((pane.desired - pane.min) * extraBudget) / desiredExtra;\n const extra = Math.floor(raw);\n sizes[index]! += extra;\n return { fraction: raw - extra, index };\n });\n let remainder = extraBudget - sizes.reduce((total, size, index) => total + size - panes[index]!.min, 0);\n fractions.sort((a, b) => b.fraction - a.fraction || a.index - b.index);\n for (const { index } of fractions) {\n if (remainder-- <= 0) break;\n sizes[index]! += 1;\n }\n return sizes;\n};\n\nexport const shouldCollapseAppWorkspaceSidebar = (width: number, collapsible: boolean): boolean =>\n collapsible && width < APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD;\n\nexport const resolveAppWorkspaceSidebarWidth = (\n width: number,\n maxWidth: number,\n collapsible: boolean,\n): { width: number; collapsed: boolean } =>\n shouldCollapseAppWorkspaceSidebar(width, collapsible)\n ? { width: APP_WORKSPACE_SIDEBAR_COLLAPSED, collapsed: true }\n : { width: Math.round(Math.min(maxWidth, Math.max(APP_WORKSPACE_SIDEBAR_MIN, width))), collapsed: false };\n\nconst finiteSize = (value: unknown, min: number, max: number) =>\n typeof value === \"number\" && Number.isFinite(value) ? Math.round(Math.min(max, Math.max(min, value))) : undefined;\n\nexport const safeAppWorkspacePanelId = (panelId: string): string => (isStableUiId(panelId) ? panelId : \"\");\n\nconst normalizeSizes = (value: unknown, min: number, max: number) => {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return undefined;\n const entries = Object.entries(value)\n .slice(0, 16)\n .flatMap(([key, size]) => {\n const normalized = finiteSize(size, min, max);\n return isStableUiId(key) && normalized !== undefined ? [[key, normalized] as const] : [];\n });\n return entries.length ? Object.fromEntries(entries) : undefined;\n};\n\nexport const appWorkspacePanelVariable = (kind: \"pane\" | \"detail\" | \"drawer\", panelId: string): string =>\n `--k2b-workspace-${kind}-${assertStableUiId(panelId, \"AppWorkspace panel id\")}-${kind === \"drawer\" ? \"height\" : \"width\"}`;\n\nexport const normalizeAppWorkspaceLayoutState = (value: unknown): AppWorkspaceLayoutState | null => {\n if (!value || typeof value !== \"object\") return null;\n const candidate = value as Record<string, unknown>;\n if (candidate.version !== 1 && candidate.version !== 2) return null;\n const sidebarWidth = finiteSize(candidate.sidebarWidth, APP_WORKSPACE_SIDEBAR_MIN, APP_WORKSPACE_SIDEBAR_STATE_MAX);\n const sidebarCollapsed = typeof candidate.sidebarCollapsed === \"boolean\" ? candidate.sidebarCollapsed : undefined;\n // Keyed panel maps only exist from version 2 on; a version-1 payload that\n // carries them was not written by this component and is not trusted.\n const legacy = candidate.version === 1;\n const paneWidths = legacy ? undefined : normalizeSizes(candidate.paneWidths, APP_WORKSPACE_PANE_STATE_MIN, APP_WORKSPACE_PANE_STATE_MAX);\n const detailWidths = legacy\n ? (() => {\n const width = finiteSize(candidate.detailWidth, APP_WORKSPACE_DETAIL_MIN, APP_WORKSPACE_DETAIL_MAX);\n return width === undefined ? undefined : { primary: width };\n })()\n : normalizeSizes(candidate.detailWidths, APP_WORKSPACE_DETAIL_MIN, APP_WORKSPACE_DETAIL_MAX);\n const drawerHeights = legacy ? undefined : normalizeSizes(candidate.drawerHeights, APP_WORKSPACE_DRAWER_MIN, APP_WORKSPACE_DRAWER_MAX);\n return sidebarWidth === undefined && sidebarCollapsed === undefined && !paneWidths && !detailWidths && !drawerHeights\n ? null\n : { version: 2, sidebarWidth, sidebarCollapsed, paneWidths, detailWidths, drawerHeights };\n};\n\nexport const parseAppWorkspaceLayoutState = (value: string | null | undefined): AppWorkspaceLayoutState | null => {\n if (!value) return null;\n try {\n return normalizeAppWorkspaceLayoutState(JSON.parse(decodeURIComponent(value)));\n } catch {\n return null;\n }\n};\n\nexport const serializeAppWorkspaceLayoutState = (state: AppWorkspaceLayoutState): string =>\n encodeURIComponent(JSON.stringify(normalizeAppWorkspaceLayoutState(state) ?? { version: 2 }));\n\nexport const appWorkspaceLayoutStyle = (state: AppWorkspaceLayoutState | null | undefined): string | undefined => {\n if (!state) return undefined;\n const declarations = [\n state.sidebarCollapsed\n ? `--k2b-workspace-sidebar-width:${APP_WORKSPACE_SIDEBAR_COLLAPSED}px`\n : state.sidebarWidth === undefined\n ? null\n : `--k2b-workspace-sidebar-width:${state.sidebarWidth}px`,\n ...Object.entries(state.paneWidths ?? {}).map(([id, width]) => `${appWorkspacePanelVariable(\"pane\", id)}:${width}px`),\n ...Object.entries(state.detailWidths ?? {}).map(([id, width]) => `${appWorkspacePanelVariable(\"detail\", id)}:${width}px`),\n ...Object.entries(state.drawerHeights ?? {}).map(([id, height]) => `${appWorkspacePanelVariable(\"drawer\", id)}:${height}px`),\n ].filter(Boolean);\n return declarations.length ? declarations.join(\";\") : undefined;\n};\n\nimport { assertStableUiId, isStableUiId } from \"./stable-id\";\n"],"mappings":"AASA,OAAO,MAAM,6BAA6B,GAAG,GAAG;AAChD,OAAO,MAAM,+BAA+B,GAAG,EAAE;AACjD,OAAO,MAAM,wCAAwC,GAAG,GAAG;AAC3D,OAAO,MAAM,yBAAyB,GAAG,GAAG;AAC5C,OAAO,MAAM,yBAAyB,GAAG,GAAG;AAC5C;AACA,MAAM,+BAA+B,GAAG,GAAG;AAC3C;AACA,OAAO,MAAM,4BAA4B,GAAG,GAAG;AAC/C,OAAO,MAAM,wBAAwB,GAAG,GAAG;AAC3C,OAAO,MAAM,wBAAwB,GAAG,GAAG;AAC3C,OAAO,MAAM,4BAA4B,GAAG,GAAG;AAC/C,OAAO,MAAM,wBAAwB,GAAG,GAAG;AAC3C,OAAO,MAAM,wBAAwB,GAAG,GAAG;AAC3C;AACA,OAAO,MAAM,sBAAsB,GAAG,GAAG;AACzC,OAAO,MAAM,6BAA6B,GAAG,GAAG;AAChD,OAAO,MAAM,0BAA0B,GAAG,GAAG;AAC7C,OAAO,MAAM,sBAAsB,GAAG,GAAG;AACzC,OAAO,MAAM,sBAAsB,GAAG,GAAG;;AAEzC;AACA,MAAM,4BAA4B,GAAG,GAAG;AACxC,MAAM,4BAA4B,GAAG,GAAG;AAIxC,OAAO,MAAM,wBAAwB,GAAI,OAOxC,IAAmC;EAClC,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,KACV,OAAO,CAAC,IAAI,KAAK,SAAS,GACvB,OAAO,CAAC,kBAAkB,GACxB,+BAA+B,GAC/B,yBAAyB,GAC3B,OAAO,CAAC,IAAI,KAAK,QAAQ,GACvB,wBAAwB,GACxB,OAAO,CAAC,IAAI,KAAK,MAAM,GACrB,sBAAsB,GACtB,wBAAwB,CAAC;EACnC,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,KACV,OAAO,CAAC,IAAI,KAAK,SAAS,GACvB,yBAAyB,GAC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EAAE,MAAM,CAAC,KAAK,GAAG,yBAAyB,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,MAAM,IAAI,CAAC,CAC7H,CAAC,MAAM,CAAC,OAAO,CAAC;EACjB,OAAO,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS;AACjE,CAAC;AAED,SAAS,gBAAgB,EAAE,YAAY,QAAQ,aAAa","ignoreList":[]}
@@ -13,7 +13,6 @@ export { default as DetailPanel } from "./DetailPanel";
13
13
  export { DetailAccess, DetailLinks, DetailPresence, DetailPresenceSlot, DetailProperties, DetailTags } from "./DetailSections";
14
14
  export { DETAILS_ICON, DetailsToggle } from "./DetailsToggle";
15
15
  export { default as Discussion } from "./Discussion";
16
- export { FloatingPill } from "./FloatingPill";
17
16
  export { default as FloatingWindow, fitFloatingWindowRect, openFloatingWindow } from "./FloatingWindow";
18
17
  export { default as MobileShell, observeMobileShell } from "./MobileShell";
19
18
  export { default as Navigation } from "./Navigation";
@@ -33,7 +32,6 @@ export { readSettingsError, SaveStatus, SettingsField, SettingsGroup, SettingsPa
33
32
  export { default as SettingsCollection } from "./SettingsCollection";
34
33
  export { default as SettingsModal } from "./SettingsModal";
35
34
  export { APP_WORKSPACE_SWITCHER_SEARCH_FROM } from "./SidebarSwitcher";
36
- export { StatusRow } from "./StatusRow";
37
35
  export { measureScrollFade } from "./scroll-fade";
38
36
  export { attachSheetHandle } from "./sheet-handle";
39
37
  export { default as TabBar } from "./TabBar";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["layout/index.ts"],"sourcesContent":["export { AnchoredPopover, type AnchoredPopoverProps } from \"./AnchoredPopover\";\nexport type {\n AppOverviewCardsProps,\n AppOverviewEmptyStateProps,\n AppOverviewPanelProps,\n AppOverviewProps,\n} from \"./AppOverview\";\nexport { default as AppOverview } from \"./AppOverview\";\nexport type {\n AppWorkspaceBottomDrawerHeight,\n AppWorkspaceBottomDrawerProps,\n AppWorkspaceContentProps,\n AppWorkspaceDetailProps,\n AppWorkspaceDetailWidth,\n AppWorkspaceHeadProps,\n AppWorkspaceLevelSwitcher,\n AppWorkspaceMainPaneProps,\n AppWorkspaceMainProps,\n AppWorkspaceNavTreeItemProps,\n AppWorkspaceNavTreeMove,\n AppWorkspaceNavTreeProps,\n AppWorkspaceProps,\n AppWorkspaceSidebarAccessoryVisibility,\n AppWorkspaceSidebarBodyProps,\n AppWorkspaceSidebarIconActionProps,\n AppWorkspaceSidebarIconActionTone,\n AppWorkspaceSidebarIconGridProps,\n AppWorkspaceSidebarItemActionProps,\n AppWorkspaceSidebarItemActionsProps,\n AppWorkspaceSidebarItemIconProps,\n AppWorkspaceSidebarItemLabelProps,\n AppWorkspaceSidebarItemMetaProps,\n AppWorkspaceSidebarItemProps,\n AppWorkspaceSidebarItemStatusProps,\n AppWorkspaceSidebarItemTone,\n AppWorkspaceSidebarProps,\n AppWorkspaceSidebarSectionActionProps,\n AppWorkspaceSidebarSectionProps,\n AppWorkspaceSidebarToggleProps,\n AppWorkspaceSidebarVisibility,\n AppWorkspaceWidthShare,\n} from \"./AppWorkspace\";\nexport { appWorkspaceDetailElementId, default as AppWorkspace } from \"./AppWorkspace\";\nexport { AppWorkspaceSidebarItemStatus } from \"./AppWorkspaceSidebarItemStatus\";\nexport { watchAppHostWidth } from \"./app-host-width\";\nexport type { AppWorkspaceControllerOptions } from \"./app-workspace-controller\";\nexport { installAppWorkspaceController, parkWorkspaceDetailDrawers } from \"./app-workspace-controller\";\nexport type {\n AppWorkspaceLayoutState,\n AppWorkspaceResizeKind,\n} from \"./app-workspace-state\";\nexport {\n APP_WORKSPACE_DETAIL_DEFAULT,\n APP_WORKSPACE_DETAIL_MAX,\n APP_WORKSPACE_DETAIL_MIN,\n APP_WORKSPACE_DRAWER_DEFAULT,\n APP_WORKSPACE_DRAWER_MAX,\n APP_WORKSPACE_DRAWER_MIN,\n APP_WORKSPACE_MAIN_MIN,\n APP_WORKSPACE_MAIN_MIN_HEIGHT,\n APP_WORKSPACE_PANE_DEFAULT,\n APP_WORKSPACE_PANE_MAX,\n APP_WORKSPACE_PANE_MIN,\n APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD,\n APP_WORKSPACE_SIDEBAR_COLLAPSED,\n APP_WORKSPACE_SIDEBAR_DEFAULT,\n APP_WORKSPACE_SIDEBAR_MAX,\n APP_WORKSPACE_SIDEBAR_MIN,\n appWorkspaceLayoutStyle,\n appWorkspacePanelVariable,\n appWorkspaceResizeLimits,\n normalizeAppWorkspaceLayoutState,\n parseAppWorkspaceLayoutState,\n resolveAppWorkspaceSidebarWidth,\n safeAppWorkspacePanelId,\n serializeAppWorkspaceLayoutState,\n shouldCollapseAppWorkspaceSidebar,\n} from \"./app-workspace-state\";\nexport { type BottomSheetProps, default as BottomSheet } from \"./BottomSheet\";\nexport { type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps } from \"./Breadcrumbs\";\nexport { bottomSheetAdaptiveOptions, bottomSheetOptions } from \"./bottom-sheet-options\";\nexport type { DataPanelProps } from \"./DataPanel\";\nexport { DataPanel } from \"./DataPanel\";\nexport type {\n DetailPanelActionButtonProps,\n DetailPanelActionCheckbox,\n DetailPanelActionLinkProps,\n DetailPanelActionProps,\n DetailPanelActionSecondary,\n DetailPanelBodyProps,\n DetailPanelGroupProps,\n DetailPanelHeaderProps,\n DetailPanelProps,\n DetailPanelRowProps,\n DetailPanelSummaryProps,\n} from \"./DetailPanel\";\nexport { default as DetailPanel } from \"./DetailPanel\";\nexport type {\n DetailAccessEntry,\n DetailAccessProps,\n DetailLinkItem,\n DetailLinksProps,\n DetailPresencePerson,\n DetailPresenceProps,\n DetailPresenceState,\n DetailPropertiesProps,\n DetailProperty,\n DetailTag,\n DetailTagsProps,\n} from \"./DetailSections\";\nexport { DetailAccess, DetailLinks, DetailPresence, DetailPresenceSlot, DetailProperties, DetailTags } from \"./DetailSections\";\nexport { DETAILS_ICON, DetailsToggle, type DetailsToggleProps } from \"./DetailsToggle\";\nexport type {\n DiscussionComposerProps,\n DiscussionItemProps,\n DiscussionListProps,\n DiscussionProps,\n DiscussionThreadProps,\n} from \"./Discussion\";\nexport { default as Discussion } from \"./Discussion\";\nexport type { FloatingPillProps } from \"./FloatingPill\";\nexport { FloatingPill } from \"./FloatingPill\";\nexport type {\n FloatingWindowClose,\n FloatingWindowProps,\n FloatingWindowState,\n OpenFloatingWindowOptions,\n} from \"./FloatingWindow\";\nexport {\n default as FloatingWindow,\n type FloatingWindowBounds,\n type FloatingWindowRect,\n fitFloatingWindowRect,\n openFloatingWindow,\n} from \"./FloatingWindow\";\nexport type { MobileShellHeaderProps, MobileShellProps, MobileShellSidebarItem, MobileShellSidebarProps } from \"./MobileShell\";\nexport { default as MobileShell, observeMobileShell } from \"./MobileShell\";\nexport { default as Navigation, type NavigationProps } from \"./Navigation\";\nexport {\n createNavigation,\n findNavigationItem,\n type NavigationController,\n type NavigationItem,\n type NavigationOptions,\n type NavigationStatus,\n} from \"./navigation-model\";\nexport type { PageTitleProps, PageTrailLink, PageTrailState } from \"./PageTitle\";\nexport { followPageTrail, PAGE_TRAIL_EVENT, PageTitle, PageTrailProvider, readPageTrail, setPageTrail, usePageTrail } from \"./PageTitle\";\nexport type {\n PanelDialogBodyProps,\n PanelDialogError,\n PanelDialogFooterProps,\n PanelDialogHeaderProps,\n PanelDialogProps,\n PanelDialogSectionProps,\n PanelDialogSurface,\n PanelDialogTabOption,\n PanelDialogTabsProps,\n} from \"./PanelDialog\";\nexport {\n confirmDiscardIfDirty,\n default as PanelDialog,\n panelDialogFixedOptions,\n panelDialogFixedPanelClass,\n panelDialogOptions,\n panelDialogPanelClass,\n panelDialogWideOptions,\n panelDialogWidePanelClass,\n panelDialogWorkspaceOptions,\n panelDialogWorkspacePanelClass,\n} from \"./PanelDialog\";\nexport type { PanelHeaderProps } from \"./PanelHeader\";\nexport { PanelHeader } from \"./PanelHeader\";\nexport type { PanesItem, PanesProps } from \"./Panes\";\nexport { default as Panes } from \"./Panes\";\nexport {\n PersonPopover,\n type PersonPopoverAction,\n type PersonPopoverError,\n type PersonPopoverLink,\n type PersonPopoverList,\n type PersonPopoverPhone,\n type PersonPopoverProps,\n} from \"./PersonPopover\";\nexport type { PullToRefreshProps, PullToRefreshState } from \"./PullToRefresh\";\nexport { default as PullToRefresh } from \"./PullToRefresh\";\nexport { installPageTitleController } from \"./page-title-controller\";\nexport type {\n AddPanesItemOptions,\n PanesDirection,\n PanesGroup,\n PanesIntent,\n PanesLayout,\n PanesNode,\n PanesPath,\n PanesPathSegment,\n PanesPreset,\n PanesSide,\n PanesSplit,\n} from \"./panes-layout\";\nexport {\n activatePanesItem,\n addPanesItem,\n applyPanesIntent,\n applyPanesPreset,\n createPanesLayout,\n isPanesItemVisible,\n PANES_LAYOUT_VERSION,\n parsePanesLayout,\n reconcilePanesLayout,\n removePanesItem,\n resizePanesSplit,\n} from \"./panes-layout\";\nexport { default as ResizeSeparator, type ResizeSeparatorProps } from \"./ResizeSeparator\";\nexport { attachResizeSeparator, type ResizeSeparatorOptions } from \"./resize-separator\";\nexport type { ScrollAreaProps } from \"./ScrollArea\";\nexport { default as ScrollArea } from \"./ScrollArea\";\nexport type {\n SaveStatusProps,\n SaveStatusState,\n SettingsFieldControlProps,\n SettingsFieldProps,\n SettingsFieldWidth,\n SettingsGroupActionProps,\n SettingsGroupProps,\n SettingsPageProps,\n SettingsPanelFooterProps,\n SettingsSaveBarProps,\n SettingsSectionProps,\n} from \"./Settings\";\nexport {\n readSettingsError,\n SaveStatus,\n SettingsField,\n SettingsGroup,\n SettingsPage,\n SettingsPanelFooter,\n SettingsSaveBar,\n SettingsSection,\n sameSettingValue,\n} from \"./Settings\";\nexport type {\n SettingsCollectionActionProps,\n SettingsCollectionItemActionsProps,\n SettingsCollectionItemProps,\n SettingsCollectionItemReorderProps,\n SettingsCollectionItemStatusProps,\n SettingsCollectionProps,\n} from \"./SettingsCollection\";\nexport { default as SettingsCollection } from \"./SettingsCollection\";\nexport type {\n SettingsModalFooterProps,\n SettingsModalGroupProps,\n SettingsModalProps,\n SettingsModalTabProps,\n SettingsModalTabTone,\n} from \"./SettingsModal\";\nexport { default as SettingsModal } from \"./SettingsModal\";\nexport {\n APP_WORKSPACE_SWITCHER_SEARCH_FROM,\n type AppWorkspaceSidebarSwitcherProps,\n type AppWorkspaceSwitcherAction,\n type AppWorkspaceSwitcherOption,\n} from \"./SidebarSwitcher\";\nexport type { StatusRowFact, StatusRowProps, StatusRowSelection, StatusRowState } from \"./StatusRow\";\nexport { StatusRow } from \"./StatusRow\";\nexport { measureScrollFade } from \"./scroll-fade\";\nexport { attachSheetHandle, type SheetHandleOptions } from \"./sheet-handle\";\nexport type { TabBarItem, TabBarProps } from \"./TabBar\";\nexport { default as TabBar } from \"./TabBar\";\nexport type { TableOfContentsItem, TableOfContentsProps } from \"./TableOfContents\";\nexport { TableOfContents } from \"./TableOfContents\";\n"],"mappings":"AAAA,SAAS,eAAe,QAAmC,mBAAmB;AAO9E,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AAmCtD,SAAS,2BAA2B,EAAE,OAAO,IAAI,YAAY,QAAQ,gBAAgB;AACrF,SAAS,6BAA6B,QAAQ,iCAAiC;AAC/E,SAAS,iBAAiB,QAAQ,kBAAkB;AAEpD,SAAS,6BAA6B,EAAE,0BAA0B,QAAQ,4BAA4B;AAKtG,SACE,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,wCAAwC,EACxC,+BAA+B,EAC/B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,gCAAgC,EAChC,iCAAiC,QAC5B,uBAAuB;AAC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B,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,QACX,gBAAgB;AACvB,SAAS,OAAO,IAAI,eAAe,QAAmC,mBAAmB;AACzF,SAAS,qBAAqB,QAAqC,oBAAoB;AAEvF,SAAS,OAAO,IAAI,UAAU,QAAQ,cAAc;AAcpD,SACE,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,gBAAgB,QACX,YAAY;AASnB,SAAS,OAAO,IAAI,kBAAkB,QAAQ,sBAAsB;AAQpE,SAAS,OAAO,IAAI,aAAa,QAAQ,iBAAiB;AAC1D,SACE,kCAAkC,QAI7B,mBAAmB;AAE1B,SAAS,SAAS,QAAQ,aAAa;AACvC,SAAS,iBAAiB,QAAQ,eAAe;AACjD,SAAS,iBAAiB,QAAiC,gBAAgB;AAE3E,SAAS,OAAO,IAAI,MAAM,QAAQ,UAAU;AAE5C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["layout/index.ts"],"sourcesContent":["export { AnchoredPopover, type AnchoredPopoverProps } from \"./AnchoredPopover\";\nexport type {\n AppOverviewCardsProps,\n AppOverviewEmptyStateProps,\n AppOverviewPanelProps,\n AppOverviewProps,\n} from \"./AppOverview\";\nexport { default as AppOverview } from \"./AppOverview\";\nexport type {\n AppWorkspaceBottomDrawerHeight,\n AppWorkspaceBottomDrawerProps,\n AppWorkspaceContentProps,\n AppWorkspaceDetailProps,\n AppWorkspaceDetailWidth,\n AppWorkspaceHeadProps,\n AppWorkspaceLevelSwitcher,\n AppWorkspaceMainPaneProps,\n AppWorkspaceMainProps,\n AppWorkspaceNavTreeItemProps,\n AppWorkspaceNavTreeMove,\n AppWorkspaceNavTreeProps,\n AppWorkspaceProps,\n AppWorkspaceSidebarAccessoryVisibility,\n AppWorkspaceSidebarBodyProps,\n AppWorkspaceSidebarIconActionProps,\n AppWorkspaceSidebarIconActionTone,\n AppWorkspaceSidebarIconGridProps,\n AppWorkspaceSidebarItemActionProps,\n AppWorkspaceSidebarItemActionsProps,\n AppWorkspaceSidebarItemIconProps,\n AppWorkspaceSidebarItemLabelProps,\n AppWorkspaceSidebarItemMetaProps,\n AppWorkspaceSidebarItemProps,\n AppWorkspaceSidebarItemStatusProps,\n AppWorkspaceSidebarItemTone,\n AppWorkspaceSidebarProps,\n AppWorkspaceSidebarSectionActionProps,\n AppWorkspaceSidebarSectionProps,\n AppWorkspaceSidebarToggleProps,\n AppWorkspaceSidebarVisibility,\n AppWorkspaceWidthShare,\n} from \"./AppWorkspace\";\nexport { appWorkspaceDetailElementId, default as AppWorkspace } from \"./AppWorkspace\";\nexport { AppWorkspaceSidebarItemStatus } from \"./AppWorkspaceSidebarItemStatus\";\nexport { watchAppHostWidth } from \"./app-host-width\";\nexport type { AppWorkspaceControllerOptions } from \"./app-workspace-controller\";\nexport { installAppWorkspaceController, parkWorkspaceDetailDrawers } from \"./app-workspace-controller\";\nexport type {\n AppWorkspaceLayoutState,\n AppWorkspaceResizeKind,\n} from \"./app-workspace-state\";\nexport {\n APP_WORKSPACE_DETAIL_DEFAULT,\n APP_WORKSPACE_DETAIL_MAX,\n APP_WORKSPACE_DETAIL_MIN,\n APP_WORKSPACE_DRAWER_DEFAULT,\n APP_WORKSPACE_DRAWER_MAX,\n APP_WORKSPACE_DRAWER_MIN,\n APP_WORKSPACE_MAIN_MIN,\n APP_WORKSPACE_MAIN_MIN_HEIGHT,\n APP_WORKSPACE_PANE_DEFAULT,\n APP_WORKSPACE_PANE_MAX,\n APP_WORKSPACE_PANE_MIN,\n APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD,\n APP_WORKSPACE_SIDEBAR_COLLAPSED,\n APP_WORKSPACE_SIDEBAR_DEFAULT,\n APP_WORKSPACE_SIDEBAR_MAX,\n APP_WORKSPACE_SIDEBAR_MIN,\n appWorkspaceLayoutStyle,\n appWorkspacePanelVariable,\n appWorkspaceResizeLimits,\n normalizeAppWorkspaceLayoutState,\n parseAppWorkspaceLayoutState,\n resolveAppWorkspaceSidebarWidth,\n safeAppWorkspacePanelId,\n serializeAppWorkspaceLayoutState,\n shouldCollapseAppWorkspaceSidebar,\n} from \"./app-workspace-state\";\nexport { type BottomSheetProps, default as BottomSheet } from \"./BottomSheet\";\nexport { type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps } from \"./Breadcrumbs\";\nexport { bottomSheetAdaptiveOptions, bottomSheetOptions } from \"./bottom-sheet-options\";\nexport type { DataPanelProps } from \"./DataPanel\";\nexport { DataPanel } from \"./DataPanel\";\nexport type {\n DetailPanelActionButtonProps,\n DetailPanelActionCheckbox,\n DetailPanelActionLinkProps,\n DetailPanelActionProps,\n DetailPanelActionSecondary,\n DetailPanelBodyProps,\n DetailPanelGroupProps,\n DetailPanelHeaderProps,\n DetailPanelProps,\n DetailPanelRowProps,\n DetailPanelSummaryProps,\n} from \"./DetailPanel\";\nexport { default as DetailPanel } from \"./DetailPanel\";\nexport type {\n DetailAccessEntry,\n DetailAccessProps,\n DetailLinkItem,\n DetailLinksProps,\n DetailPresencePerson,\n DetailPresenceProps,\n DetailPresenceState,\n DetailPropertiesProps,\n DetailProperty,\n DetailTag,\n DetailTagsProps,\n} from \"./DetailSections\";\nexport { DetailAccess, DetailLinks, DetailPresence, DetailPresenceSlot, DetailProperties, DetailTags } from \"./DetailSections\";\nexport { DETAILS_ICON, DetailsToggle, type DetailsToggleProps } from \"./DetailsToggle\";\nexport type {\n DiscussionComposerProps,\n DiscussionItemProps,\n DiscussionListProps,\n DiscussionProps,\n DiscussionThreadProps,\n} from \"./Discussion\";\nexport { default as Discussion } from \"./Discussion\";\nexport type {\n FloatingWindowClose,\n FloatingWindowProps,\n FloatingWindowState,\n OpenFloatingWindowOptions,\n} from \"./FloatingWindow\";\nexport {\n default as FloatingWindow,\n type FloatingWindowBounds,\n type FloatingWindowRect,\n fitFloatingWindowRect,\n openFloatingWindow,\n} from \"./FloatingWindow\";\nexport type { MobileShellHeaderProps, MobileShellProps, MobileShellSidebarItem, MobileShellSidebarProps } from \"./MobileShell\";\nexport { default as MobileShell, observeMobileShell } from \"./MobileShell\";\nexport { default as Navigation, type NavigationProps } from \"./Navigation\";\nexport {\n createNavigation,\n findNavigationItem,\n type NavigationController,\n type NavigationItem,\n type NavigationOptions,\n type NavigationStatus,\n} from \"./navigation-model\";\nexport type { PageTitleProps, PageTrailLink, PageTrailState } from \"./PageTitle\";\nexport { followPageTrail, PAGE_TRAIL_EVENT, PageTitle, PageTrailProvider, readPageTrail, setPageTrail, usePageTrail } from \"./PageTitle\";\nexport type {\n PanelDialogBodyProps,\n PanelDialogFooterProps,\n PanelDialogHeaderProps,\n PanelDialogProps,\n PanelDialogSectionProps,\n PanelDialogSurface,\n PanelDialogTabOption,\n PanelDialogTabsProps,\n} from \"./PanelDialog\";\nexport {\n confirmDiscardIfDirty,\n default as PanelDialog,\n panelDialogFixedOptions,\n panelDialogFixedPanelClass,\n panelDialogOptions,\n panelDialogPanelClass,\n panelDialogWideOptions,\n panelDialogWidePanelClass,\n panelDialogWorkspaceOptions,\n panelDialogWorkspacePanelClass,\n} from \"./PanelDialog\";\nexport type { PanelHeaderProps } from \"./PanelHeader\";\nexport { PanelHeader } from \"./PanelHeader\";\nexport type { PanesItem, PanesProps } from \"./Panes\";\nexport { default as Panes } from \"./Panes\";\nexport {\n PersonPopover,\n type PersonPopoverAction,\n type PersonPopoverError,\n type PersonPopoverLink,\n type PersonPopoverList,\n type PersonPopoverPhone,\n type PersonPopoverProps,\n} from \"./PersonPopover\";\nexport type { PullToRefreshProps, PullToRefreshState } from \"./PullToRefresh\";\nexport { default as PullToRefresh } from \"./PullToRefresh\";\nexport { installPageTitleController } from \"./page-title-controller\";\nexport type {\n AddPanesItemOptions,\n PanesDirection,\n PanesGroup,\n PanesIntent,\n PanesLayout,\n PanesNode,\n PanesPath,\n PanesPathSegment,\n PanesPreset,\n PanesSide,\n PanesSplit,\n} from \"./panes-layout\";\nexport {\n activatePanesItem,\n addPanesItem,\n applyPanesIntent,\n applyPanesPreset,\n createPanesLayout,\n isPanesItemVisible,\n PANES_LAYOUT_VERSION,\n parsePanesLayout,\n reconcilePanesLayout,\n removePanesItem,\n resizePanesSplit,\n} from \"./panes-layout\";\nexport { default as ResizeSeparator, type ResizeSeparatorProps } from \"./ResizeSeparator\";\nexport { attachResizeSeparator, type ResizeSeparatorOptions } from \"./resize-separator\";\nexport type { ScrollAreaProps } from \"./ScrollArea\";\nexport { default as ScrollArea } from \"./ScrollArea\";\nexport type {\n SaveStatusProps,\n SaveStatusState,\n SettingsFieldControlProps,\n SettingsFieldProps,\n SettingsFieldWidth,\n SettingsGroupActionProps,\n SettingsGroupProps,\n SettingsPageProps,\n SettingsPanelFooterProps,\n SettingsSaveBarProps,\n SettingsSectionProps,\n} from \"./Settings\";\nexport {\n readSettingsError,\n SaveStatus,\n SettingsField,\n SettingsGroup,\n SettingsPage,\n SettingsPanelFooter,\n SettingsSaveBar,\n SettingsSection,\n sameSettingValue,\n} from \"./Settings\";\nexport type {\n SettingsCollectionActionProps,\n SettingsCollectionItemActionsProps,\n SettingsCollectionItemProps,\n SettingsCollectionItemReorderProps,\n SettingsCollectionItemStatusProps,\n SettingsCollectionProps,\n} from \"./SettingsCollection\";\nexport { default as SettingsCollection } from \"./SettingsCollection\";\nexport type {\n SettingsModalFooterProps,\n SettingsModalGroupProps,\n SettingsModalProps,\n SettingsModalTabProps,\n SettingsModalTabTone,\n} from \"./SettingsModal\";\nexport { default as SettingsModal } from \"./SettingsModal\";\nexport {\n APP_WORKSPACE_SWITCHER_SEARCH_FROM,\n type AppWorkspaceSidebarSwitcherProps,\n type AppWorkspaceSwitcherAction,\n type AppWorkspaceSwitcherOption,\n} from \"./SidebarSwitcher\";\nexport { measureScrollFade } from \"./scroll-fade\";\nexport { attachSheetHandle, type SheetHandleOptions } from \"./sheet-handle\";\nexport type { TabBarItem, TabBarProps } from \"./TabBar\";\nexport { default as TabBar } from \"./TabBar\";\nexport type { TableOfContentsItem, TableOfContentsProps } from \"./TableOfContents\";\nexport { TableOfContents } from \"./TableOfContents\";\n"],"mappings":"AAAA,SAAS,eAAe,QAAmC,mBAAmB;AAO9E,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AAmCtD,SAAS,2BAA2B,EAAE,OAAO,IAAI,YAAY,QAAQ,gBAAgB;AACrF,SAAS,6BAA6B,QAAQ,iCAAiC;AAC/E,SAAS,iBAAiB,QAAQ,kBAAkB;AAEpD,SAAS,6BAA6B,EAAE,0BAA0B,QAAQ,4BAA4B;AAKtG,SACE,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,wCAAwC,EACxC,+BAA+B,EAC/B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,gCAAgC,EAChC,iCAAiC,QAC5B,uBAAuB;AAC9B,SAAgC,OAAO,IAAI,WAAW,QAAQ,eAAe;AAC7E,SAA8B,WAAW,QAA+B,eAAe;AACvF,SAAS,0BAA0B,EAAE,kBAAkB,QAAQ,wBAAwB;AAEvF,SAAS,SAAS,QAAQ,aAAa;AAcvC,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AActD,SAAS,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,QAAQ,kBAAkB;AAC9H,SAAS,YAAY,EAAE,aAAa,QAAiC,iBAAiB;AAQtF,SAAS,OAAO,IAAI,UAAU,QAAQ,cAAc;AAOpD,SACE,OAAO,IAAI,cAAc,EAGzB,qBAAqB,EACrB,kBAAkB,QACb,kBAAk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S,iBAAiB,QAAiC,gBAAgB;AAE3E,SAAS,OAAO,IAAI,MAAM,QAAQ,UAAU;AAE5C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
@@ -27,12 +27,7 @@ const workspaceMessages = i18n.define({
27
27
  sidebarAll: "All",
28
28
  sidebarAllLabel: ({
29
29
  label
30
- }) => `All ${label}`,
31
- pathLevelsAbove: "Levels above",
32
- statusNextAttempt: "next attempt",
33
- statusSelected: ({
34
- count
35
- }) => `${count} selected`
30
+ }) => `All ${label}`
36
31
  },
37
32
  de: {
38
33
  rowAction: "Zeilenaktion",
@@ -58,12 +53,7 @@ const workspaceMessages = i18n.define({
58
53
  sidebarAll: "Alle",
59
54
  sidebarAllLabel: ({
60
55
  label
61
- }) => `Alle ${label}`,
62
- pathLevelsAbove: "Ebenen darüber",
63
- statusNextAttempt: "nächster Versuch",
64
- statusSelected: ({
65
- count
66
- }) => `${count} ausgewählt`
56
+ }) => `Alle ${label}`
67
57
  }
68
58
  }
69
59
  });
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["layout/workspace-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst workspaceMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n rowAction: \"Row action\",\n sidebarUnread: ({ count }: { count: number }) => `${count} unread`,\n sidebarUnreadMany: \"more than 99 unread\",\n sidebarNewActivity: \"new activity\",\n sidebarMentioned: \"mentions you\",\n sidebarMuted: \"muted\",\n resizeNavigation: \"Resize navigation\",\n resizeWorkspacePane: \"Resize workspace pane\",\n resizeDetailPanel: \"Resize detail panel\",\n details: \"Details\",\n detailFullHeight: \"Full height\",\n resizeBottomDrawer: \"Resize bottom drawer\",\n showNavigation: \"Show navigation\",\n backTo: ({ page }: { page: string }) => `Back to ${page}`,\n path: \"Path\",\n moreLevels: \"More levels\",\n sidebarAll: \"All\",\n sidebarAllLabel: ({ label }: { label: string }) => `All ${label}`,\n pathLevelsAbove: \"Levels above\",\n statusNextAttempt: \"next attempt\",\n statusSelected: ({ count }: { count: number }) => `${count} selected`,\n },\n de: {\n rowAction: \"Zeilenaktion\",\n sidebarUnread: ({ count }) => `${count} ungelesen`,\n sidebarUnreadMany: \"mehr als 99 ungelesen\",\n sidebarNewActivity: \"neue Aktivität\",\n sidebarMentioned: \"erwähnt dich\",\n sidebarMuted: \"stummgeschaltet\",\n resizeNavigation: \"Breite der Navigation ändern\",\n resizeWorkspacePane: \"Breite des Arbeitsbereichs ändern\",\n resizeDetailPanel: \"Breite des Detailbereichs ändern\",\n details: \"Details\",\n detailFullHeight: \"Volle Höhe\",\n resizeBottomDrawer: \"Höhe des unteren Bereichs ändern\",\n showNavigation: \"Navigation anzeigen\",\n backTo: ({ page }) => `Zurück zu ${page}`,\n path: \"Pfad\",\n moreLevels: \"Weitere Ebenen\",\n sidebarAll: \"Alle\",\n sidebarAllLabel: ({ label }) => `Alle ${label}`,\n pathLevelsAbove: \"Ebenen darüber\",\n statusNextAttempt: \"nächster Versuch\",\n statusSelected: ({ count }) => `${count} ausgewählt`,\n },\n },\n});\n\nexport type WorkspaceMessages = ReturnType<(typeof workspaceMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useWorkspaceMessages = (): (() => WorkspaceMessages) => {\n const locale = useLocale();\n return () => workspaceMessages.resolve([locale()]).t;\n};\n\nexport const checkWorkspaceMessages = () => workspaceMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC;EACpC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,SAAS,EAAE,YAAY;MACvB,aAAa,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,GAAG,KAAK,SAAS;MAClE,iBAAiB,EAAE,qBAAqB;MACxC,kBAAkB,EAAE,cA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;MACjC,iBAAiB,EAAE,kBAAkB;MACrC,cAAc,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,GAAG,KAAK;IACzC;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,oBAAoB,GAAG,MAAiC;EACnE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,OAAO,MAAM,sBAAsB,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["layout/workspace-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst workspaceMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n rowAction: \"Row action\",\n sidebarUnread: ({ count }: { count: number }) => `${count} unread`,\n sidebarUnreadMany: \"more than 99 unread\",\n sidebarNewActivity: \"new activity\",\n sidebarMentioned: \"mentions you\",\n sidebarMuted: \"muted\",\n resizeNavigation: \"Resize navigation\",\n resizeWorkspacePane: \"Resize workspace pane\",\n resizeDetailPanel: \"Resize detail panel\",\n details: \"Details\",\n detailFullHeight: \"Full height\",\n resizeBottomDrawer: \"Resize bottom drawer\",\n showNavigation: \"Show navigation\",\n backTo: ({ page }: { page: string }) => `Back to ${page}`,\n path: \"Path\",\n moreLevels: \"More levels\",\n sidebarAll: \"All\",\n sidebarAllLabel: ({ label }: { label: string }) => `All ${label}`,\n },\n de: {\n rowAction: \"Zeilenaktion\",\n sidebarUnread: ({ count }) => `${count} ungelesen`,\n sidebarUnreadMany: \"mehr als 99 ungelesen\",\n sidebarNewActivity: \"neue Aktivität\",\n sidebarMentioned: \"erwähnt dich\",\n sidebarMuted: \"stummgeschaltet\",\n resizeNavigation: \"Breite der Navigation ändern\",\n resizeWorkspacePane: \"Breite des Arbeitsbereichs ändern\",\n resizeDetailPanel: \"Breite des Detailbereichs ändern\",\n details: \"Details\",\n detailFullHeight: \"Volle Höhe\",\n resizeBottomDrawer: \"Höhe des unteren Bereichs ändern\",\n showNavigation: \"Navigation anzeigen\",\n backTo: ({ page }) => `Zurück zu ${page}`,\n path: \"Pfad\",\n moreLevels: \"Weitere Ebenen\",\n sidebarAll: \"Alle\",\n sidebarAllLabel: ({ label }) => `Alle ${label}`,\n },\n },\n});\n\nexport type WorkspaceMessages = ReturnType<(typeof workspaceMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useWorkspaceMessages = (): (() => WorkspaceMessages) => {\n const locale = useLocale();\n return () => workspaceMessages.resolve([locale()]).t;\n};\n\nexport const checkWorkspaceMessages = () => workspaceMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC;EACpC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,SAAS,EAAE,YAAY;MACvB,aAAa,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,GAAG,KAAK,SAAS;MAClE,iBAAiB,EAAE,qBAAqB;MACxC,kBAAkB,EAAE,cAAc;MAClC,gBAAgB,EAAE,cAAc;MAChC,YAAY,EAAE,OAAO;MACrB,gBAAgB,EAAE,mBAAmB;MACrC,mBAAmB,EAAE,uBAAuB;MAC5C,iBAAiB,EAAE,qBAAqB;MACxC,OAAO,EAAE,SAAS;MAClB,gBAAgB,EAAE,aAAa;MAC/B,kBAAkB,EAAE,sBAAsB;MAC1C,cAAc,EAAE,iBAAiB;MACjC,MAAM,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,WAAW,IAAI,EAAE;MACzD,IAAI,EAAE,MAAM;MACZ,UAAU,EAAE,aAAa;MACzB,UAAU,EAAE,KAAK;MACjB,eAAe,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,OAAO,KAAK;IACjE,CAAC;IACD,EAAE,EAAE;MACF,SAAS,EAAE,cAAc;MACzB,aAAa,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,GAAG,KAAK,YAAY;MAClD,iBAAiB,EAAE,uBAAuB;MAC1C,kBAAkB,EAAE,gBAAgB;MACpC,gBAAgB,EAAE,cAAc;MAChC,YAAY,EAAE,iBAAiB;MAC/B,gBAAgB,EAAE,8BAA8B;MAChD,mBAAmB,EAAE,mCAAmC;MACxD,iBAAiB,EAAE,kCAAkC;MACrD,OAAO,EAAE,SAAS;MAClB,gBAAgB,EAAE,YAAY;MAC9B,kBAAkB,EAAE,kCAAkC;MACtD,cAAc,EAAE,qBAAqB;MACrC,MAAM,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,aAAa,IAAI,EAAE;MACzC,IAAI,EAAE,MAAM;MACZ,UAAU,EAAE,gBAAgB;MAC5B,UAAU,EAAE,MAAM;MAClB,eAAe,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,QAAQ,KAAK;IAC/C;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,oBAAoB,GAAG,MAAiC;EACnE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,OAAO,MAAM,sBAAsB,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@ import { escape as _$escape } from "solid-js/web";
6
6
  import { createComponent as _$createComponent } from "solid-js/web";
7
7
  var _tmpl$ = ["<div class=\"", "\">", "</div>"],
8
8
  _tmpl$2 = ["<div", ">", "</div>"],
9
- _tmpl$3 = ["<div", "><div", ">", "", "", "</div>", "</div>"],
9
+ _tmpl$3 = ["<div", ">", "", "", "", "</div>"],
10
10
  _tmpl$4 = ["<i class=\"", "\" aria-hidden=\"true\"></i>"],
11
11
  _tmpl$5 = ["<span class=\"k2b-sr-only\">", "</span>"],
12
12
  _tmpl$6 = ["<div", "><p", ">", "</p>", "</div>"],
@@ -15,16 +15,11 @@ var _tmpl$ = ["<div class=\"", "\">", "</div>"],
15
15
  _tmpl$9 = ["<div class=\"", "\"", ">", "</div>"];
16
16
  import { children, For, Show, splitProps } from "solid-js";
17
17
  import { dialogToneIcon, dialogToneLabel } from "../feedback/dialog-tone";
18
- import { rendersSomething } from "../internal/renders-something";
19
18
  import { useUiMessages } from "../intl/messages";
20
-
21
- /** `yours` is "your turn" (Valentin, 21.11.): a blue tint where the reader has to act; `warning` stays "to clarify". */
22
-
23
19
  export const NOTICE_CARD_CLASSES = {
24
20
  root: "k2b-notice-card",
25
21
  icon: "k2b-notice-card__icon",
26
22
  content: "k2b-notice-card__content",
27
- text: "k2b-notice-card__text",
28
23
  head: "k2b-notice-card__head",
29
24
  title: "k2b-notice-card__title",
30
25
  meta: "k2b-notice-card__meta",
@@ -32,6 +27,9 @@ export const NOTICE_CARD_CLASSES = {
32
27
  body: "k2b-notice-card__body",
33
28
  actions: "k2b-notice-card__actions"
34
29
  };
30
+
31
+ /** Whether resolved children render something; a Show whose condition is false, or a boolean, renders nothing. */
32
+ const rendersSomething = nodes => nodes.some(node => node != null && typeof node !== "boolean" && node !== "");
35
33
  function NoticeCardComponent(props) {
36
34
  const [local, articleProps] = splitProps(props, ["tone", "icon", "layout", "title", "detail", "meta", "children", "actions", "class", "bodyClass"]);
37
35
  // Children that render nothing, such as a Show whose condition is false, add no body and no gap.
@@ -67,7 +65,7 @@ function NoticeCardComponent(props) {
67
65
  return icon();
68
66
  },
69
67
  children: icon => [_$ssr(_tmpl$4, `${_$escape(icon(), true)} ${_$escape(NOTICE_CARD_CLASSES.icon, true)}`), toneWord() ? _$ssr(_tmpl$5, _$escape(toneWord())) : null]
70
- })), _$ssr(_tmpl$3, _$ssrAttribute("class", _$escape(NOTICE_CARD_CLASSES.content, true), false), _$ssrAttribute("class", _$escape(NOTICE_CARD_CLASSES.text, true), false), _$escape(_$createComponent(Show, {
68
+ })), _$ssr(_tmpl$3, _$ssrAttribute("class", _$escape(NOTICE_CARD_CLASSES.content, true), false), _$escape(_$createComponent(Show, {
71
69
  get when() {
72
70
  return local.title;
73
71
  },
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["surfaces/NoticeCard.tsx"],"sourcesContent":["import { children, For, type JSX, Show, splitProps } from \"solid-js\";\nimport { dialogToneIcon, dialogToneLabel } from \"../feedback/dialog-tone\";\nimport { rendersSomething } from \"../internal/renders-something\";\nimport { useUiMessages } from \"../intl/messages\";\nimport type { IntentTone } from \"../semantics\";\n\n/** `yours` is \"your turn\" (Valentin, 21.11.): a blue tint where the reader has to act; `warning` stays \"to clarify\". */\nexport type NoticeTone = Extract<IntentTone, \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\"> | \"ai\" | \"yours\";\n\ntype NoticeCardContentProps =\n | { title: JSX.Element; detail?: JSX.Element; meta?: JSX.Element; children?: JSX.Element }\n | { title?: never; detail?: never; meta?: never; children: JSX.Element };\n\nexport type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"title\"> &\n NoticeCardContentProps & {\n tone?: NoticeTone;\n /**\n * A Tabler icon class. By default it turns the notice into a compact status line whose icon and text take the tone\n * colour; `layout=\"card\"` keeps the card instead. `true`\n * takes the tone's own icon, the one a toned dialog shows, and names the tone for screen readers.\n */\n icon?: string | true;\n /**\n * Where an icon goes. `line`, the default, is the compact status line above. `card` keeps the calm card and sets the\n * icon in the tone colour beside the title, text, and actions, which share one text edge.\n */\n layout?: \"line\" | \"card\";\n /**\n * The deed: one `Button` or `ButtonLink` (`size=\"sm\"`, `secondary`) whose words name what it does, never \"Try\n * again\" (K10). A wide notice sets it beside the text, a narrow one below it. A second button is possible but\n * rare. In a `NoticeCard.Grid` row the actions of all cards share the bottom edge.\n */\n actions?: JSX.Element;\n class?: string;\n bodyClass?: string;\n };\n\nexport const NOTICE_CARD_CLASSES = {\n root: \"k2b-notice-card\",\n icon: \"k2b-notice-card__icon\",\n content: \"k2b-notice-card__content\",\n text: \"k2b-notice-card__text\",\n head: \"k2b-notice-card__head\",\n title: \"k2b-notice-card__title\",\n meta: \"k2b-notice-card__meta\",\n description: \"k2b-notice-card__description\",\n body: \"k2b-notice-card__body\",\n actions: \"k2b-notice-card__actions\",\n} as const;\n\nfunction NoticeCardComponent(props: NoticeCardProps): JSX.Element {\n const [local, articleProps] = splitProps(props, [\n \"tone\",\n \"icon\",\n \"layout\",\n \"title\",\n \"detail\",\n \"meta\",\n \"children\",\n \"actions\",\n \"class\",\n \"bodyClass\",\n ]);\n // Children that render nothing, such as a Show whose condition is false, add no body and no gap.\n const body = children(() => local.children);\n const hasBody = () => rendersSomething(body.toArray());\n const actions = children(() => local.actions);\n const hasActions = () => rendersSomething(actions.toArray());\n const messages = useUiMessages();\n /** The tone a dialog also knows, so `icon` true shows the same icon and word; info and neutral have no word. */\n const dialogTone = () => (local.tone === \"success\" || local.tone === \"warning\" || local.tone === \"danger\" ? local.tone : undefined);\n const icon = () => {\n if (local.icon !== true) return local.icon;\n const tone = dialogTone();\n return tone ? dialogToneIcon(tone) : \"ti ti-info-circle\";\n };\n const toneWord = () => {\n const tone = local.icon === true ? dialogTone() : undefined;\n return tone ? `${dialogToneLabel(messages(), tone)}: ` : undefined;\n };\n return (\n <article\n {...articleProps}\n class={`${NOTICE_CARD_CLASSES.root} ${local.class ?? \"\"}`}\n data-tone={local.tone ?? \"neutral\"}\n {...(local.icon ? { [local.layout === \"card\" ? \"data-card-icon\" : \"data-icon\"]: \"\" } : {})}\n // A spread, not `data-actions={… : undefined}`: SSR writes an absent attribute as a stray space before `>`.\n {...(hasActions() ? { \"data-actions\": \"\" } : {})}\n >\n <Show when={icon()}>\n {(icon) => (\n <>\n <i class={`${icon()} ${NOTICE_CARD_CLASSES.icon}`} aria-hidden=\"true\" />\n {/* Inside the icon's branch, so a notice without one keeps its markup. */}\n {toneWord() ? <span class=\"k2b-sr-only\">{toneWord()}</span> : null}\n </>\n )}\n </Show>\n <div class={NOTICE_CARD_CLASSES.content}>\n {/* The sentence and its consequence share one block, so a wide cell sets the deed beside it and a narrow\n one below it (K10, K15). */}\n <div class={NOTICE_CARD_CLASSES.text}>\n <Show when={local.title}>\n {(title) => (\n <div class={NOTICE_CARD_CLASSES.head}>\n <p class={NOTICE_CARD_CLASSES.title}>{title()}</p>\n <Show when={local.meta}>{(meta) => <span class={NOTICE_CARD_CLASSES.meta}>{meta()}</span>}</Show>\n </div>\n )}\n </Show>\n <Show when={local.detail}>{(detail) => <p class={NOTICE_CARD_CLASSES.description}>{detail()}</p>}</Show>\n <Show when={hasBody()}>\n <div class={`${NOTICE_CARD_CLASSES.body} ${local.bodyClass ?? \"\"}`}>{body()}</div>\n </Show>\n </div>\n <Show when={hasActions()}>\n <div class={NOTICE_CARD_CLASSES.actions}>{actions()}</div>\n </Show>\n </div>\n </article>\n );\n}\n\nexport type NoticeGridProps<T> = {\n items: readonly T[];\n children: (item: T) => JSX.Element;\n class?: string;\n};\n\nfunction NoticeGrid<T>(props: NoticeGridProps<T>): JSX.Element {\n const columns = () => (props.items.length <= 1 ? \"one\" : props.items.length === 2 ? \"two\" : \"three\");\n return (\n <Show when={props.items.length > 0}>\n <div class={`k2b-notice-grid ${props.class ?? \"\"}`} data-columns={columns()}>\n <For each={props.items}>{(item) => props.children(item)}</For>\n </div>\n </Show>\n );\n}\n\nexport const NoticeCard = Object.assign(NoticeCardComponent, { Grid: NoticeGrid });\nexport default NoticeCard;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AACpE,SAAS,cAAc,EAAE,eAAe,QAAQ,yBAAyB;AACzE,SAAS,gBAAgB,QAAQ,+BAA+B;AAChE,SAAS,aAAa,QAAQ,kBAAkB;;AAGhD;;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Card.tsx"],"sourcesContent":["import { children, For, type JSX, Show, splitProps } from \"solid-js\";\nimport { dialogToneIcon, dialogToneLabel } from \"../feedback/dialog-tone\";\nimport { useUiMessages } from \"../intl/messages\";\nimport type { IntentTone } from \"../semantics\";\n\nexport type NoticeTone = Extract<IntentTone, \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\"> | \"ai\";\n\ntype NoticeCardContentProps =\n | { title: JSX.Element; detail?: JSX.Element; meta?: JSX.Element; children?: JSX.Element }\n | { title?: never; detail?: never; meta?: never; children: JSX.Element };\n\nexport type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"title\"> &\n NoticeCardContentProps & {\n tone?: NoticeTone;\n /**\n * A Tabler icon class. By default it turns the notice into a compact status line whose icon and text take the tone\n * colour; `layout=\"card\"` keeps the card instead. `true`\n * takes the tone's own icon, the one a toned dialog shows, and names the tone for screen readers.\n */\n icon?: string | true;\n /**\n * Where an icon goes. `line`, the default, is the compact status line above. `card` keeps the calm card and sets the\n * icon in the tone colour beside the title, text, and actions, which share one text edge.\n */\n layout?: \"line\" | \"card\";\n /**\n * The direct next step: one or two `Button`s or `ButtonLink`s (`size=\"sm\"`) in one row below the text. The primary\n * action takes the tone's button variant; a second one is `secondary`. In a `NoticeCard.Grid` row the actions of all\n * cards share the bottom edge.\n */\n actions?: JSX.Element;\n class?: string;\n bodyClass?: string;\n };\n\nexport const NOTICE_CARD_CLASSES = {\n root: \"k2b-notice-card\",\n icon: \"k2b-notice-card__icon\",\n content: \"k2b-notice-card__content\",\n head: \"k2b-notice-card__head\",\n title: \"k2b-notice-card__title\",\n meta: \"k2b-notice-card__meta\",\n description: \"k2b-notice-card__description\",\n body: \"k2b-notice-card__body\",\n actions: \"k2b-notice-card__actions\",\n} as const;\n\n/** Whether resolved children render something; a Show whose condition is false, or a boolean, renders nothing. */\nconst rendersSomething = (nodes: unknown[]) => nodes.some((node) => node != null && typeof node !== \"boolean\" && node !== \"\");\nfunction NoticeCardComponent(props: NoticeCardProps): JSX.Element {\n const [local, articleProps] = splitProps(props, [\n \"tone\",\n \"icon\",\n \"layout\",\n \"title\",\n \"detail\",\n \"meta\",\n \"children\",\n \"actions\",\n \"class\",\n \"bodyClass\",\n ]);\n // Children that render nothing, such as a Show whose condition is false, add no body and no gap.\n const body = children(() => local.children);\n const hasBody = () => rendersSomething(body.toArray());\n const actions = children(() => local.actions);\n const hasActions = () => rendersSomething(actions.toArray());\n const messages = useUiMessages();\n /** The tone a dialog also knows, so `icon` true shows the same icon and word; info and neutral have no word. */\n const dialogTone = () => (local.tone === \"success\" || local.tone === \"warning\" || local.tone === \"danger\" ? local.tone : undefined);\n const icon = () => {\n if (local.icon !== true) return local.icon;\n const tone = dialogTone();\n return tone ? dialogToneIcon(tone) : \"ti ti-info-circle\";\n };\n const toneWord = () => {\n const tone = local.icon === true ? dialogTone() : undefined;\n return tone ? `${dialogToneLabel(messages(), tone)}: ` : undefined;\n };\n return (\n <article\n {...articleProps}\n class={`${NOTICE_CARD_CLASSES.root} ${local.class ?? \"\"}`}\n data-tone={local.tone ?? \"neutral\"}\n {...(local.icon ? { [local.layout === \"card\" ? \"data-card-icon\" : \"data-icon\"]: \"\" } : {})}\n // A spread, not `data-actions={… : undefined}`: SSR writes an absent attribute as a stray space before `>`.\n {...(hasActions() ? { \"data-actions\": \"\" } : {})}\n >\n <Show when={icon()}>\n {(icon) => (\n <>\n <i class={`${icon()} ${NOTICE_CARD_CLASSES.icon}`} aria-hidden=\"true\" />\n {/* Inside the icon's branch, so a notice without one keeps its markup. */}\n {toneWord() ? <span class=\"k2b-sr-only\">{toneWord()}</span> : null}\n </>\n )}\n </Show>\n <div class={NOTICE_CARD_CLASSES.content}>\n <Show when={local.title}>\n {(title) => (\n <div class={NOTICE_CARD_CLASSES.head}>\n <p class={NOTICE_CARD_CLASSES.title}>{title()}</p>\n <Show when={local.meta}>{(meta) => <span class={NOTICE_CARD_CLASSES.meta}>{meta()}</span>}</Show>\n </div>\n )}\n </Show>\n <Show when={local.detail}>{(detail) => <p class={NOTICE_CARD_CLASSES.description}>{detail()}</p>}</Show>\n <Show when={hasBody()}>\n <div class={`${NOTICE_CARD_CLASSES.body} ${local.bodyClass ?? \"\"}`}>{body()}</div>\n </Show>\n <Show when={hasActions()}>\n <div class={NOTICE_CARD_CLASSES.actions}>{actions()}</div>\n </Show>\n </div>\n </article>\n );\n}\n\nexport type NoticeGridProps<T> = {\n items: readonly T[];\n children: (item: T) => JSX.Element;\n class?: string;\n};\n\nfunction NoticeGrid<T>(props: NoticeGridProps<T>): JSX.Element {\n const columns = () => (props.items.length <= 1 ? \"one\" : props.items.length === 2 ? \"two\" : \"three\");\n return (\n <Show when={props.items.length > 0}>\n <div class={`k2b-notice-grid ${props.class ?? \"\"}`} data-columns={columns()}>\n <For each={props.items}>{(item) => props.children(item)}</For>\n </div>\n </Show>\n );\n}\n\nexport const NoticeCard = Object.assign(NoticeCardComponent, { Grid: NoticeGrid });\nexport default NoticeCard;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AACpE,SAAS,cAAc,EAAE,eAAe,QAAQ,yBAAyB;AACzE,SAAS,aAAa,QAAQ,kBAAkB;AAiChD,OAAO,MAAM,mBAAmB,GAAG;EACjC,IAAI,EAAE,iBAAiB;EACvB,IAAI,EAAE,uBAAuB;EAC7B,OAAO,EAAE,0BAA0B;EACnC,IAAI,EAAE,uBAAuB;EAC7B,KAAK,EAAE,wBAAwB;EAC/B,IAAI,EAAE,uBAAuB;EAC7B,WAAW,EAAE,8BAA8B;EAC3C,IAAI,EAAE,uBAAuB;EAC7B,OAAO,EAAE;AACX,CAAU;;AAEV;AACA,MAAM,gBAAgB,GAAI,KAAgB,IAAK,KAAK,CAAC,IAAI,CAAE,IAAI,IAAK,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,C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EAAE,SAAE,WAAG,IAAI,CAAC,CAAC;IAAA;EAAA,gCAE5E,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,UAAU,CAAC,CAAC;IAAA;IAAA;MAAA,uDACV,mBAAmB,CAAC,OAAO,0BAAG,OAAO,CAAC,CAAC;IAAA;EAAA;AAK7D;AAQA,SAAS,UAAU,CAAI,KAAyB,EAAe;EAC7D,MAAM,OAAO,GAAG,MAAO,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,OAAQ;EACpG,yBACG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;IAAA;IAAA;MAAA,sBACpB,4BAAmB,KAAK,CAAC,KAAK,IAAI,EAAE,SAAE,0CAAgB,OAAO,CAAC,CAAC,4CACxE,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,KAAK;QAAA;QAAA,UAAI,IAAI,IAAK,KAAK,CAAC,QAAQ,CAAC,IAAI;MAAC;IAAA;EAAA;AAI/D;AAEA,OAAO,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE;EAAE,IAAI,EAAE;AAAW,CAAC,CAAC;AAClF,eAAe,UAAU","ignoreList":[]}
@@ -6,7 +6,7 @@ import { memo as _$memo } from "solid-js/web";
6
6
  var _tmpl$ = ["<p class=\"k2b-placeholder__title\">", "</p>"],
7
7
  _tmpl$2 = ["<div class=\"k2b-placeholder__description\">", "</div>"],
8
8
  _tmpl$3 = ["<div class=\"k2b-placeholder__action\">", "", "</div>"],
9
- _tmpl$4 = ["<span class=\"k2b-placeholder__icon\"", "><i", " aria-hidden=\"true\"></i></span>"];
9
+ _tmpl$4 = ["<span", "><i", " aria-hidden=\"true\"></i></span>"];
10
10
  import { Show } from "solid-js";
11
11
  import { Dynamic } from "solid-js/web";
12
12
  import { Button } from "../actions/Button";
@@ -15,20 +15,12 @@ import { Paper } from "./Paper";
15
15
 
16
16
  /** `compact` stacks inside a section, `inline` is one row in a list or sidebar, `panel` fills a work area. */
17
17
 
18
- /** The tone of the round sign; the sentence still says what it means (K8, K10). */
19
-
20
- const TONE_ICONS = {
21
- success: "ti ti-check",
22
- info: "ti ti-info-circle",
23
- warning: "ti ti-alert-triangle",
24
- danger: "ti ti-alert-circle"
25
- };
26
18
  export default function Placeholder(props) {
27
19
  const messages = useUiMessages();
28
20
  const align = () => props.align ?? "center";
29
21
  const state = () => props.state ?? "empty";
30
22
  const variant = () => props.variant ?? "compact";
31
- const icon = () => props.icon ?? (props.tone && state() !== "loading" && state() !== "error" ? TONE_ICONS[props.tone] : undefined) ?? (state() === "loading" ? "ti ti-loader-2" : state() === "error" ? "ti ti-alert-circle" : state() === "no-results" ? "ti ti-search-off" : state() === "no-access" ? "ti ti-lock" : undefined);
23
+ const icon = () => props.icon ?? (state() === "loading" ? "ti ti-loader-2" : state() === "error" ? "ti ti-alert-circle" : state() === "no-results" ? "ti ti-search-off" : state() === "no-access" ? "ti ti-lock" : undefined);
32
24
  return _$createComponent(Dynamic, {
33
25
  get component() {
34
26
  return props.surface === "paper" ? Paper : "div";
@@ -48,9 +40,6 @@ export default function Placeholder(props) {
48
40
  get ["data-variant"]() {
49
41
  return variant();
50
42
  },
51
- get ["data-tone"]() {
52
- return props.tone;
53
- },
54
43
  get role() {
55
44
  return _$memo(() => state() === "error")() ? "alert" : state() === "loading" ? "status" : undefined;
56
45
  },
@@ -65,8 +54,8 @@ export default function Placeholder(props) {
65
54
  get when() {
66
55
  return icon();
67
56
  },
68
- children: iconClass => // One round sign (K10): a quiet disc for the calm states and an error; loading keeps the same box bare.
69
- _$ssr(_tmpl$4, _$ssrAttribute("data-sign", state() === "loading" ? _$escape(undefined, true) : "", false), _$ssrAttribute("class", _$escape(iconClass(), true), false))
57
+ children: iconClass => // Quiet states share the chip; loading and error keep the same icon box without it.
58
+ _$ssr(_tmpl$4, _$ssrAttribute("class", ["empty", "no-results", "no-access"].includes(state()) && variant() !== "inline" ? "k2b-placeholder__icon k2b-icon-tile" : "k2b-placeholder__icon", false), _$ssrAttribute("class", _$escape(iconClass(), true), false))
70
59
  }), _$createComponent(Show, {
71
60
  get when() {
72
61
  return props.title;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["surfaces/Placeholder.tsx"],"sourcesContent":["import { type JSX, Show } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { Paper } from \"./Paper\";\n\nexport type PlaceholderAlign = \"center\" | \"left\";\nexport type PlaceholderSurface = \"none\" | \"paper\";\nexport type PlaceholderState = \"empty\" | \"no-results\" | \"no-access\" | \"loading\" | \"error\";\n/** `compact` stacks inside a section, `inline` is one row in a list or sidebar, `panel` fills a work area. */\nexport type PlaceholderVariant = \"compact\" | \"inline\" | \"panel\";\n/** The tone of the round sign; the sentence still says what it means (K8, K10). */\nexport type PlaceholderTone = \"success\" | \"info\" | \"warning\" | \"danger\";\n\nexport type PlaceholderProps = {\n title?: JSX.Element;\n description?: JSX.Element;\n icon?: string;\n action?: JSX.Element;\n onRetry?: () => void;\n align?: PlaceholderAlign;\n surface?: PlaceholderSurface;\n state?: PlaceholderState;\n variant?: PlaceholderVariant;\n /**\n * Colours the round sign in a state tone, such as `success` with a check for \"All done\". The title still says it\n * in words. Without an `icon` the tone brings its own: check, info, alert triangle, or alert circle.\n */\n tone?: PlaceholderTone;\n class?: string;\n};\n\nconst TONE_ICONS: Record<PlaceholderTone, string> = {\n success: \"ti ti-check\",\n info: \"ti ti-info-circle\",\n warning: \"ti ti-alert-triangle\",\n danger: \"ti ti-alert-circle\",\n};\n\nexport default function Placeholder(props: PlaceholderProps): JSX.Element {\n const messages = useUiMessages();\n const align = () => props.align ?? \"center\";\n const state = () => props.state ?? \"empty\";\n const variant = () => props.variant ?? \"compact\";\n const icon = () =>\n props.icon ??\n (props.tone && state() !== \"loading\" && state() !== \"error\" ? TONE_ICONS[props.tone] : undefined) ??\n (state() === \"loading\"\n ? \"ti ti-loader-2\"\n : state() === \"error\"\n ? \"ti ti-alert-circle\"\n : state() === \"no-results\"\n ? \"ti ti-search-off\"\n : state() === \"no-access\"\n ? \"ti ti-lock\"\n : undefined);\n\n return (\n <Dynamic\n component={props.surface === \"paper\" ? Paper : \"div\"}\n class={`k2b-placeholder ${props.class ?? \"\"}`}\n data-align={align()}\n data-state={state()}\n data-surface={props.surface ?? \"none\"}\n data-variant={variant()}\n data-tone={props.tone}\n role={state() === \"error\" ? \"alert\" : state() === \"loading\" ? \"status\" : undefined}\n aria-live={state() === \"loading\" ? \"polite\" : undefined}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show when={icon()}>\n {(iconClass) => (\n // One round sign (K10): a quiet disc for the calm states and an error; loading keeps the same box bare.\n <span class=\"k2b-placeholder__icon\" data-sign={state() === \"loading\" ? undefined : \"\"}>\n <i class={iconClass()} aria-hidden=\"true\" />\n </span>\n )}\n </Show>\n <Show when={props.title}>\n <p class=\"k2b-placeholder__title\">{props.title}</p>\n </Show>\n <Show when={props.description}>\n <div class=\"k2b-placeholder__description\">{props.description}</div>\n </Show>\n <Show when={props.action || (state() === \"error\" && props.onRetry)}>\n <div class=\"k2b-placeholder__action\">\n {props.action}\n <Show when={state() === \"error\" && props.onRetry}>\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => props.onRetry?.()}>\n {messages().tryAgain}\n </Button>\n </Show>\n </div>\n </Show>\n </Dynamic>\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAAmB,IAAI,QAAQ,UAAU;AACzC,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,KAAK,QAAQ,SAAS;;AAK/B;;AAEA;;AAqBA,MAAM,UAA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":3,"names":[],"sources":["surfaces/Placeholder.tsx"],"sourcesContent":["import { type JSX, Show } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { Paper } from \"./Paper\";\n\nexport type PlaceholderAlign = \"center\" | \"left\";\nexport type PlaceholderSurface = \"none\" | \"paper\";\nexport type PlaceholderState = \"empty\" | \"no-results\" | \"no-access\" | \"loading\" | \"error\";\n/** `compact` stacks inside a section, `inline` is one row in a list or sidebar, `panel` fills a work area. */\nexport type PlaceholderVariant = \"compact\" | \"inline\" | \"panel\";\n\nexport type PlaceholderProps = {\n title?: JSX.Element;\n description?: JSX.Element;\n icon?: string;\n action?: JSX.Element;\n onRetry?: () => void;\n align?: PlaceholderAlign;\n surface?: PlaceholderSurface;\n state?: PlaceholderState;\n variant?: PlaceholderVariant;\n class?: string;\n};\n\nexport default function Placeholder(props: PlaceholderProps): JSX.Element {\n const messages = useUiMessages();\n const align = () => props.align ?? \"center\";\n const state = () => props.state ?? \"empty\";\n const variant = () => props.variant ?? \"compact\";\n const icon = () =>\n props.icon ??\n (state() === \"loading\"\n ? \"ti ti-loader-2\"\n : state() === \"error\"\n ? \"ti ti-alert-circle\"\n : state() === \"no-results\"\n ? \"ti ti-search-off\"\n : state() === \"no-access\"\n ? \"ti ti-lock\"\n : undefined);\n\n return (\n <Dynamic\n component={props.surface === \"paper\" ? Paper : \"div\"}\n class={`k2b-placeholder ${props.class ?? \"\"}`}\n data-align={align()}\n data-state={state()}\n data-surface={props.surface ?? \"none\"}\n data-variant={variant()}\n role={state() === \"error\" ? \"alert\" : state() === \"loading\" ? \"status\" : undefined}\n aria-live={state() === \"loading\" ? \"polite\" : undefined}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show when={icon()}>\n {(iconClass) => (\n // Quiet states share the chip; loading and error keep the same icon box without it.\n <span\n class={\n [\"empty\", \"no-results\", \"no-access\"].includes(state()) && variant() !== \"inline\"\n ? \"k2b-placeholder__icon k2b-icon-tile\"\n : \"k2b-placeholder__icon\"\n }\n >\n <i class={iconClass()} aria-hidden=\"true\" />\n </span>\n )}\n </Show>\n <Show when={props.title}>\n <p class=\"k2b-placeholder__title\">{props.title}</p>\n </Show>\n <Show when={props.description}>\n <div class=\"k2b-placeholder__description\">{props.description}</div>\n </Show>\n <Show when={props.action || (state() === \"error\" && props.onRetry)}>\n <div class=\"k2b-placeholder__action\">\n {props.action}\n <Show when={state() === \"error\" && props.onRetry}>\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => props.onRetry?.()}>\n {messages().tryAgain}\n </Button>\n </Show>\n </div>\n </Show>\n </Dynamic>\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAAmB,IAAI,QAAQ,UAAU;AACzC,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,KAAK,QAAQ,SAAS;;AAK/B;;AAgBA,eAAe,SAAS,WAAW,CAAC,KAAuB,EAAe;EACxE,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC;EAChC,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,IAAI,QAAQ;EAC3C,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,IAAI,OAAO;EAC1C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,IAAI,SAAS;EAChD,MAAM,IAAI,GAAG,MACX,KAAK,CAAC,IAAI,KACT,KAAK,CAAC,CAAC,KAAK,SAAS,GAClB,gBAAgB,GAChB,KAAK,CAAC,CAAC,KAAK,OAAO,GACjB,oBAAoB,GACpB,KAAK,CAAC,CAAC,KAAK,YAAY,GACtB,kBAAkB,GAClB,KAAK,CAAC,CAAC,KAAK,WAAW,GACrB,YAAY,GACZ,SAAS,CAAC;EAEtB,yBACG,OAAO;IAAA,IACN,SAAS;MAAA,OAAE,KAAK,CAAC,OAA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AAK,CAAC,OAAQ;QAAA;QAAA;UAAA,+BAE7D,KAAK,CAAC,MAAM,8BACZ,IAAI;YAAA,IAAC,IAAI;cAAA,OAAE,kBAAK,CAAC,CAAC,KAAK,OAAO,OAAI,KAAK,CAAC,OAAO;YAAA;YAAA;cAAA,yBAC7C,MAAM;gBAAC,IAAI;gBAAU,IAAI;gBAAM,OAAO;gBAAa,OAAO,EAAE,MAAM,KAAK,CAAC,OAAO,GAAG,CAAC;gBAAA;kBAAA,OACjF,QAAQ,CAAC,CAAC,CAAC,QAAQ;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAOlC","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  import { ssrElement as _$ssrElement } from "solid-js/web";
2
2
  import { mergeProps as _$mergeProps } from "solid-js/web";
3
3
  import { memo as _$memo } from "solid-js/web";
4
- import { ssrStyle as _$ssrStyle } from "solid-js/web";
5
4
  import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
6
5
  import { ssr as _$ssr } from "solid-js/web";
7
6
  import { escape as _$escape } from "solid-js/web";
@@ -11,7 +10,7 @@ var _tmpl$ = ["<span class=\"k2b-count-chip\">", "</span>"],
11
10
  _tmpl$3 = ["<span class=\"k2b-section__restricted\"", "><i class=\"ti ti-lock\" aria-hidden=\"true\"></i>", "</span>"],
12
11
  _tmpl$4 = ["<span class=\"k2b-section__description\">", "</span>"],
13
12
  _tmpl$5 = ["<span class=\"k2b-section__copy\"><span class=\"k2b-section__heading\">", "", "", "", "", "</span>", "</span>"],
14
- _tmpl$6 = ["<span class=\"k2b-section__icon\" aria-hidden=\"true\"", " style=\"", "\"><i", "></i></span>"],
13
+ _tmpl$6 = ["<span class=\"k2b-section__icon\" aria-hidden=\"true\"><i", "></i></span>"],
15
14
  _tmpl$7 = ["<span class=\"k2b-section__none\">", "</span>"],
16
15
  _tmpl$8 = ["<button type=\"button\" class=\"k2b-section__toggle\"", "", ">", "<span class=\"k2b-section__chevron\" aria-hidden=\"true\"><i class=\"ti ti-chevron-down\"></i></span></button>"],
17
16
  _tmpl$9 = ["<div role=\"status\"><span class=\"k2b-sr-only\">", "</span>", "</div>"],
@@ -31,7 +30,7 @@ import { Button } from "../actions/Button";
31
30
  import { useUiMessages } from "../intl/messages";
32
31
  import { useDetailPanelMessages } from "../layout/detail-panel-messages";
33
32
 
34
- /** Named after the status tokens; a tone colours the symbol tile only, never the fill or the title (K8, K17). */
33
+ /** Named after the status tokens; a tone colours the frame, the title, and the icon, never the fill. */
35
34
 
36
35
  /** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */
37
36
 
@@ -59,7 +58,7 @@ const Heading = props => _$createComponent(Dynamic, {
59
58
  }
60
59
  });
61
60
  const SectionRoot = props => {
62
- const [local, rest] = splitProps(props, ["title", "icon", "iconColor", "size", "frame", "tone", "restricted", "description", "count", "meta", "footer", "state", "errorMessage", "onRetry", "loadingRows", "level", "class", "children", "actions", "collapsible", "summary", "defaultOpen", "open", "onOpenChange", "disabled"]);
61
+ const [local, rest] = splitProps(props, ["title", "icon", "size", "frame", "tone", "restricted", "description", "count", "meta", "footer", "state", "errorMessage", "onRetry", "loadingRows", "level", "class", "children", "actions", "collapsible", "summary", "defaultOpen", "open", "onOpenChange", "disabled"]);
63
62
  const ui = useUiMessages();
64
63
  const counts = useDetailPanelMessages();
65
64
  const frameDefault = useContext(SectionFrameDefault);
@@ -99,9 +98,7 @@ const SectionRoot = props => {
99
98
  get when() {
100
99
  return local.icon;
101
100
  },
102
- children: name => _$ssr(_tmpl$6, _$ssrAttribute("data-color", local.iconColor ? "" : _$escape(undefined, true), false), _$ssrStyle(local.iconColor ? {
103
- "--k2b-section-icon-color": local.iconColor
104
- } : undefined), _$ssrAttribute("class", _$escape(name(), true), false))
101
+ children: name => _$ssr(_tmpl$6, _$ssrAttribute("class", _$escape(name(), true), false))
105
102
  }), _$ssr(_tmpl$5, _$escape(title), _$escape(_$createComponent(Show, {
106
103
  get when() {
107
104
  return local.count !== undefined;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["surfaces/Section.tsx"],"sourcesContent":["import { children, createContext, createEffect, createSignal, createUniqueId, For, type JSX, Show, splitProps, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useDetailPanelMessages } from \"../layout/detail-panel-messages\";\n\n/** Named after the status tokens; a tone colours the symbol tile only, never the fill or the title (K8, K17). */\nexport type SectionTone = \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"ai\";\n/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */\nexport type SectionSize = \"sm\" | \"md\";\n/** `line` draws the light 1 px frame; inside another frame a section always stands flat. */\nexport type SectionFrame = \"line\" | \"none\";\nexport type SectionState = \"ready\" | \"loading\" | \"error\";\n\ntype SectionBaseProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"title\" | \"children\" | \"class\"> & {\n title: JSX.Element;\n icon?: string;\n /**\n * The colour of the section's area as a CSS colour, such as money or goods on a dense record page (K17). It sets the\n * icon in a 20 px tile of that colour, the one place the area colour shows. Never a status hue, never near the AI\n * plum; a `tone` wins.\n */\n iconColor?: string;\n size?: SectionSize;\n frame?: SectionFrame;\n tone?: SectionTone;\n /**\n * Marks a section that only some people see, such as \"Only with permission\": a lock and these words after the\n * title. It is part of the section's accessible name and combines with any tone.\n */\n restricted?: string;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n /** Commands for the whole topic, as a row of buttons at the end of the body. */\n footer?: JSX.Element;\n /** `loading` and `error` take the body's place; the heading stays where it is. */\n state?: SectionState;\n /** Says what did not load; defaults to a generic sentence. */\n errorMessage?: JSX.Element;\n /** Shows \"Try again\" in the error state. */\n onRetry?: () => void;\n /** Placeholder rows while loading, the number the loaded body usually shows. Defaults to 3. */\n loadingRows?: number;\n /** Heading level; defaults to 3, or 2 for `size=\"md\"`. */\n level?: 2 | 3;\n class?: string;\n};\n\nexport type SectionProps = SectionBaseProps &\n (\n | {\n children?: JSX.Element;\n /** At most two quiet controls at the end of the heading, such as \"+\" or text buttons; they read grey. */\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\nexport type SectionPartProps = {\n title: JSX.Element;\n children: JSX.Element;\n class?: string;\n};\n\ntype SectionComponent = ((props: SectionProps) => JSX.Element) & {\n Part: (props: SectionPartProps) => JSX.Element;\n};\n\nconst SectionLevel = createContext<number>(2);\n\n/**\n * The frame a section draws when it passes none. A host that frames its topics itself, such as a detail panel, sets\n * `none`; everywhere else a section is a card.\n */\nexport const SectionFrameDefault = createContext<SectionFrame>(\"line\");\n\nconst Heading = (props: { level: number; id?: string; class: string; children: JSX.Element }): JSX.Element => (\n <Dynamic component={`h${props.level}`} id={props.id} class={props.class}>\n {props.children}\n </Dynamic>\n);\n\nconst SectionRoot = (props: SectionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"title\",\n \"icon\",\n \"iconColor\",\n \"size\",\n \"frame\",\n \"tone\",\n \"restricted\",\n \"description\",\n \"count\",\n \"meta\",\n \"footer\",\n \"state\",\n \"errorMessage\",\n \"onRetry\",\n \"loadingRows\",\n \"level\",\n \"class\",\n \"children\",\n \"actions\",\n \"collapsible\",\n \"summary\",\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"disabled\",\n ]);\n const ui = useUiMessages();\n const counts = useDetailPanelMessages();\n const frameDefault = useContext(SectionFrameDefault);\n const id = `k2b-section-${createUniqueId()}`;\n const titleId = `${id}-title`;\n const restrictedId = `${id}-restricted`;\n const bodyId = `${id}-body`;\n const level = () => local.level ?? (local.size === \"md\" ? 2 : 3);\n const state = () => local.state ?? \"ready\";\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n const open = () => !local.collapsible || (local.open ?? internalOpen());\n let toggleButton: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n\n const toggle = () => {\n if (local.disabled) return;\n const next = !open();\n if (local.open === undefined) setInternalOpen(next);\n local.onOpenChange?.(next);\n };\n // A parent may close the section while focus is inside it; focus then returns to the toggle instead of the page.\n createEffect(() => {\n if (open()) return;\n queueMicrotask(() => {\n const active = body?.ownerDocument.activeElement;\n if (!open() && active && body?.contains(active)) toggleButton?.focus();\n });\n });\n\n // Resolve once and only while ready: reading `children` twice would build the body twice.\n const resolved = children(() => (state() === \"ready\" ? local.children : undefined));\n // A JSX action must also be built once: checking the slot and then reading it again creates different hydration keys.\n const resolvedActions = children(() => local.actions);\n const hasBody = () => local.collapsible || state() !== \"ready\" || Boolean(resolved.toArray().length) || Boolean(local.footer);\n\n /** Icon, then the title with its count, state, and restricted marker in one row, then the description. */\n const headingRow = (title: JSX.Element, summary?: JSX.Element) => (\n <>\n <Show when={local.icon}>\n {(name) => (\n <span\n class=\"k2b-section__icon\"\n aria-hidden=\"true\"\n data-color={local.iconColor ? \"\" : undefined}\n style={local.iconColor ? { \"--k2b-section-icon-color\": local.iconColor } : undefined}\n >\n <i class={name()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-section__copy\">\n <span class=\"k2b-section__heading\">\n {title}\n <Show when={local.count !== undefined}>\n <Show when={local.count! > 0} fallback={<span class=\"k2b-section__none\">{counts().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{local.count}</span>\n </Show>\n </Show>\n <Show when={local.meta}>\n <span class=\"k2b-section__meta\">{local.meta}</span>\n </Show>\n <Show when={local.restricted}>\n <span class=\"k2b-section__restricted\" id={restrictedId}>\n <i class=\"ti ti-lock\" aria-hidden=\"true\" />\n {local.restricted}\n </span>\n </Show>\n {summary}\n </span>\n <Show when={local.description}>\n <span class=\"k2b-section__description\">{local.description}</span>\n </Show>\n </span>\n </>\n );\n\n return (\n <section\n {...rest}\n class={local.class ? `k2b-section ${local.class}` : \"k2b-section\"}\n data-size={local.size ?? \"sm\"}\n data-frame={local.frame ?? frameDefault}\n data-tone={local.tone && local.tone !== \"neutral\" ? local.tone : undefined}\n data-icon={local.icon ? \"true\" : undefined}\n data-collapsible={local.collapsible ? \"true\" : undefined}\n data-open={local.collapsible ? String(open()) : undefined}\n data-summary={local.collapsible && local.summary ? \"true\" : undefined}\n aria-labelledby={local.restricted ? `${titleId} ${restrictedId}` : titleId}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show\n when={local.collapsible}\n fallback={\n <header class=\"k2b-section__header\">\n {headingRow(\n <Heading level={level()} id={titleId} class=\"k2b-section__title\">\n {local.title}\n </Heading>,\n )}\n <Show when={resolvedActions()}>\n <div class=\"k2b-section__actions\">{resolvedActions()}</div>\n </Show>\n </header>\n }\n >\n {/* The whole heading row is one disclosure button inside the heading, so the region keeps its name. */}\n <Heading level={level()} class=\"k2b-section__header\">\n <button\n ref={toggleButton}\n type=\"button\"\n class=\"k2b-section__toggle\"\n aria-expanded={open()}\n aria-controls={bodyId}\n disabled={local.disabled}\n // A native listener, not Solid's delegated `onClick`: delegation is registered once per document when\n // this module loads, so a section rendered into a later document (a test harness, an iframe) would\n // never toggle. The shared Button registers its delegation at render time and has no such gap.\n on:click={toggle}\n >\n {headingRow(\n <span id={titleId} class=\"k2b-section__title\">\n {local.title}\n </span>,\n <Show when={local.summary}>\n <span class=\"k2b-section__summary k2b-truncate-fade\">{local.summary}</span>\n </Show>,\n )}\n <span class=\"k2b-section__chevron\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </button>\n </Heading>\n </Show>\n <Show when={hasBody()}>\n <div ref={body} id={bodyId} class=\"k2b-section__body\" hidden={!open()}>\n <Show when={state() === \"loading\"}>\n {/* Placeholder rows at the height of loaded rows; their widths vary in CSS. */}\n <div role=\"status\">\n <span class=\"k2b-sr-only\">{ui().loading}</span>\n <For each={Array.from({ length: Math.max(1, local.loadingRows ?? 3) })}>\n {() => (\n <div class=\"k2b-section__skeleton-row\" aria-hidden=\"true\">\n <span />\n <span />\n </div>\n )}\n </For>\n </div>\n </Show>\n <Show when={state() === \"error\"}>\n <div class=\"k2b-section__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{local.errorMessage ?? ui().couldNotLoadData}</span>\n </div>\n <Show when={local.onRetry}>\n {(retry) => (\n <div class=\"k2b-section__footer\">\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => retry()()}>\n <i class=\"ti ti-refresh\" aria-hidden=\"true\" />\n {ui().retry}\n </Button>\n </div>\n )}\n </Show>\n </Show>\n {resolved()}\n <Show when={state() === \"ready\" && local.footer}>\n <div class=\"k2b-section__footer\">{local.footer}</div>\n </Show>\n </div>\n </Show>\n </section>\n );\n};\n\n/** A sub-topic inside a section, such as \"Contact\" or \"Address\": a small heading, no frame of its own. */\nconst SectionPart = (props: SectionPartProps): JSX.Element => {\n const level = useContext(SectionLevel);\n const id = `k2b-section-part-${createUniqueId()}`;\n return (\n <div class={props.class ? `k2b-section__part ${props.class}` : \"k2b-section__part\"} role=\"group\" aria-labelledby={id}>\n <Heading level={Math.min(level + 1, 6)} id={id} class=\"k2b-section__part-title\">\n {props.title}\n </Heading>\n {props.children}\n </div>\n );\n};\n\n/**\n * One topic, in a detail panel or on a page: an icon, a title with its count, at most one control, and its\n * content. On a page a section is a card with the light 1 px frame; inside another frame, and in a detail panel, it\n * stands flat, so cards never nest.\n */\nconst SectionWithLevel = (props: SectionProps): JSX.Element => (\n // The level is provided before the body is built, so a part's heading sits one level below this section's.\n <SectionLevel.Provider value={props.level ?? (props.size === \"md\" ? 2 : 3)}>\n <SectionRoot {...props} />\n </SectionLevel.Provider>\n);\n\nexport const Section = SectionWithLevel as SectionComponent;\nSection.Part = SectionPart;\n\nexport default Section;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC3I,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,sBAAsB,QAAQ,iCAAiC;;AAExE;;AAEA;;AAEA;;AA6EA,MAAM,YAAY,GAAG,aAAa,CAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA,OAAO,MAAM,mBAAmB,GAAG,aAAa,CAAe,MAAM,CAAC;AAEtE,MAAM,OAAO,GAAI,KAA2E,sBACzF,OAAO;EAAA,IAAC,SAAS;IAAA,OAAE,IAAI,KAAK,CAAC,KAAK,EAAE;EAAA;EAAA,IAAE,EAAE;IAAA,OAAE,KAAK,CAAC,EAAE;EAAA;EAAA;IAAA,OAAS,KAAK,CAAC,KAAK;EAAA;EAAA;IAAA,OACpE,KAAK,CAAC,QAAQ;EAAA;AAAA,EAElB;AAED,MAAM,WAAW,GAAI,KAAmB,IAAkB;EACxD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CACtC,OAAO,EACP,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,cAAc,EACd,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACN,cAAc,EACd,UAAU,CACX,CAAC;EACF,MAAM,EAAE,GAAG,aAAa,CAAC,CAAC;EAC1B,MAAM,M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":[]}
1
+ {"version":3,"names":[],"sources":["surfaces/Section.tsx"],"sourcesContent":["import { children, createContext, createEffect, createSignal, createUniqueId, For, type JSX, Show, splitProps, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useDetailPanelMessages } from \"../layout/detail-panel-messages\";\n\n/** Named after the status tokens; a tone colours the frame, the title, and the icon, never the fill. */\nexport type SectionTone = \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"ai\";\n/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */\nexport type SectionSize = \"sm\" | \"md\";\n/** `line` draws the light 1 px frame; inside another frame a section always stands flat. */\nexport type SectionFrame = \"line\" | \"none\";\nexport type SectionState = \"ready\" | \"loading\" | \"error\";\n\ntype SectionBaseProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"title\" | \"children\" | \"class\"> & {\n title: JSX.Element;\n icon?: string;\n size?: SectionSize;\n frame?: SectionFrame;\n tone?: SectionTone;\n /**\n * Marks a section that only some people see, such as \"Only with permission\": a lock and these words after the\n * title. It is part of the section's accessible name and combines with any tone.\n */\n restricted?: string;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n /** Commands for the whole topic, as a row of buttons at the end of the body. */\n footer?: JSX.Element;\n /** `loading` and `error` take the body's place; the heading stays where it is. */\n state?: SectionState;\n /** Says what did not load; defaults to a generic sentence. */\n errorMessage?: JSX.Element;\n /** Shows \"Try again\" in the error state. */\n onRetry?: () => void;\n /** Placeholder rows while loading, the number the loaded body usually shows. Defaults to 3. */\n loadingRows?: number;\n /** Heading level; defaults to 3, or 2 for `size=\"md\"`. */\n level?: 2 | 3;\n class?: string;\n};\n\nexport type SectionProps = SectionBaseProps &\n (\n | {\n children?: JSX.Element;\n /** Exactly one control at the end of the heading, such as \"+\" or one text button. */\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\nexport type SectionPartProps = {\n title: JSX.Element;\n children: JSX.Element;\n class?: string;\n};\n\ntype SectionComponent = ((props: SectionProps) => JSX.Element) & {\n Part: (props: SectionPartProps) => JSX.Element;\n};\n\nconst SectionLevel = createContext<number>(2);\n\n/**\n * The frame a section draws when it passes none. A host that frames its topics itself, such as a detail panel, sets\n * `none`; everywhere else a section is a card.\n */\nexport const SectionFrameDefault = createContext<SectionFrame>(\"line\");\n\nconst Heading = (props: { level: number; id?: string; class: string; children: JSX.Element }): JSX.Element => (\n <Dynamic component={`h${props.level}`} id={props.id} class={props.class}>\n {props.children}\n </Dynamic>\n);\n\nconst SectionRoot = (props: SectionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"title\",\n \"icon\",\n \"size\",\n \"frame\",\n \"tone\",\n \"restricted\",\n \"description\",\n \"count\",\n \"meta\",\n \"footer\",\n \"state\",\n \"errorMessage\",\n \"onRetry\",\n \"loadingRows\",\n \"level\",\n \"class\",\n \"children\",\n \"actions\",\n \"collapsible\",\n \"summary\",\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"disabled\",\n ]);\n const ui = useUiMessages();\n const counts = useDetailPanelMessages();\n const frameDefault = useContext(SectionFrameDefault);\n const id = `k2b-section-${createUniqueId()}`;\n const titleId = `${id}-title`;\n const restrictedId = `${id}-restricted`;\n const bodyId = `${id}-body`;\n const level = () => local.level ?? (local.size === \"md\" ? 2 : 3);\n const state = () => local.state ?? \"ready\";\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n const open = () => !local.collapsible || (local.open ?? internalOpen());\n let toggleButton: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n\n const toggle = () => {\n if (local.disabled) return;\n const next = !open();\n if (local.open === undefined) setInternalOpen(next);\n local.onOpenChange?.(next);\n };\n // A parent may close the section while focus is inside it; focus then returns to the toggle instead of the page.\n createEffect(() => {\n if (open()) return;\n queueMicrotask(() => {\n const active = body?.ownerDocument.activeElement;\n if (!open() && active && body?.contains(active)) toggleButton?.focus();\n });\n });\n\n // Resolve once and only while ready: reading `children` twice would build the body twice.\n const resolved = children(() => (state() === \"ready\" ? local.children : undefined));\n // A JSX action must also be built once: checking the slot and then reading it again creates different hydration keys.\n const resolvedActions = children(() => local.actions);\n const hasBody = () => local.collapsible || state() !== \"ready\" || Boolean(resolved.toArray().length) || Boolean(local.footer);\n\n /** Icon, then the title with its count, state, and restricted marker in one row, then the description. */\n const headingRow = (title: JSX.Element, summary?: JSX.Element) => (\n <>\n <Show when={local.icon}>\n {(name) => (\n <span class=\"k2b-section__icon\" aria-hidden=\"true\">\n <i class={name()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-section__copy\">\n <span class=\"k2b-section__heading\">\n {title}\n <Show when={local.count !== undefined}>\n <Show when={local.count! > 0} fallback={<span class=\"k2b-section__none\">{counts().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{local.count}</span>\n </Show>\n </Show>\n <Show when={local.meta}>\n <span class=\"k2b-section__meta\">{local.meta}</span>\n </Show>\n <Show when={local.restricted}>\n <span class=\"k2b-section__restricted\" id={restrictedId}>\n <i class=\"ti ti-lock\" aria-hidden=\"true\" />\n {local.restricted}\n </span>\n </Show>\n {summary}\n </span>\n <Show when={local.description}>\n <span class=\"k2b-section__description\">{local.description}</span>\n </Show>\n </span>\n </>\n );\n\n return (\n <section\n {...rest}\n class={local.class ? `k2b-section ${local.class}` : \"k2b-section\"}\n data-size={local.size ?? \"sm\"}\n data-frame={local.frame ?? frameDefault}\n data-tone={local.tone && local.tone !== \"neutral\" ? local.tone : undefined}\n data-icon={local.icon ? \"true\" : undefined}\n data-collapsible={local.collapsible ? \"true\" : undefined}\n data-open={local.collapsible ? String(open()) : undefined}\n data-summary={local.collapsible && local.summary ? \"true\" : undefined}\n aria-labelledby={local.restricted ? `${titleId} ${restrictedId}` : titleId}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show\n when={local.collapsible}\n fallback={\n <header class=\"k2b-section__header\">\n {headingRow(\n <Heading level={level()} id={titleId} class=\"k2b-section__title\">\n {local.title}\n </Heading>,\n )}\n <Show when={resolvedActions()}>\n <div class=\"k2b-section__actions\">{resolvedActions()}</div>\n </Show>\n </header>\n }\n >\n {/* The whole heading row is one disclosure button inside the heading, so the region keeps its name. */}\n <Heading level={level()} class=\"k2b-section__header\">\n <button\n ref={toggleButton}\n type=\"button\"\n class=\"k2b-section__toggle\"\n aria-expanded={open()}\n aria-controls={bodyId}\n disabled={local.disabled}\n // A native listener, not Solid's delegated `onClick`: delegation is registered once per document when\n // this module loads, so a section rendered into a later document (a test harness, an iframe) would\n // never toggle. The shared Button registers its delegation at render time and has no such gap.\n on:click={toggle}\n >\n {headingRow(\n <span id={titleId} class=\"k2b-section__title\">\n {local.title}\n </span>,\n <Show when={local.summary}>\n <span class=\"k2b-section__summary k2b-truncate-fade\">{local.summary}</span>\n </Show>,\n )}\n <span class=\"k2b-section__chevron\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </button>\n </Heading>\n </Show>\n <Show when={hasBody()}>\n <div ref={body} id={bodyId} class=\"k2b-section__body\" hidden={!open()}>\n <Show when={state() === \"loading\"}>\n {/* Placeholder rows at the height of loaded rows; their widths vary in CSS. */}\n <div role=\"status\">\n <span class=\"k2b-sr-only\">{ui().loading}</span>\n <For each={Array.from({ length: Math.max(1, local.loadingRows ?? 3) })}>\n {() => (\n <div class=\"k2b-section__skeleton-row\" aria-hidden=\"true\">\n <span />\n <span />\n </div>\n )}\n </For>\n </div>\n </Show>\n <Show when={state() === \"error\"}>\n <div class=\"k2b-section__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{local.errorMessage ?? ui().couldNotLoadData}</span>\n </div>\n <Show when={local.onRetry}>\n {(retry) => (\n <div class=\"k2b-section__footer\">\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => retry()()}>\n <i class=\"ti ti-refresh\" aria-hidden=\"true\" />\n {ui().retry}\n </Button>\n </div>\n )}\n </Show>\n </Show>\n {resolved()}\n <Show when={state() === \"ready\" && local.footer}>\n <div class=\"k2b-section__footer\">{local.footer}</div>\n </Show>\n </div>\n </Show>\n </section>\n );\n};\n\n/** A sub-topic inside a section, such as \"Contact\" or \"Address\": a small heading, no frame of its own. */\nconst SectionPart = (props: SectionPartProps): JSX.Element => {\n const level = useContext(SectionLevel);\n const id = `k2b-section-part-${createUniqueId()}`;\n return (\n <div class={props.class ? `k2b-section__part ${props.class}` : \"k2b-section__part\"} role=\"group\" aria-labelledby={id}>\n <Heading level={Math.min(level + 1, 6)} id={id} class=\"k2b-section__part-title\">\n {props.title}\n </Heading>\n {props.children}\n </div>\n );\n};\n\n/**\n * One topic, in a detail panel or on a page: an icon, a title with its count, at most one control, and its\n * content. On a page a section is a card with the light 1 px frame; inside another frame, and in a detail panel, it\n * stands flat, so cards never nest.\n */\nconst SectionWithLevel = (props: SectionProps): JSX.Element => (\n // The level is provided before the body is built, so a part's heading sits one level below this section's.\n <SectionLevel.Provider value={props.level ?? (props.size === \"md\" ? 2 : 3)}>\n <SectionRoot {...props} />\n </SectionLevel.Provider>\n);\n\nexport const Section = SectionWithLevel as SectionComponent;\nSection.Part = SectionPart;\n\nexport default Section;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC3I,SAAS,OAAO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AAM,WAAW,GAAI,KAAuB,IAAkB;EAC5D,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC;EACtC,MAAM,EAAE,GAAG,oBAAoB,cAAc,CAAC,CAAC,EAAE;EACjD,+CACc,KAAK,CAAC,KAAK,GAAG,8BAAqB,KAAK,CAAC,KAAK,SAAE,GAAG,mBAAmB,qDAAgC,EAAE,4CACjH,OAAO;IAAA,IAAC,KAAK;MAAA,OAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;IAAA;IAAE,EAAE,EAAE,EAAE;IAAA;IAAA;MAAA,OAC3C,KAAK,CAAC,KAAK;IAAA;EAAA,cAEb,KAAK,CAAC,QAAQ;AAGrB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAI,KAAmB,IAC3C;AAAA,kBACC,YAAY,CAAC,QAAQ;EAAA,IAAC,KAAK;IAAA,OAAE,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;EAAA;EAAA;IAAA,yBACvE,WAAW,EAAK,KAAK;EAAA;AAAA,EAEzB;AAED,OAAO,MAAM,OAAO,GAAG,gBAAoC;AAC3D,OAAO,CAAC,IAAI,GAAG,WAAW;AAE1B,eAAe,OAAO","ignoreList":[]}
@@ -9,9 +9,6 @@ var _tmpl$ = ["<span class=\"k2b-status-badge__label\" data-reserve><span>", "</
9
9
  _tmpl$5 = ["<span class=\"k2b-status-badge__label\">", "</span>"],
10
10
  _tmpl$6 = ["<span aria-hidden=\"true\">", "</span>"];
11
11
  import { For, Show } from "solid-js";
12
-
13
- /** `yours` is "your turn": the blue tint of an action that waits for the reader; amber `warning` is "to clarify". */
14
-
15
12
  const DEFAULT_ICONS = {
16
13
  info: "ti ti-info-circle",
17
14
  ok: "ti ti-check",
@@ -19,8 +16,7 @@ const DEFAULT_ICONS = {
19
16
  error: "ti ti-alert-circle",
20
17
  degraded: "ti ti-plug-connected-x",
21
18
  running: "ti ti-loader-2",
22
- neutral: "ti ti-alert-square-rounded",
23
- yours: "ti ti-arrow-right"
19
+ neutral: "ti ti-alert-square-rounded"
24
20
  };
25
21
  export function StatusBadge(props) {
26
22
  const variant = () => props.variant ?? "chip";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["surfaces/StatusBadge.tsx"],"sourcesContent":["import { For, type JSX, Show } from \"solid-js\";\n\n/** `yours` is \"your turn\": the blue tint of an action that waits for the reader; amber `warning` is \"to clarify\". */\nexport type StatusTone = \"info\" | \"ok\" | \"warning\" | \"error\" | \"degraded\" | \"running\" | \"neutral\" | \"yours\";\n\nexport type StatusBadgeProps = {\n tone: StatusTone;\n label: JSX.Element;\n icon?: string | null;\n variant?: \"chip\" | \"dot\" | \"text\";\n /**\n * Every label this place can show, such as all states of a list's status. The badge keeps the width of the longest,\n * so in a right-aligned slot its dot starts at one x in every row and stays put when the state changes.\n */\n labels?: readonly string[];\n title?: string;\n class?: string;\n};\n\nconst DEFAULT_ICONS: Record<StatusTone, string> = {\n info: \"ti ti-info-circle\",\n ok: \"ti ti-check\",\n warning: \"ti ti-alert-triangle\",\n error: \"ti ti-alert-circle\",\n degraded: \"ti ti-plug-connected-x\",\n running: \"ti ti-loader-2\",\n neutral: \"ti ti-alert-square-rounded\",\n yours: \"ti ti-arrow-right\",\n};\n\nexport function StatusBadge(props: StatusBadgeProps): JSX.Element {\n const variant = () => props.variant ?? \"chip\";\n const icon = () => (props.icon === null ? undefined : (props.icon ?? DEFAULT_ICONS[props.tone]));\n return (\n <span class={`k2b-status-badge ${props.class ?? \"\"}`} data-tone={props.tone} data-variant={variant()} title={props.title}>\n <Show when={variant() !== \"dot\"} fallback={<span class=\"k2b-status-badge__dot\" aria-hidden=\"true\" />}>\n <Show when={icon()}>{(glyph) => <i class={glyph()} aria-hidden=\"true\" />}</Show>\n </Show>\n <Show when={props.labels?.length} fallback={<span class=\"k2b-status-badge__label\">{props.label}</span>}>\n <span class=\"k2b-status-badge__label\" data-reserve=\"\">\n <span>{props.label}</span>\n <For each={props.labels}>{(label) => <span aria-hidden=\"true\">{label}</span>}</For>\n </span>\n </Show>\n </span>\n );\n}\n\nexport default StatusBadge;\n"],"mappings":";;;;;;;;;;AAAA,SAAS,GAAG,EAAY,IAAI,QAAQ,UAAU;;AAE9C;;AAiBA,MAAM,aAAyC,GAAG;EAChD,IAAI,EAAE,mBAAmB;EACzB,EAAE,EAAE,aAAa;EACjB,OAAO,EAAE,sBAAsB;EAC/B,KAAK,EAAE,oBAAoB;EAC3B,QAAQ,EAAE,wBAAwB;EAClC,OAAO,EAAE,gBAAgB;EACzB,OAAO,EAAE,4BAA4B;EACrC,KAAK,EAAE;AACT,CAAC;AAED,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAe;EAChE,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,IAAI,MAAM;EAC7C,MAAM,IAAI,GAAG,MAAO,KAAK,CAAC,IAAI,KAAK,IAAI,GAAG,SAAS,GAAI,KAAK,CAAC,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAG;EAChG,sBACe,6BAAoB,KAAK,CAAC,KAAK,IAAI,EAAE,SAAE,uCAAa,KAAK,CAAC,IAAI,0DAAgB,OAAO,CAAC,CAAC,mDAAS,KAAK,CAAC,KAAK,4CACrH,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,OAAO,CAAC,CAAC,KAAK,KAAK;IAAA;IAAA,IAAE,QAAQ;MAAA;IAAA;IAAA;MAAA,yBACtC,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,IAAI,CAAC,CAAC;QAAA;QAAA,UAAI,KAAK,oDAAe,KAAK,CAAC,CAAC;MAAuB;IAAA;EAAA,gCAEzE,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,MAAM,EAAE,MAAM;IAAA;IAAA,IAAE,QAAQ;MAAA,+BAAyC,KAAK,CAAC,KAAK;IAAA;IAAA;MAAA,8BAEnF,KAAK,CAAC,KAAK,8BACjB,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,MAAM;QAAA;QAAA,UAAI,KAAK,4BAA+B,KAAK;MAAQ;IAAA;EAAA;AAKtF;AAEA,eAAe,WAAW","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["surfaces/StatusBadge.tsx"],"sourcesContent":["import { For, type JSX, Show } from \"solid-js\";\n\nexport type StatusTone = \"info\" | \"ok\" | \"warning\" | \"error\" | \"degraded\" | \"running\" | \"neutral\";\n\nexport type StatusBadgeProps = {\n tone: StatusTone;\n label: JSX.Element;\n icon?: string | null;\n variant?: \"chip\" | \"dot\" | \"text\";\n /**\n * Every label this place can show, such as all states of a list's status. The badge keeps the width of the longest,\n * so in a right-aligned slot its dot starts at one x in every row and stays put when the state changes.\n */\n labels?: readonly string[];\n title?: string;\n class?: string;\n};\n\nconst DEFAULT_ICONS: Record<StatusTone, string> = {\n info: \"ti ti-info-circle\",\n ok: \"ti ti-check\",\n warning: \"ti ti-alert-triangle\",\n error: \"ti ti-alert-circle\",\n degraded: \"ti ti-plug-connected-x\",\n running: \"ti ti-loader-2\",\n neutral: \"ti ti-alert-square-rounded\",\n};\n\nexport function StatusBadge(props: StatusBadgeProps): JSX.Element {\n const variant = () => props.variant ?? \"chip\";\n const icon = () => (props.icon === null ? undefined : (props.icon ?? DEFAULT_ICONS[props.tone]));\n return (\n <span class={`k2b-status-badge ${props.class ?? \"\"}`} data-tone={props.tone} data-variant={variant()} title={props.title}>\n <Show when={variant() !== \"dot\"} fallback={<span class=\"k2b-status-badge__dot\" aria-hidden=\"true\" />}>\n <Show when={icon()}>{(glyph) => <i class={glyph()} aria-hidden=\"true\" />}</Show>\n </Show>\n <Show when={props.labels?.length} fallback={<span class=\"k2b-status-badge__label\">{props.label}</span>}>\n <span class=\"k2b-status-badge__label\" data-reserve=\"\">\n <span>{props.label}</span>\n <For each={props.labels}>{(label) => <span aria-hidden=\"true\">{label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