@kerfjs/ui 5.0.0-beta.4 → 5.0.0-beta.7

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 (156) hide show
  1. package/README.md +9 -8
  2. package/ai/component-catalog.json +379 -174
  3. package/ai/public-api-signatures-v1.md +387 -33
  4. package/ai/skill.md +15 -7
  5. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  6. package/dist/app-tab.d.ts +3 -1
  7. package/dist/app-tab.js +2 -1
  8. package/dist/browser/app-tab.js +1 -0
  9. package/dist/browser/menu-action-row.js +1 -0
  10. package/dist/browser/menu-header.js +1 -0
  11. package/dist/browser/menu-item.js +1 -0
  12. package/dist/browser/panel-header.js +7 -0
  13. package/dist/browser/segmented-control.js +1 -0
  14. package/dist/browser/select.js +1 -0
  15. package/dist/browser/skeleton.js +3 -0
  16. package/dist/browser/state-banner.js +1 -0
  17. package/dist/browser/toolbar-text.js +1 -0
  18. package/dist/browser/value-table.js +1 -0
  19. package/dist/chunk-2RJBFNB6.js +172 -0
  20. package/dist/chunk-2RJBFNB6.js.map +1 -0
  21. package/dist/{chunk-XZXRLY5Q.js → chunk-2Z5TWHKQ.js} +7 -6
  22. package/dist/chunk-2Z5TWHKQ.js.map +1 -0
  23. package/dist/{chunk-EGHL5S4P.js → chunk-3YD6ZNRA.js} +8 -7
  24. package/dist/chunk-3YD6ZNRA.js.map +1 -0
  25. package/dist/chunk-B24C4A6T.js +22 -0
  26. package/dist/chunk-B24C4A6T.js.map +1 -0
  27. package/dist/{chunk-NPPD2A6O.js → chunk-H6URQGJI.js} +8 -6
  28. package/dist/chunk-H6URQGJI.js.map +1 -0
  29. package/dist/chunk-I7INRJO4.js +17 -0
  30. package/dist/chunk-I7INRJO4.js.map +1 -0
  31. package/dist/chunk-KJYXOTG3.js +10 -0
  32. package/dist/chunk-KJYXOTG3.js.map +1 -0
  33. package/dist/{chunk-CTQKI2XL.js → chunk-LC3YSAZC.js} +14 -3
  34. package/dist/chunk-LC3YSAZC.js.map +1 -0
  35. package/dist/chunk-N3SUXLLS.js +23 -0
  36. package/dist/chunk-N3SUXLLS.js.map +1 -0
  37. package/dist/{chunk-R6JHHBKQ.js → chunk-PONXLV5U.js} +5 -5
  38. package/dist/chunk-PONXLV5U.js.map +1 -0
  39. package/dist/chunk-TZNCCM5H.js +20 -0
  40. package/dist/chunk-TZNCCM5H.js.map +1 -0
  41. package/dist/{chunk-TRNBHPNW.js → chunk-YGN7OMLT.js} +11 -8
  42. package/dist/chunk-YGN7OMLT.js.map +1 -0
  43. package/dist/chunk-YKUUZPED.js +24 -0
  44. package/dist/chunk-YKUUZPED.js.map +1 -0
  45. package/dist/device-class.d.ts +62 -0
  46. package/dist/device-class.js +75 -0
  47. package/dist/device-class.js.map +1 -0
  48. package/dist/index.d.ts +3 -3
  49. package/dist/index.js +15 -15
  50. package/dist/menu-action-row.d.ts +3 -1
  51. package/dist/menu-action-row.js +2 -1
  52. package/dist/menu-header.d.ts +3 -1
  53. package/dist/menu-header.js +2 -1
  54. package/dist/menu-item.d.ts +3 -1
  55. package/dist/menu-item.js +2 -1
  56. package/dist/nav-stack.d.ts +38 -0
  57. package/dist/nav-stack.js +5 -0
  58. package/dist/nav-stack.js.map +1 -0
  59. package/dist/panel-header.d.ts +28 -0
  60. package/dist/panel-header.js +7 -0
  61. package/dist/panel-header.js.map +1 -0
  62. package/dist/segmented-control.d.ts +3 -1
  63. package/dist/segmented-control.js +2 -1
  64. package/dist/select.d.ts +5 -2
  65. package/dist/select.js +2 -1
  66. package/dist/skeleton.d.ts +24 -0
  67. package/dist/skeleton.js +3 -0
  68. package/dist/skeleton.js.map +1 -0
  69. package/dist/split-view.d.ts +42 -0
  70. package/dist/split-view.js +21 -0
  71. package/dist/split-view.js.map +1 -0
  72. package/dist/state-banner.d.ts +3 -1
  73. package/dist/state-banner.js +2 -1
  74. package/dist/styles/foundation.css +21 -0
  75. package/dist/styles/menu-header.css +19 -2
  76. package/dist/styles/nav-stack.css +112 -0
  77. package/dist/styles/panel-header.css +64 -0
  78. package/dist/styles/select.css +42 -0
  79. package/dist/styles/skeleton.css +31 -0
  80. package/dist/styles/split-view.css +35 -0
  81. package/dist/styles/styles.css +2 -2
  82. package/dist/styles/tab-scaffold.css +84 -0
  83. package/dist/styles/toolbar-control-group.css +52 -2
  84. package/dist/styles/toolbar-text.css +11 -0
  85. package/dist/styles/toolbar.css +9 -0
  86. package/dist/styles/workbench.css +94 -0
  87. package/dist/tab-scaffold.d.ts +30 -0
  88. package/dist/tab-scaffold.js +16 -0
  89. package/dist/tab-scaffold.js.map +1 -0
  90. package/dist/toolbar-text.d.ts +6 -2
  91. package/dist/toolbar-text.js +2 -1
  92. package/dist/value-table.d.ts +3 -1
  93. package/dist/value-table.js +2 -1
  94. package/dist/wire-nav-stack.d.ts +15 -0
  95. package/dist/wire-nav-stack.js +88 -0
  96. package/dist/wire-nav-stack.js.map +1 -0
  97. package/dist/wire-tab-scaffold.d.ts +11 -0
  98. package/dist/wire-tab-scaffold.js +16 -0
  99. package/dist/wire-tab-scaffold.js.map +1 -0
  100. package/dist/wire-token-search-fields.d.ts +46 -4
  101. package/dist/wire-token-search-fields.js +1 -1
  102. package/dist/workbench.d.ts +33 -0
  103. package/dist/workbench.js +17 -0
  104. package/dist/workbench.js.map +1 -0
  105. package/docs/accessibility.md +10 -10
  106. package/docs/app-layouts.md +57 -0
  107. package/docs/component-contract.md +46 -9
  108. package/docs/component-selection.md +57 -7
  109. package/docs/design-philosophy.md +23 -1
  110. package/docs/device-class.md +54 -0
  111. package/docs/layout.md +33 -8
  112. package/docs/nav-stack.md +47 -0
  113. package/docs/recipes.md +17 -5
  114. package/docs/split-view.md +49 -0
  115. package/docs/tab-scaffold.md +41 -0
  116. package/docs/ux-demo.md +3 -3
  117. package/docs/workbench.md +47 -0
  118. package/llms.txt +116 -43
  119. package/package.json +43 -11
  120. package/ux-demo/recipes/app-shell.tsx +3 -3
  121. package/ux-demo/recipes/composer-form.tsx +2 -2
  122. package/ux-demo/recipes/list-workspace-states.tsx +2 -2
  123. package/ux-demo/recipes/loaders.ts +2 -0
  124. package/ux-demo/recipes/master-detail-dialog.tsx +2 -2
  125. package/ux-demo/recipes/mount-recipe.ts +3 -0
  126. package/ux-demo/recipes/navigation-stack.tsx +76 -0
  127. package/ux-demo/recipes/recipes.css +19 -8
  128. package/ux-demo/recipes/workspace-header.tsx +2 -2
  129. package/dist/browser/dialog-header.js +0 -5
  130. package/dist/browser/page-header.js +0 -3
  131. package/dist/chunk-2PES33HS.js +0 -13
  132. package/dist/chunk-2PES33HS.js.map +0 -1
  133. package/dist/chunk-CTQKI2XL.js.map +0 -1
  134. package/dist/chunk-EGHL5S4P.js.map +0 -1
  135. package/dist/chunk-GY5WH7TO.js +0 -10
  136. package/dist/chunk-GY5WH7TO.js.map +0 -1
  137. package/dist/chunk-H5AGGVU5.js +0 -75
  138. package/dist/chunk-H5AGGVU5.js.map +0 -1
  139. package/dist/chunk-K3G72I6D.js +0 -24
  140. package/dist/chunk-K3G72I6D.js.map +0 -1
  141. package/dist/chunk-NPPD2A6O.js.map +0 -1
  142. package/dist/chunk-R6JHHBKQ.js.map +0 -1
  143. package/dist/chunk-S3TPM2LP.js +0 -23
  144. package/dist/chunk-S3TPM2LP.js.map +0 -1
  145. package/dist/chunk-TRNBHPNW.js.map +0 -1
  146. package/dist/chunk-VHW5YNIB.js +0 -17
  147. package/dist/chunk-VHW5YNIB.js.map +0 -1
  148. package/dist/chunk-XZXRLY5Q.js.map +0 -1
  149. package/dist/dialog-header.d.ts +0 -15
  150. package/dist/dialog-header.js +0 -5
  151. package/dist/dialog-header.js.map +0 -1
  152. package/dist/page-header.d.ts +0 -9
  153. package/dist/page-header.js +0 -3
  154. package/dist/page-header.js.map +0 -1
  155. package/dist/styles/dialog-header.css +0 -87
  156. package/dist/styles/page-header.css +0 -33
