@k2b/ui 0.65.0 → 0.66.0
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 +47 -0
- package/dist/browser/v2/button.js +180 -0
- package/dist/browser/v2/button.js.map +1 -0
- package/dist/browser/v2/components.js +763 -0
- package/dist/browser/v2/components.js.map +1 -0
- package/dist/browser/v2/content.js +1107 -0
- package/dist/browser/v2/content.js.map +1 -0
- package/dist/browser/v2/controls.js +568 -0
- package/dist/browser/v2/controls.js.map +1 -0
- package/dist/browser/v2/describe.js +397 -0
- package/dist/browser/v2/describe.js.map +1 -0
- package/dist/browser/v2/index.js +25 -0
- package/dist/browser/v2/index.js.map +1 -0
- package/dist/browser/v2/layout.js +578 -0
- package/dist/browser/v2/layout.js.map +1 -0
- package/dist/browser/v2/link.js +9 -0
- package/dist/browser/v2/link.js.map +1 -0
- package/dist/browser/v2/marks.js +211 -0
- package/dist/browser/v2/marks.js.map +1 -0
- package/dist/browser/v2/states.js +180 -0
- package/dist/browser/v2/states.js.map +1 -0
- package/dist/browser/v2/structure.js +328 -0
- package/dist/browser/v2/structure.js.map +1 -0
- package/dist/browser/v2/testing/index.js +23 -0
- package/dist/browser/v2/testing/index.js.map +1 -0
- package/dist/browser/v2/testing/measure-v2-layout.js +762 -0
- package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -0
- package/dist/browser/v2/testing/settled.js +52 -0
- package/dist/browser/v2/testing/settled.js.map +1 -0
- package/dist/browser/v2/tokens.js +83 -0
- package/dist/browser/v2/tokens.js.map +1 -0
- package/dist/browser/v2/types.js +24 -0
- package/dist/browser/v2/types.js.map +1 -0
- package/dist/ssr/v2/button.js +177 -0
- package/dist/ssr/v2/button.js.map +1 -0
- package/dist/ssr/v2/components.js +518 -0
- package/dist/ssr/v2/components.js.map +1 -0
- package/dist/ssr/v2/content.js +727 -0
- package/dist/ssr/v2/content.js.map +1 -0
- package/dist/ssr/v2/controls.js +268 -0
- package/dist/ssr/v2/controls.js.map +1 -0
- package/dist/ssr/v2/describe.js +397 -0
- package/dist/ssr/v2/describe.js.map +1 -0
- package/dist/ssr/v2/index.js +25 -0
- package/dist/ssr/v2/index.js.map +1 -0
- package/dist/ssr/v2/layout.js +377 -0
- package/dist/ssr/v2/layout.js.map +1 -0
- package/dist/ssr/v2/link.js +9 -0
- package/dist/ssr/v2/link.js.map +1 -0
- package/dist/ssr/v2/marks.js +126 -0
- package/dist/ssr/v2/marks.js.map +1 -0
- package/dist/ssr/v2/states.js +128 -0
- package/dist/ssr/v2/states.js.map +1 -0
- package/dist/ssr/v2/structure.js +229 -0
- package/dist/ssr/v2/structure.js.map +1 -0
- package/dist/ssr/v2/testing/index.js +23 -0
- package/dist/ssr/v2/testing/index.js.map +1 -0
- package/dist/ssr/v2/testing/measure-v2-layout.js +762 -0
- package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -0
- package/dist/ssr/v2/testing/settled.js +52 -0
- package/dist/ssr/v2/testing/settled.js.map +1 -0
- package/dist/ssr/v2/tokens.js +83 -0
- package/dist/ssr/v2/tokens.js.map +1 -0
- package/dist/ssr/v2/types.js +24 -0
- package/dist/ssr/v2/types.js.map +1 -0
- package/dist/types/v2/button.d.ts +54 -0
- package/dist/types/v2/components.d.ts +173 -0
- package/dist/types/v2/content.d.ts +233 -0
- package/dist/types/v2/controls.d.ts +118 -0
- package/dist/types/v2/describe.d.ts +18 -0
- package/dist/types/v2/index.d.ts +22 -0
- package/dist/types/v2/layout.d.ts +124 -0
- package/dist/types/v2/link.d.ts +7 -0
- package/dist/types/v2/marks.d.ts +90 -0
- package/dist/types/v2/states.d.ts +45 -0
- package/dist/types/v2/structure.d.ts +47 -0
- package/dist/types/v2/testing/index.d.ts +16 -0
- package/dist/types/v2/testing/measure-v2-layout.d.ts +99 -0
- package/dist/types/v2/testing/settled.d.ts +13 -0
- package/dist/types/v2/tokens.d.ts +77 -0
- package/dist/types/v2/types.d.ts +44 -0
- package/dist/v2.css +3072 -0
- package/package.json +23 -4
- package/skills/k2b-ui/SKILL.md +201 -0
- package/skills/k2b-ui/images/form-1440.png +0 -0
- package/skills/k2b-ui/images/form-390.png +0 -0
- package/skills/k2b-ui/images/list-detail-1440.png +0 -0
- package/skills/k2b-ui/images/list-detail-390.png +0 -0
- package/skills/k2b-ui/images/mail-1440.png +0 -0
- package/skills/k2b-ui/images/mail-390.png +0 -0
- package/skills/k2b-ui/images/record-1440.png +0 -0
- package/skills/k2b-ui/images/record-390.png +0 -0
- package/skills/k2b-ui/images/record-groups-1440.png +0 -0
- package/skills/k2b-ui/images/record-groups-390.png +0 -0
- package/skills/k2b-ui/images/table-1440.png +0 -0
- package/skills/k2b-ui/images/table-390.png +0 -0
- package/skills/k2b-ui/recipes/form.tsx +54 -0
- package/skills/k2b-ui/recipes/list-detail.tsx +105 -0
- package/skills/k2b-ui/recipes/mail.tsx +193 -0
- package/skills/k2b-ui/recipes/record-groups.tsx +115 -0
- package/skills/k2b-ui/recipes/record.tsx +163 -0
- package/skills/k2b-ui/recipes/table.tsx +68 -0
- package/skills/k2b-ui/references/mistakes.md +162 -0
- package/skills/k2b-ui/references/primitives.md +310 -0
- package/skills/k2b-ui/references/recipes.md +101 -0
- package/skills/k2b-ui/references/seeing.md +94 -0
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import { template as _$template } from "solid-js/web";
|
|
2
|
+
import { use as _$use } from "solid-js/web";
|
|
3
|
+
import { memo as _$memo } from "solid-js/web";
|
|
4
|
+
import { style as _$style } from "solid-js/web";
|
|
5
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
6
|
+
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
7
|
+
import { effect as _$effect } from "solid-js/web";
|
|
8
|
+
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
9
|
+
import { insert as _$insert } from "solid-js/web";
|
|
10
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
11
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<div class=k2-seam>`),
|
|
12
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<span class=k2-grip data-k2-grip role=separator tabindex=0 aria-orientation=vertical>`),
|
|
13
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<aside class=k2-ws-side data-k2-column>`),
|
|
14
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<div class=k2-slot data-slot=head>`),
|
|
15
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<div class=k2-ws data-k2-workspace data-k2-part=Workspace><!$><!/><div class=k2-ws-main data-k2-column><!$><!/><!$><!/></div><!$><!/>`),
|
|
16
|
+
_tmpl$6 = /*#__PURE__*/_$template(`<div class=k2-slot data-slot=status>`),
|
|
17
|
+
_tmpl$7 = /*#__PURE__*/_$template(`<section class=k2-pane data-k2-part=Pane data-k2-column><!$><!/><!$><!/><!$><!/><div class=k2-scroll>`),
|
|
18
|
+
_tmpl$8 = /*#__PURE__*/_$template(`<div class=k2-pane-back data-k2-part=Back>`),
|
|
19
|
+
_tmpl$9 = /*#__PURE__*/_$template(`<div class=k2-split data-k2-part=Pane.Split>`),
|
|
20
|
+
_tmpl$0 = /*#__PURE__*/_$template(`<div class=k2-bar-start>`),
|
|
21
|
+
_tmpl$1 = /*#__PURE__*/_$template(`<div class=k2-bar-end>`),
|
|
22
|
+
_tmpl$10 = /*#__PURE__*/_$template(`<div class=k2-bar data-k2-part=Bar><!$><!/><!$><!/>`),
|
|
23
|
+
_tmpl$11 = /*#__PURE__*/_$template(`<section class=k2-band data-k2-part=Band>`),
|
|
24
|
+
_tmpl$12 = /*#__PURE__*/_$template(`<div class=k2-cells data-k2-part=Cells>`),
|
|
25
|
+
_tmpl$13 = /*#__PURE__*/_$template(`<i class="ti ti-chevron-right k2-icon k2-cell-go"aria-hidden=true>`),
|
|
26
|
+
_tmpl$14 = /*#__PURE__*/_$template(`<span class=k2-cell-meta>`),
|
|
27
|
+
_tmpl$15 = /*#__PURE__*/_$template(`<div class=k2-cell data-k2-part=Cells.Cell><!$><!/><span class=k2-cell-label></span><!$><!/><span class=k2-cell-value></span><!$><!/>`),
|
|
28
|
+
_tmpl$16 = /*#__PURE__*/_$template(`<span>`),
|
|
29
|
+
_tmpl$17 = /*#__PURE__*/_$template(`<div class=k2-tiles data-k2-part=Tiles role=list><!$><!/><!$><!/>`),
|
|
30
|
+
_tmpl$18 = /*#__PURE__*/_$template(`<span class=k2-t-meta>`),
|
|
31
|
+
_tmpl$19 = /*#__PURE__*/_$template(`<div class=k2-tile role=listitem><!$><!/><span><span class=k2-tile-title></span><!$><!/>`),
|
|
32
|
+
_tmpl$20 = /*#__PURE__*/_$template(`<div class=k2-canvas data-k2-part=Canvas data-k2-canvas role=group>`);
|
|
33
|
+
import { createContext, createSignal, For, onCleanup, onMount, children as resolveChildren, Show, useContext } from "solid-js";
|
|
34
|
+
import { Dynamic } from "solid-js/web";
|
|
35
|
+
import { ActionButton } from "./button";
|
|
36
|
+
import { RowOpen } from "./content";
|
|
37
|
+
import { linkOr } from "./link";
|
|
38
|
+
import { custom, Icon } from "./marks";
|
|
39
|
+
// ── Grip ─────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The seam between two columns: the one 1 px line, and on a line that moves its grip. The grip is the shape only;
|
|
43
|
+
* dragging and the keyboard come with the behaviour layer.
|
|
44
|
+
*/
|
|
45
|
+
const Seam = props => (() => {
|
|
46
|
+
var _el$ = _$getNextElement(_tmpl$);
|
|
47
|
+
_$insert(_el$, _$createComponent(Show, {
|
|
48
|
+
get when() {
|
|
49
|
+
return props.grip;
|
|
50
|
+
},
|
|
51
|
+
children: grip => (() => {
|
|
52
|
+
var _el$2 = _$getNextElement(_tmpl$2);
|
|
53
|
+
_$effect(_p$ => {
|
|
54
|
+
var _v$ = grip().label,
|
|
55
|
+
_v$2 = grip().width.min,
|
|
56
|
+
_v$3 = grip().width.default;
|
|
57
|
+
_v$ !== _p$.e && _$setAttribute(_el$2, "aria-label", _p$.e = _v$);
|
|
58
|
+
_v$2 !== _p$.t && _$setAttribute(_el$2, "aria-valuemin", _p$.t = _v$2);
|
|
59
|
+
_v$3 !== _p$.a && _$setAttribute(_el$2, "aria-valuenow", _p$.a = _v$3);
|
|
60
|
+
return _p$;
|
|
61
|
+
}, {
|
|
62
|
+
e: undefined,
|
|
63
|
+
t: undefined,
|
|
64
|
+
a: undefined
|
|
65
|
+
});
|
|
66
|
+
return _el$2;
|
|
67
|
+
})()
|
|
68
|
+
}));
|
|
69
|
+
_$effect(() => _$setAttribute(_el$, "aria-hidden", props.grip ? undefined : "true"));
|
|
70
|
+
return _el$;
|
|
71
|
+
})();
|
|
72
|
+
|
|
73
|
+
// ── Workspace ────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
const sidebarDefault = {
|
|
76
|
+
min: 200,
|
|
77
|
+
default: 248
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The working surface of an app: a sidebar, a head and the columns below it, with one hairline between columns and
|
|
82
|
+
* a grip on every line that moves. On the phone the sidebar leaves and columns become pages.
|
|
83
|
+
*/
|
|
84
|
+
export const Workspace = props => {
|
|
85
|
+
const width = () => props.sidebarWidth ?? sidebarDefault;
|
|
86
|
+
// A part passed as JSX is made once, here, and read from here: reading the prop again would make it again (the
|
|
87
|
+
// server's `Show` reads `when` more than once), and the browser would look for nodes the server never sent.
|
|
88
|
+
const sidebar = resolveChildren(() => props.sidebar);
|
|
89
|
+
const head = resolveChildren(() => props.head);
|
|
90
|
+
return (() => {
|
|
91
|
+
var _el$3 = _$getNextElement(_tmpl$5),
|
|
92
|
+
_el$1 = _el$3.firstChild,
|
|
93
|
+
[_el$10, _co$3] = _$getNextMarker(_el$1.nextSibling),
|
|
94
|
+
_el$5 = _el$10.nextSibling,
|
|
95
|
+
_el$7 = _el$5.firstChild,
|
|
96
|
+
[_el$8, _co$] = _$getNextMarker(_el$7.nextSibling),
|
|
97
|
+
_el$9 = _el$8.nextSibling,
|
|
98
|
+
[_el$0, _co$2] = _$getNextMarker(_el$9.nextSibling),
|
|
99
|
+
_el$11 = _el$5.nextSibling,
|
|
100
|
+
[_el$12, _co$4] = _$getNextMarker(_el$11.nextSibling);
|
|
101
|
+
_$insert(_el$3, _$createComponent(Show, {
|
|
102
|
+
get when() {
|
|
103
|
+
return sidebar();
|
|
104
|
+
},
|
|
105
|
+
get children() {
|
|
106
|
+
return [(() => {
|
|
107
|
+
var _el$4 = _$getNextElement(_tmpl$3);
|
|
108
|
+
_$insert(_el$4, sidebar);
|
|
109
|
+
return _el$4;
|
|
110
|
+
})(), _$createComponent(Seam, {
|
|
111
|
+
get grip() {
|
|
112
|
+
return {
|
|
113
|
+
label: props.sidebarLabel ?? "Sidebar",
|
|
114
|
+
width: width()
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
})];
|
|
118
|
+
}
|
|
119
|
+
}), _el$10, _co$3);
|
|
120
|
+
_$insert(_el$5, _$createComponent(Show, {
|
|
121
|
+
get when() {
|
|
122
|
+
return head();
|
|
123
|
+
},
|
|
124
|
+
get children() {
|
|
125
|
+
var _el$6 = _$getNextElement(_tmpl$4);
|
|
126
|
+
_$insert(_el$6, head);
|
|
127
|
+
return _el$6;
|
|
128
|
+
}
|
|
129
|
+
}), _el$8, _co$);
|
|
130
|
+
_$insert(_el$5, () => props.children, _el$0, _co$2);
|
|
131
|
+
_$insert(_el$3, _$createComponent(Show, {
|
|
132
|
+
get when() {
|
|
133
|
+
return props.primary;
|
|
134
|
+
},
|
|
135
|
+
children: action => _$createComponent(Dynamic, {
|
|
136
|
+
get component() {
|
|
137
|
+
return linkOr(action().href, "button");
|
|
138
|
+
},
|
|
139
|
+
get type() {
|
|
140
|
+
return action().href !== undefined ? undefined : "button";
|
|
141
|
+
},
|
|
142
|
+
"class": "k2-btn k2-fab",
|
|
143
|
+
"data-variant": "primary",
|
|
144
|
+
get href() {
|
|
145
|
+
return action().href;
|
|
146
|
+
},
|
|
147
|
+
get onNavigate() {
|
|
148
|
+
return _$memo(() => action().href !== undefined)() ? action().onNavigate : undefined;
|
|
149
|
+
},
|
|
150
|
+
onClick: () => action().onClick?.(),
|
|
151
|
+
get children() {
|
|
152
|
+
return [_$createComponent(Show, {
|
|
153
|
+
get when() {
|
|
154
|
+
return action().icon;
|
|
155
|
+
},
|
|
156
|
+
children: name => _$createComponent(Icon, {
|
|
157
|
+
get name() {
|
|
158
|
+
return name();
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
}), _$memo(() => action().label)];
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
}), _el$12, _co$4);
|
|
165
|
+
_$effect(_$p => _$style(_el$3, custom({
|
|
166
|
+
"--k2-ws-side": `${width().default}px`,
|
|
167
|
+
"--k2-ws-side-min": `${width().min}px`
|
|
168
|
+
}), _$p));
|
|
169
|
+
return _el$3;
|
|
170
|
+
})();
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// ── Pane and Pane.Split ──────────────────────────────────────────────────────────────────────────────────────────
|
|
174
|
+
|
|
175
|
+
/** A pane inside a split registers its width and name for the seam beside it, for as long as it exists. */
|
|
176
|
+
const SplitContext = createContext();
|
|
177
|
+
/** A column that scrolls. It has no padding and no gutter, so every band in it reaches both edges. */
|
|
178
|
+
export const Pane = props => {
|
|
179
|
+
const entry = {
|
|
180
|
+
get width() {
|
|
181
|
+
return props.width;
|
|
182
|
+
},
|
|
183
|
+
get label() {
|
|
184
|
+
return props.label;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
useContext(SplitContext)?.(entry);
|
|
188
|
+
const head = resolveChildren(() => props.head);
|
|
189
|
+
const status = resolveChildren(() => props.status);
|
|
190
|
+
let section;
|
|
191
|
+
// A detail appears because something opened it, which then has the focus (the row). When the detail goes while the
|
|
192
|
+
// focus is in it (its way back, its close button), the focus returns there instead of falling to the page.
|
|
193
|
+
onMount(() => {
|
|
194
|
+
if (!props.detail) return;
|
|
195
|
+
const opener = document.activeElement;
|
|
196
|
+
if (!(opener instanceof HTMLElement) || opener === document.body || section?.contains(opener)) return;
|
|
197
|
+
onCleanup(() => {
|
|
198
|
+
const inside = section?.contains(document.activeElement) ?? false;
|
|
199
|
+
queueMicrotask(() => {
|
|
200
|
+
const lost = inside || document.activeElement === null || document.activeElement === document.body;
|
|
201
|
+
if (lost && opener.isConnected) opener.focus();
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
return (() => {
|
|
206
|
+
var _el$13 = _$getNextElement(_tmpl$7),
|
|
207
|
+
_el$17 = _el$13.firstChild,
|
|
208
|
+
[_el$18, _co$5] = _$getNextMarker(_el$17.nextSibling),
|
|
209
|
+
_el$19 = _el$18.nextSibling,
|
|
210
|
+
[_el$20, _co$6] = _$getNextMarker(_el$19.nextSibling),
|
|
211
|
+
_el$21 = _el$20.nextSibling,
|
|
212
|
+
[_el$22, _co$7] = _$getNextMarker(_el$21.nextSibling),
|
|
213
|
+
_el$16 = _el$22.nextSibling;
|
|
214
|
+
_$use(element => {
|
|
215
|
+
entry.element = element;
|
|
216
|
+
section = element;
|
|
217
|
+
}, _el$13);
|
|
218
|
+
_$insert(_el$13, _$createComponent(Show, {
|
|
219
|
+
get when() {
|
|
220
|
+
return props.back;
|
|
221
|
+
},
|
|
222
|
+
children: back => (() => {
|
|
223
|
+
var _el$23 = _$getNextElement(_tmpl$8);
|
|
224
|
+
_$insert(_el$23, _$createComponent(ActionButton, {
|
|
225
|
+
get action() {
|
|
226
|
+
return {
|
|
227
|
+
icon: "chevron-left",
|
|
228
|
+
...back()
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
variant: "text",
|
|
232
|
+
titled: true
|
|
233
|
+
}));
|
|
234
|
+
return _el$23;
|
|
235
|
+
})()
|
|
236
|
+
}), _el$18, _co$5);
|
|
237
|
+
_$insert(_el$13, _$createComponent(Show, {
|
|
238
|
+
get when() {
|
|
239
|
+
return head();
|
|
240
|
+
},
|
|
241
|
+
get children() {
|
|
242
|
+
var _el$14 = _$getNextElement(_tmpl$4);
|
|
243
|
+
_$insert(_el$14, head);
|
|
244
|
+
return _el$14;
|
|
245
|
+
}
|
|
246
|
+
}), _el$20, _co$6);
|
|
247
|
+
_$insert(_el$13, _$createComponent(Show, {
|
|
248
|
+
get when() {
|
|
249
|
+
return status();
|
|
250
|
+
},
|
|
251
|
+
get children() {
|
|
252
|
+
var _el$15 = _$getNextElement(_tmpl$6);
|
|
253
|
+
_$insert(_el$15, status);
|
|
254
|
+
return _el$15;
|
|
255
|
+
}
|
|
256
|
+
}), _el$22, _co$7);
|
|
257
|
+
_$insert(_el$16, () => props.children);
|
|
258
|
+
_$effect(_p$ => {
|
|
259
|
+
var _v$4 = props.label,
|
|
260
|
+
_v$5 = props.width ? "" : undefined,
|
|
261
|
+
_v$6 = props.detail ? "" : undefined,
|
|
262
|
+
_v$7 = props.side ? "" : undefined,
|
|
263
|
+
_v$8 = custom({
|
|
264
|
+
"--k2-pane-w": props.width ? `${props.width.default}px` : undefined,
|
|
265
|
+
"--k2-pane-min": props.width ? `${props.width.min}px` : undefined
|
|
266
|
+
}),
|
|
267
|
+
_v$9 = props.scrollKey;
|
|
268
|
+
_v$4 !== _p$.e && _$setAttribute(_el$13, "aria-label", _p$.e = _v$4);
|
|
269
|
+
_v$5 !== _p$.t && _$setAttribute(_el$13, "data-width", _p$.t = _v$5);
|
|
270
|
+
_v$6 !== _p$.a && _$setAttribute(_el$13, "data-detail", _p$.a = _v$6);
|
|
271
|
+
_v$7 !== _p$.o && _$setAttribute(_el$13, "data-side", _p$.o = _v$7);
|
|
272
|
+
_p$.i = _$style(_el$13, _v$8, _p$.i);
|
|
273
|
+
_v$9 !== _p$.n && _$setAttribute(_el$16, "data-scroll-preserve", _p$.n = _v$9);
|
|
274
|
+
return _p$;
|
|
275
|
+
}, {
|
|
276
|
+
e: undefined,
|
|
277
|
+
t: undefined,
|
|
278
|
+
a: undefined,
|
|
279
|
+
o: undefined,
|
|
280
|
+
i: undefined,
|
|
281
|
+
n: undefined
|
|
282
|
+
});
|
|
283
|
+
return _el$13;
|
|
284
|
+
})();
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Panes side by side inside content: a list beside its reader, a main column beside its info column. One hairline
|
|
289
|
+
* between them; where a pane has a `width`, its line carries a grip.
|
|
290
|
+
*/
|
|
291
|
+
Pane.Split = props => {
|
|
292
|
+
const [entries, setEntries] = createSignal([]);
|
|
293
|
+
const register = entry => {
|
|
294
|
+
setEntries(list => [...list, entry]);
|
|
295
|
+
onCleanup(() => setEntries(list => list.filter(other => other !== entry)));
|
|
296
|
+
};
|
|
297
|
+
return _$createComponent(SplitContext.Provider, {
|
|
298
|
+
value: register,
|
|
299
|
+
get children() {
|
|
300
|
+
return _$createComponent(SplitBody, {
|
|
301
|
+
get entries() {
|
|
302
|
+
return entries();
|
|
303
|
+
},
|
|
304
|
+
get children() {
|
|
305
|
+
return props.children;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Renders the panes first (each registers its width), then puts a seam after every pane; the stylesheet hides the one
|
|
314
|
+
* after the last. Panes may come and go (`Show`): each takes its own seam with it, and the grips follow. Every entry
|
|
315
|
+
* of the list is the same two nodes, so nothing in it comes and goes on its own (that would not be removed cleanly
|
|
316
|
+
* after hydration). In the browser a pane's entry is found by its element, on the server by its order.
|
|
317
|
+
*/
|
|
318
|
+
const SplitBody = props => {
|
|
319
|
+
const resolved = resolveChildren(() => props.children);
|
|
320
|
+
// a pane hidden by `Show` stays in the list as nothing: it gets no seam
|
|
321
|
+
const panes = () => resolved.toArray().filter(pane => pane !== undefined && pane !== null && pane !== "");
|
|
322
|
+
const entryOf = index => {
|
|
323
|
+
const pane = panes()[index];
|
|
324
|
+
if (pane === undefined) return undefined;
|
|
325
|
+
return props.entries.find(entry => entry.element !== undefined && entry.element === pane) ?? props.entries[index];
|
|
326
|
+
};
|
|
327
|
+
// The seam after pane `index`: the pane on its right moves it if it has a width, else the pane on its left.
|
|
328
|
+
const grip = index => {
|
|
329
|
+
const left = entryOf(index);
|
|
330
|
+
const right = entryOf(index + 1);
|
|
331
|
+
if (!right) return undefined;
|
|
332
|
+
const moving = right.width ? right : left?.width ? left : undefined;
|
|
333
|
+
return moving?.width ? {
|
|
334
|
+
label: moving.label ?? "Column",
|
|
335
|
+
width: moving.width
|
|
336
|
+
} : undefined;
|
|
337
|
+
};
|
|
338
|
+
return (() => {
|
|
339
|
+
var _el$24 = _$getNextElement(_tmpl$9);
|
|
340
|
+
_$insert(_el$24, _$createComponent(For, {
|
|
341
|
+
get each() {
|
|
342
|
+
return panes();
|
|
343
|
+
},
|
|
344
|
+
children: (pane, index) => [pane, _$createComponent(Seam, {
|
|
345
|
+
get grip() {
|
|
346
|
+
return grip(index());
|
|
347
|
+
}
|
|
348
|
+
})]
|
|
349
|
+
}));
|
|
350
|
+
return _el$24;
|
|
351
|
+
})();
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// ── Bar ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* A bar of fixed height with a line below. Its height comes from its place: 56 as the head of a workspace or pane,
|
|
358
|
+
* 52 as a status row, 40 on its own. Controls in it take the height that leaves equal air above and below. The
|
|
359
|
+
* stylesheet reads the place from the slot the bar stands in, so a bar built ahead and passed on behaves the same.
|
|
360
|
+
* In a column narrower than 480 px, a bar in the flow whose start is an `Inline` wraps instead of cutting: its things
|
|
361
|
+
* and its end flow as one line, one line stays 40, and only a second line makes the bar higher.
|
|
362
|
+
*/
|
|
363
|
+
export const Bar = props => {
|
|
364
|
+
const start = resolveChildren(() => props.start);
|
|
365
|
+
const end = resolveChildren(() => props.end);
|
|
366
|
+
return (() => {
|
|
367
|
+
var _el$25 = _$getNextElement(_tmpl$10),
|
|
368
|
+
_el$28 = _el$25.firstChild,
|
|
369
|
+
[_el$29, _co$8] = _$getNextMarker(_el$28.nextSibling),
|
|
370
|
+
_el$30 = _el$29.nextSibling,
|
|
371
|
+
[_el$31, _co$9] = _$getNextMarker(_el$30.nextSibling);
|
|
372
|
+
_$insert(_el$25, _$createComponent(Show, {
|
|
373
|
+
get when() {
|
|
374
|
+
return start() !== undefined;
|
|
375
|
+
},
|
|
376
|
+
get children() {
|
|
377
|
+
var _el$26 = _$getNextElement(_tmpl$0);
|
|
378
|
+
_$insert(_el$26, start);
|
|
379
|
+
return _el$26;
|
|
380
|
+
}
|
|
381
|
+
}), _el$29, _co$8);
|
|
382
|
+
_$insert(_el$25, _$createComponent(Show, {
|
|
383
|
+
get when() {
|
|
384
|
+
return end() !== undefined;
|
|
385
|
+
},
|
|
386
|
+
get children() {
|
|
387
|
+
var _el$27 = _$getNextElement(_tmpl$1);
|
|
388
|
+
_$insert(_el$27, end);
|
|
389
|
+
return _el$27;
|
|
390
|
+
}
|
|
391
|
+
}), _el$31, _co$9);
|
|
392
|
+
return _el$25;
|
|
393
|
+
})();
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
// ── Band ─────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
397
|
+
|
|
398
|
+
/** A band of free height with one line below, from edge to edge. What stands in it draws no line of its own. */
|
|
399
|
+
export const Band = props => (() => {
|
|
400
|
+
var _el$32 = _$getNextElement(_tmpl$11);
|
|
401
|
+
_$insert(_el$32, () => props.children);
|
|
402
|
+
_$effect(_p$ => {
|
|
403
|
+
var _v$0 = props.tone,
|
|
404
|
+
_v$1 = props.label;
|
|
405
|
+
_v$0 !== _p$.e && _$setAttribute(_el$32, "data-tone", _p$.e = _v$0);
|
|
406
|
+
_v$1 !== _p$.t && _$setAttribute(_el$32, "aria-label", _p$.t = _v$1);
|
|
407
|
+
return _p$;
|
|
408
|
+
}, {
|
|
409
|
+
e: undefined,
|
|
410
|
+
t: undefined
|
|
411
|
+
});
|
|
412
|
+
return _el$32;
|
|
413
|
+
})();
|
|
414
|
+
|
|
415
|
+
// ── Cells ────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
416
|
+
|
|
417
|
+
/** Two to four equal cells side by side with a line between them; one under the other on the phone. */
|
|
418
|
+
export const Cells = props => (() => {
|
|
419
|
+
var _el$33 = _$getNextElement(_tmpl$12);
|
|
420
|
+
_$insert(_el$33, () => props.children);
|
|
421
|
+
return _el$33;
|
|
422
|
+
})();
|
|
423
|
+
Cells.Cell = props => {
|
|
424
|
+
const meta = resolveChildren(() => props.meta);
|
|
425
|
+
return (// a cell that leads somewhere: its label is the link, stretched over the cell, so a value may hold its own controls
|
|
426
|
+
(() => {
|
|
427
|
+
var _el$34 = _$getNextElement(_tmpl$15),
|
|
428
|
+
_el$39 = _el$34.firstChild,
|
|
429
|
+
[_el$40, _co$0] = _$getNextMarker(_el$39.nextSibling),
|
|
430
|
+
_el$35 = _el$40.nextSibling,
|
|
431
|
+
_el$41 = _el$35.nextSibling,
|
|
432
|
+
[_el$42, _co$1] = _$getNextMarker(_el$41.nextSibling),
|
|
433
|
+
_el$37 = _el$42.nextSibling,
|
|
434
|
+
_el$43 = _el$37.nextSibling,
|
|
435
|
+
[_el$44, _co$10] = _$getNextMarker(_el$43.nextSibling);
|
|
436
|
+
_$insert(_el$34, _$createComponent(Icon, {
|
|
437
|
+
get name() {
|
|
438
|
+
return props.icon;
|
|
439
|
+
}
|
|
440
|
+
}), _el$40, _co$0);
|
|
441
|
+
_$insert(_el$35, _$createComponent(RowOpen, {
|
|
442
|
+
get href() {
|
|
443
|
+
return props.href;
|
|
444
|
+
},
|
|
445
|
+
get children() {
|
|
446
|
+
return props.label;
|
|
447
|
+
}
|
|
448
|
+
}));
|
|
449
|
+
_$insert(_el$34, _$createComponent(Show, {
|
|
450
|
+
get when() {
|
|
451
|
+
return props.href;
|
|
452
|
+
},
|
|
453
|
+
get fallback() {
|
|
454
|
+
return _$getNextElement(_tmpl$16);
|
|
455
|
+
},
|
|
456
|
+
get children() {
|
|
457
|
+
return _$getNextElement(_tmpl$13);
|
|
458
|
+
}
|
|
459
|
+
}), _el$42, _co$1);
|
|
460
|
+
_$insert(_el$37, () => props.value);
|
|
461
|
+
_$insert(_el$34, _$createComponent(Show, {
|
|
462
|
+
get when() {
|
|
463
|
+
return meta() !== undefined;
|
|
464
|
+
},
|
|
465
|
+
get children() {
|
|
466
|
+
var _el$38 = _$getNextElement(_tmpl$14);
|
|
467
|
+
_$insert(_el$38, meta);
|
|
468
|
+
return _el$38;
|
|
469
|
+
}
|
|
470
|
+
}), _el$44, _co$10);
|
|
471
|
+
_$effect(_p$ => {
|
|
472
|
+
var _v$10 = props.href !== undefined ? "" : undefined,
|
|
473
|
+
_v$11 = custom({
|
|
474
|
+
"--k2-c": props.color
|
|
475
|
+
});
|
|
476
|
+
_v$10 !== _p$.e && _$setAttribute(_el$34, "data-open", _p$.e = _v$10);
|
|
477
|
+
_p$.t = _$style(_el$34, _v$11, _p$.t);
|
|
478
|
+
return _p$;
|
|
479
|
+
}, {
|
|
480
|
+
e: undefined,
|
|
481
|
+
t: undefined
|
|
482
|
+
});
|
|
483
|
+
return _el$34;
|
|
484
|
+
})()
|
|
485
|
+
);
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
// ── Tiles ────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
489
|
+
|
|
490
|
+
/** Like things side by side, such as attachments. Each is pressed, so each is round; never nested. */
|
|
491
|
+
|
|
492
|
+
export const Tiles = props => (() => {
|
|
493
|
+
var _el$46 = _$getNextElement(_tmpl$17),
|
|
494
|
+
_el$47 = _el$46.firstChild,
|
|
495
|
+
[_el$48, _co$11] = _$getNextMarker(_el$47.nextSibling),
|
|
496
|
+
_el$49 = _el$48.nextSibling,
|
|
497
|
+
[_el$50, _co$12] = _$getNextMarker(_el$49.nextSibling);
|
|
498
|
+
_$insert(_el$46, _$createComponent(For, {
|
|
499
|
+
get each() {
|
|
500
|
+
return props.items;
|
|
501
|
+
},
|
|
502
|
+
children: tile => (() => {
|
|
503
|
+
var _el$51 = _$getNextElement(_tmpl$19),
|
|
504
|
+
_el$57 = _el$51.firstChild,
|
|
505
|
+
[_el$58, _co$14] = _$getNextMarker(_el$57.nextSibling),
|
|
506
|
+
_el$52 = _el$58.nextSibling,
|
|
507
|
+
_el$53 = _el$52.firstChild,
|
|
508
|
+
_el$55 = _el$53.nextSibling,
|
|
509
|
+
[_el$56, _co$13] = _$getNextMarker(_el$55.nextSibling);
|
|
510
|
+
_$insert(_el$51, _$createComponent(Icon, {
|
|
511
|
+
get name() {
|
|
512
|
+
return tile.icon;
|
|
513
|
+
}
|
|
514
|
+
}), _el$58, _co$14);
|
|
515
|
+
_$insert(_el$53, _$createComponent(RowOpen, {
|
|
516
|
+
get href() {
|
|
517
|
+
return tile.href;
|
|
518
|
+
},
|
|
519
|
+
get children() {
|
|
520
|
+
return tile.title;
|
|
521
|
+
}
|
|
522
|
+
}));
|
|
523
|
+
_$insert(_el$52, _$createComponent(Show, {
|
|
524
|
+
get when() {
|
|
525
|
+
return tile.meta;
|
|
526
|
+
},
|
|
527
|
+
get children() {
|
|
528
|
+
var _el$54 = _$getNextElement(_tmpl$18);
|
|
529
|
+
_$insert(_el$54, () => tile.meta);
|
|
530
|
+
return _el$54;
|
|
531
|
+
}
|
|
532
|
+
}), _el$56, _co$13);
|
|
533
|
+
_$effect(() => _$setAttribute(_el$51, "data-open", tile.href !== undefined ? "" : undefined));
|
|
534
|
+
return _el$51;
|
|
535
|
+
})()
|
|
536
|
+
}), _el$48, _co$11);
|
|
537
|
+
_$insert(_el$46, _$createComponent(Show, {
|
|
538
|
+
get when() {
|
|
539
|
+
return props.more;
|
|
540
|
+
},
|
|
541
|
+
children: more => _$createComponent(ActionButton, {
|
|
542
|
+
get action() {
|
|
543
|
+
return more();
|
|
544
|
+
},
|
|
545
|
+
variant: "text"
|
|
546
|
+
})
|
|
547
|
+
}), _el$50, _co$12);
|
|
548
|
+
_$effect(() => _$setAttribute(_el$46, "aria-label", props.label));
|
|
549
|
+
return _el$46;
|
|
550
|
+
})();
|
|
551
|
+
|
|
552
|
+
// ── Canvas ───────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* The one way out: a surface with its own drawing, where an app may write its own CSS. Never measured by the rules.
|
|
556
|
+
* It draws no line of its own; the structure around it separates it, and a drawing that needs an edge draws it.
|
|
557
|
+
*/
|
|
558
|
+
export const Canvas = props => (() => {
|
|
559
|
+
var _el$59 = _$getNextElement(_tmpl$20);
|
|
560
|
+
_$insert(_el$59, () => props.children);
|
|
561
|
+
_$effect(_p$ => {
|
|
562
|
+
var _v$12 = props.label,
|
|
563
|
+
_v$13 = props.height !== undefined ? "" : undefined,
|
|
564
|
+
_v$14 = custom({
|
|
565
|
+
"--k2-canvas-h": props.height !== undefined ? `${props.height}px` : undefined
|
|
566
|
+
});
|
|
567
|
+
_v$12 !== _p$.e && _$setAttribute(_el$59, "aria-label", _p$.e = _v$12);
|
|
568
|
+
_v$13 !== _p$.t && _$setAttribute(_el$59, "data-height", _p$.t = _v$13);
|
|
569
|
+
_p$.a = _$style(_el$59, _v$14, _p$.a);
|
|
570
|
+
return _p$;
|
|
571
|
+
}, {
|
|
572
|
+
e: undefined,
|
|
573
|
+
t: undefined,
|
|
574
|
+
a: undefined
|
|
575
|
+
});
|
|
576
|
+
return _el$59;
|
|
577
|
+
})();
|
|
578
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["v2/layout.tsx"],"sourcesContent":["import { createContext, createSignal, For, type JSX, onCleanup, onMount, children as resolveChildren, Show, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { ActionButton } from \"./button\";\nimport { RowOpen } from \"./content\";\nimport { linkOr } from \"./link\";\nimport { custom, Icon } from \"./marks\";\nimport type { Action, Width } from \"./types\";\n\n// ── Grip ─────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n/**\n * The seam between two columns: the one 1 px line, and on a line that moves its grip. The grip is the shape only;\n * dragging and the keyboard come with the behaviour layer.\n */\nconst Seam = (props: { grip?: { label: string; width: Width } }) => (\n <div class=\"k2-seam\" aria-hidden={props.grip ? undefined : \"true\"}>\n <Show when={props.grip}>\n {(grip) => (\n <span\n class=\"k2-grip\"\n data-k2-grip=\"\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n aria-label={grip().label}\n aria-valuemin={grip().width.min}\n aria-valuenow={grip().width.default}\n />\n )}\n </Show>\n </div>\n);\n\n// ── Workspace ────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type WorkspaceProps = {\n /** The sidebar column, such as `Nav`. */\n sidebar?: JSX.Element;\n /** The sidebar's minimum and default width; 200 and 248 px when not set. */\n sidebarWidth?: Width;\n /** The name of the sidebar's grip, such as \"Width of the sidebar\". */\n sidebarLabel?: string;\n /** The head across the main column: a `Bar` (56 px here) with tabs or a path and the actions. */\n head?: JSX.Element;\n /** The main action; on the phone it floats at the bottom right. */\n primary?: Action;\n /** A `Pane` or `Pane.Split`. */\n children: JSX.Element;\n};\n\nconst sidebarDefault: Width = { min: 200, default: 248 };\n\n/**\n * The working surface of an app: a sidebar, a head and the columns below it, with one hairline between columns and\n * a grip on every line that moves. On the phone the sidebar leaves and columns become pages.\n */\nexport const Workspace = (props: WorkspaceProps) => {\n const width = () => props.sidebarWidth ?? sidebarDefault;\n // A part passed as JSX is made once, here, and read from here: reading the prop again would make it again (the\n // server's `Show` reads `when` more than once), and the browser would look for nodes the server never sent.\n const sidebar = resolveChildren(() => props.sidebar);\n const head = resolveChildren(() => props.head);\n return (\n <div\n class=\"k2-ws\"\n data-k2-workspace=\"\"\n data-k2-part=\"Workspace\"\n style={custom({ \"--k2-ws-side\": `${width().default}px`, \"--k2-ws-side-min\": `${width().min}px` })}\n >\n <Show when={sidebar()}>\n <aside class=\"k2-ws-side\" data-k2-column=\"\">\n {sidebar()}\n </aside>\n <Seam grip={{ label: props.sidebarLabel ?? \"Sidebar\", width: width() }} />\n </Show>\n <div class=\"k2-ws-main\" data-k2-column=\"\">\n <Show when={head()}>\n <div class=\"k2-slot\" data-slot=\"head\">\n {head()}\n </div>\n </Show>\n {props.children}\n </div>\n <Show when={props.primary}>\n {(action) => (\n <Dynamic\n component={linkOr(action().href, \"button\")}\n type={action().href !== undefined ? undefined : \"button\"}\n class=\"k2-btn k2-fab\"\n data-variant=\"primary\"\n href={action().href}\n onNavigate={action().href !== undefined ? action().onNavigate : undefined}\n onClick={() => action().onClick?.()}\n >\n <Show when={action().icon}>{(name) => <Icon name={name()} />}</Show>\n {action().label}\n </Dynamic>\n )}\n </Show>\n </div>\n );\n};\n\n// ── Pane and Pane.Split ──────────────────────────────────────────────────────────────────────────────────────────\n\ntype SplitEntry = { readonly width?: Width; readonly label?: string; element?: HTMLElement };\n/** A pane inside a split registers its width and name for the seam beside it, for as long as it exists. */\nconst SplitContext = createContext<(entry: SplitEntry) => void>();\n\nexport type PaneProps = {\n /** The head of this column: a `Bar` (56 px; 52 px for a reader beside a list) or `Tabs`. */\n head?: JSX.Element;\n /** The status row of this column (52 px), such as `StatusRow`. */\n status?: JSX.Element;\n /** A column that can be dragged wider: its minimum and default width. Only inside `Pane.Split`. */\n width?: Width;\n /** The name of the column and of its grip, such as \"List\". */\n label?: string;\n /**\n * The detail of a list (a reader): beside the list on a wide screen. On the phone, while it is there (something is\n * open), it is the page and the list gives way; render it only while something is open. What is open belongs in\n * the address, so reload, back and forward show the same. A detail that closes in place hands the focus back to\n * what opened it, such as the row.\n */\n detail?: boolean;\n /**\n * The way back to the list on the phone, where the detail is a page of its own, such as \"Posteingang\". Give it an\n * `href`: the address of the list without the open entry. While it is there, the head of the workspace gives way on\n * the phone, so the way back is the one bar above the detail; it is the part `Back`, which a shell may show in its\n * own bar instead.\n */\n back?: Action;\n /** The side column of a record (the info column): quieter sections. */\n side?: boolean;\n /**\n * A name under which the page keeps this column's scroll position, such as \"mail-list\": back and forward bring\n * the list back where it was (the page restores every `data-scroll-preserve` region, as v1's `ScrollArea` does).\n */\n scrollKey?: string;\n /** Bands, rows, sections; the pane pads nothing. */\n children?: JSX.Element;\n};\n\n/** A column that scrolls. It has no padding and no gutter, so every band in it reaches both edges. */\nexport const Pane = (props: PaneProps) => {\n const entry: SplitEntry = {\n get width() {\n return props.width;\n },\n get label() {\n return props.label;\n },\n };\n useContext(SplitContext)?.(entry);\n const head = resolveChildren(() => props.head);\n const status = resolveChildren(() => props.status);\n let section: HTMLElement | undefined;\n // A detail appears because something opened it, which then has the focus (the row). When the detail goes while the\n // focus is in it (its way back, its close button), the focus returns there instead of falling to the page.\n onMount(() => {\n if (!props.detail) return;\n const opener = document.activeElement;\n if (!(opener instanceof HTMLElement) || opener === document.body || section?.contains(opener)) return;\n onCleanup(() => {\n const inside = section?.contains(document.activeElement) ?? false;\n queueMicrotask(() => {\n const lost = inside || document.activeElement === null || document.activeElement === document.body;\n if (lost && opener.isConnected) opener.focus();\n });\n });\n });\n return (\n <section\n ref={(element) => {\n entry.element = element;\n section = element;\n }}\n class=\"k2-pane\"\n data-k2-part=\"Pane\"\n data-k2-column=\"\"\n aria-label={props.label}\n data-width={props.width ? \"\" : undefined}\n data-detail={props.detail ? \"\" : undefined}\n data-side={props.side ? \"\" : undefined}\n style={custom({\n \"--k2-pane-w\": props.width ? `${props.width.default}px` : undefined,\n \"--k2-pane-min\": props.width ? `${props.width.min}px` : undefined,\n })}\n >\n {/* the way back shows only on the phone, above the head of the detail; a public part, so a shell can find it */}\n <Show when={props.back}>\n {(back) => (\n <div class=\"k2-pane-back\" data-k2-part=\"Back\">\n {/* a long name is cut with \"…\"; the whole name is the hint under the pointer */}\n <ActionButton action={{ icon: \"chevron-left\", ...back() }} variant=\"text\" titled />\n </div>\n )}\n </Show>\n <Show when={head()}>\n <div class=\"k2-slot\" data-slot=\"head\">\n {head()}\n </div>\n </Show>\n <Show when={status()}>\n <div class=\"k2-slot\" data-slot=\"status\">\n {status()}\n </div>\n </Show>\n <div class=\"k2-scroll\" data-scroll-preserve={props.scrollKey}>\n {props.children}\n </div>\n </section>\n );\n};\n\n/**\n * Panes side by side inside content: a list beside its reader, a main column beside its info column. One hairline\n * between them; where a pane has a `width`, its line carries a grip.\n */\nPane.Split = (props: { children: JSX.Element }) => {\n const [entries, setEntries] = createSignal<readonly SplitEntry[]>([]);\n const register = (entry: SplitEntry) => {\n setEntries((list) => [...list, entry]);\n onCleanup(() => setEntries((list) => list.filter((other) => other !== entry)));\n };\n return (\n <SplitContext.Provider value={register}>\n <SplitBody entries={entries()}>{props.children}</SplitBody>\n </SplitContext.Provider>\n );\n};\n\n/**\n * Renders the panes first (each registers its width), then puts a seam after every pane; the stylesheet hides the one\n * after the last. Panes may come and go (`Show`): each takes its own seam with it, and the grips follow. Every entry\n * of the list is the same two nodes, so nothing in it comes and goes on its own (that would not be removed cleanly\n * after hydration). In the browser a pane's entry is found by its element, on the server by its order.\n */\nconst SplitBody = (props: { entries: readonly SplitEntry[]; children: JSX.Element }) => {\n const resolved = resolveChildren(() => props.children);\n // a pane hidden by `Show` stays in the list as nothing: it gets no seam\n const panes = () => resolved.toArray().filter((pane) => pane !== undefined && pane !== null && pane !== \"\");\n const entryOf = (index: number) => {\n const pane = panes()[index];\n if (pane === undefined) return undefined;\n return props.entries.find((entry) => entry.element !== undefined && entry.element === pane) ?? props.entries[index];\n };\n // The seam after pane `index`: the pane on its right moves it if it has a width, else the pane on its left.\n const grip = (index: number) => {\n const left = entryOf(index);\n const right = entryOf(index + 1);\n if (!right) return undefined;\n const moving = right.width ? right : left?.width ? left : undefined;\n return moving?.width ? { label: moving.label ?? \"Column\", width: moving.width } : undefined;\n };\n return (\n <div class=\"k2-split\" data-k2-part=\"Pane.Split\">\n <For each={panes()}>\n {(pane, index) => (\n <>\n {pane}\n <Seam grip={grip(index())} />\n </>\n )}\n </For>\n </div>\n );\n};\n\n// ── Bar ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type BarProps = {\n /** The start place: a title, a path, tabs, an inline line. */\n start?: JSX.Element;\n /** The end place: buttons, a search, a person. */\n end?: JSX.Element;\n};\n\n/**\n * A bar of fixed height with a line below. Its height comes from its place: 56 as the head of a workspace or pane,\n * 52 as a status row, 40 on its own. Controls in it take the height that leaves equal air above and below. The\n * stylesheet reads the place from the slot the bar stands in, so a bar built ahead and passed on behaves the same.\n * In a column narrower than 480 px, a bar in the flow whose start is an `Inline` wraps instead of cutting: its things\n * and its end flow as one line, one line stays 40, and only a second line makes the bar higher.\n */\nexport const Bar = (props: BarProps) => {\n const start = resolveChildren(() => props.start);\n const end = resolveChildren(() => props.end);\n return (\n <div class=\"k2-bar\" data-k2-part=\"Bar\">\n <Show when={start() !== undefined}>\n <div class=\"k2-bar-start\">{start()}</div>\n </Show>\n <Show when={end() !== undefined}>\n <div class=\"k2-bar-end\">{end()}</div>\n </Show>\n </div>\n );\n};\n\n// ── Band ─────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type BandProps = {\n /** A tone only by meaning: a note, AI, \"yours\", wrong, waiting. */\n tone?: \"note\" | \"ai\" | \"yours\" | \"bad\" | \"warn\";\n label?: string;\n children: JSX.Element;\n};\n\n/** A band of free height with one line below, from edge to edge. What stands in it draws no line of its own. */\nexport const Band = (props: BandProps) => (\n <section class=\"k2-band\" data-k2-part=\"Band\" data-tone={props.tone} aria-label={props.label}>\n {props.children}\n </section>\n);\n\n// ── Cells ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type CellProps = {\n icon: string;\n /** The data colour of the symbol, such as the colour of an area. */\n color?: string;\n label: string;\n value: JSX.Element;\n /** A quiet line under the value. */\n meta?: JSX.Element;\n /** The cell leads to this page: a chevron at its end. */\n href?: string;\n};\n\n/** Two to four equal cells side by side with a line between them; one under the other on the phone. */\nexport const Cells = (props: { children: JSX.Element }) => (\n <div class=\"k2-cells\" data-k2-part=\"Cells\">\n {props.children}\n </div>\n);\n\nCells.Cell = (props: CellProps) => {\n const meta = resolveChildren(() => props.meta);\n return (\n // a cell that leads somewhere: its label is the link, stretched over the cell, so a value may hold its own controls\n <div\n class=\"k2-cell\"\n data-k2-part=\"Cells.Cell\"\n data-open={props.href !== undefined ? \"\" : undefined}\n style={custom({ \"--k2-c\": props.color })}\n >\n <Icon name={props.icon} />\n <span class=\"k2-cell-label\">\n <RowOpen href={props.href}>{props.label}</RowOpen>\n </span>\n <Show when={props.href} fallback={<span />}>\n <i class=\"ti ti-chevron-right k2-icon k2-cell-go\" aria-hidden=\"true\" />\n </Show>\n <span class=\"k2-cell-value\">{props.value}</span>\n <Show when={meta() !== undefined}>\n <span class=\"k2-cell-meta\">{meta()}</span>\n </Show>\n </div>\n );\n};\n\n// ── Tiles ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type Tile = { icon: string; title: string; meta?: string; href?: string };\n\n/** Like things side by side, such as attachments. Each is pressed, so each is round; never nested. */\nexport type TilesProps = { items: readonly Tile[]; more?: Action; label?: string };\n\nexport const Tiles = (props: TilesProps) => (\n <div class=\"k2-tiles\" data-k2-part=\"Tiles\" role=\"list\" aria-label={props.label}>\n <For each={props.items}>\n {(tile) => (\n <div class=\"k2-tile\" role=\"listitem\" data-open={tile.href !== undefined ? \"\" : undefined}>\n <Icon name={tile.icon} />\n <span>\n <span class=\"k2-tile-title\">\n <RowOpen href={tile.href}>{tile.title}</RowOpen>\n </span>\n <Show when={tile.meta}>\n <span class=\"k2-t-meta\">{tile.meta}</span>\n </Show>\n </span>\n </div>\n )}\n </For>\n <Show when={props.more}>{(more) => <ActionButton action={more()} variant=\"text\" />}</Show>\n </div>\n);\n\n// ── Canvas ───────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type CanvasProps = {\n /** What the drawing shows, for assistive technology. */\n label: string;\n /** The height of the drawing in px; the width comes from its place. */\n height?: number;\n children: JSX.Element;\n};\n\n/**\n * The one way out: a surface with its own drawing, where an app may write its own CSS. Never measured by the rules.\n * It draws no line of its own; the structure around it separates it, and a drawing that needs an edge draws it.\n */\nexport const Canvas = (props: CanvasProps) => (\n <div\n class=\"k2-canvas\"\n data-k2-part=\"Canvas\"\n data-k2-canvas=\"\"\n role=\"group\"\n aria-label={props.label}\n data-height={props.height !== undefined ? \"\" : undefined}\n style={custom({ \"--k2-canvas-h\": props.height !== undefined ? `${props.height}px` : undefined })}\n >\n {props.children}\n </div>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa,EAAE,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,IAAI,EAAE,UAAU,QAAQ,UAAU;AACxI,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,YAAY,QAAQ,UAAU;AACvC,SAAS,OAAO,QAAQ,WAAW;AACnC,SAAS,MAAM,QAAQ,QAAQ;AAC/B,SAAS,MAAM,EAAE,IAAI,QAAQ,SAAS;AAGtC;;AAEA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAI,KAAiD;EAAA;EAAA,iCAE1D,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAA,UAClB,IAAI;MAAA;MAAA;QAAA,UAOU,IAAI,CAAC,CAAC,CAAC,KAAK;UAAA,OACT,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG;UAAA,OAChB,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO;QAAA;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;MAAA;IAAA;EAEtC;EAAA,mDAb6B,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM;EAAA;AAAA,IAgBlE;;AAED;;AAiBA,MAAM,cAAqB,GAAG;EAAE,GAAG,EAAE,GAAG;EAAE,OAAO,EAAE;AAAI,CAAC;;AAExD;AACA;AACA;AACA;AACA,OAAO,MAAM,SAAS,GAAI,KAAqB,IAAK;EAClD,MAAM,KAAK,GAAG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,IAkB/E;;AAED;;AAUA;AACA;AACA;AACA;AACA,OAAO,MAAM,MAAM,GAAI,KAAkB;EAAA;EAAA,uBAUpC,KAAK,CAAC,QAAQ;EAAA;IAAA,YAJH,KAAK,CAAC,KAAK;MAAA,QACV,KAAK,CAAC,MAAM,KAAK,SAAS,GAAG,EAAE,GAAG,SAAS;MAAA,QACjD,MAAM,CAAC;QAAE,eAAe,EAAE,KAAK,CAAC,MAAM,KAAK,SAAS,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG;MAAU,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;AAAA,IAInG","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Link } from "@k2b/ssr/nav";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The element of something pressable (internal): a link renders `@k2b/ssr/nav`'s `Link`, so `onNavigate` follows its
|
|
5
|
+
* one contract (plain same-origin clicks only, a pending page swap cancelled, history through the event); anything
|
|
6
|
+
* else renders the given element.
|
|
7
|
+
*/
|
|
8
|
+
export const linkOr = (href, otherwise) => href !== undefined ? Link : otherwise;
|
|
9
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["v2/link.ts"],"sourcesContent":["import { Link } from \"@k2b/ssr/nav\";\n\n/**\n * The element of something pressable (internal): a link renders `@k2b/ssr/nav`'s `Link`, so `onNavigate` follows its\n * one contract (plain same-origin clicks only, a pending page swap cancelled, history through the event); anything\n * else renders the given element.\n */\nexport const linkOr = <const T extends \"a\" | \"button\" | \"span\">(href: string | undefined, otherwise: T): typeof Link | T =>\n href !== undefined ? Link : otherwise;\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,MAAM,GAAG,CAA0C,IAAwB,EAAE,SAAY,KACpG,IAAI,KAAK,SAAS,GAAG,IAAI,GAAG,SAAS","ignoreList":[]}
|