@kerfjs/ui 5.0.0-beta.10 → 5.0.0-beta.12

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 (140) hide show
  1. package/README.md +3 -0
  2. package/ai/component-catalog.json +164 -2
  3. package/ai/public-api-signatures-v1.md +90 -4
  4. package/ai/skill.md +3 -2
  5. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  6. package/dist/browser/floating-toolbar.js +3 -0
  7. package/dist/browser/list-inset-control.js +3 -0
  8. package/dist/browser/list-inset-text.js +3 -0
  9. package/dist/catalog.js +8 -5
  10. package/dist/catalog.js.map +1 -1
  11. package/dist/{chunk-W5EQ3HYQ.js → chunk-5ATCDSQS.js} +2 -2
  12. package/dist/{chunk-W5EQ3HYQ.js.map → chunk-5ATCDSQS.js.map} +1 -1
  13. package/dist/chunk-5E2HVJ33.js +10 -0
  14. package/dist/chunk-5E2HVJ33.js.map +1 -0
  15. package/dist/{chunk-LC3YSAZC.js → chunk-CH4SQ6H5.js} +2 -2
  16. package/dist/{chunk-LC3YSAZC.js.map → chunk-CH4SQ6H5.js.map} +1 -1
  17. package/dist/{chunk-CVZYNJJ5.js → chunk-LCOBDOCC.js} +2 -2
  18. package/dist/chunk-LCOBDOCC.js.map +1 -0
  19. package/dist/{chunk-MFKMHK5W.js → chunk-RNPGFQ33.js} +3 -3
  20. package/dist/chunk-RNPGFQ33.js.map +1 -0
  21. package/dist/chunk-VPCTCUED.js +10 -0
  22. package/dist/chunk-VPCTCUED.js.map +1 -0
  23. package/dist/chunk-XE4OX6AZ.js +10 -0
  24. package/dist/chunk-XE4OX6AZ.js.map +1 -0
  25. package/dist/{chunk-Y5MRDTLC.js → chunk-XE5ZLPCC.js} +2 -2
  26. package/dist/{chunk-Y5MRDTLC.js.map → chunk-XE5ZLPCC.js.map} +1 -1
  27. package/dist/floating-toolbar.d.ts +28 -0
  28. package/dist/floating-toolbar.js +3 -0
  29. package/dist/floating-toolbar.js.map +1 -0
  30. package/dist/index.d.ts +4 -1
  31. package/dist/index.js +17 -14
  32. package/dist/list-header.js +1 -1
  33. package/dist/list-inset-control.d.ts +16 -0
  34. package/dist/list-inset-control.js +3 -0
  35. package/dist/list-inset-control.js.map +1 -0
  36. package/dist/list-inset-text.d.ts +16 -0
  37. package/dist/list-inset-text.js +3 -0
  38. package/dist/list-inset-text.js.map +1 -0
  39. package/dist/panel-header.js +1 -1
  40. package/dist/select.js +1 -1
  41. package/dist/split-view.js +1 -1
  42. package/dist/styles/catalog.css +29 -5
  43. package/dist/styles/floating-toolbar.css +38 -0
  44. package/dist/styles/list-inset-control.css +7 -0
  45. package/dist/styles/list-inset-text.css +5 -0
  46. package/dist/styles/toolbar-control-group.css +14 -0
  47. package/dist/toolbar-control-group.d.ts +3 -1
  48. package/dist/toolbar-control-group.js +1 -1
  49. package/dist/wire-token-search-fields.d.ts +11 -2
  50. package/dist/wire-token-search-fields.js +1 -1
  51. package/docs/accessibility.md +12 -1
  52. package/docs/component-contract.md +5 -1
  53. package/docs/component-selection.md +3 -0
  54. package/docs/design/templates/empty-state/filtered-dark.svg +1 -0
  55. package/docs/design/templates/empty-state/filtered.svg +1 -0
  56. package/docs/design/templates/empty-state/with-action-dark.svg +1 -0
  57. package/docs/design/templates/empty-state/with-action.svg +1 -0
  58. package/docs/design/templates/empty-state-dark.svg +7 -0
  59. package/docs/design/templates/empty-state.svg +7 -0
  60. package/docs/design/templates/list-action-row/default-dark.svg +1 -0
  61. package/docs/design/templates/list-action-row/default.svg +1 -0
  62. package/docs/design/templates/list-action-row/selected-dark.svg +1 -0
  63. package/docs/design/templates/list-action-row/selected.svg +1 -0
  64. package/docs/design/templates/list-action-row-dark.svg +7 -0
  65. package/docs/design/templates/list-action-row.svg +7 -0
  66. package/docs/design/templates/list-header/action-dark.svg +1 -0
  67. package/docs/design/templates/list-header/action.svg +1 -0
  68. package/docs/design/templates/list-header/count-dark.svg +1 -0
  69. package/docs/design/templates/list-header/count.svg +1 -0
  70. package/docs/design/templates/list-header/toggle-collapsed-dark.svg +1 -0
  71. package/docs/design/templates/list-header/toggle-collapsed.svg +1 -0
  72. package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -0
  73. package/docs/design/templates/list-header/toggle-expanded.svg +1 -0
  74. package/docs/design/templates/list-header-dark.svg +11 -0
  75. package/docs/design/templates/list-header.svg +11 -0
  76. package/docs/design/templates/list-item/default-dark.svg +1 -0
  77. package/docs/design/templates/list-item/default.svg +1 -0
  78. package/docs/design/templates/list-item/multiline-dark.svg +1 -0
  79. package/docs/design/templates/list-item/multiline.svg +1 -0
  80. package/docs/design/templates/list-item/selected-dark.svg +1 -0
  81. package/docs/design/templates/list-item/selected.svg +1 -0
  82. package/docs/design/templates/list-item/trailing-dark.svg +1 -0
  83. package/docs/design/templates/list-item/trailing.svg +1 -0
  84. package/docs/design/templates/list-item-dark.svg +11 -0
  85. package/docs/design/templates/list-item.svg +11 -0
  86. package/docs/design/templates/segmented-control/equal-dark.svg +1 -0
  87. package/docs/design/templates/segmented-control/equal.svg +1 -0
  88. package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -0
  89. package/docs/design/templates/segmented-control/pill-small.svg +1 -0
  90. package/docs/design/templates/segmented-control-dark.svg +7 -0
  91. package/docs/design/templates/segmented-control.svg +7 -0
  92. package/docs/design/templates/skeleton/avatar-dark.svg +1 -0
  93. package/docs/design/templates/skeleton/avatar.svg +1 -0
  94. package/docs/design/templates/skeleton/block-dark.svg +1 -0
  95. package/docs/design/templates/skeleton/block.svg +1 -0
  96. package/docs/design/templates/skeleton/lines-dark.svg +1 -0
  97. package/docs/design/templates/skeleton/lines.svg +1 -0
  98. package/docs/design/templates/skeleton-dark.svg +9 -0
  99. package/docs/design/templates/skeleton.svg +9 -0
  100. package/docs/design/templates/state-banner/danger-dark.svg +1 -0
  101. package/docs/design/templates/state-banner/danger.svg +1 -0
  102. package/docs/design/templates/state-banner/info-dark.svg +1 -0
  103. package/docs/design/templates/state-banner/info.svg +1 -0
  104. package/docs/design/templates/state-banner/success-dark.svg +1 -0
  105. package/docs/design/templates/state-banner/success.svg +1 -0
  106. package/docs/design/templates/state-banner/warning-dark.svg +1 -0
  107. package/docs/design/templates/state-banner/warning.svg +1 -0
  108. package/docs/design/templates/state-banner-dark.svg +11 -0
  109. package/docs/design/templates/state-banner.svg +11 -0
  110. package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -0
  111. package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -0
  112. package/docs/design/templates/tab-bar-dark.svg +5 -0
  113. package/docs/design/templates/tab-bar.svg +5 -0
  114. package/docs/design/templates/token-search-field/empty-dark.svg +1 -0
  115. package/docs/design/templates/token-search-field/empty.svg +1 -0
  116. package/docs/design/templates/token-search-field/tokens-dark.svg +1 -0
  117. package/docs/design/templates/token-search-field/tokens.svg +1 -0
  118. package/docs/design/templates/token-search-field-dark.svg +7 -0
  119. package/docs/design/templates/token-search-field.svg +7 -0
  120. package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -0
  121. package/docs/design/templates/toolbar/title-and-actions.svg +1 -0
  122. package/docs/design/templates/toolbar-dark.svg +5 -0
  123. package/docs/design/templates/toolbar-text/default-dark.svg +1 -0
  124. package/docs/design/templates/toolbar-text/default.svg +1 -0
  125. package/docs/design/templates/toolbar-text/large-dark.svg +1 -0
  126. package/docs/design/templates/toolbar-text/large.svg +1 -0
  127. package/docs/design/templates/toolbar-text/small-dark.svg +1 -0
  128. package/docs/design/templates/toolbar-text/small.svg +1 -0
  129. package/docs/design/templates/toolbar-text-dark.svg +9 -0
  130. package/docs/design/templates/toolbar-text.svg +9 -0
  131. package/docs/design/templates/toolbar.svg +5 -0
  132. package/docs/design/templates/value-table/details-dark.svg +1 -0
  133. package/docs/design/templates/value-table/details.svg +1 -0
  134. package/docs/design/templates/value-table-dark.svg +5 -0
  135. package/docs/design/templates/value-table.svg +5 -0
  136. package/docs/design/templates.md +31 -0
  137. package/llms.txt +10 -6
  138. package/package.json +22 -2
  139. package/dist/chunk-CVZYNJJ5.js.map +0 -1
  140. package/dist/chunk-MFKMHK5W.js.map +0 -1
package/README.md CHANGED
@@ -98,10 +98,13 @@ as a `New` marker.
98
98
  | `DisclosureArrow` | `@kerfjs/ui/disclosure-arrow` | `@kerfjs/ui/disclosure-arrow.css` |
99
99
  | `Toolbar` | `@kerfjs/ui/toolbar` | `@kerfjs/ui/toolbar.css` |
100
100
  | `ToolbarControlGroup` | `@kerfjs/ui/toolbar-control-group` | `@kerfjs/ui/toolbar-control-group.css` |
101
+ | `FloatingToolbar` | `@kerfjs/ui/floating-toolbar` | `@kerfjs/ui/floating-toolbar.css` |
101
102
  | `ToolbarText` | `@kerfjs/ui/toolbar-text` | `@kerfjs/ui/toolbar-text.css` |
102
103
  | `ListActionRow` | `@kerfjs/ui/list-action-row` | `@kerfjs/ui/list-action-row.css` |
103
104
  | `ListItem` | `@kerfjs/ui/list-item` | `@kerfjs/ui/list-item.css` |
104
105
  | `ListHeader` | `@kerfjs/ui/list-header` | `@kerfjs/ui/list-header.css` |
106
+ | `ListInsetControl` | `@kerfjs/ui/list-inset-control` | `@kerfjs/ui/list-inset-control.css` |
107
+ | `ListInsetText` | `@kerfjs/ui/list-inset-text` | `@kerfjs/ui/list-inset-text.css` |
105
108
  | Pane, content, and navigation composition | — | `@kerfjs/ui/layout.css` |
