@kerfjs/ui 5.0.0-beta.126 → 5.0.0-beta.128
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/ai/component-props.json +20 -0
- package/ai/public-api-signatures-v1.md +7 -5
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/browser/editor.js +3 -1
- package/dist/{chunk-NR3ZO4LK.js → chunk-7U65KLDL.js} +1 -1
- package/dist/chunk-7U65KLDL.js.map +1 -0
- package/dist/chunk-BMOZSNDU.js +133 -0
- package/dist/chunk-BMOZSNDU.js.map +1 -0
- package/dist/chunk-GHV36C6I.js +94 -0
- package/dist/chunk-GHV36C6I.js.map +1 -0
- package/dist/{chunk-Z3BT2SZE.js → chunk-GQUDCWOD.js} +8 -2
- package/dist/chunk-GQUDCWOD.js.map +1 -0
- package/dist/{chunk-3SCGTP5O.js → chunk-HD7ZLISK.js} +137 -11
- package/dist/chunk-HD7ZLISK.js.map +1 -0
- package/dist/column-explorer.d.ts +1 -1
- package/dist/column-explorer.js +16 -138
- package/dist/column-explorer.js.map +1 -1
- package/dist/editor.js +838 -115
- package/dist/editor.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/list-detail-dialog.js +1 -1
- package/dist/styles/components/surfaces/editor-frame/editor-frame.css +8 -1
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +32 -0
- package/dist/styles/editor/editor.css +23 -0
- package/dist/styles/editor-frame.css +8 -1
- package/dist/styles/surface-scaffold.css +32 -0
- package/dist/surface-scaffold.d.ts +3 -1
- package/dist/surface-scaffold.js +1 -1
- package/dist/tree-list.d.ts +2 -2
- package/dist/tree-list.js +2 -2
- package/dist/{tree-rows-eHnnGLGM.d.ts → tree-rows-Bms5QJvG.d.ts} +3 -0
- package/dist/wire-column-explorer.js +1 -92
- package/dist/wire-column-explorer.js.map +1 -1
- package/dist/workbench-dialog.js +1 -1
- package/docs/view.md +19 -0
- package/package.json +4 -2
- package/ux-demo/recipes/app-shell.tsx +48 -141
- package/ux-demo/recipes/collapsible-sidebar.tsx +43 -169
- package/ux-demo/recipes/compact-toolbar.tsx +22 -114
- package/ux-demo/recipes/composer-form.tsx +14 -104
- package/ux-demo/recipes/list-detail-dialog.tsx +38 -84
- package/ux-demo/recipes/list-workspace-states.tsx +29 -152
- package/ux-demo/recipes/loading-inspector.tsx +30 -174
- package/ux-demo/recipes/media-detail.tsx +29 -146
- package/ux-demo/recipes/navigation-sidebar.tsx +24 -113
- package/ux-demo/recipes/navigation-stack.tsx +7 -43
- package/ux-demo/recipes/workspace-header.tsx +2 -66
- package/view/generate.mjs +34 -14
- package/dist/chunk-3SCGTP5O.js.map +0 -1
- package/dist/chunk-NR3ZO4LK.js.map +0 -1
- package/dist/chunk-Z3BT2SZE.js.map +0 -1
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
import '@kerfjs/ui/layout.css';
|
|
2
2
|
import '@kerfjs/ui/select/register';
|
|
3
3
|
|
|
4
|
-
import { Row } from '@kerfjs/ui';
|
|
5
|
-
import { em } from '@kerfjs/ui/css-values';
|
|
6
|
-
import { List } from '@kerfjs/ui/list';
|
|
7
|
-
import { ListItem } from '@kerfjs/ui/list-item';
|
|
8
|
-
import { LucideIcon } from '@kerfjs/ui/lucide-icon';
|
|
9
|
-
import { Pane } from '@kerfjs/ui/pane';
|
|
10
|
-
import { SegmentedControl } from '@kerfjs/ui/segmented-control';
|
|
11
|
-
import { Select } from '@kerfjs/ui/select';
|
|
12
|
-
import { Skeleton } from '@kerfjs/ui/skeleton';
|
|
13
|
-
import { StateBanner } from '@kerfjs/ui/state-banner';
|
|
14
|
-
import { Text } from '@kerfjs/ui/text';
|
|
15
|
-
import { Toolbar } from '@kerfjs/ui/toolbar';
|
|
16
|
-
import {
|
|
17
|
-
ToolbarButton,
|
|
18
|
-
ToolbarControlGroup,
|
|
19
|
-
} from '@kerfjs/ui/toolbar-control-group';
|
|
20
|
-
import { ToolbarText } from '@kerfjs/ui/toolbar-text';
|
|
21
|
-
import { ValueTable, ValueTableRow } from '@kerfjs/ui/value-table';
|
|
22
4
|
import { signal } from 'kerfjs';
|
|
23
|
-
import { Columns3, FileText, Inbox, List as ListIcon } from 'lucide';
|
|
24
5
|
|
|
6
|
+
import { renderRecipeInspectorIconColumns3 } from '../views/recipe-inspector-icon-columns-3.view.js';
|
|
7
|
+
import { renderRecipeInspectorIconFileText } from '../views/recipe-inspector-icon-file-text.view.js';
|
|
8
|
+
import { renderRecipeInspectorIconList } from '../views/recipe-inspector-icon-list.view.js';
|
|
9
|
+
import { renderRecipeLoadingInspector } from '../views/recipe-loading-inspector.view.js';
|
|
25
10
|
import type { RecipeFactory, RecipePresentation } from './types.js';
|
|
26
11
|
|
|
27
12
|
export const presentation: RecipePresentation = {
|
|
@@ -35,164 +20,35 @@ export const presentation: RecipePresentation = {
|
|
|
35
20
|
note: "Each value-bearing component's placeholder prop renders skeletons in its value slots while loading, so the recipe composes a faithful loading inspector from real chrome. The app owns the loading lifecycle and which values are still unknown.",
|
|
36
21
|
};
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
<LucideIcon icon={node} name={name} />
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A record inspector whose per-record values load asynchronously. Every
|
|
44
|
-
* value-bearing component takes `placeholder` from one loading flag, so the same
|
|
45
|
-
* chrome renders a faithful loading state and then the populated record — no
|
|
46
|
-
* separate skeleton markup. The composition is the point; `Skeleton` is the
|
|
47
|
-
* primitive it is built on (see the Skeleton component demo).
|
|
48
|
-
*/
|
|
23
|
+
/** A record inspector whose values load without changing its component tree. */
|
|
49
24
|
export const createRecipe: RecipeFactory = (announce) => {
|
|
50
25
|
const loading = signal(true);
|
|
26
|
+
const viewChoices = [
|
|
27
|
+
{
|
|
28
|
+
value: 'details',
|
|
29
|
+
label: 'Details',
|
|
30
|
+
content: renderRecipeInspectorIconList({}),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: 'activity',
|
|
34
|
+
label: 'Activity',
|
|
35
|
+
content: renderRecipeInspectorIconColumns3({}),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 'files',
|
|
39
|
+
label: 'Files',
|
|
40
|
+
content: renderRecipeInspectorIconFileText({}),
|
|
41
|
+
},
|
|
42
|
+
];
|
|
51
43
|
const render = () => {
|
|
52
|
-
const
|
|
53
|
-
return (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}}
|
|
61
|
-
header={
|
|
62
|
-
<>
|
|
63
|
-
<Toolbar
|
|
64
|
-
label="Ticket Inspector"
|
|
65
|
-
responsive="wrap"
|
|
66
|
-
leading={
|
|
67
|
-
<>
|
|
68
|
-
<ToolbarControlGroup appearance="borderless" single>
|
|
69
|
-
{icon(FileText, 'file-text')}
|
|
70
|
-
</ToolbarControlGroup>
|
|
71
|
-
<ToolbarText
|
|
72
|
-
text="Ticket · KF-2048"
|
|
73
|
-
size="xlarge"
|
|
74
|
-
id="recipe-inspector-title"
|
|
75
|
-
placeholder={p}
|
|
76
|
-
/>
|
|
77
|
-
</>
|
|
78
|
-
}
|
|
79
|
-
trailing={
|
|
80
|
-
<ToolbarControlGroup
|
|
81
|
-
appearance="borderless"
|
|
82
|
-
content="text"
|
|
83
|
-
single
|
|
84
|
-
>
|
|
85
|
-
<ToolbarButton
|
|
86
|
-
action="recipe-action"
|
|
87
|
-
rootAttributes={{ 'data-recipe-command': 'toggle' }}
|
|
88
|
-
>
|
|
89
|
-
{p ? 'Show Loaded' : 'Show Loading'}
|
|
90
|
-
</ToolbarButton>
|
|
91
|
-
</ToolbarControlGroup>
|
|
92
|
-
}
|
|
93
|
-
/>
|
|
94
|
-
<Row controlInsets="trbl">
|
|
95
|
-
<Text tone="quiet" id="recipe-inspector-summary">
|
|
96
|
-
{p ? (
|
|
97
|
-
<Skeleton width={em(18)} />
|
|
98
|
-
) : (
|
|
99
|
-
'Restore keyboard focus after a dialog closes'
|
|
100
|
-
)}
|
|
101
|
-
</Text>
|
|
102
|
-
</Row>
|
|
103
|
-
</>
|
|
104
|
-
}
|
|
105
|
-
>
|
|
106
|
-
<section>
|
|
107
|
-
<ValueTable label="Ticket Details">
|
|
108
|
-
<ValueTableRow
|
|
109
|
-
label="Status"
|
|
110
|
-
value="In review"
|
|
111
|
-
icon={icon(Inbox, 'inbox')}
|
|
112
|
-
placeholder={p}
|
|
113
|
-
/>
|
|
114
|
-
<ValueTableRow label="Owner" value="Mara Lopez" placeholder={p} />
|
|
115
|
-
<ValueTableRow label="Priority" value="High" placeholder={p} />
|
|
116
|
-
<ValueTableRow
|
|
117
|
-
label="Updated"
|
|
118
|
-
value="2 hours ago"
|
|
119
|
-
placeholder={p}
|
|
120
|
-
/>
|
|
121
|
-
</ValueTable>
|
|
122
|
-
</section>
|
|
123
|
-
<List gap="xs" controlInsets="rl">
|
|
124
|
-
<Select
|
|
125
|
-
name="recipe-inspector-status"
|
|
126
|
-
value="review"
|
|
127
|
-
label="Status"
|
|
128
|
-
hint="Where this ticket sits in the review workflow."
|
|
129
|
-
placeholder={p}
|
|
130
|
-
choices={[
|
|
131
|
-
{ value: 'review', label: 'In Review' },
|
|
132
|
-
{ value: 'ready', label: 'Ready' },
|
|
133
|
-
{ value: 'done', label: 'Done' },
|
|
134
|
-
]}
|
|
135
|
-
/>
|
|
136
|
-
<SegmentedControl
|
|
137
|
-
id="recipe-inspector-view"
|
|
138
|
-
label="Inspector View"
|
|
139
|
-
value="details"
|
|
140
|
-
appearance="toolbar"
|
|
141
|
-
shape="pill"
|
|
142
|
-
size="compact"
|
|
143
|
-
placeholder={p}
|
|
144
|
-
choices={[
|
|
145
|
-
{
|
|
146
|
-
value: 'details',
|
|
147
|
-
label: 'Details',
|
|
148
|
-
content: icon(ListIcon, 'list'),
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
value: 'activity',
|
|
152
|
-
label: 'Activity',
|
|
153
|
-
content: icon(Columns3, 'columns-3'),
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
value: 'files',
|
|
157
|
-
label: 'Files',
|
|
158
|
-
content: icon(FileText, 'file-text'),
|
|
159
|
-
},
|
|
160
|
-
]}
|
|
161
|
-
/>
|
|
162
|
-
</List>
|
|
163
|
-
<section>
|
|
164
|
-
<ListItem
|
|
165
|
-
action="recipe-action"
|
|
166
|
-
itemId="reassign"
|
|
167
|
-
label="Reassign Ticket"
|
|
168
|
-
icon={icon(Inbox, 'inbox')}
|
|
169
|
-
placeholder={p}
|
|
170
|
-
/>
|
|
171
|
-
<ListItem
|
|
172
|
-
action="recipe-action"
|
|
173
|
-
itemId="watch"
|
|
174
|
-
label="Watch for Changes"
|
|
175
|
-
placeholder={p}
|
|
176
|
-
/>
|
|
177
|
-
</section>
|
|
178
|
-
{p ? (
|
|
179
|
-
<StateBanner
|
|
180
|
-
tone="info"
|
|
181
|
-
title="Up to Date"
|
|
182
|
-
detail="All checks passed on the latest revision."
|
|
183
|
-
icon={icon(FileText, 'file-text')}
|
|
184
|
-
placeholder
|
|
185
|
-
/>
|
|
186
|
-
) : (
|
|
187
|
-
<StateBanner
|
|
188
|
-
tone="success"
|
|
189
|
-
title="Up to Date"
|
|
190
|
-
detail="All checks passed on the latest revision."
|
|
191
|
-
icon={icon(FileText, 'file-text')}
|
|
192
|
-
/>
|
|
193
|
-
)}
|
|
194
|
-
</Pane>
|
|
195
|
-
);
|
|
44
|
+
const value = loading.value;
|
|
45
|
+
return renderRecipeLoadingInspector({
|
|
46
|
+
loading: value,
|
|
47
|
+
loadingText: String(value),
|
|
48
|
+
toggleLabel: value ? 'Show Loaded' : 'Show Loading',
|
|
49
|
+
bannerTone: value ? 'info' : 'success',
|
|
50
|
+
viewChoices,
|
|
51
|
+
});
|
|
196
52
|
};
|
|
197
53
|
return {
|
|
198
54
|
render,
|
|
@@ -6,24 +6,16 @@ import '@kerfjs/ui/toolbar.css';
|
|
|
6
6
|
import '@kerfjs/ui/toolbar-text.css';
|
|
7
7
|
import '@kerfjs/ui/toolbar-control-group.css';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { List } from '@kerfjs/ui/list';
|
|
12
|
-
import { ListHeader } from '@kerfjs/ui/list-header';
|
|
13
|
-
import { ListItem } from '@kerfjs/ui/list-item';
|
|
14
|
-
import { LucideIcon } from '@kerfjs/ui/lucide-icon';
|
|
15
|
-
import { NavStack, type NavStackView } from '@kerfjs/ui/nav-stack';
|
|
16
|
-
import { Text } from '@kerfjs/ui/text';
|
|
17
|
-
import { Toolbar } from '@kerfjs/ui/toolbar';
|
|
18
|
-
import {
|
|
19
|
-
ToolbarButton,
|
|
20
|
-
ToolbarControlGroup,
|
|
21
|
-
} from '@kerfjs/ui/toolbar-control-group';
|
|
22
|
-
import { ToolbarText } from '@kerfjs/ui/toolbar-text';
|
|
9
|
+
import { fillColor } from '@kerfjs/ui/css-values';
|
|
10
|
+
import { type NavStackView } from '@kerfjs/ui/nav-stack';
|
|
23
11
|
import { wireScrollDividers } from '@kerfjs/ui/wire-scroll-dividers';
|
|
24
12
|
import { signal } from 'kerfjs';
|
|
25
|
-
import { ChevronRight, Disc3, Ellipsis, Play, Share, Shuffle } from 'lucide';
|
|
26
13
|
|
|
14
|
+
import { renderRecipeMediaActions } from '../views/recipe-media-actions.view.js';
|
|
15
|
+
import { renderRecipeMediaAlbum } from '../views/recipe-media-album.view.js';
|
|
16
|
+
import { renderRecipeMediaLibrary } from '../views/recipe-media-library.view.js';
|
|
17
|
+
import { renderRecipeMediaPlayback } from '../views/recipe-media-playback.view.js';
|
|
18
|
+
import { renderRecipeMediaShell } from '../views/recipe-media-shell.view.js';
|
|
27
19
|
import type { RecipeFactory, RecipePresentation } from './types.js';
|
|
28
20
|
|
|
29
21
|
export const presentation: RecipePresentation = {
|
|
@@ -91,139 +83,35 @@ const artwork = () =>
|
|
|
91
83
|
new Blob([ARTWORK], { type: 'image/svg+xml' }),
|
|
92
84
|
));
|
|
93
85
|
|
|
94
|
-
/** A playback command: icon-only with `label` as its name, or labeled. */
|
|
95
|
-
const command = (
|
|
96
|
-
name: string,
|
|
97
|
-
label: string,
|
|
98
|
-
icon: SafeIcon,
|
|
99
|
-
visibleLabel = false,
|
|
100
|
-
) =>
|
|
101
|
-
visibleLabel ? (
|
|
102
|
-
<ToolbarButton
|
|
103
|
-
action="recipe-action"
|
|
104
|
-
rootAttributes={{ 'data-recipe-command': name }}
|
|
105
|
-
icon={icon}
|
|
106
|
-
>
|
|
107
|
-
{label}
|
|
108
|
-
</ToolbarButton>
|
|
109
|
-
) : (
|
|
110
|
-
<ToolbarButton
|
|
111
|
-
ariaLabel={label}
|
|
112
|
-
action="recipe-action"
|
|
113
|
-
rootAttributes={{ 'data-recipe-command': name }}
|
|
114
|
-
icon={icon}
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
type SafeIcon = ReturnType<typeof LucideIcon>;
|
|
119
|
-
|
|
120
86
|
export const createRecipe: RecipeFactory = (announce) => {
|
|
121
87
|
const libraryView = (): NavStackView => ({
|
|
122
88
|
key: 'library',
|
|
123
89
|
toolbar: { title: 'Library' },
|
|
124
|
-
content: (
|
|
125
|
-
<List>
|
|
126
|
-
<section>
|
|
127
|
-
<ListHeader label="Albums" />
|
|
128
|
-
{ALBUMS.map((album) => (
|
|
129
|
-
<ListItem
|
|
130
|
-
action="recipe-action"
|
|
131
|
-
itemId={album.id}
|
|
132
|
-
label={album.title}
|
|
133
|
-
description={album.artist}
|
|
134
|
-
icon={<LucideIcon icon={Disc3} name="disc-3" />}
|
|
135
|
-
trailing={<LucideIcon icon={ChevronRight} name="chevron-right" />}
|
|
136
|
-
/>
|
|
137
|
-
))}
|
|
138
|
-
</section>
|
|
139
|
-
</List>
|
|
140
|
-
),
|
|
90
|
+
content: renderRecipeMediaLibrary({ albums: ALBUMS }),
|
|
141
91
|
});
|
|
142
92
|
|
|
143
93
|
const albumView = (album: Album): NavStackView => ({
|
|
144
94
|
key: album.id,
|
|
145
95
|
toolbar: {
|
|
146
96
|
title: '',
|
|
147
|
-
trailing: (
|
|
148
|
-
<ToolbarControlGroup
|
|
149
|
-
label="Album Actions"
|
|
150
|
-
content="icon"
|
|
151
|
-
material="glass"
|
|
152
|
-
>
|
|
153
|
-
{command('share', 'Share', <LucideIcon icon={Share} name="share" />)}
|
|
154
|
-
{command(
|
|
155
|
-
'more',
|
|
156
|
-
'More',
|
|
157
|
-
<LucideIcon icon={Ellipsis} name="ellipsis" />,
|
|
158
|
-
)}
|
|
159
|
-
</ToolbarControlGroup>
|
|
160
|
-
),
|
|
97
|
+
trailing: renderRecipeMediaActions({}),
|
|
161
98
|
},
|
|
162
99
|
pane: { safeAreaEdges: [] },
|
|
163
|
-
content: (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
description={album.artist}
|
|
179
|
-
size="xlarge"
|
|
180
|
-
headingLevel={2}
|
|
181
|
-
/>
|
|
182
|
-
}
|
|
183
|
-
trailing={
|
|
184
|
-
<ToolbarControlGroup
|
|
185
|
-
label="Playback"
|
|
186
|
-
content="mixed"
|
|
187
|
-
material="glass"
|
|
188
|
-
>
|
|
189
|
-
{command(
|
|
190
|
-
'play',
|
|
191
|
-
'Play',
|
|
192
|
-
<LucideIcon icon={Play} name="play" />,
|
|
193
|
-
true,
|
|
194
|
-
)}
|
|
195
|
-
{command(
|
|
196
|
-
'shuffle',
|
|
197
|
-
'Shuffle',
|
|
198
|
-
<LucideIcon icon={Shuffle} name="shuffle" />,
|
|
199
|
-
)}
|
|
200
|
-
</ToolbarControlGroup>
|
|
201
|
-
}
|
|
202
|
-
/>
|
|
203
|
-
}
|
|
204
|
-
>
|
|
205
|
-
<List>
|
|
206
|
-
<section>
|
|
207
|
-
<ListHeader
|
|
208
|
-
label="Songs"
|
|
209
|
-
count={album.tracks.length}
|
|
210
|
-
countLabel={`${String(album.tracks.length)} songs`}
|
|
211
|
-
/>
|
|
212
|
-
{album.tracks.map(([title, length], index) => (
|
|
213
|
-
<ListItem
|
|
214
|
-
action="recipe-action"
|
|
215
|
-
itemId={`${album.id}-track-${String(index + 1)}`}
|
|
216
|
-
label={title}
|
|
217
|
-
trailing={
|
|
218
|
-
<Text variant="span" tone="quiet">
|
|
219
|
-
{length}
|
|
220
|
-
</Text>
|
|
221
|
-
}
|
|
222
|
-
/>
|
|
223
|
-
))}
|
|
224
|
-
</section>
|
|
225
|
-
</List>
|
|
226
|
-
</BackdropImage>
|
|
100
|
+
content: renderRecipeMediaAlbum(
|
|
101
|
+
{
|
|
102
|
+
title: album.title,
|
|
103
|
+
artist: album.artist,
|
|
104
|
+
artworkUrl: artwork(),
|
|
105
|
+
artworkAlt: `${album.title} artwork: ridges at dusk under a low sun`,
|
|
106
|
+
trackCount: album.tracks.length,
|
|
107
|
+
trackCountLabel: `${String(album.tracks.length)} songs`,
|
|
108
|
+
tracks: album.tracks.map(([title, length], index) => ({
|
|
109
|
+
id: `${album.id}-track-${String(index + 1)}`,
|
|
110
|
+
title,
|
|
111
|
+
length,
|
|
112
|
+
})),
|
|
113
|
+
},
|
|
114
|
+
{ playback: () => renderRecipeMediaPlayback({}) },
|
|
227
115
|
),
|
|
228
116
|
});
|
|
229
117
|
|
|
@@ -235,18 +123,13 @@ export const createRecipe: RecipeFactory = (announce) => {
|
|
|
235
123
|
const album = current();
|
|
236
124
|
return (
|
|
237
125
|
<section data-recipe="recipe-media-detail" aria-label="Music">
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
views={views.value}
|
|
242
|
-
chromePresentation="clear"
|
|
243
|
-
scrollEdge="material"
|
|
244
|
-
tint={
|
|
126
|
+
{renderRecipeMediaShell({
|
|
127
|
+
views: views.value,
|
|
128
|
+
tint:
|
|
245
129
|
album === undefined
|
|
246
130
|
? undefined
|
|
247
|
-
: { color: fillColor(album.tint), scheme: 'dark' }
|
|
248
|
-
|
|
249
|
-
/>
|
|
131
|
+
: { color: fillColor(album.tint), scheme: 'dark' },
|
|
132
|
+
})}
|
|
250
133
|
</section>
|
|
251
134
|
);
|
|
252
135
|
};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import '@kerfjs/ui/layout.css';
|
|
2
2
|
|
|
3
|
-
import { ContentItem } from '@kerfjs/ui/content-item';
|
|
4
|
-
import { List } from '@kerfjs/ui/list';
|
|
5
|
-
import { ListHeader } from '@kerfjs/ui/list-header';
|
|
6
|
-
import { ListItem } from '@kerfjs/ui/list-item';
|
|
7
|
-
import { LucideIcon } from '@kerfjs/ui/lucide-icon';
|
|
8
|
-
import { Pane } from '@kerfjs/ui/pane';
|
|
9
|
-
import { Text } from '@kerfjs/ui/text';
|
|
10
|
-
import { Toolbar } from '@kerfjs/ui/toolbar';
|
|
11
|
-
import {
|
|
12
|
-
ToolbarButton,
|
|
13
|
-
ToolbarControlGroup,
|
|
14
|
-
} from '@kerfjs/ui/toolbar-control-group';
|
|
15
3
|
import { signal } from 'kerfjs';
|
|
16
|
-
import { Folder, Inbox, Plus, Settings, Users } from 'lucide';
|
|
17
4
|
|
|
5
|
+
import { renderRecipeNavigationProjects } from '../views/recipe-navigation-projects.view.js';
|
|
6
|
+
import { renderRecipeNavigationSidebar } from '../views/recipe-navigation-sidebar.view.js';
|
|
7
|
+
import { renderRecipeNavigationWorkspace } from '../views/recipe-navigation-workspace.view.js';
|
|
18
8
|
import type { RecipeFactory, RecipePresentation } from './types.js';
|
|
19
9
|
|
|
20
10
|
export const presentation: RecipePresentation = {
|
|
@@ -33,108 +23,29 @@ export const presentation: RecipePresentation = {
|
|
|
33
23
|
export const createRecipe: RecipeFactory = (announce) => {
|
|
34
24
|
const selected = signal('inbox');
|
|
35
25
|
const expanded = signal(true);
|
|
36
|
-
const render = () =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
footer={
|
|
42
|
-
<Toolbar
|
|
43
|
-
label="Sidebar Actions"
|
|
44
|
-
dividerSides="t"
|
|
45
|
-
leading={
|
|
46
|
-
<ToolbarControlGroup appearance="borderless" single>
|
|
47
|
-
<ToolbarButton
|
|
48
|
-
ariaLabel="Add Project"
|
|
49
|
-
action="recipe-action"
|
|
50
|
-
rootAttributes={{ 'data-recipe-command': 'add' }}
|
|
51
|
-
icon={<LucideIcon icon={Plus} name="plus" />}
|
|
52
|
-
/>
|
|
53
|
-
</ToolbarControlGroup>
|
|
54
|
-
}
|
|
55
|
-
trailing={
|
|
56
|
-
<ToolbarControlGroup appearance="borderless" single>
|
|
57
|
-
<ToolbarButton
|
|
58
|
-
ariaLabel="Workspace Settings"
|
|
59
|
-
action="recipe-action"
|
|
60
|
-
rootAttributes={{ 'data-recipe-command': 'settings' }}
|
|
61
|
-
icon={<LucideIcon icon={Settings} name="settings" />}
|
|
62
|
-
/>
|
|
63
|
-
</ToolbarControlGroup>
|
|
64
|
-
}
|
|
65
|
-
/>
|
|
66
|
-
}
|
|
67
|
-
>
|
|
68
|
-
<section>
|
|
69
|
-
<ListHeader
|
|
70
|
-
label="Workspace"
|
|
71
|
-
count={3}
|
|
72
|
-
countLabel="3 workspaces"
|
|
73
|
-
action="recipe-action"
|
|
74
|
-
actionLabel="Add workspace item"
|
|
75
|
-
actionIcon={<LucideIcon icon={Plus} name="plus" />}
|
|
76
|
-
/>
|
|
77
|
-
<ListItem
|
|
78
|
-
action="recipe-action"
|
|
79
|
-
itemId="inbox"
|
|
80
|
-
label="Inbox"
|
|
81
|
-
icon={<LucideIcon icon={Inbox} name="inbox" />}
|
|
82
|
-
trailing={<span>12</span>}
|
|
83
|
-
selected={selected.value === 'inbox'}
|
|
84
|
-
/>
|
|
85
|
-
<ListItem
|
|
86
|
-
action="recipe-action"
|
|
87
|
-
itemId="shared"
|
|
88
|
-
label="Shared with Me"
|
|
89
|
-
icon={<LucideIcon icon={Users} name="users" />}
|
|
90
|
-
selected={selected.value === 'shared'}
|
|
91
|
-
/>
|
|
92
|
-
<ListItem
|
|
93
|
-
action="recipe-action"
|
|
94
|
-
itemId="drafts"
|
|
95
|
-
label="Drafts Without an Icon"
|
|
96
|
-
selected={selected.value === 'drafts'}
|
|
97
|
-
/>
|
|
98
|
-
</section>
|
|
99
|
-
<section>
|
|
100
|
-
<ListHeader
|
|
101
|
-
label="Projects"
|
|
102
|
-
toggle
|
|
103
|
-
action="recipe-action"
|
|
104
|
-
expanded={expanded.value}
|
|
105
|
-
/>
|
|
106
|
-
{expanded.value && (
|
|
26
|
+
const render = () =>
|
|
27
|
+
renderRecipeNavigationSidebar(
|
|
28
|
+
{},
|
|
29
|
+
{
|
|
30
|
+
content: () => (
|
|
107
31
|
<>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
title="Available to administrators"
|
|
122
|
-
/>
|
|
123
|
-
<ContentItem>
|
|
124
|
-
<List gap="2xs">
|
|
125
|
-
<Text variant="span" weight="strong">
|
|
126
|
-
Quarterly Goal
|
|
127
|
-
</Text>
|
|
128
|
-
<Text variant="span" tone="quiet" size="compact">
|
|
129
|
-
Ship accessible navigation patterns to every workspace.
|
|
130
|
-
</Text>
|
|
131
|
-
</List>
|
|
132
|
-
</ContentItem>
|
|
32
|
+
<section>
|
|
33
|
+
{renderRecipeNavigationWorkspace({
|
|
34
|
+
inboxSelected: selected.value === 'inbox',
|
|
35
|
+
sharedSelected: selected.value === 'shared',
|
|
36
|
+
draftsSelected: selected.value === 'drafts',
|
|
37
|
+
})}
|
|
38
|
+
</section>
|
|
39
|
+
<section>
|
|
40
|
+
{renderRecipeNavigationProjects({
|
|
41
|
+
expanded: expanded.value,
|
|
42
|
+
designSelected: selected.value === 'design',
|
|
43
|
+
})}
|
|
44
|
+
</section>
|
|
133
45
|
</>
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
);
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
);
|
|
138
49
|
return {
|
|
139
50
|
render,
|
|
140
51
|
action(command, element) {
|
|
@@ -2,17 +2,12 @@ import '@kerfjs/ui/layout.css';
|
|
|
2
2
|
import '@kerfjs/ui/nav-stack.css';
|
|
3
3
|
import '@kerfjs/ui/toolbar-text.css';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { List } from '@kerfjs/ui/list';
|
|
7
|
-
import { ListHeader } from '@kerfjs/ui/list-header';
|
|
8
|
-
import { ListItem } from '@kerfjs/ui/list-item';
|
|
9
|
-
import { LucideIcon } from '@kerfjs/ui/lucide-icon';
|
|
10
|
-
import { NavStack, type NavStackView } from '@kerfjs/ui/nav-stack';
|
|
11
|
-
import { Row } from '@kerfjs/ui/row';
|
|
12
|
-
import { Text } from '@kerfjs/ui/text';
|
|
5
|
+
import { type NavStackView } from '@kerfjs/ui/nav-stack';
|
|
13
6
|
import { signal } from 'kerfjs';
|
|
14
|
-
import { ChevronRight, FileText, Folder } from 'lucide';
|
|
15
7
|
|
|
8
|
+
import { renderRecipeNavigationDetail } from '../views/recipe-navigation-detail.view.js';
|
|
9
|
+
import { renderRecipeNavigationLibrary } from '../views/recipe-navigation-library.view.js';
|
|
10
|
+
import { renderRecipeNavigationShell } from '../views/recipe-navigation-shell.view.js';
|
|
16
11
|
import type { RecipeFactory, RecipePresentation } from './types.js';
|
|
17
12
|
|
|
18
13
|
export const presentation: RecipePresentation = {
|
|
@@ -59,44 +54,13 @@ export const createRecipe: RecipeFactory = (announce) => {
|
|
|
59
54
|
const listView = (): NavStackView => ({
|
|
60
55
|
key: 'library',
|
|
61
56
|
toolbar: { title: 'Library' },
|
|
62
|
-
content: (
|
|
63
|
-
<List>
|
|
64
|
-
<section>
|
|
65
|
-
<ListHeader label="Components" />
|
|
66
|
-
{ITEMS.map((item) => (
|
|
67
|
-
<ListItem
|
|
68
|
-
action="recipe-action"
|
|
69
|
-
itemId={item.id}
|
|
70
|
-
label={item.label}
|
|
71
|
-
icon={<LucideIcon icon={Folder} name="folder" />}
|
|
72
|
-
trailing={<LucideIcon icon={ChevronRight} name="chevron-right" />}
|
|
73
|
-
/>
|
|
74
|
-
))}
|
|
75
|
-
</section>
|
|
76
|
-
</List>
|
|
77
|
-
),
|
|
57
|
+
content: renderRecipeNavigationLibrary({ items: ITEMS }),
|
|
78
58
|
});
|
|
79
59
|
|
|
80
60
|
const detailView = (item: LibraryItem): NavStackView => ({
|
|
81
61
|
key: item.id,
|
|
82
62
|
toolbar: { title: item.label },
|
|
83
|
-
content: (
|
|
84
|
-
<List controlInsets="t">
|
|
85
|
-
<ContentItem>
|
|
86
|
-
<Row gap="xs">
|
|
87
|
-
<LucideIcon icon={FileText} name="file-text" />
|
|
88
|
-
<List gap="2xs">
|
|
89
|
-
<Text variant="span" weight="strong">
|
|
90
|
-
{item.label}
|
|
91
|
-
</Text>
|
|
92
|
-
<Text variant="span" tone="quiet" size="compact">
|
|
93
|
-
{item.detail}
|
|
94
|
-
</Text>
|
|
95
|
-
</List>
|
|
96
|
-
</Row>
|
|
97
|
-
</ContentItem>
|
|
98
|
-
</List>
|
|
99
|
-
),
|
|
63
|
+
content: renderRecipeNavigationDetail(item),
|
|
100
64
|
});
|
|
101
65
|
|
|
102
66
|
const views = signal<NavStackView[]>([listView()]);
|
|
@@ -106,7 +70,7 @@ export const createRecipe: RecipeFactory = (announce) => {
|
|
|
106
70
|
data-recipe="recipe-navigation-stack"
|
|
107
71
|
aria-label="Component Library"
|
|
108
72
|
>
|
|
109
|
-
|
|
73
|
+
{renderRecipeNavigationShell({ views: views.value })}
|
|
110
74
|
</section>
|
|
111
75
|
);
|
|
112
76
|
|