@kerfjs/ui 5.0.0-beta.124 → 5.0.0-beta.126
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 +6 -0
- package/ai/application-ui-diagnostic-ids-v1.json +1 -0
- package/ai/component-catalog.json +168 -7
- package/ai/component-catalog.schema.json +14 -1
- package/ai/component-composition.json +97 -6
- package/ai/component-props.json +447 -40
- package/ai/components/README.md +1 -0
- package/ai/components/combobox.md +1 -1
- package/ai/components/gauge.md +83 -0
- package/ai/components/segmented-control.md +1 -0
- 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 +345 -295
- package/ai/skill.md +36 -27
- 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 +11 -8
- package/dist/browser/gauge.js +3 -0
- package/dist/browser/segmented-control.js +1 -0
- package/dist/catalog-resources.d.ts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +7 -7
- 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-3SCGTP5O.js +682 -0
- package/dist/chunk-3SCGTP5O.js.map +1 -0
- package/dist/{chunk-3JOEJT2Z.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-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-7AUZG5EW.js → chunk-E2MTHHLS.js} +3 -3
- package/dist/{chunk-7AUZG5EW.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-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-F3PZGFEA.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-4Z4QSTRF.js → chunk-OZKBIPXU.js} +38 -5
- 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-BCO673YW.js → chunk-Z3BT2SZE.js} +3 -3
- package/dist/chunk-Z3BT2SZE.js.map +1 -0
- package/dist/{chunk-NYNNNEAU.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 +2 -2
- package/dist/column-explorer.js +2 -2
- 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 +10869 -6993
- package/dist/editor.js.map +1 -1
- package/dist/file-picker.js +1 -1
- package/dist/gauge.d.ts +73 -0
- package/dist/gauge.js +157 -0
- package/dist/gauge.js.map +1 -0
- 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 +29 -28
- 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 +22 -1
- package/dist/segmented-control.js +3 -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/badge.css +39 -0
- 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/feedback/badge/badge.css +39 -0
- package/dist/styles/components/feedback/gauge/gauge.css +132 -0
- package/dist/styles/components/forms/segmented-control/segmented-control.css +17 -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 +2 -2
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +259 -4
- package/dist/styles/editor/editor.css +55 -0
- package/dist/styles/editor-frame.css +2 -2
- package/dist/styles/gauge.css +132 -0
- package/dist/styles/nav-stack.css +15 -19
- package/dist/styles/popup-menu.css +4 -4
- package/dist/styles/segmented-control.css +17 -1
- package/dist/styles/split-view.css +19 -33
- package/dist/styles/styles.css +1 -0
- package/dist/styles/surface-scaffold.css +259 -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 +153 -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 +2 -2
- package/dist/tree-list.js +1 -1
- 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-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 -79
- package/docs/design/sketch/Kerf-UI.sketch +0 -0
- package/docs/design/sketch/README.md +1 -1
- package/docs/design/sketch/content/README.md +8 -8
- package/docs/design/sketch/coverage.md +7 -5
- package/docs/design/sketch/unified/README.md +1 -1
- package/docs/design/sketch/unified/pages/content.png +0 -0
- package/docs/design/templates/button/full-width-dark.svg +1 -1
- package/docs/design/templates/button/full-width.svg +1 -1
- package/docs/design/templates/button/icons-dark.svg +1 -1
- package/docs/design/templates/button/icons.svg +1 -1
- package/docs/design/templates/button/pill-dark.svg +1 -1
- package/docs/design/templates/button/pill.svg +1 -1
- package/docs/design/templates/button/toggles-dark.svg +1 -1
- package/docs/design/templates/button/toggles.svg +1 -1
- package/docs/design/templates/button-dark.svg +1 -1
- package/docs/design/templates/button.svg +1 -1
- package/docs/design/templates/checkbox/compact-dark.svg +1 -1
- package/docs/design/templates/checkbox/compact.svg +1 -1
- package/docs/design/templates/checkbox/mixed-dark.svg +1 -1
- package/docs/design/templates/checkbox/mixed.svg +1 -1
- package/docs/design/templates/checkbox/states-dark.svg +1 -1
- package/docs/design/templates/checkbox/states.svg +1 -1
- package/docs/design/templates/checkbox-dark.svg +1 -1
- package/docs/design/templates/checkbox-group/vertical-dark.svg +1 -1
- package/docs/design/templates/checkbox-group/vertical.svg +1 -1
- package/docs/design/templates/checkbox-group-dark.svg +1 -1
- package/docs/design/templates/checkbox-group.svg +1 -1
- package/docs/design/templates/checkbox.svg +1 -1
- package/docs/design/templates/chip/tags-dark.svg +1 -1
- package/docs/design/templates/chip/tags.svg +1 -1
- package/docs/design/templates/chip-dark.svg +1 -1
- package/docs/design/templates/chip.svg +1 -1
- package/docs/design/templates/choice-chips/compact-icons-dark.svg +1 -1
- package/docs/design/templates/choice-chips/compact-icons.svg +1 -1
- package/docs/design/templates/choice-chips-dark.svg +1 -1
- package/docs/design/templates/choice-chips.svg +1 -1
- package/docs/design/templates/color-field/compact-dark.svg +1 -1
- package/docs/design/templates/color-field/compact.svg +1 -1
- package/docs/design/templates/color-field/error-dark.svg +1 -1
- package/docs/design/templates/color-field/error.svg +1 -1
- package/docs/design/templates/color-field/hint-dark.svg +1 -1
- package/docs/design/templates/color-field/hint.svg +1 -1
- package/docs/design/templates/color-field-dark.svg +1 -1
- package/docs/design/templates/color-field.svg +1 -1
- package/docs/design/templates/color-picker/gray-dark.svg +1 -1
- package/docs/design/templates/color-picker/gray.svg +1 -1
- package/docs/design/templates/color-picker/hsb-dark.svg +1 -1
- package/docs/design/templates/color-picker/hsb.svg +1 -1
- package/docs/design/templates/color-picker/rgb-dark.svg +1 -1
- package/docs/design/templates/color-picker/rgb.svg +1 -1
- package/docs/design/templates/color-picker-dark.svg +1 -1
- package/docs/design/templates/color-picker.svg +1 -1
- package/docs/design/templates/disclosure/embedded-dark.svg +1 -1
- package/docs/design/templates/disclosure/embedded.svg +1 -1
- package/docs/design/templates/disclosure/framed-sunken-dark.svg +1 -1
- package/docs/design/templates/disclosure/framed-sunken.svg +1 -1
- package/docs/design/templates/disclosure/plain-dark.svg +1 -1
- package/docs/design/templates/disclosure/plain.svg +1 -1
- package/docs/design/templates/disclosure-dark.svg +1 -1
- package/docs/design/templates/disclosure.svg +1 -1
- package/docs/design/templates/empty-state/filtered-dark.svg +1 -1
- package/docs/design/templates/empty-state/filtered.svg +1 -1
- package/docs/design/templates/empty-state/with-action-dark.svg +1 -1
- package/docs/design/templates/empty-state/with-action.svg +1 -1
- package/docs/design/templates/empty-state-dark.svg +1 -1
- package/docs/design/templates/empty-state.svg +1 -1
- package/docs/design/templates/gauge/bare-dark.svg +1 -0
- package/docs/design/templates/gauge/bare.svg +1 -0
- package/docs/design/templates/gauge/full-dark.svg +1 -0
- package/docs/design/templates/gauge/full.svg +1 -0
- package/docs/design/templates/gauge-dark.svg +1 -0
- package/docs/design/templates/gauge.svg +1 -0
- package/docs/design/templates/list/compact-dark.svg +1 -1
- package/docs/design/templates/list/compact.svg +1 -1
- package/docs/design/templates/list/stack-dark.svg +1 -1
- package/docs/design/templates/list/stack.svg +1 -1
- package/docs/design/templates/list-action-row/default-dark.svg +1 -1
- package/docs/design/templates/list-action-row/default.svg +1 -1
- package/docs/design/templates/list-action-row/icon-tile-dark.svg +1 -1
- package/docs/design/templates/list-action-row/icon-tile.svg +1 -1
- package/docs/design/templates/list-action-row/selected-dark.svg +1 -1
- package/docs/design/templates/list-action-row/selected.svg +1 -1
- package/docs/design/templates/list-action-row/trailing-menu-dark.svg +1 -1
- package/docs/design/templates/list-action-row/trailing-menu.svg +1 -1
- package/docs/design/templates/list-action-row-dark.svg +1 -1
- package/docs/design/templates/list-action-row.svg +1 -1
- package/docs/design/templates/list-dark.svg +1 -1
- package/docs/design/templates/list-header/action-dark.svg +1 -1
- package/docs/design/templates/list-header/action.svg +1 -1
- package/docs/design/templates/list-header/inline-action-dark.svg +1 -1
- package/docs/design/templates/list-header/inline-action.svg +1 -1
- package/docs/design/templates/list-header/toggle-collapsed-dark.svg +1 -1
- package/docs/design/templates/list-header/toggle-collapsed.svg +1 -1
- package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -1
- package/docs/design/templates/list-header/toggle-expanded.svg +1 -1
- package/docs/design/templates/list-header-dark.svg +1 -1
- package/docs/design/templates/list-header.svg +1 -1
- package/docs/design/templates/list-item/default-dark.svg +1 -1
- package/docs/design/templates/list-item/default.svg +1 -1
- package/docs/design/templates/list-item/icon-tile-dark.svg +1 -1
- package/docs/design/templates/list-item/icon-tile.svg +1 -1
- package/docs/design/templates/list-item/multiline-dark.svg +1 -1
- package/docs/design/templates/list-item/multiline.svg +1 -1
- package/docs/design/templates/list-item/selected-dark.svg +1 -1
- package/docs/design/templates/list-item/selected.svg +1 -1
- package/docs/design/templates/list-item/trailing-dark.svg +1 -1
- package/docs/design/templates/list-item/trailing.svg +1 -1
- package/docs/design/templates/list-item-dark.svg +1 -1
- package/docs/design/templates/list-item.svg +1 -1
- package/docs/design/templates/list.svg +1 -1
- package/docs/design/templates/progress-ring/sizes-dark.svg +1 -1
- package/docs/design/templates/progress-ring/sizes.svg +1 -1
- package/docs/design/templates/progress-ring/tones-dark.svg +1 -1
- package/docs/design/templates/progress-ring/tones.svg +1 -1
- package/docs/design/templates/progress-ring-dark.svg +1 -1
- package/docs/design/templates/progress-ring.svg +1 -1
- package/docs/design/templates/search-field/empty-dark.svg +1 -1
- package/docs/design/templates/search-field/empty.svg +1 -1
- package/docs/design/templates/search-field/tokens-dark.svg +1 -1
- package/docs/design/templates/search-field/tokens.svg +1 -1
- package/docs/design/templates/search-field-dark.svg +1 -1
- package/docs/design/templates/search-field.svg +1 -1
- package/docs/design/templates/segmented-control/equal-dark.svg +1 -1
- package/docs/design/templates/segmented-control/equal.svg +1 -1
- package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -1
- package/docs/design/templates/segmented-control/pill-small.svg +1 -1
- package/docs/design/templates/segmented-control-dark.svg +1 -1
- package/docs/design/templates/segmented-control.svg +1 -1
- package/docs/design/templates/select/compact-dark.svg +1 -1
- package/docs/design/templates/select/compact.svg +1 -1
- package/docs/design/templates/select/form-dark.svg +1 -1
- package/docs/design/templates/select/form.svg +1 -1
- package/docs/design/templates/select/icons-dark.svg +1 -1
- package/docs/design/templates/select/icons.svg +1 -1
- package/docs/design/templates/select-dark.svg +1 -1
- package/docs/design/templates/select.svg +1 -1
- package/docs/design/templates/split-button/full-width-dark.svg +1 -1
- package/docs/design/templates/split-button/full-width.svg +1 -1
- package/docs/design/templates/split-button/pill-dark.svg +1 -1
- package/docs/design/templates/split-button/pill.svg +1 -1
- package/docs/design/templates/split-button/states-dark.svg +1 -1
- package/docs/design/templates/split-button/states.svg +1 -1
- package/docs/design/templates/split-button/tones-dark.svg +1 -1
- package/docs/design/templates/split-button/tones.svg +1 -1
- package/docs/design/templates/split-button-dark.svg +1 -1
- package/docs/design/templates/split-button.svg +1 -1
- package/docs/design/templates/state-banner/danger-dark.svg +1 -1
- package/docs/design/templates/state-banner/danger.svg +1 -1
- package/docs/design/templates/state-banner/info-badge-dark.svg +1 -1
- package/docs/design/templates/state-banner/info-badge.svg +1 -1
- package/docs/design/templates/state-banner/info-dark.svg +1 -1
- package/docs/design/templates/state-banner/info.svg +1 -1
- package/docs/design/templates/state-banner/strip-dark.svg +1 -1
- package/docs/design/templates/state-banner/strip.svg +1 -1
- package/docs/design/templates/state-banner/success-dark.svg +1 -1
- package/docs/design/templates/state-banner/success.svg +1 -1
- package/docs/design/templates/state-banner/warning-dark.svg +1 -1
- package/docs/design/templates/state-banner/warning.svg +1 -1
- package/docs/design/templates/state-banner-dark.svg +1 -1
- package/docs/design/templates/state-banner.svg +1 -1
- package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -1
- package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -1
- package/docs/design/templates/tab-bar-dark.svg +1 -1
- package/docs/design/templates/tab-bar.svg +1 -1
- package/docs/design/templates/tag-field/error-dark.svg +1 -1
- package/docs/design/templates/tag-field/error.svg +1 -1
- package/docs/design/templates/tag-field/tags-dark.svg +1 -1
- package/docs/design/templates/tag-field/tags.svg +1 -1
- package/docs/design/templates/tag-field-dark.svg +1 -1
- package/docs/design/templates/tag-field.svg +1 -1
- package/docs/design/templates/text-field/labeled-dark.svg +1 -1
- package/docs/design/templates/text-field/labeled.svg +1 -1
- package/docs/design/templates/text-field/search-dark.svg +1 -1
- package/docs/design/templates/text-field/search.svg +1 -1
- package/docs/design/templates/text-field-dark.svg +1 -1
- package/docs/design/templates/text-field.svg +1 -1
- package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -1
- package/docs/design/templates/toolbar/title-and-actions.svg +1 -1
- package/docs/design/templates/toolbar/width-visibility-320-dark.svg +1 -1
- package/docs/design/templates/toolbar/width-visibility-320.svg +1 -1
- package/docs/design/templates/toolbar/width-visibility-600-dark.svg +1 -1
- package/docs/design/templates/toolbar/width-visibility-600.svg +1 -1
- package/docs/design/templates/toolbar-control-group/borderless-single-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/borderless-single.svg +1 -1
- package/docs/design/templates/toolbar-control-group/glass-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/glass.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-buttons-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-buttons.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-brand-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-brand.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-danger-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-danger.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-neutral-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-neutral.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-success-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-success.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-warning-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-warning.svg +1 -1
- package/docs/design/templates/toolbar-control-group/push-buttons-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/push-buttons.svg +1 -1
- package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/with-text.svg +1 -1
- package/docs/design/templates/toolbar-control-group-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group.svg +1 -1
- package/docs/design/templates/toolbar-dark.svg +1 -1
- package/docs/design/templates/toolbar.svg +1 -1
- package/docs/design/templates/tree-list/files-dark.svg +1 -1
- package/docs/design/templates/tree-list/files.svg +1 -1
- package/docs/design/templates/tree-list/outline-dark.svg +1 -1
- package/docs/design/templates/tree-list/outline.svg +1 -1
- package/docs/design/templates/tree-list-dark.svg +1 -1
- package/docs/design/templates/tree-list.svg +1 -1
- package/docs/design/templates/value-table/details-dark.svg +1 -1
- package/docs/design/templates/value-table/details.svg +1 -1
- package/docs/design/templates/value-table-dark.svg +1 -1
- package/docs/design/templates/value-table.svg +1 -1
- package/docs/design/templates.md +5 -4
- package/docs/editor-frame.md +1 -1
- package/docs/editor-host.md +15 -2
- package/docs/gauge.md +55 -0
- package/docs/overlay-tooltip.md +1 -1
- package/docs/progress.md +3 -2
- 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 +295 -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 +27 -5
- package/package.json +10 -2
- package/props/cli.mjs +47 -21
- package/scripts/lib/cli-args.mjs +98 -0
- package/ux-demo/recipes/compact-toolbar.tsx +1 -1
- package/ux-demo/recipes/loading-inspector.tsx +1 -1
- 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 +122 -43
- 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-3JOEJT2Z.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-4Z4QSTRF.js.map +0 -1
- package/dist/chunk-5SFHBYEY.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-F3PZGFEA.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-LD6A6PYB.js +0 -268
- package/dist/chunk-LD6A6PYB.js.map +0 -1
- package/dist/chunk-MVKHSAKE.js.map +0 -1
- package/dist/chunk-NYNNNEAU.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-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/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
|
|
package/docs/view.md
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# View documents
|
|
2
|
+
|
|
3
|
+
A view document (`*.kui.json`, format `kerf-ui-document/v1`) describes one
|
|
4
|
+
screen or component built from Kerf UI and your own components: which
|
|
5
|
+
components, how they nest, their prop values, and the inputs, actions, slots,
|
|
6
|
+
and named nodes your application code works with. The Kerf UI editor writes
|
|
7
|
+
these documents; tools and AI agents may write them too.
|
|
8
|
+
|
|
9
|
+
You never ship the document's markup by hand. Either generate a read-only
|
|
10
|
+
TypeScript module from it with `kerf-ui-view`, or render it at runtime with
|
|
11
|
+
`interpretView`. Both come from `@kerfjs/ui`, and both behave the same.
|
|
12
|
+
|
|
13
|
+
The full design, with every rule and diagnostic, is
|
|
14
|
+
[`docs/26-ui-editor.md`](../../docs/26-ui-editor.md). This guide covers what an
|
|
15
|
+
application needs.
|
|
16
|
+
|
|
17
|
+
## Files
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
inbox.kui.json the document (the editor's source of truth)
|
|
21
|
+
inbox.view.ts generated, read-only; never edit it
|
|
22
|
+
inbox.ts yours: state, handlers, slot content, wiring
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The generated module sits beside its document. Add `**/*.view.ts` (and
|
|
26
|
+
`*.view.js` / `*.view.d.ts`) to `.prettierignore`: reformatting a generated
|
|
27
|
+
module changes its body digest, and the checks below then report it as edited.
|
|
28
|
+
|
|
29
|
+
## The document format
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"$schema": "https://raw.githubusercontent.com/brianwestphal/kerf/main/ui/ai/view-document.schema.json",
|
|
34
|
+
"schema": "kerf-ui-document/v1",
|
|
35
|
+
"name": "Inbox",
|
|
36
|
+
"catalogs": ["@kerfjs/ui"],
|
|
37
|
+
"params": {
|
|
38
|
+
"title": { "type": { "kind": "string" }, "default": "Inbox" }
|
|
39
|
+
},
|
|
40
|
+
"root": {
|
|
41
|
+
"id": "01JB8Z1M6Q8E1X9V4S7K2R3T5A",
|
|
42
|
+
"type": "@kerfjs/ui:pane",
|
|
43
|
+
"zones": {
|
|
44
|
+
"header": [
|
|
45
|
+
{
|
|
46
|
+
"id": "01JB8Z1M6Q8E1X9V4S7K2R3T5B",
|
|
47
|
+
"type": "@kerfjs/ui:toolbar-text",
|
|
48
|
+
"props": { "label": { "$param": "title" }, "size": "xl" }
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- **`name`** is the PascalCase component name. Every generated identifier
|
|
57
|
+
derives from it (`renderInbox`, `InboxInputs`, `inboxContract`).
|
|
58
|
+
- **`catalogs`** lists the packages or catalog files whose components the
|
|
59
|
+
document uses.
|
|
60
|
+
- **`params`** are the document's typed inputs. A param with a `default` is an
|
|
61
|
+
optional input; one with `"optional": true` may be omitted.
|
|
62
|
+
- **`root`** is one node.
|
|
63
|
+
|
|
64
|
+
A **node** is `{ id, type, name?, props?, zones? }`. `type` is the component's
|
|
65
|
+
catalog key (`@kerfjs/ui:button`, or `package:id#Export` for an entry's second
|
|
66
|
+
export), or one of the built-ins `#text` and `#view` (another document). `id` is
|
|
67
|
+
an immutable ULID. A `name` (camelCase) makes the node a ref your code can
|
|
68
|
+
reach. `zones` maps each zone or content prop to its ordered children.
|
|
69
|
+
|
|
70
|
+
Prop values are JSON literals or one of these forms. There are no expressions:
|
|
71
|
+
a value that needs computing becomes a param.
|
|
72
|
+
|
|
73
|
+
| Form | Meaning |
|
|
74
|
+
| -------------------------- | --------------------------------------------------------------- |
|
|
75
|
+
| `{ "$param": "title" }` | A document param |
|
|
76
|
+
| `{ "$bind": "item.x" }` | A path into an enclosing `$each` item, or into a param |
|
|
77
|
+
| `{ "$action": "save" }` | An action name, on action props only; becomes a typed handler |
|
|
78
|
+
| `{ "$css": "space('m')" }` | One `@kerfjs/ui/css-values` builder call with literal arguments |
|
|
79
|
+
| `{ "$icon": "inbox" }` | A Lucide icon by its kebab-case name |
|
|
80
|
+
| `{ "$slot": "detail" }` | Content your application renders, inside a list or object value |
|
|
81
|
+
|
|
82
|
+
Zone children are nodes, `#text` runs, and three control-flow forms:
|
|
83
|
+
|
|
84
|
+
- **`$each`**: `{ "$each": <array>, "as": "item", "key": "item.id", "template": <node> }`
|
|
85
|
+
renders one keyed row per item. `template` may also be an `$if` chain that
|
|
86
|
+
picks a row design per item, or use `"templates"` plus `"kind"` to pick one
|
|
87
|
+
per item kind (a `default` entry is required).
|
|
88
|
+
- **`$if`**: `{ "$if": <boolean>, "then": <child>, "else"?: <child> }`.
|
|
89
|
+
- **`$slot`**: `{ "$slot": "detail" }`, a hole your application fills with
|
|
90
|
+
`SafeHtml`.
|
|
91
|
+
|
|
92
|
+
Editors and IDEs validate the shape with
|
|
93
|
+
[`view-document.schema.json`](../ai/view-document.schema.json); `validateView`
|
|
94
|
+
checks everything the schema cannot (below).
|
|
95
|
+
|
|
96
|
+
## The generated module
|
|
97
|
+
|
|
98
|
+
`kerf-ui-view generate inbox.kui.json` writes `inbox.view.ts`:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
export interface InboxInputs { readonly title?: string; … }
|
|
102
|
+
export type InboxAction = 'compose' | 'open-item';
|
|
103
|
+
export interface InboxHandlers { compose(context): void; 'open-item'(context): void }
|
|
104
|
+
export interface InboxSlots { detail(): SafeHtml }
|
|
105
|
+
export interface InboxRefs { readonly composeButton: HTMLElement; … }
|
|
106
|
+
export const inboxContract = 'kui1:5f0c2a9e7d41b3c8';
|
|
107
|
+
export function renderInbox(inputs: InboxInputs, slots: InboxSlots, rowKey?: string): SafeHtml;
|
|
108
|
+
export function wireInbox(root: HTMLElement, handlers: InboxHandlers): () => void;
|
|
109
|
+
export function inboxRefs(root: ParentNode): InboxRefs;
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Use it from your own file; never edit it:
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { mount } from 'kerfjs';
|
|
116
|
+
import { renderInbox, wireInbox } from './inbox.view.js';
|
|
117
|
+
|
|
118
|
+
mount(root, () =>
|
|
119
|
+
renderInbox(
|
|
120
|
+
{ title: 'Inbox', items: items.value },
|
|
121
|
+
{ detail: () => MessageDetail({ id: selectedId.value }) },
|
|
122
|
+
),
|
|
123
|
+
);
|
|
124
|
+
const dispose = wireInbox(root, {
|
|
125
|
+
compose: () => openComposer(),
|
|
126
|
+
'open-item': ({ key }) => (selectedId.value = key),
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- **Inputs** are the params. A missing required input is a compile error.
|
|
131
|
+
- **Handlers** need exactly one function per action, so adding an action in the
|
|
132
|
+
document fails your build until you handle it, and removing one turns the
|
|
133
|
+
leftover handler into an error. An action inside an `$each` row gets the
|
|
134
|
+
row's `key` in its context.
|
|
135
|
+
- **Slots** return `SafeHtml`, so escaping stays enforced.
|
|
136
|
+
- **Refs** resolve named nodes by their `data-kerf-node` marker. A named node
|
|
137
|
+
inside a row becomes a `(key) => Element | null` lookup.
|
|
138
|
+
|
|
139
|
+
### The contract
|
|
140
|
+
|
|
141
|
+
The **contract** is the module's public surface: its inputs, actions and their
|
|
142
|
+
scope, slots, refs, and row kinds. `<name>Contract` is its digest (`kui1:` plus
|
|
143
|
+
16 hex digits). Layout, literal prop values, text, and unnamed nodes are not
|
|
144
|
+
part of it, so a purely visual edit leaves the digest, and your code,
|
|
145
|
+
unchanged.
|
|
146
|
+
|
|
147
|
+
The module's three-line header records the generator version, the contract and
|
|
148
|
+
source digests, a digest of the module body, and the contract itself, so tools
|
|
149
|
+
can compare contracts without the old document.
|
|
150
|
+
|
|
151
|
+
## The `kerf-ui-view` CLI
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
npx kerf-ui-view generate src/**/*.kui.json # write each module beside its document
|
|
155
|
+
npx kerf-ui-view check src/**/*.kui.json # fail on a missing, stale, or hand-edited module
|
|
156
|
+
npx kerf-ui-view diff src/**/*.kui.json # print the contract changes regenerating would make
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
| Option | Effect |
|
|
160
|
+
| ---------------------- | ------------------------------------------------------------------ |
|
|
161
|
+
| `--target ts\|js` | `.view.ts` (default), or `.view.js` plus `.view.d.ts` for no-build |
|
|
162
|
+
| `--declarations-only` | Omit `render<Name>`, for documents rendered with `interpretView` |
|
|
163
|
+
| `--props <file>` | Add a `component-props.json` catalog (repeatable) |
|
|
164
|
+
| `--composition <file>` | Add a `component-composition.json` catalog (repeatable) |
|
|
165
|
+
| `--no-profile` | Skip the catalogs `.kerf-ui-profile.json` files declare |
|
|
166
|
+
|
|
167
|
+
The CLI loads Kerf UI's catalogs plus every package catalog the
|
|
168
|
+
`.kerf-ui-profile.json` files above a document declare. Run `check` in CI.
|
|
169
|
+
|
|
170
|
+
`diff` lists breaking changes first: a required input added, an input removed
|
|
171
|
+
or narrowed, an action added or removed, a slot changed, a ref removed or
|
|
172
|
+
retyped. Optional inputs, widened types, and new refs are non-breaking. Your
|
|
173
|
+
compiler then reports exactly the call sites a breaking change affects.
|
|
174
|
+
|
|
175
|
+
## Rendering documents at runtime
|
|
176
|
+
|
|
177
|
+
A server-driven application loads documents at runtime instead of generating
|
|
178
|
+
`render<Name>`. Generate with `--declarations-only` to keep the typed inputs,
|
|
179
|
+
handlers, refs, and contract, then render with `interpretView`:
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { mount } from 'kerfjs';
|
|
183
|
+
import { createViewCatalog, interpretView } from '@kerfjs/ui/view';
|
|
184
|
+
import { Pane } from '@kerfjs/ui/pane';
|
|
185
|
+
import { ToolbarText } from '@kerfjs/ui/toolbar-text';
|
|
186
|
+
import props from '@kerfjs/ui/ai/component-props.json';
|
|
187
|
+
import composition from '@kerfjs/ui/ai/component-composition.json';
|
|
188
|
+
import { inboxContract } from './inbox.view.js';
|
|
189
|
+
|
|
190
|
+
const catalog = createViewCatalog({ props: [props], composition: [composition] });
|
|
191
|
+
|
|
192
|
+
mount(root, () =>
|
|
193
|
+
interpretView(served, {
|
|
194
|
+
catalog,
|
|
195
|
+
components: {
|
|
196
|
+
'@kerfjs/ui:pane': Pane,
|
|
197
|
+
'@kerfjs/ui:toolbar-text': ToolbarText,
|
|
198
|
+
},
|
|
199
|
+
inputs: { title: 'Inbox' },
|
|
200
|
+
contract: inboxContract,
|
|
201
|
+
// Render an app-owned notice instead of throwing (log `error.contract`).
|
|
202
|
+
onMismatch: (error) => updateRequiredNotice(error),
|
|
203
|
+
}),
|
|
204
|
+
);
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`interpretView` validates the document and compares its contract digest with
|
|
208
|
+
the one your code compiled against. On a mismatch it throws a
|
|
209
|
+
`KuiContractMismatch` (with `expected`, `actual`, and the served `contract`), or
|
|
210
|
+
renders `onMismatch`'s fallback, so a server-side edit never silently breaks a
|
|
211
|
+
deployed client. Pass every component the document uses explicitly, so the
|
|
212
|
+
bundle stays static; pass `icons` (Lucide name to icon data) for `$icon`
|
|
213
|
+
values and `resolveView` for `#view` nodes. Its output matches the generated
|
|
214
|
+
module byte for byte.
|
|
215
|
+
|
|
216
|
+
## Validating documents
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
import { createViewCatalog, validateView } from '@kerfjs/ui/view';
|
|
220
|
+
|
|
221
|
+
const catalog = createViewCatalog({ props: [props], composition: [composition] });
|
|
222
|
+
const { valid, diagnostics, hints, actions } = validateView(document, catalog, {
|
|
223
|
+
resolveView: (src, path) => readDocument(path),
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Each diagnostic is `{ code, path, message }` with a stable code (`KUI-V001` to
|
|
228
|
+
`KUI-V017` for the document, `KUI-L2##` for composition rules); `hints` are
|
|
229
|
+
non-blocking advice (`KUI-H###`). `validateView` is pure and has no Node APIs,
|
|
230
|
+
so it runs in the browser. Add your own component package's catalogs to
|
|
231
|
+
`props` and `composition` (write `component-props.json` with `kerf-ui-props`).
|
|
232
|
+
|
|
233
|
+
## Never edit a generated module
|
|
234
|
+
|
|
235
|
+
`eslint-plugin-kerfjs`'s `kerfjs/no-generated-view-edits` rule reports a
|
|
236
|
+
`*.view.ts` / `*.view.js` file whose body no longer matches the digest in its
|
|
237
|
+
header. It needs no access to the document. The fix is always to regenerate;
|
|
238
|
+
to change the view, edit the document (in the editor, or as JSON) and run
|
|
239
|
+
`kerf-ui-view generate`.
|
|
240
|
+
|
|
241
|
+
## The `@kerfjs/ui/view` API
|
|
242
|
+
|
|
243
|
+
**Documents and rendering**
|
|
244
|
+
|
|
245
|
+
| Export | Use |
|
|
246
|
+
| ------------------------------------------- | ---------------------------------------------------------------------- |
|
|
247
|
+
| `createViewCatalog({ props, composition })` | Index component catalogs for the functions below |
|
|
248
|
+
| `validateView(document, catalog, options?)` | Diagnostics, hints, and the action scopes |
|
|
249
|
+
| `interpretView(document, options)` | Render a served document after its contract check |
|
|
250
|
+
| `KuiContractMismatch` | The error `interpretView` throws on a contract mismatch |
|
|
251
|
+
| `previewView(document, options)` | An editor's lenient preview: no validation, placeholders for bad nodes |
|
|
252
|
+
| `generateView(document, catalog, options?)` | The module source, declarations, contract, and digest |
|
|
253
|
+
| `GENERATOR_VERSION` | The generator version a header records |
|
|
254
|
+
| `readViewHeader(code)` | Parse a module header; `intact` is false after a hand edit |
|
|
255
|
+
| `viewModulePath(path, target?)` | `x.kui.json` to `x.view.ts` (or `.view.js`) |
|
|
256
|
+
| `composedViewPath(from, src)` | Where a `#view` `src` points, as `resolveView` receives it |
|
|
257
|
+
| `VIEW_DOCUMENT_SCHEMA_ID` | `'kerf-ui-document/v1'` |
|
|
258
|
+
|
|
259
|
+
**Contracts**
|
|
260
|
+
|
|
261
|
+
| Export | Use |
|
|
262
|
+
| ------------------------------- | ----------------------------------------------------------- |
|
|
263
|
+
| `contractOf(document, catalog)` | The contract of a valid document |
|
|
264
|
+
| `contractDigest(contract)` | Its `kui1:` digest |
|
|
265
|
+
| `diffContracts(before, after)` | Every change, each marked breaking or not |
|
|
266
|
+
| `serializeContract(contract)` | The contract line a header records |
|
|
267
|
+
| `canonicalJson(value)` | JSON with sorted keys and no whitespace, as digests hash it |
|
|
268
|
+
| `viewDigest(text)` | The `kui1:` hash of any text |
|
|
269
|
+
| `typeText(type)` | The TypeScript spelling of a param or slot-input type |
|
|
270
|
+
|
|
271
|
+
**Building tools on the format.** These serve editors and other tools that
|
|
272
|
+
read or change documents; `@kerfjs/ui/editor` uses each of them.
|
|
273
|
+
|
|
274
|
+
| Export | Use |
|
|
275
|
+
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
276
|
+
| `walkView(document, visit)` | Visit every node (with whether it is inside a row); returns slot names |
|
|
277
|
+
| `childKind(child)` / `classifyChild(child)` | A zone child's kind (`each`, `if`, `slot`, `view`, `node`); `classifyChild` pairs it with the child so a TypeScript `switch` narrows it |
|
|
278
|
+
| `createMoveCheck(document, catalog, id)` | Whether moving a node adds a problem, without a full validation |
|
|
279
|
+
| `isAssignable(from, to)` / `isLiteralOf(value, type)` | Type checks in the catalog's type grammar |
|
|
280
|
+
| `fieldZoneOf(component, definitions, key)` | Which prop field a field-zone key (`leftRail.content`) fills |
|
|
281
|
+
| `channelOf(component)` | How a component carries `data-*` attributes |
|
|
282
|
+
| `dataAttributeProblem(key)` | Why a `rootAttributes` key is not allowed, or undefined |
|
|
283
|
+
| `parseCssCall(source)` / `parseCssTree(source)` | Parse a `$css` value: its helper names, or its call tree |
|
|
284
|
+
| `lucideExportName(name)` | Lucide's export name for an icon (`a-arrow-down` to `AArrowDown`) |
|
|
285
|
+
|
|
286
|
+
The types (`ViewDocument`, `ViewNode`, `ViewChild`, `ViewEachChild`,
|
|
287
|
+
`ViewIfChild`, `ViewSlotChild`, `ViewType`, `ViewValue`, `ViewCatalog`,
|
|
288
|
+
`ViewDiagnostic`, `ViewValidation`, `ViewContract`, `ViewContractChange`,
|
|
289
|
+
`GeneratedView`) are exported alongside.
|
|
290
|
+
|
|
291
|
+
## See also
|
|
292
|
+
|
|
293
|
+
- [Editor host](./editor-host.md): run the editor in your app's dev server.
|
|
294
|
+
- [`view-document.schema.json`](../ai/view-document.schema.json): the shape
|
|
295
|
+
schema for editors and IDEs.
|
package/docs/webawesome-theme.md
CHANGED
|
@@ -19,6 +19,22 @@ panel or ResizableRegion gives an open raw dropdown) ship only in this
|
|
|
19
19
|
bridge, so a Kerf-only bundle carries none of them. The consumer-bundle tests and the
|
|
20
20
|
`webawesome-optional` browser spec enforce all of this.
|
|
21
21
|
|
|
22
|
+
**No network by default.** No Kerf component requests anything
|
|
23
|
+
at runtime: every icon a component draws is bundled Lucide SVG, and no
|
|
24
|
+
component renders a Web Awesome element, so a Kerf-only page works offline
|
|
25
|
+
and in a self-contained tool. The `no-network` browser spec loads every Kerf
|
|
26
|
+
component's catalog demo and fails on any request off the page's own origin.
|
|
27
|
+
Web Awesome's own `wa-icon` (and every element that draws its icons through
|
|
28
|
+
it) resolves its default icon library from Font Awesome's CDN. An
|
|
29
|
+
application that renders Web Awesome elements itself owns that: register a
|
|
30
|
+
local library before they render:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { registerIconLibrary } from "@awesome.me/webawesome/dist/webawesome.js";
|
|
34
|
+
|
|
35
|
+
registerIconLibrary("default", { resolver: (name) => `/icons/${name}.svg` });
|
|
36
|
+
```
|
|
37
|
+
|
|
22
38
|
**Supported versions.** `@kerfjs/ui` supports every Web Awesome 3.x release
|
|
23
39
|
from 3.14 (its optional peer range is `^3.14.0`). No Kerf component patches
|
|
24
40
|
Web Awesome's internals any more: `PopupMenu`, `Select`, and `DialogSurface`
|
package/doctor/cli.mjs
CHANGED
|
@@ -7,23 +7,11 @@ import { resolve } from 'node:path';
|
|
|
7
7
|
import process from 'node:process';
|
|
8
8
|
import { promisify } from 'node:util';
|
|
9
9
|
|
|
10
|
+
import { parseCliArguments, wantsHelp } from '../scripts/lib/cli-args.mjs';
|
|
10
11
|
import { formatUiDoctorText, runUiDoctor, UI_DOCTOR_EXIT } from './index.mjs';
|
|
11
12
|
|
|
12
13
|
const execFileAsync = promisify(execFile);
|
|
13
14
|
const args = process.argv.slice(2);
|
|
14
|
-
const take = (name, repeat = false) => {
|
|
15
|
-
const values = [];
|
|
16
|
-
while (args.includes(name)) {
|
|
17
|
-
const index = args.indexOf(name);
|
|
18
|
-
const value = args[index + 1];
|
|
19
|
-
if (!value || value.startsWith('--'))
|
|
20
|
-
throw new Error(`${name} requires a value.`);
|
|
21
|
-
args.splice(index, 2);
|
|
22
|
-
values.push(value);
|
|
23
|
-
if (!repeat) break;
|
|
24
|
-
}
|
|
25
|
-
return repeat ? values : values[0];
|
|
26
|
-
};
|
|
27
15
|
|
|
28
16
|
async function changedPaths(root) {
|
|
29
17
|
const { stdout: tracked } = await execFileAsync(
|
|
@@ -42,7 +30,7 @@ async function changedPaths(root) {
|
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
try {
|
|
45
|
-
if (
|
|
33
|
+
if (wantsHelp(args)) {
|
|
46
34
|
console.log(`Usage: kerf-ui-doctor [--full | --changed] [options]
|
|
47
35
|
|
|
48
36
|
Options:
|
|
@@ -57,27 +45,44 @@ Options:
|
|
|
57
45
|
--fail-on <severity> error, review, or warning (default: error)
|
|
58
46
|
--output <path> Also write the merged report
|
|
59
47
|
--no-cache Disable the content-addressed cache
|
|
48
|
+
-h, --help Show this help
|
|
60
49
|
|
|
61
50
|
Exit codes: 0 clean, 1 findings, 2 configuration/tool failure, 130 cancelled.`);
|
|
62
51
|
process.exit(0);
|
|
63
52
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
53
|
+
const { options } = parseCliArguments(args, {
|
|
54
|
+
values: {
|
|
55
|
+
'--root': 'root',
|
|
56
|
+
'--package': 'package',
|
|
57
|
+
'--path': 'paths',
|
|
58
|
+
'--config': 'config',
|
|
59
|
+
'--browser-url': 'browserUrl',
|
|
60
|
+
'--browser': 'browser',
|
|
61
|
+
'--eslint': 'eslint',
|
|
62
|
+
'--format': 'format',
|
|
63
|
+
'--fail-on': 'failOn',
|
|
64
|
+
'--output': 'output',
|
|
65
|
+
},
|
|
66
|
+
repeatable: ['--path'],
|
|
67
|
+
flags: {
|
|
68
|
+
'--full': 'full',
|
|
69
|
+
'--changed': 'changed',
|
|
70
|
+
'--no-cache': 'noCache',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
const root = resolve(options.root ?? process.cwd());
|
|
74
|
+
const packageSelector = options.package;
|
|
75
|
+
const explicitPaths = options.paths;
|
|
76
|
+
const configPath = options.config;
|
|
77
|
+
const url = options.browserUrl;
|
|
78
|
+
const browserList = options.browser;
|
|
79
|
+
const eslintConfig = options.eslint ?? 'recommended-ui';
|
|
80
|
+
const format = options.format ?? 'text';
|
|
81
|
+
const failOn = options.failOn;
|
|
82
|
+
const output = options.output;
|
|
83
|
+
const full = options.full === true;
|
|
84
|
+
const changed = options.changed === true;
|
|
85
|
+
const noCache = options.noCache === true;
|
|
81
86
|
if (full && changed)
|
|
82
87
|
throw new Error('--full and --changed are mutually exclusive.');
|
|
83
88
|
if (!['text', 'json'].includes(format))
|