@ptbdynamic/plinth 0.1.1 → 0.2.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 +1 -1
- package/package.json +1 -1
- package/packages/css/dist/menu.css +245 -0
- package/packages/css/dist/page-header.css +124 -0
- package/packages/css/dist/plinth.css +833 -160
- package/packages/css/dist/section-menu.css +6 -5
- package/packages/css/dist/text-field.css +230 -0
- package/packages/css/dist/textarea.css +169 -0
- package/packages/css/dist/tokens.css +9 -1
- package/packages/react/dist/PlinthMenu.d.ts +12 -0
- package/packages/react/dist/PlinthMenuGroup.d.ts +9 -0
- package/packages/react/dist/PlinthMenuItem.d.ts +26 -0
- package/packages/react/dist/PlinthMenuSeparator.d.ts +4 -0
- package/packages/react/dist/PlinthPageHeader.d.ts +17 -0
- package/packages/react/dist/PlinthTextField.d.ts +24 -0
- package/packages/react/dist/PlinthTextarea.d.ts +24 -0
- package/packages/react/dist/index.d.ts +10 -1
- package/packages/react/dist/index.js +565 -366
- package/packages/react/dist/menu.d.ts +7 -0
- package/packages/react/dist/page-header.d.ts +5 -0
- package/packages/react/dist/text-field.d.ts +10 -0
- package/packages/tokens/dist/index.d.ts +13 -1
- package/packages/tokens/dist/index.js +131 -6
- package/packages/tokens/dist/tailwind-theme.css +2 -2
- package/packages/tokens/dist/tokens.css +9 -1
- package/packages/tokens/dist/tokens.json +116 -3
- package/packages/vue/dist/PlinthMenu.vue.d.ts +24 -0
- package/packages/vue/dist/{PlinthHeader.vue.d.ts → PlinthMenuGroup.vue.d.ts} +5 -7
- package/packages/vue/dist/PlinthMenuItem.vue.d.ts +34 -0
- package/packages/vue/dist/PlinthMenuSeparator.vue.d.ts +3 -0
- package/packages/vue/dist/PlinthPageHeader.vue.d.ts +27 -0
- package/packages/vue/dist/PlinthTextField.vue.d.ts +51 -0
- package/packages/vue/dist/PlinthTextarea.vue.d.ts +42 -0
- package/packages/vue/dist/index.d.ts +11 -2
- package/packages/vue/dist/index.js +661 -368
- package/packages/vue/dist/menu.d.ts +8 -0
- package/packages/vue/dist/page-header.d.ts +5 -0
- package/packages/vue/dist/text-field.d.ts +10 -0
- package/packages/react/dist/PlinthHeader.d.ts +0 -12
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { Fragment as e,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { Fragment as e, createContext as t, isValidElement as n, use as r, useCallback as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
//#region src/size.ts
|
|
4
|
-
var
|
|
4
|
+
var f = [
|
|
5
5
|
"xs",
|
|
6
6
|
"sm",
|
|
7
7
|
"md",
|
|
8
8
|
"lg",
|
|
9
9
|
"xl"
|
|
10
|
-
],
|
|
10
|
+
], p = [
|
|
11
11
|
"sm",
|
|
12
12
|
"md",
|
|
13
13
|
"lg"
|
|
14
14
|
];
|
|
15
|
-
function
|
|
15
|
+
function m(e, t, n) {
|
|
16
16
|
return t.includes(e) ? e : n;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function h(e) {
|
|
19
19
|
return e === "xs" || e === "sm" ? "sm" : "md";
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/avatar.ts
|
|
23
|
-
var
|
|
23
|
+
var g = [
|
|
24
24
|
"sm",
|
|
25
25
|
"md",
|
|
26
26
|
"lg",
|
|
27
27
|
"xl"
|
|
28
28
|
];
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function _(e) {
|
|
30
|
+
return m(e, g, "md");
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function v(e) {
|
|
33
33
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
34
34
|
return t.length === 0 ? "" : ([...t[0]][0] + (t.length > 1 ? [...t.at(-1)][0] : "")).toUpperCase();
|
|
35
35
|
}
|
|
36
|
-
var
|
|
36
|
+
var y = "<svg class=\"plinth-avatar-glyph\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"9\" r=\"4\"></circle><path d=\"M4.5 20a7.5 7.5 0 0 1 15 0\"></path></svg>", b = (e, t) => t?.trim() ? `${e} ${t.trim()}` : e, x = (t) => t == null || typeof t == "boolean" ? !1 : typeof t == "string" ? t.trim() !== "" : Array.isArray(t) ? t.some(x) : n(t) && t.type === e ? x(t.props.children) : !0, S = [
|
|
37
37
|
"neutral",
|
|
38
38
|
"success",
|
|
39
39
|
"warning",
|
|
40
40
|
"danger"
|
|
41
41
|
];
|
|
42
|
-
function
|
|
43
|
-
return
|
|
42
|
+
function C(e) {
|
|
43
|
+
return S.includes(e) ? e : S[0];
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/PlinthAvatar.tsx
|
|
47
|
-
function
|
|
48
|
-
let f =
|
|
49
|
-
return
|
|
50
|
-
s || process.env.NODE_ENV === "production" || (e.trim() || console.warn("PlinthAvatar needs a name, or decorative when the name is shown next to it."),
|
|
47
|
+
function w({ name: e = "", src: t, initials: n, size: r, status: i, statusLabel: o, decorative: s = !1, className: c, ...l }) {
|
|
48
|
+
let f = i ? C(i) : void 0, p = s ? void 0 : f && o ? `${e}, ${o}` : e, m = n ?? v(e);
|
|
49
|
+
return a(() => {
|
|
50
|
+
s || process.env.NODE_ENV === "production" || (e.trim() || console.warn("PlinthAvatar needs a name, or decorative when the name is shown next to it."), i && !o && console.warn("PlinthAvatar needs a statusLabel with a status: colour alone does not say what it means."));
|
|
51
51
|
}, [
|
|
52
52
|
s,
|
|
53
53
|
e,
|
|
54
|
-
|
|
54
|
+
i,
|
|
55
55
|
o
|
|
56
|
-
]), /* @__PURE__ */
|
|
57
|
-
"data-size":
|
|
56
|
+
]), /* @__PURE__ */ d("span", {
|
|
57
|
+
"data-size": _(r),
|
|
58
58
|
role: p === void 0 ? void 0 : "img",
|
|
59
59
|
"aria-label": p,
|
|
60
60
|
"aria-hidden": s ? "true" : void 0,
|
|
61
|
-
...
|
|
62
|
-
className:
|
|
63
|
-
children: [t ? /* @__PURE__ */
|
|
61
|
+
...l,
|
|
62
|
+
className: b("plinth-avatar", c),
|
|
63
|
+
children: [t ? /* @__PURE__ */ u("img", {
|
|
64
64
|
className: "plinth-avatar-image",
|
|
65
65
|
src: t,
|
|
66
66
|
alt: ""
|
|
67
|
-
}) : m ? /* @__PURE__ */
|
|
67
|
+
}) : m ? /* @__PURE__ */ u("span", {
|
|
68
68
|
className: "plinth-avatar-initials",
|
|
69
69
|
"aria-hidden": "true",
|
|
70
70
|
children: m
|
|
71
|
-
}) : /* @__PURE__ */
|
|
71
|
+
}) : /* @__PURE__ */ d("svg", {
|
|
72
72
|
className: "plinth-avatar-glyph",
|
|
73
73
|
viewBox: "0 0 24 24",
|
|
74
74
|
fill: "none",
|
|
@@ -76,12 +76,12 @@ function S({ name: e = "", src: t, initials: n, size: i, status: a, statusLabel:
|
|
|
76
76
|
strokeWidth: "1.5",
|
|
77
77
|
strokeLinecap: "round",
|
|
78
78
|
"aria-hidden": "true",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
80
80
|
cx: "12",
|
|
81
81
|
cy: "9",
|
|
82
82
|
r: "4"
|
|
83
|
-
}), /* @__PURE__ */
|
|
84
|
-
}), f ? /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ u("path", { d: "M4.5 20a7.5 7.5 0 0 1 15 0" })]
|
|
84
|
+
}), f ? /* @__PURE__ */ u("span", {
|
|
85
85
|
className: "plinth-avatar-status",
|
|
86
86
|
"data-tone": f,
|
|
87
87
|
"aria-hidden": "true"
|
|
@@ -90,15 +90,15 @@ function S({ name: e = "", src: t, initials: n, size: i, status: a, statusLabel:
|
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/PlinthBadge.tsx
|
|
93
|
-
function
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
"data-tone":
|
|
93
|
+
function T({ tone: e, dot: t = !1, className: n, children: r, ...i }) {
|
|
94
|
+
return /* @__PURE__ */ d("span", {
|
|
95
|
+
"data-tone": C(e),
|
|
96
96
|
...i,
|
|
97
|
-
className:
|
|
98
|
-
children: [t ? /* @__PURE__ */
|
|
97
|
+
className: b("plinth-badge", n),
|
|
98
|
+
children: [t ? /* @__PURE__ */ u("span", {
|
|
99
99
|
className: "plinth-badge-dot",
|
|
100
100
|
"aria-hidden": "true"
|
|
101
|
-
}) : null, /* @__PURE__ */
|
|
101
|
+
}) : null, /* @__PURE__ */ u("span", {
|
|
102
102
|
className: "plinth-badge-label",
|
|
103
103
|
children: r
|
|
104
104
|
})]
|
|
@@ -106,7 +106,7 @@ function C({ tone: e, dot: t = !1, className: n, children: r, ...i }) {
|
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/button.ts
|
|
109
|
-
var
|
|
109
|
+
var E = [
|
|
110
110
|
"primary",
|
|
111
111
|
"accent",
|
|
112
112
|
"secondary",
|
|
@@ -114,115 +114,115 @@ var w = [
|
|
|
114
114
|
"danger",
|
|
115
115
|
"danger-ghost"
|
|
116
116
|
];
|
|
117
|
-
function
|
|
118
|
-
return
|
|
117
|
+
function D(e) {
|
|
118
|
+
return E.includes(e) ? e : "primary";
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/PlinthButton.tsx
|
|
122
|
-
function
|
|
123
|
-
let
|
|
124
|
-
"data-variant":
|
|
125
|
-
"data-size":
|
|
122
|
+
function O({ href: e, variant: t, size: n, disabled: r = !1, busy: i = !1, icon: a, trailing: o, mirrorIcon: s = !1, mirrorTrailing: c = !1, className: f, children: g, ..._ }) {
|
|
123
|
+
let v = m(n, p, "md"), y = h(v), S = i && !r, C = {
|
|
124
|
+
"data-variant": D(t),
|
|
125
|
+
"data-size": v,
|
|
126
126
|
"aria-busy": S ? "true" : void 0
|
|
127
|
-
}, w = /* @__PURE__ */ l
|
|
128
|
-
S ? /* @__PURE__ */
|
|
127
|
+
}, w = /* @__PURE__ */ d(l, { children: [
|
|
128
|
+
S ? /* @__PURE__ */ u("span", {
|
|
129
129
|
className: "plinth-button-spinner",
|
|
130
130
|
"aria-hidden": "true"
|
|
131
|
-
}) :
|
|
131
|
+
}) : x(a) ? /* @__PURE__ */ u("span", {
|
|
132
132
|
className: "plinth-icon",
|
|
133
|
-
"data-size":
|
|
134
|
-
"data-mirror":
|
|
133
|
+
"data-size": y,
|
|
134
|
+
"data-mirror": s ? "" : void 0,
|
|
135
135
|
"aria-hidden": "true",
|
|
136
136
|
children: a
|
|
137
137
|
}) : null,
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ u("span", {
|
|
139
139
|
className: "plinth-button-label",
|
|
140
140
|
children: g
|
|
141
141
|
}),
|
|
142
|
-
|
|
142
|
+
x(o) ? /* @__PURE__ */ u("span", {
|
|
143
143
|
className: "plinth-icon",
|
|
144
|
-
"data-size":
|
|
145
|
-
"data-mirror":
|
|
144
|
+
"data-size": y,
|
|
145
|
+
"data-mirror": c ? "" : void 0,
|
|
146
146
|
"aria-hidden": "true",
|
|
147
147
|
children: o
|
|
148
148
|
}) : null
|
|
149
149
|
] });
|
|
150
|
-
return e ? /* @__PURE__ */
|
|
150
|
+
return e ? /* @__PURE__ */ u("a", {
|
|
151
151
|
...C,
|
|
152
152
|
href: r ? void 0 : e,
|
|
153
153
|
role: r ? "link" : void 0,
|
|
154
154
|
"aria-disabled": S || r ? "true" : void 0,
|
|
155
155
|
..._,
|
|
156
|
-
className:
|
|
156
|
+
className: b("plinth-button", f),
|
|
157
157
|
children: w
|
|
158
|
-
}) : /* @__PURE__ */
|
|
158
|
+
}) : /* @__PURE__ */ u("button", {
|
|
159
159
|
type: "button",
|
|
160
160
|
...C,
|
|
161
161
|
disabled: r || void 0,
|
|
162
162
|
"aria-disabled": S ? "true" : void 0,
|
|
163
163
|
..._,
|
|
164
|
-
className:
|
|
164
|
+
className: b("plinth-button", f),
|
|
165
165
|
children: w
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/callout.ts
|
|
170
|
-
var
|
|
170
|
+
var k = [
|
|
171
171
|
"neutral",
|
|
172
172
|
"info",
|
|
173
173
|
"success",
|
|
174
174
|
"warning",
|
|
175
175
|
"danger"
|
|
176
176
|
];
|
|
177
|
-
function
|
|
178
|
-
return
|
|
177
|
+
function A(e) {
|
|
178
|
+
return k.includes(e) ? e : "neutral";
|
|
179
179
|
}
|
|
180
|
-
var
|
|
180
|
+
var j = [
|
|
181
181
|
"note",
|
|
182
182
|
"status",
|
|
183
183
|
"alert"
|
|
184
184
|
];
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function M(e) {
|
|
186
|
+
return j.includes(e) ? e : "note";
|
|
187
187
|
}
|
|
188
|
-
var
|
|
189
|
-
neutral:
|
|
190
|
-
info:
|
|
191
|
-
success:
|
|
192
|
-
warning:
|
|
193
|
-
danger:
|
|
188
|
+
var N = (e) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${e}</svg>`, ee = {
|
|
189
|
+
neutral: N("<rect x=\"5\" y=\"4\" width=\"14\" height=\"16\" rx=\"2\"></rect><path d=\"M9 9h6M9 13h6M9 17h3\"></path>"),
|
|
190
|
+
info: N("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M12 11v5M12 7.5v.01\"></path>"),
|
|
191
|
+
success: N("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M8 12.5l2.5 2.5L16 9.5\"></path>"),
|
|
192
|
+
warning: N("<path d=\"M10.3 4.3L2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0z\"></path><path d=\"M12 9.5v4M12 17v.01\"></path>"),
|
|
193
|
+
danger: N("<path d=\"M8.5 3h7L21 8.5v7L15.5 21h-7L3 15.5v-7z\"></path><path d=\"M12 7.5v5M12 16v.01\"></path>")
|
|
194
194
|
};
|
|
195
195
|
//#endregion
|
|
196
196
|
//#region src/PlinthCallout.tsx
|
|
197
|
-
function
|
|
198
|
-
let
|
|
199
|
-
return /* @__PURE__ */
|
|
200
|
-
"data-tone":
|
|
201
|
-
role:
|
|
197
|
+
function te({ tone: e, role: t, title: n, actions: r, icon: i, className: a, children: o, ...s }) {
|
|
198
|
+
let c = A(e);
|
|
199
|
+
return /* @__PURE__ */ d("div", {
|
|
200
|
+
"data-tone": c,
|
|
201
|
+
role: M(t),
|
|
202
202
|
...s,
|
|
203
|
-
className:
|
|
204
|
-
children: [
|
|
203
|
+
className: b("plinth-callout", a),
|
|
204
|
+
children: [x(i) ? /* @__PURE__ */ u("span", {
|
|
205
205
|
className: "plinth-icon plinth-callout-icon",
|
|
206
206
|
"data-size": "md",
|
|
207
207
|
"aria-hidden": "true",
|
|
208
208
|
children: i
|
|
209
|
-
}) : /* @__PURE__ */
|
|
209
|
+
}) : /* @__PURE__ */ u("span", {
|
|
210
210
|
className: "plinth-icon plinth-callout-icon",
|
|
211
211
|
"data-size": "md",
|
|
212
212
|
"aria-hidden": "true",
|
|
213
|
-
dangerouslySetInnerHTML: { __html:
|
|
214
|
-
}), /* @__PURE__ */
|
|
213
|
+
dangerouslySetInnerHTML: { __html: ee[c] }
|
|
214
|
+
}), /* @__PURE__ */ d("div", {
|
|
215
215
|
className: "plinth-callout-body",
|
|
216
216
|
children: [
|
|
217
|
-
|
|
217
|
+
x(n) ? /* @__PURE__ */ u("p", {
|
|
218
218
|
className: "plinth-callout-title",
|
|
219
219
|
children: n
|
|
220
220
|
}) : null,
|
|
221
|
-
|
|
221
|
+
x(o) ? /* @__PURE__ */ u("div", {
|
|
222
222
|
className: "plinth-callout-text",
|
|
223
223
|
children: o
|
|
224
224
|
}) : null,
|
|
225
|
-
|
|
225
|
+
x(r) ? /* @__PURE__ */ u("div", {
|
|
226
226
|
className: "plinth-callout-actions",
|
|
227
227
|
children: r
|
|
228
228
|
}) : null
|
|
@@ -232,24 +232,24 @@ function N({ tone: e, role: t, title: n, actions: r, icon: i, className: a, chil
|
|
|
232
232
|
}
|
|
233
233
|
//#endregion
|
|
234
234
|
//#region src/code-block.ts
|
|
235
|
-
var
|
|
236
|
-
function
|
|
235
|
+
var ne = (e) => e.slice(0, 6), re = (e, t) => Math.max(0, e.findIndex((e) => e.label === t));
|
|
236
|
+
function ie(e) {
|
|
237
237
|
let t = e.closest(".plinth-code-block"), n = [...t?.querySelectorAll(".plinth-code-block-tab-input") ?? []], r = Math.max(0, n.findIndex((e) => e.checked));
|
|
238
238
|
return t?.querySelectorAll(".plinth-code-block-code")[r]?.textContent ?? "";
|
|
239
239
|
}
|
|
240
240
|
//#endregion
|
|
241
241
|
//#region src/PlinthCodeBlock.tsx
|
|
242
|
-
var
|
|
242
|
+
var ae = ({ children: e, html: t }) => /* @__PURE__ */ u("pre", {
|
|
243
243
|
className: "plinth-code-block-code",
|
|
244
244
|
dir: "ltr",
|
|
245
245
|
tabIndex: 0,
|
|
246
|
-
children: t === void 0 ? /* @__PURE__ */
|
|
246
|
+
children: t === void 0 ? /* @__PURE__ */ u("code", { children: e }) : /* @__PURE__ */ u("code", { dangerouslySetInnerHTML: { __html: t } })
|
|
247
247
|
});
|
|
248
|
-
function
|
|
249
|
-
let S =
|
|
250
|
-
|
|
248
|
+
function oe({ id: e, label: t, html: n, tabs: r = [], selected: i, tabsLabel: f = "Language", copy: p = !0, copyLabel: m = "Copy", copiedLabel: h = "Copied", onCopied: g, className: _, children: v, ...y }) {
|
|
249
|
+
let S = o(), C = e?.trim() || void 0, w = `${C ?? `plinth-code-block-${S}`}-language`, T = ne(r), E = re(T, i), [D, k] = c(!1), [A, j] = c(!1), M = s(void 0);
|
|
250
|
+
a(() => (k(!!navigator.clipboard), () => clearTimeout(M.current)), []);
|
|
251
251
|
async function N(e) {
|
|
252
|
-
let t =
|
|
252
|
+
let t = ie(e.currentTarget);
|
|
253
253
|
try {
|
|
254
254
|
await navigator.clipboard.writeText(t);
|
|
255
255
|
} catch {
|
|
@@ -257,122 +257,122 @@ function re({ id: e, label: t, html: n, tabs: u = [], selected: d, tabsLabel: f
|
|
|
257
257
|
}
|
|
258
258
|
j(!0), clearTimeout(M.current), M.current = setTimeout(() => j(!1), 2e3), g?.(t);
|
|
259
259
|
}
|
|
260
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ d("div", {
|
|
261
261
|
id: C,
|
|
262
|
-
...
|
|
263
|
-
className:
|
|
264
|
-
children: [/* @__PURE__ */
|
|
262
|
+
...y,
|
|
263
|
+
className: b("plinth-code-block", _),
|
|
264
|
+
children: [/* @__PURE__ */ d("div", {
|
|
265
265
|
className: "plinth-code-block-header",
|
|
266
266
|
children: [
|
|
267
|
-
|
|
267
|
+
x(t) ? /* @__PURE__ */ u("span", {
|
|
268
268
|
className: "plinth-code-block-label",
|
|
269
269
|
children: t
|
|
270
270
|
}) : null,
|
|
271
|
-
T.length ? /* @__PURE__ */
|
|
271
|
+
T.length ? /* @__PURE__ */ u("div", {
|
|
272
272
|
className: "plinth-code-block-tabs",
|
|
273
273
|
role: "radiogroup",
|
|
274
274
|
"aria-label": f,
|
|
275
|
-
children: T.map((e, t) => /* @__PURE__ */
|
|
275
|
+
children: T.map((e, t) => /* @__PURE__ */ d("label", {
|
|
276
276
|
className: "plinth-code-block-tab",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ u("input", {
|
|
278
278
|
type: "radio",
|
|
279
279
|
className: "plinth-code-block-tab-input",
|
|
280
280
|
name: w,
|
|
281
|
-
defaultChecked: t ===
|
|
282
|
-
}), /* @__PURE__ */
|
|
281
|
+
defaultChecked: t === E
|
|
282
|
+
}), /* @__PURE__ */ u("span", {
|
|
283
283
|
className: "plinth-code-block-tab-label",
|
|
284
284
|
children: e.label
|
|
285
285
|
})]
|
|
286
286
|
}, t))
|
|
287
287
|
}) : null,
|
|
288
|
-
p ? /* @__PURE__ */ l
|
|
288
|
+
p ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(O, {
|
|
289
289
|
className: "plinth-code-block-copy",
|
|
290
290
|
variant: "ghost",
|
|
291
291
|
size: "sm",
|
|
292
|
-
hidden: !
|
|
292
|
+
hidden: !D,
|
|
293
293
|
onClick: N,
|
|
294
294
|
children: A ? h : m
|
|
295
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ u("span", {
|
|
296
296
|
className: "plinth-code-block-status",
|
|
297
297
|
role: "status",
|
|
298
298
|
children: A ? h : ""
|
|
299
299
|
})] }) : null
|
|
300
300
|
]
|
|
301
|
-
}), T.length ? T.map((e, t) => /* @__PURE__ */
|
|
301
|
+
}), T.length ? T.map((e, t) => /* @__PURE__ */ u(ae, {
|
|
302
302
|
html: e.html,
|
|
303
303
|
children: e.code
|
|
304
|
-
}, t)) : /* @__PURE__ */
|
|
304
|
+
}, t)) : /* @__PURE__ */ u(ae, {
|
|
305
305
|
html: n,
|
|
306
|
-
children:
|
|
306
|
+
children: v
|
|
307
307
|
})]
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
//#endregion
|
|
311
311
|
//#region src/confirm-dialog.ts
|
|
312
|
-
var
|
|
312
|
+
var se = [
|
|
313
313
|
"simple",
|
|
314
314
|
"type",
|
|
315
315
|
"password"
|
|
316
316
|
];
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function ce(e) {
|
|
318
|
+
return se.includes(e) ? e : "simple";
|
|
319
319
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
322
|
-
return
|
|
320
|
+
var le = ["neutral", "danger"];
|
|
321
|
+
function P(e) {
|
|
322
|
+
return le.includes(e) ? e : "neutral";
|
|
323
323
|
}
|
|
324
|
-
var
|
|
324
|
+
var F = {
|
|
325
325
|
type: "Type :phrase to confirm",
|
|
326
326
|
password: "Password"
|
|
327
|
-
},
|
|
327
|
+
}, I = (e) => e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&"), L = [
|
|
328
328
|
"start",
|
|
329
329
|
"end",
|
|
330
330
|
"top",
|
|
331
331
|
"bottom"
|
|
332
332
|
];
|
|
333
|
-
function
|
|
334
|
-
return
|
|
333
|
+
function R(e) {
|
|
334
|
+
return z(e) ?? "end";
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
return
|
|
336
|
+
function z(e) {
|
|
337
|
+
return L.includes(e) ? e : void 0;
|
|
338
338
|
}
|
|
339
|
-
var
|
|
340
|
-
function
|
|
341
|
-
return
|
|
339
|
+
var B = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 6l12 12M18 6L6 18\"></path></svg>", V = ["center", "bottom"];
|
|
340
|
+
function H(e) {
|
|
341
|
+
return V.includes(e) ? e : "center";
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var ue = B;
|
|
344
344
|
//#endregion
|
|
345
345
|
//#region src/PlinthConfirmDialog.tsx
|
|
346
|
-
function
|
|
347
|
-
let
|
|
346
|
+
function de({ id: t, title: n, message: r, kind: i, phrase: a, fieldLabel: s, confirmLabel: c = "Confirm", cancelLabel: l = "Cancel", tone: f, error: p, busy: m = !1, sidePhone: h, className: g, ..._ }) {
|
|
347
|
+
let v = o();
|
|
348
348
|
if (!n?.trim()) throw Error("<PlinthConfirmDialog> needs a title: it is the dialog's accessible name.");
|
|
349
349
|
if (!r?.trim()) throw Error("<PlinthConfirmDialog> needs a message: it is the dialog's accessible description.");
|
|
350
|
-
let
|
|
351
|
-
if (
|
|
352
|
-
let x = t?.trim() || `plinth-confirm-dialog-${
|
|
350
|
+
let y = ce(i);
|
|
351
|
+
if (y === "type" && !a?.trim()) throw Error("<PlinthConfirmDialog kind=\"type\"> needs a phrase: it is what the person types.");
|
|
352
|
+
let x = t?.trim() || `plinth-confirm-dialog-${v}`, S = H(h), C = a?.trim() ?? "", w = y !== "simple" && !!p?.trim(), T = w ? {
|
|
353
353
|
"aria-invalid": !0,
|
|
354
354
|
"aria-describedby": `${x}-error`
|
|
355
|
-
} : {},
|
|
356
|
-
if (
|
|
357
|
-
let t = s?.trim() ||
|
|
358
|
-
|
|
355
|
+
} : {}, E = null;
|
|
356
|
+
if (y !== "simple") {
|
|
357
|
+
let t = s?.trim() || F[y], n = y === "type" ? t.split(":phrase") : [t];
|
|
358
|
+
E = /* @__PURE__ */ d("div", {
|
|
359
359
|
className: "plinth-confirm-dialog-field",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ u("label", {
|
|
361
361
|
htmlFor: `${x}-field`,
|
|
362
362
|
className: "plinth-confirm-dialog-label",
|
|
363
|
-
children: n.map((t, n) => /* @__PURE__ */
|
|
364
|
-
}),
|
|
363
|
+
children: n.map((t, n) => /* @__PURE__ */ d(e, { children: [n > 0 ? /* @__PURE__ */ u("strong", { children: C }) : null, t] }, n))
|
|
364
|
+
}), y === "type" ? /* @__PURE__ */ u("input", {
|
|
365
365
|
id: `${x}-field`,
|
|
366
366
|
className: "plinth-confirm-dialog-input",
|
|
367
367
|
type: "text",
|
|
368
368
|
name: "confirmation",
|
|
369
369
|
required: !0,
|
|
370
|
-
pattern:
|
|
370
|
+
pattern: I(C),
|
|
371
371
|
autoComplete: "off",
|
|
372
372
|
autoCapitalize: "none",
|
|
373
373
|
spellCheck: "false",
|
|
374
374
|
...T
|
|
375
|
-
}) : /* @__PURE__ */
|
|
375
|
+
}) : /* @__PURE__ */ u("input", {
|
|
376
376
|
id: `${x}-field`,
|
|
377
377
|
className: "plinth-confirm-dialog-input",
|
|
378
378
|
type: "password",
|
|
@@ -383,7 +383,7 @@ function se({ id: t, title: n, message: r, kind: a, phrase: o, fieldLabel: s, co
|
|
|
383
383
|
})]
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ u("dialog", {
|
|
387
387
|
id: x,
|
|
388
388
|
role: "alertdialog",
|
|
389
389
|
"data-side-phone": S === "center" ? void 0 : S,
|
|
@@ -391,29 +391,29 @@ function se({ id: t, title: n, message: r, kind: a, phrase: o, fieldLabel: s, co
|
|
|
391
391
|
"aria-labelledby": `${x}-title`,
|
|
392
392
|
"aria-describedby": `${x}-message`,
|
|
393
393
|
..._,
|
|
394
|
-
className:
|
|
395
|
-
children: /* @__PURE__ */
|
|
394
|
+
className: b("plinth-dialog plinth-confirm-dialog", g),
|
|
395
|
+
children: /* @__PURE__ */ d("form", {
|
|
396
396
|
method: "dialog",
|
|
397
397
|
className: "plinth-confirm-dialog-form",
|
|
398
398
|
children: [
|
|
399
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ u("div", {
|
|
400
400
|
className: "plinth-dialog-header",
|
|
401
|
-
children: /* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ u("h2", {
|
|
402
402
|
id: `${x}-title`,
|
|
403
403
|
className: "plinth-dialog-title",
|
|
404
404
|
children: n
|
|
405
405
|
})
|
|
406
406
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ d("div", {
|
|
408
408
|
className: "plinth-dialog-body",
|
|
409
409
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ u("p", {
|
|
411
411
|
id: `${x}-message`,
|
|
412
412
|
className: "plinth-confirm-dialog-message",
|
|
413
413
|
children: r
|
|
414
414
|
}),
|
|
415
|
-
|
|
416
|
-
w ? /* @__PURE__ */
|
|
415
|
+
E,
|
|
416
|
+
w ? /* @__PURE__ */ u("p", {
|
|
417
417
|
id: `${x}-error`,
|
|
418
418
|
className: "plinth-confirm-dialog-error",
|
|
419
419
|
role: "alert",
|
|
@@ -421,21 +421,21 @@ function se({ id: t, title: n, message: r, kind: a, phrase: o, fieldLabel: s, co
|
|
|
421
421
|
}) : null
|
|
422
422
|
]
|
|
423
423
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ d("div", {
|
|
425
425
|
className: "plinth-dialog-footer",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
426
|
+
children: [/* @__PURE__ */ u(O, {
|
|
427
427
|
variant: "secondary",
|
|
428
428
|
commandfor: x,
|
|
429
429
|
command: "close",
|
|
430
430
|
value: "cancel",
|
|
431
|
-
children:
|
|
432
|
-
}), /* @__PURE__ */
|
|
431
|
+
children: l
|
|
432
|
+
}), /* @__PURE__ */ u(O, {
|
|
433
433
|
className: "plinth-confirm-dialog-confirm",
|
|
434
434
|
type: "submit",
|
|
435
435
|
value: "confirm",
|
|
436
|
-
variant:
|
|
436
|
+
variant: P(f) === "danger" ? "danger" : "primary",
|
|
437
437
|
busy: m,
|
|
438
|
-
children:
|
|
438
|
+
children: c
|
|
439
439
|
})]
|
|
440
440
|
})
|
|
441
441
|
]
|
|
@@ -444,26 +444,26 @@ function se({ id: t, title: n, message: r, kind: a, phrase: o, fieldLabel: s, co
|
|
|
444
444
|
}
|
|
445
445
|
//#endregion
|
|
446
446
|
//#region src/PlinthDataTable.tsx
|
|
447
|
-
function
|
|
448
|
-
return /* @__PURE__ */
|
|
447
|
+
function fe({ caption: e, head: t, className: n, children: r, ...i }) {
|
|
448
|
+
return /* @__PURE__ */ d("table", {
|
|
449
449
|
role: "table",
|
|
450
450
|
...i,
|
|
451
|
-
className:
|
|
451
|
+
className: b("plinth-data-table", n),
|
|
452
452
|
children: [
|
|
453
|
-
e?.trim() ? /* @__PURE__ */
|
|
453
|
+
e?.trim() ? /* @__PURE__ */ u("caption", {
|
|
454
454
|
className: "plinth-data-table-caption",
|
|
455
455
|
children: e
|
|
456
456
|
}) : null,
|
|
457
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ u("thead", {
|
|
458
458
|
className: "plinth-data-table-head",
|
|
459
459
|
role: "rowgroup",
|
|
460
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ u("tr", {
|
|
461
461
|
className: "plinth-data-table-head-row",
|
|
462
462
|
role: "row",
|
|
463
463
|
children: t
|
|
464
464
|
})
|
|
465
465
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ u("tbody", {
|
|
467
467
|
className: "plinth-data-table-body",
|
|
468
468
|
role: "rowgroup",
|
|
469
469
|
children: r
|
|
@@ -473,38 +473,38 @@ function ce({ caption: e, head: t, className: n, children: r, ...i }) {
|
|
|
473
473
|
}
|
|
474
474
|
//#endregion
|
|
475
475
|
//#region src/data-table.ts
|
|
476
|
-
var
|
|
476
|
+
var U = [
|
|
477
477
|
"none",
|
|
478
478
|
"ascending",
|
|
479
479
|
"descending"
|
|
480
480
|
];
|
|
481
|
-
function
|
|
482
|
-
return
|
|
481
|
+
function W(e) {
|
|
482
|
+
return U.includes(e) ? e : "none";
|
|
483
483
|
}
|
|
484
|
-
var
|
|
484
|
+
var G = [
|
|
485
485
|
"field",
|
|
486
486
|
"title",
|
|
487
487
|
"actions"
|
|
488
488
|
];
|
|
489
|
-
function
|
|
490
|
-
return
|
|
489
|
+
function K(e) {
|
|
490
|
+
return G.includes(e) ? e : "field";
|
|
491
491
|
}
|
|
492
|
-
var
|
|
492
|
+
var pe = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path class=\"plinth-data-table-sort-up\" d=\"M8 9l4-4 4 4\"></path><path class=\"plinth-data-table-sort-down\" d=\"M8 15l4 4 4-4\"></path></svg></span>";
|
|
493
493
|
//#endregion
|
|
494
494
|
//#region src/PlinthDataTableCell.tsx
|
|
495
|
-
function
|
|
496
|
-
return /* @__PURE__ */
|
|
495
|
+
function me({ label: e, kind: t, numeric: n = !1, hideOnPhone: r = !1, className: i, children: a, ...o }) {
|
|
496
|
+
return /* @__PURE__ */ d("td", {
|
|
497
497
|
role: "cell",
|
|
498
|
-
"data-kind":
|
|
498
|
+
"data-kind": K(t),
|
|
499
499
|
"data-numeric": n ? "" : void 0,
|
|
500
500
|
"data-phone": r ? "hidden" : void 0,
|
|
501
501
|
...o,
|
|
502
|
-
className:
|
|
503
|
-
children: [e?.trim() ? /* @__PURE__ */
|
|
502
|
+
className: b("plinth-data-table-cell", i),
|
|
503
|
+
children: [e?.trim() ? /* @__PURE__ */ u("span", {
|
|
504
504
|
className: "plinth-data-table-label",
|
|
505
505
|
"aria-hidden": "true",
|
|
506
506
|
children: e
|
|
507
|
-
}) : null, /* @__PURE__ */
|
|
507
|
+
}) : null, /* @__PURE__ */ u("span", {
|
|
508
508
|
className: "plinth-data-table-value",
|
|
509
509
|
children: a
|
|
510
510
|
})]
|
|
@@ -512,73 +512,73 @@ function ue({ label: e, kind: t, numeric: n = !1, hideOnPhone: r = !1, className
|
|
|
512
512
|
}
|
|
513
513
|
//#endregion
|
|
514
514
|
//#region src/PlinthDataTableColumn.tsx
|
|
515
|
-
function
|
|
516
|
-
return /* @__PURE__ */
|
|
515
|
+
function he({ sort: e, numeric: t = !1, hideOnPhone: n = !1, className: r, children: i, ...a }) {
|
|
516
|
+
return /* @__PURE__ */ u("th", {
|
|
517
517
|
role: "columnheader",
|
|
518
518
|
scope: "col",
|
|
519
|
-
"aria-sort": e?.trim() ?
|
|
519
|
+
"aria-sort": e?.trim() ? W(e) : void 0,
|
|
520
520
|
"data-numeric": t ? "" : void 0,
|
|
521
521
|
"data-phone": n ? "hidden" : void 0,
|
|
522
522
|
...a,
|
|
523
|
-
className:
|
|
523
|
+
className: b("plinth-data-table-column", r),
|
|
524
524
|
children: i
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
527
|
//#endregion
|
|
528
528
|
//#region src/PlinthDataTableEmpty.tsx
|
|
529
|
-
var
|
|
530
|
-
let t = typeof e == "number" ||
|
|
529
|
+
var ge = /^\s*[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?\s*$/, _e = (e) => {
|
|
530
|
+
let t = typeof e == "number" || ge.test(e) ? Number(e) : NaN;
|
|
531
531
|
return Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : 1;
|
|
532
532
|
};
|
|
533
|
-
function
|
|
534
|
-
return /* @__PURE__ */
|
|
533
|
+
function ve({ columns: e = 1, className: t, children: n, ...r }) {
|
|
534
|
+
return /* @__PURE__ */ u("tr", {
|
|
535
535
|
role: "row",
|
|
536
536
|
...r,
|
|
537
|
-
className:
|
|
538
|
-
children: /* @__PURE__ */
|
|
537
|
+
className: b("plinth-data-table-empty", t),
|
|
538
|
+
children: /* @__PURE__ */ u("td", {
|
|
539
539
|
className: "plinth-data-table-empty-cell",
|
|
540
540
|
role: "cell",
|
|
541
|
-
colSpan:
|
|
541
|
+
colSpan: _e(e),
|
|
542
542
|
children: n
|
|
543
543
|
})
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
//#endregion
|
|
547
547
|
//#region src/PlinthDataTableRow.tsx
|
|
548
|
-
function
|
|
549
|
-
return /* @__PURE__ */
|
|
548
|
+
function ye({ selected: e, className: t, children: n, ...r }) {
|
|
549
|
+
return /* @__PURE__ */ u("tr", {
|
|
550
550
|
role: "row",
|
|
551
551
|
"aria-selected": e === void 0 ? void 0 : e ? "true" : "false",
|
|
552
552
|
...r,
|
|
553
|
-
className:
|
|
553
|
+
className: b("plinth-data-table-row", t),
|
|
554
554
|
children: n
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/PlinthDataTableSort.tsx
|
|
559
|
-
function
|
|
560
|
-
return /* @__PURE__ */
|
|
559
|
+
function be({ className: e, children: t, ...n }) {
|
|
560
|
+
return /* @__PURE__ */ d("button", {
|
|
561
561
|
type: "button",
|
|
562
562
|
...n,
|
|
563
|
-
className:
|
|
564
|
-
children: [/* @__PURE__ */
|
|
563
|
+
className: b("plinth-data-table-sort", e),
|
|
564
|
+
children: [/* @__PURE__ */ u("span", {
|
|
565
565
|
className: "plinth-data-table-sort-label",
|
|
566
566
|
children: t
|
|
567
|
-
}), /* @__PURE__ */
|
|
567
|
+
}), /* @__PURE__ */ u("span", {
|
|
568
568
|
className: "plinth-icon plinth-data-table-sort-icon",
|
|
569
569
|
"data-size": "sm",
|
|
570
570
|
"aria-hidden": "true",
|
|
571
|
-
children: /* @__PURE__ */
|
|
571
|
+
children: /* @__PURE__ */ d("svg", {
|
|
572
572
|
viewBox: "0 0 24 24",
|
|
573
573
|
fill: "none",
|
|
574
574
|
stroke: "currentColor",
|
|
575
575
|
strokeWidth: "2",
|
|
576
576
|
strokeLinecap: "round",
|
|
577
577
|
strokeLinejoin: "round",
|
|
578
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ u("path", {
|
|
579
579
|
className: "plinth-data-table-sort-up",
|
|
580
580
|
d: "M8 9l4-4 4 4"
|
|
581
|
-
}), /* @__PURE__ */
|
|
581
|
+
}), /* @__PURE__ */ u("path", {
|
|
582
582
|
className: "plinth-data-table-sort-down",
|
|
583
583
|
d: "M8 15l4 4 4-4"
|
|
584
584
|
})]
|
|
@@ -588,43 +588,43 @@ function ge({ className: e, children: t, ...n }) {
|
|
|
588
588
|
}
|
|
589
589
|
//#endregion
|
|
590
590
|
//#region src/PlinthIconButton.tsx
|
|
591
|
-
function
|
|
592
|
-
let g =
|
|
593
|
-
className:
|
|
594
|
-
"data-variant":
|
|
591
|
+
function q({ label: e, href: t, variant: n = "ghost", size: r, disabled: i = !1, busy: a = !1, pressed: o = null, mirror: s = !1, className: c, children: l, "aria-label": d, ...f }) {
|
|
592
|
+
let g = m(r, p, "md"), _ = a && !i, v = {
|
|
593
|
+
className: b("plinth-button plinth-icon-button", c),
|
|
594
|
+
"data-variant": D(n),
|
|
595
595
|
"data-size": g,
|
|
596
|
-
"aria-label": e ||
|
|
596
|
+
"aria-label": e || d,
|
|
597
597
|
"aria-busy": _ ? "true" : void 0
|
|
598
|
-
},
|
|
598
|
+
}, y = _ ? /* @__PURE__ */ u("span", {
|
|
599
599
|
className: "plinth-button-spinner",
|
|
600
600
|
"aria-hidden": "true"
|
|
601
|
-
}) : /* @__PURE__ */
|
|
601
|
+
}) : /* @__PURE__ */ u("span", {
|
|
602
602
|
className: "plinth-icon",
|
|
603
|
-
"data-size":
|
|
603
|
+
"data-size": h(g),
|
|
604
604
|
"data-mirror": s ? "" : void 0,
|
|
605
605
|
"aria-hidden": "true",
|
|
606
|
-
children:
|
|
606
|
+
children: l
|
|
607
607
|
});
|
|
608
|
-
return t ? /* @__PURE__ */
|
|
609
|
-
...
|
|
608
|
+
return t ? /* @__PURE__ */ u("a", {
|
|
609
|
+
...v,
|
|
610
610
|
href: i ? void 0 : t,
|
|
611
611
|
role: i ? "link" : void 0,
|
|
612
612
|
"aria-disabled": _ || i ? "true" : void 0,
|
|
613
|
-
...
|
|
614
|
-
children:
|
|
615
|
-
}) : /* @__PURE__ */
|
|
613
|
+
...f,
|
|
614
|
+
children: y
|
|
615
|
+
}) : /* @__PURE__ */ u("button", {
|
|
616
616
|
type: "button",
|
|
617
|
-
...
|
|
617
|
+
...v,
|
|
618
618
|
"aria-pressed": o === null ? void 0 : o ? "true" : "false",
|
|
619
619
|
disabled: i || void 0,
|
|
620
620
|
"aria-disabled": _ ? "true" : void 0,
|
|
621
|
-
...
|
|
622
|
-
children:
|
|
621
|
+
...f,
|
|
622
|
+
children: y
|
|
623
623
|
});
|
|
624
624
|
}
|
|
625
625
|
//#endregion
|
|
626
626
|
//#region src/swipe.ts
|
|
627
|
-
function
|
|
627
|
+
function J(e) {
|
|
628
628
|
let t = e.firstElementChild, n = () => getComputedStyle(e).scrollSnapType.startsWith("y"), r = () => {
|
|
629
629
|
e.requestClose ? e.requestClose() : e.close(), e.open && (e.scrollTop = 0);
|
|
630
630
|
}, i = () => {
|
|
@@ -645,15 +645,15 @@ function X(e) {
|
|
|
645
645
|
e.removeEventListener(s, i), e.removeEventListener("click", a), e.removeEventListener("toggle", o);
|
|
646
646
|
};
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
return
|
|
650
|
-
let n =
|
|
648
|
+
function Y(e) {
|
|
649
|
+
return i((t) => {
|
|
650
|
+
let n = J(t), r = xe(e, t);
|
|
651
651
|
return () => {
|
|
652
652
|
n(), r();
|
|
653
653
|
};
|
|
654
654
|
}, [e]);
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function xe(e, t) {
|
|
657
657
|
if (typeof e == "function") {
|
|
658
658
|
let n = e(t);
|
|
659
659
|
return typeof n == "function" ? n : () => e(null);
|
|
@@ -664,63 +664,63 @@ function _e(e, t) {
|
|
|
664
664
|
}
|
|
665
665
|
//#endregion
|
|
666
666
|
//#region src/PlinthDialog.tsx
|
|
667
|
-
function
|
|
668
|
-
let m =
|
|
667
|
+
function Se({ id: e, title: t, description: n, closeLabel: r = "Close", dismissible: i = !0, sidePhone: a, footer: s, className: c, children: l, ref: f, ...p }) {
|
|
668
|
+
let m = o(), h = Y(f);
|
|
669
669
|
if (!t?.trim()) throw Error("<PlinthDialog> needs a title: it is the dialog's accessible name.");
|
|
670
|
-
let g = e?.trim() || `plinth-dialog-${m}`, _ = !!n?.trim(),
|
|
671
|
-
return /* @__PURE__ */
|
|
670
|
+
let g = e?.trim() || `plinth-dialog-${m}`, _ = !!n?.trim(), v = H(a);
|
|
671
|
+
return /* @__PURE__ */ u("dialog", {
|
|
672
672
|
id: g,
|
|
673
|
-
role:
|
|
674
|
-
"data-side-phone":
|
|
675
|
-
closedby:
|
|
673
|
+
role: i ? void 0 : "alertdialog",
|
|
674
|
+
"data-side-phone": v === "center" ? void 0 : v,
|
|
675
|
+
closedby: i ? "any" : "closerequest",
|
|
676
676
|
"aria-labelledby": `${g}-title`,
|
|
677
677
|
"aria-describedby": _ ? `${g}-description` : void 0,
|
|
678
678
|
...p,
|
|
679
679
|
ref: h,
|
|
680
|
-
className:
|
|
681
|
-
children: /* @__PURE__ */
|
|
680
|
+
className: b("plinth-dialog", c),
|
|
681
|
+
children: /* @__PURE__ */ d("div", {
|
|
682
682
|
className: "plinth-dialog-panel",
|
|
683
683
|
children: [
|
|
684
|
-
|
|
684
|
+
i && v === "bottom" ? /* @__PURE__ */ u("div", {
|
|
685
685
|
className: "plinth-dialog-handle",
|
|
686
686
|
"aria-hidden": "true"
|
|
687
687
|
}) : null,
|
|
688
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ d("div", {
|
|
689
689
|
className: "plinth-dialog-header",
|
|
690
690
|
children: [
|
|
691
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ u("h2", {
|
|
692
692
|
id: `${g}-title`,
|
|
693
693
|
className: "plinth-dialog-title",
|
|
694
694
|
children: t
|
|
695
695
|
}),
|
|
696
|
-
_ ? /* @__PURE__ */
|
|
696
|
+
_ ? /* @__PURE__ */ u("p", {
|
|
697
697
|
id: `${g}-description`,
|
|
698
698
|
className: "plinth-dialog-description",
|
|
699
699
|
children: n
|
|
700
700
|
}) : null,
|
|
701
|
-
|
|
701
|
+
i ? /* @__PURE__ */ u(q, {
|
|
702
702
|
className: "plinth-dialog-close",
|
|
703
703
|
label: r,
|
|
704
704
|
variant: "ghost",
|
|
705
705
|
commandfor: g,
|
|
706
706
|
command: "close",
|
|
707
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ u("svg", {
|
|
708
708
|
viewBox: "0 0 24 24",
|
|
709
709
|
fill: "none",
|
|
710
710
|
stroke: "currentColor",
|
|
711
711
|
strokeWidth: "2",
|
|
712
712
|
strokeLinecap: "round",
|
|
713
713
|
strokeLinejoin: "round",
|
|
714
|
-
children: /* @__PURE__ */
|
|
714
|
+
children: /* @__PURE__ */ u("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
715
715
|
})
|
|
716
716
|
}) : null
|
|
717
717
|
]
|
|
718
718
|
}),
|
|
719
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ u("div", {
|
|
720
720
|
className: "plinth-dialog-body",
|
|
721
|
-
children:
|
|
721
|
+
children: l
|
|
722
722
|
}),
|
|
723
|
-
|
|
723
|
+
x(s) ? /* @__PURE__ */ u("div", {
|
|
724
724
|
className: "plinth-dialog-footer",
|
|
725
725
|
children: s
|
|
726
726
|
}) : null
|
|
@@ -730,168 +730,145 @@ function ve({ id: e, title: t, description: n, closeLabel: r = "Close", dismissi
|
|
|
730
730
|
}
|
|
731
731
|
//#endregion
|
|
732
732
|
//#region src/drawer.ts
|
|
733
|
-
var
|
|
734
|
-
function
|
|
735
|
-
return
|
|
733
|
+
var Ce = ["dialog", "sheet"];
|
|
734
|
+
function we(e) {
|
|
735
|
+
return Ce.includes(e) ? e : "dialog";
|
|
736
736
|
}
|
|
737
|
-
var
|
|
737
|
+
var Te = [
|
|
738
738
|
"peek",
|
|
739
739
|
"half",
|
|
740
740
|
"full"
|
|
741
741
|
];
|
|
742
|
-
function
|
|
742
|
+
function Ee(e) {
|
|
743
743
|
let t = typeof e == "string" ? e.split(/\s+/) : e ?? [];
|
|
744
|
-
return
|
|
744
|
+
return Te.filter((e) => t.includes(e));
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function De(e, t) {
|
|
747
747
|
return t.includes(e) ? e : t.at(-1);
|
|
748
748
|
}
|
|
749
|
-
var
|
|
749
|
+
var Oe = B;
|
|
750
750
|
//#endregion
|
|
751
751
|
//#region src/PlinthDrawer.tsx
|
|
752
|
-
function
|
|
753
|
-
let h =
|
|
752
|
+
function ke({ id: e, title: t, description: n, closeLabel: r = "Close", desktop: i, snapPoints: a, snap: s, footer: c, className: l, children: f, ref: p, ...m }) {
|
|
753
|
+
let h = o(), g = Y(p);
|
|
754
754
|
if (!t?.trim()) throw Error("<PlinthDrawer> needs a title: it is the drawer's accessible name.");
|
|
755
|
-
let _ = e?.trim() || `plinth-drawer-${h}`,
|
|
756
|
-
return /* @__PURE__ */
|
|
755
|
+
let _ = e?.trim() || `plinth-drawer-${h}`, v = !!n?.trim(), y = Ee(a);
|
|
756
|
+
return /* @__PURE__ */ u("dialog", {
|
|
757
757
|
id: _,
|
|
758
|
-
"data-desktop":
|
|
759
|
-
"data-snap-points":
|
|
760
|
-
"data-snap":
|
|
758
|
+
"data-desktop": we(i),
|
|
759
|
+
"data-snap-points": y.length ? y.join(" ") : void 0,
|
|
760
|
+
"data-snap": De(s, y),
|
|
761
761
|
closedby: "any",
|
|
762
762
|
"aria-labelledby": `${_}-title`,
|
|
763
|
-
"aria-describedby":
|
|
763
|
+
"aria-describedby": v ? `${_}-description` : void 0,
|
|
764
764
|
...m,
|
|
765
765
|
ref: g,
|
|
766
|
-
className:
|
|
767
|
-
children: /* @__PURE__ */
|
|
766
|
+
className: b("plinth-drawer", l),
|
|
767
|
+
children: /* @__PURE__ */ d("div", {
|
|
768
768
|
className: "plinth-drawer-panel",
|
|
769
769
|
children: [
|
|
770
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ u("div", {
|
|
771
771
|
className: "plinth-drawer-handle",
|
|
772
772
|
"aria-hidden": "true"
|
|
773
773
|
}),
|
|
774
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ d("div", {
|
|
775
775
|
className: "plinth-drawer-header",
|
|
776
776
|
children: [
|
|
777
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ u("h2", {
|
|
778
778
|
id: `${_}-title`,
|
|
779
779
|
className: "plinth-drawer-title",
|
|
780
780
|
children: t
|
|
781
781
|
}),
|
|
782
|
-
|
|
782
|
+
v ? /* @__PURE__ */ u("p", {
|
|
783
783
|
id: `${_}-description`,
|
|
784
784
|
className: "plinth-drawer-description",
|
|
785
785
|
children: n
|
|
786
786
|
}) : null,
|
|
787
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ u(q, {
|
|
788
788
|
className: "plinth-drawer-close",
|
|
789
789
|
label: r,
|
|
790
790
|
variant: "ghost",
|
|
791
791
|
commandfor: _,
|
|
792
792
|
command: "close",
|
|
793
|
-
children: /* @__PURE__ */
|
|
793
|
+
children: /* @__PURE__ */ u("svg", {
|
|
794
794
|
viewBox: "0 0 24 24",
|
|
795
795
|
fill: "none",
|
|
796
796
|
stroke: "currentColor",
|
|
797
797
|
strokeWidth: "2",
|
|
798
798
|
strokeLinecap: "round",
|
|
799
799
|
strokeLinejoin: "round",
|
|
800
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ u("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
801
801
|
})
|
|
802
802
|
})
|
|
803
803
|
]
|
|
804
804
|
}),
|
|
805
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ u("div", {
|
|
806
806
|
className: "plinth-drawer-body",
|
|
807
807
|
children: f
|
|
808
808
|
}),
|
|
809
|
-
|
|
809
|
+
x(c) ? /* @__PURE__ */ u("div", {
|
|
810
810
|
className: "plinth-drawer-footer",
|
|
811
|
-
children:
|
|
811
|
+
children: c
|
|
812
812
|
}) : null
|
|
813
813
|
]
|
|
814
814
|
})
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
//#endregion
|
|
818
|
-
//#region src/PlinthHeader.tsx
|
|
819
|
-
function Te({ title: e, leading: t, actions: n, className: r, ...i }) {
|
|
820
|
-
if (!e?.trim()) throw Error("<PlinthHeader> needs a title: it is the page's heading.");
|
|
821
|
-
return /* @__PURE__ */ l("header", {
|
|
822
|
-
...i,
|
|
823
|
-
className: v("plinth-header", r),
|
|
824
|
-
children: [
|
|
825
|
-
y(t) ? /* @__PURE__ */ c("div", {
|
|
826
|
-
className: "plinth-header-leading",
|
|
827
|
-
children: t
|
|
828
|
-
}) : null,
|
|
829
|
-
/* @__PURE__ */ c("h1", {
|
|
830
|
-
className: "plinth-header-title",
|
|
831
|
-
children: e
|
|
832
|
-
}),
|
|
833
|
-
y(n) ? /* @__PURE__ */ c("div", {
|
|
834
|
-
className: "plinth-header-actions",
|
|
835
|
-
children: n
|
|
836
|
-
}) : null
|
|
837
|
-
]
|
|
838
|
-
});
|
|
839
|
-
}
|
|
840
|
-
//#endregion
|
|
841
818
|
//#region src/icon.ts
|
|
842
|
-
var
|
|
819
|
+
var Ae = [
|
|
843
820
|
"sm",
|
|
844
821
|
"md",
|
|
845
822
|
"lg"
|
|
846
823
|
];
|
|
847
|
-
function
|
|
848
|
-
return
|
|
824
|
+
function je(e) {
|
|
825
|
+
return m(e, Ae, "md");
|
|
849
826
|
}
|
|
850
827
|
//#endregion
|
|
851
828
|
//#region src/PlinthIcon.tsx
|
|
852
|
-
function
|
|
853
|
-
let s = t ?? a,
|
|
854
|
-
return /* @__PURE__ */
|
|
855
|
-
className:
|
|
856
|
-
"data-size":
|
|
829
|
+
function Me({ size: e, label: t, mirror: n = !1, className: r, children: i, "aria-label": a, ...o }) {
|
|
830
|
+
let s = t ?? a, c = s?.trim() ? s : void 0;
|
|
831
|
+
return /* @__PURE__ */ u("span", {
|
|
832
|
+
className: b("plinth-icon", r),
|
|
833
|
+
"data-size": je(e),
|
|
857
834
|
"data-mirror": n ? "" : void 0,
|
|
858
|
-
role:
|
|
859
|
-
"aria-label":
|
|
860
|
-
"aria-hidden":
|
|
835
|
+
role: c ? "img" : void 0,
|
|
836
|
+
"aria-label": c,
|
|
837
|
+
"aria-hidden": c ? void 0 : "true",
|
|
861
838
|
...o,
|
|
862
839
|
children: i
|
|
863
840
|
});
|
|
864
841
|
}
|
|
865
842
|
//#endregion
|
|
866
843
|
//#region src/heading.ts
|
|
867
|
-
var
|
|
844
|
+
var Ne = [
|
|
868
845
|
"h2",
|
|
869
846
|
"h3",
|
|
870
847
|
"h4",
|
|
871
848
|
"h5",
|
|
872
849
|
"h6"
|
|
873
850
|
];
|
|
874
|
-
function
|
|
875
|
-
return
|
|
851
|
+
function Pe(e) {
|
|
852
|
+
return Ne.includes(e) ? e : "h2";
|
|
876
853
|
}
|
|
877
854
|
//#endregion
|
|
878
855
|
//#region src/PlinthListCard.tsx
|
|
879
|
-
function
|
|
880
|
-
let o =
|
|
881
|
-
return /* @__PURE__ */
|
|
856
|
+
function Fe({ heading: e, headingLevel: t, footer: n, className: r, children: i, ...a }) {
|
|
857
|
+
let o = Pe(t);
|
|
858
|
+
return /* @__PURE__ */ d("div", {
|
|
882
859
|
...a,
|
|
883
|
-
className:
|
|
860
|
+
className: b("plinth-list-card", r),
|
|
884
861
|
children: [
|
|
885
|
-
e?.trim() ? /* @__PURE__ */
|
|
862
|
+
e?.trim() ? /* @__PURE__ */ u(o, {
|
|
886
863
|
className: "plinth-list-card-heading",
|
|
887
864
|
children: e
|
|
888
865
|
}) : null,
|
|
889
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ u("ul", {
|
|
890
867
|
className: "plinth-list-card-list",
|
|
891
868
|
role: "list",
|
|
892
869
|
children: i
|
|
893
870
|
}),
|
|
894
|
-
n?.trim() ? /* @__PURE__ */
|
|
871
|
+
n?.trim() ? /* @__PURE__ */ u("p", {
|
|
895
872
|
className: "plinth-list-card-footer",
|
|
896
873
|
children: n
|
|
897
874
|
}) : null
|
|
@@ -900,9 +877,9 @@ function je({ heading: e, headingLevel: t, footer: n, className: r, children: i,
|
|
|
900
877
|
}
|
|
901
878
|
//#endregion
|
|
902
879
|
//#region src/PlinthListRow.tsx
|
|
903
|
-
function
|
|
904
|
-
let p = n ? "a" : r ? "button" : "div", m = p, h =
|
|
905
|
-
return /* @__PURE__ */
|
|
880
|
+
function Ie({ description: e, chevron: t = !1, href: n, button: r = !1, current: i = !1, disabled: a = !1, leading: o, trailing: s, className: c, children: l, ...f }) {
|
|
881
|
+
let p = n ? "a" : r ? "button" : "div", m = p, h = x(s);
|
|
882
|
+
return /* @__PURE__ */ d(m, {
|
|
906
883
|
type: p === "button" ? "button" : void 0,
|
|
907
884
|
href: p === "a" && !a ? n : void 0,
|
|
908
885
|
"aria-current": i && p !== "button" ? "page" : void 0,
|
|
@@ -910,37 +887,37 @@ function Me({ description: e, chevron: t = !1, href: n, button: r = !1, current:
|
|
|
910
887
|
role: p === "a" && a ? "link" : void 0,
|
|
911
888
|
"aria-disabled": p === "a" && a ? "true" : void 0,
|
|
912
889
|
...f,
|
|
913
|
-
className:
|
|
890
|
+
className: b("plinth-list-row", c),
|
|
914
891
|
children: [
|
|
915
|
-
|
|
892
|
+
x(o) ? /* @__PURE__ */ u("span", {
|
|
916
893
|
className: "plinth-list-row-leading",
|
|
917
894
|
children: o
|
|
918
895
|
}) : null,
|
|
919
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ d("span", {
|
|
920
897
|
className: "plinth-list-row-content",
|
|
921
|
-
children: [/* @__PURE__ */
|
|
898
|
+
children: [/* @__PURE__ */ u("span", {
|
|
922
899
|
className: "plinth-list-row-title",
|
|
923
|
-
children:
|
|
924
|
-
}), e ? /* @__PURE__ */
|
|
900
|
+
children: l
|
|
901
|
+
}), e ? /* @__PURE__ */ u("span", {
|
|
925
902
|
className: "plinth-list-row-description",
|
|
926
903
|
children: e
|
|
927
904
|
}) : null]
|
|
928
905
|
}),
|
|
929
|
-
h || t ? /* @__PURE__ */
|
|
906
|
+
h || t ? /* @__PURE__ */ d("span", {
|
|
930
907
|
className: "plinth-list-row-trailing",
|
|
931
|
-
children: [h ? s : null, t ? /* @__PURE__ */
|
|
908
|
+
children: [h ? s : null, t ? /* @__PURE__ */ u("span", {
|
|
932
909
|
className: "plinth-icon plinth-list-row-chevron",
|
|
933
910
|
"data-size": "sm",
|
|
934
911
|
"data-mirror": "",
|
|
935
912
|
"aria-hidden": "true",
|
|
936
|
-
children: /* @__PURE__ */
|
|
913
|
+
children: /* @__PURE__ */ u("svg", {
|
|
937
914
|
viewBox: "0 0 24 24",
|
|
938
915
|
fill: "none",
|
|
939
916
|
stroke: "currentColor",
|
|
940
917
|
strokeWidth: "2",
|
|
941
918
|
strokeLinecap: "round",
|
|
942
919
|
strokeLinejoin: "round",
|
|
943
|
-
children: /* @__PURE__ */
|
|
920
|
+
children: /* @__PURE__ */ u("path", { d: "M9 6l6 6-6 6" })
|
|
944
921
|
})
|
|
945
922
|
}) : null]
|
|
946
923
|
}) : null
|
|
@@ -948,64 +925,144 @@ function Me({ description: e, chevron: t = !1, href: n, button: r = !1, current:
|
|
|
948
925
|
});
|
|
949
926
|
}
|
|
950
927
|
//#endregion
|
|
928
|
+
//#region src/menu.ts
|
|
929
|
+
var Le = ["neutral", "danger"];
|
|
930
|
+
function Re(e) {
|
|
931
|
+
return Le.includes(e) ? e : "neutral";
|
|
932
|
+
}
|
|
933
|
+
var X = t(void 0);
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/PlinthMenu.tsx
|
|
936
|
+
function ze({ id: e, className: t, children: n, ...r }) {
|
|
937
|
+
if (!e?.trim()) throw Error("<PlinthMenu> needs an id: its button names it in popoverTarget.");
|
|
938
|
+
let i = e.trim();
|
|
939
|
+
return /* @__PURE__ */ u("div", {
|
|
940
|
+
id: i,
|
|
941
|
+
popover: "auto",
|
|
942
|
+
...r,
|
|
943
|
+
className: b("plinth-menu", t),
|
|
944
|
+
children: /* @__PURE__ */ u(X, {
|
|
945
|
+
value: i,
|
|
946
|
+
children: n
|
|
947
|
+
})
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
//#endregion
|
|
951
|
+
//#region src/PlinthMenuGroup.tsx
|
|
952
|
+
function Be({ label: e, className: t, children: n, ...r }) {
|
|
953
|
+
let i = !!e?.trim();
|
|
954
|
+
return /* @__PURE__ */ d("div", {
|
|
955
|
+
role: "group",
|
|
956
|
+
"aria-label": i ? e : void 0,
|
|
957
|
+
...r,
|
|
958
|
+
className: b("plinth-menu-group", t),
|
|
959
|
+
children: [i ? /* @__PURE__ */ u("div", {
|
|
960
|
+
className: "plinth-menu-heading",
|
|
961
|
+
"aria-hidden": "true",
|
|
962
|
+
children: e
|
|
963
|
+
}) : null, n]
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
//#endregion
|
|
967
|
+
//#region src/PlinthMenuItem.tsx
|
|
968
|
+
function Ve({ href: e, tone: t, shortcut: n, disabled: i = !1, menu: a, icon: o, className: s, children: c, ...l }) {
|
|
969
|
+
let f = r(X), p = e?.trim() ? "a" : "button", m = p, h = p === "button" ? a?.trim() || f : void 0;
|
|
970
|
+
return /* @__PURE__ */ d(m, {
|
|
971
|
+
type: p === "button" ? "button" : void 0,
|
|
972
|
+
href: p === "a" && !i ? e : void 0,
|
|
973
|
+
commandfor: h || void 0,
|
|
974
|
+
command: h ? "hide-popover" : void 0,
|
|
975
|
+
"data-tone": Re(t) === "danger" ? "danger" : void 0,
|
|
976
|
+
disabled: p === "button" && i ? !0 : void 0,
|
|
977
|
+
role: p === "a" && i ? "link" : void 0,
|
|
978
|
+
"aria-disabled": p === "a" && i ? "true" : void 0,
|
|
979
|
+
...l,
|
|
980
|
+
className: b("plinth-menu-item", s),
|
|
981
|
+
children: [
|
|
982
|
+
x(o) ? /* @__PURE__ */ u("span", {
|
|
983
|
+
className: "plinth-menu-icon",
|
|
984
|
+
"aria-hidden": "true",
|
|
985
|
+
children: o
|
|
986
|
+
}) : null,
|
|
987
|
+
/* @__PURE__ */ u("span", {
|
|
988
|
+
className: "plinth-menu-label",
|
|
989
|
+
children: c
|
|
990
|
+
}),
|
|
991
|
+
n?.trim() ? /* @__PURE__ */ u("kbd", {
|
|
992
|
+
className: "plinth-menu-shortcut",
|
|
993
|
+
"aria-hidden": "true",
|
|
994
|
+
children: n
|
|
995
|
+
}) : null
|
|
996
|
+
]
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
//#endregion
|
|
1000
|
+
//#region src/PlinthMenuSeparator.tsx
|
|
1001
|
+
function He({ className: e, ...t }) {
|
|
1002
|
+
return /* @__PURE__ */ u("hr", {
|
|
1003
|
+
...t,
|
|
1004
|
+
className: b("plinth-menu-separator", e)
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
951
1008
|
//#region src/PlinthSheet.tsx
|
|
952
|
-
function
|
|
953
|
-
let m =
|
|
1009
|
+
function Ue({ id: e, title: t, description: n, closeLabel: r = "Close", side: i, sidePhone: a, footer: s, className: c, children: l, ref: f, ...p }) {
|
|
1010
|
+
let m = o(), h = Y(f);
|
|
954
1011
|
if (!t?.trim()) throw Error("<PlinthSheet> needs a title: it is the sheet's accessible name.");
|
|
955
|
-
let g = e?.trim() || `plinth-sheet-${m}`, _ = !!n?.trim(),
|
|
956
|
-
return /* @__PURE__ */
|
|
1012
|
+
let g = e?.trim() || `plinth-sheet-${m}`, _ = !!n?.trim(), v = z(a), y = (v ?? R(i)) === "bottom";
|
|
1013
|
+
return /* @__PURE__ */ u("dialog", {
|
|
957
1014
|
id: g,
|
|
958
|
-
"data-side":
|
|
959
|
-
"data-side-phone":
|
|
1015
|
+
"data-side": R(i),
|
|
1016
|
+
"data-side-phone": v,
|
|
960
1017
|
closedby: "any",
|
|
961
1018
|
"aria-labelledby": `${g}-title`,
|
|
962
1019
|
"aria-describedby": _ ? `${g}-description` : void 0,
|
|
963
1020
|
...p,
|
|
964
1021
|
ref: h,
|
|
965
|
-
className:
|
|
966
|
-
children: /* @__PURE__ */
|
|
1022
|
+
className: b("plinth-sheet", c),
|
|
1023
|
+
children: /* @__PURE__ */ d("div", {
|
|
967
1024
|
className: "plinth-sheet-panel",
|
|
968
1025
|
children: [
|
|
969
|
-
|
|
1026
|
+
y ? /* @__PURE__ */ u("div", {
|
|
970
1027
|
className: "plinth-sheet-handle",
|
|
971
1028
|
"aria-hidden": "true"
|
|
972
1029
|
}) : null,
|
|
973
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ d("div", {
|
|
974
1031
|
className: "plinth-sheet-header",
|
|
975
1032
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ u("h2", {
|
|
977
1034
|
id: `${g}-title`,
|
|
978
1035
|
className: "plinth-sheet-title",
|
|
979
1036
|
children: t
|
|
980
1037
|
}),
|
|
981
|
-
_ ? /* @__PURE__ */
|
|
1038
|
+
_ ? /* @__PURE__ */ u("p", {
|
|
982
1039
|
id: `${g}-description`,
|
|
983
1040
|
className: "plinth-sheet-description",
|
|
984
1041
|
children: n
|
|
985
1042
|
}) : null,
|
|
986
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ u(q, {
|
|
987
1044
|
className: "plinth-sheet-close",
|
|
988
1045
|
label: r,
|
|
989
1046
|
variant: "ghost",
|
|
990
1047
|
commandfor: g,
|
|
991
1048
|
command: "close",
|
|
992
|
-
children: /* @__PURE__ */
|
|
1049
|
+
children: /* @__PURE__ */ u("svg", {
|
|
993
1050
|
viewBox: "0 0 24 24",
|
|
994
1051
|
fill: "none",
|
|
995
1052
|
stroke: "currentColor",
|
|
996
1053
|
strokeWidth: "2",
|
|
997
1054
|
strokeLinecap: "round",
|
|
998
1055
|
strokeLinejoin: "round",
|
|
999
|
-
children: /* @__PURE__ */
|
|
1056
|
+
children: /* @__PURE__ */ u("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
1000
1057
|
})
|
|
1001
1058
|
})
|
|
1002
1059
|
]
|
|
1003
1060
|
}),
|
|
1004
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ u("div", {
|
|
1005
1062
|
className: "plinth-sheet-body",
|
|
1006
|
-
children:
|
|
1063
|
+
children: l
|
|
1007
1064
|
}),
|
|
1008
|
-
|
|
1065
|
+
x(s) ? /* @__PURE__ */ u("div", {
|
|
1009
1066
|
className: "plinth-sheet-footer",
|
|
1010
1067
|
children: s
|
|
1011
1068
|
}) : null
|
|
@@ -1015,48 +1072,86 @@ function Ne({ id: e, title: t, description: n, closeLabel: r = "Close", side: a,
|
|
|
1015
1072
|
}
|
|
1016
1073
|
//#endregion
|
|
1017
1074
|
//#region src/PlinthMenuSheet.tsx
|
|
1018
|
-
var
|
|
1019
|
-
function
|
|
1020
|
-
let m =
|
|
1021
|
-
return /* @__PURE__ */
|
|
1075
|
+
var Z = (e) => e?.trim() ? e : void 0;
|
|
1076
|
+
function We({ id: e, title: t = "Menu", closeLabel: n = "Close", userName: r, userDetail: i, userSrc: a, userHref: s, account: c, className: l, children: f, ...p }) {
|
|
1077
|
+
let m = o(), h = e?.trim() || `plinth-menu-sheet-${m}`, g = Z(s);
|
|
1078
|
+
return /* @__PURE__ */ d(Ue, {
|
|
1022
1079
|
id: h,
|
|
1023
1080
|
title: t,
|
|
1024
1081
|
closeLabel: n,
|
|
1025
1082
|
side: "end",
|
|
1026
1083
|
sidePhone: "bottom",
|
|
1027
1084
|
...p,
|
|
1028
|
-
className:
|
|
1085
|
+
className: b("plinth-menu-sheet", l),
|
|
1029
1086
|
children: [
|
|
1030
|
-
r?.trim() ? /* @__PURE__ */
|
|
1087
|
+
r?.trim() ? /* @__PURE__ */ u(Ie, {
|
|
1031
1088
|
className: "plinth-menu-sheet-user",
|
|
1032
|
-
description:
|
|
1089
|
+
description: Z(i),
|
|
1033
1090
|
href: g,
|
|
1034
1091
|
chevron: !!g,
|
|
1035
|
-
leading: /* @__PURE__ */
|
|
1092
|
+
leading: /* @__PURE__ */ u(w, {
|
|
1036
1093
|
name: r,
|
|
1037
|
-
src:
|
|
1094
|
+
src: Z(a),
|
|
1038
1095
|
size: "lg",
|
|
1039
1096
|
decorative: !0
|
|
1040
1097
|
}),
|
|
1041
1098
|
children: r
|
|
1042
1099
|
}) : null,
|
|
1043
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ u("nav", {
|
|
1044
1101
|
className: "plinth-menu-sheet-nav",
|
|
1045
1102
|
"aria-labelledby": `${h}-title`,
|
|
1046
1103
|
children: f
|
|
1047
1104
|
}),
|
|
1048
|
-
|
|
1105
|
+
x(c) ? /* @__PURE__ */ u("div", {
|
|
1049
1106
|
className: "plinth-menu-sheet-account",
|
|
1050
|
-
children:
|
|
1107
|
+
children: c
|
|
1108
|
+
}) : null
|
|
1109
|
+
]
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
//#endregion
|
|
1113
|
+
//#region src/page-header.ts
|
|
1114
|
+
var Ge = [
|
|
1115
|
+
"h1",
|
|
1116
|
+
"h2",
|
|
1117
|
+
"h3",
|
|
1118
|
+
"h4",
|
|
1119
|
+
"h5",
|
|
1120
|
+
"h6"
|
|
1121
|
+
];
|
|
1122
|
+
function Q(e) {
|
|
1123
|
+
return Ge.includes(e) ? e : "h1";
|
|
1124
|
+
}
|
|
1125
|
+
//#endregion
|
|
1126
|
+
//#region src/PlinthPageHeader.tsx
|
|
1127
|
+
function Ke({ heading: e, level: t, top: n = !1, leading: r, actions: i, className: a, ...o }) {
|
|
1128
|
+
if (!e?.trim()) throw Error("<PlinthPageHeader> needs a heading: it is the page's heading.");
|
|
1129
|
+
let s = Q(t);
|
|
1130
|
+
return /* @__PURE__ */ d("header", {
|
|
1131
|
+
className: b("plinth-page-header", a),
|
|
1132
|
+
"data-top": n ? "" : void 0,
|
|
1133
|
+
...o,
|
|
1134
|
+
children: [
|
|
1135
|
+
x(r) ? /* @__PURE__ */ u("div", {
|
|
1136
|
+
className: "plinth-page-header-leading",
|
|
1137
|
+
children: r
|
|
1138
|
+
}) : null,
|
|
1139
|
+
/* @__PURE__ */ u(s, {
|
|
1140
|
+
className: "plinth-page-header-heading",
|
|
1141
|
+
children: e
|
|
1142
|
+
}),
|
|
1143
|
+
x(i) ? /* @__PURE__ */ u("div", {
|
|
1144
|
+
className: "plinth-page-header-actions",
|
|
1145
|
+
children: i
|
|
1051
1146
|
}) : null
|
|
1052
1147
|
]
|
|
1053
1148
|
});
|
|
1054
1149
|
}
|
|
1055
1150
|
//#endregion
|
|
1056
1151
|
//#region src/PlinthPill.tsx
|
|
1057
|
-
function
|
|
1058
|
-
let s = t ? "a" : "button",
|
|
1059
|
-
return /* @__PURE__ */
|
|
1152
|
+
function qe({ count: e, href: t, selected: n = !1, disabled: r = !1, className: i, children: a, ...o }) {
|
|
1153
|
+
let s = t ? "a" : "button", c = s, l = e != null && String(e).trim() !== "";
|
|
1154
|
+
return /* @__PURE__ */ d(c, {
|
|
1060
1155
|
type: s === "button" ? "button" : void 0,
|
|
1061
1156
|
href: s === "a" && !r ? t : void 0,
|
|
1062
1157
|
"aria-pressed": s === "button" ? String(n) : void 0,
|
|
@@ -1065,11 +1160,11 @@ function Fe({ count: e, href: t, selected: n = !1, disabled: r = !1, className:
|
|
|
1065
1160
|
role: s === "a" && r ? "link" : void 0,
|
|
1066
1161
|
"aria-disabled": s === "a" && r ? "true" : void 0,
|
|
1067
1162
|
...o,
|
|
1068
|
-
className:
|
|
1069
|
-
children: [/* @__PURE__ */
|
|
1163
|
+
className: b("plinth-pill", i),
|
|
1164
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1070
1165
|
className: "plinth-pill-label",
|
|
1071
1166
|
children: a
|
|
1072
|
-
}),
|
|
1167
|
+
}), l ? /* @__PURE__ */ u("span", {
|
|
1073
1168
|
className: "plinth-pill-count",
|
|
1074
1169
|
children: e
|
|
1075
1170
|
}) : null]
|
|
@@ -1077,31 +1172,31 @@ function Fe({ count: e, href: t, selected: n = !1, disabled: r = !1, className:
|
|
|
1077
1172
|
}
|
|
1078
1173
|
//#endregion
|
|
1079
1174
|
//#region src/PlinthPillRow.tsx
|
|
1080
|
-
function
|
|
1081
|
-
return /* @__PURE__ */
|
|
1175
|
+
function Je({ label: e, nav: t = !1, className: n, children: r, ...i }) {
|
|
1176
|
+
return /* @__PURE__ */ u(t ? "nav" : "div", {
|
|
1082
1177
|
role: t ? void 0 : "group",
|
|
1083
1178
|
"aria-label": e || void 0,
|
|
1084
1179
|
...i,
|
|
1085
|
-
className:
|
|
1180
|
+
className: b("plinth-pill-row", n),
|
|
1086
1181
|
children: r
|
|
1087
1182
|
});
|
|
1088
1183
|
}
|
|
1089
1184
|
//#endregion
|
|
1090
1185
|
//#region src/PlinthSectionMenu.tsx
|
|
1091
|
-
function
|
|
1092
|
-
return /* @__PURE__ */
|
|
1186
|
+
function Ye({ label: e, nav: t = !0, className: n, children: r, ...i }) {
|
|
1187
|
+
return /* @__PURE__ */ u(t ? "nav" : "div", {
|
|
1093
1188
|
role: t ? void 0 : "group",
|
|
1094
1189
|
"aria-label": e?.trim() ? e : void 0,
|
|
1095
1190
|
...i,
|
|
1096
|
-
className:
|
|
1191
|
+
className: b("plinth-section-menu", n),
|
|
1097
1192
|
children: r
|
|
1098
1193
|
});
|
|
1099
1194
|
}
|
|
1100
1195
|
//#endregion
|
|
1101
1196
|
//#region src/PlinthSectionMenuItem.tsx
|
|
1102
|
-
function
|
|
1103
|
-
let s = t?.trim() ? "a" : "button",
|
|
1104
|
-
return /* @__PURE__ */
|
|
1197
|
+
function Xe({ count: e, href: t, current: n = !1, disabled: r = !1, className: i, children: a, ...o }) {
|
|
1198
|
+
let s = t?.trim() ? "a" : "button", c = s, l = e != null && String(e).trim() !== "";
|
|
1199
|
+
return /* @__PURE__ */ d(c, {
|
|
1105
1200
|
type: s === "button" ? "button" : void 0,
|
|
1106
1201
|
href: s === "a" && !r ? t : void 0,
|
|
1107
1202
|
"aria-pressed": s === "button" ? String(n) : void 0,
|
|
@@ -1110,18 +1205,122 @@ function Re({ count: e, href: t, current: n = !1, disabled: r = !1, className: i
|
|
|
1110
1205
|
role: s === "a" && r ? "link" : void 0,
|
|
1111
1206
|
"aria-disabled": s === "a" && r ? "true" : void 0,
|
|
1112
1207
|
...o,
|
|
1113
|
-
className:
|
|
1114
|
-
children: [/* @__PURE__ */
|
|
1208
|
+
className: b("plinth-section-menu-item", i),
|
|
1209
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1115
1210
|
className: "plinth-section-menu-label",
|
|
1116
1211
|
children: a
|
|
1117
|
-
}),
|
|
1212
|
+
}), l ? /* @__PURE__ */ u("span", {
|
|
1118
1213
|
className: "plinth-section-menu-count",
|
|
1119
1214
|
children: e
|
|
1120
1215
|
}) : null]
|
|
1121
1216
|
});
|
|
1122
1217
|
}
|
|
1123
1218
|
//#endregion
|
|
1219
|
+
//#region src/text-field.ts
|
|
1220
|
+
var Ze = ["sm", "md"];
|
|
1221
|
+
function Qe(e) {
|
|
1222
|
+
return m(e, Ze, "md");
|
|
1223
|
+
}
|
|
1224
|
+
function $(e, t, n) {
|
|
1225
|
+
let r = [t?.trim() ? `${e}-description` : "", n?.trim() ? `${e}-error` : ""].filter(Boolean);
|
|
1226
|
+
return r.length ? r.join(" ") : void 0;
|
|
1227
|
+
}
|
|
1228
|
+
//#endregion
|
|
1229
|
+
//#region src/PlinthTextarea.tsx
|
|
1230
|
+
function $e({ label: e, hideLabel: t = !1, id: n, rows: r = 3, grow: i = !1, maxRows: a = 8, description: s, error: c, className: l, style: f, ...p }) {
|
|
1231
|
+
let m = o();
|
|
1232
|
+
if (!e?.trim()) throw Error("<PlinthTextarea> needs a label: it is the field's accessible name.");
|
|
1233
|
+
let h = n?.trim() || `plinth-textarea-${m}`, g = !!c?.trim(), _ = i ? {
|
|
1234
|
+
"--plinth-textarea-rows": r,
|
|
1235
|
+
"--plinth-textarea-max-rows": Math.max(a, r),
|
|
1236
|
+
...f
|
|
1237
|
+
} : f;
|
|
1238
|
+
return /* @__PURE__ */ d("div", {
|
|
1239
|
+
className: b("plinth-textarea", l),
|
|
1240
|
+
"data-label": t ? "hidden" : void 0,
|
|
1241
|
+
children: [
|
|
1242
|
+
/* @__PURE__ */ u("label", {
|
|
1243
|
+
className: "plinth-textarea-label",
|
|
1244
|
+
htmlFor: h,
|
|
1245
|
+
children: e
|
|
1246
|
+
}),
|
|
1247
|
+
/* @__PURE__ */ u("textarea", {
|
|
1248
|
+
id: h,
|
|
1249
|
+
className: "plinth-textarea-input",
|
|
1250
|
+
rows: r,
|
|
1251
|
+
"data-grow": i ? "" : void 0,
|
|
1252
|
+
style: _,
|
|
1253
|
+
"aria-describedby": $(h, s, c),
|
|
1254
|
+
"aria-invalid": g ? "true" : void 0,
|
|
1255
|
+
...p
|
|
1256
|
+
}),
|
|
1257
|
+
s?.trim() ? /* @__PURE__ */ u("p", {
|
|
1258
|
+
id: `${h}-description`,
|
|
1259
|
+
className: "plinth-textarea-description",
|
|
1260
|
+
children: s
|
|
1261
|
+
}) : null,
|
|
1262
|
+
g ? /* @__PURE__ */ u("p", {
|
|
1263
|
+
id: `${h}-error`,
|
|
1264
|
+
className: "plinth-textarea-error",
|
|
1265
|
+
children: c
|
|
1266
|
+
}) : null
|
|
1267
|
+
]
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
//#endregion
|
|
1271
|
+
//#region src/PlinthTextField.tsx
|
|
1272
|
+
function et({ label: e, hideLabel: t = !1, id: n, type: r = "text", size: i, description: a, error: s, icon: c, trailing: l, className: f, ...p }) {
|
|
1273
|
+
let m = o();
|
|
1274
|
+
if (!e?.trim()) throw Error("<PlinthTextField> needs a label: it is the field's accessible name.");
|
|
1275
|
+
let h = n?.trim() || `plinth-text-field-${m}`, g = !!s?.trim();
|
|
1276
|
+
return /* @__PURE__ */ d("div", {
|
|
1277
|
+
className: b("plinth-text-field", f),
|
|
1278
|
+
"data-size": Qe(i),
|
|
1279
|
+
"data-label": t ? "hidden" : void 0,
|
|
1280
|
+
children: [
|
|
1281
|
+
/* @__PURE__ */ u("label", {
|
|
1282
|
+
className: "plinth-text-field-label",
|
|
1283
|
+
htmlFor: h,
|
|
1284
|
+
children: e
|
|
1285
|
+
}),
|
|
1286
|
+
/* @__PURE__ */ d("div", {
|
|
1287
|
+
className: "plinth-text-field-control",
|
|
1288
|
+
children: [
|
|
1289
|
+
x(c) ? /* @__PURE__ */ u("span", {
|
|
1290
|
+
className: "plinth-icon",
|
|
1291
|
+
"data-size": "sm",
|
|
1292
|
+
"aria-hidden": "true",
|
|
1293
|
+
children: c
|
|
1294
|
+
}) : null,
|
|
1295
|
+
/* @__PURE__ */ u("input", {
|
|
1296
|
+
id: h,
|
|
1297
|
+
type: r,
|
|
1298
|
+
className: "plinth-text-field-input",
|
|
1299
|
+
"aria-describedby": $(h, a, s),
|
|
1300
|
+
"aria-invalid": g ? "true" : void 0,
|
|
1301
|
+
...p
|
|
1302
|
+
}),
|
|
1303
|
+
x(l) ? /* @__PURE__ */ u("span", {
|
|
1304
|
+
className: "plinth-text-field-trailing",
|
|
1305
|
+
children: l
|
|
1306
|
+
}) : null
|
|
1307
|
+
]
|
|
1308
|
+
}),
|
|
1309
|
+
a?.trim() ? /* @__PURE__ */ u("p", {
|
|
1310
|
+
id: `${h}-description`,
|
|
1311
|
+
className: "plinth-text-field-description",
|
|
1312
|
+
children: a
|
|
1313
|
+
}) : null,
|
|
1314
|
+
g ? /* @__PURE__ */ u("p", {
|
|
1315
|
+
id: `${h}-error`,
|
|
1316
|
+
className: "plinth-text-field-error",
|
|
1317
|
+
children: s
|
|
1318
|
+
}) : null
|
|
1319
|
+
]
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
//#endregion
|
|
1124
1323
|
//#region src/list-row.ts
|
|
1125
|
-
var
|
|
1324
|
+
var tt = "<span class=\"plinth-icon plinth-list-row-chevron\" data-size=\"sm\" data-mirror aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 6l6 6-6 6\"></path></svg></span>";
|
|
1126
1325
|
//#endregion
|
|
1127
|
-
export {
|
|
1326
|
+
export { X as MenuIdContext, w as PlinthAvatar, T as PlinthBadge, O as PlinthButton, te as PlinthCallout, oe as PlinthCodeBlock, de as PlinthConfirmDialog, fe as PlinthDataTable, me as PlinthDataTableCell, he as PlinthDataTableColumn, ve as PlinthDataTableEmpty, ye as PlinthDataTableRow, be as PlinthDataTableSort, Se as PlinthDialog, ke as PlinthDrawer, Me as PlinthIcon, q as PlinthIconButton, Fe as PlinthListCard, Ie as PlinthListRow, ze as PlinthMenu, Be as PlinthMenuGroup, Ve as PlinthMenuItem, He as PlinthMenuSeparator, We as PlinthMenuSheet, Ke as PlinthPageHeader, qe as PlinthPill, Je as PlinthPillRow, Ye as PlinthSectionMenu, Xe as PlinthSectionMenuItem, Ue as PlinthSheet, et as PlinthTextField, $e as PlinthTextarea, y as avatarGlyph, g as avatarSizes, E as buttonVariants, ee as calloutIcons, M as calloutRole, j as calloutRoles, A as calloutTone, k as calloutTones, F as confirmDialogFieldLabels, ce as confirmDialogKind, se as confirmDialogKinds, I as confirmDialogPattern, P as confirmDialogTone, le as confirmDialogTones, p as controlSizes, K as dataTableCellKind, G as dataTableCellKinds, W as dataTableSort, pe as dataTableSortIcon, U as dataTableSorts, ue as dialogCloseIcon, H as dialogSidePhone, V as dialogSidePhones, Oe as drawerCloseIcon, we as drawerDesktop, Ce as drawerDesktops, De as drawerSnap, Ee as drawerSnapPoints, Te as drawerSnaps, $ as fieldDescribedBy, Pe as headingLevel, Ne as headingLevels, h as iconSizeFor, Ae as iconSizes, v as initialsFrom, tt as listRowChevron, Re as menuItemTone, Le as menuItemTones, Q as pageHeaderLevel, Ge as pageHeaderLevels, m as resolveSize, B as sheetCloseIcon, R as sheetSide, z as sheetSidePhone, L as sheetSides, f as sizes, J as swipeToClose, Qe as textFieldSize, Ze as textFieldSizes, S as tones, Y as useSwipeToClose };
|