@kerfjs/ui 5.0.0-beta.126 → 5.0.0-beta.128

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 (51) hide show
  1. package/ai/component-props.json +20 -0
  2. package/ai/public-api-signatures-v1.md +7 -5
  3. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  4. package/dist/browser/editor.js +3 -1
  5. package/dist/{chunk-NR3ZO4LK.js → chunk-7U65KLDL.js} +1 -1
  6. package/dist/chunk-7U65KLDL.js.map +1 -0
  7. package/dist/chunk-BMOZSNDU.js +133 -0
  8. package/dist/chunk-BMOZSNDU.js.map +1 -0
  9. package/dist/chunk-GHV36C6I.js +94 -0
  10. package/dist/chunk-GHV36C6I.js.map +1 -0
  11. package/dist/{chunk-Z3BT2SZE.js → chunk-GQUDCWOD.js} +8 -2
  12. package/dist/chunk-GQUDCWOD.js.map +1 -0
  13. package/dist/{chunk-3SCGTP5O.js → chunk-HD7ZLISK.js} +137 -11
  14. package/dist/chunk-HD7ZLISK.js.map +1 -0
  15. package/dist/column-explorer.d.ts +1 -1
  16. package/dist/column-explorer.js +16 -138
  17. package/dist/column-explorer.js.map +1 -1
  18. package/dist/editor.js +838 -115
  19. package/dist/editor.js.map +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/list-detail-dialog.js +1 -1
  22. package/dist/styles/components/surfaces/editor-frame/editor-frame.css +8 -1
  23. package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +32 -0
  24. package/dist/styles/editor/editor.css +23 -0
  25. package/dist/styles/editor-frame.css +8 -1
  26. package/dist/styles/surface-scaffold.css +32 -0
  27. package/dist/surface-scaffold.d.ts +3 -1
  28. package/dist/surface-scaffold.js +1 -1
  29. package/dist/tree-list.d.ts +2 -2
  30. package/dist/tree-list.js +2 -2
  31. package/dist/{tree-rows-eHnnGLGM.d.ts → tree-rows-Bms5QJvG.d.ts} +3 -0
  32. package/dist/wire-column-explorer.js +1 -92
  33. package/dist/wire-column-explorer.js.map +1 -1
  34. package/dist/workbench-dialog.js +1 -1
  35. package/docs/view.md +19 -0
  36. package/package.json +4 -2
  37. package/ux-demo/recipes/app-shell.tsx +48 -141
  38. package/ux-demo/recipes/collapsible-sidebar.tsx +43 -169
  39. package/ux-demo/recipes/compact-toolbar.tsx +22 -114
  40. package/ux-demo/recipes/composer-form.tsx +14 -104
  41. package/ux-demo/recipes/list-detail-dialog.tsx +38 -84
  42. package/ux-demo/recipes/list-workspace-states.tsx +29 -152
  43. package/ux-demo/recipes/loading-inspector.tsx +30 -174
  44. package/ux-demo/recipes/media-detail.tsx +29 -146
  45. package/ux-demo/recipes/navigation-sidebar.tsx +24 -113
  46. package/ux-demo/recipes/navigation-stack.tsx +7 -43
  47. package/ux-demo/recipes/workspace-header.tsx +2 -66
  48. package/view/generate.mjs +34 -14
  49. package/dist/chunk-3SCGTP5O.js.map +0 -1
  50. package/dist/chunk-NR3ZO4LK.js.map +0 -1
  51. package/dist/chunk-Z3BT2SZE.js.map +0 -1
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ export { applySelection, isApplePlatform, selectionGesture } from './chunk-GXSX6
42
42
  export { Grid } from './chunk-FR5G77K5.js';
43
43
 
44
44
  export { ListActionRow } from './chunk-RHMY45DK.js';
45
- export { DialogSurface, PinnablePopoverSurface, PopoverDialogSurface, PopupSurface, isPopoverPinned, pinPopover, wirePinnablePopover } from './chunk-3SCGTP5O.js';
45
+ export { DialogSurface, PinnablePopoverSurface, PopoverDialogSurface, PopupSurface, isPopoverPinned, pinPopover, wirePinnablePopover } from './chunk-HD7ZLISK.js';
46
46
  export { closeDialog, openDialog } from './chunk-UQ4FRQ6M.js';
