@kerfjs/ui 5.0.0-beta.54 → 5.0.0-beta.55

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 (109) hide show
  1. package/README.md +3 -2
  2. package/ai/component-catalog-v2.json +58 -1
  3. package/ai/component-catalog.json +105 -8
  4. package/ai/public-api-signatures-v1.md +265 -28
  5. package/ai/skill.md +6 -4
  6. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  7. package/dist/browser/popup-menu.js +3 -0
  8. package/dist/catalog-resources.d.ts +1 -1
  9. package/dist/catalog.d.ts +10 -4
  10. package/dist/catalog.js +243 -300
  11. package/dist/catalog.js.map +1 -1
  12. package/dist/{chunk-7IUSV4XG.js → chunk-24PHKUR3.js} +2 -2
  13. package/dist/chunk-24PHKUR3.js.map +1 -0
  14. package/dist/chunk-4BIMLITI.js +92 -0
  15. package/dist/chunk-4BIMLITI.js.map +1 -0
  16. package/dist/{chunk-ZK5EGVFP.js → chunk-5OLVUEND.js} +12 -2
  17. package/dist/chunk-5OLVUEND.js.map +1 -0
  18. package/dist/{chunk-CMUIXJZM.js → chunk-BSKEH3UC.js} +2 -2
  19. package/dist/{chunk-CMUIXJZM.js.map → chunk-BSKEH3UC.js.map} +1 -1
  20. package/dist/chunk-EAX2GSS4.js +384 -0
  21. package/dist/chunk-EAX2GSS4.js.map +1 -0
  22. package/dist/chunk-KH6VUGHU.js +399 -0
  23. package/dist/chunk-KH6VUGHU.js.map +1 -0
  24. package/dist/{chunk-BJJKFVWW.js → chunk-LZXQVUGN.js} +2 -2
  25. package/dist/chunk-LZXQVUGN.js.map +1 -0
  26. package/dist/chunk-N7FHFNT6.js +55 -0
  27. package/dist/chunk-N7FHFNT6.js.map +1 -0
  28. package/dist/{chunk-KPNTVB7A.js → chunk-R754MHXX.js} +3 -3
  29. package/dist/{chunk-KPNTVB7A.js.map → chunk-R754MHXX.js.map} +1 -1
  30. package/dist/{chunk-HJKRCKDR.js → chunk-RNRUVPJ3.js} +4 -2
  31. package/dist/chunk-RNRUVPJ3.js.map +1 -0
  32. package/dist/collapsible-panel.d.ts +40 -13
  33. package/dist/collapsible-panel.js +41 -10
  34. package/dist/collapsible-panel.js.map +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +17 -16
  37. package/dist/list-header.js +1 -1
  38. package/dist/list-inset-text.d.ts +7 -1
  39. package/dist/list-inset-text.js +2 -1
  40. package/dist/panel-toolbar-BFQxFITu.d.ts +52 -0
  41. package/dist/popup-menu-register.d.ts +9 -0
  42. package/dist/popup-menu-register.js +30 -0
  43. package/dist/popup-menu-register.js.map +1 -0
  44. package/dist/popup-menu.d.ts +71 -0
  45. package/dist/popup-menu.js +3 -0
  46. package/dist/popup-menu.js.map +1 -0
  47. package/dist/state-banner.js +1 -1
  48. package/dist/styles/catalog/components/catalog-example.css +0 -16
  49. package/dist/styles/catalog/components/catalog-stage.css +8 -13
  50. package/dist/styles/catalog/components/catalog.css +8 -18
  51. package/dist/styles/catalog.css +0 -5
  52. package/dist/styles/popup-menu.css +12 -0
  53. package/dist/styles/state-banner.css +13 -4
  54. package/dist/styles/styles.css +1 -0
  55. package/dist/styles/tab-bar.css +31 -3
  56. package/dist/styles/toolbar-control-group.css +13 -0
  57. package/dist/styles/toolbar.css +43 -2
  58. package/dist/styles/workbench.css +31 -0
  59. package/dist/text.js +1 -1
  60. package/dist/token-search-field.d.ts +10 -1
  61. package/dist/token-search-field.js +1 -1
  62. package/dist/{types-CEsieBZi.d.ts → types-D6vzj-VT.d.ts} +15 -0
  63. package/dist/wire-catalog.d.ts +13 -1
  64. package/dist/wire-catalog.js +18 -3
  65. package/dist/wire-catalog.js.map +1 -1
  66. package/dist/wire-sidebar.js +6 -3
  67. package/dist/wire-sidebar.js.map +1 -1
  68. package/dist/wire-token-search-fields.js +1 -1
  69. package/dist/wire-workbench.js +1 -350
  70. package/dist/wire-workbench.js.map +1 -1
  71. package/dist/workbench.d.ts +107 -6
  72. package/dist/workbench.js +11 -208
  73. package/dist/workbench.js.map +1 -1
  74. package/docs/accessibility.md +12 -1
  75. package/docs/catalog.md +27 -9
  76. package/docs/collapsible-panel.md +55 -0
  77. package/docs/component-contract.md +2 -2
  78. package/docs/component-selection.md +25 -17
  79. package/docs/design/templates/state-banner/danger-dark.svg +1 -1
  80. package/docs/design/templates/state-banner/danger.svg +1 -1
  81. package/docs/design/templates/state-banner/info-dark.svg +1 -1
  82. package/docs/design/templates/state-banner/info.svg +1 -1
  83. package/docs/design/templates/state-banner/success-dark.svg +1 -1
  84. package/docs/design/templates/state-banner/success.svg +1 -1
  85. package/docs/design/templates/state-banner/warning-dark.svg +1 -1
  86. package/docs/design/templates/state-banner/warning.svg +1 -1
  87. package/docs/design/templates/state-banner-dark.svg +1 -1
  88. package/docs/design/templates/state-banner.svg +1 -1
  89. package/docs/layout.md +5 -0
  90. package/docs/recipes.md +44 -37
  91. package/docs/surface-scaffold.md +1 -1
  92. package/docs/ux-demo.md +6 -2
  93. package/docs/workbench.md +92 -7
  94. package/llms.txt +6 -5
  95. package/package.json +13 -2
  96. package/ux-demo/recipes/app-shell.tsx +141 -223
  97. package/ux-demo/recipes/collapsible-sidebar.tsx +44 -75
  98. package/ux-demo/recipes/list-detail-dialog.tsx +150 -54
  99. package/ux-demo/recipes/mount-recipe.ts +0 -5
  100. package/ux-demo/recipes/types.ts +0 -1
  101. package/dist/chunk-7IUSV4XG.js.map +0 -1
  102. package/dist/chunk-BJJKFVWW.js.map +0 -1
  103. package/dist/chunk-HJKRCKDR.js.map +0 -1
  104. package/dist/chunk-ZK5EGVFP.js.map +0 -1
  105. package/dist/styles/catalog/components/catalog-detail.css +0 -35
  106. package/dist/styles/catalog/components/catalog-resource-footer.css +0 -37
  107. package/dist/styles/catalog/components/catalog-secondary-sections.css +0 -38
  108. package/dist/styles/catalog/components/catalog-section-list.css +0 -22
  109. package/dist/styles/catalog/components/catalog-sidebar.css +0 -82
