@kerfjs/ui 5.0.0-beta.18 → 5.0.0-beta.22

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 (170) hide show
  1. package/README.md +114 -3
  2. package/ai/application-ui-diagnostic-ids-v1.json +92 -0
  3. package/ai/application-ui-profile-sync.cjs +529 -0
  4. package/ai/application-ui-profile.d.mts +1 -0
  5. package/ai/application-ui-profile.d.ts +102 -0
  6. package/ai/application-ui-profile.defaults.json +41 -0
  7. package/ai/application-ui-profile.mjs +626 -0
  8. package/ai/application-ui-profile.schema.json +130 -0
  9. package/ai/catalog-authoring.json +25 -0
  10. package/ai/catalog-authoring.schema.json +61 -0
  11. package/ai/compile-time-contracts-v1.json +101 -0
  12. package/ai/compile-time-contracts-v1.schema.json +49 -0
  13. package/ai/component-catalog-extension-v2.d.ts +7 -0
  14. package/ai/component-catalog-extension-v2.schema.json +7 -0
  15. package/ai/component-catalog-v2-overrides.json +326 -0
  16. package/ai/component-catalog-v2.d.ts +67 -0
  17. package/ai/component-catalog-v2.json +4441 -0
  18. package/ai/component-catalog-v2.schema.json +246 -0
  19. package/ai/component-catalog.json +150 -6
  20. package/ai/public-api-signatures-v1.md +294 -64
  21. package/ai/skill.md +41 -5
  22. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  23. package/analyzer/cli.mjs +46 -0
  24. package/analyzer/index.d.mts +45 -0
  25. package/analyzer/index.mjs +743 -0
  26. package/analyzer/report.schema.json +66 -0
  27. package/dist/browser/pane.js +3 -0
  28. package/dist/browser/sunken-panel.js +3 -0
  29. package/dist/catalog-resources.d.ts +34 -0
  30. package/dist/catalog-resources.js +22 -0
  31. package/dist/catalog-resources.js.map +1 -0
  32. package/dist/catalog.d.ts +21 -3
  33. package/dist/catalog.js +239 -210
  34. package/dist/catalog.js.map +1 -1
  35. package/dist/{chunk-ZK2G3VR5.js → chunk-5VTB2BKP.js} +1 -1
  36. package/dist/chunk-5VTB2BKP.js.map +1 -0
  37. package/dist/{chunk-S3HKPI7I.js → chunk-7KEUJIIC.js} +1 -1
  38. package/dist/chunk-7KEUJIIC.js.map +1 -0
  39. package/dist/{chunk-NVWXKU37.js → chunk-AASLYRGE.js} +1 -1
  40. package/dist/chunk-AASLYRGE.js.map +1 -0
  41. package/dist/{chunk-QIRXYKCE.js → chunk-DSNIYOZ3.js} +3 -2
  42. package/dist/chunk-DSNIYOZ3.js.map +1 -0
  43. package/dist/{chunk-ENVTNLYC.js → chunk-GP5DP5DL.js} +55 -15
  44. package/dist/chunk-GP5DP5DL.js.map +1 -0
  45. package/dist/chunk-JRKSK2HX.js +79 -0
  46. package/dist/chunk-JRKSK2HX.js.map +1 -0
  47. package/dist/{chunk-U5IFGQCD.js → chunk-K57KRAOV.js} +1 -1
  48. package/dist/chunk-K57KRAOV.js.map +1 -0
  49. package/dist/{chunk-ZVI5YST2.js → chunk-M7JBER5U.js} +1 -1
  50. package/dist/chunk-M7JBER5U.js.map +1 -0
  51. package/dist/{chunk-43FUQH35.js → chunk-OHU6CI22.js} +2 -2
  52. package/dist/{chunk-43FUQH35.js.map → chunk-OHU6CI22.js.map} +1 -1
  53. package/dist/{chunk-4TRDV6RL.js → chunk-OZWU5ZPZ.js} +1 -1
  54. package/dist/chunk-OZWU5ZPZ.js.map +1 -0
  55. package/dist/{chunk-JTHUXDN2.js → chunk-RYRIFZCT.js} +3 -3
  56. package/dist/chunk-RYRIFZCT.js.map +1 -0
  57. package/dist/{chunk-6ETZKKAE.js → chunk-VLYV65LK.js} +1 -1
  58. package/dist/chunk-VLYV65LK.js.map +1 -0
  59. package/dist/chunk-W4CXQYSG.js +23 -0
  60. package/dist/chunk-W4CXQYSG.js.map +1 -0
  61. package/dist/{chunk-S3PCZ7NV.js → chunk-W7YD6E4N.js} +1 -1
  62. package/dist/chunk-W7YD6E4N.js.map +1 -0
  63. package/dist/index.d.ts +6 -4
  64. package/dist/index.js +14 -12
  65. package/dist/list-header.d.ts +29 -8
  66. package/dist/list-header.js +1 -1
  67. package/dist/nav-stack.js +1 -1
  68. package/dist/pane.d.ts +49 -0
  69. package/dist/pane.js +4 -0
  70. package/dist/pane.js.map +1 -0
  71. package/dist/panel-header.d.ts +9 -3
  72. package/dist/panel-header.js +1 -1
  73. package/dist/segmented-control.d.ts +6 -6
  74. package/dist/segmented-control.js +1 -1
  75. package/dist/select.d.ts +10 -4
  76. package/dist/select.js +1 -1
  77. package/dist/split-view.js +2 -2
  78. package/dist/state-banner.d.ts +3 -2
  79. package/dist/state-banner.js +1 -1
  80. package/dist/styles/catalog.css +6 -6
  81. package/dist/styles/layout.css +2 -20
  82. package/dist/styles/pane.css +62 -0
  83. package/dist/styles/segmented-control.css +3 -7
  84. package/dist/styles/sunken-panel.css +18 -0
  85. package/dist/sunken-panel.d.ts +16 -0
  86. package/dist/sunken-panel.js +3 -0
  87. package/dist/sunken-panel.js.map +1 -0
  88. package/dist/tab-bar.d.ts +3 -2
  89. package/dist/tab-bar.js +1 -1
  90. package/dist/tab-scaffold.d.ts +6 -6
  91. package/dist/tab-scaffold.js.map +1 -1
  92. package/dist/token-search-field.d.ts +25 -9
  93. package/dist/token-search-field.js +1 -1
  94. package/dist/toolbar-control-group.d.ts +9 -5
  95. package/dist/toolbar-control-group.js +1 -1
  96. package/dist/toolbar-text.d.ts +10 -11
  97. package/dist/toolbar-text.js +1 -1
  98. package/dist/wire-tab-bars.d.ts +5 -2
  99. package/dist/wire-tab-bars.js +1 -1
  100. package/dist/wire-token-search-fields.d.ts +11 -6
  101. package/dist/wire-token-search-fields.js +1 -1
  102. package/docs/catalog.md +186 -67
  103. package/docs/component-contract.md +102 -5
  104. package/docs/component-selection.md +9 -5
  105. package/docs/design/templates/panel-header/icon-actions-dark.svg +1 -1
  106. package/docs/design/templates/panel-header/icon-actions.svg +1 -1
  107. package/docs/design/templates/panel-header/icon-summary-actions-dark.svg +1 -1
  108. package/docs/design/templates/panel-header/icon-summary-actions.svg +1 -1
  109. package/docs/design/templates/panel-header/no-icon-dark.svg +1 -1
  110. package/docs/design/templates/panel-header/no-icon.svg +1 -1
  111. package/docs/design/templates/panel-header/page-heading-dark.svg +1 -1
  112. package/docs/design/templates/panel-header/page-heading.svg +1 -1
  113. package/docs/design/templates/panel-header/title-only-dark.svg +1 -1
  114. package/docs/design/templates/panel-header/title-only.svg +1 -1
  115. package/docs/design/templates/panel-header-dark.svg +5 -5
  116. package/docs/design/templates/panel-header.svg +5 -5
  117. package/docs/design/templates/segmented-control/equal-dark.svg +1 -1
  118. package/docs/design/templates/segmented-control/equal.svg +1 -1
  119. package/docs/design/templates/segmented-control-dark.svg +1 -1
  120. package/docs/design/templates/segmented-control.svg +1 -1
  121. package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -1
  122. package/docs/design/templates/toolbar/title-and-actions.svg +1 -1
  123. package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -1
  124. package/docs/design/templates/toolbar-control-group/with-text.svg +1 -1
  125. package/docs/design/templates/toolbar-control-group-dark.svg +1 -1
  126. package/docs/design/templates/toolbar-control-group.svg +1 -1
  127. package/docs/design/templates/toolbar-dark.svg +1 -1
  128. package/docs/design/templates/toolbar-text/default-dark.svg +1 -1
  129. package/docs/design/templates/toolbar-text/default.svg +1 -1
  130. package/docs/design/templates/toolbar-text/large-dark.svg +1 -1
  131. package/docs/design/templates/toolbar-text/large.svg +1 -1
  132. package/docs/design/templates/toolbar-text/small-dark.svg +1 -1
  133. package/docs/design/templates/toolbar-text/small.svg +1 -1
  134. package/docs/design/templates/toolbar-text-dark.svg +3 -3
  135. package/docs/design/templates/toolbar-text.svg +3 -3
  136. package/docs/design/templates/toolbar.svg +1 -1
  137. package/docs/design/templates.md +11 -6
  138. package/docs/design-philosophy.md +2 -4
  139. package/docs/examples/application-ui-profile.json +60 -0
  140. package/docs/examples/component-catalog-extension-v2.json +81 -0
  141. package/docs/layout.md +42 -23
  142. package/docs/sunken-panel.md +43 -0
  143. package/docs/type-contracts.md +99 -0
  144. package/docs/ui-analyzer.md +81 -0
  145. package/docs/ui-doctor.md +77 -0
  146. package/docs/ui-evaluator.md +122 -0
  147. package/doctor/cli.mjs +115 -0
  148. package/doctor/config.schema.json +68 -0
  149. package/doctor/index.d.mts +116 -0
  150. package/doctor/index.mjs +1256 -0
  151. package/doctor/report.schema.json +118 -0
  152. package/evaluator/cli.mjs +89 -0
  153. package/evaluator/index.d.mts +90 -0
  154. package/evaluator/index.mjs +1138 -0
  155. package/evaluator/report.schema.json +152 -0
  156. package/llms.txt +40 -3
  157. package/package.json +66 -8
  158. package/ux-demo/recipes/compact-toolbar.tsx +2 -2
  159. package/ux-demo/recipes/composer-form.tsx +1 -1
  160. package/dist/chunk-4TRDV6RL.js.map +0 -1
  161. package/dist/chunk-6ETZKKAE.js.map +0 -1
  162. package/dist/chunk-ENVTNLYC.js.map +0 -1
  163. package/dist/chunk-JTHUXDN2.js.map +0 -1
  164. package/dist/chunk-NVWXKU37.js.map +0 -1
  165. package/dist/chunk-QIRXYKCE.js.map +0 -1
  166. package/dist/chunk-S3HKPI7I.js.map +0 -1
  167. package/dist/chunk-S3PCZ7NV.js.map +0 -1
  168. package/dist/chunk-U5IFGQCD.js.map +0 -1
  169. package/dist/chunk-ZK2G3VR5.js.map +0 -1
  170. package/dist/chunk-ZVI5YST2.js.map +0 -1