106
109
  | `ResizableRegion` | `@kerfjs/ui/resizable-region` | `@kerfjs/ui/resizable-region.css` |
107
110
  | `wireResizableRegions` | `@kerfjs/ui/wire-resizable-regions` | — |
@@ -385,10 +385,12 @@
385
385
  "ToolbarControlGroup"
386
386
  ],
387
387
  "useWhen": [
388
- "Group related controls inside a toolbar with a supported visual treatment."
388
+ "Group related controls inside a toolbar with a supported visual treatment.",
389
+ "Fill it with plain <button> controls (the group styles > button fully); use wa-button only for a Web Awesome feature such as a wa-dropdown popup trigger."
389
390
  ],
390
391
  "avoidWhen": [
391
- "Do not use merely to align unrelated buttons or to imitate an exclusive choice."
392
+ "Do not use merely to align unrelated buttons or to imitate an exclusive choice.",
393
+ "Do not reach for wa-button for an ordinary control inside the group — a plain <button> is the default and avoids the Web Awesome dependency."
392
394
  ],
393
395
  "alternatives": [
394
396
  {
@@ -454,6 +456,68 @@
454
456
  "recipe": "docs/component-selection.md#problem-to-component-matrix"
455
457
  }
456
458
  },
459
+ {
460
+ "id": "floating-toolbar",
461
+ "name": "FloatingToolbar",
462
+ "category": "Structure",
463
+ "kind": "component",
464
+ "source": "kerf",
465
+ "description": "A transparent, forced-dark toolbar that floats over its container's content.",
466
+ "uses": [],
467
+ "purpose": "A transparent, forced-dark toolbar that floats over its container's content.",
468
+ "publicExports": [
469
+ "FloatingToolbar"
470
+ ],
471
+ "useWhen": [
472
+ "Float a small cluster of controls (e.g. a drawer restore) over scrolling content without covering dialogs."
473
+ ],
474
+ "avoidWhen": [
475
+ "Do not use for a primary page or panel toolbar, or for anything that must sit above overlays (it is not top-layer)."
476
+ ],
477
+ "alternatives": [
478
+ {
479
+ "id": "toolbar",
480
+ "relationship": "nearest"
481
+ }
482
+ ],
483
+ "appOwns": [
484
+ "controls",
485
+ "position",
486
+ "visibility"
487
+ ],
488
+ "variants": [
489
+ "bottom-end",
490
+ "bottom-start",
491
+ "bottom",
492
+ "top-end",
493
+ "top-start",
494
+ "top"
495
+ ],
496
+ "accessibility": [
497
+ "Give the toolbar an accessible name (label is required — it exposes role=\"toolbar\")."
498
+ ],
499
+ "delivery": {
500
+ "browserImport": "@kerfjs/ui/floating-toolbar",
501
+ "manualCssImport": "@kerfjs/ui/floating-toolbar.css",
502
+ "sideEffects": [
503
+ "browser-condition-css"
504
+ ]
505
+ },
506
+ "wiring": [],
507
+ "publicClasses": [
508
+ "kui-floating-toolbar"
509
+ ],
510
+ "publicTokens": [
511
+ "--kui-floating-toolbar-inset",
512
+ "--kui-space-m",
513
+ "--kui-space-xs"
514
+ ],
515
+ "links": {
516
+ "catalogRoute": "?component=floating-toolbar",
517
+ "documentation": "docs/component-selection.md",
518
+ "recipe": "docs/component-selection.md#problem-to-component-matrix"
519
+ }
520
+ },
457
521
  {
458
522
  "id": "toolbar-text",
459
523
  "name": "ToolbarText",
@@ -1047,6 +1111,104 @@
1047
1111
  "recipe": "docs/component-selection.md#problem-to-component-matrix"
1048
1112
  }
1049
1113
  },
1114
+ {
1115
+ "id": "list-inset-control",
1116
+ "name": "ListInsetControl",
1117
+ "category": "Structure",
1118
+ "kind": "component",
1119
+ "source": "kerf",
1120
+ "description": "Insets a self-bordered control into a pane/list content region.",
1121
+ "uses": [],
1122
+ "purpose": "Insets a self-bordered control into a pane/list content region.",
1123
+ "publicExports": [
1124
+ "ListInsetControl"
1125
+ ],
1126
+ "useWhen": [
1127
+ "Place a control that carries its own border and padding (an input, a wa-* control) in a pane/list content region so its edges align with .kui-content items."
1128
+ ],
1129
+ "avoidWhen": [
1130
+ "Do not wrap a component that already owns its content-item margin (ListItem, StateBanner, …) — that double-insets it. Use ListInsetText for bare text."
1131
+ ],
1132
+ "alternatives": [
1133
+ {
1134
+ "id": "list-inset-text",
1135
+ "relationship": "nearest"
1136
+ }
1137
+ ],
1138
+ "appOwns": [
1139
+ "the wrapped control and its behavior"
1140
+ ],
1141
+ "accessibility": [
1142
+ "A layout wrapper only; it adds no role or name — the wrapped control keeps its own."
1143
+ ],
1144
+ "delivery": {
1145
+ "browserImport": "@kerfjs/ui/list-inset-control",
1146
+ "manualCssImport": "@kerfjs/ui/list-inset-control.css",
1147
+ "sideEffects": [
1148
+ "browser-condition-css"
1149
+ ]
1150
+ },
1151
+ "wiring": [],
1152
+ "publicClasses": [
1153
+ "kui-list-inset-control"
1154
+ ],
1155
+ "publicTokens": [
1156
+ "--kui-layout-inline-margin"
1157
+ ],
1158
+ "links": {
1159
+ "catalogRoute": "?component=list-inset-control",
1160
+ "documentation": "docs/component-selection.md",
1161
+ "recipe": "docs/component-selection.md#problem-to-component-matrix"
1162
+ }
1163
+ },
1164
+ {
1165
+ "id": "list-inset-text",
1166
+ "name": "ListInsetText",
1167
+ "category": "Structure",
1168
+ "kind": "component",
1169
+ "source": "kerf",
1170
+ "description": "Gives bare text the content-item geometry so it lines up with bordered items.",
1171
+ "uses": [],
1172
+ "purpose": "Gives bare text the content-item geometry so it lines up with bordered items.",
1173
+ "publicExports": [
1174
+ "ListInsetText"
1175
+ ],
1176
+ "useWhen": [
1177
+ "Line a plain text element up with bordered .kui-content items — it adds the 8px margin, 1px transparent border, and 8px padding the text lacks."
1178
+ ],
1179
+ "avoidWhen": [
1180
+ "Do not use it to wrap an interactive control (use ListInsetControl), or a component that already owns its content-item geometry."
1181
+ ],
1182
+ "alternatives": [
1183
+ {
1184
+ "id": "list-inset-control",
1185
+ "relationship": "nearest"
1186
+ }
1187
+ ],
1188
+ "appOwns": [
1189
+ "the text content"
1190
+ ],
1191
+ "accessibility": [
1192
+ "A layout wrapper only; it adds no role or name."
1193
+ ],
1194
+ "delivery": {
1195
+ "browserImport": "@kerfjs/ui/list-inset-text",
1196
+ "manualCssImport": "@kerfjs/ui/list-inset-text.css",
1197
+ "sideEffects": [
1198
+ "browser-condition-css"
1199
+ ]
1200
+ },
1201
+ "wiring": [],
1202
+ "publicClasses": [
1203
+ "kui-list-inset-text"
1204
+ ],
1205
+ "publicTokens": [],
1206
+ "links": {
1207
+ "catalogRoute": "?component=list-inset-text",
1208
+ "documentation": "docs/component-selection.md",
1209
+ "recipe": "docs/component-selection.md#problem-to-component-matrix"
1210
+ }
1211
+ },
1050
1212
  {
1051
1213
  "id": "tabs",
1052
1214
  "name": "AppTab",
@@ -1,6 +1,6 @@
1
1
  # Public API signatures for the UI authoring corpus
2
2
 
3
- Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.10` and `kerfjs@5.0.0-beta.10`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
3
+ Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.12` and `kerfjs@5.0.0-beta.12`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
4
4
 
5
5
  ## `@kerfjs/ui/disclosure-arrow`
6
6
 
@@ -81,12 +81,47 @@ interface ToolbarControlGroupProps {
81
81
  appearance?: 'contained' | 'borderless';
82
82
  tone?: 'default' | 'dark';
83
83
  buttonAppearance?: 'plain' | 'push';
84
+ /** Corner shape: fully round `pill` (default) or a softer `rounded` rectangle. */
85
+ shape?: 'pill' | 'rounded';
84
86
  }
85
- declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance }: ToolbarControlGroupProps): SafeHtml;
87
+ declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance, shape }: ToolbarControlGroupProps): SafeHtml;
86
88
 
87
89
  export { ToolbarControlGroup, type ToolbarControlGroupProps };
88
90
  ```
89
91
 
92
+ ## `@kerfjs/ui/floating-toolbar`
93
+
94
+ ```ts
95
+ import { SafeHtml } from 'kerfjs';
96
+
97
+ /** Where a {@link FloatingToolbar} floats within its positioned container. */
98
+ type FloatingToolbarPosition = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';
99
+ interface FloatingToolbarProps {
100
+ /** Toolbar contents — normally one or more `ToolbarControlGroup`s. */
101
+ children: SafeHtml | SafeHtml[];
102
+ /** Accessible name for the toolbar (required — it exposes `role="toolbar"`). */
103
+ label: string;
104
+ /**
105
+ * Corner or edge it floats to inside its nearest positioned ancestor.
106
+ * Default: `'bottom-end'`.
107
+ */
108
+ position?: FloatingToolbarPosition;
109
+ className?: string;
110
+ }
111
+ /**
112
+ * A toolbar that floats above the main content of its nearest positioned
113
+ * ancestor — a transparent, forced-dark cluster of controls (e.g. a drawer
114
+ * restore button) that sits over the content but NOT over dialogs or overlays
115
+ * (it is not in the top layer). It is inset from the container edges by
116
+ * `--kui-floating-toolbar-inset` (default `--kui-space-m`, i.e. 8px more than a
117
+ * top toolbar's own inset); override that token to move it. The app owns the
118
+ * controls and their behavior — wire them with `delegate()` as usual.
119
+ */
120
+ declare function FloatingToolbar({ children, label, position, className }: FloatingToolbarProps): SafeHtml;
121
+
122
+ export { FloatingToolbar, type FloatingToolbarPosition, type FloatingToolbarProps };
123
+ ```
124
+
90
125
  ## `@kerfjs/ui/list-header`
91
126
 
92
127
  ```ts