package/dist/catalog.d.ts CHANGED
@@ -1,11 +1,17 @@
1
1
  import * as kerfjs from 'kerfjs';
2
2
  import { SafeHtml } from 'kerfjs';
3
- import { a as CatalogProps } from './types-CEsieBZi.js';
4
- export { b as CatalogBrand, c as CatalogEntry, d as CatalogRelated, C as CatalogResource, e as CatalogSecondaryGroup, f as CatalogSection, g as CatalogStageRootAttributes } from './types-CEsieBZi.js';
3
+ import { a as CatalogProps } from './types-D6vzj-VT.js';
4
+ export { b as CatalogBrand, c as CatalogEntry, d as CatalogRelated, C as CatalogResource, e as CatalogSecondaryGroup, f as CatalogSection, g as CatalogStageRootAttributes } from './types-D6vzj-VT.js';
5
5
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
6
6
 
7
- /** Controlled, stateless component-catalog shell. */
8
- declare function Catalog({ brand, sections, active, content, collapsed, theme, headerActions, secondarySections, sidebarFooter, status, geometryOverlay, stageRootAttributes, selectAction, toggleSidebarAction, toggleThemeAction, toggleSecondaryAction, className, slot, }: CatalogProps): kerfjs.SafeHtml;
7
+ /**
8
+ * Controlled, stateless component-catalog shell: a `Workbench` whose left rail
9
+ * is the catalog navigation and whose work area is the active entry — its
10
+ * toolbar, description, preview stage, and resource footer. The sidebar's
11
+ * standard toggle moves into the entry toolbar while it is collapsed, and on
12
+ * a small screen the sidebar overlays the stage like any Workbench rail.
13
+ */
14
+ declare function Catalog({ id, brand, sections, active, content, collapsed, theme, headerActions, secondarySections, sidebarFooter, status, geometryOverlay, stageRootAttributes, selectAction, toggleSidebarAction, toggleThemeAction, toggleSecondaryAction, headerPlacement, footerPlacement, className, slot, }: CatalogProps): kerfjs.SafeHtml;
9
15
 