package/dist/catalog.js CHANGED
@@ -1,12 +1,13 @@
1
- import { ToolbarControlGroup } from './chunk-ZK2G3VR5.js';
1
+ import { Pane } from './chunk-JRKSK2HX.js';
2
2
  import { Toolbar } from './chunk-7L6EHUMV.js';
3
- import { ListHeader } from './chunk-QIRXYKCE.js';
3
+ import { ToolbarControlGroup } from './chunk-5VTB2BKP.js';
4
+ import { ListHeader } from './chunk-DSNIYOZ3.js';
4
5
  import { ListItem } from './chunk-ELSJX4W7.js';
5
-
6
+ import { filterDataAttributes } from './chunk-SRSJO5QE.js';
6
7
 
7
8
 
8
9
  import { LucideIcon } from './chunk-W2FK7ZNY.js';
9
- import { PanelLeftClose, Moon, Sun, PanelLeftOpen, Waypoints, ExternalLink } from 'lucide';
10
+ import { PanelLeftClose, Waypoints, ExternalLink, Moon, Sun, PanelLeftOpen } from 'lucide';
10
11
  import { jsxs, jsx, Fragment } from 'kerfjs/jsx-runtime';
11
12
 
12
13
  function findEntry(sections, id) {
@@ -67,246 +68,268 @@ function Catalog({
67
68
  "data-sidebar-collapsed": String(collapsed),
68
69
  "data-geometry-overlay": geometryOverlay === void 0 ? void 0 : String(geometryOverlay),
69
70
  children: [
70
- /* @__PURE__ */ jsxs(
71
- "aside",
71
+ /* @__PURE__ */ jsx(
72
+ Pane,
72
73
  {
73
- class: "kui-catalog__sidebar kui-pane",
74
- "aria-label": `${brand.title} catalog`,
75
- children: [
76
- /* @__PURE__ */ jsxs("header", { class: "kui-catalog__brand kui-pane__toolbar", children: [
77
- /* @__PURE__ */ jsx(
78
- Toolbar,
74
+ element: "aside",
75
+ className: "kui-catalog__sidebar",
76
+ label: `${brand.title} catalog`,
77
+ contentElement: "nav",
78
+ contentLabel: `${brand.title} components`,
79
+ separators: ["inline-end"],
80
+ headerClassName: "kui-catalog__brand",
81
+ header: /* @__PURE__ */ jsxs(Fragment, { children: [
82
+ /* @__PURE__ */ jsx(
83
+ Toolbar,
84
+ {
85
+ label: `${brand.title} catalog header`,
86
+ divider: false,
87
+ leading: /* @__PURE__ */ jsxs(
88
+ ToolbarControlGroup,
89
+ {
90
+ appearance: "borderless",
91
+ className: "kui-catalog__identity",
92
+ children: [
93
+ brand.logoUrl ? /* @__PURE__ */ jsx("img", { class: "kui-catalog__mark", src: brand.logoUrl, alt: "" }) : /* @__PURE__ */ jsx(Fragment, {}),
94
+ /* @__PURE__ */ jsx("h1", { children: brand.title })
95
+ ]
96
+ }
97
+ ),
98
+ trailing: /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
99
+ "button",
100
+ {
101
+ type: "button",
102
+ "data-action": toggleSidebarAction,
103
+ "aria-label": `Collapse ${brand.title} catalog`,
104
+ children: /* @__PURE__ */ jsx(LucideIcon, { icon: PanelLeftClose, name: "panel-left-close" })
105
+ }
106
+ ) })
107
+ }
108
+ ),
109
+ brand.subtitle ? /* @__PURE__ */ jsx("p", { class: "kui-catalog__subtitle", children: brand.subtitle }) : /* @__PURE__ */ jsx(Fragment, {})
110
+ ] }),
111
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
112
+ sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group", children: [
113
+ /* @__PURE__ */ jsx(ListHeader, { label: section.category }),
114
+ /* @__PURE__ */ jsx("div", { class: "kui-catalog__items", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
115
+ ListItem,
79
116
  {
80
- label: `${brand.title} catalog header`,
81
- divider: false,
82
- leading: /* @__PURE__ */ jsxs(
83
- ToolbarControlGroup,
84
- {
85
- appearance: "borderless",
86
- className: "kui-catalog__identity",
87
- children: [
88
- brand.logoUrl ? /* @__PURE__ */ jsx("img", { class: "kui-catalog__mark", src: brand.logoUrl, alt: "" }) : /* @__PURE__ */ jsx(Fragment, {}),
89
- /* @__PURE__ */ jsx("h1", { children: brand.title })
90
- ]
91
- }
92
- ),
93
- trailing: /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
117
+ action: selectAction,
118
+ itemId: entry.id,
119
+ label: entry.name,
120
+ trailing: catalogEntryTags(entry.tags),
121
+ selected: active === entry.id,
122
+ title: entry.description,
123
+ multiline: true
124
+ }
125
+ )) })
126
+ ] })),
127
+ secondarySections ? /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group kui-catalog__group--secondary", children: [
128
+ secondarySections.collapsible ? /* @__PURE__ */ jsx(
129
+ ListHeader,
130
+ {
131
+ label: secondarySections.label,
132
+ toggle: true,
133
+ expanded: Boolean(secondarySections.expanded),
134
+ action: toggleSecondaryAction
135
+ }
136
+ ) : /* @__PURE__ */ jsx(ListHeader, { label: secondarySections.label }),
137
+ !secondarySections.collapsible || secondarySections.expanded ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__secondary", "data-catalog-secondary": true, children: secondarySections.sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__secondary-group", children: [
138
+ /* @__PURE__ */ jsx("h3", { class: "kui-catalog__secondary-heading", children: section.category }),
139
+ /* @__PURE__ */ jsx("div", { class: "kui-catalog__items", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
140
+ ListItem,
141
+ {
142
+ action: selectAction,
143
+ itemId: entry.id,
144
+ label: entry.name,
145
+ trailing: catalogEntryTags(entry.tags),
146
+ selected: active === entry.id,
147
+ title: entry.description,
148
+ multiline: true
149
+ }
150
+ )) })
151
+ ] })) }) : /* @__PURE__ */ jsx(Fragment, {})
152
+ ] }) : /* @__PURE__ */ jsx(Fragment, {}),
153
+ sidebarFooter ?? /* @__PURE__ */ jsx(Fragment, {})
154
+ ] })
155
+ }
156
+ ),
157
+ /* @__PURE__ */ jsx(
158
+ Pane,
159
+ {
160
+ element: "article",
161
+ className: "kui-catalog__detail",
162
+ contentElement: "section",
163
+ contentLabel: `${name} preview`,
164
+ contentClassName: "kui-catalog__stage",
165
+ headerClassName: "kui-catalog__header",
166
+ header: /* @__PURE__ */ jsxs(Fragment, { children: [
167
+ /* @__PURE__ */ jsx(
168
+ Toolbar,
169
+ {
170
+ label: `${name} header`,
171
+ divider: false,
172
+ leading: /* @__PURE__ */ jsxs(Fragment, { children: [
173
+ collapsed ? /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
94
174
  "button",
95
175
  {
96
176
  type: "button",
97
177
  "data-action": toggleSidebarAction,
98
- "aria-label": `Collapse ${brand.title} catalog`,
99
- children: /* @__PURE__ */ jsx(LucideIcon, { icon: PanelLeftClose, name: "panel-left-close" })
178
+ "aria-label": `Expand ${brand.title} catalog`,
179
+ children: /* @__PURE__ */ jsx(
180
+ LucideIcon,
181
+ {
182
+ icon: PanelLeftOpen,
183
+ name: "panel-left-open"
184
+ }
185
+ )
100
186
  }
101
- ) })
102
- }
103
- ),
104
- brand.subtitle ? /* @__PURE__ */ jsx("p", { class: "kui-catalog__subtitle", children: brand.subtitle }) : /* @__PURE__ */ jsx(Fragment, {})
105
- ] }),
106
- /* @__PURE__ */ jsxs(
107
- "nav",
108
- {
109
- class: "kui-pane__content kui-content",
110
- "aria-label": `${brand.title} components`,
111
- children: [
112
- sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group", children: [
113
- /* @__PURE__ */ jsx(ListHeader, { label: section.category }),
114
- /* @__PURE__ */ jsx("div", { class: "kui-catalog__items", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
115
- ListItem,
116
- {
117
- action: selectAction,
118
- itemId: entry.id,
119
- label: entry.name,
120
- trailing: catalogEntryTags(entry.tags),
121
- selected: active === entry.id,
122
- title: entry.description,
123
- multiline: true
124
- }
125
- )) })
126
- ] })),
127
- secondarySections ? /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group kui-catalog__group--secondary", children: [
128
- /* @__PURE__ */ jsx(
129
- ListHeader,
130
- {
131
- label: secondarySections.label,
132
- toggle: secondarySections.collapsible,
133
- expanded: secondarySections.collapsible ? Boolean(secondarySections.expanded) : void 0,
134
- action: secondarySections.collapsible ? toggleSecondaryAction : void 0
135
- }
136
- ),
137
- !secondarySections.collapsible || secondarySections.expanded ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__secondary", "data-catalog-secondary": true, children: secondarySections.sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__secondary-group", children: [
138
- /* @__PURE__ */ jsx("h3", { class: "kui-catalog__secondary-heading", children: section.category }),
139
- /* @__PURE__ */ jsx("div", { class: "kui-catalog__items", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
140
- ListItem,
187
+ ) }) : /* @__PURE__ */ jsx(Fragment, {}),
188
+ /* @__PURE__ */ jsx(
189
+ ToolbarControlGroup,
190
+ {
191
+ appearance: "borderless",
192
+ className: "kui-catalog__title",
193
+ children: /* @__PURE__ */ jsx("h2", { children: name })
194
+ }
195
+ )
196
+ ] }),
197
+ trailing: /* @__PURE__ */ jsxs("div", { class: "kui-catalog__header-actions", children: [
198
+ headerActions,
199
+ theme ? /* @__PURE__ */ jsx(
200
+ ToolbarControlGroup,
201
+ {
202
+ className: "kui-catalog__settings",
203
+ label: "Catalog display",
204
+ children: /* @__PURE__ */ jsxs(
205
+ "button",
141
206
  {
142
- action: selectAction,
143
- itemId: entry.id,
144
- label: entry.name,
145
- trailing: catalogEntryTags(entry.tags),
146
- selected: active === entry.id,
147
- title: entry.description,
148
- multiline: true
207
+ type: "button",
208
+ "data-action": toggleThemeAction,
209
+ "aria-label": `Use ${nextTheme} theme`,
210
+ "data-theme-preview": theme,
211
+ children: [
212
+ nextTheme === "dark" ? /* @__PURE__ */ jsx(LucideIcon, { icon: Moon, name: "moon" }) : /* @__PURE__ */ jsx(LucideIcon, { icon: Sun, name: "sun" }),
213
+ /* @__PURE__ */ jsx("span", { children: nextTheme === "dark" ? "Dark" : "Light" })
214
+ ]
149
215
  }
150
- )) })
151
- ] })) }) : /* @__PURE__ */ jsx(Fragment, {})
152
- ] }) : /* @__PURE__ */ jsx(Fragment, {}),
153
- sidebarFooter
154
- ]
216
+ )
217
+ }
218
+ ) : /* @__PURE__ */ jsx(Fragment, {})
219
+ ] })
155
220
  }