47
47
 
48
48
  export { EmptyState } from './chunk-FNJA4S6J.js';
@@ -1,5 +1,5 @@
1
1
  import { SplitView } from './chunk-E2MTHHLS.js';
2
- import { DialogSurface } from './chunk-3SCGTP5O.js';
2
+ import { DialogSurface } from './chunk-HD7ZLISK.js';
3
3
  export { closeDialog, openDialog } from './chunk-UQ4FRQ6M.js';
4
4
 
5
5
 
@@ -27,6 +27,7 @@
27
27
  }
28
28
 
29
29
  .kui-editor-frame[data-mode="source"] > .kui-editor-frame__surface {
30
+ padding: 0;
30
31
  overflow: hidden;
31
32
  }
32
33
 
@@ -40,7 +41,7 @@
40
41
  min-width: 0;
41
42
  min-height: 0;
42
43
  box-sizing: border-box;
43
- padding: 0;
44
+ padding: 1rem;
44
45
  overflow: auto;
45
46
  border: 0;
46
47
  outline: 0;
@@ -56,6 +57,12 @@
56
57
  padding: 0;
57
58
  }
58
59
 
60
+ .kui-editor-frame[data-mode="source"][data-inset="none"]
61
+ > .kui-editor-frame__surface
62
+ > textarea {
63
+ padding: 0;
64
+ }
65
+
59
66
  .kui-editor-frame[data-appearance="embedded"]:not([data-expanded="true"]) {
60
67
  width: 100%;
61
68
  height: auto;
@@ -922,6 +922,31 @@ h2.kui-dialog-surface__title {
922
922
  min-height: min(10rem, 100%);
923
923
  resize: both;
924
924
  }
925
+ .kui-pinnable-popover-surface__bottom-resize {
926
+ position: absolute;
927
+ z-index: 1;
928
+ inset-inline: 0;
929
+ inset-block-end: 0;
930
+ block-size: 0.75rem;
931
+ border: 0;
932
+ padding: 0;
933
+ background: transparent;
934
+ cursor: ns-resize;
935
+ touch-action: none;
936
+ }
937
+ .kui-pinnable-popover-surface__bottom-resize::after {
938
+ content: "";
939
+ display: block;
940
+ inline-size: 2rem;
941
+ block-size: 0.1875rem;
942
+ margin-inline: auto;
943
+ border-radius: 999px;
944
+ background: var(--kui-color-neutral-border-normal);
945
+ }
946
+ .kui-pinnable-popover-surface__bottom-resize:focus-visible {
947
+ outline: var(--kui-focus-ring);
948
+ outline-offset: -2px;
949
+ }
925
950
  .kui-pinnable-popover-surface[data-presentation="embedded"] {
926
951
  position: relative;
927
952
  inset: auto;
@@ -1053,6 +1078,7 @@ h2.kui-dialog-surface__title {
1053
1078
  > .kui-pinnable-popover-surface__body {
1054
1079
  display: flex;
1055
1080
  flex-direction: column;
1081
+ padding-block-end: 0;
1056
1082
  overflow: hidden;
1057
1083
  }
1058
1084
  .kui-pinnable-popover-surface[data-body-layout="fill-last"]
@@ -1066,6 +1092,12 @@ h2.kui-dialog-surface__title {
1066
1092
  flex: 1 1 0;
1067
1093
  min-block-size: 0;
1068
1094
  }
1095
+ .kui-pinnable-popover-surface[data-body-layout="fill-last"][data-scrolled]
1096
+ > .kui-pinnable-popover-surface__body
1097
+ > :nth-last-child(2) {
1098
+ /* The fixed row marks the start of scrolled content without shifting it. */
1099
+ box-shadow: inset 0 -1px var(--kui-color-neutral-border-normal);
1100
+ }
1069
1101
  .kui-popup-surface {
1070
1102
  display: inline-flex;
1071
1103
  }
@@ -583,3 +583,26 @@
583
583
  pointer-events: none;
584
584
  color: var(--kui-color-text-quiet);
585
585
  }
586
+
587
+ /* The explorer owns horizontal scrolling; the Library body owns the vertical
588
+ list when the tree presentation is active. */
589
+ .kui-editor__document-columns {
590
+ display: flex;
591
+ flex-direction: column;
592
+ block-size: 100%;
593
+ min-block-size: 0;
594
+ }
595
+
596
+ .kui-editor__document-location {
597
+ display: flex;
598
+ align-items: center;
599
+ gap: var(--kui-layout-item-gap, 8px);
600
+ min-block-size: 40px;
601
+ padding-inline: var(--kui-layout-inline-margin, 8px);
602
+ min-inline-size: 0;
603
+ }
604
+
605
+ .kui-editor__document-explorer {
606
+ flex: 1;
607
+ min-block-size: 0;
608
+ }
@@ -27,6 +27,7 @@
27
27
  }
28
28
 
29
29
  .kui-editor-frame[data-mode="source"] > .kui-editor-frame__surface {
30
+ padding: 0;
30
31
  overflow: hidden;
31
32
  }
32
33
 
@@ -40,7 +41,7 @@
40
41
  min-width: 0;
41
42
  min-height: 0;
42
43
  box-sizing: border-box;
43
- padding: 0;
44
+ padding: 1rem;
44
45
  overflow: auto;
45
46
  border: 0;
46
47
  outline: 0;
@@ -56,6 +57,12 @@
56
57
  padding: 0;
57
58
  }