10
16
  /** How a specimen aligns its visible edge with its `ListHeader` label. */
11
17
  type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';
package/dist/catalog.js CHANGED
@@ -1,49 +1,67 @@
1
- import { ToolbarControlGroup, ToolbarActionLink } from './chunk-ZIYOJFZD.js';
2
- import { Toolbar } from './chunk-MTM43SJO.js';
1
+ import { Workbench } from './chunk-EAX2GSS4.js';
2
+
3
+ import { Row } from './chunk-5I22LMCV.js';
4
+
3
5
  import { ListItem } from './chunk-GUIHMIT2.js';
4
6
  import { List } from './chunk-3NBL3OUQ.js';
7
+
5
8
  import { ToolbarText } from './chunk-TZ5IHWB2.js';
6
- import { Pane } from './chunk-7GUQYHKA.js';
9
+ import { PopupMenu } from './chunk-4BIMLITI.js';
7
10
 
8
11
 
9
- import { ListHeader } from './chunk-KPNTVB7A.js';
12
+ import { ListHeader } from './chunk-R754MHXX.js';
13
+ import { Text } from './chunk-24PHKUR3.js';
14
+ import { ListInsetText } from './chunk-5OLVUEND.js';
10
15
 
11
16
 
12
- import { filterDataAttributes } from './chunk-SRSJO5QE.js';
13
17
 
18
+ import { Toolbar } from './chunk-MTM43SJO.js';
19
+ import { ToolbarControlGroup, ToolbarActionLink } from './chunk-ZIYOJFZD.js';
20
+
21
+ import { filterDataAttributes } from './chunk-SRSJO5QE.js';
14
22
 
15
23
 
16
24
  import { LucideIcon } from './chunk-4R777DUZ.js';
17
- import { PanelLeftClose, Moon, Sun, PanelLeftOpen, Waypoints, ExternalLink } from 'lucide';
18
- import { jsxs, jsx, Fragment } from 'kerfjs/jsx-runtime';
25
+ import { Moon, Sun, Waypoints, ExternalLink } from 'lucide';
26
+ import { jsx, jsxs, Fragment } from 'kerfjs/jsx-runtime';
19
27
 
20
28
  function relatedMenuItems(related, selectAction) {
21
29
  const groups = [];
22
30
  for (const entry of related)
23
31
  if (!groups.includes(entry.group)) groups.push(entry.group);
24
- const nodes = [];
32
+ const items = [];
25
33
  groups.forEach((group, index) => {
26
- if (index > 0) nodes.push(/* @__PURE__ */ jsx("wa-divider", {}));
27
- nodes.push(/* @__PURE__ */ jsx("small", { class: "kui-catalog__related-heading", children: group }));
28
- for (const entry of related) {
34
+ if (index > 0) items.push({ kind: "divider" });
35
+ items.push({ kind: "heading", label: group });
36
+ for (const entry of related)
29
37
  if (entry.group === group)
30
- nodes.push(
31
- /* @__PURE__ */ jsx("wa-dropdown-item", { "data-action": selectAction, "data-item-id": entry.id, children: entry.name })
32
- );
33
- }
38
+ items.push({
39
+ label: entry.name,
40
+ action: selectAction,
41
+ attributes: { "data-item-id": entry.id }
42
+ });
34
43
  });
35
- return nodes;
44
+ return items;
36
45
  }