156
- )
157
- ]
158
- }
159
- ),
160
- /* @__PURE__ */ jsxs("article", { class: "kui-catalog__detail kui-pane", children: [
161
- /* @__PURE__ */ jsxs("header", { class: "kui-catalog__header kui-pane__toolbar", children: [
162
- /* @__PURE__ */ jsx(
163
- Toolbar,
164
- {
165
- label: `${name} header`,
166
- divider: false,
167
- leading: /* @__PURE__ */ jsxs(Fragment, { children: [
168
- collapsed ? /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
169
- "button",
170
- {
171
- type: "button",
172
- "data-action": toggleSidebarAction,
173
- "aria-label": `Expand ${brand.title} catalog`,
174
- children: /* @__PURE__ */ jsx(LucideIcon, { icon: PanelLeftOpen, name: "panel-left-open" })
175
- }
176
- ) }) : /* @__PURE__ */ jsx(Fragment, {}),
177
- /* @__PURE__ */ jsx(
178
- ToolbarControlGroup,
221
+ ),
222
+ selected?.description ? /* @__PURE__ */ jsx("p", { class: "kui-catalog__description kui-content-item", children: selected.description }) : /* @__PURE__ */ jsx(Fragment, {})
223
+ ] }),
224
+ footerClassName: "kui-catalog__footer",
225
+ footer: /* @__PURE__ */ jsxs(Fragment, { children: [
226
+ status ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__status", children: status }) : /* @__PURE__ */ jsx(Fragment, {}),
227
+ /* @__PURE__ */ jsx(
228
+ Toolbar,
229
+ {
230
+ label: `${name} resources`,
231
+ divider: false,
232
+ leading: resources.length > 0 ? /* @__PURE__ */ jsx(
233
+ "nav",
179
234
  {
180
- appearance: "borderless",
181
- className: "kui-catalog__title",
182
- children: /* @__PURE__ */ jsx("h2", { children: name })
235
+ class: "kui-catalog__resources",
236
+ "aria-label": `${name} resources`,
237
+ children: /* @__PURE__ */ jsx(
238
+ ToolbarControlGroup,
239
+ {
240
+ className: "kui-catalog__resource-group",
241
+ label: `${name} resources`,
242
+ children: resources.map((resource) => /* @__PURE__ */ jsxs(
243
+ "a",
244
+ {
245
+ class: "kui-catalog__resource",
246
+ href: resource.href,
247
+ target: "_blank",
248
+ rel: "noopener noreferrer",
249
+ "aria-label": `${name}: ${resource.label} (opens in new tab)`,
250
+ children: [
251
+ /* @__PURE__ */ jsx(
252
+ LucideIcon,
253
+ {
254
+ icon: ExternalLink,
255
+ name: "external-link"
256
+ }
257
+ ),
258
+ /* @__PURE__ */ jsx("span", { children: resource.label }),
259
+ resource.detail ? /* @__PURE__ */ jsx("code", { children: resource.detail }) : /* @__PURE__ */ jsx(Fragment, {})
260
+ ]
261
+ }
262
+ ))
263
+ }
264
+ )
183
265
  }
184
- )
185
- ] }),
186
- trailing: /* @__PURE__ */ jsxs("div", { class: "kui-catalog__header-actions", children: [
187
- headerActions,
188
- theme ? /* @__PURE__ */ jsx(
266
+ ) : /* @__PURE__ */ jsx(Fragment, {}),
267
+ trailing: related.length > 0 ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__related", "data-catalog-related": true, children: /* @__PURE__ */ jsx(
189
268
  ToolbarControlGroup,
190
269
  {
191
- className: "kui-catalog__settings",
192
- label: "Catalog display",
270
+ single: true,
271
+ className: "kui-catalog__related-group",
272
+ label: "Related entries",
193
273
  children: /* @__PURE__ */ jsxs(
194
- "button",
274
+ "wa-dropdown",
195
275
  {
196
- type: "button",
197
- "data-action": toggleThemeAction,
198
- "aria-label": `Use ${nextTheme} theme`,
199
- "data-theme-preview": theme,
276
+ class: "kui-catalog__related-menu",
277
+ placement: "top-end",
278
+ "data-key": `kui-catalog-related-${active}`,
279
+ "data-morph-skip-children": true,
200
280
  children: [
201
- nextTheme === "dark" ? /* @__PURE__ */ jsx(LucideIcon, { icon: Moon, name: "moon" }) : /* @__PURE__ */ jsx(LucideIcon, { icon: Sun, name: "sun" }),
202
- /* @__PURE__ */ jsx("span", { children: nextTheme === "dark" ? "Dark" : "Light" })
281
+ /* @__PURE__ */ jsx("wa-button", { slot: "trigger", appearance: "plain", "with-caret": true, children: /* @__PURE__ */ jsxs("span", { class: "kui-catalog__related-trigger", children: [
282
+ /* @__PURE__ */ jsx(LucideIcon, { icon: Waypoints, name: "waypoints" }),
283
+ /* @__PURE__ */ jsx("span", { class: "kui-catalog__related-label", children: "Component" })
284
+ ] }) }),
285
+ relatedMenuItems(related, selectAction)
203
286
  ]
204
287
  }
205
288
  )
206
289
  }
207
- ) : /* @__PURE__ */ jsx(Fragment, {})
208
- ] })
209
- }
210
- ),
211
- selected?.description ? /* @__PURE__ */ jsx("p", { class: "kui-catalog__description kui-content-item", children: selected.description }) : /* @__PURE__ */ jsx(Fragment, {})
212
- ] }),
213
- /* @__PURE__ */ jsx(
214
- "section",
215
- {
216
- class: "kui-catalog__stage kui-pane__content",
217
- "aria-label": `${name} preview`,
218
- children: /* @__PURE__ */ jsxs("div", { class: "kui-catalog__canvas", children: [
219
- content,
220
- geometryOverlay !== void 0 ? /* @__PURE__ */ jsx(
221
- "div",
222
- {
223
- class: "kui-catalog__geometry-overlay",
224
- "data-catalog-geometry-overlay": true,
225
- "data-morph-skip-children": true,
226
- "aria-hidden": "true"
227
- }
228
- ) : /* @__PURE__ */ jsx(Fragment, {})
229
- ] })
230
- }
231
- ),
232
- /* @__PURE__ */ jsxs("footer", { class: "kui-catalog__footer kui-pane__footer", children: [
233
- status ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__status", children: status }) : /* @__PURE__ */ jsx(Fragment, {}),
234
- /* @__PURE__ */ jsx(
235
- Toolbar,
236
- {
237
- label: `${name} resources`,
238
- divider: false,
239
- leading: resources.length > 0 ? /* @__PURE__ */ jsx(
240
- "nav",
241
- {
242
- class: "kui-catalog__resources",
243
- "aria-label": `${name} resources`,
244
- children: /* @__PURE__ */ jsx(
245
- ToolbarControlGroup,
246
- {
247
- className: "kui-catalog__resource-group",
248
- label: `${name} resources`,
249
- children: resources.map((resource) => /* @__PURE__ */ jsxs(
250
- "a",
251
- {
252
- class: "kui-catalog__resource",
253
- href: resource.href,
254
- target: "_blank",
255
- rel: "noopener noreferrer",
256
- "aria-label": `${name}: ${resource.label} (opens in new tab)`,
257
- children: [
258
- /* @__PURE__ */ jsx(LucideIcon, { icon: ExternalLink, name: "external-link" }),
259
- /* @__PURE__ */ jsx("span", { children: resource.label }),
260
- resource.detail ? /* @__PURE__ */ jsx("code", { children: resource.detail }) : /* @__PURE__ */ jsx(Fragment, {})
261
- ]
262
- }
263
- ))
264
- }
265
- )
266
- }
267
- ) : /* @__PURE__ */ jsx(Fragment, {}),
268
- trailing: related.length > 0 ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__related", "data-catalog-related": true, children: /* @__PURE__ */ jsx(
269
- ToolbarControlGroup,
270
- {
271
- single: true,
272
- className: "kui-catalog__related-group",
273
- label: "Related entries",
274
- children: /* @__PURE__ */ jsxs(
275
- "wa-dropdown",
276
- {
277
- class: "kui-catalog__related-menu",
278
- placement: "top-end",
279
- "data-key": `kui-catalog-related-${active}`,
280
- "data-morph-skip-children": true,
281
- children: [
282
- /* @__PURE__ */ jsx("wa-button", { slot: "trigger", appearance: "plain", "with-caret": true, children: /* @__PURE__ */ jsxs("span", { class: "kui-catalog__related-trigger", children: [
283
- /* @__PURE__ */ jsx(LucideIcon, { icon: Waypoints, name: "waypoints" }),
284
- /* @__PURE__ */ jsx("span", { class: "kui-catalog__related-label", children: "Component" })
285
- ] }) }),
286
- relatedMenuItems(related, selectAction)
287
- ]
288
- }
289
- )
290
- }
291
- ) }) : /* @__PURE__ */ jsx(Fragment, {})
292
- }
293
- )
294
- ] })
295
- ] })
290
+ ) }) : /* @__PURE__ */ jsx(Fragment, {})
291
+ }
292
+ )
293
+ ] }),
294
+ children: /* @__PURE__ */ jsxs("div", { class: "kui-catalog__canvas", children: [
295
+ content,
296
+ geometryOverlay !== void 0 ? /* @__PURE__ */ jsx(
297
+ "div",
298
+ {
299
+ class: "kui-catalog__geometry-overlay",
300
+ "data-catalog-geometry-overlay": true,
301
+ "data-morph-skip-children": true,
302
+ "aria-hidden": "true"
303
+ }
304
+ ) : /* @__PURE__ */ jsx(Fragment, {})
305
+ ] })
306
+ }
307
+ )
296
308
  ]