package/docs/ux-demo.md CHANGED
@@ -13,15 +13,15 @@ deterministic state, and semantic layout owners from the [recipe guide](./recipe
13
13
  - `ai/component-catalog.json` is the canonical catalog metadata. A deterministic checked-in projection supplies the demo's unique id, category, kind (`component`, `composition`, or `recipe`), source (`kerf` or `webawesome`), name, description, direct `uses` dependencies, existing documentation path, and demo-source path; first-party, recipe, and Web Awesome renderer maps are exhaustively typed against its generated id unions. Demo paths resolve to `ui/ux-demo/main.tsx`, the matching `ui/ux-demo/recipes/*.tsx` file, or `ui/ux-demo/webawesome-demos.tsx` according to the canonical entry. First-party component entries additionally derive `ui/src/<browser-subpath>.tsx` from their canonical `delivery.browserImport`.
14
14
  - Every detail footer groups compact `Demo source` and `Guidance` actions; first-party component details also expose `Component source`. Web Awesome details say `Integration guidance` to distinguish the local integration contract from the upstream component implementation. Each button retains its repository-relative path in the DOM for verification and uses a deploy-safe absolute GitHub blob URL with a contextual new-tab name; the demo does not depend on a local source server or add a package runtime export. At phone widths, the resource group and related-component selector stack as full-width rows, with any resource overflow contained locally so labels cannot overlap the selector or widen the document.
15
15
  - The master/detail shell groups first-party routes by category with production `MenuHeader` and `MenuItem` components. The 70 ecosystem components live in a separate `Web Awesome` disclosure with seven subgroups, so they remain discoverable without being presented as first-class `@kerfjs/ui` exports. Direct Web Awesome routes open the disclosure and reveal the selected row at wide sizes; narrow layouts keep the expanded list in document flow rather than introducing a competing nested scroller.
16
- - The shell itself uses `@kerfjs/ui/layout.css`: sidebars, details, previews, dialogs, and resize specimens share unpadded panes plus self-contained content items. Its sidebar identity uses the Kerf logo beside a vertically centered title, with the subtitle in its own aligned row like `DialogHeader`; the current-view heading is also a toolbar. Collapsing the catalog removes the pane completely and moves its restore action to the main toolbar's leading edge instead of leaving an icon-only rail. The selected view description remains inset below the page toolbar. The checkerboard belongs to the complete scrollable preview region rather than a nested card. A lightly separated footer keeps live status above compact source, guidance, and relationship groups. The focused `ResizableRegion` specimen stretches its surface through the available stage height and reports committed width in that shared status footer; narrow layouts retain local horizontal access when the pane is resized wider than the stage, and the split remains readable at 200% root scaling. Geometry coverage checks wide, intermediate, narrow, and 200% zoom layouts.
17
- - The composer-form recipe demonstrates one coherent visible form surface with `DialogHeader` title/summary hierarchy, fields and actions on the shared 8px control gutter, and 24px major rhythm. Its conditional error or success `StateBanner` is the only nested semantic surface. Reset synchronizes the upgraded Web Awesome fields' live value properties with their empty controlled attributes and announces `Draft reset`; browser coverage preserves behavior and verifies wide, narrow, dark, validation, success, reset, 200% zoom, and forced-colors states.
16
+ - The shell itself uses `@kerfjs/ui/layout.css`: sidebars, details, previews, dialogs, and resize specimens share unpadded panes plus self-contained content items. Its sidebar identity uses the Kerf logo beside a vertically centered title, with the subtitle in its own aligned row like `PanelHeader`; the current-view heading is also a toolbar. Collapsing the catalog removes the pane completely and moves its restore action to the main toolbar's leading edge instead of leaving an icon-only rail. The selected view description remains inset below the page toolbar. The checkerboard belongs to the complete scrollable preview region rather than a nested card. A lightly separated footer keeps live status above compact source, guidance, and relationship groups. The focused `ResizableRegion` specimen stretches its surface through the available stage height and reports committed width in that shared status footer; narrow layouts retain local horizontal access when the pane is resized wider than the stage, and the split remains readable at 200% root scaling. Geometry coverage checks wide, intermediate, narrow, and 200% zoom layouts.
17
+ - The composer-form recipe demonstrates one coherent visible form surface with `PanelHeader` title/summary hierarchy, fields and actions on the shared 8px control gutter, and 24px major rhythm. Its conditional error or success `StateBanner` is the only nested semantic surface. Reset synchronizes the upgraded Web Awesome fields' live value properties with their empty controlled attributes and announces `Draft reset`; browser coverage preserves behavior and verifies wide, narrow, dark, validation, success, reset, 200% zoom, and forced-colors states.
18
18
  - The master-detail dialog recipe places its header directly on the dialog edge while preserving the header's internal inset, gives the selected project title the complete outer-plus-inner content gutter, lets the value table fill the available detail column between the shared outer margins, and keeps record actions on one outer gutter without an extra content-item inset. Browser geometry coverage protects those relationships at wide and narrow widths.
19
19
  - Catalog-only brand marks, preview dimensions, checkerboard tiles, and the compound display-settings control retain local geometry because they are specimen chrome or intrinsic control anatomy rather than reusable application spacing roles.
20
20
  - The menu composition route demonstrates toolbar/content/footer anatomy, 24px major gaps, 8/1/8 child geometry, the full-width `MenuHeader` count-or-badge/action split, logical-end 44px action targets with 18px visuals, and 44px row/header/toolbar targets. Its one chevron is a production 18px `DisclosureArrow` inside a controlled Tools header that actually reveals and hides content; ordinary Projects navigation has no false disclosure affordance. Browser assertions cover stable naming, expanded/content transitions, visual rotation, node identity, reduced motion, RTL alignment and containment, and wide, narrow, dark, and 200% layouts. The focused MenuHeader route separately shows the shared neutral count pill for Attachments, Notes (including zero), and Duplicates plus a non-count legacy badge, full-width logical-end actions, and no disclosure without content.
21
21
  - The `DisclosureArrow` route renders the production 18px root-scaled default without a catalog-only size override. Its two native buttons independently control the default right-to-down chevron and a recognizable right-facing replacement arrow with left-to-up custom directions; both use shortest-path rotation and their names stay stable while `aria-expanded` communicates state. Browser coverage verifies the custom clockwise path, pointer and native keyboard activation, focus, narrow and 200%-zoom stacking with contained labels, consumer sizing, and the independent `.5` Web Awesome glyph scale retained by Kerf `Select`.
22
22
  - A detail with relationships renders one grouped footer selector: `Uses` links to direct dependencies and `Used by` links to reverse dependents. Choosing either navigates to that component's demo. The relationship group is absent when both sets are empty; no duplicate summary is rendered.
23
23
  - Demo-only CSS supplies only the catalog shell and stages; component appearance stays in package CSS. Decorative chrome and Web Awesome controls share the same semantic system palette instead of carrying a separate demo identity.
24
- - Scenarios use deterministic data and cover real variants, long content, disabled state, selection, progress, feedback, overlays, media, helpers, and stateful interactions. The Web Awesome theme route remains the broad system view, while individual action, form, layout, navigation, feedback, media, and helper routes provide focused specimens; MenuItem and MenuHeader demonstrate typed domain metadata, protected native button/disclosure semantics, and a native popover trigger relationship without product props; DialogHeader demonstrates its top-toolbar identity/action groups, optional subtitle row, and 24px icon inside a 34px circle; the Select route verifies that option icons survive unrelated Kerf rerenders and selected slot content follows value changes; the Animation route exposes preset, easing, duration, playback-rate, and transport controls with live lifecycle status; observer routes provide user-driven intersection, mutation, and resize events with live results; ToolbarControlGroup exposes all eight Hot Sheet 2 variants, loads the Web Awesome registrations needed by its popup specimen, and preserves the upgraded dropdown's managed light-DOM children across Kerf rerenders; the Toolbar route composes a collapsible TokenSearchField inside a group, animates between the empty iconic and complete field states, stays open while populated, and focuses the revealed editor; SegmentedControl covers toolbar, rounded-rectangle, pill, equal-width, and disabled presentations; TokenSearchField covers editable ordered chips, pointer and keyboard removal, caret-preserving controlled deletion, editing, clearing, free text, disabled state, and fixed first-line alignment while content wraps; StateBanner exposes every built-in tone plus a scoped override; TabBar demonstrates overflow, edge autoscroll, and controlled pointer/keyboard reordering.
24
+ - Scenarios use deterministic data and cover real variants, long content, disabled state, selection, progress, feedback, overlays, media, helpers, and stateful interactions. The Web Awesome theme route remains the broad system view, while individual action, form, layout, navigation, feedback, media, and helper routes provide focused specimens; MenuItem and MenuHeader demonstrate typed domain metadata, protected native button/disclosure semantics, and a native popover trigger relationship without product props; PanelHeader demonstrates its plain top-toolbar identity, extra-large title, optional subtitle row, and bordered brand-filled icon group; the Select route verifies that option icons survive unrelated Kerf rerenders and selected slot content follows value changes; the Animation route exposes preset, easing, duration, playback-rate, and transport controls with live lifecycle status; observer routes provide user-driven intersection, mutation, and resize events with live results; ToolbarControlGroup exposes all eight Hot Sheet 2 variants, loads the Web Awesome registrations needed by its popup specimen, and preserves the upgraded dropdown's managed light-DOM children across Kerf rerenders; the Toolbar route composes a collapsible TokenSearchField inside a group, animates between the empty iconic and complete field states, stays open while populated, and focuses the revealed editor; SegmentedControl covers toolbar, rounded-rectangle, pill, equal-width, and disabled presentations; TokenSearchField covers editable ordered chips, pointer and keyboard removal, caret-preserving controlled deletion, editing, clearing, free text, disabled state, and fixed first-line alignment while content wraps; StateBanner exposes every built-in tone plus a scoped override; TabBar demonstrates overflow, edge autoscroll, and controlled pointer/keyboard reordering.
25
25
  - Recipe ownership notes are hidden by default. A page-toolbar toggle reveals them as floating warning-toned notes with a folded corner, keeping instructional copy visually distinct and removable from the specimen flow.
26
26
  - Settings exercise light/dark, increased contrast, and reduced motion without changing component code. The theme action starts from the operating system's effective color scheme, always names the appearance it will switch to, and installs an explicit light or dark override when activated; contrast and reduced motion expose their independent preferences through `aria-pressed`.
27
27
  - The footer action log is an `aria-live` region, making interactions visible to both people and browser tests.
@@ -0,0 +1,47 @@
1
+ # Workbench
2
+
3
+ `@kerfjs/ui/workbench` is the Xcode-like multi-panel workspace: a collapsible
4
+ left rail, right rail, and bottom drawer around a central work area (any absent).
5
+ It generalizes the instant-width / sliding-content collapse used by the catalog
6
+ sidebar. One of the opt-in app layouts (see
7
+ [`../../docs/23-app-layouts.md`](../../docs/23-app-layouts.md)); best on
8
+ desktop-class devices.
9
+
10
+ ```ts
11
+ import { Workbench } from '@kerfjs/ui/workbench';
12
+ import '@kerfjs/ui/workbench.css';
13
+ ```
14
+
15
+ ## State lives in the app
16
+
17
+ `Workbench` is declarative and the collapse is **pure CSS** — no wire. The app
18
+ owns each panel's `collapsed` flag (usually a signal) and toggles it; the panel
19
+ animates itself.
20
+
21
+ ```tsx
22
+ const navCollapsed = signal(false);
23
+
24
+ <Workbench
25
+ id="studio"
26
+ label="Studio"
27
+ main={<Editor />}
28
+ leftRail={{ content: <Navigator />, label: 'Navigator', collapsed: navCollapsed.value, size: 280 }}
29
+ rightRail={{ content: <Inspector />, label: 'Inspector', collapsed: inspectorCollapsed.value }}
30
+ bottomDrawer={{ content: <Console />, label: 'Console', collapsed: consoleCollapsed.value }}
31
+ />;
32
+ ```
33
+
34
+ Each `WorkbenchPanel` takes `content`, an optional `collapsed`, an optional
35
+ `size` (rail width or drawer height in px, overriding the CSS default —
36
+ `--kui-workbench-rail-width` 280px, `--kui-workbench-drawer-height` 220px), and
37
+ an optional `label`.
38
+
39
+ ## How the collapse animates
40
+
41
+ Collapsing snaps the panel's flex track to zero in a single reflow (so the work
42
+ area relayouts once, not per frame) while the panel's fixed-size content slides
43
+ out via a composited `transform` — a rail slides horizontally, the drawer
44
+ vertically — clipped by the shell's overflow. It honors `prefers-reduced-motion`
45
+ (the slide collapses to instant). On smaller device classes, present the rails'
46
+ contents through a `NavStack` or overlay drawers rather than shrinking the
47
+ three-panel shell.
package/llms.txt CHANGED
@@ -1,45 +1,118 @@
1
1
  # @kerfjs/ui