58
59
 
60
+ .kui-editor-frame[data-mode="source"][data-inset="none"]
61
+ > .kui-editor-frame__surface
62
+ > textarea {
63
+ padding: 0;
64
+ }
65
+
59
66
  .kui-editor-frame[data-appearance="embedded"]:not([data-expanded="true"]) {
60
67
  width: 100%;
61
68
  height: auto;
@@ -922,6 +922,31 @@ h2.kui-dialog-surface__title {
922
922
  min-height: min(10rem, 100%);
923
923
  resize: both;
924
924
  }
925
+ .kui-pinnable-popover-surface__bottom-resize {
926
+ position: absolute;
927
+ z-index: 1;
928
+ inset-inline: 0;
929
+ inset-block-end: 0;
930
+ block-size: 0.75rem;
931
+ border: 0;
932
+ padding: 0;
933
+ background: transparent;
934
+ cursor: ns-resize;
935
+ touch-action: none;
936
+ }
937
+ .kui-pinnable-popover-surface__bottom-resize::after {
938
+ content: "";
939
+ display: block;
940
+ inline-size: 2rem;
941
+ block-size: 0.1875rem;
942
+ margin-inline: auto;
943
+ border-radius: 999px;
944
+ background: var(--kui-color-neutral-border-normal);
945
+ }
946
+ .kui-pinnable-popover-surface__bottom-resize:focus-visible {
947
+ outline: var(--kui-focus-ring);
948
+ outline-offset: -2px;
949
+ }
925
950
  .kui-pinnable-popover-surface[data-presentation="embedded"] {
926
951
  position: relative;
927
952
  inset: auto;
@@ -1053,6 +1078,7 @@ h2.kui-dialog-surface__title {
1053
1078
  > .kui-pinnable-popover-surface__body {
1054
1079
  display: flex;
1055
1080
  flex-direction: column;
1081
+ padding-block-end: 0;
1056
1082
  overflow: hidden;
1057
1083
  }
1058
1084
  .kui-pinnable-popover-surface[data-body-layout="fill-last"]
@@ -1066,6 +1092,12 @@ h2.kui-dialog-surface__title {
1066
1092
  flex: 1 1 0;
1067
1093
  min-block-size: 0;
1068
1094
  }
1095
+ .kui-pinnable-popover-surface[data-body-layout="fill-last"][data-scrolled]
1096
+ > .kui-pinnable-popover-surface__body
1097
+ > :nth-last-child(2) {
1098
+ /* The fixed row marks the start of scrolled content without shifting it. */
1099
+ box-shadow: inset 0 -1px var(--kui-color-neutral-border-normal);
1100
+ }
1069
1101
  .kui-popup-surface {
1070
1102
  display: inline-flex;
1071
1103
  }
@@ -142,6 +142,8 @@ interface PinnablePopoverSurfaceProps {
142
142
  * `fill-last` stacks fixed rows above one filling last child.
143
143
  */
144
144
  bodyLayout?: DialogSurfaceBodyLayout;
145
+ /** Add a bottom-edge handle that pins and resizes an overlay by drag or arrow key. */
146
+ resizeFromBottom?: boolean;
145
147
  /** The Pin toggle's accessible name (default `Pin`). */
146
148
  pinLabel?: string;
147
149
  /** The close button's accessible name (default `Close`). */
@@ -164,7 +166,7 @@ interface PinnablePopoverSurfaceProps {
164
166
  * what `onChange` reports. Use `PopoverDialogSurface` for a dialog that only
165
167
  * ever light-dismisses.
166
168
  */
167
- declare function PinnablePopoverSurface({ id, label, describedBy, children, headerActions, presentation, pinned, size, preferredWidth, height, maxHeight, viewportGutter, bodyLayout, pinLabel, closeLabel, moveDescription, rootAttributes, className, slot, }: PinnablePopoverSurfaceProps): kerfjs.SafeHtml;
169
+ declare function PinnablePopoverSurface({ id, label, describedBy, children, headerActions, presentation, pinned, size, preferredWidth, height, maxHeight, viewportGutter, bodyLayout, resizeFromBottom, pinLabel, closeLabel, moveDescription, rootAttributes, className, slot, }: PinnablePopoverSurfaceProps): kerfjs.SafeHtml;
168
170
 
169
171
  type PopupSurfaceInset = 'none' | 'compact' | 'default' | /** @deprecated Use default. */ 'standard' | /** @deprecated Use none. */ 'list-zero';
170
172
  interface PopupSurfaceProps {
@@ -1,4 +1,4 @@
1
- export { DialogSurface, PinnablePopoverSurface, PopoverDialogSurface, PopupSurface, isPopoverPinned, pinPopover, wirePinnablePopover } from './chunk-3SCGTP5O.js';
1
+ export { DialogSurface, PinnablePopoverSurface, PopoverDialogSurface, PopupSurface, isPopoverPinned, pinPopover, wirePinnablePopover } from './chunk-HD7ZLISK.js';
2
2
  export { closeDialog, openDialog, syncDialogStack, wireDialogStack } from './chunk-UQ4FRQ6M.js';
3
3
 
4
4
 
@@ -1,7 +1,7 @@
1
1
  import * as kerfjs from 'kerfjs';
2
2
  import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
3
- import { T as TreeListNode } from './tree-rows-eHnnGLGM.js';
4
- export { a as TreeListRow, i as isExpandable, m as moveTreeListNode, t as treeListPath, b as treeListRows } from './tree-rows-eHnnGLGM.js';
3
+ import { T as TreeListNode } from './tree-rows-Bms5QJvG.js';
4
+ export { a as TreeListRow, i as isExpandable, m as moveTreeListNode, t as treeListPath, b as treeListRows } from './tree-rows-Bms5QJvG.js';
5
5
  import './semantic-content-BbzjvSu9.js';
6
6
 
7
7
  interface TreeListProps {
package/dist/tree-list.js CHANGED
@@ -1,5 +1,5 @@
1
- export { TreeList } from './chunk-Z3BT2SZE.js';
2
- export { isExpandable, moveTreeListNode, treeListPath, treeListRows } from './chunk-NR3ZO4LK.js';
1
+ export { TreeList } from './chunk-GQUDCWOD.js';
2
+ export { isExpandable, moveTreeListNode, treeListPath, treeListRows } from './chunk-7U65KLDL.js';
3
3
 
4
4
 
5
5
 
@@ -1,5 +1,6 @@
1
1
  import { SafeHtml } from 'kerfjs';
2
2
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
3
+ import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
3
4
 
4
5
  /** One node of a hierarchy the application owns. */
5
6
  interface TreeListNode {
@@ -14,6 +15,8 @@ interface TreeListNode {
14
15
  readonly disabled?: boolean;
15
16
  /** Drags with `wireTreeList`'s `onMove` (KF-WXP6AB). */
16
17
  readonly draggable?: boolean;
18
+ /** Safe data attributes carried by this row in either tree presentation. */
19
+ readonly rootAttributes?: RootDataAttributes;
17
20
  /** Child nodes. An empty array is an expandable node with no children yet. */
18
21
  readonly children?: readonly TreeListNode[];
19
22
  /**
@@ -1,94 +1,3 @@
1
- import { delegate } from 'kerfjs';
2
-
3
- // src/components/collections/column-explorer/wiring/wire-column-explorer.ts
4
- var EXPLORER = '[data-component="column-explorer"]';
5
- var ROW = `${EXPLORER} .kui-list-item[data-column-explorer-level]`;
6
- var TYPEAHEAD_RESET_MS = 500;
7
- var levelOf = (row) => Number(row.dataset.columnExplorerLevel);
8
- function columnRows(from, level) {
9
- return [
10
- ...from.closest(EXPLORER).querySelectorAll(
11
- `.kui-list-item[data-column-explorer-level="${level}"]`
12
- )
13
- ];
14
- }
15
- function focusRow(row) {
16
- if (!row) return;
17
- for (const other of columnRows(row, levelOf(row)))
18
- other.tabIndex = other === row ? 0 : -1;
19
- row.focus();
20
- }
21
- function stopOf(rows) {
22
- return rows.find((row) => row.getAttribute("aria-current")) ?? rows[0];
23
- }
24
- function revealLastColumn(explorer) {
25
- const track = explorer.querySelector(".kui-column-track");
26
- track.scrollLeft = track.scrollWidth;
27
- }
28
- function wireColumnExplorer(root) {
29
- let typed = "";
30
- let typedAt = 0;
31
- const view = root.ownerDocument.defaultView;
32
- for (const explorer of root.querySelectorAll(EXPLORER))
33
- revealLastColumn(explorer);
34
- const stopChoose = delegate(root, "click", ROW, (_e, row) => {
35
- const explorer = row.closest(EXPLORER);
36
- view.requestAnimationFrame(() => revealLastColumn(explorer));
37
- });
38
- const stopKeys = delegate(root, "keydown", ROW, (event, row) => {
39
- const key = event;
40
- if (key.ctrlKey || key.metaKey || key.altKey) return;
41
- const level = levelOf(row);
42
- const rows = columnRows(row, level);
43
- const index = rows.indexOf(row);
44
- let handled = true;
45
- switch (key.key) {
46
- case "ArrowDown":
47
- focusRow(rows[index + 1]);
48
- break;
49
- case "ArrowUp":
50
- focusRow(rows[index - 1]);
51
- break;
52
- case "Home":
53
- focusRow(rows[0]);
54
- break;
55
- case "End":
56
- focusRow(rows.at(-1));
57
- break;
58
- case "ArrowRight":
59
- if (row.dataset.expandable && row.dataset.action) {
60
- if (!row.getAttribute("aria-current")) row.click();
61
- focusRow(stopOf(columnRows(row, level + 1)));
62
- }
63
- break;
64
- case "ArrowLeft":
65
- focusRow(stopOf(columnRows(row, level - 1)));
66
- break;
67
- default:
68
- handled = typeahead(key, rows, index);
69
- }
70
- if (handled) key.preventDefault();
71
- });
72
- function typeahead(key, rows, index) {
73
- if (key.key.length !== 1 || key.key === " ") return false;
74
- const now = Date.now();
75
- typed = now - typedAt > TYPEAHEAD_RESET_MS ? key.key.toLowerCase() : typed + key.key.toLowerCase();
76
- typedAt = now;
77
- const start = typed.length === 1 ? index + 1 : index;
78
- const ordered = [...rows.slice(start), ...rows.slice(0, start)];
79
- focusRow(
80
- ordered.find(
81
- (candidate) => (candidate.querySelector(".kui-list-item__primary-label")?.textContent ?? "").trim().toLowerCase().startsWith(typed)
82
- )
83
- );
84
- return true;
85
- }
86
- return () => {
87
- stopChoose();
88
- stopKeys();
89
- };
90
- }
91
-
92
- export { wireColumnExplorer };
1
+ export { wireColumnExplorer } from './chunk-GHV36C6I.js';
93
2
 
94
3
  //# sourceMappingURL=wire-column-explorer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/collections/column-explorer/wiring/wire-column-explorer.ts"],"names":[],"mappings":";;;AAKA,IAAM,QAAA,GAAW,oCAAA;AACjB,IAAM,GAAA,GAAM,GAAG,QAAQ,CAAA,2CAAA,CAAA;AACvB,IAAM,kBAAA,GAAqB,GAAA;AAE3B,IAAM,UAAU,CAAC,GAAA,KAAqB,MAAA,CAAO,GAAA,CAAI,QAAQ,mBAAmB,CAAA;AAG5E,SAAS,UAAA,CAAW,MAAmB,KAAA,EAA8B;AACnE,EAAA,OAAO;AAAA,IACL,GAAG,IAAA,CACA,OAAA,CAAQ,QAAQ,CAAA,CAChB,gBAAA;AAAA,MACC,8CAA8C,KAAK,CAAA,EAAA;AAAA;AACrD,GACJ;AACF;AAGA,SAAS,SAAS,GAAA,EAA8B;AAC9C,EAAA,IAAI,CAAC,GAAA,EAAK;AACV,EAAA,KAAA,MAAW,KAAA,IAAS,UAAA,CAAW,GAAA,EAAK,OAAA,CAAQ,GAAG,CAAC,CAAA;AAC9C,IAAA,KAAA,CAAM,QAAA,GAAW,KAAA,KAAU,GAAA,GAAM,CAAA,GAAI,EAAA;AACvC,EAAA,GAAA,CAAI,KAA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AK,OAAO,KAAA;AACpD,IAAA,MAAM,GAAA,GAAM,KAAK,GAAA,EAAI;AACrB,IAAA,KAAA,GACE,GAAA,GAAM,OAAA,GAAU,kBAAA,GACZ,GAAA,CAAI,GAAA,CAAI,aAAY,GACpB,KAAA,GAAQ,GAAA,CAAI,GAAA,CAAI,WAAA,EAAY;AAClC,IAAA,OAAA,GAAU,GAAA;AACV,IAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,MAAA,KAAW,CAAA,GAAI,QAAQ,CAAA,GAAI,KAAA;AAC/C,IAAA,MAAM,OAAA,GAAU,CAAC,GAAG,IAAA,CAAK,KAAA,CAAM,KAAK,CAAA,EAAG,GAAG,IAAA,CAAK,KAAA,CAAM,CAAA,EAAG,KAAK,CAAC,CAAA;AAC9D,IAAA,QAAA;AAAA,MACE,OAAA,CAAQ,IAAA;AAAA,QAAK,CAAC,SAAA,KAAA,CAEV,SAAA,CAAU,aAAA,CAAc,+BAA+B,CAAA,EACnD,WAAA,IAAe,EAAA,EAElB,IAAA,EAAK,CACL,WAAA,EAAY,CACZ,WAAW,KAAK;AAAA;AACrB,KACF;AACA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,MAAM;AACX,IAAA,UAAA,EAAW;AACX,IAAA,QAAA,EAAS;AAAA,EACX,CAAA;AACF","file":"wire-column-explorer.js","sourcesContent":["// KF-JY68DQ: keyboard navigation for ColumnExplorer, and bringing a newly\n// opened column into view. Choosing a row clicks it, so the application's\n// `action` handler stays the one owner of the chosen path.\nimport { delegate } from 'kerfjs';\n\nconst EXPLORER = '[data-component=\"column-explorer\"]';\nconst ROW = `${EXPLORER} .kui-list-item[data-column-explorer-level]`;\nconst TYPEAHEAD_RESET_MS = 500;\n\nconst levelOf = (row: HTMLElement) => Number(row.dataset.columnExplorerLevel);\n\n/** The rows of one column of the explorer that holds `from`. */\nfunction columnRows(from: HTMLElement, level: number): HTMLElement[] {\n return [\n ...from\n .closest(EXPLORER)!\n .querySelectorAll<HTMLElement>(\n `.kui-list-item[data-column-explorer-level=\"${level}\"]`,\n ),\n ];\n}\n\n/** Moves a column's single Tab stop to `row` and focuses it. */\nfunction focusRow(row: HTMLElement | undefined) {\n if (!row) return;\n for (const other of columnRows(row, levelOf(row)))\n other.tabIndex = other === row ? 0 : -1;\n row.focus();\n}\n\n/** The column's chosen row, or its first. */\nfunction stopOf(rows: HTMLElement[]) {\n return rows.find((row) => row.getAttribute('aria-current')) ?? rows[0];\n}\n\n/**\n * Brings the explorer's last column into view by scrolling its track to the\n * end (a paged track snaps there). Only the track scrolls, never the page.\n */\nfunction revealLastColumn(explorer: Element) {\n const track = explorer.querySelector<HTMLElement>('.kui-column-track')!;\n track.scrollLeft = track.scrollWidth;\n}\n\n/**\n * Wires every ColumnExplorer under `root`:\n * - Down and Up move within a column; Home and End go to its first and last.\n * - Right opens the focused row's column (choosing it) and moves into it;\n * Left returns to the chosen row of the column before.\n * - Enter and Space choose the row (its native button click sends `action`).\n * - Typing letters moves to the next row in the column that starts with them.\n * The deepest column starts in view, and choosing a row brings the column it\n * opens into view. Returns a disposer.\n */\nexport function wireColumnExplorer(root: HTMLElement): () => void {\n let typed = '';\n let typedAt = 0;\n const view = root.ownerDocument.defaultView!;\n for (const explorer of root.querySelectorAll(EXPLORER))\n revealLastColumn(explorer);\n\n const stopChoose = delegate<HTMLElement>(root, 'click', ROW, (_e, row) => {\n const explorer = row.closest(EXPLORER)!;\n view.requestAnimationFrame(() => revealLastColumn(explorer));\n });\n\n const stopKeys = delegate<HTMLElement>(root, 'keydown', ROW, (event, row) => {\n const key = event as KeyboardEvent;\n if (key.ctrlKey || key.metaKey || key.altKey) return;\n const level = levelOf(row);\n const rows = columnRows(row, level);\n const index = rows.indexOf(row);\n let handled = true;\n switch (key.key) {\n case 'ArrowDown':\n focusRow(rows[index + 1]);\n break;\n case 'ArrowUp':\n focusRow(rows[index - 1]);\n break;\n case 'Home':\n focusRow(rows[0]);\n break;\n case 'End':\n focusRow(rows.at(-1));\n break;\n case 'ArrowRight':\n if (row.dataset.expandable && row.dataset.action) {\n if (!row.getAttribute('aria-current')) row.click();\n focusRow(stopOf(columnRows(row, level + 1)));\n }\n break;\n case 'ArrowLeft':\n focusRow(stopOf(columnRows(row, level - 1)));\n break;\n default:\n handled = typeahead(key, rows, index);\n }\n if (handled) key.preventDefault();\n });\n\n function typeahead(\n key: KeyboardEvent,\n rows: HTMLElement[],\n index: number,\n ): boolean {\n if (key.key.length !== 1 || key.key === ' ') return false;\n const now = Date.now();\n typed =\n now - typedAt > TYPEAHEAD_RESET_MS\n ? key.key.toLowerCase()\n : typed + key.key.toLowerCase();\n typedAt = now;\n const start = typed.length === 1 ? index + 1 : index;\n const ordered = [...rows.slice(start), ...rows.slice(0, start)];\n focusRow(\n ordered.find((candidate) =>\n (\n candidate.querySelector('.kui-list-item__primary-label')\n ?.textContent ?? ''\n )\n .trim()\n .toLowerCase()\n .startsWith(typed),\n ),\n );\n return true;\n }\n\n return () => {\n stopChoose();\n stopKeys();\n };\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"wire-column-explorer.js"}
@@ -1,4 +1,4 @@
1
- import { DialogSurface } from './chunk-3SCGTP5O.js';
1
+ import { DialogSurface } from './chunk-HD7ZLISK.js';
2
2
  export { closeDialog, openDialog } from './chunk-UQ4FRQ6M.js';
3
3
 
4
4
 
package/docs/view.md CHANGED
@@ -172,6 +172,25 @@ or narrowed, an action added or removed, a slot changed, a ref removed or
172
172
  retyped. Optional inputs, widened types, and new refs are non-breaking. Your
173
173
  compiler then reports exactly the call sites a breaking change affects.
174
174
 
175
+ ### Catalog-owned views
176
+
177
+ The UX catalog uses this same path for compositions and recipes. Their editable sources live in
178
+ `ux-demo/views/`; the checked `*.view.ts` files beside them render the
179
+ component trees imported by the catalog hosts. The `headers.tsx` host keeps
180
+ `CatalogExample` framing, and the workspace recipe host keeps presentation and
181
+ command handling. The catalog's existing delegated actions handle the button
182
+ names and `data-recipe-command` values in the documents.
183
+
184
+ After editing a catalog document in the editor, run this command from `ui/` and
185
+ commit the document and generated module together:
186
+
187
+ ```sh
188
+ npm run catalog:views:generate
189
+ ```
190
+
191
+ `npm run check:catalog-views` fails when any module is missing, stale, or
192
+ hand-edited. Both `npm run check:change` and `npm run check` include that check.
193
+
175
194
  ## Rendering documents at runtime
176
195
 
177
196
  A server-driven application loads documents at runtime instead of generating
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerfjs/ui",
3
- "version": "5.0.0-beta.126",
3
+ "version": "5.0.0-beta.128",
4
4
  "description": "Accessible, composable UI primitives for kerf applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -784,6 +784,8 @@
784
784
  "lucide-aliases:sync": "node scripts/sync-lucide-aliases.mjs",
785
785
  "check:props": "node scripts/sync-component-props.mjs --check",
786
786
  "check:view-bundle": "node scripts/check-view-bundle.mjs",
787
+ "catalog:views:generate": "node view/cli.mjs generate ux-demo/views/*.kui.json",
788
+ "check:catalog-views": "node view/cli.mjs check ux-demo/views/*.kui.json",
787
789
  "composition:sync": "node scripts/sync-component-composition.mjs && node scripts/sync-component-docs.mjs",
788
790
  "check:component-integrations": "node scripts/check-component-integrations.mjs",
789
791
  "component-integrations:dry-run": "node scripts/check-component-integrations.mjs --dry-run",
@@ -826,7 +828,7 @@
826
828
  "test:e2e": "playwright test",
827
829
  "test:webawesome-latest": "npm install --no-save --no-audit --no-fund @awesome.me/webawesome@^3 && node -e \"console.log('Web Awesome', require('@awesome.me/webawesome/package.json').version)\" && vitest run tests/unit && KERF_WEBAWESOME_LATEST=1 playwright test --project=chromium",
828
830
  "bench:micro": "vitest bench --run tests/bench",
829
- "check": "npm run build && npm run check:source-organization && npm run check:catalog && npm run check:props && npm run check:view-bundle && npm run check:component-integrations && npm run check:profile && npm run check:demo-conformance && npm run check:recipes && npm run check:css-ownership && npm run check:guidance && npm run check:ai-compatibility && npm run check:ai-regressions && npm run lint && npm run typecheck && npm run test:built && npm run test:consumer-types:built && npm run check:ai-signatures && npm run demo:build:built && npm run check:design-templates && npm pack --dry-run",
831
+ "check": "npm run build && npm run check:source-organization && npm run check:catalog && npm run check:catalog-views && npm run check:props && npm run check:view-bundle && npm run check:component-integrations && npm run check:profile && npm run check:demo-conformance && npm run check:recipes && npm run check:css-ownership && npm run check:guidance && npm run check:ai-compatibility && npm run check:ai-regressions && npm run lint && npm run typecheck && npm run test:built && npm run test:consumer-types:built && npm run check:ai-signatures && npm run demo:build:built && npm run check:design-templates && npm pack --dry-run",
830
832
  "prepublishOnly": "npm run check",
831
833
  "check:design-templates": "node scripts/check-design-templates.mjs",
832
834
  "check:design-templates:drift": "node scripts/check-design-templates-drift.mjs",