@kerfjs/ui 5.0.0-beta.23 → 5.0.0-beta.25
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 +45 -23
- package/ai/application-ui-diagnostic-ids-v1.json +3 -0
- package/ai/application-ui-profile.defaults.json +1 -1
- package/ai/compile-time-contracts-v1.json +5 -12
- package/ai/component-catalog-v2-overrides.json +12 -49
- package/ai/component-catalog-v2.d.ts +1 -0
- package/ai/component-catalog-v2.json +458 -123
- package/ai/component-catalog-v2.schema.json +2 -1
- package/ai/component-catalog.json +658 -195
- package/ai/public-api-signatures-v1.md +160 -80
- package/ai/skill.md +22 -22
- package/ai/webawesome-jsx-signatures-v1.md +2 -1
- package/analyzer/cli.mjs +5 -2
- package/analyzer/index.d.mts +1 -0
- package/analyzer/index.mjs +117 -10
- package/dist/app-tab.d.ts +10 -2
- package/dist/app-tab.js +1 -1
- package/dist/browser/list-action-row.js +1 -0
- package/dist/browser/list-item.js +1 -0
- package/dist/browser/list.js +3 -0
- package/dist/browser/surface-scaffold.js +3 -0
- package/dist/catalog.d.ts +8 -4
- package/dist/catalog.js +21 -11
- package/dist/catalog.js.map +1 -1
- package/dist/{chunk-ELSJX4W7.js → chunk-4EF2CMYS.js} +25 -6
- package/dist/chunk-4EF2CMYS.js.map +1 -0
- package/dist/{chunk-OHU6CI22.js → chunk-B3A3IVO5.js} +2 -2
- package/dist/{chunk-OHU6CI22.js.map → chunk-B3A3IVO5.js.map} +1 -1
- package/dist/{chunk-K57KRAOV.js → chunk-FRVS5RFM.js} +24 -6
- package/dist/chunk-FRVS5RFM.js.map +1 -0
- package/dist/{chunk-DSNIYOZ3.js → chunk-GWEAPEZI.js} +16 -3
- package/dist/chunk-GWEAPEZI.js.map +1 -0
- package/dist/chunk-HP2B2L26.js +102 -0
- package/dist/chunk-HP2B2L26.js.map +1 -0
- package/dist/{chunk-OZWU5ZPZ.js → chunk-IJBSZ4NX.js} +2 -2
- package/dist/{chunk-OZWU5ZPZ.js.map → chunk-IJBSZ4NX.js.map} +1 -1
- package/dist/chunk-J5BFYY7Q.js +35 -0
- package/dist/chunk-J5BFYY7Q.js.map +1 -0
- package/dist/{chunk-GP5DP5DL.js → chunk-JFGXQBIP.js} +85 -24
- package/dist/chunk-JFGXQBIP.js.map +1 -0
- package/dist/{chunk-QQFJMRIB.js → chunk-KWWR5VMS.js} +2 -2
- package/dist/{chunk-QQFJMRIB.js.map → chunk-KWWR5VMS.js.map} +1 -1
- package/dist/chunk-OBLTAKSX.js +43 -0
- package/dist/chunk-OBLTAKSX.js.map +1 -0
- package/dist/{chunk-PIDTEQ3U.js → chunk-OT6RPYAP.js} +17 -3
- package/dist/chunk-OT6RPYAP.js.map +1 -0
- package/dist/{chunk-W7YD6E4N.js → chunk-R7ZWUN64.js} +2 -2
- package/dist/{chunk-W7YD6E4N.js.map → chunk-R7ZWUN64.js.map} +1 -1
- package/dist/{chunk-PZQVSDLH.js → chunk-RKVQEH4J.js} +1 -1
- package/dist/chunk-RKVQEH4J.js.map +1 -0
- package/dist/{chunk-7L6EHUMV.js → chunk-SYDMYBPG.js} +3 -3
- package/dist/chunk-SYDMYBPG.js.map +1 -0
- package/dist/{chunk-W4CXQYSG.js → chunk-TB6DY7H5.js} +3 -1
- package/dist/chunk-TB6DY7H5.js.map +1 -0
- package/dist/{chunk-AASLYRGE.js → chunk-UKKSMZYT.js} +18 -7
- package/dist/chunk-UKKSMZYT.js.map +1 -0
- package/dist/{chunk-BBRXX6PF.js → chunk-VCE4MPVE.js} +26 -4
- package/dist/chunk-VCE4MPVE.js.map +1 -0
- package/dist/{chunk-VLYV65LK.js → chunk-W5L2JSBY.js} +5 -3
- package/dist/chunk-W5L2JSBY.js.map +1 -0
- package/dist/{chunk-5VTB2BKP.js → chunk-WNWD54GR.js} +16 -2
- package/dist/chunk-WNWD54GR.js.map +1 -0
- package/dist/{chunk-M7JBER5U.js → chunk-X2U3QJCJ.js} +8 -2
- package/dist/chunk-X2U3QJCJ.js.map +1 -0
- package/dist/{chunk-DPDBVKNA.js → chunk-YMKH5XTF.js} +5 -3
- package/dist/chunk-YMKH5XTF.js.map +1 -0
- package/dist/collapsible-panel.d.ts +9 -1
- package/dist/collapsible-panel.js +36 -15
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/divider-sides-267FA7sY.d.ts +4 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +20 -19
- package/dist/list-action-row.d.ts +11 -1
- package/dist/list-action-row.js +2 -1
- package/dist/list-header.d.ts +15 -2
- package/dist/list-header.js +1 -1
- package/dist/list-item.d.ts +12 -1
- package/dist/list-item.js +2 -1
- package/dist/list.d.ts +19 -0
- package/dist/list.js +3 -0
- package/dist/list.js.map +1 -0
- package/dist/nav-stack.js +1 -1
- package/dist/resizable-region.d.ts +19 -2
- package/dist/resizable-region.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select.d.ts +12 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/split-view.js +2 -2
- package/dist/state-banner.d.ts +4 -2
- package/dist/state-banner.js +1 -1
- package/dist/styles/app-tab.css +26 -0
- package/dist/styles/catalog.css +8 -2
- package/dist/styles/collapsible-panel.css +66 -4
- package/dist/styles/list-action-row.css +64 -0
- package/dist/styles/list-header.css +32 -0
- package/dist/styles/list-item.css +45 -6
- package/dist/styles/list.css +43 -0
- package/dist/styles/resizable-region.css +132 -0
- package/dist/styles/select.css +68 -0
- package/dist/styles/state-banner.css +32 -1
- package/dist/styles/styles.css +2 -1
- package/dist/styles/sunken-panel.css +4 -0
- package/dist/styles/surface-scaffold.css +51 -0
- package/dist/styles/tab-bar.css +24 -0
- package/dist/styles/toolbar-control-group.css +73 -1
- package/dist/styles/toolbar-text.css +1 -1
- package/dist/styles/toolbar.css +38 -2
- package/dist/styles/webawesome.css +12 -0
- package/dist/styles/workbench.css +89 -0
- package/dist/sunken-panel.d.ts +5 -2
- package/dist/sunken-panel.js +1 -1
- package/dist/surface-scaffold.d.ts +25 -0
- package/dist/surface-scaffold.js +3 -0
- package/dist/surface-scaffold.js.map +1 -0
- package/dist/tab-bar.d.ts +11 -2
- package/dist/tab-bar.js +1 -1
- package/dist/toolbar-control-group.d.ts +16 -2
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar-text.js +1 -1
- package/dist/toolbar.d.ts +5 -3
- package/dist/toolbar.js +1 -1
- package/dist/value-table.js +1 -1
- package/dist/webawesome.d.ts +1 -0
- package/dist/wire-catalog.d.ts +4 -2
- package/dist/wire-catalog.js +95 -36
- package/dist/wire-catalog.js.map +1 -1
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-sidebar.d.ts +6 -1
- package/dist/wire-sidebar.js +27 -8
- package/dist/wire-sidebar.js.map +1 -1
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-token-search-fields.d.ts +1 -1
- package/dist/wire-token-search-fields.js +1 -1
- package/dist/workbench.d.ts +8 -0
- package/dist/workbench.js +42 -0
- package/dist/workbench.js.map +1 -1
- package/docs/accessibility.md +67 -15
- package/docs/catalog.md +17 -12
- package/docs/collapsible-panel.md +7 -0
- package/docs/component-contract.md +19 -9
- package/docs/component-selection.md +65 -31
- 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 -7
- package/docs/design/templates/empty-state.svg +1 -7
- package/docs/design/templates/list/compact-dark.svg +1 -0
- package/docs/design/templates/list/compact.svg +1 -0
- package/docs/design/templates/list/stack-dark.svg +1 -0
- package/docs/design/templates/list/stack.svg +1 -0
- 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/selected-dark.svg +1 -1
- package/docs/design/templates/list-action-row/selected.svg +1 -1
- package/docs/design/templates/list-action-row-dark.svg +1 -7
- package/docs/design/templates/list-action-row.svg +1 -7
- package/docs/design/templates/list-dark.svg +1 -0
- 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/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 -11
- package/docs/design/templates/list-header.svg +1 -11
- 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/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 -11
- package/docs/design/templates/list-item.svg +1 -11
- package/docs/design/templates/list.svg +1 -0
- package/docs/design/templates/segmented-control-dark.svg +1 -7
- package/docs/design/templates/segmented-control.svg +1 -7
- package/docs/design/templates/skeleton-dark.svg +1 -9
- package/docs/design/templates/skeleton.svg +1 -9
- 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 -0
- package/docs/design/templates/state-banner/info-badge.svg +1 -0
- 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/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 -11
- package/docs/design/templates/state-banner.svg +1 -11
- 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 -5
- package/docs/design/templates/tab-bar.svg +1 -5
- package/docs/design/templates/token-search-field/empty-dark.svg +1 -1
- package/docs/design/templates/token-search-field/empty.svg +1 -1
- package/docs/design/templates/token-search-field/tokens-dark.svg +1 -1
- package/docs/design/templates/token-search-field/tokens.svg +1 -1
- package/docs/design/templates/token-search-field-dark.svg +1 -7
- package/docs/design/templates/token-search-field.svg +1 -7
- 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-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/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/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 -11
- package/docs/design/templates/toolbar-control-group.svg +1 -11
- package/docs/design/templates/toolbar-dark.svg +1 -5
- package/docs/design/templates/toolbar-text-dark.svg +1 -9
- package/docs/design/templates/toolbar-text.svg +1 -9
- package/docs/design/templates/toolbar.svg +1 -5
- 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 -5
- package/docs/design/templates/value-table.svg +1 -5
- package/docs/design/templates.md +29 -20
- package/docs/examples/component-catalog-extension-v2.json +3 -6
- package/docs/examples/component-catalog-extension.json +1 -1
- package/docs/layout.md +7 -9
- package/docs/recipes.md +8 -7
- package/docs/sunken-panel.md +11 -1
- package/docs/surface-scaffold.md +17 -0
- package/docs/type-contracts.md +11 -10
- package/docs/ui-analyzer.md +19 -1
- package/docs/ui-doctor.md +7 -5
- package/docs/ux-demo.md +6 -3
- package/docs/webawesome-theme.md +4 -1
- package/docs/workbench.md +49 -2
- package/doctor/eslint-diagnostics.d.mts +16 -0
- package/doctor/eslint-diagnostics.mjs +17 -0
- package/doctor/index.mjs +21 -3
- package/llms.txt +33 -11
- package/package.json +14 -8
- package/traversal-exclusions.mjs +7 -1
- package/ux-demo/recipes/app-shell.tsx +36 -23
- package/ux-demo/recipes/collapsible-sidebar.tsx +23 -17
- package/ux-demo/recipes/composer-form.tsx +15 -6
- package/ux-demo/recipes/list-detail-dialog.tsx +31 -15
- package/ux-demo/recipes/list-workspace-states.tsx +16 -7
- package/ux-demo/recipes/loading-inspector.tsx +39 -18
- package/ux-demo/recipes/navigation-sidebar.tsx +1 -1
- package/ux-demo/recipes/recipes.css +7 -2
- package/ux-demo/recipes/workspace-header.tsx +17 -7
- package/dist/browser/panel-header.js +0 -7
- package/dist/chunk-5VTB2BKP.js.map +0 -1
- package/dist/chunk-7L6EHUMV.js.map +0 -1
- package/dist/chunk-AASLYRGE.js.map +0 -1
- package/dist/chunk-BBRXX6PF.js.map +0 -1
- package/dist/chunk-DPDBVKNA.js.map +0 -1
- package/dist/chunk-DSNIYOZ3.js.map +0 -1
- package/dist/chunk-ELSJX4W7.js.map +0 -1
- package/dist/chunk-GP5DP5DL.js.map +0 -1
- package/dist/chunk-K57KRAOV.js.map +0 -1
- package/dist/chunk-M7JBER5U.js.map +0 -1
- package/dist/chunk-NENBUYX5.js +0 -79
- package/dist/chunk-NENBUYX5.js.map +0 -1
- package/dist/chunk-PIDTEQ3U.js.map +0 -1
- package/dist/chunk-PZQVSDLH.js.map +0 -1
- package/dist/chunk-RYRIFZCT.js +0 -58
- package/dist/chunk-RYRIFZCT.js.map +0 -1
- package/dist/chunk-VLYV65LK.js.map +0 -1
- package/dist/chunk-W4CXQYSG.js.map +0 -1
- package/dist/panel-header.d.ts +0 -42
- package/dist/panel-header.js +0 -7
- package/dist/panel-header.js.map +0 -1
- package/dist/styles/panel-header.css +0 -64
- package/docs/design/templates/panel-header/icon-actions-dark.svg +0 -1
- package/docs/design/templates/panel-header/icon-actions.svg +0 -1
- package/docs/design/templates/panel-header/icon-summary-actions-dark.svg +0 -1
- package/docs/design/templates/panel-header/icon-summary-actions.svg +0 -1
- package/docs/design/templates/panel-header/no-icon-dark.svg +0 -1
- package/docs/design/templates/panel-header/no-icon.svg +0 -1
- package/docs/design/templates/panel-header/page-heading-dark.svg +0 -1
- package/docs/design/templates/panel-header/page-heading.svg +0 -1
- package/docs/design/templates/panel-header/title-only-dark.svg +0 -1
- package/docs/design/templates/panel-header/title-only.svg +0 -1
- package/docs/design/templates/panel-header-dark.svg +0 -13
- package/docs/design/templates/panel-header.svg +0 -13
package/ai/skill.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kerf-ui
|
|
3
3
|
description: Build interfaces with kerfjs and the @kerfjs/ui production component package. Use whenever code imports @kerfjs/ui or a task asks for Kerf UI components.
|
|
4
|
-
kerf-ui-skill-version: 1.36.
|
|
4
|
+
kerf-ui-skill-version: 1.36.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Building with @kerfjs/ui
|
|
@@ -63,18 +63,18 @@ Choose from the need, not from visual resemblance:
|
|
|
63
63
|
|
|
64
64
|
Quick routing:
|
|
65
65
|
|
|
66
|
-
| Need | Choose | Nearest alternatives / boundary
|
|
67
|
-
| ------------------------------------- | ---------------------------------------------------------- |
|
|
68
|
-
| Navigation row | `ListItem` | Use an ordinary link or button when sidebar/menu anatomy and state do not apply. Multiline leading icons stay aligned with the first text line.
|
|
69
|
-
| Navigation row with a trailing action | `ListActionRow` | Use `ListItem` when the trailing region is dormant; never put controls inside either component's SafeHtml slots. Multiline leading icons stay aligned with the first text line.
|
|
70
|
-
| Page, panel, or dialog heading | `Toolbar`
|
|
71
|
-
| Exclusive choice | `TabBar`, `SegmentedControl`, or `Select` | Tabs switch tabpanels; segments expose a few choices; Select handles a longer value list.
|
|
72
|
-
| Status or absent content | `StateBanner` or `EmptyState` | Web Awesome callouts suit ecosystem content; toasts are transient and never the only record of important state.
|
|
73
|
-
| Loading placeholder | a component's `placeholder` prop, or `Skeleton` | Set `placeholder` on a value-bearing component (`Select`, `ListHeader`, `ListItem`, `ValueTableRow`, `
|
|
74
|
-
| Adjustable or static columns | `ResizableRegion` or CSS grid | Use the component only for a user-operable controlled separator.
|
|
75
|
-
| Structured or ordinary search | `TokenSearchField` or an input | Use token search only when text and ordered filter chips form one editor.
|
|
76
|
-
| Key/value facts | `ValueTable` with `ValueTableRow` | Use rows with `icon` only when the optional 24px leading visual adds context.
|
|
77
|
-
| Command search | Application-local semantics using shared layout vocabulary | No runtime component or production recipe is exported; the app owns behavior, policy, and copy.
|
|
66
|
+
| Need | Choose | Nearest alternatives / boundary |
|
|
67
|
+
| ------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
68
|
+
| Navigation row | `ListItem` | Use an ordinary link or button when sidebar/menu anatomy and state do not apply. Multiline leading icons stay aligned with the first text line. |
|
|
69
|
+
| Navigation row with a trailing action | `ListActionRow` | Use `ListItem` when the trailing region is dormant; never put controls inside either component's SafeHtml slots. Multiline leading icons stay aligned with the first text line. |
|
|
70
|
+
| Page, panel, or dialog heading | `Toolbar` + `ToolbarText` | Use a direct extra-large `ToolbarText`, optional grouped icon, grouped trailing controls, and app-owned supporting copy below. |
|
|
71
|
+
| Exclusive choice | `TabBar`, `SegmentedControl`, or `Select` | Tabs switch tabpanels; segments expose a few choices; Select handles a longer value list. |
|
|
72
|
+
| Status or absent content | `StateBanner` or `EmptyState` | `StateBanner` accepts an optional terse, tone-tinted `badge` beside its title for a count or compact status; do not rely on color alone. Web Awesome callouts suit ecosystem content; toasts are transient and never the only record of important state. |
|
|
73
|
+
| Loading placeholder | a component's `placeholder` prop, or `Skeleton` | Set `placeholder` on a value-bearing component (`Select`, `ListHeader`, `ListItem`, `ValueTableRow`, `SegmentedControl`, `StateBanner`, `AppTab`, `ToolbarText`, `ListActionRow`) to render its real chrome with value slots as subtle **unanimated** skeletons and interactivity disabled — do not hand-rebuild an empty state. `Skeleton` is the standalone block for a custom slot. Use `LoadingSpinner` for known busy activity, not a skeleton; never animate a skeleton; prefer it over `wa-skeleton`. |
|
|
74
|
+
| Adjustable or static columns | `ResizableRegion` or CSS grid | Use the component only for a user-operable controlled separator. |
|
|
75
|
+
| Structured or ordinary search | `TokenSearchField` or an input | Use token search only when text and ordered filter chips form one editor. |
|
|
76
|
+
| Key/value facts | `ValueTable` with `ValueTableRow` | Use rows with `icon` only when the optional 24px leading visual adds context. |
|
|
77
|
+
| Command search | Application-local semantics using shared layout vocabulary | No runtime component or production recipe is exported; the app owns behavior, policy, and copy. |
|
|
78
78
|
|
|
79
79
|
For a complete shell, sidebar, workspace header, list-detail dialog, composer
|
|
80
80
|
form, list-state lifecycle, or mixed-control toolbar, start from the runnable
|
|
@@ -97,21 +97,21 @@ Hard rules:
|
|
|
97
97
|
3. Keep state, product copy, persistence, and domain mappings in the application. Do not add product-specific actions or fields to a generic component. Put ListItem/ListActionRow/ListHeader/AppTab domain `data-*` metadata in `rootAttributes`; use ListActionRow `trailingActionAttributes` and ListHeader `triggerAttributes` only for domain `data-*` or native popover target/action and `aria-controls`/`aria-haspopup`. These slots do not replace component-owned action, item/tab identity, selection, disclosure, naming, disabled, icon, or role semantics.
|
|
98
98
|
4. Wire `data-action` hooks from one stable root with `delegate()` or `delegateActions()` and retain disposers.
|
|
99
99
|
5. Use the opinionated `--kui-color-*` semantic ramps and component-level override properties. Override tokens at the narrowest useful scope and prefer equivalent props/tokens. Public-class-to-public-class selectors are supported when every Kerf class appears in the catalog entry's `publicClasses`; never target descendant tags, ids, attribute-only anatomy, or unlisted implementation classes.
|
|
100
|
-
6. `Select` is pure until the app explicitly imports `@kerfjs/ui/select/register`; do not import Web Awesome's full registration bundle. When an app writes direct `wa-*` JSX, add `import type {} from '@kerfjs/ui/webawesome'` for the catalog-supported intrinsic-element declarations, import the CSS-only `@kerfjs/ui/webawesome.css` theme once, and keep importing individual Web Awesome component modules so their JavaScript remains tree-shakeable. The type boundary emits no code and registers nothing. Pass icon-bearing `choices` and `renderSelected` content normally: `Select` preserves its slotted option icons across Kerf rerenders and keys selected content by the controlled value, so app wrappers must not add competing morph-control attributes.
|
|
100
|
+
6. `Select` is pure until the app explicitly imports `@kerfjs/ui/select/register`; do not import Web Awesome's full registration bundle. When an app writes direct `wa-*` JSX, add `import type {} from '@kerfjs/ui/webawesome'` for the catalog-supported intrinsic-element declarations, import the CSS-only `@kerfjs/ui/webawesome.css` theme once, and keep importing individual Web Awesome component modules so their JavaScript remains tree-shakeable. The type boundary emits no code and registers nothing. Pass icon-bearing `choices` and `renderSelected` content normally: `Select` preserves its slotted option icons across Kerf rerenders and keys selected content by the controlled value, so app wrappers must not add competing morph-control attributes. Give it a visible `label` or an `ariaLabel` for a visually hidden name; the nonempty visible label takes precedence and the package names the actual shadow combobox, including `renderSelected`, without adding label geometry. Use `hint` for persistent supporting text below the control and `placeholderText` only for the empty value inside the closed control; loading placeholders retain the hint.
|
|
101
101
|
7. Decorative icons are hidden; controls are named; focus is visible; state never relies on color alone; reduced motion and increased contrast remain usable. `DisclosureArrow` defaults to an 18px root-scaled visual and exposes `--kui-disclosure-arrow-size` for consumer sizing; it never becomes the interaction or accessible-name owner. Put it in an owning native control with a stable accessible name and controlled `aria-expanded`. `ListHeader` toggle mode supplies it when `actionIcon` is omitted, but the app must reveal matching content; a custom icon replaces it. Author replacement icon content facing right before its configured direction transform is applied. Direction changes take the shortest rotation path, with counterclockwise chosen for a 180-degree closed-to-open tie. Kerf `Select` separately keeps its intrinsic Web Awesome expand glyph at `--kui-disclosure-icon-scale: .5`.
|
|
102
102
|
8. `ResizableRegion` uses `wireResizableRegions()` for Arrow, Shift+Arrow, Home/End, and pointer behavior. The app owns size persistence. `handleIcon` replaces decorative dormant glyph content only.
|
|
103
103
|
9. Use controlled `SegmentedControl` for a small exclusive choice set. Select `appearance="toolbar"` when nesting it inside `ToolbarControlGroup`; use rounded or pill shapes for standalone contexts. Handle its action, update `value`, keep meaningful choice labels, and preserve every enabled native button in sequential Tab order.
|
|
104
|
-
10. Compose `AppTab` inside controlled `TabBar`; call `wireTabBars()` once and retain its disposer. It owns same-bar drag mechanics, including proximity-based horizontal edge autoscroll, while the app applies `onReorder` and owns order, selection, panels, close policy, routing, and persistence. Arrow/Home/End select on move by default; pass `activation: 'manual'` (or `TabBar activation="manual"` per strip) so arrow keys move focus only and the user selects with Enter/Space/click — use it when selecting a tab is a heavy action. Use runtime-filtered `rootAttributes` for domain metadata and keep an optional `closeIcon` decorative and noninteractive.
|
|
105
|
-
11. Use token-controlled `TokenSearchField` when free text and removable structured filters share one editor. Editable text stays DOM-owned between token changes. The leading icon, first text line, clear action, and trailing slot share one fixed row when content wraps. The app owns parsing and suggestions; call `readTokenSearchField()` on input, empty `textContent` on clear, use `placeTokenSearchCaret()` after explicit controlled focus changes, and call `wireTokenSearchFields()` once so Enter submits without inserting a line break and keyboard chip deletion restores focus plus the text-relative caret after controlled replacement. Enable `collapsible` for an animated iconic closed state, standalone or inside `ToolbarControlGroup`; the field keeps text or tokens expanded, and `wireTokenSearchFields()` manages the transient expand/collapse/focus by default (activate to reveal + focus, Escape or empty blur to collapse). Bind the field's `expanded` to the returned handle's `expanded(id)` signal or adopt your own via `collapsible.signals`; opt a behavior out only when the app must own it. Do not hand-roll the open handler, the focusout collapse,
|
|
104
|
+
10. Compose `AppTab` inside controlled `TabBar`; call `wireTabBars()` once and retain its disposer. It owns same-bar drag mechanics, including proximity-based horizontal edge autoscroll, while the app applies `onReorder` and owns order, selection, panels, close policy, routing, and persistence. Arrow/Home/End select on move by default and restore focus by bar/tab identity when controlled activation replaces the strip; pass `activation: 'manual'` (or `TabBar activation="manual"` per strip) so arrow keys move focus only and the user selects with Enter/Space/click — use it when selecting a tab is a heavy action. Use runtime-filtered `rootAttributes` for domain metadata and keep an optional `closeIcon` decorative and noninteractive.
|
|
105
|
+
11. Use token-controlled `TokenSearchField` when free text and removable structured filters share one editor. Editable text stays DOM-owned between token changes. The leading icon, first text line, clear action, and trailing slot share one fixed row when content wraps. The app owns parsing and suggestions; call `readTokenSearchField()` on input, empty `textContent` on clear, use `placeTokenSearchCaret()` after explicit controlled focus changes, and call `wireTokenSearchFields()` once so Enter submits without inserting a line break and keyboard chip deletion restores focus plus the text-relative caret after controlled replacement. Enable `collapsible` for an animated iconic closed state, standalone or inside `ToolbarControlGroup`; the field keeps text or tokens expanded, and `wireTokenSearchFields()` manages the transient expand/collapse/focus by default (activate to reveal + focus, Escape or empty blur to collapse). Bind the field's `expanded` to the returned handle's `expanded(id)` signal or adopt your own via `collapsible.signals`; opt a behavior out only when the app must own it. Do not hand-roll the open handler, the focusout collapse, a clear-button mousedown guard, or reopening after controlled clear or Select All deletion — the helper keeps the replacement editor open and focused. Deletion restoration finishes before the next keystroke, so a delayed animation frame cannot overwrite a later selection. Persist both query and tokens returned by the DOM read. For real-app adoption it also provides a focusout keep-open exception (`data-token-search-keep-open` regions or `collapsible.keepOpenOn(target)`, so a sibling suggestions/date/help surface does not collapse an empty field), opt-in atomic-chip keyboard (`keyboard`: Backspace/Delete remove the adjacent chip via `onRemoveToken`, ArrowRight moves the caret past a trailing chip), and an `onEdit({id, editor, event})` input callback (the `InputEvent` lets you gate on `inputType`/`data`) — reach for these instead of re-adding hand-rolled keydown/input handlers around the field.
|
|
106
106
|
12. Demo work uses public production component subpaths and their browser-selected CSS. Give every public visual component its own category-grouped catalog route; list themed third-party components under a clearly labeled collapsible ecosystem section, with a focused route for each. For the complete focused/composition decision, `CatalogExample` / `CatalogExampleStack` row/group nesting, exact specimen selection, geometry-overlay legend and exclusions, skip-marker behavior, and metadata ownership, follow the single [Catalog demo authoring contract](../docs/catalog.md#catalog-demo-authoring-contract), discovered machine-readably through [`catalog-authoring.json`](./catalog-authoring.json). Never infer structure from private `kui-catalog-*` classes. Project each component's deterministic repository-relative demo source and existing documentation path so the detail can expose `View demo source` and `Read guidance` links without a runtime export; also derive first-party component implementation paths from their canonical browser imports, and label Web Awesome documentation as Kerf integration guidance. Declare direct `uses` relationships so `Used by` stays derivable, and theme shell chrome through the same semantic tokens as the stage instead of drawing a substitute. Enable `wireCatalog({ revealSelection: true })` for long desktop sidebars so controlled selections remain visible without moving focus; keep its default compact media guard unless compact scrolling is an explicit product behavior, and use `revealCatalogEntry` for an initial deep link.
|
|
107
|
-
13. The Web Awesome theme makes Tooltip and Popover arrowless by default. Keep that default unless a pointer materially clarifies the anchor; opt back in with `--wa-tooltip-arrow-size`, `--kui-wa-popover-arrow-size`, or a popover's public `--arrow-size`, and use `without-arrow` when local no-arrow intent should survive theme changes. Its non-field chrome uses `--kui-wa-control-inset` (8px controls/items), `--kui-wa-surface-margin` / `--kui-wa-surface-inset` (8px around/inside Accordion, Card, Details, Callout, and Include), and `--kui-wa-container-inset` (16px Tab Panel content);
|
|
107
|
+
13. The Web Awesome theme makes Tooltip and Popover arrowless by default. Keep that default unless a pointer materially clarifies the anchor; opt back in with `--wa-tooltip-arrow-size`, `--kui-wa-popover-arrow-size`, or a popover's public `--arrow-size`, and use `without-arrow` when local no-arrow intent should survive theme changes. Its non-field chrome uses `--kui-wa-control-inset` (8px controls/items), `--kui-wa-surface-margin` / `--kui-wa-surface-inset` (8px around/inside Accordion, Card, Details, Callout, and Include), and `--kui-wa-container-inset` (16px Tab Panel content); Dialog maps its body to the 8px surface tier and its footer to the 16px container tier independently of `--spacing`. Override those tiers instead of restyling individual parts. Checkbox and Radio Group option regions, the Color Picker trigger, and Slider's complete interactive region receive the shared 8px logical inline outer inset because those controls have no bordered field shell. Known Date field captions and bordered text-like field hints align with values at the 9px border-plus-padding inset. OTP Input's label uses the same uppercase xs/650 treatment as other field labels, and both its label and hint use that 9px inset.
|
|
108
108
|
14. Treat the complete Web Awesome catalog as support coverage, not a recommendation list. Its UX sidebar marks superseded and exceptional entries `Discouraged`. Consider Popup when it replaces custom anchored positioning. Prefer Kerf `Select` over direct Dropdown/Dropdown Item/Select/Option composition, `SegmentedControl` over Button Group, `TabBar` or `SegmentedControl` over Web Awesome Tabs, `LucideIcon` over Web Awesome Icon, and `ResizableRegion` over Split Panel. Use Tree/Tree Item, Animated Image, and Comparison only for a specific required behavior; avoid Zoomable Frame.
|
|
109
|
-
15. Build sidebars, main areas, inspectors, and dialogs from `@kerfjs/ui/layout.css`: an unpadded `.kui-pane`, optional `.kui-pane__toolbar`, one scrolling `.kui-pane__content`, and optional `.kui-pane__footer`. Add `.kui-content` for 24px major vertical separation and `.kui-content-item` for a child-owned 8px inline margin, 1px transparent-or-visible border, 8px padding, and 12px radius. Use the pill modifier for 22px. Do not pad pane shells
|
|
109
|
+
15. Build sidebars, main areas, inspectors, and dialogs from `@kerfjs/ui/layout.css`: an unpadded `.kui-pane`, optional `.kui-pane__toolbar`, one scrolling `.kui-pane__content`, and optional `.kui-pane__footer`. Use `List` instead of a hand-written flex-column wrapper when rows or sections need stretch alignment, standard/custom gap, flex growth, one vertical scroll owner, or physical-edge dividers; `dividerSides` uses canonical `t`/`r`/`b`/`l` order. Add `.kui-content` for 24px major vertical separation and `.kui-content-item` for a child-owned 8px inline margin, 1px transparent-or-visible border, 8px padding, and 12px radius. Use the pill modifier for 22px. Do not pad pane shells, duplicate item geometry in wrappers, or create nested scroll owners.
|
|
110
110
|
16. Keep a visible collapsible pane's collapse control in its own toolbar. When hidden, move its restore control into the adjacent main toolbar on the corresponding logical edge: leading for an inline-start sidebar and trailing for an inline-end inspector. Collapse the pane completely; do not preserve an empty icon-only rail.
|
|
111
|
-
17. The only direct children of a `Toolbar` zone (`leading`/`center`/`trailing`) are `ToolbarText` (identity/title text) and `ToolbarControlGroup`; never drop bare buttons, inputs, links, or arbitrary markup straight into a zone. `SegmentedControl`, `Select`, a collapsible `TokenSearchField`, and Web Awesome controls all live inside a
|
|
112
|
-
18. When a recurring concept has no matching export or production recipe, keep its semantics in a thin application adapter while reusing the public layout vocabulary. The composer recipe uses one visible form surface,
|
|
111
|
+
17. The only direct children of a `Toolbar` zone (`leading`/`center`/`trailing`) are `ToolbarText` (identity/title text) and `ToolbarControlGroup`; never drop bare buttons, inputs, links, or arbitrary markup straight into a zone. Put identity/title text directly in the zone as `ToolbarText`; wrap interactive controls and icon tiles in `ToolbarControlGroup`. `SegmentedControl`, `Select`, a collapsible `TokenSearchField`, and Web Awesome controls all live inside a group. For an ordinary icon/action control inside a group, use a plain `<button>` (the group styles `> button` fully) — that is the default; reach for `wa-button` only when you need a Web Awesome feature, chiefly a `wa-dropdown` popup trigger. A popup menu in a toolbar is a `single` group wrapping a `wa-dropdown` whose `slot="trigger"` `wa-button` is the toolbar button and whose `wa-dropdown-item`s are the menu, with the dropdown kept under `data-morph-skip-children`. Compose panel/dialog/page headings with a direct extra-large `ToolbarText`, optional grouped icon, grouped trailing controls, and app-owned supporting copy below. A group remains 44px outside (`calc(2px + remify(42px))`) when its border/background are transparent; use 8px between groups and inside items. Split dormant and interactive regions: `ListHeader` fills the available inline width and keeps its label and mutually exclusive semantic count or non-count `badge` together, with an independent logical-end 44px action unless disclosure mode makes the title cluster the button. Its action visual defaults to 18px through `--kui-list-header-action-icon-size`; never shrink the target to match it. Pass every non-negative safe-integer section quantity through `count` with a localized full spoken `countLabel`; never concatenate it into `label` or put a number in `badge`. `ListItem.trailing` is dormant; use `ListActionRow` when primary and trailing actions need sibling 44px native buttons. Its `label`, `icon`, and `trailingActionIcon` slots are also dormant and cannot contain controls. Let panes relocate at narrow widths instead of shrinking targets.
|
|
112
|
+
18. When a recurring concept has no matching export or production recipe, keep its semantics in a thin application adapter while reusing the public layout vocabulary. The composer recipe uses one visible form surface, toolbar title/supporting-copy ids, shared 8px field/action gutters, 24px major rhythm, and a conditional StateBanner as its only nested semantic surface; do not turn every section into a card or double-inset intrinsically bordered controls. The application-local `../docs/examples/command-palette-adapter.tsx` is reference source for one such missing concept, not an `@kerfjs/ui` runtime export or catalog recipe. The application owns its registration, ranking, history, permissions, availability, shortcut policy, focus policy, dispatch, and copy. If a missing concept recurs across products, open an upstream component or recipe request.
|
|
113
113
|
19. Compose `ValueTable` from typed `ValueTableRow` entries instead of handwritten `dt`/`dd` wrappers. Pass `icon` for the optional 24px leading visual; the row owns 8px of root-scaled top and bottom padding, the 8px iconless or 40px icon-bearing separator start, and the common 8px right inset.
|
|
114
|
-
20. Use `
|
|
114
|
+
20. Use the standard direct `Toolbar` composition for a panel, dialog, or page heading, not a private wrapper or custom heading row. Put an optional icon in a `ToolbarControlGroup`, the title directly in the leading zone as extra-large `ToolbarText`, and actions in a trailing group. Set `headingLevel` for page/section landmarks. Supporting copy stays below the toolbar as app-owned content. The app owns modal behavior, focus, dismissal, command policy, ids, and action handling.
|
|
115
115
|
21. Space with the official five-step scale, picked by how connected two elements are — not by eye. `0` `--kui-space-none` = no separation (one unit); `4px` `--kui-space-2xs` = very minor air on a connected cluster; `8px` `--kui-space-xs` = standard, between elements within a group; `16px` `--kui-space-m` = minor, between homogeneous groups; `24px` `--kui-space-l` = major, between heterogeneous groups (the `.kui-content` rhythm). The 8px-vs-24px distinction is inside-a-group vs between-major-differing-regions. `--kui-space-s` (12px) and `--kui-space-xl` (32px) are off-scale exceptions; prefer the five canonical remify-authored tokens. See `docs/layout.md` "Spacing scale".
|
|
116
116
|
22. Pick a whole-screen layout from the opt-in, tree-shakeable subpaths by data + interaction + device, and derive responsiveness from `@kerfjs/ui/device-class`'s `deviceClass()` (`compact` = handset or portrait tablet = one pane at a time). Simple/flat → `NavStack` with one entry (single pane), plus `TabScaffold` (`@kerfjs/ui/tab-scaffold`, iOS bottom tabs, each tab its own `NavStack`) for 2–5 co-equal sections on `compact`. Drill-down → `NavStack` (`@kerfjs/ui/nav-stack`), upgrading to `SplitView` (`@kerfjs/ui/split-view`, list-detail) once both panes fit (`atLeast('tablet')` landscape); `SplitView` collapses to a `NavStack` on `compact`. Complex tool with peripheral panels → `Workbench` (`@kerfjs/ui/workbench`, collapsible rails + drawer) `atLeast('desktop')`, degrading to `NavStack`/overlays below. These are declarative (the app owns the stack/selection/collapsed/active state as signals) with disposer-returning `wire…` helpers; each ships a companion CSS import and stays out of the barrel. For a standalone collapsible rail or bottom drawer outside a full shell, use `CollapsiblePanel` + `CollapsiblePanelToggle` (`@kerfjs/ui/collapsible-panel`) with `wireSidebar` (`@kerfjs/ui/wire-sidebar`): the standard collapse animation and per-side icon convention (`PanelLeft*`/`PanelRight*`/`PanelBottom*`) plus toggle, focus, compact overlay, and persistence semantics. Dialogs pick the same inner layout, then present per device class (full-screen modal on `compact`, inline on desktop). See `docs/app-layouts.md` and `docs/collapsible-panel.md`.
|
|
117
117
|
|
|
@@ -138,7 +138,7 @@ Common mistakes:
|
|
|
138
138
|
| Let the document, pane, and list all scroll | Keep fixed chrome outside one `.kui-pane__content` scroll owner per pane |
|
|
139
139
|
| Invent an `@kerfjs/ui` command-palette export | Keep the semantics application-local, reuse public layout vocabulary, and propose recurring behavior upstream |
|
|
140
140
|
| Handwrite `ValueTable` row wrappers or compensate their padding or separators | Compose `ValueTableRow`; its root-scaled block padding, optional icon hook, and separator geometry are public contract |
|
|
141
|
-
| Rebuild a panel/dialog heading
|
|
141
|
+
| Rebuild a panel/dialog heading with bespoke CSS or a private wrapper | Compose a plain `Toolbar` with a direct xl `ToolbarText`, optional grouped icon, grouped trailing controls, and app-owned supporting copy below |
|
|
142
142
|
| Force a `width`/`height`/`padding` on a component to size or space it | Let it size to its content and tokens; a forced box leaves a halo or a stretched oval — adjust an icon-size or spacing token, not the box |
|
|
143
143
|
| Wrap a component or region in a card, border, backdrop, or outline to "contain" it | Let it sit on the surface; add a `.kui-content-item` only for a real distinction — hierarchy comes from alignment, spacing, and type first |
|
|
144
144
|
| Add another container's padding on top of a content-item's own margin | Pick one owner of the inset; a pane has no padding and its `.kui-content` children own the 8/1/8 geometry — stacking them double-insets |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Web Awesome JSX signatures for the UI authoring corpus
|
|
2
2
|
|
|
3
|
-
Generated from the emitted `@kerfjs/ui@5.0.0-beta.
|
|
3
|
+
Generated from the emitted `@kerfjs/ui@5.0.0-beta.25` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { KerfCustomElement } from 'kerfjs/jsx-runtime';
|
|
@@ -28,6 +28,7 @@ declare module 'kerfjs/jsx-runtime' {
|
|
|
28
28
|
'aria-label'?: string;
|
|
29
29
|
value?: string;
|
|
30
30
|
placeholder?: string;
|
|
31
|
+
hint?: string;
|
|
31
32
|
disabled?: boolean;
|
|
32
33
|
};
|
|
33
34
|
'wa-option': KerfCustomElement & {
|
package/analyzer/cli.mjs
CHANGED
|
@@ -24,13 +24,16 @@ const format = take('--format') ?? 'text';
|
|
|
24
24
|
const output = take('--output');
|
|
25
25
|
const profile = take('--profile');
|
|
26
26
|
const failOnReview = args.includes('--fail-on-review');
|
|
27
|
-
const
|
|
27
|
+
const adoption = args.includes('--adoption');
|
|
28
|
+
const paths = args.filter(
|
|
29
|
+
(argument) => !argument.startsWith('--') && argument !== '--adoption',
|
|
30
|
+
);
|
|
28
31
|
|
|
29
32
|
if (!['text', 'json', 'sarif'].includes(format)) {
|
|
30
33
|
console.error(`Unknown --format ${format}; expected text, json, or sarif.`);
|
|
31
34
|
process.exitCode = 2;
|
|
32
35
|
} else {
|
|
33
|
-
const report = await analyzeUiProject({ root, paths, profile });
|
|
36
|
+
const report = await analyzeUiProject({ root, paths, profile, adoption });
|
|
34
37
|
const rendered =
|
|
35
38
|
format === 'text'
|
|
36
39
|
? formatUiAnalysisText(report)
|
package/analyzer/index.d.mts
CHANGED
package/analyzer/index.mjs
CHANGED
|
@@ -30,8 +30,22 @@ export const UI_ANALYSIS_RULES = Object.freeze({
|
|
|
30
30
|
'KUI-L007': { severity: 'error', title: 'Nested scroll owners' },
|
|
31
31
|
'KUI-L008': { severity: 'review', title: 'Dynamic class requires review' },
|
|
32
32
|
'KUI-L009': { severity: 'error', title: 'Stylesheet could not be parsed' },
|
|
33
|
+
'KUI-L010': {
|
|
34
|
+
severity: 'error',
|
|
35
|
+
title: 'Private Kerf descendant override',
|
|
36
|
+
},
|
|
37
|
+
'KUI-L011': { severity: 'error', title: 'Uncataloged shadow part override' },
|
|
38
|
+
'KUI-L012': { severity: 'error', title: 'Private Kerf token assignment' },
|
|
33
39
|
});
|
|
34
40
|
|
|
41
|
+
const adoptionRules = new Set([
|
|
42
|
+
'KUI-L001',
|
|
43
|
+
'KUI-L002',
|
|
44
|
+
'KUI-L010',
|
|
45
|
+
'KUI-L011',
|
|
46
|
+
'KUI-L012',
|
|
47
|
+
]);
|
|
48
|
+
|
|
35
49
|
const sourceExtensions = new Set(['.tsx', '.jsx']);
|
|
36
50
|
const spacingProperties = /^(?:margin|padding|gap|inset)(?:-|$)/;
|
|
37
51
|
const dimensionProperties =
|
|
@@ -80,11 +94,11 @@ function location(file, node, source) {
|
|
|
80
94
|
};
|
|
81
95
|
}
|
|
82
96
|
|
|
83
|
-
function diagnostic(ruleId, at, message, evidence, chain) {
|
|
97
|
+
function diagnostic(ruleId, at, message, evidence, chain, adoption = false) {
|
|
84
98
|
const rule = UI_ANALYSIS_RULES[ruleId];
|
|
85
99
|
return {
|
|
86
100
|
ruleId,
|
|
87
|
-
severity: rule.severity,
|
|
101
|
+
severity: adoption && adoptionRules.has(ruleId) ? 'review' : rule.severity,
|
|
88
102
|
message,
|
|
89
103
|
location: at,
|
|
90
104
|
evidence,
|
|
@@ -187,6 +201,7 @@ async function loadCatalogs(profileResult) {
|
|
|
187
201
|
function catalogFacts(entries) {
|
|
188
202
|
const publicClasses = new Set();
|
|
189
203
|
const publicTokens = new Set();
|
|
204
|
+
const publicParts = new Map();
|
|
190
205
|
const classEntries = new Map();
|
|
191
206
|
const exportEntries = new Map();
|
|
192
207
|
for (const entry of entries) {
|
|
@@ -201,8 +216,19 @@ function catalogFacts(entries) {
|
|
|
201
216
|
}
|
|
202
217
|
for (const token of entry.boundaries?.publicTokens ?? [])
|
|
203
218
|
publicTokens.add(token);
|
|
219
|
+
for (const part of entry.boundaries?.publicParts ?? []) {
|
|
220
|
+
const roots = publicParts.get(part) ?? new Set();
|
|
221
|
+
if (entry.boundaries?.rootClass) roots.add(entry.boundaries.rootClass);
|
|
222
|
+
publicParts.set(part, roots);
|
|
223
|
+
}
|
|
204
224
|
}
|
|
205
|
-
return {
|
|
225
|
+
return {
|
|
226
|
+
publicClasses,
|
|
227
|
+
publicTokens,
|
|
228
|
+
publicParts,
|
|
229
|
+
classEntries,
|
|
230
|
+
exportEntries,
|
|
231
|
+
};
|
|
206
232
|
}
|
|
207
233
|
|
|
208
234
|
function spacingValues(value) {
|
|
@@ -214,7 +240,18 @@ function spacingValues(value) {
|
|
|
214
240
|
return results;
|
|
215
241
|
}
|
|
216
242
|
|
|
217
|
-
|
|
243
|
+
function escapeRegExp(value) {
|
|
244
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
async function inspectCss(
|
|
248
|
+
file,
|
|
249
|
+
source,
|
|
250
|
+
facts,
|
|
251
|
+
diagnostics,
|
|
252
|
+
cssFacts,
|
|
253
|
+
adoption = false,
|
|
254
|
+
) {
|
|
218
255
|
let root;
|
|
219
256
|
try {
|
|
220
257
|
root = postcss.parse(source, { from: file });
|
|
@@ -232,14 +269,69 @@ async function inspectCss(file, source, facts, diagnostics, cssFacts) {
|
|
|
232
269
|
const classes = [
|
|
233
270
|
...rule.selector.matchAll(/\.([_a-zA-Z]+[_a-zA-Z0-9-]*)/g),
|
|
234
271
|
].map((match) => match[1]);
|
|
272
|
+
const publicRootPattern = [...facts.publicClasses]
|
|
273
|
+
.map(
|
|
274
|
+
(className) => `\\.${className.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`,
|
|
275
|
+
)
|
|
276
|
+
.join('|');
|
|
277
|
+
const privateDescendants = new Set();
|
|
278
|
+
if (publicRootPattern)
|
|
279
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
280
|
+
const rootMatch = new RegExp(
|
|
281
|
+
`(?:${publicRootPattern})(?:[.#:[\\w-]|\\s)*(?:>|\\s)`,
|
|
282
|
+
).exec(selector);
|
|
283
|
+
if (!rootMatch) continue;
|
|
284
|
+
const descendant = selector.slice(
|
|
285
|
+
rootMatch.index + rootMatch[0].length,
|
|
286
|
+
);
|
|
287
|
+
for (const match of descendant.matchAll(/\.(kui-[\w-]+)/g))
|
|
288
|
+
if (!facts.publicClasses.has(match[1]))
|
|
289
|
+
privateDescendants.add(match[1]);
|
|
290
|
+
}
|
|
235
291
|
for (const className of classes) {
|
|
236
|
-
if (
|
|
292
|
+
if (privateDescendants.has(className))
|
|
293
|
+
diagnostics.push(
|
|
294
|
+
diagnostic(
|
|
295
|
+
'KUI-L010',
|
|
296
|
+
location(file, rule),
|
|
297
|
+
`.${className} is a private Kerf descendant; prefer the owning component's prop or variant, or catalog a deliberate public extension point.`,
|
|
298
|
+
{ selector: rule.selector, className },
|
|
299
|
+
undefined,
|
|
300
|
+
adoption,
|
|
301
|
+
),
|
|
302
|
+
);
|
|
303
|
+
else if (
|
|
304
|
+
className.startsWith('kui-') &&
|
|
305
|
+
!facts.publicClasses.has(className)
|
|
306
|
+
)
|
|
237
307
|
diagnostics.push(
|
|
238
308
|
diagnostic(
|
|
239
309
|
'KUI-L001',
|
|
240
310
|
location(file, rule),
|
|
241
|
-
`.${className} is not a cataloged public Kerf class.`,
|
|
311
|
+
`.${className} is not a cataloged public Kerf class; prefer a component prop or variant, or catalog the extension point.`,
|
|
242
312
|
{ selector: rule.selector, className },
|
|
313
|
+
undefined,
|
|
314
|
+
adoption,
|
|
315
|
+
),
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
for (const match of rule.selector.matchAll(/::part\(\s*([\w-]+)\s*\)/g)) {
|
|
319
|
+
const part = match[1];
|
|
320
|
+
const roots = facts.publicParts.get(part) ?? new Set();
|
|
321
|
+
const allowed = [...roots].some((className) =>
|
|
322
|
+
new RegExp(`\\.${escapeRegExp(className)}(?:[^\\w-]|$)`).test(
|
|
323
|
+
rule.selector.slice(0, match.index),
|
|
324
|
+
),
|
|
325
|
+
);
|
|
326
|
+
if (!allowed)
|
|
327
|
+
diagnostics.push(
|
|
328
|
+
diagnostic(
|
|
329
|
+
'KUI-L011',
|
|
330
|
+
location(file, rule),
|
|
331
|
+
`::part(${part}) is not a cataloged extension point; prefer the component's prop or variant, or add ${part} to boundaries.publicParts.`,
|
|
332
|
+
{ selector: rule.selector, part },
|
|
333
|
+
undefined,
|
|
334
|
+
adoption,
|
|
243
335
|
),
|
|
244
336
|
);
|
|
245
337
|
}
|
|
@@ -250,15 +342,21 @@ async function inspectCss(file, source, facts, diagnostics, cssFacts) {
|
|
|
250
342
|
...(decl.value.match(/--kui-[a-z0-9-]+/g) ?? []),
|
|
251
343
|
];
|
|
252
344
|
for (const token of new Set(tokens))
|
|
253
|
-
if (!facts.publicTokens.has(token))
|
|
345
|
+
if (!facts.publicTokens.has(token)) {
|
|
346
|
+
const assignment = decl.prop === token;
|
|
254
347
|
diagnostics.push(
|
|
255
348
|
diagnostic(
|
|
256
|
-
'KUI-L002',
|
|
349
|
+
assignment ? 'KUI-L012' : 'KUI-L002',
|
|
257
350
|
at,
|
|
258
|
-
|
|
351
|
+
assignment
|
|
352
|
+
? `${token} has no public configuration contract; prefer the component's prop or variant, or catalog the token explicitly.`
|
|
353
|
+
: `${token} is not a cataloged public Kerf token; prefer a documented token or component configuration.`,
|
|
259
354
|
{ property: decl.prop, value: decl.value, token },
|
|
355
|
+
undefined,
|
|
356
|
+
adoption,
|
|
260
357
|
),
|
|
261
358
|
);
|
|
359
|
+
}
|
|
262
360
|
if (
|
|
263
361
|
spacingProperties.test(decl.prop) &&
|
|
264
362
|
!/var\(|calc\(|remify\(/.test(decl.value)
|
|
@@ -439,6 +537,7 @@ export async function analyzeUiProject({
|
|
|
439
537
|
root: requestedRoot = process.cwd(),
|
|
440
538
|
paths,
|
|
441
539
|
knownRules = [],
|
|
540
|
+
adoption = false,
|
|
442
541
|
profile: packageProfile = resolve(
|
|
443
542
|
import.meta.dirname,
|
|
444
543
|
'../ai/application-ui-profile.defaults.json',
|
|
@@ -538,7 +637,14 @@ export async function analyzeUiProject({
|
|
|
538
637
|
for (const file of files.filter((item) => item.endsWith('.css'))) {
|
|
539
638
|
const context = contexts.get(file);
|
|
540
639
|
const fileFacts = new Map();
|
|
541
|
-
await inspectCss(
|
|
640
|
+
await inspectCss(
|
|
641
|
+
file,
|
|
642
|
+
contents.get(file),
|
|
643
|
+
context.facts,
|
|
644
|
+
[],
|
|
645
|
+
fileFacts,
|
|
646
|
+
adoption,
|
|
647
|
+
);
|
|
542
648
|
styleFacts.set(file, fileFacts);
|
|
543
649
|
}
|
|
544
650
|
const styleConsumers = new Map(
|
|
@@ -572,6 +678,7 @@ export async function analyzeUiProject({
|
|
|
572
678
|
context.facts,
|
|
573
679
|
fileDiagnostics,
|
|
574
680
|
new Map(),
|
|
681
|
+
adoption,
|
|
575
682
|
);
|
|
576
683
|
recordDiagnostics(fileDiagnostics, context);
|
|
577
684
|
}
|
package/dist/app-tab.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ type AppTabRootAttributes = Readonly<Record<`data-${string}`, string | undefined
|
|
|
8
8
|
'data-tab-dragging'?: never;
|
|
9
9
|
'data-tab-drop-position'?: never;
|
|
10
10
|
}>;
|
|
11
|
+
type AppTabPresentation = 'pill' | 'segmented' | 'icon-only';
|
|
12
|
+
type AppTabSize = 'default' | 'compact';
|
|
11
13
|
interface AppTabProps {
|
|
12
14
|
id: string;
|
|
13
15
|
name: string;
|
|
@@ -16,6 +18,12 @@ interface AppTabProps {
|
|
|
16
18
|
draggable?: boolean;
|
|
17
19
|
leading?: SafeHtml;
|
|
18
20
|
trailing?: SafeHtml;
|
|
21
|
+
/** Visual treatment within a TabBar. Icon-only tabs retain `name` as their accessible name. */
|
|
22
|
+
presentation?: AppTabPresentation;
|
|
23
|
+
/** Compact tabs use the 32px application-rail height. */
|
|
24
|
+
size?: AppTabSize;
|
|
25
|
+
/** Maximum visible label width in CSS pixels before ellipsis. */
|
|
26
|
+
labelMaxWidth?: number;
|
|
19
27
|
/** Decorative dormant content for the close button. Must not contain interactive descendants. */
|
|
20
28
|
closeIcon?: SafeHtml;
|
|
21
29
|
selectAction?: string;
|
|
@@ -25,6 +33,6 @@ interface AppTabProps {
|
|
|
25
33
|
placeholder?: boolean;
|
|
26
34
|
rootAttributes?: AppTabRootAttributes;
|
|
27
35
|
}
|
|
28
|
-
declare function AppTab({ id, name, selected, closable, draggable, leading, trailing, closeIcon, selectAction, closeAction, className, placeholder, rootAttributes, }: AppTabProps): SafeHtml;
|
|
36
|
+
declare function AppTab({ id, name, selected, closable, draggable, leading, trailing, presentation, size, labelMaxWidth, closeIcon, selectAction, closeAction, className, placeholder, rootAttributes, }: AppTabProps): SafeHtml;
|
|
29
37
|
|
|
30
|
-
export { AppTab, type AppTabProps };
|
|
38
|
+
export { AppTab, type AppTabPresentation, type AppTabProps, type AppTabSize };
|
package/dist/app-tab.js
CHANGED
package/dist/catalog.d.ts
CHANGED
|
@@ -67,10 +67,10 @@ interface CatalogProps {
|
|
|
67
67
|
/** Status line content shown at the start of the detail footer. */
|
|
68
68
|
status?: SafeHtml;
|
|
69
69
|
/**
|
|
70
|
-
* Whether to highlight
|
|
71
|
-
* margins. Pass a boolean (rather than omitting the
|
|
72
|
-
* entry can switch between component and composition
|
|
73
|
-
* `wireCatalogGeometryOverlay` keeps the overlay synchronized.
|
|
70
|
+
* Whether to highlight specimens' computed borders (or transparent outer
|
|
71
|
+
* bounds) and non-zero margins. Pass a boolean (rather than omitting the
|
|
72
|
+
* prop) when the active entry can switch between component and composition
|
|
73
|
+
* previews; `wireCatalogGeometryOverlay` keeps the overlay synchronized.
|
|
74
74
|
*/
|
|
75
75
|
geometryOverlay?: boolean;
|
|
76
76
|
selectAction?: string;
|
|
@@ -100,11 +100,15 @@ type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';
|
|
|
100
100
|
type CatalogExampleRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
101
101
|
'data-catalog-example'?: never;
|
|
102
102
|
'data-catalog-example-stack'?: never;
|
|
103
|
+
'data-catalog-example-label'?: never;
|
|
104
|
+
'data-catalog-example-note'?: never;
|
|
103
105
|
'data-align'?: never;
|
|
104
106
|
}>;
|
|
105
107
|
type CatalogExampleStackRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
106
108
|
'data-catalog-example'?: never;
|
|
107
109
|
'data-catalog-example-stack'?: never;
|
|
110
|
+
'data-catalog-example-label'?: never;
|
|
111
|
+
'data-catalog-example-note'?: never;
|
|
108
112
|
'data-align'?: never;
|
|
109
113
|
}>;
|
|
110
114
|
interface CatalogExampleProps {
|
package/dist/catalog.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { Toolbar } from './chunk-SYDMYBPG.js';
|
|
2
|
+
import { ToolbarControlGroup } from './chunk-WNWD54GR.js';
|
|
1
3
|
import { Pane } from './chunk-JRKSK2HX.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ListItem } from './chunk-ELSJX4W7.js';
|
|
4
|
+
import { ListHeader } from './chunk-GWEAPEZI.js';
|
|
5
|
+
import { ListItem } from './chunk-4EF2CMYS.js';
|
|
6
|
+
import { List } from './chunk-J5BFYY7Q.js';
|
|
6
7
|
import { filterDataAttributes } from './chunk-SRSJO5QE.js';
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
import { LucideIcon } from './chunk-W2FK7ZNY.js';
|
|
11
|
+
|
|
10
12
|
import { PanelLeftClose, Waypoints, ExternalLink, Moon, Sun, PanelLeftOpen } from 'lucide';
|
|
11
13
|
import { jsxs, jsx, Fragment } from 'kerfjs/jsx-runtime';
|
|
12
14
|
|
|
@@ -83,7 +85,7 @@ function Catalog({
|
|
|
83
85
|
Toolbar,
|
|
84
86
|
{
|
|
85
87
|
label: `${brand.title} catalog header`,
|
|
86
|
-
|
|
88
|
+
dividerSides: "",
|
|
87
89
|
leading: /* @__PURE__ */ jsxs(
|
|
88
90
|
ToolbarControlGroup,
|
|
89
91
|
{
|
|
@@ -111,7 +113,7 @@ function Catalog({
|
|
|
111
113
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
114
|
sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__group", children: [
|
|
113
115
|
/* @__PURE__ */ jsx(ListHeader, { label: section.category }),
|
|
114
|
-
/* @__PURE__ */ jsx(
|
|
116
|
+
/* @__PURE__ */ jsx(List, { className: "kui-catalog__items", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
|
|
115
117
|
ListItem,
|
|
116
118
|
{
|
|
117
119
|
action: selectAction,
|
|
@@ -136,7 +138,7 @@ function Catalog({
|
|
|
136
138
|
) : /* @__PURE__ */ jsx(ListHeader, { label: secondarySections.label }),
|
|
137
139
|
!secondarySections.collapsible || secondarySections.expanded ? /* @__PURE__ */ jsx("div", { class: "kui-catalog__secondary", "data-catalog-secondary": true, children: secondarySections.sections.map((section) => /* @__PURE__ */ jsxs("section", { class: "kui-catalog__secondary-group", children: [
|
|
138
140
|
/* @__PURE__ */ jsx("h3", { class: "kui-catalog__secondary-heading", children: section.category }),
|
|
139
|
-
/* @__PURE__ */ jsx(
|
|
141
|
+
/* @__PURE__ */ jsx(List, { className: "kui-catalog__items", children: section.entries.map((entry) => /* @__PURE__ */ jsx(
|
|
140
142
|
ListItem,
|
|
141
143
|
{
|
|
142
144
|
action: selectAction,
|
|
@@ -168,7 +170,7 @@ function Catalog({
|
|
|
168
170
|
Toolbar,
|
|
169
171
|
{
|
|
170
172
|
label: `${name} header`,
|
|
171
|
-
|
|
173
|
+
dividerSides: "",
|
|
172
174
|
leading: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
173
175
|
collapsed ? /* @__PURE__ */ jsx(ToolbarControlGroup, { appearance: "borderless", single: true, children: /* @__PURE__ */ jsx(
|
|
174
176
|
"button",
|
|
@@ -228,7 +230,7 @@ function Catalog({
|
|
|
228
230
|
Toolbar,
|
|
229
231
|
{
|
|
230
232
|
label: `${name} resources`,
|
|
231
|
-
|
|
233
|
+
dividerSides: "",
|
|
232
234
|
leading: resources.length > 0 ? /* @__PURE__ */ jsx(
|
|
233
235
|
"nav",
|
|
234
236
|
{
|
|
@@ -312,6 +314,8 @@ function Catalog({
|
|
|
312
314
|
var catalogExampleProtectedAttributes = /* @__PURE__ */ new Set([
|
|
313
315
|
"data-catalog-example",
|
|
314
316
|
"data-catalog-example-stack",
|
|
317
|
+
"data-catalog-example-label",
|
|
318
|
+
"data-catalog-example-note",
|
|
315
319
|
"data-align"
|
|
316
320
|
]);
|
|
317
321
|
function CatalogExample({
|
|
@@ -334,8 +338,14 @@ function CatalogExample({
|
|
|
334
338
|
"data-catalog-example": true,
|
|
335
339
|
"data-align": align,
|
|
336
340
|
children: [
|
|
337
|
-
label !== void 0 ? /* @__PURE__ */ jsx(
|
|
338
|
-
|
|
341
|
+
label !== void 0 ? /* @__PURE__ */ jsx(
|
|
342
|
+
ListHeader,
|
|
343
|
+
{
|
|
344
|
+
label,
|
|
345
|
+
rootAttributes: { "data-catalog-example-label": "" }
|
|
346
|
+
}
|
|
347
|
+
) : /* @__PURE__ */ jsx(Fragment, {}),
|
|
348
|
+
note !== void 0 ? /* @__PURE__ */ jsx("p", { class: "kui-catalog-example__note", "data-catalog-example-note": true, children: note }) : /* @__PURE__ */ jsx(Fragment, {}),
|
|
339
349
|
children
|
|
340
350
|
]
|
|
341
351
|
}
|