@@ -230,6 +265,48 @@ declare function ListItem({ label, icon, trailing, selected, action, itemId, cla
230
265
  export { ListItem, type ListItemProps };
231
266
  ```
232
267
 
268
+ ## `@kerfjs/ui/list-inset-control`
269
+
270
+ ```ts
271
+ import { SafeHtml } from 'kerfjs';
272
+
273
+ interface ListInsetControlProps {
274
+ /** Control(s) that own their own border and padding (e.g. an input, a `wa-*`). */
275
+ children: SafeHtml | SafeHtml[];
276
+ className?: string;
277
+ }
278
+ /**
279
+ * Insets a control into a pane/list content region: an 8px inline margin (so its
280
+ * edges line up with `.kui-content` items) and a stretch flex row with an 8px gap.
281
+ * Use it for controls that carry their own border and padding but no outer margin
282
+ * — the wrapper adds only the alignment margin and layout, not a second inset.
283
+ */
284
+ declare function ListInsetControl({ children, className }: ListInsetControlProps): SafeHtml;
285
+
286
+ export { ListInsetControl, type ListInsetControlProps };
287
+ ```
288
+
289
+ ## `@kerfjs/ui/list-inset-text`
290
+
291
+ ```ts
292
+ import { SafeHtml } from 'kerfjs';
293
+
294
+ interface ListInsetTextProps {
295
+ /** Text (or inline content) that carries no margin, border, or padding of its own. */
296
+ children: SafeHtml | SafeHtml[] | string;
297
+ className?: string;
298
+ }
299
+ /**
300
+ * Gives bare text the content-item geometry — an 8px inline margin, a 1px
301
+ * transparent border, and 8px padding — so a plain string lines up with
302
+ * bordered `.kui-content` items (its text edge lands at the same 17px inset).
303
+ * Use it for text elements that have no margin, border, or padding of their own.
304
+ */
305
+ declare function ListInsetText({ children, className }: ListInsetTextProps): SafeHtml;
306
+
307
+ export { ListInsetText, type ListInsetTextProps };
308
+ ```
309
+
233
310
  ## `@kerfjs/ui/panel-header`
234
311
 
235
312
  ```ts
@@ -1156,6 +1233,15 @@ interface TokenSearchSubmit {
1156
1233
  id: string;
1157
1234
  editor: HTMLElement;
1158
1235
  }
1236
+ /** Reported to {@link WireTokenSearchFieldsOptions.onEdit} on every editor input. */
1237
+ interface TokenSearchEdit extends TokenSearchSubmit {
1238
+ /**
1239
+ * The `InputEvent` that mutated the editor — read `event.inputType` / `event.data`
1240
+ * to gate commit behavior (e.g. only parse a chip on whitespace-terminated input)
1241
+ * without keeping a separate `input` listener.
1242
+ */
1243
+ event: InputEvent;
1244
+ }
1159
1245
  /** Reported when adjacent-token keyboard deletion asks the app to drop a chip. */
1160
1246
  interface TokenSearchTokenRemoval {
1161
1247
  id: string;
@@ -1216,7 +1302,7 @@ interface TokenSearchCollapsibleOptions {
1216
1302
  interface WireTokenSearchFieldsOptions {
1217
1303
  onSubmit?: (submission: TokenSearchSubmit) => void;
1218
1304
  /** Fired on every editor `input`, after the browser mutates it, so a caller can drop its own `input` listener. */
1219
- onEdit?: (edit: TokenSearchSubmit) => void;
1305
+ onEdit?: (edit: TokenSearchEdit) => void;
1220
1306
  /** Managed collapsible transient behavior. `true`/omitted = on with defaults; `false` = fully off. */
1221
1307
  collapsible?: boolean | TokenSearchCollapsibleOptions;
1222
1308
  /** Opt-in atomic-chip keyboard behavior (off by default). `true` = on with defaults. */
@@ -1246,7 +1332,7 @@ interface TokenSearchFieldsHandle {
1246
1332
  */
1247
1333
  declare function wireTokenSearchFields(root: HTMLElement, { onSubmit, onEdit, collapsible, keyboard }?: WireTokenSearchFieldsOptions): TokenSearchFieldsHandle;
1248
1334
 
1249
- export { type TokenSearchCollapsibleOptions, type TokenSearchFieldsHandle, type TokenSearchKeyboardOptions, type TokenSearchSubmit, type TokenSearchTokenRemoval, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
1335
+ export { type TokenSearchCollapsibleOptions, type TokenSearchEdit, type TokenSearchFieldsHandle, type TokenSearchKeyboardOptions, type TokenSearchSubmit, type TokenSearchTokenRemoval, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
1250
1336
  ```
1251
1337
 
1252
1338
  ## `kerfjs/actions`
package/ai/skill.md CHANGED
@@ -57,13 +57,13 @@ Hard rules:
57
57
  8. `ResizableRegion` uses `wireResizableRegions()` for Arrow, Shift+Arrow, Home/End, and pointer behavior. The app owns size persistence. `handleIcon` replaces decorative dormant glyph content only.
58
58
  9. Use controlled `SegmentedControl` for a small exclusive choice set. Select `appearance="toolbar"` when nesting it inside `ToolbarControlGroup`; use rounded or pill shapes for standalone contexts. Handle its action, update `value`, keep meaningful choice labels, and preserve every enabled native button in sequential Tab order.
59
59
  10. Compose `AppTab` inside controlled `TabBar`; call `wireTabBars()` once and retain its disposer. It owns same-bar drag mechanics, including proximity-based horizontal edge autoscroll, while the app applies `onReorder` and owns order, selection, panels, close policy, routing, and persistence. Arrow/Home/End select on move by default; pass `activation: 'manual'` (or `TabBar activation="manual"` per strip) so arrow keys move focus only and the user selects with Enter/Space/click — use it when selecting a tab is a heavy action. Use runtime-filtered `rootAttributes` for domain metadata and keep an optional `closeIcon` decorative and noninteractive.
60
- 11. Use token-controlled `TokenSearchField` when free text and removable structured filters share one editor. Editable text stays DOM-owned between token changes. The leading icon, first text line, clear action, and trailing slot share one fixed row when content wraps. The app owns parsing and suggestions; call `readTokenSearchField()` on input, empty `textContent` on clear, use `placeTokenSearchCaret()` after explicit controlled focus changes, and call `wireTokenSearchFields()` once so Enter submits without inserting a line break and keyboard chip deletion restores focus plus the text-relative caret after controlled replacement. Enable `collapsible` for an animated iconic closed state, standalone or inside `ToolbarControlGroup`; the field keeps text or tokens expanded, and `wireTokenSearchFields()` manages the transient expand/collapse/focus by default (activate to reveal + focus, Escape or empty blur to collapse). Bind the field's `expanded` to the returned handle's `expanded(id)` signal or adopt your own via `collapsible.signals`; opt a behavior out only when the app must own it. Do not hand-roll the open handler, the focusout collapse, or a clear-button mousedown guard — the helper owns them. For real-app adoption it also provides a focusout keep-open exception (`data-token-search-keep-open` regions or `collapsible.keepOpenOn(target)`, so a sibling suggestions/date/help surface does not collapse an empty field), opt-in atomic-chip keyboard (`keyboard`: Backspace/Delete remove the adjacent chip via `onRemoveToken`, ArrowRight moves the caret past a trailing chip), and an `onEdit({id, editor})` input callback — reach for these instead of re-adding hand-rolled keydown/input handlers around the field.
60
+ 11. Use token-controlled `TokenSearchField` when free text and removable structured filters share one editor. Editable text stays DOM-owned between token changes. The leading icon, first text line, clear action, and trailing slot share one fixed row when content wraps. The app owns parsing and suggestions; call `readTokenSearchField()` on input, empty `textContent` on clear, use `placeTokenSearchCaret()` after explicit controlled focus changes, and call `wireTokenSearchFields()` once so Enter submits without inserting a line break and keyboard chip deletion restores focus plus the text-relative caret after controlled replacement. Enable `collapsible` for an animated iconic closed state, standalone or inside `ToolbarControlGroup`; the field keeps text or tokens expanded, and `wireTokenSearchFields()` manages the transient expand/collapse/focus by default (activate to reveal + focus, Escape or empty blur to collapse). Bind the field's `expanded` to the returned handle's `expanded(id)` signal or adopt your own via `collapsible.signals`; opt a behavior out only when the app must own it. Do not hand-roll the open handler, the focusout collapse, or a clear-button mousedown guard — the helper owns them. For real-app adoption it also provides a focusout keep-open exception (`data-token-search-keep-open` regions or `collapsible.keepOpenOn(target)`, so a sibling suggestions/date/help surface does not collapse an empty field), opt-in atomic-chip keyboard (`keyboard`: Backspace/Delete remove the adjacent chip via `onRemoveToken`, ArrowRight moves the caret past a trailing chip), and an `onEdit({id, editor, event})` input callback (the `InputEvent` lets you gate on `inputType`/`data`) — reach for these instead of re-adding hand-rolled keydown/input handlers around the field.
61
61
  12. Demo work uses public production component subpaths and their browser-selected CSS. Give every public visual component its own category-grouped catalog route; list themed third-party components under a clearly labeled collapsible ecosystem section, with a focused route for each. Project its deterministic repository-relative demo source and existing documentation path so the detail can expose `View demo source` and `Read guidance` links without a runtime export; also derive first-party component implementation paths from their canonical browser imports, and label Web Awesome documentation as Kerf integration guidance. Declare direct `uses` relationships so `Used by` stays derivable, and theme shell chrome through the same semantic tokens as the stage instead of drawing a substitute.
62
62
  13. The Web Awesome theme makes Tooltip and Popover arrowless by default. Keep that default unless a pointer materially clarifies the anchor; opt back in with `--wa-tooltip-arrow-size`, `--kui-wa-popover-arrow-size`, or a popover's public `--arrow-size`, and use `without-arrow` when local no-arrow intent should survive theme changes.
63
63
  14. Treat the complete Web Awesome catalog as support coverage, not a recommendation list. Consider Popup when it replaces custom anchored positioning. Prefer Kerf `Select` over direct Dropdown/Dropdown Item/Select/Option composition, `SegmentedControl` over Button Group, `TabBar` or `SegmentedControl` over Web Awesome Tabs, `LucideIcon` over Web Awesome Icon, and `ResizableRegion` over Split Panel. Use Tree/Tree Item, Animated Image, and Comparison only for a specific required behavior; avoid Zoomable Frame.
64
64
  15. Build sidebars, main areas, inspectors, and dialogs from `@kerfjs/ui/layout.css`: an unpadded `.kui-pane`, optional `.kui-pane__toolbar`, one scrolling `.kui-pane__content`, and optional `.kui-pane__footer`. Add `.kui-content` for 24px major vertical separation and `.kui-content-item` for a child-owned 8px inline margin, 1px transparent-or-visible border, 8px padding, and 12px radius. Use the pill modifier for 22px. Do not pad pane shells or duplicate item geometry in wrappers.
65
65
  16. Keep a visible collapsible pane's collapse control in its own toolbar. When hidden, move its restore control into the adjacent main toolbar on the corresponding logical edge: leading for an inline-start sidebar and trailing for an inline-end inspector. Collapse the pane completely; do not preserve an empty icon-only rail.
66
- 16. The only direct children of a `Toolbar` zone (`leading`/`center`/`trailing`) are `ToolbarText` (identity/title text) and `ToolbarControlGroup`; never drop bare buttons, inputs, links, or arbitrary markup straight into a zone. `SegmentedControl`, `Select`, a collapsible `TokenSearchField`, and Web Awesome controls all live inside a `ToolbarControlGroup`. A popup menu in a toolbar is a `single` `ToolbarControlGroup` wrapping a `wa-dropdown` whose `slot="trigger"` `wa-button` is the toolbar button and whose `wa-dropdown-item`s are the menu, with the dropdown kept under `data-morph-skip-children`. `PanelHeader` composes these for you as a panel/dialog/page heading. Wrap every toolbar item, including dormant text, in `ToolbarControlGroup`. A group remains 44px outside (`calc(2px + remify(42px))`) when its border/background are transparent; use 8px between groups and inside items. Split dormant and interactive regions: `ListHeader` fills the available inline width and keeps its label and mutually exclusive semantic count or non-count `badge` together, with an independent logical-end 44px action unless disclosure mode makes the title cluster the button. Its action visual defaults to 18px through `--kui-list-header-action-icon-size`; never shrink the target to match it. Pass every non-negative safe-integer section quantity through `count` with a localized full spoken `countLabel`; never concatenate it into `label` or put a number in `badge`. `ListItem.trailing` is dormant; use `ListActionRow` when primary and trailing actions need sibling 44px native buttons. Its `label`, `icon`, and `trailingActionIcon` slots are also dormant and cannot contain controls. Let panes relocate at narrow widths instead of shrinking targets.
66
+ 16. The only direct children of a `Toolbar` zone (`leading`/`center`/`trailing`) are `ToolbarText` (identity/title text) and `ToolbarControlGroup`; never drop bare buttons, inputs, links, or arbitrary markup straight into a zone. `SegmentedControl`, `Select`, a collapsible `TokenSearchField`, and Web Awesome controls all live inside a `ToolbarControlGroup`. For an ordinary icon/action control inside a group, use a plain `<button>` (the group styles `> button` fully) — that is the default; reach for `wa-button` only when you need a Web Awesome feature, chiefly a `wa-dropdown` popup trigger. A popup menu in a toolbar is a `single` `ToolbarControlGroup` wrapping a `wa-dropdown` whose `slot="trigger"` `wa-button` is the toolbar button and whose `wa-dropdown-item`s are the menu, with the dropdown kept under `data-morph-skip-children`. `PanelHeader` composes these for you as a panel/dialog/page heading. Wrap every toolbar item, including dormant text, in `ToolbarControlGroup`. A group remains 44px outside (`calc(2px + remify(42px))`) when its border/background are transparent; use 8px between groups and inside items. Split dormant and interactive regions: `ListHeader` fills the available inline width and keeps its label and mutually exclusive semantic count or non-count `badge` together, with an independent logical-end 44px action unless disclosure mode makes the title cluster the button. Its action visual defaults to 18px through `--kui-list-header-action-icon-size`; never shrink the target to match it. Pass every non-negative safe-integer section quantity through `count` with a localized full spoken `countLabel`; never concatenate it into `label` or put a number in `badge`. `ListItem.trailing` is dormant; use `ListActionRow` when primary and trailing actions need sibling 44px native buttons. Its `label`, `icon`, and `trailingActionIcon` slots are also dormant and cannot contain controls. Let panes relocate at narrow widths instead of shrinking targets.
67
67
  17. When a recurring concept has no matching export or production recipe, keep its semantics in a thin application adapter while reusing the public layout vocabulary. The composer recipe uses one visible form surface, `PanelHeader` title/summary ids, shared 8px field/action gutters, 24px major rhythm, and a conditional StateBanner as its only nested semantic surface; do not turn every section into a card or double-inset intrinsically bordered controls. The application-local `../docs/examples/command-palette-adapter.tsx` is reference source for one such missing concept, not an `@kerfjs/ui` runtime export or catalog recipe. The application owns its registration, ranking, history, permissions, availability, shortcut policy, focus policy, dispatch, and copy. If a missing concept recurs across products, open an upstream component or recipe request.
68
68
  18. Compose `ValueTable` from typed `ValueTableRow` entries instead of handwritten `dt`/`dd` wrappers. Pass `icon` for the optional 24px leading visual; the row owns 8px of root-scaled top and bottom padding, the 8px iconless or 40px icon-bearing separator start, and the common 8px right inset.
69
69
  19. Use `PanelHeader` for a panel, dialog, or page heading, not a custom heading row. It is a plain top `Toolbar` (overriding no Toolbar styles): the leading zone holds an optional icon (a normal bordered `ToolbarControlGroup` given a brand fill with a matching border) and the title as extra-large `ToolbarText`; the app's trailing controls (typically a `ToolbarControlGroup`) go straight in the trailing zone, and the icon group is omitted when no icon is passed. Its optional `summary`/`summaryId` row stays below the title. The app owns modal behavior, focus, dismissal, command policy, and action handling.
@@ -89,6 +89,7 @@ Common mistakes:
89
89
  | Choose a listed ecosystem component by default | Apply the component-selection guidance above; catalog coverage means supported and themed, not preferred |
90
90
  | Add sidebar-specific wrapper padding | Use the unpadded `.kui-pane`; let `ListHeader`, `ListItem`, and `.kui-content-item` own their 8/1/8 geometry |
91
91
  | Put bare text or controls directly in a toolbar slot | Wrap every item in `ToolbarControlGroup`, using `appearance="borderless"` for transparent chrome |
92
+ | Reach for `wa-button` for a plain control inside a `ToolbarControlGroup` | Use a plain `<button>` (the group styles it fully); `wa-button` is only for Web Awesome features like a `wa-dropdown` popup trigger |
92
93
  | Let the document, pane, and list all scroll | Keep fixed chrome outside one `.kui-pane__content` scroll owner per pane |
93
94
  | Invent an `@kerfjs/ui` command-palette export | Keep the semantics application-local, reuse public layout vocabulary, and propose recurring behavior upstream |
94
95
  | Handwrite `ValueTable` row wrappers or compensate their padding or separators | Compose `ValueTableRow`; its root-scaled block padding, optional icon hook, and separator geometry are public contract |
@@ -1,6 +1,6 @@
1
1
  # Web Awesome JSX signatures for the UI authoring corpus
2
2
 
3
- Generated from the emitted `@kerfjs/ui@5.0.0-beta.10` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
3
+ Generated from the emitted `@kerfjs/ui@5.0.0-beta.12` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
4
4
 
5
5
  ```ts
6
6
  import { KerfCustomElement } from 'kerfjs/jsx-runtime';
@@ -0,0 +1,3 @@
1
+ import '../styles/foundation.css';
2
+ import '../styles/floating-toolbar.css';
3
+ export * from '../floating-toolbar.js';
@@ -0,0 +1,3 @@
1
+ import '../styles/foundation.css';
2
+ import '../styles/list-inset-control.css';
3
+ export * from '../list-inset-control.js';
@@ -0,0 +1,3 @@
1
+ import '../styles/foundation.css';
2
+ import '../styles/list-inset-text.css';
3
+ export * from '../list-inset-text.js';
package/dist/catalog.js CHANGED
@@ -1,11 +1,11 @@
1
- import { ListHeader } from './chunk-W5EQ3HYQ.js';
2
- import { ListItem } from './chunk-L4OKFDJY.js';
3
- import { ToolbarControlGroup } from './chunk-MFKMHK5W.js';
1
+ import { ToolbarControlGroup } from './chunk-RNPGFQ33.js';
4
2
  import { Toolbar } from './chunk-DAFFDO33.js';
3
+ import { ListHeader } from './chunk-5ATCDSQS.js';
4
+ import { ListItem } from './chunk-L4OKFDJY.js';
5
5
 
6
- import { LucideIcon } from './chunk-W2FK7ZNY.js';
7
6
 
8
7
 
8
+ import { LucideIcon } from './chunk-W2FK7ZNY.js';
9
9
  import { PanelLeftClose, Moon, Sun, PanelLeftOpen, Waypoints, ExternalLink } from 'lucide';
10
10
  import { jsxs, jsx, Fragment } from 'kerfjs/jsx-runtime';
11
11
 
@@ -118,7 +118,10 @@ function Catalog({
118
118
  resource.detail ? /* @__PURE__ */ jsx("code", { children: resource.detail }) : /* @__PURE__ */ jsx(Fragment, {})
119
119
  ] })) }) }) : /* @__PURE__ */ jsx(Fragment, {}),
120
120
  trailing: related.length > 0 ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__related", "data-catalog-related": true, children: /* @__PURE__ */ jsx(ToolbarControlGroup, { single: true, className: "kui-catalog__related-group", label: "Related entries", children: /* @__PURE__ */ jsxs("wa-dropdown", { class: "kui-catalog__related-menu", placement: "top-end", "data-key": `kui-catalog-related-${active}`, "data-morph-skip-children": true, children: [
121
- /* @__PURE__ */ jsx("wa-button", { slot: "trigger", appearance: "plain", "with-caret": true, "aria-label": "Related entries", children: /* @__PURE__ */ jsx(LucideIcon, { icon: Waypoints, name: "waypoints" }) }),
121
+ /* @__PURE__ */ jsx("wa-button", { slot: "trigger", appearance: "plain", "with-caret": true, children: /* @__PURE__ */ jsxs("span", { class: "kui-catalog__related-trigger", children: [
122
+ /* @__PURE__ */ jsx(LucideIcon, { icon: Waypoints, name: "waypoints" }),
123
+ /* @__PURE__ */ jsx("span", { class: "kui-catalog__related-label", children: "Component" })
124
+ ] }) }),
122
125
  relatedMenuItems(related, selectAction)
123
126
  ] }) }) }) : /* @__PURE__ */ jsx(Fragment, {})