297
309
  }
298
310
  );
299
311
  }
312
+ var catalogExampleProtectedAttributes = /* @__PURE__ */ new Set([
313
+ "data-catalog-example",
314
+ "data-catalog-example-stack",
315
+ "data-align"
316
+ ]);
300
317
  function CatalogExample({
301
318
  label,
302
319
  note,
303
320
  align = "none",
321
+ rootAttributes = {},
304
322
  className = "",
305
323
  children
306
324
  }) {
325
+ const safeRootAttributes = filterDataAttributes(
326
+ rootAttributes,
327
+ catalogExampleProtectedAttributes
328
+ );
307
329
  return /* @__PURE__ */ jsxs(
308
330
  "section",
309
331
  {
332
+ ...safeRootAttributes,
310
333
  class: `kui-catalog-example ${className}`.trim(),
311
334
  "data-catalog-example": true,
312
335
  "data-align": align,
@@ -320,12 +343,18 @@ function CatalogExample({
320
343
  }
321
344
  function CatalogExampleStack({
322
345
  label,
346
+ rootAttributes = {},
323
347
  className = "",
324
348
  children
325
349
  }) {
350
+ const safeRootAttributes = filterDataAttributes(
351
+ rootAttributes,
352
+ catalogExampleProtectedAttributes
353
+ );
326
354
  return /* @__PURE__ */ jsx(
327
- "div",
355
+ "section",
328
356
  {
357
+ ...safeRootAttributes,
329
358
  class: `kui-catalog-example-stack ${className}`.trim(),
330
359
  "data-catalog-example-stack": true,
331
360
  "aria-label": label,