2
2
 
3
- Accessible, production-backed UI primitives for kerf applications.
4
-
5
- - [Package guide](./README.md)
6
- - [AI skill](./ai/skill.md)
7
- - [Machine-readable component catalog](./ai/component-catalog.json)
8
- - [Public API signature snapshot](./ai/public-api-signatures-v1.md)
9
- - [Web Awesome JSX signature snapshot](./ai/webawesome-jsx-signatures-v1.md)
10
- - [Need-first component selection matrix](./docs/component-selection.md)
11
- - [Production composition recipes](./docs/recipes.md)
12
- - [Component contract](./docs/component-contract.md)
13
- - [Web Awesome theme contract](./docs/webawesome-theme.md)
14
- - [Accessibility and keyboard contracts](./docs/accessibility.md)
15
- - [Design philosophy](./docs/design-philosophy.md)
16
- - [Apple HIG translation](./docs/apple-hig.md)
17
- - [UX catalog](./docs/ux-demo.md)
18
-
19
- The UX catalog is a category-grouped master/detail review surface with a focused route for every public visual component plus composition demos. Its collapsible ecosystem section also lists all 70 free Web Awesome 3.12 components, each with a focused themed route. Related entries use one grouped `Uses` / `Used by` selector across both sets; the shell, display preferences, and selected component share one semantic theme.
20
-
21
- Choose from the interface need: search the catalog, reuse a semantic match, compose existing primitives, add a thin application adapter for product concerns, and use custom markup only for a genuinely different contract. The selection matrix covers every public visual/helper export and the supported-but-not-preferred Web Awesome overlaps, including required wiring, application ownership, import subpaths, alternatives, and recipe links.
22
-
23
- There is no `@kerfjs/ui` command-palette runtime export or production recipe. The typed application-local example at `docs/examples/command-palette-adapter.tsx` demonstrates how a missing concept can reuse public layout vocabulary without inventing a package API. Ranking, history, permissions, availability, focus policy, actions, and copy stay in the app; propose recurring behavior upstream.
24
-
25
- AI tools that need exhaustive retrieval should load `@kerfjs/ui/ai/component-catalog.json`. It is the canonical checked-in source for stable ids, exports, purpose, selection guidance, relationships, delivery and side effects, wiring, application ownership, variants, accessibility, public CSS hooks, catalog routes, and current documentation/recipe links. Its adjacent JSON Schema describes the format.
26
-
27
- Prefer an equivalent component prop or `--kui-*` token for customization. When composition-specific layout needs CSS, the catalog's `publicClasses` arrays are the exact supported anatomy boundary: selectors may join documented public classes, but must not reach into a component by tag, id, attribute alone, or an unlisted class.
28
-
29
- Before emitting code, load `@kerfjs/ui/ai/public-api-signatures-v1.md` for the exact declaration signatures used by the authoring corpus. It records accepted import paths, prop names, callback shapes, and disposer return types from emitted declarations rather than prose examples.
30
-
31
- Public components: `LucideIcon`, `DisclosureArrow`, `Toolbar`, `ToolbarControlGroup`, `ToolbarText`, `SegmentedControl`, `TokenSearchField`, `readTokenSearchField`, `placeTokenSearchCaret`, `wireTokenSearchFields`, `MenuItem`, `MenuActionRow`, `MenuHeader`, `ResizableRegion`, `wireResizableRegions`, `AppTab`, `TabBar`, `wireTabBars`, `reorderTabs`, `PageHeader`, `LoadingSpinner`, `Select`, `StateBanner`, `EmptyState`, `DialogHeader`, `ValueTable`, and `ValueTableRow`. `MenuItem`, `MenuActionRow`, `MenuHeader`, and `AppTab` accept typed, runtime-filtered application `data-*` metadata through `rootAttributes`; MenuActionRow `trailingActionAttributes` and MenuHeader `triggerAttributes` additionally support native popover target/action and `aria-controls`/`aria-haspopup`, while component-owned action, identity, selection, disclosure, naming, disabled, icon, and role semantics stay protected. `MenuHeader` uses the mutually exclusive `count` plus required localized `countLabel` pair for non-negative safe-integer section quantities, including zero; it renders the shared neutral pill and joins the spoken phrase to the owning heading or disclosure button. Never concatenate a count into `label` or put numeric content in the legacy non-count `badge` SafeHtml slot. In real toggle mode, omitting `actionIcon` supplies one production 18px `DisclosureArrow` driven by `expanded`; a custom icon replaces it, and the app must reveal matching content. Ordinary navigation must not borrow a disclosure chevron. `AppTab.closeIcon` and `ResizableRegion.handleIcon` replace decorative dormant glyphs without taking control ownership. `MenuItem.trailing` is dormant; use `MenuActionRow` for sibling primary/trailing native buttons, keeping its `label`, `icon`, and `trailingActionIcon` SafeHtml dormant too. `ValueTableRow` owns semantic `dt`/`dd` markup, 8px of root-scaled top and bottom padding, and an optional 24px leading icon; its separator begins 8px from the left without an icon or 40px with one and ends 8px from the right. `DisclosureArrow` is a decorative, controlled open/closed indicator with configurable directions, shortest-path rotation (counterclockwise for a 180-degree closed-to-open tie), replaceable right-oriented icon content, an 18px root-scaled default, and a scoped `--kui-disclosure-arrow-size` override; the owning control retains interaction and expanded-state semantics. `SegmentedControl` is controlled and supports toolbar, rounded-rectangle, and pill presentations with native pressed buttons in sequential Tab order. `Select` preserves icon-bearing option slots across Kerf rerenders, keys custom selected content by the controlled value, and separately keeps its intrinsic Web Awesome expand glyph at `--kui-disclosure-icon-scale: .5`. `TokenSearchField` controls tokens while keeping editable text DOM-owned between token changes, combining free text with ordered atomic filter chips while leaving query parsing and results to the application; its leading icon, first text line, clear action, and trailing slot stay aligned to one fixed row when text wraps. Its optional `collapsible` mode animates between an empty iconic action and the complete field, works standalone or inside `ToolbarControlGroup`, and keeps populated searches expanded while the app controls transient focus/open state. Call `wireTokenSearchFields` once to make Enter submit without inserting a contenteditable line break and to preserve focus plus the text-relative caret across controlled keyboard chip deletion; visual wrapping remains available. Semantic state palettes are opinionated, Web Awesome-compatible, and overridable globally, by tone, or per instance.
32
-
33
- `DialogHeader` composes a real top `Toolbar`: its borderless identity group keeps the optional 24px icon in a 34px circular background and the first title line centered against an automatic action `ToolbarControlGroup`. Pass action children directly and add a localized `actionsLabel` when that group needs a name. The optional `summary`/`summaryId` row remains below the title; the application owns modal focus, dismissal, commands, and action handling.
34
-
35
- Pane and navigation composition: import `@kerfjs/ui/layout.css` and use an unpadded `.kui-pane` with optional `.kui-pane__toolbar`, one scrolling `.kui-pane__content`, and optional `.kui-pane__footer`. Add `.kui-content` for 24px major vertical gaps. Use `.kui-content-item` for children that own 8px inline margin, 1px transparent-or-visible border, 8px padding, and 12px rounded corners; the pill modifier uses 22px. This vocabulary applies equally to sidebars, main areas, inspectors, and dialogs. A visible collapsible pane owns collapse in its own toolbar. When hidden, move restore into the adjacent main toolbar on the same logical edgeleading for an inline-start pane, trailing for inline-end—and remove the pane instead of leaving an icon-only rail.
36
-
37
- Composer form recipe: keep the form as one visible surface, use `DialogHeader` title/summary ids to label and describe it, and align field and action control edges on the shared 8px inline gutter without a second content-item padding inset. Retain 24px major rhythm. A conditional `StateBanner` is the only nested semantic surface. Do not make every form section another card. When resetting controlled upgraded Web Awesome fields, synchronize their live `value` properties as well as the rendered value attributes.
38
-
39
- Toolbar and split-item geometry: wrap every toolbar item, including dormant text, in `ToolbarControlGroup`. Groups stay 44px outside (`calc(2px + remify(42px))`) even when their border and background are transparent, with 8px between groups and inside items. `MenuHeader` fills the available inline width and separates its dormant title/count-or-badge cluster from its optional logical-end 44px action; the visible action glyph defaults to 18px through `--kui-menu-header-action-icon-size`, while disclosure mode makes the title cluster the action. `MenuActionRow` keeps primary and trailing 44px actions as sibling native buttons inside a noninteractive row. Multiline `MenuItem` and `MenuActionRow` leading icons stay centered on the first text line while later lines extend below. Do not pad pane shells or add competing wrapper insets. See `docs/layout.md`.
40
-
41
- Import visual components from explicit JavaScript subpaths. A CSS-aware browser bundler selects generated wrappers that bring in the foundation, the component CSS, and styles for reachable UI subcomponents; unrelated CSS stays out. The root barrel and `@kerfjs/ui/unstyled` are CSS-free; use `styles.css` with the root barrel only when the complete layer is intentional. Manual CSS exports remain available for custom pipelines, and application overrides follow package styles in the cascade. Direct `wa-*` JSX uses `import type {} from '@kerfjs/ui/webawesome'`, the side-effect-free declaration boundary synchronized with all 70 catalog-supported elements. `@kerfjs/ui/webawesome.css` is the optional CSS-only theme; it includes Web Awesome's base stylesheet, registers no elements, and remains overridable through public `--wa-*` tokens. CSS, its generated browser wrappers, and `@kerfjs/ui/select/register` are the declared side effects. `kerfjs` is an external peer. The Web Awesome peer is optional and needed for its components. `wireTabBars` includes proximity-based horizontal edge autoscroll during same-bar drag reordering.
42
-
43
- The Web Awesome theme renders Tooltip and Popover without pointer arrows by default. Restore them only when the anchor relationship needs the pointer, using `--wa-tooltip-arrow-size`, `--kui-wa-popover-arrow-size`, or one popover's public `--arrow-size`; `without-arrow` remains available for explicit local intent.
44
-
45
- Web Awesome catalog coverage means themed and inspectable, not preferred. 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. ResizableRegion carries Hot Sheet 2's 1px separator plus hover/focus grip. Use Tree/Tree Item, Animated Image, and Comparison only for a specific required behavior; avoid Zoomable Frame.
3
+ > Accessible, production-backed UI primitives for [kerf](https://github.com/brianwestphal/kerf)
4
+ > applications. Components are plain functions returning `SafeHtml`; the app owns
5
+ > state and wires stable `data-action` hooks once. This file orients an LLM to
6
+ > generate correct, good-looking kerf UI — it is not a catalog to browse.
7
+
8
+ ```bash
9
+ npm install kerfjs @kerfjs/ui # kerfjs is a peer; Web Awesome is an optional peer
10
+ ```
11
+
12
+ Import each component from its own subpath (`@kerfjs/ui/menu-item`, `@kerfjs/ui/toolbar`,
13
+ …); the browser build pulls that component's reachable CSS automatically, so do not
14
+ maintain a central style list. Configure JSX with `"jsxImportSource": "kerfjs"`.
15
+
16
+ ## How to build a screen (retrieval order)
17
+
18
+ 1. **Pick the component from the interface need**, not by appearance — read
19
+ [component-selection.md](./docs/component-selection.md) (the problem→component
20
+ matrix, with imports, wiring, ownership, and alternatives).
21
+ 2. **Get exact signatures before emitting code** read
22
+ [public-api-signatures-v1.md](./ai/public-api-signatures-v1.md) (real prop names,
23
+ callback shapes, disposer return types).
24
+ 3. **For exhaustive, structured facts** (ids, exports, variants, `publicClasses`,
25
+ relationships, side effects) load the
26
+ [Machine-readable component catalog](./ai/component-catalog.json) — the
27
+ canonical checked-in source; its schema is alongside it.
28
+ 4. **Apply the rules below and in** [skill.md](./ai/skill.md).
29
+
30
+ ## Core rules (do the right thing)
31
+
32
+ - **Reach for the primitive, not for CSS.** The package is built to look right
33
+ *unstyled*. Before adding `padding`, `margin`, `width`, `height`, `border`,
34
+ `background`, a wrapper card, or a decoration, check whether the component, the
35
+ pane, or the content-item already owns itit almost always does. Prefer a
36
+ component prop or a `--kui-*` token; write CSS only for genuinely new structure,
37
+ and then only join a component's documented `publicClasses` (never reach in by
38
+ tag/id/attribute or an unlisted class).
39
+ - **Never double-inset.** A `.kui-pane` has no padding; its `.kui-content` children
40
+ own the geometry (8px inline margin + 1px border + 8px padding). Do not add a
41
+ container padding on top of a content-item's own margin pick one owner. Use
42
+ `.kui-content` for 24px major vertical rhythm.
43
+ - **Trust the defaults.** Render a control at its natural size and color (a
44
+ `LucideIcon` is 24px); if it looks wrong, fix the surrounding layout, not the
45
+ control. Never force a component's width/height to size it that leaves a halo
46
+ or a stretched oval.
47
+ - **Toolbars hold only `ToolbarText` and `ToolbarControlGroup`.** Never put a bare
48
+ button, input, link, or loose markup in a `leading`/`center`/`trailing` zone.
49
+ Wrap every control — `SegmentedControl`, `Select`, a collapsible
50
+ `TokenSearchField`, Web Awesome controls — inside a `ToolbarControlGroup`. A
51
+ toolbar popup menu is a `single` `ToolbarControlGroup` around a `wa-dropdown`
52
+ (its `slot="trigger"` `wa-button` is the toolbar button, kept under
53
+ `data-morph-skip-children`).
54
+ - **`PanelHeader` is *the* panel/dialog/page heading.** A plain toolbar with an
55
+ optional bordered icon group, an extra-large `ToolbarText` title, the trailing
56
+ controls you pass, and an optional subtitle below — do not hand-build a heading
57
+ row or restyle a toolbar into one.
58
+ - **Space by the five-step scale, by relationship not by eye.** `0`
59
+ `--kui-space-none`, `4px` `--kui-space-2xs`, `8px` `--kui-space-xs` (inside a
60
+ group), `16px` `--kui-space-m`, `24px` `--kui-space-l` (between major differing
61
+ regions). 12px/32px are off-scale exceptions.
62
+ - **Panes share one child-owned geometry.** Sidebars, main areas, inspectors, and
63
+ dialogs all use an unpadded `.kui-pane` (optional `.kui-pane__toolbar`, one
64
+ scrolling `.kui-pane__content`, optional `.kui-pane__footer`). A visible pane owns
65
+ its collapse control; a hidden pane's restore moves to the adjacent main
66
+ toolbar's matching edge — no icon-only rail. Keep one scroll owner per region.
67
+ - **State and behavior live in the app.** Components take semantic `data-action`
68
+ strings and controlled values; wire them once with `delegate()`/`delegateActions()`
69
+ or the disposer-returning `wire…` helpers, and own domain copy, transport, and
70
+ policy in a thin adapter. Every element must earn its place — cut chrome, labels,
71
+ and readouts that do not help a person decide or act.
72
+ - **App state is domain/persisted; helpers own only ephemeral mechanics.** Keep
73
+ navigation stacks, tab selection and order, pane sizes, and `collapsed`/`expanded`
74
+ disclosure flags in the app — they are data or persisted layout, and the app reads
75
+ them to render. The `wire…` helpers own the *ephemeral* parts: `wireNavStack` the
76
+ push/pop animation, `wireTabBars` the overflow autoscroll and drag preview,
77
+ `wireResizableRegions` the live drag preview; they report committed changes via
78
+ callbacks. The one richer case is `wireTokenSearchFields`, which manages the
79
+ collapsible field's expand/collapse/focus by default (on, per-behavior opt-out) and
80
+ exposes the `expanded` signal on its handle — bind it in render or hand in your own
81
+ via `collapsible.signals`. Do not hand-roll open/collapse/focus that helper
82
+ provides; but do keep a plain disclosure toggle (a one-line boolean the app already
83
+ renders from) in the app.
84
+ - **Placeholder loading state, don't rebuild it.** For a value or component that is
85
+ still loading, set `placeholder` on the component (`Select`, `MenuHeader`,
86
+ `MenuItem`, `ValueTableRow`, `PanelHeader`, `SegmentedControl`, `StateBanner`,
87
+ `AppTab`, `ToolbarText`, `MenuActionRow`): it renders its real chrome with value
88
+ slots as subtle **unanimated** skeleton blocks and interactivity disabled, so a
89
+ parent composes a faithful loading view (e.g. an inspector) without hand-rebuilding
90
+ markup. Use the standalone `Skeleton` for a custom slot. Prefer it over `wa-skeleton`
91
+ (the pure-Kerf primitives avoid Web Awesome), and never animate it — use
92
+ `LoadingSpinner` for known busy activity instead.
93
+
94
+ ## Public exports
95
+
96
+ `LucideIcon`, `DisclosureArrow`, `Toolbar`, `ToolbarControlGroup`, `ToolbarText`,
97
+ `PanelHeader`, `MenuItem`, `MenuActionRow`, `MenuHeader`, `SegmentedControl`,
98
+ `Select`, `TokenSearchField` (+ `readTokenSearchField`, `placeTokenSearchCaret`,
99
+ `wireTokenSearchFields`), `AppTab`, `TabBar` (+ `wireTabBars`, `reorderTabs`),
100
+ `ResizableRegion` (+ `wireResizableRegions`), `StateBanner`, `EmptyState`,
101
+ `LoadingSpinner`, `Skeleton`, `ValueTable`, `ValueTableRow`. Whole-screen layouts (opt-in,
102
+ tree-shakeable, declarative with `wire…` helpers, each with a companion CSS import):
103
+ `NavStack`, `SplitView`, `Workbench`, `TabScaffold`, driven by `deviceClass()` from
104
+ `@kerfjs/ui/device-class`. `@kerfjs/ui/webawesome` is a type-only boundary for
105
+ `wa-*` JSX; `@kerfjs/ui/select/register` and the CSS are the declared side effects.
106
+
107
+ ## Reference
108
+
109
+ - [skill.md](./ai/skill.md): the full rule set + a common-mistakes table (the shipped AI skill).
110
+ - [design-philosophy.md](./docs/design-philosophy.md): why kerf UI is shaped this way — the decision principles behind the rules above.
111
+ - [layout.md](./docs/layout.md): the pane/content-item geometry, public roles/tokens, and the spacing scale.
112
+ - [component-contract.md](./docs/component-contract.md): what a component owns vs. what the app owns.
113
+ - [accessibility.md](./docs/accessibility.md): keyboard and ARIA contracts per component.
114
+ - [recipes.md](./docs/recipes.md): production compositions (app shell, master-detail dialog, composer form, …) as copyable references.
115
+ - [app-layouts.md](./docs/app-layouts.md): choosing `NavStack`/`SplitView`/`Workbench`/`TabScaffold` by data + interaction + device, and dialog presentation.
116
+ - [webawesome-theme.md](./docs/webawesome-theme.md): the optional Web Awesome theme; catalog coverage means themed-and-supported, not preferred (prefer the Kerf primitive when one exists).
117
+ - [component-catalog.json](./ai/component-catalog.json) + [public-api-signatures-v1.md](./ai/public-api-signatures-v1.md) + [webawesome-jsx-signatures-v1.md](./ai/webawesome-jsx-signatures-v1.md): machine-readable facts and exact signatures.
118
+ - [README.md](./README.md): package overview and the component subpath table.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerfjs/ui",
3
- "version": "5.0.0-beta.4",
3
+ "version": "5.0.0-beta.7",
4
4
  "description": "Accessible, composable UI primitives for kerf applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -88,6 +88,10 @@
