@kerfjs/ui 5.0.0-beta.125 → 5.0.0-beta.127
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.
- package/README.md +5 -0
- package/ai/application-ui-diagnostic-ids-v1.json +1 -0
- package/ai/component-catalog.json +77 -6
- package/ai/component-catalog.schema.json +14 -1
- package/ai/component-composition.json +27 -6
- package/ai/component-props.json +265 -40
- package/ai/components/combobox.md +1 -1
- package/ai/components/surface-scaffold.md +19 -5
- package/ai/components/tab-bar.md +2 -0
- package/ai/components/toolbar.md +1 -0
- package/ai/public-api-signatures-v1.md +251 -298
- package/ai/skill.md +10 -4
- package/ai/view-document.schema.json +55 -2
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/analyzer/cli.mjs +60 -24
- package/analyzer/index.mjs +331 -58
- package/catalog-projection-cli.mjs +86 -50
- package/dist/anchored-surface.js +2 -1
- package/dist/browser/editor.js +12 -7
- package/dist/catalog-resources.d.ts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +6 -6
- package/dist/{chunk-VX3YF2UD.js → chunk-3K5V3ZSD.js} +3 -3
- package/dist/{chunk-VX3YF2UD.js.map → chunk-3K5V3ZSD.js.map} +1 -1
- package/dist/{chunk-NHQOX7T4.js → chunk-3ZKUXWAV.js} +4 -4
- package/dist/chunk-3ZKUXWAV.js.map +1 -0
- package/dist/{chunk-ADMWT7FX.js → chunk-3ZWYGGEC.js} +136 -8
- package/dist/chunk-3ZWYGGEC.js.map +1 -0
- package/dist/{chunk-KLR3DCHH.js → chunk-4L5ZIKDZ.js} +1 -1
- package/dist/chunk-4L5ZIKDZ.js.map +1 -0
- package/dist/{chunk-2E7S5C4D.js → chunk-4UWLHKNU.js} +5 -5
- package/dist/chunk-4UWLHKNU.js.map +1 -0
- package/dist/{chunk-EXGDKG7B.js → chunk-5A2DN3LR.js} +5 -5
- package/dist/chunk-5A2DN3LR.js.map +1 -0
- package/dist/{chunk-DJ65XFVN.js → chunk-63TJH2RF.js} +4 -4
- package/dist/chunk-63TJH2RF.js.map +1 -0
- package/dist/{chunk-Q2CLQ3IJ.js → chunk-6PHG2DMG.js} +1 -1
- package/dist/chunk-6PHG2DMG.js.map +1 -0
- package/dist/{chunk-SPI6VMIY.js → chunk-6T7AX365.js} +4 -4
- package/dist/chunk-6T7AX365.js.map +1 -0
- package/dist/{chunk-GVII4JSD.js → chunk-6V6UHPJD.js} +4 -4
- package/dist/chunk-6V6UHPJD.js.map +1 -0
- package/dist/{chunk-NR3ZO4LK.js → chunk-7U65KLDL.js} +1 -1
- package/dist/chunk-7U65KLDL.js.map +1 -0
- package/dist/chunk-BMOZSNDU.js +133 -0
- package/dist/chunk-BMOZSNDU.js.map +1 -0
- package/dist/{chunk-2LM3PYHA.js → chunk-C2TY5DJC.js} +11 -8
- package/dist/chunk-C2TY5DJC.js.map +1 -0
- package/dist/{chunk-3WYREXW4.js → chunk-COMEWURO.js} +8 -6
- package/dist/chunk-COMEWURO.js.map +1 -0
- package/dist/{chunk-VPDSPD76.js → chunk-DB64I3DB.js} +4 -3
- package/dist/chunk-DB64I3DB.js.map +1 -0
- package/dist/{chunk-SBCXWGNP.js → chunk-DBCDYBZP.js} +2 -2
- package/dist/{chunk-SBCXWGNP.js.map → chunk-DBCDYBZP.js.map} +1 -1
- package/dist/{chunk-CNM6ZWP2.js → chunk-DJWBXEF4.js} +4 -2
- package/dist/chunk-DJWBXEF4.js.map +1 -0
- package/dist/{chunk-SVUJIVMR.js → chunk-E2MTHHLS.js} +3 -3
- package/dist/{chunk-SVUJIVMR.js.map → chunk-E2MTHHLS.js.map} +1 -1
- package/dist/{chunk-JG4ONAOI.js → chunk-EI55KWHP.js} +2 -2
- package/dist/chunk-EI55KWHP.js.map +1 -0
- package/dist/{chunk-MVKHSAKE.js → chunk-GE2BQXB3.js} +41 -4
- package/dist/chunk-GE2BQXB3.js.map +1 -0
- package/dist/chunk-GHV36C6I.js +94 -0
- package/dist/chunk-GHV36C6I.js.map +1 -0
- package/dist/{chunk-BCO673YW.js → chunk-GQUDCWOD.js} +10 -4
- package/dist/chunk-GQUDCWOD.js.map +1 -0
- package/dist/chunk-HD7ZLISK.js +808 -0
- package/dist/chunk-HD7ZLISK.js.map +1 -0
- package/dist/{chunk-KELWWCMX.js → chunk-I2K4OQKB.js} +4 -4
- package/dist/chunk-I2K4OQKB.js.map +1 -0
- package/dist/chunk-IFDTSVE6.js +9 -0
- package/dist/chunk-IFDTSVE6.js.map +1 -0
- package/dist/{chunk-TPLVC5BE.js → chunk-IR32NI2O.js} +336 -247
- package/dist/chunk-IR32NI2O.js.map +1 -0
- package/dist/{chunk-ZKKO4MHC.js → chunk-JYKP7TBZ.js} +4 -2
- package/dist/chunk-JYKP7TBZ.js.map +1 -0
- package/dist/{chunk-6OT7FOSA.js → chunk-K3C35KGR.js} +4 -4
- package/dist/chunk-K3C35KGR.js.map +1 -0
- package/dist/{chunk-4RECPEHI.js → chunk-KBS3GP6S.js} +4 -3
- package/dist/chunk-KBS3GP6S.js.map +1 -0
- package/dist/{chunk-YHRJNKD5.js → chunk-KS7EXW4P.js} +6 -4
- package/dist/chunk-KS7EXW4P.js.map +1 -0
- package/dist/{chunk-V6N3YLTM.js → chunk-LTOTL5AS.js} +3 -3
- package/dist/chunk-LTOTL5AS.js.map +1 -0
- package/dist/chunk-M64TAGZY.js +590 -0
- package/dist/chunk-M64TAGZY.js.map +1 -0
- package/dist/{chunk-JZZVWTUB.js → chunk-MMOQR426.js} +2 -2
- package/dist/chunk-MMOQR426.js.map +1 -0
- package/dist/{chunk-SJBMKA4X.js → chunk-OHT2AXER.js} +11 -10
- package/dist/chunk-OHT2AXER.js.map +1 -0
- package/dist/{chunk-TTFW6E6C.js → chunk-OZKBIPXU.js} +2 -2
- package/dist/chunk-OZKBIPXU.js.map +1 -0
- package/dist/{chunk-Q2SLOMN6.js → chunk-RHMY45DK.js} +4 -4
- package/dist/chunk-RHMY45DK.js.map +1 -0
- package/dist/{chunk-BZXA5SSA.js → chunk-S7QB5KMM.js} +2 -2
- package/dist/{chunk-BZXA5SSA.js.map → chunk-S7QB5KMM.js.map} +1 -1
- package/dist/{chunk-HDXUHLTQ.js → chunk-SHECA2N4.js} +8 -2
- package/dist/chunk-SHECA2N4.js.map +1 -0
- package/dist/{chunk-R6FIXYAE.js → chunk-SJEPM5ZU.js} +2 -2
- package/dist/{chunk-R6FIXYAE.js.map → chunk-SJEPM5ZU.js.map} +1 -1
- package/dist/{chunk-FJMABKKV.js → chunk-UQ4FRQ6M.js} +35 -17
- package/dist/chunk-UQ4FRQ6M.js.map +1 -0
- package/dist/{chunk-S4ZGTDSG.js → chunk-UU37OR3D.js} +2 -2
- package/dist/chunk-UU37OR3D.js.map +1 -0
- package/dist/{chunk-SWXWLSUD.js → chunk-WEQNPYVA.js} +1 -1
- package/dist/{chunk-SWXWLSUD.js.map → chunk-WEQNPYVA.js.map} +1 -1
- package/dist/{chunk-5SFHBYEY.js → chunk-WUVHP3UC.js} +97 -24
- package/dist/chunk-WUVHP3UC.js.map +1 -0
- package/dist/{chunk-3S3WXAZ5.js → chunk-X43QQWVC.js} +3 -2
- package/dist/chunk-X43QQWVC.js.map +1 -0
- package/dist/{chunk-Z3T24FX3.js → chunk-YE6KCAIN.js} +3 -2
- package/dist/chunk-YE6KCAIN.js.map +1 -0
- package/dist/{chunk-KQZIC5CA.js → chunk-ZC4KSRAF.js} +7 -7
- package/dist/chunk-ZC4KSRAF.js.map +1 -0
- package/dist/collapsible-panel.d.ts +2 -2
- package/dist/collapsible-panel.js +2 -2
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/column-explorer.d.ts +3 -3
- package/dist/column-explorer.js +16 -138
- package/dist/column-explorer.js.map +1 -1
- package/dist/dialog-surface-controller-BeKZ3e8Z.d.ts +251 -0
- package/dist/editor-frame.d.ts +1 -1
- package/dist/editor-frame.js +1 -1
- package/dist/editor.d.ts +38 -20
- package/dist/editor.js +11651 -7052
- package/dist/editor.js.map +1 -1
- package/dist/file-picker.js +1 -1
- package/dist/help-tags-register.js +2 -1
- package/dist/help-tags-register.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +24 -23
- package/dist/list-action-row.d.ts +1 -1
- package/dist/list-action-row.js +1 -1
- package/dist/list-detail-dialog.d.ts +7 -7
- package/dist/list-detail-dialog.js +6 -5
- package/dist/list-detail-dialog.js.map +1 -1
- package/dist/list-header.d.ts +1 -1
- package/dist/list-header.js +1 -1
- package/dist/list-item.d.ts +1 -1
- package/dist/list-item.js +1 -1
- package/dist/message-composer.js +1 -1
- package/dist/nav-stack.d.ts +6 -6
- package/dist/nav-stack.js +1 -1
- package/dist/popup-menu-register.js +1 -7
- package/dist/popup-menu-register.js.map +1 -1
- package/dist/popup-menu.d.ts +2 -2
- package/dist/popup-menu.js +1 -1
- package/dist/resizable-region.js +1 -1
- package/dist/segmented-control.d.ts +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select-register.js +17 -23
- package/dist/select-register.js.map +1 -1
- package/dist/split-view.d.ts +6 -6
- package/dist/split-view.js +1 -1
- package/dist/styles/collapsible-panel.css +34 -25
- package/dist/styles/components/actions/popup-menu/popup-menu.css +4 -4
- package/dist/styles/components/actions/toolbar/toolbar.css +34 -1
- package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +1 -1
- package/dist/styles/components/forms/segmented-control/segmented-control.css +1 -1
- package/dist/styles/components/layout/collapsible-panel/collapsible-panel.css +34 -25
- package/dist/styles/components/layout/split-view/split-view.css +19 -33
- package/dist/styles/components/navigation/nav-stack/nav-stack.css +15 -19
- package/dist/styles/components/navigation/tab-navigator/tab-navigator.css +30 -29
- package/dist/styles/components/surfaces/editor-frame/editor-frame.css +10 -3
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +291 -4
- package/dist/styles/editor/editor.css +78 -0
- package/dist/styles/editor-frame.css +10 -3
- package/dist/styles/nav-stack.css +15 -19
- package/dist/styles/popup-menu.css +4 -4
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/split-view.css +19 -33
- package/dist/styles/surface-scaffold.css +291 -4
- package/dist/styles/tab-navigator.css +30 -29
- package/dist/styles/toolbar-control-group.css +1 -1
- package/dist/styles/toolbar.css +34 -1
- package/dist/styles/webawesome.css +4 -5
- package/dist/surface-scaffold-register.js +2 -1
- package/dist/surface-scaffold-register.js.map +1 -1
- package/dist/surface-scaffold.d.ts +155 -246
- package/dist/surface-scaffold.js +3 -2
- package/dist/toolbar-control-group.d.ts +2 -2
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar.d.ts +6 -1
- package/dist/toolbar.js +1 -1
- package/dist/tree-list.d.ts +4 -4
- package/dist/tree-list.js +2 -2
- package/dist/{tree-rows-eHnnGLGM.d.ts → tree-rows-Bms5QJvG.d.ts} +3 -0
- package/dist/wire-catalog.d.ts +1 -1
- package/dist/wire-catalog.js +3 -2
- package/dist/wire-catalog.js.map +1 -1
- package/dist/wire-checkboxes.js +2 -1
- package/dist/wire-choice-chips.js +2 -1
- package/dist/wire-color-fields.js +2 -1
- package/dist/wire-color-pickers.js +2 -1
- package/dist/wire-column-explorer.js +1 -92
- package/dist/wire-column-explorer.js.map +1 -1
- package/dist/wire-comboboxes.d.ts +2 -0
- package/dist/wire-comboboxes.js +2 -1
- package/dist/wire-content-items.js +2 -1
- package/dist/wire-corner-status.js +2 -1
- package/dist/wire-nav-stack.js +2 -1
- package/dist/wire-overlay-sheets.js +2 -1
- package/dist/wire-paged-views.js +2 -2
- package/dist/wire-paged-views.js.map +1 -1
- package/dist/wire-resizable-regions.js +2 -1
- package/dist/wire-scroll-dividers.js +1 -1
- package/dist/wire-search-fields.js +2 -1
- package/dist/wire-sidebar.js +2 -1
- package/dist/wire-tab-bars.d.ts +41 -2
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tab-navigator.js +2 -1
- package/dist/wire-tag-fields.js +2 -1
- package/dist/wire-workbench.js +2 -1
- package/dist/workbench-dialog.d.ts +7 -7
- package/dist/workbench-dialog.js +5 -4
- package/dist/workbench-dialog.js.map +1 -1
- package/dist/workbench.d.ts +1 -1
- package/dist/workbench.js +1 -1
- package/docs/accessibility.md +3 -6
- package/docs/component-contract.md +47 -7
- package/docs/component-selection.md +90 -80
- package/docs/design/templates.md +5 -4
- package/docs/editor-frame.md +1 -1
- package/docs/editor-host.md +15 -2
- package/docs/overlay-tooltip.md +1 -1
- package/docs/recipes.md +1 -1
- package/docs/surface-scaffold.md +63 -2
- package/docs/ui-analyzer.md +42 -0
- package/docs/ui-doctor.md +45 -1
- package/docs/ui-evaluator.md +35 -0
- package/docs/ux-demo.md +1 -1
- package/docs/view.md +314 -0
- package/docs/webawesome-theme.md +16 -0
- package/doctor/cli.mjs +36 -31
- package/doctor/index.mjs +349 -162
- package/evaluator/cli.mjs +36 -30
- package/llms.txt +17 -4
- package/package.json +6 -2
- package/props/cli.mjs +47 -21
- package/scripts/lib/cli-args.mjs +98 -0
- package/ux-demo/recipes/app-shell.tsx +48 -141
- package/ux-demo/recipes/collapsible-sidebar.tsx +43 -169
- package/ux-demo/recipes/compact-toolbar.tsx +22 -114
- package/ux-demo/recipes/composer-form.tsx +14 -104
- package/ux-demo/recipes/list-detail-dialog.tsx +38 -84
- package/ux-demo/recipes/list-workspace-states.tsx +29 -152
- package/ux-demo/recipes/loading-inspector.tsx +30 -174
- package/ux-demo/recipes/media-detail.tsx +29 -146
- package/ux-demo/recipes/navigation-sidebar.tsx +24 -113
- package/ux-demo/recipes/navigation-stack.tsx +7 -43
- package/ux-demo/recipes/workspace-header.tsx +2 -66
- package/view/catalog.mjs +229 -0
- package/view/child-kind.mjs +22 -0
- package/view/cli.mjs +142 -119
- package/view/contract.mjs +84 -11
- package/view/css-grammar.mjs +93 -0
- package/view/generate.d.mts +16 -0
- package/view/generate.mjs +155 -56
- package/view/index.d.mts +80 -14
- package/view/index.mjs +5 -9
- package/view/interpret.mjs +104 -36
- package/view/types.mjs +161 -0
- package/view/validate-move.mjs +66 -30
- package/view/validate.mjs +420 -654
- package/vite-editor.d.mts +16 -1
- package/vite-editor.mjs +74 -4
- package/dist/chunk-2E7S5C4D.js.map +0 -1
- package/dist/chunk-2LM3PYHA.js.map +0 -1
- package/dist/chunk-3S3WXAZ5.js.map +0 -1
- package/dist/chunk-3WYREXW4.js.map +0 -1
- package/dist/chunk-4RECPEHI.js.map +0 -1
- package/dist/chunk-5SFHBYEY.js.map +0 -1
- package/dist/chunk-6OT7FOSA.js.map +0 -1
- package/dist/chunk-ADMWT7FX.js.map +0 -1
- package/dist/chunk-BCO673YW.js.map +0 -1
- package/dist/chunk-CNM6ZWP2.js.map +0 -1
- package/dist/chunk-DJ65XFVN.js.map +0 -1
- package/dist/chunk-EXGDKG7B.js.map +0 -1
- package/dist/chunk-FJMABKKV.js.map +0 -1
- package/dist/chunk-GVII4JSD.js.map +0 -1
- package/dist/chunk-HDXUHLTQ.js.map +0 -1
- package/dist/chunk-JG4ONAOI.js.map +0 -1
- package/dist/chunk-JZZVWTUB.js.map +0 -1
- package/dist/chunk-KELWWCMX.js.map +0 -1
- package/dist/chunk-KLR3DCHH.js.map +0 -1
- package/dist/chunk-KQZIC5CA.js.map +0 -1
- package/dist/chunk-LD6A6PYB.js +0 -268
- package/dist/chunk-LD6A6PYB.js.map +0 -1
- package/dist/chunk-MVKHSAKE.js.map +0 -1
- package/dist/chunk-NHQOX7T4.js.map +0 -1
- package/dist/chunk-NR3ZO4LK.js.map +0 -1
- package/dist/chunk-Q2CLQ3IJ.js.map +0 -1
- package/dist/chunk-Q2SLOMN6.js.map +0 -1
- package/dist/chunk-S4ZGTDSG.js.map +0 -1
- package/dist/chunk-SJBMKA4X.js.map +0 -1
- package/dist/chunk-SPI6VMIY.js.map +0 -1
- package/dist/chunk-TPLVC5BE.js.map +0 -1
- package/dist/chunk-TTFW6E6C.js.map +0 -1
- package/dist/chunk-V6N3YLTM.js.map +0 -1
- package/dist/chunk-VNT4MXR5.js +0 -548
- package/dist/chunk-VNT4MXR5.js.map +0 -1
- package/dist/chunk-VPDSPD76.js.map +0 -1
- package/dist/chunk-YHRJNKD5.js.map +0 -1
- package/dist/chunk-Z3T24FX3.js.map +0 -1
- package/dist/chunk-ZKKO4MHC.js.map +0 -1
- package/dist/{nav-stack-DwxpXxqJ.d.ts → nav-stack-vQ3ieerq.d.ts} +3 -3
package/docs/design/templates.md
CHANGED
|
@@ -36,7 +36,7 @@ interaction-/viewport-driven screens rather than component cards — the live UX
|
|
|
36
36
|
catalog and the app-layouts docs cover those. `ColorPicker` is templated from stand-ins: its area and its channel and opacity tracks are CSS gradients and range-input pseudo-elements a static capture cannot keep, so the templates draw them as inline SVG gradients and checker squares from the picker's own values (`staticColorPicker`). For the same reason the `Slider` templates draw
|
|
37
37
|
its track, fill, and thumb with template-only stand-in elements built from
|
|
38
38
|
the Slider's own tokens and fill value (`staticRange` in
|
|
39
|
-
`scripts/
|
|
39
|
+
`scripts/design-templates/specs.mjs`). The `ColorField` templates likewise draw the swatch's checkerboard with plain squares (`staticSwatch`), since the capture would embed its conic gradient as a nested SVG.
|
|
40
40
|
|
|
41
41
|
## Layout
|
|
42
42
|
|
|
@@ -103,7 +103,8 @@ stylesheets, because its standalone HTML pages live outside `dist/styles`.
|
|
|
103
103
|
Run `npm run build` before the template build so those entries exist.
|
|
104
104
|
|
|
105
105
|
**Keep the templates current as components change.** The variants live in the
|
|
106
|
-
`COMPONENTS` manifest in `scripts/
|
|
106
|
+
`COMPONENTS` manifest in `scripts/design-templates/specs.mjs` (the capture
|
|
107
|
+
pipeline, `scripts/build-design-templates.mjs`, re-exports it) — when a component
|
|
107
108
|
gains or changes a presentation combination (e.g. a new `Toolbar` slot), add
|
|
108
109
|
or adjust its variant there and re-run the build. Cover the common cases: if a
|
|
109
110
|
component can render with or without an icon, include both.
|
|
@@ -133,8 +134,8 @@ updated SVGs.
|
|
|
133
134
|
## Templating your own components
|
|
134
135
|
|
|
135
136
|
Apps that build on `@kerfjs/ui` can produce the same design templates for their
|
|
136
|
-
own application-level components. Copy `scripts/build-design-templates.mjs`
|
|
137
|
-
starting point and:
|
|
137
|
+
own application-level components. Copy `scripts/build-design-templates.mjs` and
|
|
138
|
+
its manifest, `scripts/design-templates/specs.mjs`, as a starting point and:
|
|
138
139
|
|
|
139
140
|
1. Import your component and render it to a `SafeHtml` string with realistic
|
|
140
141
|
sample data (pass icon/action slots as `SafeHtml`, e.g. `LucideIcon({ … })` or
|
package/docs/editor-frame.md
CHANGED
|
@@ -32,7 +32,7 @@ Set `appearance="embedded"` when a host already owns the frame. The border,
|
|
|
32
32
|
radius, fill, and fixed height then drop away. The embedded source can use
|
|
33
33
|
`sourceHeight` for a restored native textarea height or `sourceAutosize` to
|
|
34
34
|
grow with its content; the application still owns persistence and value updates.
|
|
35
|
-
Set `inset="
|
|
35
|
+
Set `inset="none"` when the host already provides the text inset. These modes
|
|
36
36
|
preserve the native textarea's selection, input events, and form behavior.
|
|
37
37
|
|
|
38
38
|
Set `expanded` to place the same editor in a fixed viewport overlay with a
|
package/docs/editor-host.md
CHANGED
|
@@ -33,7 +33,10 @@ the editor reopens it on your next visit. The plugin's file endpoint
|
|
|
33
33
|
the project, outside `node_modules` and `.git`, and only for requests the
|
|
34
34
|
editor itself makes. A host that mounts the editor itself passes
|
|
35
35
|
`createEditor({ catalog, storage: devServerStorage() })` and adds
|
|
36
|
-
`editorFileMiddleware(root)` to its server.
|
|
36
|
+
`editorFileMiddleware(root)` to its server. The same middleware lists the
|
|
37
|
+
project's documents (GET `/__kerf-ui-editor/api/files`: every `.kui.json`
|
|
38
|
+
outside `node_modules`, `dist`, `test-results`, and dot-folders), which
|
|
39
|
+
Add a child's **Existing document…** offers in a picker.
|
|
37
40
|
|
|
38
41
|
The editor offers Kerf UI's components and every component your
|
|
39
42
|
`.kerf-ui-profile.json` declares a catalog for. Generate your package's
|
|
@@ -185,7 +188,17 @@ editor.wire(root);
|
|
|
185
188
|
`save(fileName, text)` replaces the default download for Save and Export,
|
|
186
189
|
`fieldEditors` registers field editors by type name (above), and
|
|
187
190
|
`devicePresets` adds play mode's devices and `playHandlers` its mock
|
|
188
|
-
action handlers (below).
|
|
191
|
+
action handlers (below). `storage` (an `EditorStorage`, `read(path)` and
|
|
192
|
+
`write(path, text)` by project path) also loads the documents a `#view`
|
|
193
|
+
composes, so the canvas renders them and Problems validates against them;
|
|
194
|
+
without it a `#view` previews as a placeholder. An optional `list()`
|
|
195
|
+
answers the project's documents as project-relative `.kui.json` paths;
|
|
196
|
+
with it, Add a child's **Existing document…** inserts one as a `#view`
|
|
197
|
+
from a picker, and without it that choice asks for a path. With it, the
|
|
198
|
+
Library also lists those documents after its components, to insert by
|
|
199
|
+
click or drag.
|
|
200
|
+
`devServerStorage(api?, listApi?)` implements all three over the dev
|
|
201
|
+
server (`EDITOR_FILE_API`, `EDITOR_LIST_API`).
|
|
189
202
|
- `createEditorCatalog({ props, composition, selection?, components, placeholders? })`
|
|
190
203
|
combines catalogs. Without a selection catalog a component is named by its
|
|
191
204
|
export. `placeholders` maps `<component key>.<prop>` to a factory for the
|
package/docs/overlay-tooltip.md
CHANGED
|
@@ -42,7 +42,7 @@ set their own text color.
|
|
|
42
42
|
|
|
43
43
|
- A control or value needs a short explanation on hover and focus: a longer
|
|
44
44
|
description of an action, a chart point, or a truncated label.
|
|
45
|
-
- Not for icon-only Kerf controls: `@kerfjs/ui/help-tags
|
|
45
|
+
- Not for icon-only Kerf controls: `@kerfjs/ui/help-tags/register` already
|
|
46
46
|
shows their help tag.
|
|
47
47
|
- Not for interactive content or the only copy of important information. Use an
|
|
48
48
|
`AnchoredSurface` the person opens, or visible text.
|
package/docs/recipes.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Production composition recipes
|
|
2
2
|
|
|
3
|
-
These
|
|
3
|
+
These eleven reference compositions sit between individual primitives and product
|
|
4
4
|
code. Open each stable UX-catalog route to run it, then copy the linked TSX. The
|
|
5
5
|
examples import public package subpaths, compose components through their
|
|
6
6
|
props and tokens, and keep state in a per-instance application adapter. They
|
package/docs/surface-scaffold.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
`DialogSurface` is Kerf's modal dialog: a native `<dialog>` with a header
|
|
4
4
|
(title, header actions, close button), a body, and an optional footer, sized
|
|
5
5
|
and presented by its props. `PopoverDialogSurface` is its non-modal sibling,
|
|
6
|
+
`PinnablePopoverSurface` a non-modal panel the person can pin and move,
|
|
6
7
|
and `PopupSurface` insets a raw Web Awesome dropdown. The application owns
|
|
7
8
|
open state, dismissal policy, ids, names, and content.
|
|
8
9
|
|
|
@@ -521,7 +522,8 @@ else, so move focus into it with `autofocus` on its first control when that
|
|
|
521
522
|
matters. A closed surface stays hidden; only the open one lays out.
|
|
522
523
|
`presentation="embedded"` renders the same surface in flow, with no top
|
|
523
524
|
layer and never wider than its container, for a catalog specimen or an inline
|
|
524
|
-
preview.
|
|
525
|
+
preview. In flow it draws its border without the drop shadow, which a
|
|
526
|
+
scrolling container would clip to a square box.
|
|
525
527
|
|
|
526
528
|
```tsx
|
|
527
529
|
<button type="button" popoverTarget="repository-status">Repository Status</button>
|
|
@@ -550,7 +552,66 @@ embedded surface.
|
|
|
550
552
|
|
|
551
553
|
Use `DialogSurface` whenever the task must block the page.
|
|
552
554
|
|
|
553
|
-
|
|
555
|
+
## Pinnable panels: `PinnablePopoverSurface`
|
|
556
|
+
|
|
557
|
+
A panel the person may keep open while working (a component library, a
|
|
558
|
+
palette, a quick inspector) starts as a transient popover and becomes a
|
|
559
|
+
floating panel when pinned. Render `PinnablePopoverSurface` instead of a
|
|
560
|
+
hand-built draggable panel. It takes the same geometry props as
|
|
561
|
+
`PopoverDialogSurface` (`size`, `preferredWidth`, `viewportGutter`, `height`
|
|
562
|
+
/ `maxHeight`, `bodyLayout`) and owns its header: the `label` title, optional
|
|
563
|
+
`headerActions`, a Pin toggle (`aria-pressed`), and Close. Call
|
|
564
|
+
`wirePinnablePopover()` once for its behavior:
|
|
565
|
+
|
|
566
|
+
- **Transient** (the default). It opens below the control whose
|
|
567
|
+
`popoverTarget` names it (or the `anchor` option), above it without room
|
|
568
|
+
below, start-aligned and kept inside the viewport gutter. Escape or a press
|
|
569
|
+
outside it and its opener closes it.
|
|
570
|
+
- **Pinned** by its Pin toggle or `pinPopover(surface)`. It no longer closes on
|
|
571
|
+
a press outside; Escape (with focus inside it), Close, or `hidePopover()`
|
|
572
|
+
still close it. Pinned state and placement survive closing and reopening.
|
|
573
|
+
- **Moved** by dragging its header, or with the arrow keys on its focused title
|
|
574
|
+
(8px a press, 40px with Shift; the `step` and `largeStep` options).
|
|
575
|
+
Moving a transient surface pins it. It stays inside the viewport gutter,
|
|
576
|
+
and after a window resize it is clamped again; when the window has room it
|
|
577
|
+
returns to where the person put it.
|
|
578
|
+
- **Resized** from its corner while pinned, within the viewport caps.
|
|
579
|
+
|
|
580
|
+
The surface is `popover="manual"`, so the controller provides its light
|
|
581
|
+
dismiss; changing an `auto` popover into a pinned one is not possible while
|
|
582
|
+
it is open. The title is the move handle: a focusable button named by the
|
|
583
|
+
label, whose accessible description (`moveDescription`) explains the drag
|
|
584
|
+
and the keys. Focus stays where the person puts it, as with any non-modal
|
|
585
|
+
popover; give its first control `autofocus` to move focus in on open.
|
|
586
|
+
|
|
587
|
+
The application owns storage. `onChange` reports `{ pinned, placement, reason }`
|
|
588
|
+
whenever the person or `pinPopover` pins, unpins, moves, or resizes it
|
|
589
|
+
(`placement` is `{ x, y, width?, height? }` in viewport px, `null` while
|
|
590
|
+
transient); a clamp after a window resize is not reported. Pass the stored
|
|
591
|
+
values back as `pinned` and `placement` to restore it. `isPopoverPinned()`
|
|
592
|
+
reads the current state.
|
|
593
|
+
|
|
594
|
+
```tsx
|
|
595
|
+
<button type="button" popoverTarget="library">Library</button>
|
|
596
|
+
<PinnablePopoverSurface id="library" label="Library" size="small" maxHeight={remify(480)}>
|
|
597
|
+
<List>{rows}</List>
|
|
598
|
+
</PinnablePopoverSurface>;
|
|
599
|
+
|
|
600
|
+
const stop = wirePinnablePopover(document.getElementById('library')!, {
|
|
601
|
+
pinned: saved?.pinned,
|
|
602
|
+
placement: saved?.placement ?? undefined,
|
|
603
|
+
onChange: (change) => store(change),
|
|
604
|
+
});
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
The controller keeps its pinned state, placement, and the Pin toggle's
|
|
608
|
+
`aria-pressed` across application re-renders. An application that closes the
|
|
609
|
+
panel after a task (a drop from a library) checks `isPopoverPinned()` first.
|
|
610
|
+
`presentation="embedded"` (with `pinned` for the pinned look) renders it in
|
|
611
|
+
flow for a catalog or a design canvas, with its border and no drop shadow;
|
|
612
|
+
`wirePinnablePopover` leaves an embedded surface alone.
|
|
613
|
+
|
|
614
|
+
Wrap one `PopupMenu` (or another single `wa-dropdown`) with `PopupSurface`. `inset="none"` removes menu
|
|
554
615
|
padding for a child that already owns row insets, `compact` uses 4px, and
|
|
555
616
|
`standard` uses the shared 8px surface inset. Keep the menu trigger named. A raw
|
|
556
617
|
`wa-dropdown` should keep `data-morph-skip-children` when its upgraded light-DOM
|
package/docs/ui-analyzer.md
CHANGED
|
@@ -53,6 +53,47 @@ nested `.claude/worktrees` checkout. Those checkouts are separate repositories,
|
|
|
53
53
|
not application source, and cannot contribute files, diagnostics, profile
|
|
54
54
|
policy, or analysis inputs to the containing application.
|
|
55
55
|
|
|
56
|
+
## CLI options
|
|
57
|
+
|
|
58
|
+
`kerf-ui-analyze [options] [path...]` analyzes the named files or directories
|
|
59
|
+
(relative to the root), or the whole root when none are named.
|
|
60
|
+
|
|
61
|
+
| Option | Meaning |
|
|
62
|
+
| ------------------- | ----------------------------------------------------------------------------------- |
|
|
63
|
+
| `--root <path>` | Project root (default: the current directory). Must be an existing directory. |
|
|
64
|
+
| `--format <format>` | `text` (default), `json` (the versioned report), or `sarif`. |
|
|
65
|
+
| `--output <path>` | Write the report to this file (relative to the root) instead of standard output. |
|
|
66
|
+
| `--profile <path>` | Use this application UI profile in place of the package-default profile Kerf ships. |
|
|
67
|
+
| `--fail-on-review` | Exit 1 on review findings as well as errors. |
|
|
68
|
+
| `--adoption` | Report ownership-boundary diagnostics as review findings (see below). |
|
|
69
|
+
| `-h`, `--help` | Print usage and exit 0. |
|
|
70
|
+
|
|
71
|
+
Exit codes: `0` clean, `1` errors (or review findings with `--fail-on-review`),
|
|
72
|
+
`2` a usage or input error — a flag missing its value, an unknown flag, an
|
|
73
|
+
unknown format, or a missing root — reported as `kerf-ui-analyze: <message>`.
|
|
74
|
+
|
|
75
|
+
## Node API
|
|
76
|
+
|
|
77
|
+
`@kerfjs/ui/analyzer` exports the analysis the CLI runs (types ship in
|
|
78
|
+
`analyzer/index.d.mts`):
|
|
79
|
+
|
|
80
|
+
| Export | Purpose |
|
|
81
|
+
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `analyzeUiProject(options?)` | Resolves to the versioned report. Options: `root`, `workspaceRoot`, `paths`, `profile` (package-default profile path), `adoption`, and the ownership settings the doctor configuration also exposes (`ownership`, `ownershipContext`, `implicitComponentOwnership`, `ownershipGroups`). |
|
|
83
|
+
| `formatUiAnalysisText(report)` | Renders a report as the CLI's terminal text. |
|
|
84
|
+
| `formatUiAnalysisSarif(report)` | Converts a report to a SARIF 2.1.0 log object (serialize it with `JSON.stringify`). |
|
|
85
|
+
| `UI_ANALYSIS_RULES` | Every `KUI-L###` rule: `{ severity, title }` by id. |
|
|
86
|
+
| `UI_ANALYSIS_ACTIONS` | The repair action for rules whose fix is more specific than the default, by id; the doctor attaches these to its diagnostics. |
|
|
87
|
+
| `UI_ANALYSIS_SCHEMA_VERSION` | The report schema version (`1`); the schema ships at `@kerfjs/ui/analyzer/report.schema.json`. |
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
import { analyzeUiProject, formatUiAnalysisText } from '@kerfjs/ui/analyzer';
|
|
91
|
+
|
|
92
|
+
const report = await analyzeUiProject({ root: process.cwd(), paths: ['src'] });
|
|
93
|
+
console.log(formatUiAnalysisText(report));
|
|
94
|
+
if (report.summary.errors) process.exitCode = 1;
|
|
95
|
+
```
|
|
96
|
+
|
|
56
97
|
## Diagnostics and exit behavior
|
|
57
98
|
|
|
58
99
|
| Rule | Kind | Meaning |
|
|
@@ -82,6 +123,7 @@ policy, or analysis inputs to the containing application.
|
|
|
82
123
|
| `KUI-L023` | error | A source module renders another component's public class as its own markup. |
|
|
83
124
|
| `KUI-L024` | review | A selector names a Web Awesome appearance scope (`.wa-light`, `.wa-dark`, `.wa-invert`). |
|
|
84
125
|
| `KUI-L025` | review | CSS writes a `--wa-*` token nothing reads, in a package without Web Awesome. |
|
|
126
|
+
| `KUI-L026` | review | A literal size, density, or inset prop uses a deprecated Kerf UI alias. |
|
|
85
127
|
|
|
86
128
|
For `KUI-L004` and `KUI-L007`, scroll and inset declarations belong to the
|
|
87
129
|
subject of each CSS selector. An ancestor class used only to qualify a
|
package/docs/ui-doctor.md
CHANGED
|
@@ -10,7 +10,28 @@ npx kerf-ui-doctor --full --browser-url http://127.0.0.1:4173
|
|
|
10
10
|
npx kerf-ui-doctor --full --fail-on warning
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The default terminal output is short and repair-oriented. `--format json` emits the schema-version-1 report; `--output report.json` writes the same representation. The package exports its contract from `@kerfjs/ui/doctor
|
|
13
|
+
The default terminal output is short and repair-oriented. `--format json` emits the schema-version-1 report; `--output report.json` writes the same representation. The package exports its contract from `@kerfjs/ui/doctor` (see [Node API](#node-api)), its configuration schema from `@kerfjs/ui/doctor/config.schema.json`, and its report schema from `@kerfjs/ui/doctor/report.schema.json`.
|
|
14
|
+
|
|
15
|
+
## CLI options
|
|
16
|
+
|
|
17
|
+
| Option | Meaning |
|
|
18
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `--full` | Check the whole selected package. Mutually exclusive with `--changed`. |
|
|
20
|
+
| `--changed` | Check only changed files: `--path` values, or else git's tracked changes against `HEAD` plus untracked files. |
|
|
21
|
+
| `--root <path>` | Workspace root (default: the current directory). |
|
|
22
|
+
| `--package <name/path>` | Select one workspace package by package name or workspace-relative path. |
|
|
23
|
+
| `--path <path>` | Restrict changed mode to this path. Repeatable. |
|
|
24
|
+
| `--config <path>` | Doctor configuration file (default: `.kerf-ui-doctor.json` at the root). |
|
|
25
|
+
| `--browser-url <url>` | Enable the browser evaluation stage against this running application. |
|
|
26
|
+
| `--browser <list>` | Comma-separated engines for the browser stage: `chromium`, `firefox`, `webkit`. Used with `--browser-url`. |
|
|
27
|
+
| `--eslint <preset>` | ESLint preset: `recommended-ui` (default) or `strict-ui`. |
|
|
28
|
+
| `--format <format>` | `text` (default) or `json`. |
|
|
29
|
+
| `--fail-on <severity>` | `error`, `review`, or `warning`; overrides the configuration's `failOn` for this run. |
|
|
30
|
+
| `--output <path>` | Write the report to this file (relative to the root) instead of standard output. |
|
|
31
|
+
| `--no-cache` | Disable the content-addressed cache. |
|
|
32
|
+
| `-h`, `--help` | Print usage and exit 0. |
|
|
33
|
+
|
|
34
|
+
A flag missing its value, an unknown argument, or an invalid choice prints `kerf-ui-doctor: <message>` and exits 2.
|
|
14
35
|
|
|
15
36
|
## Stages and trust boundary
|
|
16
37
|
|
|
@@ -319,6 +340,29 @@ Exit codes are deterministic. `failOn` defaults to `error`; `--fail-on error|rev
|
|
|
319
340
|
|
|
320
341
|
Warnings and review findings remain visible at every threshold. A cached report keeps its original exit code and labels previously run stages `cached`.
|
|
321
342
|
|
|
343
|
+
## Node API
|
|
344
|
+
|
|
345
|
+
`@kerfjs/ui/doctor` exports the same pipeline the CLI runs (types ship in `doctor/index.d.mts`):
|
|
346
|
+
|
|
347
|
+
| Export | Purpose |
|
|
348
|
+
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
349
|
+
| `runUiDoctor(options?)` | Runs every stage and resolves to the report. Options mirror the CLI: `root`, `package`, `mode` (`'full'` or `'changed'`), `paths`, `config` (an inline config object) or `configPath`, `cache`, `failOn`, `eslintConfig`, `browser` (`{ url, browsers }`), and an `AbortSignal` as `signal`. |
|
|
350
|
+
| `readUiDoctorConfig(root, path?)` | Reads and validates a configuration file (default `<root>/.kerf-ui-doctor.json`); resolves to `{ path, config, diagnostics }`. A missing file yields the default `{ schemaVersion: 1 }`. |
|
|
351
|
+
| `validateUiDoctorConfig(config, source?)` | Validates a configuration object; returns doctor diagnostics, empty when valid. |
|
|
352
|
+
| `resolveUiDoctorPackage(root, selector?)` | Resolves a workspace package name or workspace-relative path to its directory (the root when no selector); rejects when no package matches. |
|
|
353
|
+
| `formatUiDoctorText(report)` | Renders a report as the CLI's terminal text. |
|
|
354
|
+
| `UI_DOCTOR_EXIT` | The exit codes: `{ clean: 0, findings: 1, configuration: 2, cancelled: 130 }`. `report.exitCode` is one of them. |
|
|
355
|
+
| `UI_DOCTOR_RULES` | The doctor's own `KUI-D###` rules: `{ severity, title }` by id. |
|
|
356
|
+
| `UI_DOCTOR_SCHEMA_VERSION` | The report schema version (`1`). |
|
|
357
|
+
|
|
358
|
+
```js
|
|
359
|
+
import { formatUiDoctorText, runUiDoctor } from '@kerfjs/ui/doctor';
|
|
360
|
+
|
|
361
|
+
const report = await runUiDoctor({ root: process.cwd(), mode: 'changed' });
|
|
362
|
+
console.log(formatUiDoctorText(report));
|
|
363
|
+
process.exitCode = report.exitCode;
|
|
364
|
+
```
|
|
365
|
+
|
|
322
366
|
## Monorepos and repair loops
|
|
323
367
|
|
|
324
368
|
`--package` accepts either a workspace package name or a workspace-relative package path. The doctor uses the selected package for compiler, lint, profile-discovery start, and analyzer scope, while workspace profile precedence and root lockfiles remain authoritative.
|
package/docs/ui-evaluator.md
CHANGED
|
@@ -27,6 +27,28 @@ six contexts: wide, intermediate, narrow, a half-width CSS viewport representing
|
|
|
27
27
|
200% browser zoom, dark color scheme, and reduced motion. Use
|
|
28
28
|
`--browser chromium` for a fast local loop; keep all three engines in CI.
|
|
29
29
|
|
|
30
|
+
## CLI options
|
|
31
|
+
|
|
32
|
+
| Option | Meaning |
|
|
33
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `--url <url>` | The running application to evaluate (required). |
|
|
35
|
+
| `--root <path>` | Workspace root (default: the current directory). Other paths resolve against it. |
|
|
36
|
+
| `--start <path>` | Directory where profile discovery starts (default: the root), for one application in a monorepo. |
|
|
37
|
+
| `--profile <path>` | Use this profile in place of the package-default application UI profile Kerf ships. |
|
|
38
|
+
| `--browser <list>` | Comma-separated engines: `chromium`, `firefox`, `webkit` (default: all three). |
|
|
39
|
+
| `--output <directory>` | Evidence directory (default: `kerf-ui-evidence`). |
|
|
40
|
+
| `--report <path>` | Report JSON path (default: `<output>/report.json`). |
|
|
41
|
+
| `--timeout <ms>` | Per-operation timeout (default: `15000`). |
|
|
42
|
+
| `--settle <ms>` | Post-navigation settle delay (default: `100`). |
|
|
43
|
+
| `--retention <policy>` | Screenshot retention: `on-failure` (default), `always`, or `never` (see [Report and artifacts](#report-and-artifacts)). |
|
|
44
|
+
| `--format <format>` | Terminal output: `text` (default) or `json` (the full report). The report file is written either way. |
|
|
45
|
+
| `--no-fail` | Exit 0 even when objective diagnostics fail, for evidence-collection jobs. |
|
|
46
|
+
| `-h`, `--help` | Print usage and exit 0. |
|
|
47
|
+
|
|
48
|
+
The command prints the report path on standard error. A flag missing its
|
|
49
|
+
value, an unknown argument, or an invalid number prints
|
|
50
|
+
`kerf-ui-evaluate: <message>` and exits 2.
|
|
51
|
+
|
|
30
52
|
## Objective checks
|
|
31
53
|
|
|
32
54
|
The versioned JSON report uses stable `KUI-B###` codes and includes the context,
|
|
@@ -126,6 +148,19 @@ and rejects with `AbortError`.
|
|
|
126
148
|
The CLI exits `1` for objective failures, `2` for invocation/profile errors, and
|
|
127
149
|
`0` for a pass; `--no-fail` is available only for evidence-collection jobs.
|
|
128
150
|
|
|
151
|
+
The rest of `@kerfjs/ui/evaluator` (types ship in `evaluator/index.d.mts`):
|
|
152
|
+
|
|
153
|
+
| Export | Purpose |
|
|
154
|
+
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
155
|
+
| `evaluateUi(options)` | Runs the evaluation above. Beyond the CLI's options it accepts `contexts` (a custom matrix), `recordedAt`, a preloaded `playwright` module, and `signal`. |
|
|
156
|
+
| `formatUiEvaluationText(report)` | Renders a report as the CLI's terminal text. |
|
|
157
|
+
| `buildEvaluationContexts(overrides?)` | Returns the default six-context matrix, or normalizes custom contexts (filling `reducedMotion`) for `evaluateUi`'s `contexts`. |
|
|
158
|
+
| `contrastRatio(foreground, background)` | The WCAG contrast ratio of two CSS colors or RGB(A) arrays, compositing a translucent foreground over the background; `null` when a color cannot be parsed. |
|
|
159
|
+
| `createEvaluationReport(options)` | Assembles a schema-version-1 report from `target`, `profileFiles`, `contexts`, `diagnostics`, `artifacts`, `recordedAt`, and `retention`, with its summary and unrecorded subjective review. |
|
|
160
|
+
| `SUBJECTIVE_REVIEW_RUBRIC` | The named human-review rubric (`{ id, prompt }`) every report carries; see below. |
|
|
161
|
+
| `UI_EVALUATION_RULES` | Every `KUI-B###` rule: `{ severity, title }` by id. |
|
|
162
|
+
| `UI_EVALUATION_SCHEMA_VERSION` | The report schema version (`1`). |
|
|
163
|
+
|
|
129
164
|
## Human visual review stays human
|
|
130
165
|
|
|
131
166
|
Hierarchy, rhythm, density, aesthetic fit, and the perceived clarity of
|
package/docs/ux-demo.md
CHANGED
|
@@ -26,7 +26,7 @@ other container (`catalog-demo/wrapped-example-stack`): single-component demos
|
|
|
26
26
|
sit directly on the catalog grid, and only composition and recipe routes frame
|
|
27
27
|
their content.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Eleven lazy production-composition routes live under the `Recipes` category.
|
|
30
30
|
Each `?component=recipe-*` route uses public package primitives, real wiring,
|
|
31
31
|
deterministic state, and semantic layout owners from the [recipe guide](./recipes.md).
|
|
32
32
|
|