124
127
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/catalog.tsx"],"names":[],"mappings":";;;;;;;;;;;AAuFA,SAAS,SAAA,CAAU,UAAqC,EAAA,EAAsC;AAC5F,EAAA,KAAA,MAAW,WAAW,QAAA,EAAU;AAC9B,IAAA,KAAA,MAAW,SAAS,OAAA,CAAQ,OAAA,MAAa,KAAA,CAAM,EAAA,KAAO,IAAI,OAAO,KAAA;AAAA,EACnE;AACA,EAAA,OAAO,MAAA;AACT;AAQA,SAAS,gBAAA,CAAiB,SAAoC,YAAA,EAAkC;AAC9F,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AAW,KAAA,EAAc,oBAAK,GAAA,CAAA,QAAA,EAAA,EAAE,CAAA;AAAA,IACvD,IAAA,KAAS,yBAAY,GAAA,CAAC,GAAA,EAAA,EAAE,OAAM,2BAAA,EAA6B,QAAA,EAAA,IAAA,EAAK,oBAAO,GAAA,CAAA,QAAA,EAAA,EAAE,CAAA;AAAA,IACzE;AAAA,GAAA,EACH,CAAA;AACF;AAUO,SAAS,oBAAoB,EAAE,KAAA,EAAO,SAAA,GAAY,EAAA,EAAI,UAAS,EAA6B;AACjG,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAO,CAAA,0BAAA,EAA6B,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK,EAAG,4BAAA,EAA0B,IAAA,EAAC,YAAA,EAAY,KAAA,EAAQ,QAAA,EAAS,CAAA;AAC9H","file":"catalog.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport { ExternalLink, Moon, PanelLeftClose, PanelLeftOpen, Sun, Waypoints } from 'lucide';\n\nimport { ListHeader } from './list-header.js';\nimport { ListItem } from './list-item.js';\nimport { LucideIcon } from './lucide-icon.js';\nimport { Toolbar } from './toolbar.js';\nimport { ToolbarControlGroup } from './toolbar-control-group.js';\n\n/** A reference link shown in the detail footer for the active entry. */\nexport interface CatalogResource {\n label: string;\n href: string;\n /** Optional monospace detail (e.g. a file path) shown after the label. */\n detail?: string;\n}\n\n/** A related entry offered in the detail footer's \"Related entries\" popup menu. */\nexport interface CatalogRelated {\n id: string;\n name: string;\n /** Group heading in the menu, e.g. \"Uses\" / \"Used by\". */\n group: string;\n}\n\nexport interface CatalogEntry {\n id: string;\n name: string;\n description?: string;\n resources?: readonly CatalogResource[];\n related?: readonly CatalogRelated[];\n}\n\nexport interface CatalogSection {\n category: string;\n entries: readonly CatalogEntry[];\n}\n\n/**\n * A secondary group of sections shown below the primary sidebar sections with a\n * quieter \"ecosystem\" treatment (e.g. third-party components). Optionally\n * collapsible — the app owns `expanded` and toggles it from `wireCatalog`'s\n * `onToggleSecondary`.\n */\nexport interface CatalogSecondaryGroup {\n label: string;\n sections: readonly CatalogSection[];\n /** When true, the group's label is a disclosure toggle controlling `expanded`. */\n collapsible?: boolean;\n /** Whether the group is expanded (controlled). Ignored unless `collapsible`. */\n expanded?: boolean;\n}\n\nexport interface CatalogBrand {\n title: string;\n subtitle?: string;\n /** Logo image URL (rendered decorative). Omit for a text-only brand. */\n logoUrl?: string;\n}\n\nexport interface CatalogProps {\n brand: CatalogBrand;\n sections: readonly CatalogSection[];\n /** The controlled active entry id — the app owns this signal. */\n active: string;\n /** The rendered preview for the active entry; the app computes it from `active`. */\n content: SafeHtml;\n /** Whether the sidebar is collapsed (controlled). */\n collapsed?: boolean;\n /** Current theme; when set, a theme toggle is shown that switches to the opposite. Omit to hide it. */\n theme?: 'light' | 'dark';\n /** Extra header controls placed before the theme toggle (each a `ToolbarControlGroup`). */\n headerActions?: SafeHtml;\n /** A secondary \"ecosystem\" group of sections below the primary category groups. */\n secondarySections?: CatalogSecondaryGroup;\n /** Extra sidebar content below the category groups (and the secondary group). */\n sidebarFooter?: SafeHtml;\n /** Status line content shown at the start of the detail footer. */\n status?: SafeHtml;\n selectAction?: string;\n toggleSidebarAction?: string;\n toggleThemeAction?: string;\n /** Action fired by the secondary group's disclosure toggle (when collapsible). */\n toggleSecondaryAction?: string;\n className?: string;\n}\n\nfunction findEntry(sections: readonly CatalogSection[], id: string): CatalogEntry | undefined {\n for (const section of sections) {\n for (const entry of section.entries) if (entry.id === id) return entry;\n }\n return undefined;\n}\n\n/**\n * Render the related entries as a `wa-dropdown` popup-menu body: a heading per\n * `group` (first-seen order) followed by that group's entries, each a navigable\n * item carrying the same `selectAction` the sidebar items use, so a chosen entry\n * routes through the one `wireCatalog` select handler.\n */\nfunction relatedMenuItems(related: readonly CatalogRelated[], selectAction: string): SafeHtml[] {\n const groups: string[] = [];\n for (const entry of related) if (!groups.includes(entry.group)) groups.push(entry.group);\n const nodes: SafeHtml[] = [];\n groups.forEach((group, index) => {\n if (index > 0) nodes.push(<wa-divider></wa-divider>);\n nodes.push(<small class=\"kui-catalog__related-heading\">{group}</small>);\n for (const entry of related) {\n if (entry.group === group) nodes.push(<wa-dropdown-item data-action={selectAction} data-item-id={entry.id}>{entry.name}</wa-dropdown-item>);\n }\n });\n return nodes;\n}\n\n/**\n * A reusable component-catalog shell: a collapsible category sidebar, a titled\n * detail stage that renders the active entry's preview, and a footer with\n * reference links and a related-entry popup menu. Built entirely from public\n * `@kerfjs/ui` primitives. Controlled and stateless — the app owns the `active`,\n * `collapsed`, and `theme` signals and computes `content` from `active` in its own\n * render; wire the sidebar/collapse/theme actions with `wireCatalog`.\n */\nexport function Catalog({\n brand,\n sections,\n active,\n content,\n collapsed = false,\n theme,\n headerActions,\n secondarySections,\n sidebarFooter,\n status,\n selectAction = 'catalog-select',\n toggleSidebarAction = 'catalog-toggle-sidebar',\n toggleThemeAction = 'catalog-toggle-theme',\n toggleSecondaryAction = 'catalog-toggle-secondary',\n className = '',\n}: CatalogProps) {\n const selected = findEntry(sections, active) ?? (secondarySections ? findEntry(secondarySections.sections, active) : undefined);\n const name = selected?.name ?? '';\n const nextTheme = theme === 'dark' ? 'light' : 'dark';\n const resources = selected?.resources ?? [];\n const related = selected?.related ?? [];\n\n return <main class={`kui-catalog ${className}`.trim()} data-component=\"catalog\" data-sidebar-collapsed={String(collapsed)}>\n <aside class=\"kui-catalog__sidebar kui-pane\" aria-label={`${brand.title} catalog`}>\n <header class=\"kui-catalog__brand kui-pane__toolbar\">\n <Toolbar\n label={`${brand.title} catalog header`}\n divider={false}\n leading={<ToolbarControlGroup appearance=\"borderless\" className=\"kui-catalog__identity\">{brand.logoUrl ? <img class=\"kui-catalog__mark\" src={brand.logoUrl} alt=\"\" /> : <></>}<h1>{brand.title}</h1></ToolbarControlGroup>}\n trailing={<ToolbarControlGroup appearance=\"borderless\" single><button type=\"button\" data-action={toggleSidebarAction} aria-label={`Collapse ${brand.title} catalog`}><LucideIcon icon={PanelLeftClose} name=\"panel-left-close\" /></button></ToolbarControlGroup>}\n />\n {brand.subtitle ? <p class=\"kui-catalog__subtitle\">{brand.subtitle}</p> : <></>}\n </header>\n <nav class=\"kui-pane__content kui-content\" aria-label={`${brand.title} components`}>\n {sections.map((section) => <section class=\"kui-catalog__group\">\n <ListHeader label={section.category} />\n <div class=\"kui-catalog__items\">\n {section.entries.map((entry) => <ListItem action={selectAction} itemId={entry.id} label={entry.name} selected={active === entry.id} title={entry.description} multiline />)}\n </div>\n </section>)}\n {secondarySections ? <section class=\"kui-catalog__group kui-catalog__group--secondary\">\n <ListHeader label={secondarySections.label} toggle={secondarySections.collapsible} expanded={secondarySections.collapsible ? Boolean(secondarySections.expanded) : undefined} action={secondarySections.collapsible ? toggleSecondaryAction : undefined} />\n {!secondarySections.collapsible || secondarySections.expanded\n ? <div class=\"kui-catalog__secondary\" data-catalog-secondary>\n {secondarySections.sections.map((section) => <section class=\"kui-catalog__secondary-group\">\n <h3 class=\"kui-catalog__secondary-heading\">{section.category}</h3>\n <div class=\"kui-catalog__items\">\n {section.entries.map((entry) => <ListItem action={selectAction} itemId={entry.id} label={entry.name} selected={active === entry.id} title={entry.description} multiline />)}\n </div>\n </section>)}\n </div>\n : <></>}\n </section> : <></>}\n {sidebarFooter}\n </nav>\n </aside>\n <article class=\"kui-catalog__detail kui-pane\">\n <header class=\"kui-catalog__header kui-pane__toolbar\">\n <Toolbar\n label={`${name} header`}\n divider={false}\n leading={<>{collapsed ? <ToolbarControlGroup appearance=\"borderless\" single><button type=\"button\" data-action={toggleSidebarAction} aria-label={`Expand ${brand.title} catalog`}><LucideIcon icon={PanelLeftOpen} name=\"panel-left-open\" /></button></ToolbarControlGroup> : <></>}<ToolbarControlGroup appearance=\"borderless\" className=\"kui-catalog__title\"><h2>{name}</h2></ToolbarControlGroup></>}\n trailing={<div class=\"kui-catalog__header-actions\">{headerActions}{theme ? <ToolbarControlGroup className=\"kui-catalog__settings\" label=\"Catalog display\"><button type=\"button\" data-action={toggleThemeAction} aria-label={`Use ${nextTheme} theme`} data-theme-preview={theme}>{nextTheme === 'dark' ? <LucideIcon icon={Moon} name=\"moon\" /> : <LucideIcon icon={Sun} name=\"sun\" />}<span>{nextTheme === 'dark' ? 'Dark' : 'Light'}</span></button></ToolbarControlGroup> : <></>}</div>}\n />\n {selected?.description ? <p class=\"kui-catalog__description kui-content-item\">{selected.description}</p> : <></>}\n </header>\n <section class=\"kui-catalog__stage kui-pane__content\" aria-label={`${name} preview`}>\n <div class=\"kui-catalog__canvas\">{content}</div>\n </section>\n <footer class=\"kui-catalog__footer kui-pane__footer\">\n {status ? <div class=\"kui-catalog__status\">{status}</div> : <></>}\n <Toolbar\n label={`${name} resources`}\n divider={false}\n leading={resources.length > 0\n ? <nav class=\"kui-catalog__resources\" aria-label={`${name} resources`}><ToolbarControlGroup className=\"kui-catalog__resource-group\" label={`${name} resources`}>{resources.map((resource) => <a class=\"kui-catalog__resource\" href={resource.href} target=\"_blank\" rel=\"noopener noreferrer\" aria-label={`${name}: ${resource.label} (opens in new tab)`}><LucideIcon icon={ExternalLink} name=\"external-link\" /><span>{resource.label}</span>{resource.detail ? <code>{resource.detail}</code> : <></>}</a>)}</ToolbarControlGroup></nav>\n : <></>}\n trailing={related.length > 0\n ? <div class=\"kui-catalog__related\" data-catalog-related><ToolbarControlGroup single className=\"kui-catalog__related-group\" label=\"Related entries\"><wa-dropdown class=\"kui-catalog__related-menu\" placement=\"top-end\" data-key={`kui-catalog-related-${active}`} data-morph-skip-children><wa-button slot=\"trigger\" appearance=\"plain\" with-caret aria-label=\"Related entries\"><LucideIcon icon={Waypoints} name=\"waypoints\" /></wa-button>{relatedMenuItems(related, selectAction)}</wa-dropdown></ToolbarControlGroup></div>\n : <></>}\n />\n </footer>\n </article>\n </main>;\n}\n\n/**\n * How a {@link CatalogExample}'s content aligns its visible left edge with the\n * example's `ListHeader` label (which sits 16px in — 8px title + 8px label):\n * - `'glyph'` — a bare glyph/text specimen with no inline geometry insets the full 16px.\n * - `'inline-control'` — a control that already carries ~8px of its own inline padding insets 8px so its content lands on the same line.\n * - `'none'` — a content-item / composition that owns its geometry and already aligns; no inset (default).\n */\nexport type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';\n\nexport interface CatalogExampleProps {\n /** The example's label, shown as a `ListHeader` above the specimen. Omit for a bare specimen. */\n label?: string;\n /** Optional explanatory note between the label and the specimen. */\n note?: SafeHtml | string;\n /** Alignment inset for the specimen — see {@link CatalogExampleAlign}. Default `'none'`. */\n align?: CatalogExampleAlign;\n className?: string;\n children?: SafeHtml | readonly SafeHtml[];\n}\n\n/**\n * One labeled example in a catalog preview: a `ListHeader` label, an optional\n * note, and the specimen. `align` insets the specimen so its visible left edge\n * lines up with the label text, encoding the catalog's alignment rules as a\n * first-class prop instead of per-demo CSS. The inset is published as the\n * `--kui-catalog-example-align` custom property so a debug overlay can exclude it\n * from a specimen's measured margin.\n */\nexport function CatalogExample({ label, note, align = 'none', className = '', children }: CatalogExampleProps) {\n return <section class={`kui-catalog-example ${className}`.trim()} data-catalog-example data-align={align}>\n {label !== undefined ? <ListHeader label={label} /> : <></>}\n {note !== undefined ? <p class=\"kui-catalog-example__note\">{note}</p> : <></>}\n {children}\n </section>;\n}\n\nexport interface CatalogExampleStackProps {\n /** Accessible label for the stack region. */\n label?: string;\n className?: string;\n children?: SafeHtml | readonly SafeHtml[];\n}\n\n/** A vertically-stacked group of {@link CatalogExample}s with the catalog's example rhythm. */\nexport function CatalogExampleStack({ label, className = '', children }: CatalogExampleStackProps) {\n return <div class={`kui-catalog-example-stack ${className}`.trim()} data-catalog-example-stack aria-label={label}>{children}</div>;\n}\n"]}
1
+ {"version":3,"sources":["../src/catalog.tsx"],"names":[],"mappings":";;;;;;;;;;;AAuFA,SAAS,SAAA,CAAU,UAAqC,EAAA,EAAsC;AAC5F,EAAA,KAAA,MAAW,WAAW,QAAA,EAAU;AAC9B,IAAA,KAAA,MAAW,SAAS,OAAA,CAAQ,OAA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AE,KAAA,EAAO,IAAA,EAAM,QAAQ,MAAA,EAAQ,SAAA,GAAY,EAAA,EAAI,QAAA,EAAS,EAAwB;AAC7G,EAAA,uBAAO,IAAA,CAAC,SAAA,EAAA,EAAQ,KAAA,EAAO,CAAA,oBAAA,EAAuB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK,EAAG,sBAAA,EAAoB,IAAA,EAAC,YAAA,EAAY,KAAA,EAChG,QAAA,EAAA;AAAA,IAAA,KAAA,KAAU,MAAA,mBAAY,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAc,oBAAK,GAAA,CAAA,QAAA,EAAA,EAAE,CAAA;AAAA,IACvD,IAAA,KAAS,yBAAY,GAAA,CAAC,GAAA,EAAA,EAAE,OAAM,2BAAA,EAA6B,QAAA,EAAA,IAAA,EAAK,oBAAO,GAAA,CAAA,QAAA,EAAA,EAAE,CAAA;AAAA,IACzE;AAAA,GAAA,EACH,CAAA;AACF;AAUO,SAAS,oBAAoB,EAAE,KAAA,EAAO,SAAA,GAAY,EAAA,EAAI,UAAS,EAA6B;AACjG,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAO,CAAA,0BAAA,EAA6B,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK,EAAG,4BAAA,EAA0B,IAAA,EAAC,YAAA,EAAY,KAAA,EAAQ,QAAA,EAAS,CAAA;AAC9H","file":"catalog.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport { ExternalLink, Moon, PanelLeftClose, PanelLeftOpen, Sun, Waypoints } from 'lucide';\n\nimport { ListHeader } from './list-header.js';\nimport { ListItem } from './list-item.js';\nimport { LucideIcon } from './lucide-icon.js';\nimport { Toolbar } from './toolbar.js';\nimport { ToolbarControlGroup } from './toolbar-control-group.js';\n\n/** A reference link shown in the detail footer for the active entry. */\nexport interface CatalogResource {\n label: string;\n href: string;\n /** Optional monospace detail (e.g. a file path) shown after the label. */\n detail?: string;\n}\n\n/** A related entry offered in the detail footer's \"Related entries\" popup menu. */\nexport interface CatalogRelated {\n id: string;\n name: string;\n /** Group heading in the menu, e.g. \"Uses\" / \"Used by\". */\n group: string;\n}\n\nexport interface CatalogEntry {\n id: string;\n name: string;\n description?: string;\n resources?: readonly CatalogResource[];\n related?: readonly CatalogRelated[];\n}\n\nexport interface CatalogSection {\n category: string;\n entries: readonly CatalogEntry[];\n}\n\n/**\n * A secondary group of sections shown below the primary sidebar sections with a\n * quieter \"ecosystem\" treatment (e.g. third-party components). Optionally\n * collapsible — the app owns `expanded` and toggles it from `wireCatalog`'s\n * `onToggleSecondary`.\n */\nexport interface CatalogSecondaryGroup {\n label: string;\n sections: readonly CatalogSection[];\n /** When true, the group's label is a disclosure toggle controlling `expanded`. */\n collapsible?: boolean;\n /** Whether the group is expanded (controlled). Ignored unless `collapsible`. */\n expanded?: boolean;\n}\n\nexport interface CatalogBrand {\n title: string;\n subtitle?: string;\n /** Logo image URL (rendered decorative). Omit for a text-only brand. */\n logoUrl?: string;\n}\n\nexport interface CatalogProps {\n brand: CatalogBrand;\n sections: readonly CatalogSection[];\n /** The controlled active entry id — the app owns this signal. */\n active: string;\n /** The rendered preview for the active entry; the app computes it from `active`. */\n content: SafeHtml;\n /** Whether the sidebar is collapsed (controlled). */\n collapsed?: boolean;\n /** Current theme; when set, a theme toggle is shown that switches to the opposite. Omit to hide it. */\n theme?: 'light' | 'dark';\n /** Extra header controls placed before the theme toggle (each a `ToolbarControlGroup`). */\n headerActions?: SafeHtml;\n /** A secondary \"ecosystem\" group of sections below the primary category groups. */\n secondarySections?: CatalogSecondaryGroup;\n /** Extra sidebar content below the category groups (and the secondary group). */\n sidebarFooter?: SafeHtml;\n /** Status line content shown at the start of the detail footer. */\n status?: SafeHtml;\n selectAction?: string;\n toggleSidebarAction?: string;\n toggleThemeAction?: string;\n /** Action fired by the secondary group's disclosure toggle (when collapsible). */\n toggleSecondaryAction?: string;\n className?: string;\n}\n\nfunction findEntry(sections: readonly CatalogSection[], id: string): CatalogEntry | undefined {\n for (const section of sections) {\n for (const entry of section.entries) if (entry.id === id) return entry;\n }\n return undefined;\n}\n\n/**\n * Render the related entries as a `wa-dropdown` popup-menu body: a heading per\n * `group` (first-seen order) followed by that group's entries, each a navigable\n * item carrying the same `selectAction` the sidebar items use, so a chosen entry\n * routes through the one `wireCatalog` select handler.\n */\nfunction relatedMenuItems(related: readonly CatalogRelated[], selectAction: string): SafeHtml[] {\n const groups: string[] = [];\n for (const entry of related) if (!groups.includes(entry.group)) groups.push(entry.group);\n const nodes: SafeHtml[] = [];\n groups.forEach((group, index) => {\n if (index > 0) nodes.push(<wa-divider></wa-divider>);\n nodes.push(<small class=\"kui-catalog__related-heading\">{group}</small>);\n for (const entry of related) {\n if (entry.group === group) nodes.push(<wa-dropdown-item data-action={selectAction} data-item-id={entry.id}>{entry.name}</wa-dropdown-item>);\n }\n });\n return nodes;\n}\n\n/**\n * A reusable component-catalog shell: a collapsible category sidebar, a titled\n * detail stage that renders the active entry's preview, and a footer with\n * reference links and a related-entry popup menu. Built entirely from public\n * `@kerfjs/ui` primitives. Controlled and stateless — the app owns the `active`,\n * `collapsed`, and `theme` signals and computes `content` from `active` in its own\n * render; wire the sidebar/collapse/theme actions with `wireCatalog`.\n */\nexport function Catalog({\n brand,\n sections,\n active,\n content,\n collapsed = false,\n theme,\n headerActions,\n secondarySections,\n sidebarFooter,\n status,\n selectAction = 'catalog-select',\n toggleSidebarAction = 'catalog-toggle-sidebar',\n toggleThemeAction = 'catalog-toggle-theme',\n toggleSecondaryAction = 'catalog-toggle-secondary',\n className = '',\n}: CatalogProps) {\n const selected = findEntry(sections, active) ?? (secondarySections ? findEntry(secondarySections.sections, active) : undefined);\n const name = selected?.name ?? '';\n const nextTheme = theme === 'dark' ? 'light' : 'dark';\n const resources = selected?.resources ?? [];\n const related = selected?.related ?? [];\n\n return <main class={`kui-catalog ${className}`.trim()} data-component=\"catalog\" data-sidebar-collapsed={String(collapsed)}>\n <aside class=\"kui-catalog__sidebar kui-pane\" aria-label={`${brand.title} catalog`}>\n <header class=\"kui-catalog__brand kui-pane__toolbar\">\n <Toolbar\n label={`${brand.title} catalog header`}\n divider={false}\n leading={<ToolbarControlGroup appearance=\"borderless\" className=\"kui-catalog__identity\">{brand.logoUrl ? <img class=\"kui-catalog__mark\" src={brand.logoUrl} alt=\"\" /> : <></>}<h1>{brand.title}</h1></ToolbarControlGroup>}\n trailing={<ToolbarControlGroup appearance=\"borderless\" single><button type=\"button\" data-action={toggleSidebarAction} aria-label={`Collapse ${brand.title} catalog`}><LucideIcon icon={PanelLeftClose} name=\"panel-left-close\" /></button></ToolbarControlGroup>}\n />\n {brand.subtitle ? <p class=\"kui-catalog__subtitle\">{brand.subtitle}</p> : <></>}\n </header>\n <nav class=\"kui-pane__content kui-content\" aria-label={`${brand.title} components`}>\n {sections.map((section) => <section class=\"kui-catalog__group\">\n <ListHeader label={section.category} />\n <div class=\"kui-catalog__items\">\n {section.entries.map((entry) => <ListItem action={selectAction} itemId={entry.id} label={entry.name} selected={active === entry.id} title={entry.description} multiline />)}\n </div>\n </section>)}\n {secondarySections ? <section class=\"kui-catalog__group kui-catalog__group--secondary\">\n <ListHeader label={secondarySections.label} toggle={secondarySections.collapsible} expanded={secondarySections.collapsible ? Boolean(secondarySections.expanded) : undefined} action={secondarySections.collapsible ? toggleSecondaryAction : undefined} />\n {!secondarySections.collapsible || secondarySections.expanded\n ? <div class=\"kui-catalog__secondary\" data-catalog-secondary>\n {secondarySections.sections.map((section) => <section class=\"kui-catalog__secondary-group\">\n <h3 class=\"kui-catalog__secondary-heading\">{section.category}</h3>\n <div class=\"kui-catalog__items\">\n {section.entries.map((entry) => <ListItem action={selectAction} itemId={entry.id} label={entry.name} selected={active === entry.id} title={entry.description} multiline />)}\n </div>\n </section>)}\n </div>\n : <></>}\n </section> : <></>}\n {sidebarFooter}\n </nav>\n </aside>\n <article class=\"kui-catalog__detail kui-pane\">\n <header class=\"kui-catalog__header kui-pane__toolbar\">\n <Toolbar\n label={`${name} header`}\n divider={false}\n leading={<>{collapsed ? <ToolbarControlGroup appearance=\"borderless\" single><button type=\"button\" data-action={toggleSidebarAction} aria-label={`Expand ${brand.title} catalog`}><LucideIcon icon={PanelLeftOpen} name=\"panel-left-open\" /></button></ToolbarControlGroup> : <></>}<ToolbarControlGroup appearance=\"borderless\" className=\"kui-catalog__title\"><h2>{name}</h2></ToolbarControlGroup></>}\n trailing={<div class=\"kui-catalog__header-actions\">{headerActions}{theme ? <ToolbarControlGroup className=\"kui-catalog__settings\" label=\"Catalog display\"><button type=\"button\" data-action={toggleThemeAction} aria-label={`Use ${nextTheme} theme`} data-theme-preview={theme}>{nextTheme === 'dark' ? <LucideIcon icon={Moon} name=\"moon\" /> : <LucideIcon icon={Sun} name=\"sun\" />}<span>{nextTheme === 'dark' ? 'Dark' : 'Light'}</span></button></ToolbarControlGroup> : <></>}</div>}\n />\n {selected?.description ? <p class=\"kui-catalog__description kui-content-item\">{selected.description}</p> : <></>}\n </header>\n <section class=\"kui-catalog__stage kui-pane__content\" aria-label={`${name} preview`}>\n <div class=\"kui-catalog__canvas\">{content}</div>\n </section>\n <footer class=\"kui-catalog__footer kui-pane__footer\">\n {status ? <div class=\"kui-catalog__status\">{status}</div> : <></>}\n <Toolbar\n label={`${name} resources`}\n divider={false}\n leading={resources.length > 0\n ? <nav class=\"kui-catalog__resources\" aria-label={`${name} resources`}><ToolbarControlGroup className=\"kui-catalog__resource-group\" label={`${name} resources`}>{resources.map((resource) => <a class=\"kui-catalog__resource\" href={resource.href} target=\"_blank\" rel=\"noopener noreferrer\" aria-label={`${name}: ${resource.label} (opens in new tab)`}><LucideIcon icon={ExternalLink} name=\"external-link\" /><span>{resource.label}</span>{resource.detail ? <code>{resource.detail}</code> : <></>}</a>)}</ToolbarControlGroup></nav>\n : <></>}\n trailing={related.length > 0\n ? <div class=\"kui-catalog__related\" data-catalog-related><ToolbarControlGroup single className=\"kui-catalog__related-group\" label=\"Related entries\"><wa-dropdown class=\"kui-catalog__related-menu\" placement=\"top-end\" data-key={`kui-catalog-related-${active}`} data-morph-skip-children><wa-button slot=\"trigger\" appearance=\"plain\" with-caret><span class=\"kui-catalog__related-trigger\"><LucideIcon icon={Waypoints} name=\"waypoints\" /><span class=\"kui-catalog__related-label\">Component</span></span></wa-button>{relatedMenuItems(related, selectAction)}</wa-dropdown></ToolbarControlGroup></div>\n : <></>}\n />\n </footer>\n </article>\n </main>;\n}\n\n/**\n * How a {@link CatalogExample}'s content aligns its visible left edge with the\n * example's `ListHeader` label (which sits 16px in — 8px title + 8px label):\n * - `'glyph'` — a bare glyph/text specimen with no inline geometry insets the full 16px.\n * - `'inline-control'` — a control that already carries ~8px of its own inline padding insets 8px so its content lands on the same line.\n * - `'none'` — a content-item / composition that owns its geometry and already aligns; no inset (default).\n */\nexport type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';\n\nexport interface CatalogExampleProps {\n /** The example's label, shown as a `ListHeader` above the specimen. Omit for a bare specimen. */\n label?: string;\n /** Optional explanatory note between the label and the specimen. */\n note?: SafeHtml | string;\n /** Alignment inset for the specimen — see {@link CatalogExampleAlign}. Default `'none'`. */\n align?: CatalogExampleAlign;\n className?: string;\n children?: SafeHtml | readonly SafeHtml[];\n}\n\n/**\n * One labeled example in a catalog preview: a `ListHeader` label, an optional\n * note, and the specimen. `align` insets the specimen so its visible left edge\n * lines up with the label text, encoding the catalog's alignment rules as a\n * first-class prop instead of per-demo CSS. The inset is published as the\n * `--kui-catalog-example-align` custom property so a debug overlay can exclude it\n * from a specimen's measured margin.\n */\nexport function CatalogExample({ label, note, align = 'none', className = '', children }: CatalogExampleProps) {\n return <section class={`kui-catalog-example ${className}`.trim()} data-catalog-example data-align={align}>\n {label !== undefined ? <ListHeader label={label} /> : <></>}\n {note !== undefined ? <p class=\"kui-catalog-example__note\">{note}</p> : <></>}\n {children}\n </section>;\n}\n\nexport interface CatalogExampleStackProps {\n /** Accessible label for the stack region. */\n label?: string;\n className?: string;\n children?: SafeHtml | readonly SafeHtml[];\n}\n\n/** A vertically-stacked group of {@link CatalogExample}s with the catalog's example rhythm. */\nexport function CatalogExampleStack({ label, className = '', children }: CatalogExampleStackProps) {\n return <div class={`kui-catalog-example-stack ${className}`.trim()} data-catalog-example-stack aria-label={label}>{children}</div>;\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { DisclosureArrow } from './chunk-56RJXPHG.js';
2
1
  import { filterDataAttributes, filterControlAttributes } from './chunk-7BR3DO2A.js';
3
2
  import { Skeleton } from './chunk-B24C4A6T.js';
3
+ import { DisclosureArrow } from './chunk-56RJXPHG.js';
4
4
  import { jsx, jsxs } from 'kerfjs/jsx-runtime';
5
5
 
6
6
  var PROTECTED_ROOT_DATA_ATTRIBUTES = /* @__PURE__ */ new Set([
@@ -39,4 +39,4 @@ function ListHeader({ label, count, countLabel, badge, action, actionLabel, acti
39
39
 
40
40
  export { ListHeader };
41
41
 
42
- //# sourceMappingURL=chunk-W5EQ3HYQ.js.map
42
+ //# sourceMappingURL=chunk-5ATCDSQS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/list-header.tsx"],"names":[],"mappings":";;;;;AAMA,IAAM,8BAAA,uBAAqC,GAAA,CAAI;AAAA,EAC7C,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC,CAAA;AACD,IAAM,iCAAA,mBAAoC,IAAI,GAAA,CAAI,CAAC,aAAa,CAAC,CAAA;AA2C1D,SAAS,UAAA,CAAW,EAAE,KAAA,EAAO,KAAA,EAAO,YAAY,KAAA,EAAO,MAAA,EAAQ,WAAA,EAAa,UAAA,EAAY,cAAA,GAAiB,KAAA,EAAO,gBAAgB,QAAA,EAAU,MAAA,GAAS,KAAA,EAAO,WAAA,GAAc,KAAA,EAAO,cAAA,GAAiB,EAAC,EAAG,iBAAA,GAAoB,EAAC,EAAE,EAAoB;AACpP,EAAA,MAAM,uBAAA,GAA0B,oBAAA,CAAqB,cAAA,E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AAA,EAAM,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,OAAM,wBAAA,EAAyB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAA,EAAA,EAAG,KAAA,EAAM,wBAAA,EAAyB,YAAA,EAAY,iBAAkB,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,MAAM;AAAA,KAAA,EAAU,CAAA;AAAA,IAAO,MAAA,wBAAW,QAAA,EAAA,EAAQ,GAAG,4BAA4B,IAAA,EAAK,QAAA,EAAS,KAAA,EAAM,yBAAA,EAA0B,aAAA,EAAa,WAAA,GAAc,SAAY,MAAA,EAAQ,YAAA,EAAY,WAAA,EAAa,KAAA,EAAO,cAAA,GAAiB,cAAA,GAAiB,aAAa,QAAA,EAAU,cAAA,IAAkB,WAAA,IAAe,MAAA,EAAY,QAAA,EAAA,kBAAA,EAAmB;AAAA,GAAA,EAAU,CAAA;AACvtB","file":"chunk-W5EQ3HYQ.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport { DisclosureArrow } from './disclosure-arrow.js';\nimport { filterControlAttributes, filterDataAttributes } from './extension-attributes.js';\nimport { Skeleton } from './skeleton.js';\n\nconst PROTECTED_ROOT_DATA_ATTRIBUTES = new Set([\n 'data-component',\n 'data-action',\n 'data-has-badge',\n 'data-has-count',\n 'data-toggle',\n]);\nconst PROTECTED_TRIGGER_DATA_ATTRIBUTES = new Set(['data-action']);\n\ntype ListHeaderRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-action'?: never;\n 'data-has-badge'?: never;\n 'data-has-count'?: never;\n 'data-toggle'?: never;\n }\n>;\n\ntype ListHeaderTriggerAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-action'?: never;\n popoverTarget?: string;\n popoverTargetAction?: 'toggle' | 'show' | 'hide';\n 'aria-controls'?: string;\n 'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';\n }\n>;\n\ninterface ListHeaderBaseProps {\n label: string;\n action?: string;\n actionLabel?: string;\n actionIcon?: SafeHtml;\n actionDisabled?: boolean;\n disabledReason?: string;\n expanded?: boolean;\n toggle?: boolean;\n /** Render as an unanimated loading skeleton: keep the label and action affordance, disable interaction. */\n placeholder?: boolean;\n rootAttributes?: ListHeaderRootAttributes;\n triggerAttributes?: ListHeaderTriggerAttributes;\n}\n\ntype ListHeaderIndicatorProps =\n | { count: number; countLabel: string; badge?: never }\n | { count?: never; countLabel?: never; badge?: SafeHtml };\n\nexport type ListHeaderProps = ListHeaderBaseProps & ListHeaderIndicatorProps;\n\nexport function ListHeader({ label, count, countLabel, badge, action, actionLabel, actionIcon, actionDisabled = false, disabledReason, expanded, toggle = false, placeholder = false, rootAttributes = {}, triggerAttributes = {} }: ListHeaderProps) {\n const extensionRootAttributes = filterDataAttributes(rootAttributes, PROTECTED_ROOT_DATA_ATTRIBUTES);\n const extensionTriggerAttributes = filterControlAttributes(triggerAttributes, PROTECTED_TRIGGER_DATA_ATTRIBUTES);\n const normalizedCount = typeof count === 'number' && Number.isSafeInteger(count) && count >= 0 ? count : undefined;\n const normalizedCountLabel = normalizedCount === undefined\n ? undefined\n : typeof countLabel === 'string' && countLabel.trim() ? countLabel : String(normalizedCount);\n const renderedBadge = normalizedCount === undefined ? badge : undefined;\n const renderedActionIcon = actionIcon ?? (toggle ? <DisclosureArrow open={Boolean(expanded)} /> : undefined);\n const accessibleLabel = normalizedCount === undefined ? undefined : `${label}, ${normalizedCountLabel}`;\n const indicator = placeholder\n ? ((normalizedCount !== undefined || renderedBadge) && <span class=\"kui-list-header__badge\"><Skeleton width=\"1.75em\" /></span>)\n : normalizedCount === undefined\n ? renderedBadge && <span class=\"kui-list-header__badge\">{renderedBadge}</span>\n : <span class=\"kui-list-header__count\" aria-hidden=\"true\">{normalizedCount}</span>;\n const busy = placeholder ? ('true' as const) : undefined;\n if (toggle) {\n return <header {...extensionRootAttributes} class=\"kui-list-header\" data-component=\"list-header\" data-has-badge={String(Boolean(renderedBadge))} data-has-count={String(normalizedCount !== undefined)} data-toggle=\"true\" data-placeholder={placeholder ? 'true' : undefined} aria-busy={busy}><button {...extensionTriggerAttributes} type=\"button\" class=\"kui-list-header__title kui-list-header__toggle\" data-action={placeholder ? undefined : action} disabled={placeholder || undefined} aria-label={accessibleLabel} aria-expanded={String(Boolean(expanded))}><span class=\"kui-list-header__label\">{label}</span>{indicator}{renderedActionIcon && <span class=\"kui-list-header__action-layer\">{renderedActionIcon}</span>}</button></header>;\n }\n return <header {...extensionRootAttributes} class=\"kui-list-header\" data-component=\"list-header\" data-has-badge={String(Boolean(renderedBadge))} data-has-count={String(normalizedCount !== undefined)} data-toggle=\"false\" data-placeholder={placeholder ? 'true' : undefined} aria-busy={busy}><div class=\"kui-list-header__title\"><h2 class=\"kui-list-header__label\" aria-label={accessibleLabel}>{label}</h2>{indicator}</div>{action && <button {...extensionTriggerAttributes} type=\"button\" class=\"kui-list-header__action\" data-action={placeholder ? undefined : action} aria-label={actionLabel} title={actionDisabled ? disabledReason : actionLabel} disabled={actionDisabled || placeholder || undefined}>{renderedActionIcon}</button>}</header>;\n}\n"]}
1
+ {"version":3,"sources":["../src/list-header.tsx"],"names":[],"mappings":";;;;;AAMA,IAAM,8BAAA,uBAAqC,GAAA,CAAI;AAAA,EAC7C,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC,CAAA;AACD,IAAM,iCAAA,mBAAoC,IAAI,GAAA,CAAI,CAAC,aAAa,CAAC,CAAA;AA2C1D,SAAS,UAAA,CAAW,EAAE,KAAA,EAAO,KAAA,EAAO,YAAY,KAAA,EAAO,MAAA,EAAQ,WAAA,EAAa,UAAA,EAAY,cAAA,GAAiB,KAAA,EAAO,gBAAgB,QAAA,EAAU,MAAA,GAAS,KAAA,EAAO,WAAA,GAAc,KAAA,EAAO,cAAA,GAAiB,EAAC,EAAG,iBAAA,G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Y,OAAA,EAAQ,kBAAA,EAAkB,WAAA,GAAc,MAAA,GAAS,MAAA,EAAW,WAAA,EAAW,IAAA,EAAM,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,OAAM,wBAAA,EAAyB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAA,EAAA,EAAG,KAAA,EAAM,wBAAA,EAAyB,YAAA,EAAY,iBAAkB,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,MAAM;AAAA,KAAA,EAAU,CAAA;AAAA,IAAO,MAAA,wBAAW,QAAA,EAAA,EAAQ,GAAG,4BAA4B,IAAA,EAAK,QAAA,EAAS,KAAA,EAAM,yBAAA,EAA0B,aAAA,EAAa,WAAA,GAAc,SAAY,MAAA,EAAQ,YAAA,EAAY,WAAA,EAAa,KAAA,EAAO,cAAA,GAAiB,cAAA,GAAiB,aAAa,QAAA,EAAU,cAAA,IAAkB,WAAA,IAAe,MAAA,EAAY,QAAA,EAAA,kBAAA,EAAmB;AAAA,GAAA,EAAU,CAAA;AACvtB","file":"chunk-5ATCDSQS.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport { DisclosureArrow } from './disclosure-arrow.js';\nimport { filterControlAttributes, filterDataAttributes } from './extension-attributes.js';\nimport { Skeleton } from './skeleton.js';\n\nconst PROTECTED_ROOT_DATA_ATTRIBUTES = new Set([\n 'data-component',\n 'data-action',\n 'data-has-badge',\n 'data-has-count',\n 'data-toggle',\n]);\nconst PROTECTED_TRIGGER_DATA_ATTRIBUTES = new Set(['data-action']);\n\ntype ListHeaderRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-action'?: never;\n 'data-has-badge'?: never;\n 'data-has-count'?: never;\n 'data-toggle'?: never;\n }\n>;\n\ntype ListHeaderTriggerAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-action'?: never;\n popoverTarget?: string;\n popoverTargetAction?: 'toggle' | 'show' | 'hide';\n 'aria-controls'?: string;\n 'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';\n }\n>;\n\ninterface ListHeaderBaseProps {\n label: string;\n action?: string;\n actionLabel?: string;\n actionIcon?: SafeHtml;\n actionDisabled?: boolean;\n disabledReason?: string;\n expanded?: boolean;\n toggle?: boolean;\n /** Render as an unanimated loading skeleton: keep the label and action affordance, disable interaction. */\n placeholder?: boolean;\n rootAttributes?: ListHeaderRootAttributes;\n triggerAttributes?: ListHeaderTriggerAttributes;\n}\n\ntype ListHeaderIndicatorProps =\n | { count: number; countLabel: string; badge?: never }\n | { count?: never; countLabel?: never; badge?: SafeHtml };\n\nexport type ListHeaderProps = ListHeaderBaseProps & ListHeaderIndicatorProps;\n\nexport function ListHeader({ label, count, countLabel, badge, action, actionLabel, actionIcon, actionDisabled = false, disabledReason, expanded, toggle = false, placeholder = false, rootAttributes = {}, triggerAttributes = {} }: ListHeaderProps) {\n const extensionRootAttributes = filterDataAttributes(rootAttributes, PROTECTED_ROOT_DATA_ATTRIBUTES);\n const extensionTriggerAttributes = filterControlAttributes(triggerAttributes, PROTECTED_TRIGGER_DATA_ATTRIBUTES);\n const normalizedCount = typeof count === 'number' && Number.isSafeInteger(count) && count >= 0 ? count : undefined;\n const normalizedCountLabel = normalizedCount === undefined\n ? undefined\n : typeof countLabel === 'string' && countLabel.trim() ? countLabel : String(normalizedCount);\n const renderedBadge = normalizedCount === undefined ? badge : undefined;\n const renderedActionIcon = actionIcon ?? (toggle ? <DisclosureArrow open={Boolean(expanded)} /> : undefined);\n const accessibleLabel = normalizedCount === undefined ? undefined : `${label}, ${normalizedCountLabel}`;\n const indicator = placeholder\n ? ((normalizedCount !== undefined || renderedBadge) && <span class=\"kui-list-header__badge\"><Skeleton width=\"1.75em\" /></span>)\n : normalizedCount === undefined\n ? renderedBadge && <span class=\"kui-list-header__badge\">{renderedBadge}</span>\n : <span class=\"kui-list-header__count\" aria-hidden=\"true\">{normalizedCount}</span>;\n const busy = placeholder ? ('true' as const) : undefined;\n if (toggle) {\n return <header {...extensionRootAttributes} class=\"kui-list-header\" data-component=\"list-header\" data-has-badge={String(Boolean(renderedBadge))} data-has-count={String(normalizedCount !== undefined)} data-toggle=\"true\" data-placeholder={placeholder ? 'true' : undefined} aria-busy={busy}><button {...extensionTriggerAttributes} type=\"button\" class=\"kui-list-header__title kui-list-header__toggle\" data-action={placeholder ? undefined : action} disabled={placeholder || undefined} aria-label={accessibleLabel} aria-expanded={String(Boolean(expanded))}><span class=\"kui-list-header__label\">{label}</span>{indicator}{renderedActionIcon && <span class=\"kui-list-header__action-layer\">{renderedActionIcon}</span>}</button></header>;\n }\n return <header {...extensionRootAttributes} class=\"kui-list-header\" data-component=\"list-header\" data-has-badge={String(Boolean(renderedBadge))} data-has-count={String(normalizedCount !== undefined)} data-toggle=\"false\" data-placeholder={placeholder ? 'true' : undefined} aria-busy={busy}><div class=\"kui-list-header__title\"><h2 class=\"kui-list-header__label\" aria-label={accessibleLabel}>{label}</h2>{indicator}</div>{action && <button {...extensionTriggerAttributes} type=\"button\" class=\"kui-list-header__action\" data-action={placeholder ? undefined : action} aria-label={actionLabel} title={actionDisabled ? disabledReason : actionLabel} disabled={actionDisabled || placeholder || undefined}>{renderedActionIcon}</button>}</header>;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { jsx } from 'kerfjs/jsx-runtime';
2
+
3
+ // src/floating-toolbar.tsx
4
+ function FloatingToolbar({ children, label, position = "bottom-end", className = "" }) {
5
+ return /* @__PURE__ */ jsx("div", { class: `kui-floating-toolbar ${className}`.trim(), "data-component": "floating-toolbar", "data-position": position, role: "toolbar", "aria-label": label, children });
6
+ }
7
+
8
+ export { FloatingToolbar };
9
+
10
+ //# sourceMappingURL=chunk-5E2HVJ33.js.map