@kerfjs/ui 5.0.0-beta.16 → 5.0.0-beta.18
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 +111 -81
- package/ai/component-catalog-extension.schema.json +79 -0
- package/ai/component-catalog.json +499 -0
- package/ai/component-catalog.schema.json +15 -0
- package/ai/public-api-signatures-v1.md +86 -32
- package/ai/skill.md +60 -51
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/app-tab.d.ts +1 -1
- package/dist/app-tab.js +1 -1
- package/dist/catalog.d.ts +12 -3
- package/dist/catalog.js +283 -90
- package/dist/catalog.js.map +1 -1
- package/dist/chunk-43FUQH35.js +83 -0
- package/dist/chunk-43FUQH35.js.map +1 -0
- package/dist/{chunk-YGN7OMLT.js → chunk-4TRDV6RL.js} +2 -2
- package/dist/chunk-4TRDV6RL.js.map +1 -0
- package/dist/chunk-6ETZKKAE.js +38 -0
- package/dist/chunk-6ETZKKAE.js.map +1 -0
- package/dist/chunk-6WTETUZ6.js +21 -0
- package/dist/chunk-6WTETUZ6.js.map +1 -0
- package/dist/chunk-7L6EHUMV.js +31 -0
- package/dist/chunk-7L6EHUMV.js.map +1 -0
- package/dist/chunk-BBRXX6PF.js +108 -0
- package/dist/chunk-BBRXX6PF.js.map +1 -0
- package/dist/chunk-DPDBVKNA.js +113 -0
- package/dist/chunk-DPDBVKNA.js.map +1 -0
- package/dist/chunk-ELSJX4W7.js +68 -0
- package/dist/chunk-ELSJX4W7.js.map +1 -0
- package/dist/{chunk-LCOBDOCC.js → chunk-ENVTNLYC.js} +153 -67
- package/dist/chunk-ENVTNLYC.js.map +1 -0
- package/dist/{chunk-AHQI52QO.js → chunk-FEY65TBV.js} +6 -2
- package/dist/chunk-FEY65TBV.js.map +1 -0
- package/dist/chunk-JTHUXDN2.js +58 -0
- package/dist/chunk-JTHUXDN2.js.map +1 -0
- package/dist/chunk-LPOMRC4C.js +25 -0
- package/dist/chunk-LPOMRC4C.js.map +1 -0
- package/dist/chunk-NENBUYX5.js +79 -0
- package/dist/chunk-NENBUYX5.js.map +1 -0
- package/dist/{chunk-XXMOARTH.js → chunk-NVWXKU37.js} +57 -16
- package/dist/chunk-NVWXKU37.js.map +1 -0
- package/dist/chunk-PIDTEQ3U.js +105 -0
- package/dist/chunk-PIDTEQ3U.js.map +1 -0
- package/dist/chunk-PX3YSS5C.js +32 -0
- package/dist/chunk-PX3YSS5C.js.map +1 -0
- package/dist/chunk-PZQVSDLH.js +61 -0
- package/dist/chunk-PZQVSDLH.js.map +1 -0
- package/dist/chunk-QIRXYKCE.js +113 -0
- package/dist/chunk-QIRXYKCE.js.map +1 -0
- package/dist/chunk-QO55FN2Y.js +20 -0
- package/dist/chunk-QO55FN2Y.js.map +1 -0
- package/dist/chunk-QQFJMRIB.js +45 -0
- package/dist/chunk-QQFJMRIB.js.map +1 -0
- package/dist/chunk-S3HKPI7I.js +218 -0
- package/dist/chunk-S3HKPI7I.js.map +1 -0
- package/dist/chunk-S3PCZ7NV.js +38 -0
- package/dist/chunk-S3PCZ7NV.js.map +1 -0
- package/dist/{chunk-7BR3DO2A.js → chunk-SRSJO5QE.js} +13 -4
- package/dist/chunk-SRSJO5QE.js.map +1 -0
- package/dist/chunk-U5IFGQCD.js +117 -0
- package/dist/chunk-U5IFGQCD.js.map +1 -0
- package/dist/{chunk-56RJXPHG.js → chunk-Y6LYKFXY.js} +1 -1
- package/dist/{chunk-56RJXPHG.js.map → chunk-Y6LYKFXY.js.map} +1 -1
- package/dist/chunk-ZK2G3VR5.js +35 -0
- package/dist/chunk-ZK2G3VR5.js.map +1 -0
- package/dist/chunk-ZVI5YST2.js +41 -0
- package/dist/chunk-ZVI5YST2.js.map +1 -0
- package/dist/collapsible-panel.d.ts +2 -2
- package/dist/collapsible-panel.js +47 -6
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/device-class.js +33 -5
- package/dist/device-class.js.map +1 -1
- package/dist/disclosure-arrow.js +1 -1
- package/dist/empty-state.d.ts +1 -1
- package/dist/empty-state.js +1 -1
- package/dist/floating-toolbar.d.ts +1 -1
- package/dist/floating-toolbar.js +1 -1
- package/dist/index.js +25 -25
- package/dist/list-action-row.d.ts +1 -1
- package/dist/list-action-row.js +1 -1
- package/dist/list-header.d.ts +1 -1
- package/dist/list-header.js +1 -1
- package/dist/list-inset-control.d.ts +1 -1
- package/dist/list-inset-control.js +1 -1
- package/dist/list-inset-text.d.ts +1 -1
- package/dist/list-inset-text.js +1 -1
- package/dist/list-item.d.ts +1 -1
- package/dist/list-item.js +1 -1
- package/dist/loading-spinner.js +1 -1
- package/dist/nav-stack.d.ts +1 -1
- package/dist/nav-stack.js +1 -1
- package/dist/panel-header.d.ts +1 -1
- package/dist/panel-header.js +1 -1
- package/dist/resizable-region.d.ts +1 -1
- package/dist/resizable-region.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/split-view.d.ts +1 -1
- package/dist/split-view.js +70 -10
- package/dist/split-view.js.map +1 -1
- package/dist/state-banner.d.ts +1 -1
- package/dist/state-banner.js +1 -1
- package/dist/styles/catalog.css +48 -1
- package/dist/styles/toolbar-text.css +54 -2
- package/dist/styles/webawesome.css +131 -0
- package/dist/tab-bar.d.ts +1 -1
- package/dist/tab-bar.js +1 -1
- package/dist/tab-scaffold.d.ts +1 -1
- package/dist/tab-scaffold.js +43 -8
- package/dist/tab-scaffold.js.map +1 -1
- package/dist/token-search-field.js +1 -1
- package/dist/toolbar-control-group.d.ts +1 -1
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar-text.d.ts +17 -1
- package/dist/toolbar-text.js +1 -1
- package/dist/toolbar.d.ts +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/value-table.d.ts +2 -2
- package/dist/value-table.js +1 -1
- package/dist/wire-catalog.d.ts +31 -2
- package/dist/wire-catalog.js +203 -8
- package/dist/wire-catalog.js.map +1 -1
- package/dist/wire-nav-stack.js +22 -7
- package/dist/wire-nav-stack.js.map +1 -1
- package/dist/wire-resizable-regions.d.ts +1 -1
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-sidebar.js +52 -41
- package/dist/wire-sidebar.js.map +1 -1
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tab-scaffold.js +9 -4
- package/dist/wire-tab-scaffold.js.map +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 +1 -1
- package/dist/workbench.js +56 -9
- package/dist/workbench.js.map +1 -1
- package/docs/app-layouts.md +7 -7
- package/docs/catalog.md +110 -25
- package/docs/collapsible-panel.md +38 -11
- package/docs/component-contract.md +30 -2
- package/docs/component-selection.md +76 -65
- package/docs/design/templates.md +1 -1
- package/docs/design-philosophy.md +5 -5
- package/docs/device-class.md +8 -8
- package/docs/examples/command-palette-adapter.tsx +67 -17
- package/docs/examples/component-catalog-extension.json +45 -0
- package/docs/layout.md +19 -19
- package/docs/nav-stack.md +15 -6
- package/docs/recipes.md +4 -4
- package/docs/split-view.md +3 -3
- package/docs/tab-scaffold.md +16 -7
- package/docs/ux-demo.md +2 -2
- package/docs/webawesome-theme.md +73 -8
- package/docs/workbench.md +18 -5
- package/llms.txt +36 -15
- package/package.json +6 -4
- package/ux-demo/recipes/app-shell.tsx +206 -10
- package/ux-demo/recipes/collapsible-sidebar.tsx +167 -44
- package/ux-demo/recipes/compact-toolbar.tsx +114 -12
- package/ux-demo/recipes/composer-form.tsx +106 -18
- package/ux-demo/recipes/list-detail-dialog.tsx +144 -8
- package/ux-demo/recipes/list-workspace-states.tsx +165 -8
- package/ux-demo/recipes/loaders.ts +5 -2
- package/ux-demo/recipes/loading-inspector.tsx +124 -41
- package/ux-demo/recipes/mount-recipe.ts +27 -6
- package/ux-demo/recipes/navigation-sidebar.tsx +120 -9
- package/ux-demo/recipes/navigation-stack.tsx +61 -19
- package/ux-demo/recipes/types.ts +3 -1
- package/ux-demo/recipes/workspace-header.tsx +57 -2
- package/dist/chunk-2Z5TWHKQ.js +0 -34
- package/dist/chunk-2Z5TWHKQ.js.map +0 -1
- package/dist/chunk-37T3VNIZ.js +0 -19
- package/dist/chunk-37T3VNIZ.js.map +0 -1
- package/dist/chunk-55DATV3A.js +0 -10
- package/dist/chunk-55DATV3A.js.map +0 -1
- package/dist/chunk-5ATCDSQS.js +0 -42
- package/dist/chunk-5ATCDSQS.js.map +0 -1
- package/dist/chunk-5E2HVJ33.js +0 -10
- package/dist/chunk-5E2HVJ33.js.map +0 -1
- package/dist/chunk-7BR3DO2A.js.map +0 -1
- package/dist/chunk-7JB7VPRI.js +0 -34
- package/dist/chunk-7JB7VPRI.js.map +0 -1
- package/dist/chunk-7LDCTU7D.js +0 -134
- package/dist/chunk-7LDCTU7D.js.map +0 -1
- package/dist/chunk-AHQI52QO.js.map +0 -1
- package/dist/chunk-AQNKJRFH.js +0 -79
- package/dist/chunk-AQNKJRFH.js.map +0 -1
- package/dist/chunk-AVZHJN6C.js +0 -14
- package/dist/chunk-AVZHJN6C.js.map +0 -1
- package/dist/chunk-B24C4A6T.js +0 -22
- package/dist/chunk-B24C4A6T.js.map +0 -1
- package/dist/chunk-BLK3UEEI.js +0 -23
- package/dist/chunk-BLK3UEEI.js.map +0 -1
- package/dist/chunk-CH4SQ6H5.js +0 -39
- package/dist/chunk-CH4SQ6H5.js.map +0 -1
- package/dist/chunk-DAFFDO33.js +0 -14
- package/dist/chunk-DAFFDO33.js.map +0 -1
- package/dist/chunk-I7INRJO4.js +0 -17
- package/dist/chunk-I7INRJO4.js.map +0 -1
- package/dist/chunk-L4OKFDJY.js +0 -24
- package/dist/chunk-L4OKFDJY.js.map +0 -1
- package/dist/chunk-LCOBDOCC.js.map +0 -1
- package/dist/chunk-M5JRI6MN.js +0 -27
- package/dist/chunk-M5JRI6MN.js.map +0 -1
- package/dist/chunk-RNPGFQ33.js +0 -10
- package/dist/chunk-RNPGFQ33.js.map +0 -1
- package/dist/chunk-RUNWEPR4.js +0 -10
- package/dist/chunk-RUNWEPR4.js.map +0 -1
- package/dist/chunk-VPCTCUED.js +0 -10
- package/dist/chunk-VPCTCUED.js.map +0 -1
- package/dist/chunk-WVPYVDXY.js +0 -15
- package/dist/chunk-WVPYVDXY.js.map +0 -1
- package/dist/chunk-XE5ZLPCC.js +0 -20
- package/dist/chunk-XE5ZLPCC.js.map +0 -1
- package/dist/chunk-XXMOARTH.js.map +0 -1
- package/dist/chunk-YGN7OMLT.js.map +0 -1
|
@@ -15,8 +15,13 @@ import type { RecipeFactory } from './types.js';
|
|
|
15
15
|
|
|
16
16
|
type ValueField = HTMLElement & { value: string };
|
|
17
17
|
|
|
18
|
-
const syncControlledFieldValues = (
|
|
19
|
-
|
|
18
|
+
const syncControlledFieldValues = (
|
|
19
|
+
action: HTMLElement,
|
|
20
|
+
values: Record<string, string>,
|
|
21
|
+
) => {
|
|
22
|
+
const form = action.closest<HTMLElement>(
|
|
23
|
+
'[data-recipe="recipe-composer-form"]',
|
|
24
|
+
);
|
|
20
25
|
if (!form) return;
|
|
21
26
|
for (const [name, value] of Object.entries(values)) {
|
|
22
27
|
const field = form.querySelector<ValueField>(`[name="${name}"]`);
|
|
@@ -26,20 +31,93 @@ const syncControlledFieldValues = (action: HTMLElement, values: Record<string, s
|
|
|
26
31
|
|
|
27
32
|
export const createRecipe: RecipeFactory = (announce) => {
|
|
28
33
|
const title = signal('');
|
|
29
|
-
const body = signal(
|
|
34
|
+
const body = signal(
|
|
35
|
+
'The tablet layout now keeps navigation, content, and inspector focus order aligned.',
|
|
36
|
+
);
|
|
30
37
|
const audience = signal('team');
|
|
31
38
|
const status = signal<'idle' | 'error' | 'saved'>('idle');
|
|
32
|
-
const render = () =>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const render = () => (
|
|
40
|
+
<form
|
|
41
|
+
class="kui-recipe recipe-form kui-recipe__surface kui-content"
|
|
42
|
+
data-recipe="recipe-composer-form"
|
|
43
|
+
aria-labelledby="recipe-composer-title"
|
|
44
|
+
aria-describedby="recipe-composer-summary"
|
|
45
|
+
noValidate
|
|
46
|
+
>
|
|
47
|
+
<PanelHeader
|
|
48
|
+
title="Publish workspace update"
|
|
49
|
+
titleId="recipe-composer-title"
|
|
50
|
+
summary="Share a concise, actionable update with collaborators."
|
|
51
|
+
summaryId="recipe-composer-summary"
|
|
52
|
+
/>
|
|
53
|
+
{status.value === 'error' && (
|
|
54
|
+
<StateBanner
|
|
55
|
+
title="Add a title before publishing"
|
|
56
|
+
detail="The update body and audience are preserved."
|
|
57
|
+
tone="danger"
|
|
58
|
+
urgency="alert"
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
{status.value === 'saved' && (
|
|
62
|
+
<StateBanner
|
|
63
|
+
title="Update published"
|
|
64
|
+
detail="The team audience can now read it."
|
|
65
|
+
tone="success"
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
<div class="recipe-form__section recipe-form__fields">
|
|
69
|
+
<wa-input
|
|
70
|
+
name="recipe-title"
|
|
71
|
+
label="Update title"
|
|
72
|
+
hint="Summarize the outcome in one line."
|
|
73
|
+
required
|
|
74
|
+
value={title.value}
|
|
75
|
+
></wa-input>
|
|
76
|
+
<wa-textarea
|
|
77
|
+
name="recipe-body"
|
|
78
|
+
label="Details"
|
|
79
|
+
hint="Include decisions, owners, and the next checkpoint."
|
|
80
|
+
rows="5"
|
|
81
|
+
maxlength="400"
|
|
82
|
+
with-count
|
|
83
|
+
value={body.value}
|
|
84
|
+
></wa-textarea>
|
|
85
|
+
<Select
|
|
86
|
+
name="recipe-audience"
|
|
87
|
+
value={audience.value}
|
|
88
|
+
label="Audience"
|
|
89
|
+
choices={[
|
|
90
|
+
{ value: 'team', label: 'Workspace team' },
|
|
91
|
+
{ value: 'reviewers', label: 'Reviewers' },
|
|
92
|
+
{ value: 'organization', label: 'Entire organization' },
|
|
93
|
+
]}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
<footer class="recipe-form__section recipe-form__footer">
|
|
97
|
+
<div class="recipe-form__actions kui-control-cluster">
|
|
98
|
+
<wa-button
|
|
99
|
+
appearance="outlined"
|
|
100
|
+
data-action="recipe-action"
|
|
101
|
+
data-recipe-command="reset"
|
|
102
|
+
>
|
|
103
|
+
Reset
|
|
104
|
+
</wa-button>
|
|
105
|
+
<wa-button
|
|
106
|
+
variant="brand"
|
|
107
|
+
appearance="accent"
|
|
108
|
+
data-action="recipe-action"
|
|
109
|
+
data-recipe-command="submit"
|
|
110
|
+
>
|
|
111
|
+
Publish update
|
|
112
|
+
</wa-button>
|
|
113
|
+
</div>
|
|
114
|
+
<p class="kui-recipe__ownership">
|
|
115
|
+
The recipe owns field, message, and action rhythm. The app owns
|
|
116
|
+
validation rules, draft persistence, permissions, and transport.
|
|
117
|
+
</p>
|
|
118
|
+
</footer>
|
|
119
|
+
</form>
|
|
120
|
+
);
|
|
43
121
|
return {
|
|
44
122
|
render,
|
|
45
123
|
action(command, element) {
|
|
@@ -47,17 +125,27 @@ export const createRecipe: RecipeFactory = (announce) => {
|
|
|
47
125
|
title.value = '';
|
|
48
126
|
body.value = '';
|
|
49
127
|
status.value = 'idle';
|
|
50
|
-
syncControlledFieldValues(element, {
|
|
128
|
+
syncControlledFieldValues(element, {
|
|
129
|
+
'recipe-title': title.value,
|
|
130
|
+
'recipe-body': body.value,
|
|
131
|
+
});
|
|
51
132
|
announce('Draft reset');
|
|
52
133
|
return;
|
|
53
134
|
}
|
|
54
|
-
if (command === 'submit') {
|
|
135
|
+
if (command === 'submit') {
|
|
136
|
+
status.value = title.value.trim() ? 'saved' : 'error';
|
|
137
|
+
announce(
|
|
138
|
+
status.value === 'saved' ? 'Update published' : 'Title required',
|
|
139
|
+
);
|
|
140
|
+
}
|
|
55
141
|
},
|
|
56
142
|
change(element) {
|
|
57
|
-
const value =
|
|
143
|
+
const value =
|
|
144
|
+
(element as HTMLElement & { value?: string | null }).value ?? '';
|
|
58
145
|
if (element.getAttribute('name') === 'recipe-title') title.value = value;
|
|
59
146
|
if (element.getAttribute('name') === 'recipe-body') body.value = value;
|
|
60
|
-
if (element.getAttribute('name') === 'recipe-audience')
|
|
147
|
+
if (element.getAttribute('name') === 'recipe-audience')
|
|
148
|
+
audience.value = value;
|
|
61
149
|
},
|
|
62
150
|
};
|
|
63
151
|
};
|
|
@@ -15,9 +15,24 @@ import { FileText } from 'lucide';
|
|
|
15
15
|
import type { RecipeFactory } from './types.js';
|
|
16
16
|
|
|
17
17
|
const records = {
|
|
18
|
-
alpha: {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
alpha: {
|
|
19
|
+
name: 'Northstar migration',
|
|
20
|
+
owner: 'Mara Chen',
|
|
21
|
+
state: 'In review',
|
|
22
|
+
updated: 'Today, 09:42',
|
|
23
|
+
},
|
|
24
|
+
beta: {
|
|
25
|
+
name: 'Tablet navigation',
|
|
26
|
+
owner: 'Sam Rivera',
|
|
27
|
+
state: 'Ready',
|
|
28
|
+
updated: 'Yesterday, 16:20',
|
|
29
|
+
},
|
|
30
|
+
gamma: {
|
|
31
|
+
name: 'Contrast audit',
|
|
32
|
+
owner: 'Inez Okafor',
|
|
33
|
+
state: 'Blocked',
|
|
34
|
+
updated: 'Monday, 11:05',
|
|
35
|
+
},
|
|
21
36
|
} as const;
|
|
22
37
|
|
|
23
38
|
interface RecipeDialogElement extends HTMLElement {
|
|
@@ -27,15 +42,136 @@ interface RecipeDialogElement extends HTMLElement {
|
|
|
27
42
|
export const createRecipe: RecipeFactory = (announce) => {
|
|
28
43
|
const selected = signal<keyof typeof records>('alpha');
|
|
29
44
|
const open = { value: false };
|
|
30
|
-
const render = () =>
|
|
45
|
+
const render = () => (
|
|
46
|
+
<section
|
|
47
|
+
class="kui-recipe kui-content"
|
|
48
|
+
data-recipe="recipe-list-detail-dialog"
|
|
49
|
+
>
|
|
50
|
+
<button
|
|
51
|
+
class="kui-recipe__button kui-content-item"
|
|
52
|
+
data-primary="true"
|
|
53
|
+
type="button"
|
|
54
|
+
data-action="recipe-action"
|
|
55
|
+
data-recipe-command="open"
|
|
56
|
+
>
|
|
57
|
+
Open project details
|
|
58
|
+
</button>
|
|
59
|
+
<p class="kui-recipe__ownership kui-content-item">
|
|
60
|
+
Web Awesome owns modal focus and dismissal. The recipe owns
|
|
61
|
+
header/body/list-detail anatomy; the app owns open state, selection, and
|
|
62
|
+
policy.
|
|
63
|
+
</p>
|
|
64
|
+
<wa-dialog
|
|
65
|
+
class="recipe-dialog"
|
|
66
|
+
label="Project details"
|
|
67
|
+
without-header
|
|
68
|
+
open={open.value}
|
|
69
|
+
>
|
|
70
|
+
<div class="recipe-dialog__pane kui-pane">
|
|
71
|
+
<div class="recipe-list-detail kui-pane__content">
|
|
72
|
+
<nav
|
|
73
|
+
class="recipe-list-detail__list kui-pane"
|
|
74
|
+
aria-label="Projects"
|
|
75
|
+
>
|
|
76
|
+
<ListHeader label="Recent projects" />
|
|
77
|
+
<div class="kui-pane__content kui-content">
|
|
78
|
+
<section>
|
|
79
|
+
{Object.entries(records).map(([id, record]) => (
|
|
80
|
+
<ListItem
|
|
81
|
+
action="recipe-action"
|
|
82
|
+
itemId={id}
|
|
83
|
+
label={record.name}
|
|
84
|
+
selected={selected.value === id}
|
|
85
|
+
multiline
|
|
86
|
+
/>
|
|
87
|
+
))}
|
|
88
|
+
</section>
|
|
89
|
+
</div>
|
|
90
|
+
</nav>
|
|
91
|
+
<section class="recipe-list-detail__detail kui-pane">
|
|
92
|
+
<PanelHeader
|
|
93
|
+
title="Project details"
|
|
94
|
+
titleId="recipe-dialog-title"
|
|
95
|
+
summary="Compare delivery state without leaving the workspace."
|
|
96
|
+
summaryId="recipe-dialog-summary"
|
|
97
|
+
icon={<LucideIcon icon={FileText} name="file-text" />}
|
|
98
|
+
actions={
|
|
99
|
+
<wa-button
|
|
100
|
+
appearance="plain"
|
|
101
|
+
data-action="recipe-action"
|
|
102
|
+
data-recipe-command="close"
|
|
103
|
+
>
|
|
104
|
+
Close
|
|
105
|
+
</wa-button>
|
|
106
|
+
}
|
|
107
|
+
/>
|
|
108
|
+
<div
|
|
109
|
+
class="recipe-list-detail__body kui-pane__content kui-content"
|
|
110
|
+
aria-live="polite"
|
|
111
|
+
>
|
|
112
|
+
<h3 class="recipe-list-detail__title kui-recipe__pane-title kui-content-item">
|
|
113
|
+
{records[selected.value].name}
|
|
114
|
+
</h3>
|
|
115
|
+
<ValueTable label="Project details">
|
|
116
|
+
<ValueTableRow
|
|
117
|
+
label="Owner"
|
|
118
|
+
value={records[selected.value].owner}
|
|
119
|
+
/>
|
|
120
|
+
<ValueTableRow
|
|
121
|
+
label="Status"
|
|
122
|
+
value={records[selected.value].state}
|
|
123
|
+
/>
|
|
124
|
+
<ValueTableRow
|
|
125
|
+
label="Updated"
|
|
126
|
+
value={records[selected.value].updated}
|
|
127
|
+
/>
|
|
128
|
+
</ValueTable>
|
|
129
|
+
<div class="recipe-list-detail__actions kui-control-cluster">
|
|
130
|
+
<wa-button
|
|
131
|
+
appearance="outlined"
|
|
132
|
+
data-action="recipe-action"
|
|
133
|
+
data-recipe-command="archive"
|
|
134
|
+
>
|
|
135
|
+
Archive
|
|
136
|
+
</wa-button>
|
|
137
|
+
<wa-button
|
|
138
|
+
variant="brand"
|
|
139
|
+
appearance="accent"
|
|
140
|
+
data-action="recipe-action"
|
|
141
|
+
data-recipe-command="open-record"
|
|
142
|
+
>
|
|
143
|
+
Open project
|
|
144
|
+
</wa-button>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</section>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</wa-dialog>
|
|
151
|
+
</section>
|
|
152
|
+
);
|
|
31
153
|
return {
|
|
32
154
|
render,
|
|
33
155
|
action(command, element) {
|
|
34
156
|
const id = element.dataset.itemId;
|
|
35
|
-
if (id && id in records) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
157
|
+
if (id && id in records) {
|
|
158
|
+
selected.value = id as keyof typeof records;
|
|
159
|
+
announce(`Selected ${records[selected.value].name}`);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const dialog = element
|
|
163
|
+
.closest('[data-recipe]')
|
|
164
|
+
?.querySelector<RecipeDialogElement>('wa-dialog');
|
|
165
|
+
if (command === 'open' && dialog) {
|
|
166
|
+
element.focus();
|
|
167
|
+
open.value = true;
|
|
168
|
+
dialog.open = true;
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (command === 'close' && dialog) {
|
|
172
|
+
dialog.open = false;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
39
175
|
announce(`${command} requested`);
|
|
40
176
|
},
|
|
41
177
|
afterHide() {
|
|
@@ -10,17 +10,174 @@ import { signal } from 'kerfjs';
|
|
|
10
10
|
import type { RecipeFactory } from './types.js';
|
|
11
11
|
|
|
12
12
|
type ListState = 'loading' | 'empty' | 'populated' | 'stale' | 'error';
|
|
13
|
-
const items = [
|
|
13
|
+
const items = [
|
|
14
|
+
'Audit keyboard focus order',
|
|
15
|
+
'Verify 200% zoom layout',
|
|
16
|
+
'Publish package migration notes',
|
|
17
|
+
];
|
|
14
18
|
|
|
15
19
|
export const createRecipe: RecipeFactory = (announce) => {
|
|
16
20
|
const state = signal<ListState>('loading');
|
|
17
|
-
const populated = () =>
|
|
21
|
+
const populated = () => (
|
|
22
|
+
<ul class="recipe-list__items" aria-label="Release tasks">
|
|
23
|
+
{items.map((item, index) => (
|
|
24
|
+
<li>
|
|
25
|
+
<strong>{item}</strong>
|
|
26
|
+
<span class="kui-recipe__muted">
|
|
27
|
+
{index === 0
|
|
28
|
+
? 'In review · Mara'
|
|
29
|
+
: index === 1
|
|
30
|
+
? 'Ready · Sam'
|
|
31
|
+
: 'Draft · Inez'}
|
|
32
|
+
</span>
|
|
33
|
+
</li>
|
|
34
|
+
))}
|
|
35
|
+
</ul>
|
|
36
|
+
);
|
|
18
37
|
const renderBody = () => {
|
|
19
|
-
if (state.value === 'loading')
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
if (state.value === 'loading')
|
|
39
|
+
return (
|
|
40
|
+
<EmptyState
|
|
41
|
+
title="Loading release tasks"
|
|
42
|
+
detail="The current workspace will appear when data is ready."
|
|
43
|
+
busy
|
|
44
|
+
action={
|
|
45
|
+
<button
|
|
46
|
+
class="kui-recipe__button"
|
|
47
|
+
type="button"
|
|
48
|
+
data-action="recipe-action"
|
|
49
|
+
data-recipe-command="load"
|
|
50
|
+
>
|
|
51
|
+
Complete load
|
|
52
|
+
</button>
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
if (state.value === 'empty')
|
|
57
|
+
return (
|
|
58
|
+
<EmptyState
|
|
59
|
+
title="No release tasks"
|
|
60
|
+
detail="Create the first task for this milestone."
|
|
61
|
+
action={
|
|
62
|
+
<button
|
|
63
|
+
class="kui-recipe__button"
|
|
64
|
+
data-primary="true"
|
|
65
|
+
type="button"
|
|
66
|
+
data-action="recipe-action"
|
|
67
|
+
data-recipe-command="create"
|
|
68
|
+
>
|
|
69
|
+
Create task
|
|
70
|
+
</button>
|
|
71
|
+
}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
if (state.value === 'error')
|
|
75
|
+
return (
|
|
76
|
+
<StateBanner
|
|
77
|
+
title="Release tasks could not be refreshed"
|
|
78
|
+
detail="Existing filters are preserved. Try again when the connection recovers."
|
|
79
|
+
tone="danger"
|
|
80
|
+
urgency="alert"
|
|
81
|
+
action={
|
|
82
|
+
<button
|
|
83
|
+
class="kui-recipe__button"
|
|
84
|
+
type="button"
|
|
85
|
+
data-action="recipe-action"
|
|
86
|
+
data-recipe-command="retry"
|
|
87
|
+
>
|
|
88
|
+
Retry
|
|
89
|
+
</button>
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
return (
|
|
94
|
+
<>
|
|
95
|
+
{state.value === 'stale' && (
|
|
96
|
+
<StateBanner
|
|
97
|
+
title="Showing saved results"
|
|
98
|
+
detail="Refreshing in the background."
|
|
99
|
+
tone="warning"
|
|
100
|
+
action={
|
|
101
|
+
<span class="kui-inline-metadata">
|
|
102
|
+
<LoadingSpinner label="Refreshing release tasks" />
|
|
103
|
+
<button
|
|
104
|
+
class="kui-recipe__button"
|
|
105
|
+
type="button"
|
|
106
|
+
data-action="recipe-action"
|
|
107
|
+
data-recipe-command="finish"
|
|
108
|
+
>
|
|
109
|
+
Finish refresh
|
|
110
|
+
</button>
|
|
111
|
+
</span>
|
|
112
|
+
}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
{populated()}
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
const render = () => (
|
|
120
|
+
<section
|
|
121
|
+
class="kui-recipe recipe-list kui-recipe__surface kui-pane"
|
|
122
|
+
data-recipe="recipe-list-workspace-states"
|
|
123
|
+
data-list-state={state.value}
|
|
124
|
+
>
|
|
125
|
+
<PanelHeader
|
|
126
|
+
title="Release tasks"
|
|
127
|
+
titleId="recipe-list-title"
|
|
128
|
+
actions={
|
|
129
|
+
<div class="kui-control-cluster">
|
|
130
|
+
<button
|
|
131
|
+
class="kui-recipe__button"
|
|
132
|
+
type="button"
|
|
133
|
+
data-action="recipe-action"
|
|
134
|
+
data-recipe-command="empty"
|
|
135
|
+
>
|
|
136
|
+
Clear
|
|
137
|
+
</button>
|
|
138
|
+
<button
|
|
139
|
+
class="kui-recipe__button"
|
|
140
|
+
type="button"
|
|
141
|
+
data-action="recipe-action"
|
|
142
|
+
data-recipe-command="fail"
|
|
143
|
+
>
|
|
144
|
+
Simulate failure
|
|
145
|
+
</button>
|
|
146
|
+
<button
|
|
147
|
+
class="kui-recipe__button"
|
|
148
|
+
data-primary="true"
|
|
149
|
+
type="button"
|
|
150
|
+
data-action="recipe-action"
|
|
151
|
+
data-recipe-command="refresh"
|
|
152
|
+
>
|
|
153
|
+
Refresh
|
|
154
|
+
</button>
|
|
155
|
+
</div>
|
|
156
|
+
}
|
|
157
|
+
/>
|
|
158
|
+
<div class="recipe-list__body kui-pane__content kui-content">
|
|
159
|
+
{renderBody()}
|
|
160
|
+
<p class="kui-recipe__ownership kui-content-item">
|
|
161
|
+
The recipe owns feedback placement and stable content. The app owns
|
|
162
|
+
fetching, cache age, retry policy, and domain rows.
|
|
163
|
+
</p>
|
|
164
|
+
</div>
|
|
165
|
+
</section>
|
|
166
|
+
);
|
|
167
|
+
return {
|
|
168
|
+
render,
|
|
169
|
+
action(command) {
|
|
170
|
+
const next: Record<string, ListState> = {
|
|
171
|
+
load: 'populated',
|
|
172
|
+
empty: 'empty',
|
|
173
|
+
create: 'populated',
|
|
174
|
+
fail: 'error',
|
|
175
|
+
retry: 'populated',
|
|
176
|
+
refresh: 'stale',
|
|
177
|
+
finish: 'populated',
|
|
178
|
+
};
|
|
179
|
+
if (command in next) state.value = next[command]!;
|
|
180
|
+
announce(`List state: ${state.value}`);
|
|
181
|
+
},
|
|
23
182
|
};
|
|
24
|
-
const render = () => <section class="kui-recipe recipe-list kui-recipe__surface kui-pane" data-recipe="recipe-list-workspace-states" data-list-state={state.value}><PanelHeader title="Release tasks" titleId="recipe-list-title" actions={<div class="kui-control-cluster"><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="empty">Clear</button><button class="kui-recipe__button" type="button" data-action="recipe-action" data-recipe-command="fail">Simulate failure</button><button class="kui-recipe__button" data-primary="true" type="button" data-action="recipe-action" data-recipe-command="refresh">Refresh</button></div>} /><div class="recipe-list__body kui-pane__content kui-content">{renderBody()}<p class="kui-recipe__ownership kui-content-item">The recipe owns feedback placement and stable content. The app owns fetching, cache age, retry policy, and domain rows.</p></div></section>;
|
|
25
|
-
return { render, action(command) { const next: Record<string, ListState> = { load: 'populated', empty: 'empty', create: 'populated', fail: 'error', retry: 'populated', refresh: 'stale', finish: 'populated' }; if (command in next) state.value = next[command]!; announce(`List state: ${state.value}`); } };
|
|
26
183
|
};
|
|
@@ -13,9 +13,12 @@ export const recipeIds = [
|
|
|
13
13
|
'recipe-collapsible-sidebar',
|
|
14
14
|
] as const;
|
|
15
15
|
|
|
16
|
-
export type RecipeId = typeof recipeIds[number];
|
|
16
|
+
export type RecipeId = (typeof recipeIds)[number];
|
|
17
17
|
|
|
18
|
-
export const recipeLoaders: Record<
|
|
18
|
+
export const recipeLoaders: Record<
|
|
19
|
+
RecipeId,
|
|
20
|
+
() => Promise<{ createRecipe: RecipeFactory }>
|
|
21
|
+
> = {
|
|
19
22
|
'recipe-app-shell': () => import('./app-shell.js'),
|
|
20
23
|
'recipe-navigation-sidebar': () => import('./navigation-sidebar.js'),
|
|
21
24
|
'recipe-workspace-header': () => import('./workspace-header.js'),
|