@kerfjs/ui 4.4.1 → 5.0.0-beta.10
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 +240 -10
- package/ai/component-catalog.json +4766 -0
- package/ai/component-catalog.schema.json +79 -0
- package/ai/public-api-signatures-v1.md +1327 -0
- package/ai/skill.md +73 -11
- package/ai/webawesome-jsx-signatures-v1.md +106 -0
- package/dist/app-tab.d.ts +14 -2
- package/dist/app-tab.js +3 -1
- package/dist/browser/app-tab.js +3 -2
- package/dist/browser/disclosure-arrow.js +4 -0
- package/dist/browser/empty-state.js +3 -3
- package/dist/browser/list-action-row.js +4 -0
- package/dist/browser/list-header.js +6 -0
- package/dist/browser/list-item.js +4 -0
- package/dist/browser/loading-spinner.js +2 -2
- package/dist/browser/lucide-icon.js +2 -2
- package/dist/browser/panel-header.js +7 -0
- package/dist/browser/resizable-region.js +2 -2
- package/dist/browser/segmented-control.js +3 -2
- package/dist/browser/select.js +4 -3
- package/dist/browser/skeleton.js +3 -0
- package/dist/browser/state-banner.js +3 -2
- package/dist/browser/tab-bar.js +2 -2
- package/dist/browser/token-search-field.js +4 -0
- package/dist/browser/toolbar-control-group.js +2 -2
- package/dist/browser/toolbar-text.js +3 -2
- package/dist/browser/toolbar.js +2 -2
- package/dist/browser/value-table.js +3 -2
- package/dist/catalog.d.ts +119 -0
- package/dist/catalog.js +143 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chunk-2Z5TWHKQ.js +34 -0
- package/dist/chunk-2Z5TWHKQ.js.map +1 -0
- package/dist/chunk-37T3VNIZ.js +19 -0
- package/dist/chunk-37T3VNIZ.js.map +1 -0
- package/dist/chunk-56RJXPHG.js +43 -0
- package/dist/chunk-56RJXPHG.js.map +1 -0
- package/dist/chunk-7BR3DO2A.js +31 -0
- package/dist/chunk-7BR3DO2A.js.map +1 -0
- package/dist/chunk-7JB7VPRI.js +34 -0
- package/dist/chunk-7JB7VPRI.js.map +1 -0
- package/dist/chunk-7LDCTU7D.js +134 -0
- package/dist/chunk-7LDCTU7D.js.map +1 -0
- package/dist/{chunk-4HHCYSGT.js → chunk-AQNKJRFH.js} +2 -2
- package/dist/{chunk-4HHCYSGT.js.map → chunk-AQNKJRFH.js.map} +1 -1
- package/dist/{chunk-MBR3TYNL.js → chunk-AVZHJN6C.js} +3 -3
- package/dist/chunk-AVZHJN6C.js.map +1 -0
- package/dist/chunk-B24C4A6T.js +22 -0
- package/dist/chunk-B24C4A6T.js.map +1 -0
- package/dist/chunk-BLK3UEEI.js +23 -0
- package/dist/chunk-BLK3UEEI.js.map +1 -0
- package/dist/chunk-CVZYNJJ5.js +265 -0
- package/dist/chunk-CVZYNJJ5.js.map +1 -0
- package/dist/chunk-I7INRJO4.js +17 -0
- package/dist/chunk-I7INRJO4.js.map +1 -0
- package/dist/chunk-L4OKFDJY.js +24 -0
- package/dist/chunk-L4OKFDJY.js.map +1 -0
- package/dist/chunk-LC3YSAZC.js +39 -0
- package/dist/chunk-LC3YSAZC.js.map +1 -0
- package/dist/{chunk-3O7ZEUW2.js → chunk-M5JRI6MN.js} +3 -3
- package/dist/chunk-M5JRI6MN.js.map +1 -0
- package/dist/chunk-RUNWEPR4.js +10 -0
- package/dist/chunk-RUNWEPR4.js.map +1 -0
- package/dist/chunk-W5EQ3HYQ.js +42 -0
- package/dist/chunk-W5EQ3HYQ.js.map +1 -0
- package/dist/{chunk-MQIZAD4A.js → chunk-XXMOARTH.js} +5 -3
- package/dist/chunk-XXMOARTH.js.map +1 -0
- package/dist/chunk-Y5MRDTLC.js +20 -0
- package/dist/chunk-Y5MRDTLC.js.map +1 -0
- package/dist/{chunk-TRNBHPNW.js → chunk-YGN7OMLT.js} +11 -8
- package/dist/chunk-YGN7OMLT.js.map +1 -0
- package/dist/collapsible-panel.d.ts +66 -0
- package/dist/collapsible-panel.js +22 -0
- package/dist/collapsible-panel.js.map +1 -0
- package/dist/device-class.d.ts +62 -0
- package/dist/device-class.js +75 -0
- package/dist/device-class.js.map +1 -0
- package/dist/disclosure-arrow.d.ts +14 -0
- package/dist/disclosure-arrow.js +4 -0
- package/dist/disclosure-arrow.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +21 -16
- package/dist/list-action-row.d.ts +52 -0
- package/dist/list-action-row.js +5 -0
- package/dist/list-action-row.js.map +1 -0
- package/dist/list-header.d.ts +43 -0
- package/dist/list-header.js +7 -0
- package/dist/list-header.js.map +1 -0
- package/dist/list-item.d.ts +33 -0
- package/dist/list-item.js +5 -0
- package/dist/list-item.js.map +1 -0
- package/dist/nav-stack.d.ts +38 -0
- package/dist/nav-stack.js +5 -0
- package/dist/nav-stack.js.map +1 -0
- package/dist/panel-header.d.ts +36 -0
- package/dist/panel-header.js +7 -0
- package/dist/panel-header.js.map +1 -0
- package/dist/resizable-region.d.ts +3 -1
- package/dist/resizable-region.js +1 -1
- package/dist/segmented-control.d.ts +3 -1
- package/dist/segmented-control.js +2 -1
- package/dist/select-register.d.ts +5 -1
- package/dist/select-register.js +3 -0
- package/dist/select-register.js.map +1 -1
- package/dist/select.d.ts +5 -2
- package/dist/select.js +2 -1
- package/dist/skeleton.d.ts +24 -0
- package/dist/skeleton.js +3 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/split-view.d.ts +42 -0
- package/dist/split-view.js +21 -0
- package/dist/split-view.js.map +1 -0
- package/dist/state-banner.d.ts +3 -1
- package/dist/state-banner.js +2 -1
- package/dist/styles/app-tab.css +152 -0
- package/dist/styles/catalog.css +498 -0
- package/dist/styles/collapsible-panel.css +146 -0
- package/dist/styles/disclosure-arrow.css +23 -0
- package/dist/styles/empty-state.css +47 -0
- package/dist/styles/foundation.css +347 -0
- package/dist/styles/layout.css +73 -0
- package/dist/styles/list-action-row.css +160 -0
- package/dist/styles/list-header.css +160 -0
- package/dist/styles/list-item.css +123 -0
- package/dist/styles/loading-spinner.css +21 -0
- package/dist/styles/lucide-icon.css +6 -0
- package/dist/styles/nav-stack.css +111 -0
- package/dist/styles/panel-header.css +64 -0
- package/dist/styles/resizable-region.css +111 -0
- package/{src → dist/styles}/segmented-control.css +62 -31
- package/dist/styles/select.css +138 -0
- package/dist/styles/skeleton.css +31 -0
- package/dist/styles/split-view.css +35 -0
- package/dist/styles/state-banner.css +173 -0
- package/dist/styles/styles.css +23 -0
- package/dist/styles/tab-bar.css +45 -0
- package/dist/styles/tab-scaffold.css +84 -0
- package/dist/styles/token-search-field.css +289 -0
- package/dist/styles/toolbar-control-group.css +211 -0
- package/dist/styles/toolbar-text.css +40 -0
- package/dist/styles/toolbar.css +61 -0
- package/dist/styles/value-table.css +75 -0
- package/{src → dist/styles}/webawesome.css +119 -29
- package/dist/styles/workbench.css +94 -0
- package/dist/tab-bar.d.ts +8 -1
- package/dist/tab-bar.js +1 -1
- package/dist/tab-scaffold.d.ts +30 -0
- package/dist/tab-scaffold.js +16 -0
- package/dist/tab-scaffold.js.map +1 -0
- package/dist/token-search-field.d.ts +43 -0
- package/dist/token-search-field.js +4 -0
- package/dist/token-search-field.js.map +1 -0
- package/dist/toolbar-text.d.ts +15 -3
- package/dist/toolbar-text.js +2 -1
- package/dist/value-table.d.ts +12 -2
- package/dist/value-table.js +2 -1
- package/dist/webawesome.d.ts +100 -0
- package/dist/webawesome.js +3 -0
- package/dist/webawesome.js.map +1 -0
- package/dist/wire-catalog.d.ts +26 -0
- package/dist/wire-catalog.js +48 -0
- package/dist/wire-catalog.js.map +1 -0
- package/dist/wire-nav-stack.d.ts +15 -0
- package/dist/wire-nav-stack.js +88 -0
- package/dist/wire-nav-stack.js.map +1 -0
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-sidebar.d.ts +43 -0
- package/dist/wire-sidebar.js +117 -0
- package/dist/wire-sidebar.js.map +1 -0
- package/dist/wire-tab-bars.d.ts +15 -2
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tab-scaffold.d.ts +11 -0
- package/dist/wire-tab-scaffold.js +16 -0
- package/dist/wire-tab-scaffold.js.map +1 -0
- package/dist/wire-token-search-fields.d.ts +97 -0
- package/dist/wire-token-search-fields.js +5 -0
- package/dist/wire-token-search-fields.js.map +1 -0
- package/dist/workbench.d.ts +33 -0
- package/dist/workbench.js +17 -0
- package/dist/workbench.js.map +1 -0
- package/docs/accessibility.md +101 -3
- package/docs/app-layouts.md +61 -0
- package/docs/catalog.md +155 -0
- package/docs/collapsible-panel.md +102 -0
- package/docs/component-contract.md +169 -4
- package/docs/component-selection.md +185 -0
- package/docs/design/templates/panel-header/icon-actions-dark.svg +1 -0
- package/docs/design/templates/panel-header/icon-actions.svg +1 -0
- package/docs/design/templates/panel-header/icon-summary-actions-dark.svg +1 -0
- package/docs/design/templates/panel-header/icon-summary-actions.svg +1 -0
- package/docs/design/templates/panel-header/no-icon-dark.svg +1 -0
- package/docs/design/templates/panel-header/no-icon.svg +1 -0
- package/docs/design/templates/panel-header/page-heading-dark.svg +1 -0
- package/docs/design/templates/panel-header/page-heading.svg +1 -0
- package/docs/design/templates/panel-header/title-only-dark.svg +1 -0
- package/docs/design/templates/panel-header/title-only.svg +1 -0
- package/docs/design/templates/panel-header-dark.svg +13 -0
- package/docs/design/templates/panel-header.svg +13 -0
- package/docs/design/templates/toolbar-control-group/borderless-single-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/borderless-single.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons.svg +1 -0
- package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/with-text.svg +1 -0
- package/docs/design/templates/toolbar-control-group-dark.svg +11 -0
- package/docs/design/templates/toolbar-control-group.svg +11 -0
- package/docs/design/templates.md +83 -0
- package/docs/design-philosophy.md +61 -1
- package/docs/device-class.md +54 -0
- package/docs/examples/command-palette-adapter.tsx +70 -0
- package/docs/layout.md +131 -0
- package/docs/nav-stack.md +47 -0
- package/docs/recipes.md +167 -0
- package/docs/split-view.md +49 -0
- package/docs/tab-scaffold.md +41 -0
- package/docs/ux-demo.md +23 -9
- package/docs/webawesome-theme.md +15 -0
- package/docs/workbench.md +47 -0
- package/llms.txt +123 -14
- package/package.json +139 -44
- package/ux-demo/recipes/app-shell.tsx +32 -0
- package/ux-demo/recipes/collapsible-sidebar.tsx +100 -0
- package/ux-demo/recipes/compact-toolbar.tsx +43 -0
- package/ux-demo/recipes/composer-form.tsx +63 -0
- package/ux-demo/recipes/list-detail-dialog.tsx +45 -0
- package/ux-demo/recipes/list-workspace-states.tsx +26 -0
- package/ux-demo/recipes/loaders.ts +33 -0
- package/ux-demo/recipes/loading-inspector.tsx +81 -0
- package/ux-demo/recipes/mount-recipe.ts +43 -0
- package/ux-demo/recipes/navigation-sidebar.tsx +26 -0
- package/ux-demo/recipes/navigation-stack.tsx +76 -0
- package/ux-demo/recipes/recipes.css +448 -0
- package/ux-demo/recipes/types.ts +17 -0
- package/ux-demo/recipes/workspace-header.tsx +12 -0
- package/dist/browser/dialog-header.js +0 -3
- package/dist/browser/menu-header.js +0 -3
- package/dist/browser/menu-item.js +0 -3
- package/dist/browser/page-header.js +0 -3
- package/dist/chunk-2PES33HS.js +0 -13
- package/dist/chunk-2PES33HS.js.map +0 -1
- package/dist/chunk-3O7ZEUW2.js.map +0 -1
- package/dist/chunk-723YNJBH.js +0 -17
- package/dist/chunk-723YNJBH.js.map +0 -1
- package/dist/chunk-GY5WH7TO.js +0 -10
- package/dist/chunk-GY5WH7TO.js.map +0 -1
- package/dist/chunk-MBR3TYNL.js.map +0 -1
- package/dist/chunk-MQIZAD4A.js.map +0 -1
- package/dist/chunk-NHXX4JI5.js +0 -28
- package/dist/chunk-NHXX4JI5.js.map +0 -1
- package/dist/chunk-OPCJRCYO.js +0 -19
- package/dist/chunk-OPCJRCYO.js.map +0 -1
- package/dist/chunk-T5XNMVOI.js +0 -24
- package/dist/chunk-T5XNMVOI.js.map +0 -1
- package/dist/chunk-TRNBHPNW.js.map +0 -1
- package/dist/chunk-VHW5YNIB.js +0 -17
- package/dist/chunk-VHW5YNIB.js.map +0 -1
- package/dist/chunk-VKH2JLDZ.js +0 -10
- package/dist/chunk-VKH2JLDZ.js.map +0 -1
- package/dist/chunk-WY4CAEPG.js +0 -14
- package/dist/chunk-WY4CAEPG.js.map +0 -1
- package/dist/dialog-header.d.ts +0 -14
- package/dist/dialog-header.js +0 -3
- package/dist/dialog-header.js.map +0 -1
- package/dist/menu-header.d.ts +0 -15
- package/dist/menu-header.js +0 -3
- package/dist/menu-header.js.map +0 -1
- package/dist/menu-item.d.ts +0 -22
- package/dist/menu-item.js +0 -3
- package/dist/menu-item.js.map +0 -1
- package/dist/page-header.d.ts +0 -9
- package/dist/page-header.js +0 -3
- package/dist/page-header.js.map +0 -1
- package/src/app-tab.css +0 -20
- package/src/dialog-header.css +0 -9
- package/src/empty-state.css +0 -6
- package/src/foundation.css +0 -106
- package/src/loading-spinner.css +0 -4
- package/src/lucide-icon.css +0 -1
- package/src/menu-header.css +0 -13
- package/src/menu-item.css +0 -12
- package/src/page-header.css +0 -3
- package/src/resizable-region.css +0 -19
- package/src/select.css +0 -18
- package/src/state-banner.css +0 -31
- package/src/styles.css +0 -18
- package/src/tab-bar.css +0 -4
- package/src/toolbar-control-group.css +0 -25
- package/src/toolbar-text.css +0 -4
- package/src/toolbar.css +0 -9
- package/src/value-table.css +0 -5
package/README.md
CHANGED
|
@@ -2,46 +2,178 @@
|
|
|
2
2
|
|
|
3
3
|
Accessible, composable UI primitives for [kerf](https://github.com/brianwestphal/kerf). The package ships production components, component-reachable CSS, accessibility and keyboard contracts, an AI-readable guide, and a production-backed UX catalog.
|
|
4
4
|
|
|
5
|
+
Start interface work with the [need-first component selection matrix](./docs/component-selection.md). It distinguishes direct reuse, composition, thin application adapters, and genuinely custom semantics, with imports, required wiring, application ownership, alternatives, and recipes for every public primitive.
|
|
6
|
+
|
|
7
|
+
For connective application patterns, use the seven [production composition
|
|
8
|
+
recipes](./docs/recipes.md). Each has a stable catalog route, runnable state,
|
|
9
|
+
public-subpath source, semantic layout ownership, and explicit application
|
|
10
|
+
customization boundaries. The composer recipe demonstrates one coherent form
|
|
11
|
+
surface with `PanelHeader` hierarchy and field/action controls aligned to the
|
|
12
|
+
shared 8px gutter; only persistent feedback adds a nested semantic
|
|
13
|
+
`StateBanner` surface.
|
|
14
|
+
|
|
15
|
+
When no primitive matches, keep policy application-owned while reusing the
|
|
16
|
+
layout vocabulary. The typed
|
|
17
|
+
[`command-palette-adapter.tsx`](./docs/examples/command-palette-adapter.tsx)
|
|
18
|
+
shows that application boundary explicitly; it is reference source, not a package
|
|
19
|
+
runtime export.
|
|
20
|
+
|
|
5
21
|
```bash
|
|
6
22
|
npm install kerfjs @kerfjs/ui
|
|
7
23
|
```
|
|
8
24
|
|
|
9
25
|
```tsx
|
|
10
|
-
import {
|
|
26
|
+
import { ListItem } from '@kerfjs/ui/list-item';
|
|
27
|
+
import { ListHeader } from '@kerfjs/ui/list-header';
|
|
28
|
+
import { ListActionRow } from '@kerfjs/ui/list-action-row';
|
|
11
29
|
import { Toolbar } from '@kerfjs/ui/toolbar';
|
|
30
|
+
import { ToolbarControlGroup } from '@kerfjs/ui/toolbar-control-group';
|
|
12
31
|
import { ToolbarText } from '@kerfjs/ui/toolbar-text';
|
|
13
32
|
|
|
14
33
|
mount(root, () => <>
|
|
15
|
-
<Toolbar label="Document" leading={<ToolbarText text="Notes"
|
|
16
|
-
<
|
|
34
|
+
<Toolbar label="Document" leading={<ToolbarControlGroup appearance="borderless" single><ToolbarText text="Notes" /></ToolbarControlGroup>} />
|
|
35
|
+
<section>
|
|
36
|
+
<ListHeader
|
|
37
|
+
label="Workspace"
|
|
38
|
+
action="show-workspace-actions"
|
|
39
|
+
actionLabel="Workspace actions"
|
|
40
|
+
rootAttributes={{ 'data-section-id': 'workspace' }}
|
|
41
|
+
triggerAttributes={{
|
|
42
|
+
popoverTarget: 'workspace-actions',
|
|
43
|
+
popoverTargetAction: 'toggle',
|
|
44
|
+
'aria-controls': 'workspace-actions',
|
|
45
|
+
'aria-haspopup': 'dialog',
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
<ListItem
|
|
49
|
+
action="open-notes"
|
|
50
|
+
label="Notes"
|
|
51
|
+
selected
|
|
52
|
+
rootAttributes={{ 'data-command-color': 'blue', 'data-drop-status': 'ready' }}
|
|
53
|
+
/>
|
|
54
|
+
<ListActionRow
|
|
55
|
+
action="open-file"
|
|
56
|
+
itemId="src/main.ts"
|
|
57
|
+
label="src/main.ts"
|
|
58
|
+
trailingAction="open-file-actions"
|
|
59
|
+
trailingActionLabel="Actions for src/main.ts"
|
|
60
|
+
trailingActionIcon={moreIcon}
|
|
61
|
+
/>
|
|
62
|
+
<div id="workspace-actions" popover="auto">Application-owned actions</div>
|
|
63
|
+
</section>
|
|
17
64
|
</>);
|
|
18
65
|
```
|
|
19
66
|
|
|
20
67
|
Components return Kerf `SafeHtml`. They do not own application state or attach transient listeners. Actions are stable `data-action` hooks; the application wires them once with `delegate()` or `delegateActions()` and retains the disposer.
|
|
21
68
|
|
|
69
|
+
`ListItem.rootAttributes`, `ListHeader.rootAttributes`,
|
|
70
|
+
`ListActionRow.rootAttributes`, and `AppTab.rootAttributes` carry typed
|
|
71
|
+
application `data-*` metadata without
|
|
72
|
+
teaching the package domain fields. `ListHeader.triggerAttributes` and
|
|
73
|
+
`ListActionRow.trailingActionAttributes` additionally support native popover
|
|
74
|
+
target and relationship attributes. Roles and component-owned action, selection,
|
|
75
|
+
disclosure, naming, disabled, and icon semantics remain protected props; an
|
|
76
|
+
isolated `role="menuitem"` is not an extension shortcut.
|
|
77
|
+
The slots are also filtered at runtime, so structurally widened objects and
|
|
78
|
+
JavaScript callers cannot bypass those protections with case-variant names.
|
|
79
|
+
`ListItem.trailing` is dormant metadata. Use `ListActionRow` when a row needs
|
|
80
|
+
sibling primary and trailing native-button actions with independent names,
|
|
81
|
+
disabled states, focus, and click ownership. Its `label`, `icon`, and
|
|
82
|
+
`trailingActionIcon` slots are dormant content and must not contain controls.
|
|
83
|
+
In either component's multiline mode, the leading icon remains aligned with
|
|
84
|
+
the first text line as the label wraps below it.
|
|
85
|
+
For section quantities, pass a non-negative safe-integer `count` together with
|
|
86
|
+
the localized full spoken phrase in `countLabel`, for example
|
|
87
|
+
`count={3} countLabel="3 notes"`. This renders the standard neutral count pill
|
|
88
|
+
and includes the count in the heading or disclosure button's accessible name.
|
|
89
|
+
Do not concatenate a count into `label` or pass a numeric `badge`; the mutually
|
|
90
|
+
exclusive legacy `badge` slot remains available for non-count `SafeHtml` such
|
|
91
|
+
as a `New` marker.
|
|
92
|
+
|
|
22
93
|
## Component subpaths
|
|
23
94
|
|
|
24
95
|
| Component | Browser import (includes reachable CSS) | Manual CSS export |
|
|
25
96
|
| --- | --- | --- |
|
|
26
97
|
| `LucideIcon` | `@kerfjs/ui/lucide-icon` | `@kerfjs/ui/lucide-icon.css` |
|
|
98
|
+
| `DisclosureArrow` | `@kerfjs/ui/disclosure-arrow` | `@kerfjs/ui/disclosure-arrow.css` |
|
|
27
99
|
| `Toolbar` | `@kerfjs/ui/toolbar` | `@kerfjs/ui/toolbar.css` |
|
|
28
100
|
| `ToolbarControlGroup` | `@kerfjs/ui/toolbar-control-group` | `@kerfjs/ui/toolbar-control-group.css` |
|
|
29
101
|
| `ToolbarText` | `@kerfjs/ui/toolbar-text` | `@kerfjs/ui/toolbar-text.css` |
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
102
|
+
| `ListActionRow` | `@kerfjs/ui/list-action-row` | `@kerfjs/ui/list-action-row.css` |
|
|
103
|
+
| `ListItem` | `@kerfjs/ui/list-item` | `@kerfjs/ui/list-item.css` |
|
|
104
|
+
| `ListHeader` | `@kerfjs/ui/list-header` | `@kerfjs/ui/list-header.css` |
|
|
105
|
+
| Pane, content, and navigation composition | — | `@kerfjs/ui/layout.css` |
|
|
32
106
|
| `ResizableRegion` | `@kerfjs/ui/resizable-region` | `@kerfjs/ui/resizable-region.css` |
|
|
33
107
|
| `wireResizableRegions` | `@kerfjs/ui/wire-resizable-regions` | — |
|
|
34
108
|
| `AppTab` | `@kerfjs/ui/app-tab` | `@kerfjs/ui/app-tab.css` |
|
|
35
109
|
| `TabBar` | `@kerfjs/ui/tab-bar` | `@kerfjs/ui/tab-bar.css` |
|
|
36
110
|
| `wireTabBars`, `reorderTabs` | `@kerfjs/ui/wire-tab-bars` | — |
|
|
37
|
-
| `PageHeader` | `@kerfjs/ui/page-header` | `@kerfjs/ui/page-header.css` |
|
|
38
111
|
| `LoadingSpinner` | `@kerfjs/ui/loading-spinner` | `@kerfjs/ui/loading-spinner.css` |
|
|
112
|
+
| `Skeleton` | `@kerfjs/ui/skeleton` | `@kerfjs/ui/skeleton.css` |
|
|
39
113
|
| `Select` | `@kerfjs/ui/select` | `@kerfjs/ui/select.css` |
|
|
40
114
|
| `SegmentedControl` | `@kerfjs/ui/segmented-control` | `@kerfjs/ui/segmented-control.css` |
|
|
115
|
+
| `TokenSearchField`, `readTokenSearchField`, `placeTokenSearchCaret` | `@kerfjs/ui/token-search-field` | `@kerfjs/ui/token-search-field.css` |
|
|
116
|
+
| `wireTokenSearchFields` | `@kerfjs/ui/wire-token-search-fields` | — |
|
|
41
117
|
| `StateBanner` | `@kerfjs/ui/state-banner` | `@kerfjs/ui/state-banner.css` |
|
|
42
118
|
| `EmptyState` | `@kerfjs/ui/empty-state` | `@kerfjs/ui/empty-state.css` |
|
|
43
|
-
| `
|
|
44
|
-
| `ValueTable` | `@kerfjs/ui/value-table` | `@kerfjs/ui/value-table.css` |
|
|
119
|
+
| `PanelHeader` | `@kerfjs/ui/panel-header` | `@kerfjs/ui/panel-header.css` |
|
|
120
|
+
| `ValueTable`, `ValueTableRow` | `@kerfjs/ui/value-table` | `@kerfjs/ui/value-table.css` |
|
|
121
|
+
|
|
122
|
+
`PanelHeader` is a plain `Toolbar` used as a panel, dialog, or page heading: an
|
|
123
|
+
optional icon control group (given a brand fill with a matching border), the
|
|
124
|
+
title as extra-large `ToolbarText`, the app's trailing action controls, and an
|
|
125
|
+
optional subtitle on a separate row below the title. It overrides no toolbar
|
|
126
|
+
styles — the app passes its own trailing controls (typically a
|
|
127
|
+
`ToolbarControlGroup`).
|
|
128
|
+
|
|
129
|
+
`DisclosureArrow` defaults to an 18px root-scaled decorative visual. Override
|
|
130
|
+
`--kui-disclosure-arrow-size` at the narrowest useful scope when a consumer
|
|
131
|
+
needs another size; the owning control still supplies interaction, naming, and
|
|
132
|
+
expanded state. Kerf `Select` retains its independent Web Awesome expand-glyph
|
|
133
|
+
scale of `.5` through `--kui-disclosure-icon-scale`. Author replacement
|
|
134
|
+
`DisclosureArrow` icon content facing right before its configured direction
|
|
135
|
+
transform is applied. Direction changes take the shortest rotation path; a
|
|
136
|
+
180-degree closed-to-open tie uses counterclockwise rotation.
|
|
137
|
+
|
|
138
|
+
`ListHeader` supplies that production `DisclosureArrow` automatically when
|
|
139
|
+
`toggle` is true and `actionIcon` is omitted. Keep `expanded` synchronized with
|
|
140
|
+
real controlled content and preserve the button's stable label; ordinary
|
|
141
|
+
navigation must not display a disclosure arrow. A custom `actionIcon` remains
|
|
142
|
+
an escape hatch and replaces the default arrow entirely. The header fills its
|
|
143
|
+
available inline width, keeping a separate action at the logical end in a 44px
|
|
144
|
+
target. Its visible action glyph defaults to 18px through
|
|
145
|
+
`--kui-list-header-action-icon-size`.
|
|
146
|
+
|
|
147
|
+
## Machine-readable catalog
|
|
148
|
+
|
|
149
|
+
AI tools can retrieve the shipped [`ai/component-catalog.json`](./ai/component-catalog.json)
|
|
150
|
+
for the exhaustive component and composition inventory. It is the canonical
|
|
151
|
+
source for ids, public exports, purpose and selection guidance, relationships,
|
|
152
|
+
delivery and side effects, companion wiring, application-owned policy,
|
|
153
|
+
variants, accessibility obligations, public CSS hooks, routes, and current
|
|
154
|
+
documentation/recipe links. The adjacent
|
|
155
|
+
[`component-catalog.schema.json`](./ai/component-catalog.schema.json) describes
|
|
156
|
+
the versioned format.
|
|
157
|
+
|
|
158
|
+
For code generation, pair catalog selection guidance with the checked-in
|
|
159
|
+
[`public-api-signatures-v1.md`](./ai/public-api-signatures-v1.md) declaration
|
|
160
|
+
snapshot. It is generated from the emitted `@kerfjs/ui` declarations and the
|
|
161
|
+
installed `kerfjs/actions` declaration, so callback names, props, return values,
|
|
162
|
+
and accepted import paths do not have to be inferred from examples. Direct
|
|
163
|
+
Web Awesome JSX has its own generated
|
|
164
|
+
[`webawesome-jsx-signatures-v1.md`](./ai/webawesome-jsx-signatures-v1.md)
|
|
165
|
+
context so adding the declaration boundary does not mutate a frozen measured
|
|
166
|
+
regression suite.
|
|
167
|
+
|
|
168
|
+
`npm run catalog:sync` deterministically projects the fields used by the UX
|
|
169
|
+
catalog into `ux-demo/catalog.generated.ts`, including the existing guidance
|
|
170
|
+
path and the first-party source path for each main, recipe, or Web Awesome
|
|
171
|
+
specimen. First-party component entries also derive their implementation path
|
|
172
|
+
from the canonical browser import. Do not edit that generated file.
|
|
173
|
+
`npm run check:catalog` rejects stale generated output, exports and package
|
|
174
|
+
paths, Web Awesome manifest/declaration drift, invalid relationships, broken
|
|
175
|
+
links, or a missing AI-guidance entry. Prose remains authored where design
|
|
176
|
+
nuance matters.
|
|
45
177
|
|
|
46
178
|
Import components from their explicit JavaScript subpaths. CSS-aware browser
|
|
47
179
|
bundlers such as Vite, webpack, and esbuild follow each subpath's `browser`
|
|
@@ -61,17 +193,61 @@ entry for a browser build with a custom styling pipeline. The exported
|
|
|
61
193
|
delivery. Load application overrides after package styles, or scope `--kui-*`
|
|
62
194
|
variables directly on a component instance.
|
|
63
195
|
|
|
196
|
+
## Pane and content geometry
|
|
197
|
+
|
|
198
|
+
Import `@kerfjs/ui/layout.css` and use the same structural vocabulary for a
|
|
199
|
+
sidebar, main area, inspector, or dialog. `.kui-pane` is unpadded and contains
|
|
200
|
+
an optional toolbar, one scrolling `.kui-pane__content`, and an optional footer.
|
|
201
|
+
Add `.kui-content` to make its major children a vertical stack with 24px gaps.
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
<aside class="kui-pane">
|
|
205
|
+
<div class="kui-pane__toolbar"><Toolbar label="Workspace" ... /></div>
|
|
206
|
+
<nav class="kui-pane__content kui-content">
|
|
207
|
+
<section>
|
|
208
|
+
<ListHeader label="Workspace" count={3} countLabel="3 workspaces" />
|
|
209
|
+
<ListItem action="open" label="Inbox" icon={inboxIcon} />
|
|
210
|
+
<ListItem action="open" label="Drafts" />
|
|
211
|
+
</section>
|
|
212
|
+
<div class="kui-content-item">Workspace details</div>
|
|
213
|
+
</nav>
|
|
214
|
+
</aside>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Ordinary children use `.kui-content-item`: 8px inline margin, a real 1px border
|
|
218
|
+
(transparent by default), 8px padding, and 12px rounded corners. The pill
|
|
219
|
+
modifier uses a 22px radius. A component can expose a transparent border or
|
|
220
|
+
background without changing layout. `ListHeader` follows the same rule while
|
|
221
|
+
keeping its dormant title and count-or-badge cluster separate from its optional
|
|
222
|
+
44px action.
|
|
223
|
+
|
|
224
|
+
## Spacing and application layout
|
|
225
|
+
|
|
226
|
+
Use 24px only for major vertical separation; use 8px inside content items and
|
|
227
|
+
between toolbar groups. Toolbar groups are 44px outside (`2px + 42px`) and keep
|
|
228
|
+
that geometry when their border/background are transparent. Wrap text and other
|
|
229
|
+
dormant toolbar content in a `ToolbarControlGroup` too. Do not pad the pane
|
|
230
|
+
itself, add competing wrapper insets, or give it more than one scroll owner.
|
|
231
|
+
Reading width and responsive pane placement remain application decisions. See
|
|
232
|
+
the complete [layout contract](./docs/layout.md).
|
|
233
|
+
|
|
64
234
|
## Web Awesome theme
|
|
65
235
|
|
|
66
236
|
Apps using Web Awesome's free components can opt into the same visual universe
|
|
67
237
|
with one CSS import:
|
|
68
238
|
|
|
69
239
|
```ts
|
|
240
|
+
import type {} from '@kerfjs/ui/webawesome';
|
|
70
241
|
import '@kerfjs/ui/webawesome.css';
|
|
71
242
|
import '@awesome.me/webawesome/dist/components/button/button.js';
|
|
72
243
|
import '@awesome.me/webawesome/dist/components/input/input.js';
|
|
73
244
|
```
|
|
74
245
|
|
|
246
|
+
The type-only `@kerfjs/ui/webawesome` import adds Kerf JSX intrinsic-element
|
|
247
|
+
declarations for the same 70 elements tracked by the catalog. It emits no
|
|
248
|
+
runtime code and registers nothing; keep importing only the individual Web
|
|
249
|
+
Awesome modules the application renders.
|
|
250
|
+
|
|
75
251
|
`webawesome.css` includes Web Awesome's native/base theme and then applies the
|
|
76
252
|
Hot Sheet 2 palette, surfaces, status colors, focus treatment, form geometry,
|
|
77
253
|
radii, tooltips, and shadows through Web Awesome's public `--wa-*` contract.
|
|
@@ -100,6 +276,10 @@ foreground roles through `--kui-color-*`; stateful components also expose
|
|
|
100
276
|
component variables such as `--kui-state-banner-background`. Override the
|
|
101
277
|
foundation for an application theme, a tone variable for one semantic state, or
|
|
102
278
|
a component variable on one instance without replacing component selectors.
|
|
279
|
+
Prefer an equivalent prop or token. When composition-specific layout still
|
|
280
|
+
needs a selector, the component catalog's `publicClasses` arrays define the
|
|
281
|
+
exact stable anatomy: public-class-to-public-class selectors are supported;
|
|
282
|
+
descendant tag, id, attribute-only, and unlisted-class selectors are not.
|
|
103
283
|
|
|
104
284
|
`StateBanner` has opinionated `neutral`, `info`, `success`, `warning`, and
|
|
105
285
|
`danger` palettes. Override an individual banner with
|
|
@@ -137,12 +317,45 @@ value through `data-segment-value`. Override an instance through
|
|
|
137
317
|
`--kui-segmented-{background|border|foreground|hover-background}` and
|
|
138
318
|
`--kui-segmented-selected-{background|foreground|border|shadow}`.
|
|
139
319
|
|
|
320
|
+
`TokenSearchField` is a token-controlled contenteditable searchbox that keeps
|
|
321
|
+
free text and ordered filter chips in one field. Its editable text stays
|
|
322
|
+
DOM-owned between token changes so typing does not replace the caret. Tokens
|
|
323
|
+
expose stable edit/remove actions and remain atomic during editing; the app owns
|
|
324
|
+
parsing, suggestions, query execution, and state. Use `readTokenSearchField()`
|
|
325
|
+
after browser input to recover text plus token offsets, and
|
|
326
|
+
`placeTokenSearchCaret()` when restoring focus after a controlled update.
|
|
327
|
+
Call `wireTokenSearchFields()` once at a stable root to make Enter submit through
|
|
328
|
+
`onSubmit` without inserting a contenteditable line break and to preserve focus
|
|
329
|
+
plus the text-relative caret when keyboard deletion of a chip causes controlled
|
|
330
|
+
rendering to replace the editor. Text still wraps visually when it reaches the
|
|
331
|
+
field edge.
|
|
332
|
+
Clear actions should empty the editor's `textContent` before clearing app state.
|
|
333
|
+
The leading icon, first text line, clear action, and trailing slot share one
|
|
334
|
+
fixed alignment row; when text wraps, those controls stay pinned to that first
|
|
335
|
+
row instead of recentering against the taller editor.
|
|
336
|
+
Set `collapsible` for the first-class compact presentation: an empty closed
|
|
337
|
+
field renders as one iconic search action, `expanded` reveals the complete
|
|
338
|
+
field, and text or tokens keep it expanded. Width changes animate by default
|
|
339
|
+
and respect reduced-motion preferences. The field works standalone or inside a
|
|
340
|
+
`ToolbarControlGroup`; the application owns the transient focused/open signal,
|
|
341
|
+
focus transfer, and focusout policy. The catalog's Toolbar route demonstrates
|
|
342
|
+
that composition at wide and narrow sizes.
|
|
343
|
+
Override its surface through `--kui-token-search-{background|border}` and its
|
|
344
|
+
chips through `--kui-token-search-token-{background|foreground}`. Override
|
|
345
|
+
`--kui-token-search-line-size` only when the complete first-line geometry must
|
|
346
|
+
change together.
|
|
347
|
+
|
|
140
348
|
`TabBar` is controlled: pass ordered `AppTab` children, then wire its keyboard
|
|
141
349
|
and same-bar drag behavior with `wireTabBars(root, { onReorder })`. During a
|
|
142
350
|
drag, the scroll strip automatically moves toward either edge with speed based
|
|
143
351
|
on pointer proximity, exposing earlier or later drop targets. Apply the reported
|
|
144
352
|
change with `reorderTabs()` or application-specific state logic. The application
|
|
145
353
|
still owns selection, closing, routing, and persistence.
|
|
354
|
+
Use `AppTab.rootAttributes` for domain `data-*` metadata and `closeIcon` for a
|
|
355
|
+
decorative replacement glyph. The runtime rejects roles and case variants of
|
|
356
|
+
the component- or wiring-owned action, tab identity, selection, drag, drop, and
|
|
357
|
+
component markers. Keep the icon free of interactive descendants; the named
|
|
358
|
+
close button retains all close interaction.
|
|
146
359
|
|
|
147
360
|
`Select` uses Web Awesome but does not register anything by itself. Install the optional peer, import the shared theme if desired, and explicitly import the registration entry in the application:
|
|
148
361
|
|
|
@@ -152,25 +365,42 @@ import '@kerfjs/ui/select/register';
|
|
|
152
365
|
```
|
|
153
366
|
|
|
154
367
|
That boundary keeps Web Awesome and its custom-element side effects out of bundles that use unrelated components. Automated consumer-bundle tests enforce it.
|
|
368
|
+
`Select` also owns the Kerf/Web Awesome reconciliation boundary: option icons
|
|
369
|
+
keep stable slotted elements across rerenders, and `renderSelected` content is
|
|
370
|
+
replaced when the controlled value changes. Consumers do not need to add
|
|
371
|
+
`data-key` or `data-morph-skip` workarounds around choice icons.
|
|
155
372
|
|
|
156
373
|
For application choices and panes, prefer Kerf's purpose-built primitives:
|
|
157
374
|
`Select` over direct Web Awesome selection/dropdown composition,
|
|
158
375
|
`SegmentedControl` over Button Group, `TabBar` or `SegmentedControl` over Web
|
|
159
376
|
Awesome Tabs, `LucideIcon` over Web Awesome Icon, and `ResizableRegion` over
|
|
160
377
|
Split Panel. `ResizableRegion` includes Hot Sheet 2's 1px separator and
|
|
161
|
-
hover/focus grip.
|
|
378
|
+
hover/focus grip. Its optional `handleIcon` replaces only the decorative glyph;
|
|
379
|
+
the component and `wireResizableRegions()` retain separator semantics and
|
|
380
|
+
pointer/keyboard behavior. Consider Web Awesome Popup when its anchored-positioning
|
|
162
381
|
engine removes custom placement code; treat Tree, Animated Image, Comparison,
|
|
163
382
|
Zoomable Frame, and the displaced alternatives above as exceptional rather
|
|
164
383
|
than default patterns. The detailed rationale lives in the theme contract.
|
|
165
384
|
|
|
166
385
|
## Design and tool guidance
|
|
167
386
|
|
|
387
|
+
- [Component selection and composition](./docs/component-selection.md)
|
|
168
388
|
- [Design philosophy](./docs/design-philosophy.md)
|
|
169
389
|
- [Apple HIG translation](./docs/apple-hig.md)
|
|
170
390
|
- [Accessibility and keyboard contracts](./docs/accessibility.md)
|
|
171
391
|
- [Component and integration contract](./docs/component-contract.md)
|
|
392
|
+
- [Spacing and application layout](./docs/layout.md)
|
|
172
393
|
- [Web Awesome theme contract](./docs/webawesome-theme.md)
|
|
173
394
|
- [UX catalog contract](./docs/ux-demo.md)
|
|
174
395
|
- [AI guide](./ai/skill.md)
|
|
175
396
|
|
|
176
|
-
Run `npm run dev` from this directory for the category-grouped master/detail catalog. Every public visual component has a focused route; all 70 free Web Awesome 3.12 components have focused routes under the collapsible ecosystem section. One grouped `Related components` selector contains derived `Uses` / `Used by` navigation across both sets. Run `npm run check` for static/unit/bundle gates and `npm run test:e2e` for the real-browser suite.
|
|
397
|
+
Run `npm run dev` from this directory for the category-grouped master/detail catalog. Every public visual component has a focused route; all 70 free Web Awesome 3.12 components have focused routes under the collapsible ecosystem section. Every detail visibly links its first-party demo source and existing guidance while showing the repository-relative paths; first-party components also link their implementation source, and Web Awesome entries label local guidance as Kerf integration guidance. One grouped `Related components` selector contains derived `Uses` / `Used by` navigation across both sets. Run `npm run check` for static/unit/bundle gates and `npm run test:e2e` for the real-browser suite.
|
|
398
|
+
|
|
399
|
+
Run `npm run format:css` after editing styles. The normal `npm run check` gate
|
|
400
|
+
uses Prettier to reject unformatted CSS in `src/` and `ux-demo/`.
|
|
401
|
+
|
|
402
|
+
For dimensions that should scale with the root font size, author pixels with
|
|
403
|
+
`remify()`: `gap: remify(17px)` builds to `gap: 1.0625rem` using a fixed 16px
|
|
404
|
+
baseline. Keep intentional 1px borders in pixels and contextual `em` values
|
|
405
|
+
explicit. `npm run build` emits standard CSS to `dist/styles`; `npm run dev`
|
|
406
|
+
applies the same transform directly to source styles and hot-reloads edits.
|