37
46
  function CatalogResourceFooter({
38
47
  name,
39
- active,
40
48
  resources,
41
49
  related,
42
50
  status,
43
51
  selectAction
44
52
  }) {
45
- return /* @__PURE__ */ jsxs("div", { class: "kui-catalog__footer", children: [
46
- status ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__status", children: status }) : null,
53
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
54
+ status ? /* @__PURE__ */ jsx(
55
+ Row,
56
+ {
57
+ hAlign: "space-between",
58
+ vAlign: "baseline",
59
+ gap: "xs",
60
+ wrap: true,
61
+ textInsets: "trl",
62
+ children: status
63
+ }
64
+ ) : null,
47
65
  /* @__PURE__ */ jsx(
48
66
  Toolbar,
49
67
  {
@@ -80,20 +98,14 @@ function CatalogResourceFooter({
80
98
  menuInset: "compact",
81
99
  size: "compact",
82
100
  label: "Related entries",
83
- children: /* @__PURE__ */ jsxs(
84
- "wa-dropdown",
101
+ children: /* @__PURE__ */ jsx(
102
+ PopupMenu,
85
103
  {
104
+ text: "Components",
105
+ icon: /* @__PURE__ */ jsx(LucideIcon, { icon: Waypoints, name: "waypoints" }),
86
106
  placement: "top-end",
87
- "data-key": `kui-catalog-related-${active}`,
88
- "data-catalog-related": true,
89
- "data-morph-skip-children": true,
90
- children: [
91
- /* @__PURE__ */ jsxs("wa-button", { slot: "trigger", appearance: "plain", "with-caret": true, children: [
92
- /* @__PURE__ */ jsx(LucideIcon, { icon: Waypoints, name: "waypoints" }),
93
- /* @__PURE__ */ jsx("span", { children: "Components" })
94
- ] }),
95
- relatedMenuItems(related, selectAction)
96
- ]
107
+ items: relatedMenuItems(related, selectAction),
108
+ rootAttributes: { "data-catalog-related": "" }
97
109
  }
98
110
  )
99
111
  }
@@ -102,6 +114,99 @@ function CatalogResourceFooter({
102
114
  )
103
115
  ] });
104
116
  }
117
+ function CatalogSectionEntries({
118
+ section,
119
+ active,
120
+ selectAction
121
+ }) {
122
+ return /* @__PURE__ */ jsxs(List, { rootAttributes: { "data-catalog-section": section.category }, children: [
123
+ /* @__PURE__ */ jsx(ListHeader, { label: section.category }),
124
+ /* @__PURE__ */ jsx(List, { gap: "2xs", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
125
+ ListItem,
126
+ {
127
+ action: selectAction,
128
+ itemId: entry.id,
129
+ label: entry.name,
130
+ status: entry.tags?.join(" \xB7 "),
131
+ selected: active === entry.id,
132
+ title: entry.description,
133
+ multiline: true
134
+ }
135
+ )) })
136
+ ] });
137
+ }
138
+ function CatalogSecondarySections({
139
+ group,
140
+ active,
141
+ selectAction,
142
+ toggleAction
143
+ }) {
144
+ const open = !group.collapsible || Boolean(group.expanded);
145
+ return /* @__PURE__ */ jsxs(List, { dividerSides: "t", controlInsets: "t", children: [
146
+ group.collapsible ? /* @__PURE__ */ jsx(
147
+ ListHeader,
148
+ {
149
+ label: group.label,
150
+ toggle: true,
151
+ expanded: open,
152
+ action: toggleAction
153
+ }
154
+ ) : /* @__PURE__ */ jsx(ListHeader, { label: group.label }),
155
+ open ? /* @__PURE__ */ jsx(List, { gap: "m", rootAttributes: { "data-catalog-secondary": "" }, children: group.sections.map((section) => /* @__PURE__ */ jsx(
156
+ CatalogSectionEntries,
157
+ {
158
+ section,
159
+ active,
160
+ selectAction
161
+ }
162
+ )) }) : null
163
+ ] });
164
+ }
165
+ function CatalogSectionList({
166
+ sections,
167
+ active,
168
+ selectAction
169
+ }) {
170
+ return /* @__PURE__ */ jsx(Fragment, { children: sections.map((section) => /* @__PURE__ */ jsx(
171
+ CatalogSectionEntries,
172
+ {
173
+ section,
174
+ active,
175
+ selectAction
176
+ }
177
+ )) });
178
+ }
179
+ function CatalogSidebar({
180
+ brand,
181
+ sections,
182
+ active,
183
+ secondarySections,
184
+ footer,
185
+ selectAction,
186
+ toggleSecondaryAction
187
+ }) {
188
+ return /* @__PURE__ */ jsx("nav", { "aria-label": `${brand.title} components`, children: /* @__PURE__ */ jsxs(List, { gap: "m", controlInsets: "b", children: [
189
+ brand.subtitle ? /* @__PURE__ */ jsx(ListInsetText, { sides: "rl", children: /* @__PURE__ */ jsx(Text, { variant: "span", size: "compact", tone: "quiet", children: brand.subtitle }) }) : null,
190
+ /* @__PURE__ */ jsx(
191
+ CatalogSectionList,
192
+ {
193
+ sections,
194
+ active,
195
+ selectAction
196
+ }
197
+ ),
198
+ secondarySections ? /* @__PURE__ */ jsx(
199
+ CatalogSecondarySections,
200
+ {
201
+ group: secondarySections,
202
+ active,
203
+ selectAction,
204
+ toggleAction: toggleSecondaryAction
205
+ }
206
+ ) : null,
207
+ footer
208
+ ] }) });
209
+ }
105
210
  var protectedAttributes = /* @__PURE__ */ new Set(["data-catalog-stage"]);
106
211
  function CatalogStage({
107
212
  name,
@@ -135,51 +240,82 @@ function CatalogStage({
135
240
  }
136
241
  );
137
242
  }
138
- function CatalogDetail({
139
- brandTitle,
243
+ function findEntry(sections, id) {
244
+ for (const section of sections) {
245
+ for (const entry of section.entries) if (entry.id === id) return entry;
246
+ }
247
+ return void 0;
248
+ }
249
+ function Catalog({
250
+ id = "kui-catalog",
251
+ brand,
252
+ sections,
140
253
  active,
141
- selected,
142
254
  content,
143
- collapsed,
255
+ collapsed = false,
144
256
  theme,
145
257
  headerActions,
258
+ secondarySections,
259
+ sidebarFooter,
146
260
  status,
147
261
  geometryOverlay,
148
262
  stageRootAttributes,
149
- selectAction,
150
- toggleSidebarAction,
151
- toggleThemeAction
263
+ selectAction = "catalog-select",
264
+ toggleSidebarAction = "catalog-toggle-sidebar",
265
+ toggleThemeAction = "catalog-toggle-theme",
266
+ toggleSecondaryAction = "catalog-toggle-secondary",
267
+ headerPlacement = "fixed",
268
+ footerPlacement = "fixed",
269
+ className = "",
270
+ slot
152
271
  }) {
272
+ const selected = findEntry(sections, active) ?? (secondarySections ? findEntry(secondarySections.sections, active) : void 0);
153
273
  const name = selected?.name ?? "";
154
274
  const nextTheme = theme === "dark" ? "light" : "dark";
155
- return /* @__PURE__ */ jsx("article", { class: "kui-catalog__detail", children: /* @__PURE__ */ jsx(
156
- Pane,
275
+ const catalogName = `${brand.title} catalog`;
276
+ return /* @__PURE__ */ jsx(
277
+ "main",
157
278
  {
158
- contentClassName: "kui-catalog__detail-preview",
159
- header: /* @__PURE__ */ jsxs("div", { class: "kui-catalog__header", children: [
160
- /* @__PURE__ */ jsx(
161
- Toolbar,
162
- {
279
+ class: `kui-catalog ${className}`.trim(),
280
+ "data-component": "catalog",
281
+ "data-sidebar-collapsed": String(collapsed),
282
+ "data-geometry-overlay": geometryOverlay === void 0 ? void 0 : String(geometryOverlay),
283
+ slot,
284
+ children: /* @__PURE__ */ jsx(
285
+ Workbench,
286
+ {
287
+ id,
288
+ label: catalogName,
289
+ leftRail: {
290
+ label: catalogName,
291
+ size: 288,
292
+ collapsed,
293
+ toolbar: {
294
+ label: `${catalogName} header`,
295
+ title: /* @__PURE__ */ jsxs(Fragment, { children: [
296
+ brand.logoUrl ? /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx("img", { class: "kui-catalog__mark", src: brand.logoUrl, alt: "" }) }) : null,
297
+ /* @__PURE__ */ jsx(ToolbarText, { text: brand.title, size: "large", headingLevel: 1 })
298
+ ] }),
299
+ toggle: { action: toggleSidebarAction, name: catalogName }
300
+ },
301
+ content: /* @__PURE__ */ jsx(
302
+ CatalogSidebar,
303
+ {
304
+ brand,
305
+ sections,
306
+ active,
307
+ secondarySections,
308
+ footer: sidebarFooter,
309
+ selectAction,
310
+ toggleSecondaryAction
311
+ }
312
+ )
313
+ },
314
+ mainToolbar: {
163
315
  label: `${name} header`,
164
- dividerSides: "",
165
- leading: /* @__PURE__ */ jsxs(Fragment, { children: [
166
- collapsed ? /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
167
- "button",
168
- {
169
- type: "button",
170
- "data-action": toggleSidebarAction,
171
- "aria-label": `Expand ${brandTitle} catalog`,
172
- children: /* @__PURE__ */ jsx(
173
- LucideIcon,
174
- {
175
- icon: PanelLeftOpen,
176
- name: "panel-left-open"
177
- }
178
- )
179
- }
180
- ) }) : null,
181
- /* @__PURE__ */ jsx(ToolbarText, { text: name, size: "xlarge", headingLevel: 2 })
182
- ] }),
316
+ // The entry title stays whole; actions wrap below it when narrow.
317
+ responsive: "wrap",
318
+ title: /* @__PURE__ */ jsx(ToolbarText, { text: name, size: "xlarge", headingLevel: 2 }),
183
319
  trailing: /* @__PURE__ */ jsxs(Fragment, { children: [
184
320
  headerActions,
185
321
  theme ? /* @__PURE__ */ jsx(
@@ -205,248 +341,47 @@ function CatalogDetail({
205
341
  }
206
342
  ) : null
207
343
  ] })
208
- }
209
- ),
210
- selected?.description ? /* @__PURE__ */ jsx("p", { class: "kui-catalog__description kui-content-item", children: selected.description }) : null
211
- ] }),
212
- footer: /* @__PURE__ */ jsx(
213
- CatalogResourceFooter,
214
- {
215
- name,
216
- active,
217
- resources: selected?.resources ?? [],
218
- related: selected?.related ?? [],
219
- status,
220
- selectAction
221
- }
222
- ),
223
- children: /* @__PURE__ */ jsx(
224
- CatalogStage,
225
- {
226
- name,
227
- content,
228
- geometryOverlay,
229
- rootAttributes: stageRootAttributes
230
- }
231
- )
232
- }
233
- ) });
234
- }
235
- function CatalogSecondarySections({
236
- group,
237
- active,
238
- selectAction,
239
- toggleAction
240
- }) {
241
- return /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group--secondary", children: [
242
- group.collapsible ? /* @__PURE__ */ jsx(
243
- ListHeader,
244
- {
245
- label: group.label,
246
- toggle: true,
247
- expanded: Boolean(group.expanded),
248
- action: toggleAction
249
- }
250
- ) : /* @__PURE__ */ jsx(ListHeader, { label: group.label }),
251
- !group.collapsible || group.expanded ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__secondary", "data-catalog-secondary": true, children: group.sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__secondary-group", children: [
252
- /* @__PURE__ */ jsx("h3", { class: "kui-catalog__secondary-heading", children: section.category }),
253
- /* @__PURE__ */ jsx("div", { class: "kui-catalog__secondary-items", children: /* @__PURE__ */ jsx(List, { gap: "2xs", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
254
- ListItem,
255
- {
256
- action: selectAction,
257
- itemId: entry.id,
258
- label: entry.name,
259
- status: entry.tags?.join(" \xB7 "),
260
- selected: active === entry.id,
261
- title: entry.description,
262
- multiline: true
263
- }
264
- )) }) })
265
- ] })) }) : null
266
- ] });
267
- }
268
- function CatalogSectionList({
269
- sections,
270
- active,
271
- selectAction
272
- }) {
273
- return /* @__PURE__ */ jsx("div", { class: "kui-catalog__sections", children: sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group", children: [
274
- /* @__PURE__ */ jsx(ListHeader, { label: section.category }),
275
- /* @__PURE__ */ jsx("div", { class: "kui-catalog__items", children: /* @__PURE__ */ jsx(List, { gap: "2xs", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
276
- ListItem,
277
- {
278
- action: selectAction,
279
- itemId: entry.id,
280
- label: entry.name,
281
- status: entry.tags?.join(" \xB7 "),
282
- selected: active === entry.id,
283
- title: entry.description,
284
- multiline: true
285
- }
286
- )) }) })
287
- ] })) });
288
- }
289
- function CatalogSidebar({
290
- brand,
291
- sections,
292
- active,
293
- collapsed,
294
- secondarySections,
295
- footer,
296
- selectAction,
297
- toggleSidebarAction,
298
- toggleSecondaryAction
299
- }) {
300
- return /* @__PURE__ */ jsx(
301
- "aside",
302
- {
303
- class: "kui-catalog__sidebar",
304
- "aria-label": `${brand.title} catalog`,
305
- "data-collapsed": String(collapsed),
306
- children: /* @__PURE__ */ jsx(
307
- Pane,
308
- {
309
- header: /* @__PURE__ */ jsxs("div", { class: "kui-catalog__brand", children: [
310
- /* @__PURE__ */ jsx(
311
- Toolbar,
312
- {
313
- label: `${brand.title} catalog header`,
314
- dividerSides: "",
315
- leading: /* @__PURE__ */ jsxs(Fragment, { children: [
316
- brand.logoUrl ? /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
317
- "img",
318
- {
319
- class: "kui-catalog__mark",
320
- src: brand.logoUrl,
321
- alt: ""
322
- }
323
- ) }) : null,
324
- /* @__PURE__ */ jsx(
325
- ToolbarText,
326
- {
327
- text: brand.title,
328
- size: "large",
329
- headingLevel: 1
330
- }
331
- )
332
- ] }),
333
- trailing: /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
334
- "button",
335
- {
336
- type: "button",
337
- "data-action": toggleSidebarAction,
338
- "aria-label": `Collapse ${brand.title} catalog`,
339
- children: /* @__PURE__ */ jsx(LucideIcon, { icon: PanelLeftClose, name: "panel-left-close" })
340
- }
341
- ) })
342
- }
343
- ),
344
- brand.subtitle ? /* @__PURE__ */ jsx("p", { class: "kui-catalog__subtitle", children: brand.subtitle }) : null
345
- ] }),
346
- children: /* @__PURE__ */ jsxs(
347
- "nav",
344
+ },
345
+ mainFooter: /* @__PURE__ */ jsx(
346
+ CatalogResourceFooter,
348
347
  {
349
- class: "kui-catalog__navigation",
350
- "aria-label": `${brand.title} components`,
351
- children: [
352
- /* @__PURE__ */ jsx(
353
- CatalogSectionList,
354
- {
355
- sections,
356
- active,
357
- selectAction
358
- }
359
- ),
360
- secondarySections ? /* @__PURE__ */ jsx(
361
- CatalogSecondarySections,
362
- {
363
- group: secondarySections,
364
- active,
365
- selectAction,
366
- toggleAction: toggleSecondaryAction
367
- }
368
- ) : null,
369
- footer
370
- ]
348
+ name,
349
+ resources: selected?.resources ?? [],
350
+ related: selected?.related ?? [],
351
+ status,
352
+ selectAction
371
353
  }
354
+ ),
355
+ mainHeaderPlacement: headerPlacement,
356
+ mainFooterPlacement: footerPlacement,
357
+ main: (
358
+ // The description is supporting copy, so it scrolls with the
359
+ // preview rather than pinning under the toolbar.
360
+ /* @__PURE__ */ jsxs(List, { flex: true, children: [
361
+ selected?.description ? /* @__PURE__ */ jsx(
362
+ ListInsetText,
363
+ {
364
+ sides: "trbl",
365
+ rootAttributes: { "data-catalog-description": "" },
366
+ children: /* @__PURE__ */ jsx(Text, { variant: "span", children: selected.description })
367
+ }
368
+ ) : null,
369
+ /* @__PURE__ */ jsx(
370
+ CatalogStage,
371
+ {
372
+ name,
373
+ content,
374
+ geometryOverlay,
375
+ rootAttributes: stageRootAttributes
376
+ }
377
+ )
378
+ ] })
372
379
  )