88
88
  "types": "./dist/wire-resizable-regions.d.ts",
89
89
  "import": "./dist/wire-resizable-regions.js"
90
90
  },
91
+ "./device-class": {
92
+ "types": "./dist/device-class.d.ts",
93
+ "import": "./dist/device-class.js"
94
+ },
91
95
  "./app-tab": {
92
96
  "types": "./dist/app-tab.d.ts",
93
97
  "browser": "./dist/browser/app-tab.js",
@@ -102,10 +106,29 @@
102
106
  "types": "./dist/wire-tab-bars.d.ts",
103
107
  "import": "./dist/wire-tab-bars.js"
104
108
  },
105
- "./page-header": {
106
- "types": "./dist/page-header.d.ts",
107
- "browser": "./dist/browser/page-header.js",
108
- "import": "./dist/page-header.js"
109
+ "./nav-stack": {
110
+ "types": "./dist/nav-stack.d.ts",
111
+ "import": "./dist/nav-stack.js"
112
+ },
113
+ "./wire-nav-stack": {
114
+ "types": "./dist/wire-nav-stack.d.ts",
115
+ "import": "./dist/wire-nav-stack.js"
116
+ },
117
+ "./split-view": {
118
+ "types": "./dist/split-view.d.ts",
119
+ "import": "./dist/split-view.js"
120
+ },
121
+ "./workbench": {
122
+ "types": "./dist/workbench.d.ts",
123
+ "import": "./dist/workbench.js"
124
+ },
125
+ "./tab-scaffold": {
126
+ "types": "./dist/tab-scaffold.d.ts",
127
+ "import": "./dist/tab-scaffold.js"
128
+ },
129
+ "./wire-tab-scaffold": {
130
+ "types": "./dist/wire-tab-scaffold.d.ts",
131
+ "import": "./dist/wire-tab-scaffold.js"
109
132
  },
110
133
  "./loading-spinner": {
111
134
  "types": "./dist/loading-spinner.d.ts",
@@ -117,6 +140,11 @@
117
140
  "browser": "./dist/browser/select.js",
118
141
  "import": "./dist/select.js"
119
142
  },
143
+ "./skeleton": {
144
+ "types": "./dist/skeleton.d.ts",
145
+ "browser": "./dist/browser/skeleton.js",
146
+ "import": "./dist/skeleton.js"
147
+ },
120
148
  "./segmented-control": {
121
149
  "types": "./dist/segmented-control.d.ts",
122
150
  "browser": "./dist/browser/segmented-control.js",
@@ -149,10 +177,10 @@
149
177
  "browser": "./dist/browser/empty-state.js",
150
178
  "import": "./dist/empty-state.js"
151
179
  },
152
- "./dialog-header": {
153
- "types": "./dist/dialog-header.d.ts",
154
- "browser": "./dist/browser/dialog-header.js",
155
- "import": "./dist/dialog-header.js"
180
+ "./panel-header": {
181
+ "types": "./dist/panel-header.d.ts",
182
+ "browser": "./dist/browser/panel-header.js",
183
+ "import": "./dist/panel-header.js"
156
184
  },
157
185
  "./value-table": {
158
186
  "types": "./dist/value-table.d.ts",
@@ -178,14 +206,18 @@
178
206
  "./resizable-region.css": "./dist/styles/resizable-region.css",
179
207
  "./app-tab.css": "./dist/styles/app-tab.css",
180
208
  "./tab-bar.css": "./dist/styles/tab-bar.css",
181
- "./page-header.css": "./dist/styles/page-header.css",
209
+ "./nav-stack.css": "./dist/styles/nav-stack.css",
210
+ "./split-view.css": "./dist/styles/split-view.css",
211
+ "./workbench.css": "./dist/styles/workbench.css",
212
+ "./tab-scaffold.css": "./dist/styles/tab-scaffold.css",
182
213
  "./loading-spinner.css": "./dist/styles/loading-spinner.css",
183
214
  "./select.css": "./dist/styles/select.css",
215
+ "./skeleton.css": "./dist/styles/skeleton.css",
184
216
  "./segmented-control.css": "./dist/styles/segmented-control.css",
185
217
  "./token-search-field.css": "./dist/styles/token-search-field.css",
186
218
  "./state-banner.css": "./dist/styles/state-banner.css",
187
219
  "./empty-state.css": "./dist/styles/empty-state.css",
188
- "./dialog-header.css": "./dist/styles/dialog-header.css",
220
+ "./panel-header.css": "./dist/styles/panel-header.css",
189
221
  "./value-table.css": "./dist/styles/value-table.css",
190
222
  "./ai/*": "./ai/*",
191
223
  "./docs/*": "./docs/*"
@@ -4,7 +4,7 @@ import './recipes.css';
4
4
  import { LucideIcon } from '@kerfjs/ui/lucide-icon';
5
5
  import { MenuHeader } from '@kerfjs/ui/menu-header';
6
6
  import { MenuItem } from '@kerfjs/ui/menu-item';
7
- import { PageHeader } from '@kerfjs/ui/page-header';
7
+ import { PanelHeader } from '@kerfjs/ui/panel-header';
8
8
  import { ResizableRegion } from '@kerfjs/ui/resizable-region';
9
9
  import { Toolbar } from '@kerfjs/ui/toolbar';
10
10
  import { ToolbarControlGroup } from '@kerfjs/ui/toolbar-control-group';
@@ -24,8 +24,8 @@ export const createRecipe: RecipeFactory = (announce) => {
24
24
  <Toolbar label="Atlas workspace" leading={<ToolbarControlGroup appearance="borderless" single><ToolbarText text="Atlas" /></ToolbarControlGroup>} trailing={<div class="recipe-shell__toolbar-actions"><ToolbarControlGroup className="recipe-shell__responsive-controls" appearance="borderless" label="Workspace panes"><button type="button" aria-label="Show navigation" aria-controls="recipe-shell-navigation" aria-pressed={String(responsivePane.value === 'navigation')} data-action="recipe-action" data-recipe-command="show-navigation"><LucideIcon icon={Folder} name="folder" /></button><button type="button" aria-label="Show content" aria-controls="recipe-shell-content" aria-pressed={String(responsivePane.value === 'content')} data-action="recipe-action" data-recipe-command="show-content"><LucideIcon icon={Inbox} name="inbox" /></button><button type="button" aria-label="Show inspector" aria-controls="recipe-shell-inspector" aria-pressed={String(responsivePane.value === 'inspector')} data-action="recipe-action" data-recipe-command="show-inspector"><LucideIcon icon={Settings} name="settings" /></button></ToolbarControlGroup><ToolbarControlGroup appearance="borderless" label="Workspace controls"><button type="button" aria-label="Notifications" data-action="recipe-action" data-recipe-command="notify"><LucideIcon icon={Bell} name="bell" /></button><button type="button" aria-label="Settings" data-action="recipe-action" data-recipe-command="settings"><LucideIcon icon={Settings} name="settings" /></button></ToolbarControlGroup></div>} />
25
25
  <div class="recipe-shell__body">
26
26
  <div id="recipe-shell-navigation" class="recipe-shell__nav-region"><ResizableRegion id="recipe-navigation" label="Navigation" size={navigationSize.value} min={180} max={320}><aside class="recipe-shell__nav kui-pane"><MenuHeader label="Workspace" /><nav class="recipe-shell__nav-list kui-pane__content kui-content" aria-label="Workspace"><section><MenuItem action="recipe-action" itemId="inbox" label="Inbox" icon={<LucideIcon icon={Inbox} name="inbox" />} selected={selected.value === 'inbox'} /><MenuItem action="recipe-action" itemId="projects" label="Projects with a deliberately wrapping title" icon={<LucideIcon icon={Folder} name="folder" />} selected={selected.value === 'projects'} multiline /></section></nav></aside></ResizableRegion></div>
27
- <main id="recipe-shell-content" class="recipe-shell__main kui-pane"><PageHeader title={selected.value === 'inbox' ? 'Inbox triage' : 'Active projects'} action={<button class="kui-recipe__button" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="new">New task</button>} /><div class="recipe-shell__main-body kui-pane__content kui-content"><p class="kui-recipe__ownership kui-content-item">Recipe owns pane geometry and one scroll owner per pane. The app owns routing, data, pane visibility, sizes, and persistence.</p><div class="recipe-shell__cards">{['Release accessibility audit', 'Prepare tablet navigation', 'Review stale-data states', 'Confirm package boundaries'].map((title) => <article class="recipe-shell__card kui-content-item"><strong>{title}</strong><p class="kui-recipe__muted">Assigned to the interface systems team · due this week</p></article>)}</div></div></main>
28
- <div id="recipe-shell-inspector" class="recipe-shell__inspector-region"><ResizableRegion id="recipe-inspector" label="Inspector" size={inspectorSize.value} min={200} max={360} edge="start"><aside class="recipe-shell__inspector kui-pane"><PageHeader title="Inspector" /><div class="recipe-shell__inspector-body kui-pane__content kui-content"><ValueTable label="Selected task"><ValueTableRow label="Status" value="In review" /><ValueTableRow label="Owner" value="Mara Chen" /><ValueTableRow label="Priority" value="High" /></ValueTable></div></aside></ResizableRegion></div>
27
+ <main id="recipe-shell-content" class="recipe-shell__main kui-pane"><PanelHeader title={selected.value === 'inbox' ? 'Inbox triage' : 'Active projects'} titleId="recipe-shell-main-title" actions={<button class="kui-recipe__button" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="new">New task</button>} /><div class="recipe-shell__main-body kui-pane__content kui-content"><p class="kui-recipe__ownership kui-content-item">Recipe owns pane geometry and one scroll owner per pane. The app owns routing, data, pane visibility, sizes, and persistence.</p><div class="recipe-shell__cards">{['Release accessibility audit', 'Prepare tablet navigation', 'Review stale-data states', 'Confirm package boundaries'].map((title) => <article class="recipe-shell__card kui-content-item"><strong>{title}</strong><p class="kui-recipe__muted">Assigned to the interface systems team · due this week</p></article>)}</div></div></main>
28
+ <div id="recipe-shell-inspector" class="recipe-shell__inspector-region"><ResizableRegion id="recipe-inspector" label="Inspector" size={inspectorSize.value} min={200} max={360} edge="start"><aside class="recipe-shell__inspector kui-pane"><PanelHeader title="Inspector" titleId="recipe-shell-inspector-title" /><div class="recipe-shell__inspector-body kui-pane__content kui-content"><ValueTable label="Selected task"><ValueTableRow label="Status" value="In review" /><ValueTableRow label="Owner" value="Mara Chen" /><ValueTableRow label="Priority" value="High" /></ValueTable></div></aside></ResizableRegion></div>
29
29
  </div>
30
30
  </section>;
31
31
  return { render, action(command, element) { const pane = command.match(/^show-(navigation|content|inspector)$/)?.[1] as typeof responsivePane.value | undefined; if (pane) responsivePane.value = pane; const id = element.dataset.itemId; if (id) selected.value = id; announce(id ? `Opened ${id}` : pane ? `Showing ${pane}` : command === 'new' ? 'New task requested' : `${command} requested`); }, resize(id, size) { if (id === 'recipe-navigation') navigationSize.value = size; if (id === 'recipe-inspector') inspectorSize.value = size; announce(`${id} resized to ${size}px`); } };
@@ -6,7 +6,7 @@ import '@awesome.me/webawesome/dist/components/input/input.js';
6
6
  import '@awesome.me/webawesome/dist/components/textarea/textarea.js';
7
7
  import './recipes.css';
8
8
 
9
- import { DialogHeader } from '@kerfjs/ui/dialog-header';
9
+ import { PanelHeader } from '@kerfjs/ui/panel-header';
10
10
  import { Select } from '@kerfjs/ui/select';
11
11
  import { StateBanner } from '@kerfjs/ui/state-banner';
12
12
  import { signal } from 'kerfjs';
@@ -30,7 +30,7 @@ export const createRecipe: RecipeFactory = (announce) => {
30
30
  const audience = signal('team');
31
31
  const status = signal<'idle' | 'error' | 'saved'>('idle');
32
32
  const render = () => <form class="kui-recipe recipe-form kui-recipe__surface kui-content" data-recipe="recipe-composer-form" aria-labelledby="recipe-composer-title" aria-describedby="recipe-composer-summary" noValidate>
33
- <DialogHeader title="Publish workspace update" titleId="recipe-composer-title" summary="Share a concise, actionable update with collaborators." summaryId="recipe-composer-summary" />
33
+ <PanelHeader title="Publish workspace update" titleId="recipe-composer-title" summary="Share a concise, actionable update with collaborators." summaryId="recipe-composer-summary" />
34
34
  {status.value === 'error' && <StateBanner title="Add a title before publishing" detail="The update body and audience are preserved." tone="danger" urgency="alert" />}
35
35
  {status.value === 'saved' && <StateBanner title="Update published" detail="The team audience can now read it." tone="success" />}
36
36
  <div class="recipe-form__section recipe-form__fields">
@@ -3,7 +3,7 @@ import './recipes.css';
3
3
 
4
4
  import { EmptyState } from '@kerfjs/ui/empty-state';
5
5
  import { LoadingSpinner } from '@kerfjs/ui/loading-spinner';
6
- import { PageHeader } from '@kerfjs/ui/page-header';
6
+ import { PanelHeader } from '@kerfjs/ui/panel-header';
7
7
  import { StateBanner } from '@kerfjs/ui/state-banner';
8
8
  import { signal } from 'kerfjs';
9
9
 
@@ -21,6 +21,6 @@ export const createRecipe: RecipeFactory = (announce) => {
21
21
  if (state.value === 'error') return <StateBanner title="Release tasks could not be refreshed" detail="Existing filters are preserved. Try again when the connection recovers." tone="danger" urgency="alert" action={<button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="retry">Retry</button>} />;
22
22
  return <>{state.value === 'stale' && <StateBanner title="Showing saved results" detail="Refreshing in the background." tone="warning" action={<span class="kui-inline-metadata"><LoadingSpinner label="Refreshing release tasks" /><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="finish">Finish refresh</button></span>} />}{populated()}</>;
23
23
  };
24
- const render = () => <section class="kui-recipe recipe-list kui-recipe__surface kui-pane" data-recipe="recipe-list-workspace-states" data-list-state={state.value}><PageHeader title="Release tasks" action={<div class="kui-control-cluster"><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="empty">Clear</button><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="fail">Simulate failure</button><button class="kui-recipe__button" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="refresh">Refresh</button></div>} /><div class="recipe-list__body kui-pane__content kui-content">{renderBody()}<p class="kui-recipe__ownership kui-content-item">The recipe owns feedback placement and stable content. The app owns fetching, cache age, retry policy, and domain rows.</p></div></section>;
24
+ const render = () => <section class="kui-recipe recipe-list kui-recipe__surface kui-pane" data-recipe="recipe-list-workspace-states" data-list-state={state.value}><PanelHeader title="Release tasks" titleId="recipe-list-title" actions={<div class="kui-control-cluster"><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="empty">Clear</button><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="fail">Simulate failure</button><button class="kui-recipe__button" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="refresh">Refresh</button></div>} /><div class="recipe-list__body kui-pane__content kui-content">{renderBody()}<p class="kui-recipe__ownership kui-content-item">The recipe owns feedback placement and stable content. The app owns fetching, cache age, retry policy, and domain rows.</p></div></section>;
25
25
  return { render, action(command) { const next: Record<string, ListState> = { load: 'populated', empty: 'empty', create: 'populated', fail: 'error', retry: 'populated', refresh: 'stale', finish: 'populated' }; if (command in next) state.value = next[command]!; announce(`List state: ${state.value}`); } };
26
26
  };
@@ -8,6 +8,7 @@ export const recipeIds = [
8
8
  'recipe-composer-form',
9
9
  'recipe-list-workspace-states',
10
10
  'recipe-compact-toolbar',
11
+ 'recipe-navigation-stack',
11
12
  ] as const;
12
13
 
13
14
  export type RecipeId = typeof recipeIds[number];
@@ -20,6 +21,7 @@ export const recipeLoaders: Record<RecipeId, () => Promise<{ createRecipe: Recip
20
21
  'recipe-composer-form': () => import('./composer-form.js'),
21
22
  'recipe-list-workspace-states': () => import('./list-workspace-states.js'),
22
23
  'recipe-compact-toolbar': () => import('./compact-toolbar.js'),
24
+ 'recipe-navigation-stack': () => import('./navigation-stack.js'),
23
25
  };
24
26
 
25
27
  export function isRecipeId(value: string): value is RecipeId {
@@ -4,10 +4,10 @@ import '@awesome.me/webawesome/dist/components/button/button.js';
4
4
  import '@awesome.me/webawesome/dist/components/dialog/dialog.js';
5
5
  import './recipes.css';
6
6
 
7
- import { DialogHeader } from '@kerfjs/ui/dialog-header';
8
7
  import { LucideIcon } from '@kerfjs/ui/lucide-icon';
9
8
  import { MenuHeader } from '@kerfjs/ui/menu-header';
10
9
  import { MenuItem } from '@kerfjs/ui/menu-item';
10
+ import { PanelHeader } from '@kerfjs/ui/panel-header';
11
11
  import { ValueTable, ValueTableRow } from '@kerfjs/ui/value-table';
12
12
  import { signal } from 'kerfjs';
13
13
  import { FileText } from 'lucide';
@@ -27,7 +27,7 @@ interface RecipeDialogElement extends HTMLElement {
27
27
  export const createRecipe: RecipeFactory = (announce) => {
28
28
  const selected = signal<keyof typeof records>('alpha');
29
29
  const open = { value: false };
30
- const render = () => <section class="kui-recipe kui-content" data-recipe="recipe-master-detail-dialog"><button class="kui-recipe__button kui-content-item" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="open">Open project details</button><p class="kui-recipe__ownership kui-content-item">Web Awesome owns modal focus and dismissal. The recipe owns header/body/master-detail anatomy; the app owns open state, selection, and policy.</p><wa-dialog class="recipe-dialog" label="Project details" without-header open={open.value}><div class="recipe-dialog__pane kui-pane"><DialogHeader title="Project details" titleId="recipe-dialog-title" summary="Compare delivery state without leaving the workspace." summaryId="recipe-dialog-summary" icon={<LucideIcon icon={FileText} name="file-text" />} actions={<wa-button appearance="plain" data-action="recipe-action" data-recipe-command="close">Close</wa-button>} actionsLabel="Project detail actions" /><div class="recipe-master-detail kui-pane__content"><nav class="recipe-master-detail__master kui-pane" aria-label="Projects"><MenuHeader label="Recent projects" /><div class="kui-pane__content kui-content"><section>{Object.entries(records).map(([id, record]) => <MenuItem action="recipe-action" itemId={id} label={record.name} selected={selected.value === id} multiline />)}</section></div></nav><section class="recipe-master-detail__detail kui-content" aria-live="polite"><h3 class="recipe-master-detail__title kui-recipe__pane-title kui-content-item">{records[selected.value].name}</h3><ValueTable label="Project details"><ValueTableRow label="Owner" value={records[selected.value].owner} /><ValueTableRow label="Status" value={records[selected.value].state} /><ValueTableRow label="Updated" value={records[selected.value].updated} /></ValueTable><div class="recipe-master-detail__actions kui-control-cluster"><wa-button appearance="outlined" data-action="recipe-action" data-recipe-command="archive">Archive</wa-button><wa-button variant="brand" appearance="accent" data-action="recipe-action" data-recipe-command="open-record">Open project</wa-button></div></section></div></div></wa-dialog></section>;
30
+ const render = () => <section class="kui-recipe kui-content" data-recipe="recipe-master-detail-dialog"><button class="kui-recipe__button kui-content-item" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="open">Open project details</button><p class="kui-recipe__ownership kui-content-item">Web Awesome owns modal focus and dismissal. The recipe owns header/body/master-detail anatomy; the app owns open state, selection, and policy.</p><wa-dialog class="recipe-dialog" label="Project details" without-header open={open.value}><div class="recipe-dialog__pane kui-pane"><PanelHeader title="Project details" titleId="recipe-dialog-title" summary="Compare delivery state without leaving the workspace." summaryId="recipe-dialog-summary" icon={<LucideIcon icon={FileText} name="file-text" />} actions={<wa-button appearance="plain" data-action="recipe-action" data-recipe-command="close">Close</wa-button>} /><div class="recipe-master-detail kui-pane__content"><nav class="recipe-master-detail__master kui-pane" aria-label="Projects"><MenuHeader label="Recent projects" /><div class="kui-pane__content kui-content"><section>{Object.entries(records).map(([id, record]) => <MenuItem action="recipe-action" itemId={id} label={record.name} selected={selected.value === id} multiline />)}</section></div></nav><section class="recipe-master-detail__detail kui-content" aria-live="polite"><h3 class="recipe-master-detail__title kui-recipe__pane-title kui-content-item">{records[selected.value].name}</h3><ValueTable label="Project details"><ValueTableRow label="Owner" value={records[selected.value].owner} /><ValueTableRow label="Status" value={records[selected.value].state} /><ValueTableRow label="Updated" value={records[selected.value].updated} /></ValueTable><div class="recipe-master-detail__actions kui-control-cluster"><wa-button appearance="outlined" data-action="recipe-action" data-recipe-command="archive">Archive</wa-button><wa-button variant="brand" appearance="accent" data-action="recipe-action" data-recipe-command="open-record">Open project</wa-button></div></section></div></div></wa-dialog></section>;
31
31
  return {
32
32
  render,
33
33
  action(command, element) {
@@ -1,3 +1,4 @@
1
+ import { wireNavStack } from '@kerfjs/ui/wire-nav-stack';
1
2
  import { wireResizableRegions } from '@kerfjs/ui/wire-resizable-regions';
2
3
  import { delegate, mount } from 'kerfjs';
3
4
  import { delegateActions } from 'kerfjs/actions';
@@ -23,11 +24,13 @@ export function mountRecipe(root: HTMLElement, controller: RecipeController): ()
23
24
  const stopResize = wireResizableRegions(root, {
24
25
  onCommit: ({ id, size }) => controller.resize?.(id, size),
25
26
  });
27
+ const stopNav = wireNavStack(root, { onBack: () => controller.action('nav-back', root) });
26
28
 
27
29
  let disposed = false;
28
30
  return () => {
29
31
  if (disposed) return;
30
32
  disposed = true;
33
+ stopNav();
31
34
  stopResize();
32
35
  stopDialogs();
33
36
  stopInputs();
@@ -0,0 +1,76 @@
1
+ import '@kerfjs/ui/layout.css';
2
+ import '@kerfjs/ui/nav-stack.css';
3
+ import '@kerfjs/ui/toolbar-text.css';
4
+ import './recipes.css';
5
+
6
+ import { LucideIcon } from '@kerfjs/ui/lucide-icon';
7
+ import { MenuHeader } from '@kerfjs/ui/menu-header';
8
+ import { MenuItem } from '@kerfjs/ui/menu-item';
9
+ import { NavStack, type NavStackView } from '@kerfjs/ui/nav-stack';
10
+ import { signal } from 'kerfjs';
11
+ import { ChevronRight, FileText, Folder } from 'lucide';
12
+
13
+ import type { RecipeFactory } from './types.js';
14
+
15
+ interface LibraryItem {
16
+ id: string;
17
+ label: string;
18
+ detail: string;
19
+ }
20
+
21
+ const ITEMS: LibraryItem[] = [
22
+ { id: 'tokens', label: 'Design tokens', detail: 'Semantic color, spacing, and radius scales shared across every surface.' },
23
+ { id: 'controls', label: 'Toolbar controls', detail: 'Control groups and segmented controls with their hover and pressed contracts.' },
24
+ { id: 'layouts', label: 'App layouts', detail: 'Navigation stacks, split views, workbench, and bottom-tab scaffolds.' },
25
+ ];
26
+
27
+ export const createRecipe: RecipeFactory = (announce) => {
28
+ const listView = (): NavStackView => ({
29
+ key: 'library',
30
+ title: 'Library',
31
+ content: <div class="recipe-navstack__view kui-pane__content kui-content">
32
+ <section>
33
+ <MenuHeader label="Components" />
34
+ {ITEMS.map((item) => <MenuItem action="recipe-action" itemId={item.id} label={item.label} icon={<LucideIcon icon={Folder} name="folder" />} trailing={<LucideIcon icon={ChevronRight} name="chevron-right" />} />)}
35
+ </section>
36
+ <p class="kui-recipe__ownership kui-content-item">The recipe owns the stack as a signal of views and pushes/pops it; `NavStack` renders the stack and `wireNavStack` slides the content and settles the chrome. The app owns selection, data, and routing.</p>
37
+ </div>,
38
+ });
39
+
40
+ const detailView = (item: LibraryItem): NavStackView => ({
41
+ key: item.id,
42
+ title: item.label,
43
+ content: <div class="recipe-navstack__view kui-pane__content kui-content">
44
+ <div class="kui-content-item">
45
+ <LucideIcon icon={FileText} name="file-text" />
46
+ <strong>{item.label}</strong>
47
+ <p class="kui-recipe__muted">{item.detail}</p>
48
+ </div>
49
+ </div>,
50
+ });
51
+
52
+ const views = signal<NavStackView[]>([listView()]);
53
+
54
+ const render = () => <section class="kui-recipe recipe-navstack kui-recipe__surface" data-recipe="recipe-navigation-stack">
55
+ <div class="recipe-navstack__stage"><NavStack id="recipe-nav" label="Component library" views={views.value} /></div>
56
+ </section>;
57
+
58
+ return {
59
+ render,
60
+ action(command, element) {
61
+ if (command === 'nav-back') {
62
+ if (views.value.length > 1) {
63
+ views.value = views.value.slice(0, -1);
64
+ announce('Navigated back');
65
+ }
66
+ return;
67
+ }
68
+ const id = element.dataset.itemId;
69
+ const item = ITEMS.find((candidate) => candidate.id === id);
70
+ if (item) {
71
+ views.value = [...views.value, detailView(item)];
72
+ announce(`Opened ${item.label}`);
73
+ }
74
+ },
75
+ };
76
+ };