@kerfjs/ui 4.4.1 → 5.0.0-beta.4
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 +234 -5
- package/ai/component-catalog.json +4473 -0
- package/ai/component-catalog.schema.json +79 -0
- package/ai/public-api-signatures-v1.md +619 -0
- package/ai/skill.md +65 -11
- package/ai/webawesome-jsx-signatures-v1.md +106 -0
- package/dist/app-tab.d.ts +12 -2
- package/dist/app-tab.js +2 -1
- package/dist/browser/app-tab.js +2 -2
- package/dist/browser/dialog-header.js +4 -2
- package/dist/browser/disclosure-arrow.js +4 -0
- package/dist/browser/empty-state.js +3 -3
- package/dist/browser/loading-spinner.js +2 -2
- package/dist/browser/lucide-icon.js +2 -2
- package/dist/browser/menu-action-row.js +3 -0
- package/dist/browser/menu-header.js +4 -2
- package/dist/browser/menu-item.js +2 -2
- package/dist/browser/page-header.js +2 -2
- package/dist/browser/resizable-region.js +2 -2
- package/dist/browser/segmented-control.js +2 -2
- package/dist/browser/select.js +3 -3
- package/dist/browser/state-banner.js +2 -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 +2 -2
- package/dist/browser/toolbar.js +2 -2
- package/dist/browser/value-table.js +2 -2
- 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-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-NHXX4JI5.js → chunk-CTQKI2XL.js} +3 -3
- package/dist/chunk-CTQKI2XL.js.map +1 -0
- package/dist/chunk-EGHL5S4P.js +33 -0
- package/dist/chunk-EGHL5S4P.js.map +1 -0
- package/dist/chunk-H5AGGVU5.js +75 -0
- package/dist/chunk-H5AGGVU5.js.map +1 -0
- package/dist/chunk-K3G72I6D.js +24 -0
- package/dist/chunk-K3G72I6D.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-NPPD2A6O.js +40 -0
- package/dist/chunk-NPPD2A6O.js.map +1 -0
- package/dist/chunk-R6JHHBKQ.js +19 -0
- package/dist/chunk-R6JHHBKQ.js.map +1 -0
- package/dist/chunk-S3TPM2LP.js +23 -0
- package/dist/chunk-S3TPM2LP.js.map +1 -0
- package/dist/{chunk-T5XNMVOI.js → chunk-XZXRLY5Q.js} +14 -5
- package/dist/chunk-XZXRLY5Q.js.map +1 -0
- package/dist/dialog-header.d.ts +3 -2
- package/dist/dialog-header.js +3 -1
- 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 +5 -1
- package/dist/index.js +16 -11
- package/dist/menu-action-row.d.ts +50 -0
- package/dist/menu-action-row.js +4 -0
- package/dist/menu-action-row.js.map +1 -0
- package/dist/menu-header.d.ts +28 -2
- package/dist/menu-header.js +4 -1
- package/dist/menu-item.d.ts +10 -1
- package/dist/menu-item.js +2 -1
- package/dist/resizable-region.d.ts +3 -1
- package/dist/resizable-region.js +1 -1
- package/dist/select.js +1 -1
- package/dist/styles/app-tab.css +152 -0
- package/dist/styles/dialog-header.css +87 -0
- package/dist/styles/disclosure-arrow.css +23 -0
- package/dist/styles/empty-state.css +47 -0
- package/dist/styles/foundation.css +326 -0
- package/dist/styles/layout.css +73 -0
- package/dist/styles/loading-spinner.css +21 -0
- package/dist/styles/lucide-icon.css +6 -0
- package/dist/styles/menu-action-row.css +160 -0
- package/dist/styles/menu-header.css +143 -0
- package/dist/styles/menu-item.css +123 -0
- package/dist/styles/page-header.css +33 -0
- package/dist/styles/resizable-region.css +111 -0
- package/{src → dist/styles}/segmented-control.css +62 -31
- package/dist/styles/select.css +96 -0
- package/dist/styles/state-banner.css +173 -0
- package/dist/styles/styles.css +22 -0
- package/dist/styles/tab-bar.css +45 -0
- package/dist/styles/token-search-field.css +281 -0
- package/dist/styles/toolbar-control-group.css +161 -0
- package/dist/styles/toolbar-text.css +29 -0
- package/dist/styles/toolbar.css +52 -0
- package/dist/styles/value-table.css +75 -0
- package/{src → dist/styles}/webawesome.css +119 -29
- 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/value-table.d.ts +10 -2
- package/dist/value-table.js +1 -1
- package/dist/webawesome.d.ts +100 -0
- package/dist/webawesome.js +3 -0
- package/dist/webawesome.js.map +1 -0
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-token-search-fields.d.ts +11 -0
- package/dist/wire-token-search-fields.js +5 -0
- package/dist/wire-token-search-fields.js.map +1 -0
- package/docs/accessibility.md +60 -3
- package/docs/component-contract.md +131 -3
- package/docs/component-selection.md +133 -0
- package/docs/design-philosophy.md +38 -0
- package/docs/examples/command-palette-adapter.tsx +70 -0
- package/docs/layout.md +106 -0
- package/docs/recipes.md +124 -0
- package/docs/ux-demo.md +23 -9
- package/docs/webawesome-theme.md +15 -0
- package/llms.txt +25 -2
- package/package.json +70 -27
- package/ux-demo/recipes/app-shell.tsx +32 -0
- package/ux-demo/recipes/compact-toolbar.tsx +43 -0
- package/ux-demo/recipes/composer-form.tsx +63 -0
- package/ux-demo/recipes/list-workspace-states.tsx +26 -0
- package/ux-demo/recipes/loaders.ts +27 -0
- package/ux-demo/recipes/master-detail-dialog.tsx +45 -0
- package/ux-demo/recipes/mount-recipe.ts +38 -0
- package/ux-demo/recipes/navigation-sidebar.tsx +26 -0
- package/ux-demo/recipes/recipes.css +344 -0
- package/ux-demo/recipes/types.ts +11 -0
- package/ux-demo/recipes/workspace-header.tsx +12 -0
- 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-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.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/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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/brianwestphal/kerf/main/ui/ai/component-catalog.schema.json",
|
|
4
|
+
"title": "Kerf UI component catalog",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schemaVersion", "package", "description", "entries"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": { "type": "string" },
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"package": { "const": "@kerfjs/ui" },
|
|
11
|
+
"description": { "type": "string", "minLength": 1 },
|
|
12
|
+
"entries": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": { "$ref": "#/$defs/entry" }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"$defs": {
|
|
19
|
+
"entry": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"required": ["id", "name", "category", "kind", "source", "purpose", "useWhen", "avoidWhen", "delivery", "links"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"id": { "type": "string", "minLength": 1 },
|
|
24
|
+
"name": { "type": "string", "minLength": 1 },
|
|
25
|
+
"category": { "type": "string", "minLength": 1 },
|
|
26
|
+
"kind": { "enum": ["component", "composition", "recipe"] },
|
|
27
|
+
"source": { "enum": ["kerf", "webawesome"] },
|
|
28
|
+
"description": { "type": "string" },
|
|
29
|
+
"purpose": { "type": "string", "minLength": 1 },
|
|
30
|
+
"customElement": { "type": "string" },
|
|
31
|
+
"publicExports": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
32
|
+
"useWhen": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
|
|
33
|
+
"avoidWhen": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
|
|
34
|
+
"recommendation": { "enum": ["supported", "conditional", "exceptional", "underlying", "avoid"] },
|
|
35
|
+
"alternatives": { "type": "array", "items": { "$ref": "#/$defs/alternative" } },
|
|
36
|
+
"uses": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
37
|
+
"wiring": { "type": "array", "items": { "$ref": "#/$defs/wiring" } },
|
|
38
|
+
"appOwns": { "type": "array", "items": { "type": "string" } },
|
|
39
|
+
"variants": { "type": "array", "items": { "type": "string" } },
|
|
40
|
+
"accessibility": { "type": "array", "items": { "type": "string" } },
|
|
41
|
+
"publicClasses": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
42
|
+
"publicTokens": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
43
|
+
"delivery": { "$ref": "#/$defs/delivery" },
|
|
44
|
+
"links": { "$ref": "#/$defs/links" }
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"alternative": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"required": ["id", "relationship"],
|
|
51
|
+
"properties": { "id": { "type": "string" }, "relationship": { "type": "string" }, "when": { "type": "string" } },
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
},
|
|
54
|
+
"wiring": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": ["export", "import", "required"],
|
|
57
|
+
"properties": { "export": { "type": "string" }, "import": { "type": "string" }, "required": { "type": "boolean" }, "reason": { "type": "string" } },
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
},
|
|
60
|
+
"delivery": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": ["sideEffects"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"browserImport": { "type": "string" },
|
|
65
|
+
"manualCssImport": { "type": "string" },
|
|
66
|
+
"registrationImport": { "type": "string" },
|
|
67
|
+
"themeCssImport": { "type": "string" },
|
|
68
|
+
"sideEffects": { "type": "array", "items": { "type": "string" } }
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": false
|
|
71
|
+
},
|
|
72
|
+
"links": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": ["catalogRoute", "documentation", "recipe"],
|
|
75
|
+
"properties": { "catalogRoute": { "type": "string" }, "documentation": { "type": "string" }, "recipe": { "type": "string" } },
|
|
76
|
+
"additionalProperties": false
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
# Public API signatures for the UI authoring corpus
|
|
2
|
+
|
|
3
|
+
Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.4` and `kerfjs@5.0.0-beta.4`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
|
|
4
|
+
|
|
5
|
+
## `@kerfjs/ui/disclosure-arrow`
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { SafeHtml } from 'kerfjs';
|
|
9
|
+
|
|
10
|
+
type DisclosureDirection = 'up' | 'down' | 'left' | 'right';
|
|
11
|
+
interface DisclosureArrowProps {
|
|
12
|
+
open: boolean;
|
|
13
|
+
openDirection?: DisclosureDirection;
|
|
14
|
+
closedDirection?: DisclosureDirection;
|
|
15
|
+
/** Replacement icons should use right as their unrotated orientation. */
|
|
16
|
+
icon?: SafeHtml;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function DisclosureArrow({ open, openDirection, closedDirection, icon, className, }: DisclosureArrowProps): SafeHtml;
|
|
20
|
+
|
|
21
|
+
export { DisclosureArrow, type DisclosureArrowProps, type DisclosureDirection };
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## `@kerfjs/ui/toolbar`
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { SafeHtml } from 'kerfjs';
|
|
28
|
+
|
|
29
|
+
interface ToolbarProps {
|
|
30
|
+
leading?: SafeHtml;
|
|
31
|
+
center?: SafeHtml;
|
|
32
|
+
trailing?: SafeHtml;
|
|
33
|
+
label?: string;
|
|
34
|
+
divider?: boolean;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
declare function Toolbar({ leading, center, trailing, label, divider, className }: ToolbarProps): SafeHtml;
|
|
38
|
+
|
|
39
|
+
export { Toolbar, type ToolbarProps };
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## `@kerfjs/ui/toolbar-text`
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import * as kerfjs from 'kerfjs';
|
|
46
|
+
|
|
47
|
+
type ToolbarTextSize = 'large' | 'default' | 'small';
|
|
48
|
+
interface ToolbarTextProps {
|
|
49
|
+
text: string;
|
|
50
|
+
size?: ToolbarTextSize;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
declare function ToolbarText({ text, size, className }: ToolbarTextProps): kerfjs.SafeHtml;
|
|
54
|
+
|
|
55
|
+
export { ToolbarText, type ToolbarTextProps, type ToolbarTextSize };
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## `@kerfjs/ui/toolbar-control-group`
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { SafeHtml } from 'kerfjs';
|
|
62
|
+
|
|
63
|
+
interface ToolbarControlGroupProps {
|
|
64
|
+
children: SafeHtml | SafeHtml[];
|
|
65
|
+
label?: string;
|
|
66
|
+
className?: string;
|
|
67
|
+
expanded?: boolean;
|
|
68
|
+
single?: boolean;
|
|
69
|
+
appearance?: 'contained' | 'borderless';
|
|
70
|
+
tone?: 'default' | 'dark';
|
|
71
|
+
buttonAppearance?: 'plain' | 'push';
|
|
72
|
+
}
|
|
73
|
+
declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance }: ToolbarControlGroupProps): SafeHtml;
|
|
74
|
+
|
|
75
|
+
export { ToolbarControlGroup, type ToolbarControlGroupProps };
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## `@kerfjs/ui/menu-header`
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { SafeHtml } from 'kerfjs';
|
|
82
|
+
|
|
83
|
+
type MenuHeaderRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
84
|
+
'data-component'?: never;
|
|
85
|
+
'data-action'?: never;
|
|
86
|
+
'data-has-badge'?: never;
|
|
87
|
+
'data-has-count'?: never;
|
|
88
|
+
'data-toggle'?: never;
|
|
89
|
+
}>;
|
|
90
|
+
type MenuHeaderTriggerAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
91
|
+
'data-action'?: never;
|
|
92
|
+
popoverTarget?: string;
|
|
93
|
+
popoverTargetAction?: 'toggle' | 'show' | 'hide';
|
|
94
|
+
'aria-controls'?: string;
|
|
95
|
+
'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';
|
|
96
|
+
}>;
|
|
97
|
+
interface MenuHeaderBaseProps {
|
|
98
|
+
label: string;
|
|
99
|
+
action?: string;
|
|
100
|
+
actionLabel?: string;
|
|
101
|
+
actionIcon?: SafeHtml;
|
|
102
|
+
actionDisabled?: boolean;
|
|
103
|
+
disabledReason?: string;
|
|
104
|
+
expanded?: boolean;
|
|
105
|
+
toggle?: boolean;
|
|
106
|
+
rootAttributes?: MenuHeaderRootAttributes;
|
|
107
|
+
triggerAttributes?: MenuHeaderTriggerAttributes;
|
|
108
|
+
}
|
|
109
|
+
type MenuHeaderIndicatorProps = {
|
|
110
|
+
count: number;
|
|
111
|
+
countLabel: string;
|
|
112
|
+
badge?: never;
|
|
113
|
+
} | {
|
|
114
|
+
count?: never;
|
|
115
|
+
countLabel?: never;
|
|
116
|
+
badge?: SafeHtml;
|
|
117
|
+
};
|
|
118
|
+
type MenuHeaderProps = MenuHeaderBaseProps & MenuHeaderIndicatorProps;
|
|
119
|
+
declare function MenuHeader({ label, count, countLabel, badge, action, actionLabel, actionIcon, actionDisabled, disabledReason, expanded, toggle, rootAttributes, triggerAttributes }: MenuHeaderProps): SafeHtml;
|
|
120
|
+
|
|
121
|
+
export { MenuHeader, type MenuHeaderProps };
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## `@kerfjs/ui/menu-action-row`
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import { SafeHtml } from 'kerfjs';
|
|
128
|
+
|
|
129
|
+
type MenuActionRowRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
130
|
+
'data-component'?: never;
|
|
131
|
+
'data-action'?: never;
|
|
132
|
+
'data-item-id'?: never;
|
|
133
|
+
'data-has-icon'?: never;
|
|
134
|
+
'data-multiline'?: never;
|
|
135
|
+
'data-state'?: never;
|
|
136
|
+
'data-selected'?: never;
|
|
137
|
+
'data-pressed'?: never;
|
|
138
|
+
}>;
|
|
139
|
+
type MenuActionRowTrailingAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
140
|
+
'data-component'?: never;
|
|
141
|
+
'data-action'?: never;
|
|
142
|
+
'data-item-id'?: never;
|
|
143
|
+
popoverTarget?: string;
|
|
144
|
+
popoverTargetAction?: 'toggle' | 'show' | 'hide';
|
|
145
|
+
'aria-controls'?: string;
|
|
146
|
+
'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';
|
|
147
|
+
}>;
|
|
148
|
+
interface MenuActionRowProps {
|
|
149
|
+
/** Visible dormant content for the primary button. Must not contain interactive descendants. */
|
|
150
|
+
label: string | SafeHtml;
|
|
151
|
+
/** Decorative dormant content for the primary button. Must not contain interactive descendants. */
|
|
152
|
+
icon?: SafeHtml;
|
|
153
|
+
action: string;
|
|
154
|
+
itemId?: string;
|
|
155
|
+
selected?: boolean;
|
|
156
|
+
pressed?: boolean;
|
|
157
|
+
accessibleLabel?: string;
|
|
158
|
+
title?: string;
|
|
159
|
+
multiline?: boolean;
|
|
160
|
+
state?: string;
|
|
161
|
+
disabled?: boolean;
|
|
162
|
+
tabIndex?: number;
|
|
163
|
+
trailingAction: string;
|
|
164
|
+
trailingActionLabel: string;
|
|
165
|
+
/** Decorative dormant content for the trailing button. Must not contain interactive descendants. */
|
|
166
|
+
trailingActionIcon: SafeHtml;
|
|
167
|
+
trailingActionDisabled?: boolean;
|
|
168
|
+
trailingActionTitle?: string;
|
|
169
|
+
className?: string;
|
|
170
|
+
style?: string;
|
|
171
|
+
rootAttributes?: MenuActionRowRootAttributes;
|
|
172
|
+
trailingActionAttributes?: MenuActionRowTrailingAttributes;
|
|
173
|
+
}
|
|
174
|
+
declare function MenuActionRow({ label, icon, action, itemId, selected, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, trailingAction, trailingActionLabel, trailingActionIcon, trailingActionDisabled, trailingActionTitle, className, style, rootAttributes, trailingActionAttributes }: MenuActionRowProps): SafeHtml;
|
|
175
|
+
|
|
176
|
+
export { MenuActionRow, type MenuActionRowProps };
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## `@kerfjs/ui/menu-item`
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { SafeHtml } from 'kerfjs';
|
|
183
|
+
|
|
184
|
+
type MenuItemRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
185
|
+
'data-component'?: never;
|
|
186
|
+
'data-action'?: never;
|
|
187
|
+
'data-item-id'?: never;
|
|
188
|
+
'data-has-icon'?: never;
|
|
189
|
+
'data-multiline'?: never;
|
|
190
|
+
'data-state'?: never;
|
|
191
|
+
}>;
|
|
192
|
+
interface MenuItemProps {
|
|
193
|
+
label: string | SafeHtml;
|
|
194
|
+
icon?: SafeHtml;
|
|
195
|
+
trailing?: SafeHtml;
|
|
196
|
+
selected?: boolean;
|
|
197
|
+
action: string;
|
|
198
|
+
itemId?: string;
|
|
199
|
+
className?: string;
|
|
200
|
+
style?: string;
|
|
201
|
+
pressed?: boolean;
|
|
202
|
+
accessibleLabel?: string;
|
|
203
|
+
title?: string;
|
|
204
|
+
multiline?: boolean;
|
|
205
|
+
state?: string;
|
|
206
|
+
disabled?: boolean;
|
|
207
|
+
tabIndex?: number;
|
|
208
|
+
rootAttributes?: MenuItemRootAttributes;
|
|
209
|
+
}
|
|
210
|
+
declare function MenuItem({ label, icon, trailing, selected, action, itemId, className, style, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, rootAttributes }: MenuItemProps): SafeHtml;
|
|
211
|
+
|
|
212
|
+
export { MenuItem, type MenuItemProps };
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## `@kerfjs/ui/page-header`
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
import { SafeHtml } from 'kerfjs';
|
|
219
|
+
|
|
220
|
+
interface PageHeaderProps {
|
|
221
|
+
title: string | SafeHtml;
|
|
222
|
+
action?: SafeHtml;
|
|
223
|
+
}
|
|
224
|
+
declare function PageHeader({ title, action }: PageHeaderProps): SafeHtml;
|
|
225
|
+
|
|
226
|
+
export { PageHeader, type PageHeaderProps };
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## `@kerfjs/ui/dialog-header`
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import { SafeHtml } from 'kerfjs';
|
|
233
|
+
|
|
234
|
+
interface DialogHeaderProps {
|
|
235
|
+
title: string;
|
|
236
|
+
titleId: string;
|
|
237
|
+
summary?: string;
|
|
238
|
+
summaryId?: string;
|
|
239
|
+
icon?: SafeHtml;
|
|
240
|
+
iconClassName?: string;
|
|
241
|
+
actions?: SafeHtml;
|
|
242
|
+
actionsLabel?: string;
|
|
243
|
+
}
|
|
244
|
+
declare function DialogHeader({ title, titleId, summary, summaryId, icon, iconClassName, actions, actionsLabel }: DialogHeaderProps): SafeHtml;
|
|
245
|
+
|
|
246
|
+
export { DialogHeader, type DialogHeaderProps };
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## `@kerfjs/ui/value-table`
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
import { SafeHtml } from 'kerfjs';
|
|
253
|
+
|
|
254
|
+
interface ValueTableRowProps {
|
|
255
|
+
label: string | SafeHtml;
|
|
256
|
+
value: string | SafeHtml;
|
|
257
|
+
icon?: SafeHtml;
|
|
258
|
+
className?: string;
|
|
259
|
+
}
|
|
260
|
+
declare function ValueTableRow({ label, value, icon, className }: ValueTableRowProps): SafeHtml;
|
|
261
|
+
|
|
262
|
+
interface ValueTableProps {
|
|
263
|
+
label: string;
|
|
264
|
+
className?: string;
|
|
265
|
+
children: SafeHtml | readonly SafeHtml[];
|
|
266
|
+
}
|
|
267
|
+
declare function ValueTable({ label, className, children }: ValueTableProps): SafeHtml;
|
|
268
|
+
|
|
269
|
+
export { ValueTable, type ValueTableProps, ValueTableRow, type ValueTableRowProps };
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## `@kerfjs/ui/app-tab`
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import { SafeHtml } from 'kerfjs';
|
|
276
|
+
|
|
277
|
+
type AppTabRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
278
|
+
'data-component'?: never;
|
|
279
|
+
'data-action'?: never;
|
|
280
|
+
'data-tab-id'?: never;
|
|
281
|
+
'data-selected'?: never;
|
|
282
|
+
'data-tab-dragging'?: never;
|
|
283
|
+
'data-tab-drop-position'?: never;
|
|
284
|
+
}>;
|
|
285
|
+
interface AppTabProps {
|
|
286
|
+
id: string;
|
|
287
|
+
name: string;
|
|
288
|
+
selected?: boolean;
|
|
289
|
+
closable?: boolean;
|
|
290
|
+
draggable?: boolean;
|
|
291
|
+
leading?: SafeHtml;
|
|
292
|
+
trailing?: SafeHtml;
|
|
293
|
+
/** Decorative dormant content for the close button. Must not contain interactive descendants. */
|
|
294
|
+
closeIcon?: SafeHtml;
|
|
295
|
+
selectAction?: string;
|
|
296
|
+
closeAction?: string;
|
|
297
|
+
className?: string;
|
|
298
|
+
rootAttributes?: AppTabRootAttributes;
|
|
299
|
+
}
|
|
300
|
+
declare function AppTab({ id, name, selected, closable, draggable, leading, trailing, closeIcon, selectAction, closeAction, className, rootAttributes }: AppTabProps): SafeHtml;
|
|
301
|
+
|
|
302
|
+
export { AppTab, type AppTabProps };
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## `@kerfjs/ui/tab-bar`
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
import { SafeHtml } from 'kerfjs';
|
|
309
|
+
|
|
310
|
+
interface TabBarProps {
|
|
311
|
+
id: string;
|
|
312
|
+
label: string;
|
|
313
|
+
children: SafeHtml | readonly SafeHtml[];
|
|
314
|
+
leading?: SafeHtml;
|
|
315
|
+
trailing?: SafeHtml;
|
|
316
|
+
className?: string;
|
|
317
|
+
}
|
|
318
|
+
/** Render a controlled tab strip. The application owns selection, order, and persistence. */
|
|
319
|
+
declare function TabBar({ id, label, children, leading, trailing, className }: TabBarProps): SafeHtml;
|
|
320
|
+
|
|
321
|
+
export { TabBar, type TabBarProps };
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## `@kerfjs/ui/wire-tab-bars`
|
|
325
|
+
|
|
326
|
+
```ts
|
|
327
|
+
type TabReorderSource = 'pointer' | 'keyboard';
|
|
328
|
+
type TabDropPosition = 'before' | 'after';
|
|
329
|
+
interface TabReorder {
|
|
330
|
+
barId: string;
|
|
331
|
+
sourceId: string;
|
|
332
|
+
targetId: string;
|
|
333
|
+
position: TabDropPosition;
|
|
334
|
+
source: TabReorderSource;
|
|
335
|
+
}
|
|
336
|
+
interface WireTabBarsOptions {
|
|
337
|
+
onReorder: (change: TabReorder) => void;
|
|
338
|
+
}
|
|
339
|
+
declare function reorderTabs<T>(items: readonly T[], getId: (item: T) => string, sourceId: string, targetId: string, position: TabDropPosition): T[];
|
|
340
|
+
/** Wire reordering and keyboard navigation while leaving controlled state in the application. */
|
|
341
|
+
declare function wireTabBars(root: HTMLElement | Document, { onReorder }: WireTabBarsOptions): () => void;
|
|
342
|
+
|
|
343
|
+
export { type TabDropPosition, type TabReorder, type TabReorderSource, type WireTabBarsOptions, reorderTabs, wireTabBars };
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## `@kerfjs/ui/resizable-region`
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
import { SafeHtml } from 'kerfjs';
|
|
350
|
+
|
|
351
|
+
type ResizableRegionAxis = 'horizontal' | 'vertical';
|
|
352
|
+
type ResizableRegionEdge = 'start' | 'end';
|
|
353
|
+
interface ResizableRegionProps {
|
|
354
|
+
id: string;
|
|
355
|
+
label: string;
|
|
356
|
+
size: number;
|
|
357
|
+
min: number;
|
|
358
|
+
max: number;
|
|
359
|
+
axis?: ResizableRegionAxis;
|
|
360
|
+
edge?: ResizableRegionEdge;
|
|
361
|
+
collapsed?: boolean;
|
|
362
|
+
transitioning?: boolean;
|
|
363
|
+
/** Decorative dormant content for the separator handle. Must not contain interactive descendants. */
|
|
364
|
+
handleIcon?: SafeHtml;
|
|
365
|
+
children: SafeHtml | SafeHtml[];
|
|
366
|
+
}
|
|
367
|
+
declare const clampRegionSize: (size: number, min: number, max: number) => number;
|
|
368
|
+
declare const resizeRegionFromPointer: (startSize: number, delta: number, edge: ResizableRegionEdge) => number;
|
|
369
|
+
declare function ResizableRegion({ id, label, size, min, max, axis, edge, collapsed, transitioning, handleIcon, children }: ResizableRegionProps): SafeHtml;
|
|
370
|
+
|
|
371
|
+
export { ResizableRegion, type ResizableRegionAxis, type ResizableRegionEdge, type ResizableRegionProps, clampRegionSize, resizeRegionFromPointer };
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
## `@kerfjs/ui/wire-resizable-regions`
|
|
375
|
+
|
|
376
|
+
```ts
|
|
377
|
+
interface ResizeCommit {
|
|
378
|
+
id: string;
|
|
379
|
+
size: number;
|
|
380
|
+
source: 'keyboard' | 'pointer';
|
|
381
|
+
}
|
|
382
|
+
interface WireResizableRegionsOptions {
|
|
383
|
+
step?: number;
|
|
384
|
+
largeStep?: number;
|
|
385
|
+
onPreview?: (change: ResizeCommit) => void;
|
|
386
|
+
onCommit: (change: ResizeCommit) => void;
|
|
387
|
+
}
|
|
388
|
+
/** Wire pointer and separator-keyboard behavior for every ResizableRegion below root. */
|
|
389
|
+
declare function wireResizableRegions(root: HTMLElement, { step, largeStep, onPreview, onCommit }: WireResizableRegionsOptions): () => void;
|
|
390
|
+
|
|
391
|
+
export { type ResizeCommit, type WireResizableRegionsOptions, wireResizableRegions };
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## `@kerfjs/ui/segmented-control`
|
|
395
|
+
|
|
396
|
+
```ts
|
|
397
|
+
import { SafeHtml } from 'kerfjs';
|
|
398
|
+
|
|
399
|
+
type SegmentedControlAppearance = 'filled' | 'outlined' | 'toolbar';
|
|
400
|
+
type SegmentedControlShape = 'rounded' | 'pill';
|
|
401
|
+
type SegmentedControlSize = 'small' | 'default';
|
|
402
|
+
type SegmentedControlLayout = 'content' | 'equal';
|
|
403
|
+
interface SegmentedControlChoice {
|
|
404
|
+
value: string;
|
|
405
|
+
label: string;
|
|
406
|
+
content?: SafeHtml;
|
|
407
|
+
title?: string;
|
|
408
|
+
disabled?: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface SegmentedControlProps {
|
|
411
|
+
id: string;
|
|
412
|
+
label: string;
|
|
413
|
+
value: string;
|
|
414
|
+
choices: readonly SegmentedControlChoice[];
|
|
415
|
+
action?: string;
|
|
416
|
+
appearance?: SegmentedControlAppearance;
|
|
417
|
+
shape?: SegmentedControlShape;
|
|
418
|
+
size?: SegmentedControlSize;
|
|
419
|
+
layout?: SegmentedControlLayout;
|
|
420
|
+
className?: string;
|
|
421
|
+
}
|
|
422
|
+
declare function SegmentedControl({ id, label, value, choices, action, appearance, shape, size, layout, className, }: SegmentedControlProps): SafeHtml;
|
|
423
|
+
|
|
424
|
+
export { SegmentedControl, type SegmentedControlAppearance, type SegmentedControlChoice, type SegmentedControlLayout, type SegmentedControlProps, type SegmentedControlShape, type SegmentedControlSize };
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## `@kerfjs/ui/state-banner`
|
|
428
|
+
|
|
429
|
+
```ts
|
|
430
|
+
import { SafeHtml } from 'kerfjs';
|
|
431
|
+
|
|
432
|
+
type StateBannerTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
433
|
+
interface StateBannerProps {
|
|
434
|
+
title: string;
|
|
435
|
+
detail?: string;
|
|
436
|
+
icon?: SafeHtml;
|
|
437
|
+
action?: SafeHtml;
|
|
438
|
+
tone?: StateBannerTone;
|
|
439
|
+
urgency?: 'status' | 'alert';
|
|
440
|
+
className?: string;
|
|
441
|
+
}
|
|
442
|
+
declare function StateBanner({ title, detail, icon, action, tone, urgency, className }: StateBannerProps): SafeHtml;
|
|
443
|
+
|
|
444
|
+
export { StateBanner, type StateBannerProps, type StateBannerTone };
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
## `@kerfjs/ui/empty-state`
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
import { SafeHtml } from 'kerfjs';
|
|
451
|
+
|
|
452
|
+
interface EmptyStateProps {
|
|
453
|
+
title: string;
|
|
454
|
+
detail?: string;
|
|
455
|
+
icon?: SafeHtml;
|
|
456
|
+
action?: SafeHtml;
|
|
457
|
+
busy?: boolean;
|
|
458
|
+
className?: string;
|
|
459
|
+
}
|
|
460
|
+
declare function EmptyState({ title, detail, icon, action, busy, className }: EmptyStateProps): SafeHtml;
|
|
461
|
+
|
|
462
|
+
export { EmptyState, type EmptyStateProps };
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## `@kerfjs/ui/loading-spinner`
|
|
466
|
+
|
|
467
|
+
```ts
|
|
468
|
+
import * as kerfjs from 'kerfjs';
|
|
469
|
+
|
|
470
|
+
interface LoadingSpinnerProps {
|
|
471
|
+
className?: string;
|
|
472
|
+
label?: string;
|
|
473
|
+
}
|
|
474
|
+
/** Stable viewBox-centered progress ring based on svg-spinners' MIT-licensed 180-ring. */
|
|
475
|
+
declare function LoadingSpinner({ className, label }: LoadingSpinnerProps): kerfjs.SafeHtml;
|
|
476
|
+
|
|
477
|
+
export { LoadingSpinner, type LoadingSpinnerProps };
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
## `@kerfjs/ui/token-search-field`
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
import { SafeHtml } from 'kerfjs';
|
|
484
|
+
|
|
485
|
+
interface TokenSearchToken {
|
|
486
|
+
value: string;
|
|
487
|
+
label: string;
|
|
488
|
+
offset?: number;
|
|
489
|
+
accessibleLabel?: string;
|
|
490
|
+
}
|
|
491
|
+
interface TokenSearchFieldProps {
|
|
492
|
+
id: string;
|
|
493
|
+
label: string;
|
|
494
|
+
query?: string;
|
|
495
|
+
tokens?: readonly TokenSearchToken[];
|
|
496
|
+
placeholder?: string;
|
|
497
|
+
tokenPlaceholder?: string;
|
|
498
|
+
disabled?: boolean;
|
|
499
|
+
autofocus?: boolean;
|
|
500
|
+
/** Allow an empty field to render as one iconic action. */
|
|
501
|
+
collapsible?: boolean;
|
|
502
|
+
/** Keep an empty collapsible field open while the application owns focus. */
|
|
503
|
+
expanded?: boolean;
|
|
504
|
+
expandAction?: string;
|
|
505
|
+
expandLabel?: string;
|
|
506
|
+
leading?: SafeHtml;
|
|
507
|
+
trailing?: SafeHtml;
|
|
508
|
+
editAction?: string;
|
|
509
|
+
removeAction?: string;
|
|
510
|
+
clearAction?: string;
|
|
511
|
+
clearLabel?: string;
|
|
512
|
+
className?: string;
|
|
513
|
+
editorAttributes?: Readonly<Record<`data-${string}`, string>>;
|
|
514
|
+
}
|
|
515
|
+
interface TokenSearchFieldValue {
|
|
516
|
+
query: string;
|
|
517
|
+
tokens: TokenSearchToken[];
|
|
518
|
+
}
|
|
519
|
+
declare function TokenSearchField({ id, label, query, tokens, placeholder, tokenPlaceholder, disabled, autofocus, collapsible, expanded, expandAction, expandLabel, leading, trailing, editAction, removeAction, clearAction, clearLabel, className, editorAttributes, }: TokenSearchFieldProps): SafeHtml;
|
|
520
|
+
/** Read editable text and ordered token offsets from a rendered TokenSearchField editor. */
|
|
521
|
+
declare function readTokenSearchField(editor: HTMLElement, knownTokens?: readonly TokenSearchToken[]): TokenSearchFieldValue;
|
|
522
|
+
/** Focus an editor and place its caret at a text offset, skipping atomic token chips. */
|
|
523
|
+
declare function placeTokenSearchCaret(editor: HTMLElement, offset?: number): void;
|
|
524
|
+
|
|
525
|
+
export { TokenSearchField, type TokenSearchFieldProps, type TokenSearchFieldValue, type TokenSearchToken, placeTokenSearchCaret, readTokenSearchField };
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
## `@kerfjs/ui/wire-token-search-fields`
|
|
529
|
+
|
|
530
|
+
```ts
|
|
531
|
+
interface TokenSearchSubmit {
|
|
532
|
+
id: string;
|
|
533
|
+
editor: HTMLElement;
|
|
534
|
+
}
|
|
535
|
+
interface WireTokenSearchFieldsOptions {
|
|
536
|
+
onSubmit: (submission: TokenSearchSubmit) => void;
|
|
537
|
+
}
|
|
538
|
+
/** Keep TokenSearchField wrapping, submit Enter, and preserve its caret across controlled token deletion. */
|
|
539
|
+
declare function wireTokenSearchFields(root: HTMLElement, { onSubmit }: WireTokenSearchFieldsOptions): () => void;
|
|
540
|
+
|
|
541
|
+
export { type TokenSearchSubmit, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
## `kerfjs/actions`
|
|
545
|
+
|
|
546
|
+
```ts
|
|
547
|
+
import { A as AttrSpec } from './attrSelector-Cmu2ZoGO.js';
|
|
548
|
+
import { D as DelegateOptions } from './delegate-CL9VTZFb.js';
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* `kerfjs/actions` — the delegated action-table helper.
|
|
552
|
+
*
|
|
553
|
+
* The most-reinvented idiom across real kerf apps: one table of `data-action`
|
|
554
|
+
* attribute specs used as the single source of truth for BOTH the JSX attribute
|
|
555
|
+
* and the delegate selector, plus a hand-rolled `switch (dataset.action)`
|
|
556
|
+
* dispatcher. This subpath blesses it as two thin helpers over the existing
|
|
557
|
+
* `attr()` + `delegate()` — it does NOT replace them.
|
|
558
|
+
*
|
|
559
|
+
* import { action, delegateActions } from 'kerfjs/actions';
|
|
560
|
+
*
|
|
561
|
+
* const A = {
|
|
562
|
+
* select: action('select-file'),
|
|
563
|
+
* remove: action('remove-file'),
|
|
564
|
+
* };
|
|
565
|
+
*
|
|
566
|
+
* // JSX — spread the attr (rename-safe; no hardcoded attribute name):
|
|
567
|
+
* // <button {...A.select.attrs} data-id={id}>…</button>
|
|
568
|
+
*
|
|
569
|
+
* // Wire the whole table with ONE delegated listener; returns a disposer:
|
|
570
|
+
* const dispose = delegateActions(root, 'click', {
|
|
571
|
+
* [A.select.value]: (_e, el) => selectFile(el.getAttribute('data-id')),
|
|
572
|
+
* [A.remove.value]: (_e, el) => removeFile(el.getAttribute('data-id')),
|
|
573
|
+
* });
|
|
574
|
+
*
|
|
575
|
+
* Contract: `delegateActions` returns a `() => void` disposer and holds no
|
|
576
|
+
* per-instance state — the same shape as `delegate()`, which it builds on (so
|
|
577
|
+
* it inherits the single-listener dispatch and the capture auto-promotion for
|
|
578
|
+
* well-known non-bubbling event types). One event type per call, mirroring
|
|
579
|
+
* `delegate()`; collect the disposers for a root that needs several.
|
|
580
|
+
*/
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* A handler in a {@link delegateActions} table. Receives the DOM event and the
|
|
584
|
+
* matched element (walk-up `closest()` match by default) — the same shape as a
|
|
585
|
+
* `delegate()` handler.
|
|
586
|
+
*/
|
|
587
|
+
type ActionHandler<E extends Element = Element> = (event: Event, el: E) => void;
|
|
588
|
+
/**
|
|
589
|
+
* `action(value)` — an {@link AttrSpec} on `data-action`. A thin specialization
|
|
590
|
+
* of `attr('data-action', value)`: spread its `.attrs` in JSX and use its
|
|
591
|
+
* `.value` as the handler-table key, so the action name lives in exactly one
|
|
592
|
+
* place and can't drift between the markup and the dispatcher.
|
|
593
|
+
*/
|
|
594
|
+
declare function action<V extends string>(value: V): AttrSpec<'data-action', V>;
|
|
595
|
+
/** Options for {@link delegateActions}. Extends {@link DelegateOptions}. */
|
|
596
|
+
interface DelegateActionsOptions extends DelegateOptions {
|
|
597
|
+
/**
|
|
598
|
+
* The attribute the table keys on. Default `'data-action'`. Override it only
|
|
599
|
+
* if you also author the specs with `attr(yourName, …)` instead of `action()`.
|
|
600
|
+
*/
|
|
601
|
+
attr?: string;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Wire a whole table of action handlers with ONE delegated listener.
|
|
605
|
+
*
|
|
606
|
+
* On `eventType`, the nearest element carrying the action attribute (walk-up
|
|
607
|
+
* `closest()` by default; pass `{ match: 'direct' }` for an exact-element match)
|
|
608
|
+
* is looked up in `table` by its attribute value, and the matching handler
|
|
609
|
+
* runs. An element whose action is absent from the table is ignored — the same
|
|
610
|
+
* behavior as a `switch (dataset.action)` with no matching `case`.
|
|
611
|
+
*
|
|
612
|
+
* Returns a `() => void` disposer. One event type per call (the smallest
|
|
613
|
+
* surface, mirroring `delegate()`); collect the disposers when a root needs
|
|
614
|
+
* several event types.
|
|
615
|
+
*/
|
|
616
|
+
declare function delegateActions<E extends Element = Element>(root: HTMLElement, eventType: string, table: Readonly<Record<string, ActionHandler<E>>>, options?: DelegateActionsOptions): () => void;
|
|
617
|
+
|
|
618
|
+
export { type ActionHandler, type DelegateActionsOptions, action, delegateActions };
|
|
619
|
+
```
|