373
380
  }
374
381
  )
375
382
  }
376
383
  );
377
384
  }
378
- function findEntry(sections, id) {
379
- for (const section of sections) {
380
- for (const entry of section.entries) if (entry.id === id) return entry;
381
- }
382
- return void 0;
383
- }
384
- function Catalog({
385
- brand,
386
- sections,
387
- active,
388
- content,
389
- collapsed = false,
390
- theme,
391
- headerActions,
392
- secondarySections,
393
- sidebarFooter,
394
- status,
395
- geometryOverlay,
396
- stageRootAttributes,
397
- selectAction = "catalog-select",
398
- toggleSidebarAction = "catalog-toggle-sidebar",
399
- toggleThemeAction = "catalog-toggle-theme",
400
- toggleSecondaryAction = "catalog-toggle-secondary",
401
- className = "",
402
- slot
403
- }) {
404
- const selected = findEntry(sections, active) ?? (secondarySections ? findEntry(secondarySections.sections, active) : void 0);
405
- return /* @__PURE__ */ jsxs(
406
- "main",
407
- {
408
- class: `kui-catalog ${className}`.trim(),
409
- "data-component": "catalog",
410
- "data-sidebar-collapsed": String(collapsed),
411
- "data-geometry-overlay": geometryOverlay === void 0 ? void 0 : String(geometryOverlay),
412
- slot,
413
- children: [
414
- /* @__PURE__ */ jsx(
415
- CatalogSidebar,
416
- {
417
- brand,
418
- sections,
419
- active,
420
- collapsed,
421
- secondarySections,
422
- footer: sidebarFooter,
423
- selectAction,
424
- toggleSidebarAction,
425
- toggleSecondaryAction
426
- }
427
- ),
428
- /* @__PURE__ */ jsx(
429
- CatalogDetail,
430
- {
431
- brandTitle: brand.title,
432
- active,
433
- selected,
434
- content,
435
- collapsed,
436
- theme,
437
- headerActions,
438
- status,
439
- geometryOverlay,
440
- stageRootAttributes,
441
- selectAction,
442
- toggleSidebarAction,
443
- toggleThemeAction
444
- }
445
- )
446
- ]
447
- }
448
- );
449
- }
450
385
  var protectedAttributes2 = /* @__PURE__ */ new Set([
451
386
  "data-catalog-example",
452
387
  "data-catalog-example-stack",
@@ -505,8 +440,16 @@ function CatalogExample({
505
440
  rootAttributes: { "data-catalog-example-label": "" }
506
441
  }
507
442
  ) : null,
508
- note !== void 0 ? /* @__PURE__ */ jsx("p", { class: "kui-catalog-example__note", "data-catalog-example-note": true, children: note }) : null,
509
- compactFallback !== void 0 ? /* @__PURE__ */ jsx("p", { class: "kui-catalog-example__compact-fallback", children: compactFallback }) : null,
443
+ note !== void 0 ? /* @__PURE__ */ jsx(
444
+ ListInsetText,
445
+ {
446
+ sides: "rl",
447
+ className: "kui-catalog-example__note",
448
+ rootAttributes: { "data-catalog-example-note": "" },
449
+ children: /* @__PURE__ */ jsx(Text, { variant: "span", size: "compact", tone: "quiet", children: note })
450
+ }
451
+ ) : null,
452
+ compactFallback !== void 0 ? /* @__PURE__ */ jsx(Text, { tone: "quiet", className: "kui-catalog-example__compact-fallback", children: compactFallback }) : null,
510
453
  specimen
511
454
  ]
512
455
  }