@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.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/packages/css/dist/menu.css +245 -0
  4. package/packages/css/dist/page-header.css +124 -0
  5. package/packages/css/dist/plinth.css +833 -160
  6. package/packages/css/dist/section-menu.css +6 -5
  7. package/packages/css/dist/text-field.css +230 -0
  8. package/packages/css/dist/textarea.css +169 -0
  9. package/packages/css/dist/tokens.css +9 -1
  10. package/packages/react/dist/PlinthMenu.d.ts +12 -0
  11. package/packages/react/dist/PlinthMenuGroup.d.ts +9 -0
  12. package/packages/react/dist/PlinthMenuItem.d.ts +26 -0
  13. package/packages/react/dist/PlinthMenuSeparator.d.ts +4 -0
  14. package/packages/react/dist/PlinthPageHeader.d.ts +17 -0
  15. package/packages/react/dist/PlinthTextField.d.ts +24 -0
  16. package/packages/react/dist/PlinthTextarea.d.ts +24 -0
  17. package/packages/react/dist/index.d.ts +10 -1
  18. package/packages/react/dist/index.js +565 -366
  19. package/packages/react/dist/menu.d.ts +7 -0
  20. package/packages/react/dist/page-header.d.ts +5 -0
  21. package/packages/react/dist/text-field.d.ts +10 -0
  22. package/packages/tokens/dist/index.d.ts +13 -1
  23. package/packages/tokens/dist/index.js +131 -6
  24. package/packages/tokens/dist/tailwind-theme.css +2 -2
  25. package/packages/tokens/dist/tokens.css +9 -1
  26. package/packages/tokens/dist/tokens.json +116 -3
  27. package/packages/vue/dist/PlinthMenu.vue.d.ts +24 -0
  28. package/packages/vue/dist/{PlinthHeader.vue.d.ts → PlinthMenuGroup.vue.d.ts} +5 -7
  29. package/packages/vue/dist/PlinthMenuItem.vue.d.ts +34 -0
  30. package/packages/vue/dist/PlinthMenuSeparator.vue.d.ts +3 -0
  31. package/packages/vue/dist/PlinthPageHeader.vue.d.ts +27 -0
  32. package/packages/vue/dist/PlinthTextField.vue.d.ts +51 -0
  33. package/packages/vue/dist/PlinthTextarea.vue.d.ts +42 -0
  34. package/packages/vue/dist/index.d.ts +11 -2
  35. package/packages/vue/dist/index.js +661 -368
  36. package/packages/vue/dist/menu.d.ts +8 -0
  37. package/packages/vue/dist/page-header.d.ts +5 -0
  38. package/packages/vue/dist/text-field.d.ts +10 -0
  39. package/packages/react/dist/PlinthHeader.d.ts +0 -12
@@ -1,58 +1,58 @@
1
- import { Comment as e, Fragment as t, Static as n, Text as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useAttrs as S, useId as C, useSlots as w, warn as T, watchEffect as E, withCtx as D } from "vue";
1
+ import { Comment as e, Fragment as t, Static as n, Text as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, inject as f, mergeModels as p, mergeProps as m, normalizeClass as h, onBeforeUnmount as g, onMounted as _, openBlock as v, provide as y, ref as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useAttrs as E, useId as D, useModel as O, useSlots as k, warn as A, watchEffect as ee, withCtx as j } from "vue";
2
2
  //#region src/size.ts
3
- var O = [
3
+ var te = [
4
4
  "xs",
5
5
  "sm",
6
6
  "md",
7
7
  "lg",
8
8
  "xl"
9
- ], k = [
9
+ ], M = [
10
10
  "sm",
11
11
  "md",
12
12
  "lg"
13
13
  ];
14
- function A(e, t, n) {
14
+ function N(e, t, n) {
15
15
  return t.includes(e) ? e : n;
16
16
  }
17
- function j(e) {
17
+ function P(e) {
18
18
  return e === "xs" || e === "sm" ? "sm" : "md";
19
19
  }
20
20
  //#endregion
21
21
  //#region src/avatar.ts
22
- var ee = [
22
+ var ne = [
23
23
  "sm",
24
24
  "md",
25
25
  "lg",
26
26
  "xl"
27
27
  ];
28
- function te(e) {
29
- return A(e, ee, "md");
28
+ function re(e) {
29
+ return N(e, ne, "md");
30
30
  }
31
- function M(e) {
31
+ function ie(e) {
32
32
  let t = e.trim().split(/\s+/).filter(Boolean);
33
33
  return t.length === 0 ? "" : ([...t[0]][0] + (t.length > 1 ? [...t.at(-1)][0] : "")).toUpperCase();
34
34
  }
35
- var ne = "<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>", N = [
35
+ var ae = "<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>", F = [
36
36
  "neutral",
37
37
  "success",
38
38
  "warning",
39
39
  "danger"
40
40
  ];
41
- function re(e) {
42
- return N.includes(e) ? e : N[0];
41
+ function oe(e) {
42
+ return F.includes(e) ? e : F[0];
43
43
  }
44
44
  //#endregion
45
45
  //#region src/PlinthAvatar.vue?vue&type=script&setup=true&lang.ts
46
- var ie = [
46
+ var se = [
47
47
  "data-size",
48
48
  "role",
49
49
  "aria-label",
50
50
  "aria-hidden"
51
- ], ae = ["src"], oe = {
51
+ ], ce = ["src"], le = {
52
52
  key: 1,
53
53
  class: "plinth-avatar-initials",
54
54
  "aria-hidden": "true"
55
- }, se = {
55
+ }, ue = {
56
56
  key: 2,
57
57
  class: "plinth-avatar-glyph",
58
58
  viewBox: "0 0 24 24",
@@ -61,7 +61,7 @@ var ie = [
61
61
  "stroke-width": "1.5",
62
62
  "stroke-linecap": "round",
63
63
  "aria-hidden": "true"
64
- }, ce = ["data-tone"], P = /* @__PURE__ */ d({
64
+ }, de = ["data-tone"], I = /* @__PURE__ */ d({
65
65
  __name: "PlinthAvatar",
66
66
  props: {
67
67
  name: { default: "" },
@@ -76,38 +76,38 @@ var ie = [
76
76
  }
77
77
  },
78
78
  setup(e) {
79
- let t = e, n = i(() => te(t.size)), r = i(() => t.status ? re(t.status) : void 0), a = i(() => {
79
+ let t = e, n = i(() => re(t.size)), r = i(() => t.status ? oe(t.status) : void 0), a = i(() => {
80
80
  if (!t.decorative) return r.value && t.statusLabel ? `${t.name}, ${t.statusLabel}` : t.name;
81
- }), l = i(() => t.initials ?? M(t.name));
82
- return E(() => {
83
- t.decorative || (t.name.trim() || T("PlinthAvatar needs a name, or decorative when the name is shown next to it."), t.status && !t.statusLabel && T("PlinthAvatar needs a statusLabel with a status: colour alone does not say what it means."));
84
- }), (t, i) => (h(), s("span", {
81
+ }), l = i(() => t.initials ?? ie(t.name));
82
+ return ee(() => {
83
+ t.decorative || (t.name.trim() || A("PlinthAvatar needs a name, or decorative when the name is shown next to it."), t.status && !t.statusLabel && A("PlinthAvatar needs a statusLabel with a status: colour alone does not say what it means."));
84
+ }), (t, i) => (v(), s("span", {
85
85
  class: "plinth-avatar",
86
86
  "data-size": n.value,
87
87
  role: a.value === void 0 ? void 0 : "img",
88
88
  "aria-label": a.value,
89
89
  "aria-hidden": e.decorative ? "true" : void 0
90
- }, [e.src ? (h(), s("img", {
90
+ }, [e.src ? (v(), s("img", {
91
91
  key: 0,
92
92
  class: "plinth-avatar-image",
93
93
  src: e.src,
94
94
  alt: ""
95
- }, null, 8, ae)) : l.value ? (h(), s("span", oe, b(l.value), 1)) : (h(), s("svg", se, [...i[0] ||= [c("circle", {
95
+ }, null, 8, ce)) : l.value ? (v(), s("span", le, w(l.value), 1)) : (v(), s("svg", ue, [...i[0] ||= [c("circle", {
96
96
  cx: "12",
97
97
  cy: "9",
98
98
  r: "4"
99
- }, null, -1), c("path", { d: "M4.5 20a7.5 7.5 0 0 1 15 0" }, null, -1)]])), r.value ? (h(), s("span", {
99
+ }, null, -1), c("path", { d: "M4.5 20a7.5 7.5 0 0 1 15 0" }, null, -1)]])), r.value ? (v(), s("span", {
100
100
  key: 3,
101
101
  class: "plinth-avatar-status",
102
102
  "data-tone": r.value,
103
103
  "aria-hidden": "true"
104
- }, null, 8, ce)) : o("", !0)], 8, ie));
104
+ }, null, 8, de)) : o("", !0)], 8, se));
105
105
  }
106
- }), le = ["data-tone"], ue = {
106
+ }), fe = ["data-tone"], pe = {
107
107
  key: 0,
108
108
  class: "plinth-badge-dot",
109
109
  "aria-hidden": "true"
110
- }, de = { class: "plinth-badge-label" }, F = /* @__PURE__ */ d({
110
+ }, me = { class: "plinth-badge-label" }, he = /* @__PURE__ */ d({
111
111
  __name: "PlinthBadge",
112
112
  props: {
113
113
  tone: { default: "neutral" },
@@ -117,13 +117,13 @@ var ie = [
117
117
  }
118
118
  },
119
119
  setup(e) {
120
- let t = e, n = i(() => re(t.tone));
121
- return (t, r) => (h(), s("span", {
120
+ let t = e, n = i(() => oe(t.tone));
121
+ return (t, r) => (v(), s("span", {
122
122
  class: "plinth-badge",
123
123
  "data-tone": n.value
124
- }, [e.dot ? (h(), s("span", ue)) : o("", !0), c("span", de, [v(t.$slots, "default")])], 8, le));
124
+ }, [e.dot ? (v(), s("span", pe)) : o("", !0), c("span", me, [S(t.$slots, "default")])], 8, fe));
125
125
  }
126
- }), I = [
126
+ }), ge = [
127
127
  "primary",
128
128
  "accent",
129
129
  "secondary",
@@ -131,33 +131,33 @@ var ie = [
131
131
  "danger",
132
132
  "danger-ghost"
133
133
  ];
134
- function L(e) {
135
- return I.includes(e) ? e : "primary";
134
+ function _e(e) {
135
+ return ge.includes(e) ? e : "primary";
136
136
  }
137
137
  //#endregion
138
138
  //#region src/PlinthButton.vue?vue&type=script&setup=true&lang.ts
139
- var fe = [
139
+ var ve = [
140
140
  "href",
141
141
  "data-variant",
142
142
  "data-size",
143
143
  "role",
144
144
  "aria-busy",
145
145
  "aria-disabled"
146
- ], pe = {
146
+ ], ye = {
147
147
  key: 0,
148
148
  class: "plinth-button-spinner",
149
149
  "aria-hidden": "true"
150
- }, me = ["data-size", "data-mirror"], he = { class: "plinth-button-label" }, ge = ["data-size", "data-mirror"], _e = [
150
+ }, be = ["data-size", "data-mirror"], xe = { class: "plinth-button-label" }, Se = ["data-size", "data-mirror"], Ce = [
151
151
  "data-variant",
152
152
  "data-size",
153
153
  "disabled",
154
154
  "aria-busy",
155
155
  "aria-disabled"
156
- ], ve = {
156
+ ], we = {
157
157
  key: 0,
158
158
  class: "plinth-button-spinner",
159
159
  "aria-hidden": "true"
160
- }, ye = ["data-size", "data-mirror"], be = { class: "plinth-button-label" }, xe = ["data-size", "data-mirror"], R = /* @__PURE__ */ d({
160
+ }, Te = ["data-size", "data-mirror"], Ee = { class: "plinth-button-label" }, De = ["data-size", "data-mirror"], L = /* @__PURE__ */ d({
161
161
  __name: "PlinthButton",
162
162
  props: {
163
163
  variant: { default: "primary" },
@@ -181,8 +181,8 @@ var fe = [
181
181
  }
182
182
  },
183
183
  setup(e) {
184
- let t = e, n = i(() => L(t.variant)), r = i(() => A(t.size, k, "md")), a = i(() => j(r.value)), l = i(() => t.busy && !t.disabled);
185
- return (t, i) => e.href ? (h(), s("a", {
184
+ let t = e, n = i(() => _e(t.variant)), r = i(() => N(t.size, M, "md")), a = i(() => P(r.value)), l = i(() => t.busy && !t.disabled);
185
+ return (t, i) => e.href ? (v(), s("a", {
186
186
  key: 0,
187
187
  class: "plinth-button",
188
188
  href: e.disabled ? void 0 : e.href,
@@ -192,22 +192,22 @@ var fe = [
192
192
  "aria-busy": l.value ? "true" : void 0,
193
193
  "aria-disabled": l.value || e.disabled ? "true" : void 0
194
194
  }, [
195
- l.value ? (h(), s("span", pe)) : t.$slots.icon ? (h(), s("span", {
195
+ l.value ? (v(), s("span", ye)) : t.$slots.icon ? (v(), s("span", {
196
196
  key: 1,
197
197
  class: "plinth-icon",
198
198
  "data-size": a.value,
199
199
  "data-mirror": e.mirrorIcon ? "" : void 0,
200
200
  "aria-hidden": "true"
201
- }, [v(t.$slots, "icon")], 8, me)) : o("", !0),
202
- c("span", he, [v(t.$slots, "default")]),
203
- t.$slots.trailing ? (h(), s("span", {
201
+ }, [S(t.$slots, "icon")], 8, be)) : o("", !0),
202
+ c("span", xe, [S(t.$slots, "default")]),
203
+ t.$slots.trailing ? (v(), s("span", {
204
204
  key: 2,
205
205
  class: "plinth-icon",
206
206
  "data-size": a.value,
207
207
  "data-mirror": e.mirrorTrailing ? "" : void 0,
208
208
  "aria-hidden": "true"
209
- }, [v(t.$slots, "trailing")], 8, ge)) : o("", !0)
210
- ], 8, fe)) : (h(), s("button", {
209
+ }, [S(t.$slots, "trailing")], 8, Se)) : o("", !0)
210
+ ], 8, ve)) : (v(), s("button", {
211
211
  key: 1,
212
212
  type: "button",
213
213
  class: "plinth-button",
@@ -217,62 +217,62 @@ var fe = [
217
217
  "aria-busy": l.value ? "true" : void 0,
218
218
  "aria-disabled": l.value ? "true" : void 0
219
219
  }, [
220
- l.value ? (h(), s("span", ve)) : t.$slots.icon ? (h(), s("span", {
220
+ l.value ? (v(), s("span", we)) : t.$slots.icon ? (v(), s("span", {
221
221
  key: 1,
222
222
  class: "plinth-icon",
223
223
  "data-size": a.value,
224
224
  "data-mirror": e.mirrorIcon ? "" : void 0,
225
225
  "aria-hidden": "true"
226
- }, [v(t.$slots, "icon")], 8, ye)) : o("", !0),
227
- c("span", be, [v(t.$slots, "default")]),
228
- t.$slots.trailing ? (h(), s("span", {
226
+ }, [S(t.$slots, "icon")], 8, Te)) : o("", !0),
227
+ c("span", Ee, [S(t.$slots, "default")]),
228
+ t.$slots.trailing ? (v(), s("span", {
229
229
  key: 2,
230
230
  class: "plinth-icon",
231
231
  "data-size": a.value,
232
232
  "data-mirror": e.mirrorTrailing ? "" : void 0,
233
233
  "aria-hidden": "true"
234
- }, [v(t.$slots, "trailing")], 8, xe)) : o("", !0)
235
- ], 8, _e));
234
+ }, [S(t.$slots, "trailing")], 8, De)) : o("", !0)
235
+ ], 8, Ce));
236
236
  }
237
- }), z = [
237
+ }), Oe = [
238
238
  "neutral",
239
239
  "info",
240
240
  "success",
241
241
  "warning",
242
242
  "danger"
243
243
  ];
244
- function B(e) {
245
- return z.includes(e) ? e : "neutral";
244
+ function ke(e) {
245
+ return Oe.includes(e) ? e : "neutral";
246
246
  }
247
- var V = [
247
+ var Ae = [
248
248
  "note",
249
249
  "status",
250
250
  "alert"
251
251
  ];
252
- function H(e) {
253
- return V.includes(e) ? e : "note";
252
+ function je(e) {
253
+ return Ae.includes(e) ? e : "note";
254
254
  }
255
- var U = (e) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${e}</svg>`, W = {
256
- neutral: U("<rect x=\"5\" y=\"4\" width=\"14\" height=\"16\" rx=\"2\"></rect><path d=\"M9 9h6M9 13h6M9 17h3\"></path>"),
257
- info: U("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M12 11v5M12 7.5v.01\"></path>"),
258
- success: U("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M8 12.5l2.5 2.5L16 9.5\"></path>"),
259
- warning: U("<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>"),
260
- danger: U("<path d=\"M8.5 3h7L21 8.5v7L15.5 21h-7L3 15.5v-7z\"></path><path d=\"M12 7.5v5M12 16v.01\"></path>")
261
- }, G = (i) => (i ?? []).some((i) => i.type === e ? !1 : i.type === r || i.type === n ? String(i.children).trim() !== "" : i.type !== t || G(i.children)), Se = ["data-tone", "role"], Ce = {
255
+ var R = (e) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${e}</svg>`, Me = {
256
+ neutral: R("<rect x=\"5\" y=\"4\" width=\"14\" height=\"16\" rx=\"2\"></rect><path d=\"M9 9h6M9 13h6M9 17h3\"></path>"),
257
+ info: R("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M12 11v5M12 7.5v.01\"></path>"),
258
+ success: R("<circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M8 12.5l2.5 2.5L16 9.5\"></path>"),
259
+ warning: R("<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>"),
260
+ danger: R("<path d=\"M8.5 3h7L21 8.5v7L15.5 21h-7L3 15.5v-7z\"></path><path d=\"M12 7.5v5M12 16v.01\"></path>")
261
+ }, z = (i) => (i ?? []).some((i) => i.type === e ? !1 : i.type === r || i.type === n ? String(i.children).trim() !== "" : i.type !== t || z(i.children)), Ne = ["data-tone", "role"], Pe = {
262
262
  key: 0,
263
263
  class: "plinth-icon plinth-callout-icon",
264
264
  "data-size": "md",
265
265
  "aria-hidden": "true"
266
- }, we = ["innerHTML"], Te = { class: "plinth-callout-body" }, Ee = {
266
+ }, Fe = ["innerHTML"], Ie = { class: "plinth-callout-body" }, Le = {
267
267
  key: 0,
268
268
  class: "plinth-callout-title"
269
- }, De = {
269
+ }, Re = {
270
270
  key: 1,
271
271
  class: "plinth-callout-text"
272
- }, Oe = {
272
+ }, ze = {
273
273
  key: 2,
274
274
  class: "plinth-callout-actions"
275
- }, ke = /* @__PURE__ */ d({
275
+ }, Be = /* @__PURE__ */ d({
276
276
  __name: "PlinthCallout",
277
277
  props: {
278
278
  tone: { default: "neutral" },
@@ -280,60 +280,60 @@ var U = (e) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strok
280
280
  title: { default: void 0 }
281
281
  },
282
282
  setup(e) {
283
- let t = e, n = w(), r = i(() => B(t.tone)), a = i(() => H(t.role));
284
- return (t, i) => (h(), s("div", {
283
+ let t = e, n = k(), r = i(() => ke(t.tone)), a = i(() => je(t.role));
284
+ return (t, i) => (v(), s("div", {
285
285
  class: "plinth-callout",
286
286
  "data-tone": r.value,
287
287
  role: a.value
288
- }, [x(G)(x(n).icon?.()) ? (h(), s("span", Ce, [v(t.$slots, "icon")])) : (h(), s("span", {
288
+ }, [T(z)(T(n).icon?.()) ? (v(), s("span", Pe, [S(t.$slots, "icon")])) : (v(), s("span", {
289
289
  key: 1,
290
290
  class: "plinth-icon plinth-callout-icon",
291
291
  "data-size": "md",
292
292
  "aria-hidden": "true",
293
- innerHTML: x(W)[r.value]
294
- }, null, 8, we)), c("div", Te, [
295
- e.title?.trim() || x(G)(x(n).title?.()) ? (h(), s("p", Ee, [v(t.$slots, "title", {}, () => [l(b(e.title), 1)])])) : o("", !0),
296
- x(G)(x(n).default?.()) ? (h(), s("div", De, [v(t.$slots, "default")])) : o("", !0),
297
- x(G)(x(n).actions?.()) ? (h(), s("div", Oe, [v(t.$slots, "actions")])) : o("", !0)
298
- ])], 8, Se));
293
+ innerHTML: T(Me)[r.value]
294
+ }, null, 8, Fe)), c("div", Ie, [
295
+ e.title?.trim() || T(z)(T(n).title?.()) ? (v(), s("p", Le, [S(t.$slots, "title", {}, () => [l(w(e.title), 1)])])) : o("", !0),
296
+ T(z)(T(n).default?.()) ? (v(), s("div", Re, [S(t.$slots, "default")])) : o("", !0),
297
+ T(z)(T(n).actions?.()) ? (v(), s("div", ze, [S(t.$slots, "actions")])) : o("", !0)
298
+ ])], 8, Ne));
299
299
  }
300
- }), Ae = (e) => e.slice(0, 6), je = (e, t) => Math.max(0, e.findIndex((e) => e.label === t));
301
- function Me(e) {
300
+ }), B = (e) => e.slice(0, 6), Ve = (e, t) => Math.max(0, e.findIndex((e) => e.label === t));
301
+ function He(e) {
302
302
  let t = e.closest(".plinth-code-block"), n = [...t?.querySelectorAll(".plinth-code-block-tab-input") ?? []], r = Math.max(0, n.findIndex((e) => e.checked));
303
303
  return t?.querySelectorAll(".plinth-code-block-code")[r]?.textContent ?? "";
304
304
  }
305
305
  //#endregion
306
306
  //#region src/PlinthCodeBlock.vue?vue&type=script&setup=true&lang.ts
307
- var Ne = ["id"], Pe = { class: "plinth-code-block-header" }, Fe = {
307
+ var Ue = ["id"], We = { class: "plinth-code-block-header" }, Ge = {
308
308
  key: 0,
309
309
  class: "plinth-code-block-label"
310
- }, Ie = {
310
+ }, Ke = {
311
311
  key: 1,
312
312
  class: "plinth-code-block-label"
313
- }, Le = ["aria-label"], Re = ["name", "checked"], ze = { class: "plinth-code-block-tab-label" }, Be = {
313
+ }, qe = ["aria-label"], Je = ["name", "checked"], Ye = { class: "plinth-code-block-tab-label" }, Xe = {
314
314
  class: "plinth-code-block-status",
315
315
  role: "status"
316
- }, Ve = {
316
+ }, Ze = {
317
317
  key: 0,
318
318
  class: "plinth-code-block-code",
319
319
  dir: "ltr",
320
320
  tabindex: "0"
321
- }, He = ["innerHTML"], Ue = {
321
+ }, Qe = ["innerHTML"], $e = {
322
322
  key: 1,
323
323
  class: "plinth-code-block-code",
324
324
  dir: "ltr",
325
325
  tabindex: "0"
326
- }, We = {
326
+ }, et = {
327
327
  key: 1,
328
328
  class: "plinth-code-block-code",
329
329
  dir: "ltr",
330
330
  tabindex: "0"
331
- }, Ge = ["innerHTML"], Ke = {
331
+ }, tt = ["innerHTML"], nt = {
332
332
  key: 2,
333
333
  class: "plinth-code-block-code",
334
334
  dir: "ltr",
335
335
  tabindex: "0"
336
- }, qe = /* @__PURE__ */ d({
336
+ }, V = /* @__PURE__ */ d({
337
337
  __name: "PlinthCodeBlock",
338
338
  props: {
339
339
  id: { default: void 0 },
@@ -351,102 +351,102 @@ var Ne = ["id"], Pe = { class: "plinth-code-block-header" }, Fe = {
351
351
  },
352
352
  emits: ["copied"],
353
353
  setup(e, { emit: n }) {
354
- let r = e, a = n, d = w(), f = C(), y = i(() => r.id?.trim() || void 0), S = i(() => `${y.value ?? `plinth-code-block-${f}`}-language`), T = i(() => Ae(r.tabs)), E = je(Ae(r.tabs), r.selected), O = g(!1), k = g(!1), A;
355
- m(() => {
356
- O.value = !!navigator.clipboard;
357
- }), p(() => clearTimeout(A));
358
- async function j(e) {
359
- let t = Me(e.currentTarget);
354
+ let r = e, a = n, d = k(), f = D(), p = i(() => r.id?.trim() || void 0), m = i(() => `${p.value ?? `plinth-code-block-${f}`}-language`), h = i(() => B(r.tabs)), y = Ve(B(r.tabs), r.selected), C = b(!1), E = b(!1), O;
355
+ _(() => {
356
+ C.value = !!navigator.clipboard;
357
+ }), g(() => clearTimeout(O));
358
+ async function A(e) {
359
+ let t = He(e.currentTarget);
360
360
  try {
361
361
  await navigator.clipboard.writeText(t);
362
362
  } catch {
363
363
  return;
364
364
  }
365
- k.value = !0, clearTimeout(A), A = setTimeout(() => k.value = !1, 2e3), a("copied", t);
365
+ E.value = !0, clearTimeout(O), O = setTimeout(() => E.value = !1, 2e3), a("copied", t);
366
366
  }
367
- return (n, r) => (h(), s("div", {
368
- id: y.value,
367
+ return (n, r) => (v(), s("div", {
368
+ id: p.value,
369
369
  class: "plinth-code-block"
370
- }, [c("div", Pe, [
371
- x(G)(x(d).label?.()) ? (h(), s("span", Fe, [v(n.$slots, "label")])) : e.label?.trim() ? (h(), s("span", Ie, b(e.label), 1)) : o("", !0),
372
- T.value.length ? (h(), s("div", {
370
+ }, [c("div", We, [
371
+ T(z)(T(d).label?.()) ? (v(), s("span", Ge, [S(n.$slots, "label")])) : e.label?.trim() ? (v(), s("span", Ke, w(e.label), 1)) : o("", !0),
372
+ h.value.length ? (v(), s("div", {
373
373
  key: 2,
374
374
  class: "plinth-code-block-tabs",
375
375
  role: "radiogroup",
376
376
  "aria-label": e.tabsLabel
377
- }, [(h(!0), s(t, null, _(T.value, (e, t) => (h(), s("label", {
377
+ }, [(v(!0), s(t, null, x(h.value, (e, t) => (v(), s("label", {
378
378
  key: t,
379
379
  class: "plinth-code-block-tab"
380
380
  }, [c("input", {
381
381
  type: "radio",
382
382
  class: "plinth-code-block-tab-input",
383
- name: S.value,
384
- checked: t === x(E)
385
- }, null, 8, Re), c("span", ze, b(e.label), 1)]))), 128))], 8, Le)) : o("", !0),
386
- e.copy ? (h(), s(t, { key: 3 }, [u(R, {
383
+ name: m.value,
384
+ checked: t === T(y)
385
+ }, null, 8, Je), c("span", Ye, w(e.label), 1)]))), 128))], 8, qe)) : o("", !0),
386
+ e.copy ? (v(), s(t, { key: 3 }, [u(L, {
387
387
  class: "plinth-code-block-copy",
388
388
  variant: "ghost",
389
389
  size: "sm",
390
- hidden: !O.value,
391
- onClick: j
390
+ hidden: !C.value,
391
+ onClick: A
392
392
  }, {
393
- default: D(() => [l(b(k.value ? e.copiedLabel : e.copyLabel), 1)]),
393
+ default: j(() => [l(w(E.value ? e.copiedLabel : e.copyLabel), 1)]),
394
394
  _: 1
395
- }, 8, ["hidden"]), c("span", Be, b(k.value ? e.copiedLabel : ""), 1)], 64)) : o("", !0)
396
- ]), T.value.length ? (h(!0), s(t, { key: 0 }, _(T.value, (e, n) => (h(), s(t, { key: n }, [e.html === void 0 ? (h(), s("pre", Ue, [c("code", null, b(e.code), 1)])) : (h(), s("pre", Ve, [c("code", { innerHTML: e.html }, null, 8, He)]))], 64))), 128)) : e.html === void 0 ? (h(), s("pre", Ke, [c("code", null, [v(n.$slots, "default")])])) : (h(), s("pre", We, [c("code", { innerHTML: e.html }, null, 8, Ge)]))], 8, Ne));
395
+ }, 8, ["hidden"]), c("span", Xe, w(E.value ? e.copiedLabel : ""), 1)], 64)) : o("", !0)
396
+ ]), h.value.length ? (v(!0), s(t, { key: 0 }, x(h.value, (e, n) => (v(), s(t, { key: n }, [e.html === void 0 ? (v(), s("pre", $e, [c("code", null, w(e.code), 1)])) : (v(), s("pre", Ze, [c("code", { innerHTML: e.html }, null, 8, Qe)]))], 64))), 128)) : e.html === void 0 ? (v(), s("pre", nt, [c("code", null, [S(n.$slots, "default")])])) : (v(), s("pre", et, [c("code", { innerHTML: e.html }, null, 8, tt)]))], 8, Ue));
397
397
  }
398
- }), Je = [
398
+ }), H = [
399
399
  "simple",
400
400
  "type",
401
401
  "password"
402
402
  ];
403
- function Ye(e) {
404
- return Je.includes(e) ? e : "simple";
403
+ function U(e) {
404
+ return H.includes(e) ? e : "simple";
405
405
  }
406
- var Xe = ["neutral", "danger"];
407
- function Ze(e) {
408
- return Xe.includes(e) ? e : "neutral";
406
+ var rt = ["neutral", "danger"];
407
+ function it(e) {
408
+ return rt.includes(e) ? e : "neutral";
409
409
  }
410
- var Qe = {
410
+ var at = {
411
411
  type: "Type :phrase to confirm",
412
412
  password: "Password"
413
- }, $e = (e) => e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&"), et = [
413
+ }, ot = (e) => e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&"), st = [
414
414
  "start",
415
415
  "end",
416
416
  "top",
417
417
  "bottom"
418
418
  ];
419
- function tt(e) {
420
- return K(e) ?? "end";
419
+ function ct(e) {
420
+ return W(e) ?? "end";
421
421
  }
422
- function K(e) {
423
- return et.includes(e) ? e : void 0;
422
+ function W(e) {
423
+ return st.includes(e) ? e : void 0;
424
424
  }
425
- var q = "<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>", nt = ["center", "bottom"];
426
- function J(e) {
427
- return nt.includes(e) ? e : "center";
425
+ var G = "<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>", lt = ["center", "bottom"];
426
+ function K(e) {
427
+ return lt.includes(e) ? e : "center";
428
428
  }
429
- var rt = q, it = [
429
+ var ut = G, dt = [
430
430
  "id",
431
431
  "data-side-phone",
432
432
  "aria-labelledby",
433
433
  "aria-describedby"
434
- ], at = {
434
+ ], ft = {
435
435
  method: "dialog",
436
436
  class: "plinth-confirm-dialog-form"
437
- }, ot = { class: "plinth-dialog-header" }, st = ["id"], ct = { class: "plinth-dialog-body" }, lt = ["id"], ut = {
437
+ }, pt = { class: "plinth-dialog-header" }, mt = ["id"], ht = { class: "plinth-dialog-body" }, gt = ["id"], _t = {
438
438
  key: 0,
439
439
  class: "plinth-confirm-dialog-field"
440
- }, dt = ["for"], ft = { key: 0 }, pt = [
440
+ }, vt = ["for"], yt = { key: 0 }, bt = [
441
441
  "id",
442
442
  "pattern",
443
443
  "aria-invalid",
444
444
  "aria-describedby"
445
- ], mt = [
445
+ ], xt = [
446
446
  "id",
447
447
  "aria-invalid",
448
448
  "aria-describedby"
449
- ], ht = ["id"], gt = { class: "plinth-dialog-footer" }, Y = /* @__PURE__ */ d({
449
+ ], St = ["id"], Ct = { class: "plinth-dialog-footer" }, wt = /* @__PURE__ */ d({
450
450
  __name: "PlinthConfirmDialog",
451
451
  props: {
452
452
  id: { default: void 0 },
@@ -470,53 +470,53 @@ var rt = q, it = [
470
470
  let a = e, d = r;
471
471
  if (!a.title?.trim()) throw Error("<PlinthConfirmDialog> needs a title: it is the dialog's accessible name.");
472
472
  if (!a.message?.trim()) throw Error("<PlinthConfirmDialog> needs a message: it is the dialog's accessible description.");
473
- let f = i(() => Ye(a.kind));
473
+ let f = i(() => U(a.kind));
474
474
  if (f.value === "type" && !a.phrase?.trim()) throw Error("<PlinthConfirmDialog kind=\"type\"> needs a phrase: it is what the person types.");
475
- let p = C(), m = i(() => a.id?.trim() || `plinth-confirm-dialog-${p}`), v = i(() => J(a.sidePhone)), y = i(() => a.phrase?.trim() ?? ""), S = i(() => f.value !== "simple" && !!a.error?.trim()), w = i(() => {
476
- let e = a.fieldLabel?.trim() || Qe[f.value];
475
+ let p = D(), m = i(() => a.id?.trim() || `plinth-confirm-dialog-${p}`), h = i(() => K(a.sidePhone)), g = i(() => a.phrase?.trim() ?? ""), _ = i(() => f.value !== "simple" && !!a.error?.trim()), y = i(() => {
476
+ let e = a.fieldLabel?.trim() || at[f.value];
477
477
  return f.value === "type" ? e.split(":phrase") : [e];
478
- }), T = g();
478
+ }), S = b();
479
479
  return n({
480
- showModal: () => T.value?.showModal(),
481
- close: (e) => T.value?.close(e)
482
- }), (n, r) => (h(), s("dialog", {
480
+ showModal: () => S.value?.showModal(),
481
+ close: (e) => S.value?.close(e)
482
+ }), (n, r) => (v(), s("dialog", {
483
483
  id: m.value,
484
484
  ref_key: "dialog",
485
- ref: T,
485
+ ref: S,
486
486
  class: "plinth-dialog plinth-confirm-dialog",
487
487
  role: "alertdialog",
488
- "data-side-phone": v.value === "center" ? void 0 : v.value,
488
+ "data-side-phone": h.value === "center" ? void 0 : h.value,
489
489
  closedby: "closerequest",
490
490
  "aria-labelledby": `${m.value}-title`,
491
491
  "aria-describedby": `${m.value}-message`,
492
492
  onClose: r[0] ||= (e) => d("close", e)
493
- }, [c("form", at, [
494
- c("div", ot, [c("h2", {
493
+ }, [c("form", ft, [
494
+ c("div", pt, [c("h2", {
495
495
  id: `${m.value}-title`,
496
496
  class: "plinth-dialog-title"
497
- }, b(e.title), 9, st)]),
498
- c("div", ct, [
497
+ }, w(e.title), 9, mt)]),
498
+ c("div", ht, [
499
499
  c("p", {
500
500
  id: `${m.value}-message`,
501
501
  class: "plinth-confirm-dialog-message"
502
- }, b(e.message), 9, lt),
503
- f.value === "simple" ? o("", !0) : (h(), s("div", ut, [c("label", {
502
+ }, w(e.message), 9, gt),
503
+ f.value === "simple" ? o("", !0) : (v(), s("div", _t, [c("label", {
504
504
  for: `${m.value}-field`,
505
505
  class: "plinth-confirm-dialog-label"
506
- }, [(h(!0), s(t, null, _(w.value, (e, n) => (h(), s(t, { key: n }, [n > 0 ? (h(), s("strong", ft, b(y.value), 1)) : o("", !0), l(b(e), 1)], 64))), 128))], 8, dt), f.value === "type" ? (h(), s("input", {
506
+ }, [(v(!0), s(t, null, x(y.value, (e, n) => (v(), s(t, { key: n }, [n > 0 ? (v(), s("strong", yt, w(g.value), 1)) : o("", !0), l(w(e), 1)], 64))), 128))], 8, vt), f.value === "type" ? (v(), s("input", {
507
507
  key: 0,
508
508
  id: `${m.value}-field`,
509
509
  class: "plinth-confirm-dialog-input",
510
510
  type: "text",
511
511
  name: "confirmation",
512
512
  required: "",
513
- pattern: x($e)(y.value),
513
+ pattern: T(ot)(g.value),
514
514
  autocomplete: "off",
515
515
  autocapitalize: "none",
516
516
  spellcheck: "false",
517
- "aria-invalid": S.value ? "true" : void 0,
518
- "aria-describedby": S.value ? `${m.value}-error` : void 0
519
- }, null, 8, pt)) : (h(), s("input", {
517
+ "aria-invalid": _.value ? "true" : void 0,
518
+ "aria-describedby": _.value ? `${m.value}-error` : void 0
519
+ }, null, 8, bt)) : (v(), s("input", {
520
520
  key: 1,
521
521
  id: `${m.value}-field`,
522
522
  class: "plinth-confirm-dialog-input",
@@ -524,86 +524,86 @@ var rt = q, it = [
524
524
  name: "password",
525
525
  required: "",
526
526
  autocomplete: "current-password",
527
- "aria-invalid": S.value ? "true" : void 0,
528
- "aria-describedby": S.value ? `${m.value}-error` : void 0
529
- }, null, 8, mt))])),
530
- S.value ? (h(), s("p", {
527
+ "aria-invalid": _.value ? "true" : void 0,
528
+ "aria-describedby": _.value ? `${m.value}-error` : void 0
529
+ }, null, 8, xt))])),
530
+ _.value ? (v(), s("p", {
531
531
  key: 1,
532
532
  id: `${m.value}-error`,
533
533
  class: "plinth-confirm-dialog-error",
534
534
  role: "alert"
535
- }, b(e.error), 9, ht)) : o("", !0)
535
+ }, w(e.error), 9, St)) : o("", !0)
536
536
  ]),
537
- c("div", gt, [u(R, {
537
+ c("div", Ct, [u(L, {
538
538
  variant: "secondary",
539
539
  commandfor: m.value,
540
540
  command: "close",
541
541
  value: "cancel"
542
542
  }, {
543
- default: D(() => [l(b(e.cancelLabel), 1)]),
543
+ default: j(() => [l(w(e.cancelLabel), 1)]),
544
544
  _: 1
545
- }, 8, ["commandfor"]), u(R, {
545
+ }, 8, ["commandfor"]), u(L, {
546
546
  class: "plinth-confirm-dialog-confirm",
547
547
  type: "submit",
548
548
  value: "confirm",
549
- variant: x(Ze)(e.tone) === "danger" ? "danger" : "primary",
549
+ variant: T(it)(e.tone) === "danger" ? "danger" : "primary",
550
550
  busy: e.busy
551
551
  }, {
552
- default: D(() => [l(b(e.confirmLabel), 1)]),
552
+ default: j(() => [l(w(e.confirmLabel), 1)]),
553
553
  _: 1
554
554
  }, 8, ["variant", "busy"])])
555
- ])], 40, it));
555
+ ])], 40, dt));
556
556
  }
557
- }), _t = {
557
+ }), Tt = {
558
558
  class: "plinth-data-table",
559
559
  role: "table"
560
- }, vt = {
560
+ }, Et = {
561
561
  key: 0,
562
562
  class: "plinth-data-table-caption"
563
- }, yt = {
563
+ }, Dt = {
564
564
  class: "plinth-data-table-head",
565
565
  role: "rowgroup"
566
- }, bt = {
566
+ }, Ot = {
567
567
  class: "plinth-data-table-head-row",
568
568
  role: "row"
569
- }, xt = {
569
+ }, kt = {
570
570
  class: "plinth-data-table-body",
571
571
  role: "rowgroup"
572
- }, St = /* @__PURE__ */ d({
572
+ }, At = /* @__PURE__ */ d({
573
573
  __name: "PlinthDataTable",
574
574
  props: { caption: { default: void 0 } },
575
575
  setup(e) {
576
- return (t, n) => (h(), s("table", _t, [
577
- e.caption?.trim() ? (h(), s("caption", vt, b(e.caption), 1)) : o("", !0),
578
- c("thead", yt, [c("tr", bt, [v(t.$slots, "head")])]),
579
- c("tbody", xt, [v(t.$slots, "default")])
576
+ return (t, n) => (v(), s("table", Tt, [
577
+ e.caption?.trim() ? (v(), s("caption", Et, w(e.caption), 1)) : o("", !0),
578
+ c("thead", Dt, [c("tr", Ot, [S(t.$slots, "head")])]),
579
+ c("tbody", kt, [S(t.$slots, "default")])
580
580
  ]));
581
581
  }
582
- }), Ct = [
582
+ }), jt = [
583
583
  "none",
584
584
  "ascending",
585
585
  "descending"
586
586
  ];
587
- function wt(e) {
588
- return Ct.includes(e) ? e : "none";
587
+ function Mt(e) {
588
+ return jt.includes(e) ? e : "none";
589
589
  }
590
- var Tt = [
590
+ var Nt = [
591
591
  "field",
592
592
  "title",
593
593
  "actions"
594
594
  ];
595
- function Et(e) {
596
- return Tt.includes(e) ? e : "field";
595
+ function Pt(e) {
596
+ return Nt.includes(e) ? e : "field";
597
597
  }
598
- var Dt = "<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>", Ot = [
598
+ var Ft = "<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>", It = [
599
599
  "data-kind",
600
600
  "data-numeric",
601
601
  "data-phone"
602
- ], kt = {
602
+ ], Lt = {
603
603
  key: 0,
604
604
  class: "plinth-data-table-label",
605
605
  "aria-hidden": "true"
606
- }, At = { class: "plinth-data-table-value" }, jt = /* @__PURE__ */ d({
606
+ }, Rt = { class: "plinth-data-table-value" }, zt = /* @__PURE__ */ d({
607
607
  __name: "PlinthDataTableCell",
608
608
  props: {
609
609
  label: { default: void 0 },
@@ -618,20 +618,20 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
618
618
  }
619
619
  },
620
620
  setup(e) {
621
- let t = e, n = i(() => Et(t.kind));
622
- return (t, r) => (h(), s("td", {
621
+ let t = e, n = i(() => Pt(t.kind));
622
+ return (t, r) => (v(), s("td", {
623
623
  class: "plinth-data-table-cell",
624
624
  role: "cell",
625
625
  "data-kind": n.value,
626
626
  "data-numeric": e.numeric ? "" : void 0,
627
627
  "data-phone": e.hideOnPhone ? "hidden" : void 0
628
- }, [e.label?.trim() ? (h(), s("span", kt, b(e.label), 1)) : o("", !0), c("span", At, [v(t.$slots, "default")])], 8, Ot));
628
+ }, [e.label?.trim() ? (v(), s("span", Lt, w(e.label), 1)) : o("", !0), c("span", Rt, [S(t.$slots, "default")])], 8, It));
629
629
  }
630
- }), Mt = [
630
+ }), Bt = [
631
631
  "aria-sort",
632
632
  "data-numeric",
633
633
  "data-phone"
634
- ], Nt = /* @__PURE__ */ d({
634
+ ], Vt = /* @__PURE__ */ d({
635
635
  __name: "PlinthDataTableColumn",
636
636
  props: {
637
637
  sort: { default: void 0 },
@@ -645,20 +645,20 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
645
645
  }
646
646
  },
647
647
  setup(e) {
648
- let t = e, n = i(() => t.sort?.trim() ? wt(t.sort) : void 0);
649
- return (t, r) => (h(), s("th", {
648
+ let t = e, n = i(() => t.sort?.trim() ? Mt(t.sort) : void 0);
649
+ return (t, r) => (v(), s("th", {
650
650
  class: "plinth-data-table-column",
651
651
  role: "columnheader",
652
652
  scope: "col",
653
653
  "aria-sort": n.value,
654
654
  "data-numeric": e.numeric ? "" : void 0,
655
655
  "data-phone": e.hideOnPhone ? "hidden" : void 0
656
- }, [v(t.$slots, "default")], 8, Mt));
656
+ }, [S(t.$slots, "default")], 8, Bt));
657
657
  }
658
- }), Pt = {
658
+ }), Ht = {
659
659
  class: "plinth-data-table-empty",
660
660
  role: "row"
661
- }, Ft = ["colspan"], It = /* @__PURE__ */ d({
661
+ }, Ut = ["colspan"], Wt = /* @__PURE__ */ d({
662
662
  __name: "PlinthDataTableEmpty",
663
663
  props: { columns: { default: 1 } },
664
664
  setup(e) {
@@ -666,32 +666,32 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
666
666
  let e = typeof t.columns == "number" ? t.columns : String(t.columns), r = typeof e == "number" || n.test(e) ? Number(e) : NaN;
667
667
  return Number.isFinite(r) ? Math.max(1, Math.trunc(r)) : 1;
668
668
  });
669
- return (e, t) => (h(), s("tr", Pt, [c("td", {
669
+ return (e, t) => (v(), s("tr", Ht, [c("td", {
670
670
  class: "plinth-data-table-empty-cell",
671
671
  role: "cell",
672
672
  colspan: r.value
673
- }, [v(e.$slots, "default")], 8, Ft)]));
673
+ }, [S(e.$slots, "default")], 8, Ut)]));
674
674
  }
675
- }), Lt = ["aria-selected"], Rt = /* @__PURE__ */ d({
675
+ }), Gt = ["aria-selected"], Kt = /* @__PURE__ */ d({
676
676
  __name: "PlinthDataTableRow",
677
677
  props: { selected: {
678
678
  type: Boolean,
679
679
  default: void 0
680
680
  } },
681
681
  setup(e) {
682
- return (t, n) => (h(), s("tr", {
682
+ return (t, n) => (v(), s("tr", {
683
683
  class: "plinth-data-table-row",
684
684
  role: "row",
685
685
  "aria-selected": e.selected === void 0 ? void 0 : e.selected ? "true" : "false"
686
- }, [v(t.$slots, "default")], 8, Lt));
686
+ }, [S(t.$slots, "default")], 8, Gt));
687
687
  }
688
- }), zt = {
688
+ }), qt = {
689
689
  type: "button",
690
690
  class: "plinth-data-table-sort"
691
- }, Bt = { class: "plinth-data-table-sort-label" }, Vt = /* @__PURE__ */ d({
691
+ }, Jt = { class: "plinth-data-table-sort-label" }, Yt = /* @__PURE__ */ d({
692
692
  __name: "PlinthDataTableSort",
693
693
  setup(e) {
694
- return (e, t) => (h(), s("button", zt, [c("span", Bt, [v(e.$slots, "default")]), t[0] ||= c("span", {
694
+ return (e, t) => (v(), s("button", qt, [c("span", Jt, [S(e.$slots, "default")]), t[0] ||= c("span", {
695
695
  class: "plinth-icon plinth-data-table-sort-icon",
696
696
  "data-size": "sm",
697
697
  "aria-hidden": "true"
@@ -710,7 +710,7 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
710
710
  d: "M8 15l4 4 4-4"
711
711
  })])], -1)]));
712
712
  }
713
- }), Ht = [
713
+ }), Xt = [
714
714
  "href",
715
715
  "data-variant",
716
716
  "data-size",
@@ -718,11 +718,11 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
718
718
  "role",
719
719
  "aria-busy",
720
720
  "aria-disabled"
721
- ], Ut = {
721
+ ], Zt = {
722
722
  key: 0,
723
723
  class: "plinth-button-spinner",
724
724
  "aria-hidden": "true"
725
- }, Wt = ["data-size", "data-mirror"], Gt = [
725
+ }, Qt = ["data-size", "data-mirror"], $t = [
726
726
  "data-variant",
727
727
  "data-size",
728
728
  "aria-label",
@@ -730,11 +730,11 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
730
730
  "disabled",
731
731
  "aria-busy",
732
732
  "aria-disabled"
733
- ], Kt = {
733
+ ], en = {
734
734
  key: 0,
735
735
  class: "plinth-button-spinner",
736
736
  "aria-hidden": "true"
737
- }, qt = ["data-size", "data-mirror"], X = /* @__PURE__ */ d({
737
+ }, tn = ["data-size", "data-mirror"], q = /* @__PURE__ */ d({
738
738
  inheritAttrs: !1,
739
739
  __name: "PlinthIconButton",
740
740
  props: {
@@ -760,8 +760,8 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
760
760
  }
761
761
  },
762
762
  setup(e) {
763
- let t = e, n = S(), r = i(() => L(t.variant)), a = i(() => A(t.size, k, "md")), o = i(() => j(a.value)), c = i(() => t.busy && !t.disabled), l = i(() => t.label || n["aria-label"]), u = i(() => Object.fromEntries(Object.entries(n).filter(([e]) => e !== "aria-label")));
764
- return (t, n) => e.href ? (h(), s("a", f({
763
+ let t = e, n = E(), r = i(() => _e(t.variant)), a = i(() => N(t.size, M, "md")), o = i(() => P(a.value)), c = i(() => t.busy && !t.disabled), l = i(() => t.label || n["aria-label"]), u = i(() => Object.fromEntries(Object.entries(n).filter(([e]) => e !== "aria-label")));
764
+ return (t, n) => e.href ? (v(), s("a", m({
765
765
  key: 0,
766
766
  class: "plinth-button plinth-icon-button",
767
767
  href: e.disabled ? void 0 : e.href,
@@ -771,13 +771,13 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
771
771
  role: e.disabled ? "link" : void 0,
772
772
  "aria-busy": c.value ? "true" : void 0,
773
773
  "aria-disabled": c.value || e.disabled ? "true" : void 0
774
- }, u.value), [c.value ? (h(), s("span", Ut)) : (h(), s("span", {
774
+ }, u.value), [c.value ? (v(), s("span", Zt)) : (v(), s("span", {
775
775
  key: 1,
776
776
  class: "plinth-icon",
777
777
  "data-size": o.value,
778
778
  "data-mirror": e.mirror ? "" : void 0,
779
779
  "aria-hidden": "true"
780
- }, [v(t.$slots, "default")], 8, Wt))], 16, Ht)) : (h(), s("button", f({
780
+ }, [S(t.$slots, "default")], 8, Qt))], 16, Xt)) : (v(), s("button", m({
781
781
  key: 1,
782
782
  type: "button",
783
783
  class: "plinth-button plinth-icon-button",
@@ -788,18 +788,18 @@ var Dt = "<span class=\"plinth-icon plinth-data-table-sort-icon\" data-size=\"sm
788
788
  disabled: e.disabled || void 0,
789
789
  "aria-busy": c.value ? "true" : void 0,
790
790
  "aria-disabled": c.value ? "true" : void 0
791
- }, u.value), [c.value ? (h(), s("span", Kt)) : (h(), s("span", {
791
+ }, u.value), [c.value ? (v(), s("span", en)) : (v(), s("span", {
792
792
  key: 1,
793
793
  class: "plinth-icon",
794
794
  "data-size": o.value,
795
795
  "data-mirror": e.mirror ? "" : void 0,
796
796
  "aria-hidden": "true"
797
- }, [v(t.$slots, "default")], 8, qt))], 16, Gt));
797
+ }, [S(t.$slots, "default")], 8, tn))], 16, $t));
798
798
  }
799
799
  });
800
800
  //#endregion
801
801
  //#region src/swipe.ts
802
- function Jt(e) {
802
+ function nn(e) {
803
803
  let t = e.firstElementChild, n = () => getComputedStyle(e).scrollSnapType.startsWith("y"), r = () => {
804
804
  e.requestClose ? e.requestClose() : e.close(), e.open && (e.scrollTop = 0);
805
805
  }, i = () => {
@@ -820,29 +820,29 @@ function Jt(e) {
820
820
  e.removeEventListener(s, i), e.removeEventListener("click", a), e.removeEventListener("toggle", o);
821
821
  };
822
822
  }
823
- function Z(e) {
823
+ function J(e) {
824
824
  let t;
825
- m(() => {
826
- t = e.value ? Jt(e.value) : void 0;
827
- }), p(() => t?.());
825
+ _(() => {
826
+ t = e.value ? nn(e.value) : void 0;
827
+ }), g(() => t?.());
828
828
  }
829
829
  //#endregion
830
830
  //#region src/PlinthDialog.vue?vue&type=script&setup=true&lang.ts
831
- var Yt = [
831
+ var rn = [
832
832
  "id",
833
833
  "role",
834
834
  "data-side-phone",
835
835
  "closedby",
836
836
  "aria-labelledby",
837
837
  "aria-describedby"
838
- ], Xt = { class: "plinth-dialog-panel" }, Zt = {
838
+ ], an = { class: "plinth-dialog-panel" }, on = {
839
839
  key: 0,
840
840
  class: "plinth-dialog-handle",
841
841
  "aria-hidden": "true"
842
- }, Qt = { class: "plinth-dialog-header" }, $t = ["id"], en = ["id"], tn = { class: "plinth-dialog-body" }, nn = {
842
+ }, sn = { class: "plinth-dialog-header" }, cn = ["id"], ln = ["id"], un = { class: "plinth-dialog-body" }, dn = {
843
843
  key: 1,
844
844
  class: "plinth-dialog-footer"
845
- }, rn = /* @__PURE__ */ d({
845
+ }, fn = /* @__PURE__ */ d({
846
846
  __name: "PlinthDialog",
847
847
  props: {
848
848
  id: { default: void 0 },
@@ -859,14 +859,14 @@ var Yt = [
859
859
  setup(e, { expose: t, emit: n }) {
860
860
  let r = e, l = n;
861
861
  if (!r.title?.trim()) throw Error("<PlinthDialog> needs a title: it is the dialog's accessible name.");
862
- let u = w(), d = C(), f = i(() => r.id?.trim() || `plinth-dialog-${d}`), p = i(() => J(r.sidePhone)), m = i(() => !!r.description?.trim()), _ = g();
863
- return Z(_), t({
864
- showModal: () => _.value?.showModal(),
865
- close: () => _.value?.close()
866
- }), (t, n) => (h(), s("dialog", {
862
+ let u = k(), d = D(), f = i(() => r.id?.trim() || `plinth-dialog-${d}`), p = i(() => K(r.sidePhone)), m = i(() => !!r.description?.trim()), h = b();
863
+ return J(h), t({
864
+ showModal: () => h.value?.showModal(),
865
+ close: () => h.value?.close()
866
+ }), (t, n) => (v(), s("dialog", {
867
867
  id: f.value,
868
868
  ref_key: "dialog",
869
- ref: _,
869
+ ref: h,
870
870
  class: "plinth-dialog",
871
871
  role: e.dismissible ? void 0 : "alertdialog",
872
872
  "data-side-phone": p.value === "center" ? void 0 : p.value,
@@ -874,19 +874,19 @@ var Yt = [
874
874
  "aria-labelledby": `${f.value}-title`,
875
875
  "aria-describedby": m.value ? `${f.value}-description` : void 0,
876
876
  onClose: n[0] ||= (e) => l("close", e)
877
- }, [c("div", Xt, [
878
- e.dismissible && p.value === "bottom" ? (h(), s("div", Zt)) : o("", !0),
879
- c("div", Qt, [
877
+ }, [c("div", an, [
878
+ e.dismissible && p.value === "bottom" ? (v(), s("div", on)) : o("", !0),
879
+ c("div", sn, [
880
880
  c("h2", {
881
881
  id: `${f.value}-title`,
882
882
  class: "plinth-dialog-title"
883
- }, b(e.title), 9, $t),
884
- m.value ? (h(), s("p", {
883
+ }, w(e.title), 9, cn),
884
+ m.value ? (v(), s("p", {
885
885
  key: 0,
886
886
  id: `${f.value}-description`,
887
887
  class: "plinth-dialog-description"
888
- }, b(e.description), 9, en)) : o("", !0),
889
- e.dismissible ? (h(), a(X, {
888
+ }, w(e.description), 9, ln)) : o("", !0),
889
+ e.dismissible ? (v(), a(q, {
890
890
  key: 1,
891
891
  class: "plinth-dialog-close",
892
892
  label: e.closeLabel,
@@ -894,7 +894,7 @@ var Yt = [
894
894
  commandfor: f.value,
895
895
  command: "close"
896
896
  }, {
897
- default: D(() => [...n[1] ||= [c("svg", {
897
+ default: j(() => [...n[1] ||= [c("svg", {
898
898
  viewBox: "0 0 24 24",
899
899
  fill: "none",
900
900
  stroke: "currentColor",
@@ -905,37 +905,37 @@ var Yt = [
905
905
  _: 1
906
906
  }, 8, ["label", "commandfor"])) : o("", !0)
907
907
  ]),
908
- c("div", tn, [v(t.$slots, "default")]),
909
- x(G)(x(u).footer?.()) ? (h(), s("div", nn, [v(t.$slots, "footer")])) : o("", !0)
910
- ])], 40, Yt));
908
+ c("div", un, [S(t.$slots, "default")]),
909
+ T(z)(T(u).footer?.()) ? (v(), s("div", dn, [S(t.$slots, "footer")])) : o("", !0)
910
+ ])], 40, rn));
911
911
  }
912
- }), an = ["dialog", "sheet"];
913
- function on(e) {
914
- return an.includes(e) ? e : "dialog";
912
+ }), pn = ["dialog", "sheet"];
913
+ function mn(e) {
914
+ return pn.includes(e) ? e : "dialog";
915
915
  }
916
- var sn = [
916
+ var hn = [
917
917
  "peek",
918
918
  "half",
919
919
  "full"
920
920
  ];
921
- function cn(e) {
921
+ function gn(e) {
922
922
  let t = typeof e == "string" ? e.split(/\s+/) : e ?? [];
923
- return sn.filter((e) => t.includes(e));
923
+ return hn.filter((e) => t.includes(e));
924
924
  }
925
- function ln(e, t) {
925
+ function _n(e, t) {
926
926
  return t.includes(e) ? e : t.at(-1);
927
927
  }
928
- var un = q, dn = [
928
+ var vn = G, yn = [
929
929
  "id",
930
930
  "data-desktop",
931
931
  "data-snap-points",
932
932
  "data-snap",
933
933
  "aria-labelledby",
934
934
  "aria-describedby"
935
- ], fn = { class: "plinth-drawer-panel" }, pn = { class: "plinth-drawer-header" }, mn = ["id"], hn = ["id"], gn = { class: "plinth-drawer-body" }, _n = {
935
+ ], bn = { class: "plinth-drawer-panel" }, xn = { class: "plinth-drawer-header" }, Sn = ["id"], Cn = ["id"], wn = { class: "plinth-drawer-body" }, Tn = {
936
936
  key: 0,
937
937
  class: "plinth-drawer-footer"
938
- }, vn = /* @__PURE__ */ d({
938
+ }, En = /* @__PURE__ */ d({
939
939
  __name: "PlinthDrawer",
940
940
  props: {
941
941
  id: { default: void 0 },
@@ -950,45 +950,45 @@ var un = q, dn = [
950
950
  setup(e, { expose: t, emit: n }) {
951
951
  let r = e, a = n;
952
952
  if (!r.title?.trim()) throw Error("<PlinthDrawer> needs a title: it is the drawer's accessible name.");
953
- let l = w(), d = C(), f = i(() => r.id?.trim() || `plinth-drawer-${d}`), p = i(() => cn(r.snapPoints)), m = i(() => !!r.description?.trim()), _ = g();
954
- return Z(_), t({
955
- showModal: () => _.value?.showModal(),
956
- close: () => _.value?.close()
957
- }), (t, n) => (h(), s("dialog", {
953
+ let l = k(), d = D(), f = i(() => r.id?.trim() || `plinth-drawer-${d}`), p = i(() => gn(r.snapPoints)), m = i(() => !!r.description?.trim()), h = b();
954
+ return J(h), t({
955
+ showModal: () => h.value?.showModal(),
956
+ close: () => h.value?.close()
957
+ }), (t, n) => (v(), s("dialog", {
958
958
  id: f.value,
959
959
  ref_key: "dialog",
960
- ref: _,
960
+ ref: h,
961
961
  class: "plinth-drawer",
962
- "data-desktop": x(on)(e.desktop),
962
+ "data-desktop": T(mn)(e.desktop),
963
963
  "data-snap-points": p.value.length ? p.value.join(" ") : void 0,
964
- "data-snap": x(ln)(e.snap, p.value),
964
+ "data-snap": T(_n)(e.snap, p.value),
965
965
  closedby: "any",
966
966
  "aria-labelledby": `${f.value}-title`,
967
967
  "aria-describedby": m.value ? `${f.value}-description` : void 0,
968
968
  onClose: n[0] ||= (e) => a("close", e)
969
- }, [c("div", fn, [
969
+ }, [c("div", bn, [
970
970
  n[2] ||= c("div", {
971
971
  class: "plinth-drawer-handle",
972
972
  "aria-hidden": "true"
973
973
  }, null, -1),
974
- c("div", pn, [
974
+ c("div", xn, [
975
975
  c("h2", {
976
976
  id: `${f.value}-title`,
977
977
  class: "plinth-drawer-title"
978
- }, b(e.title), 9, mn),
979
- m.value ? (h(), s("p", {
978
+ }, w(e.title), 9, Sn),
979
+ m.value ? (v(), s("p", {
980
980
  key: 0,
981
981
  id: `${f.value}-description`,
982
982
  class: "plinth-drawer-description"
983
- }, b(e.description), 9, hn)) : o("", !0),
984
- u(X, {
983
+ }, w(e.description), 9, Cn)) : o("", !0),
984
+ u(q, {
985
985
  class: "plinth-drawer-close",
986
986
  label: e.closeLabel,
987
987
  variant: "ghost",
988
988
  commandfor: f.value,
989
989
  command: "close"
990
990
  }, {
991
- default: D(() => [...n[1] ||= [c("svg", {
991
+ default: j(() => [...n[1] ||= [c("svg", {
992
992
  viewBox: "0 0 24 24",
993
993
  fill: "none",
994
994
  stroke: "currentColor",
@@ -999,45 +999,27 @@ var un = q, dn = [
999
999
  _: 1
1000
1000
  }, 8, ["label", "commandfor"])
1001
1001
  ]),
1002
- c("div", gn, [v(t.$slots, "default")]),
1003
- x(G)(x(l).footer?.()) ? (h(), s("div", _n, [v(t.$slots, "footer")])) : o("", !0)
1004
- ])], 40, dn));
1005
- }
1006
- }), yn = { class: "plinth-header" }, bn = {
1007
- key: 0,
1008
- class: "plinth-header-leading"
1009
- }, xn = { class: "plinth-header-title" }, Sn = {
1010
- key: 1,
1011
- class: "plinth-header-actions"
1012
- }, Cn = /* @__PURE__ */ d({
1013
- __name: "PlinthHeader",
1014
- props: { title: {} },
1015
- setup(e) {
1016
- if (!e.title?.trim()) throw Error("<PlinthHeader> needs a title: it is the page's heading.");
1017
- let t = w();
1018
- return (n, r) => (h(), s("header", yn, [
1019
- x(G)(x(t).leading?.()) ? (h(), s("div", bn, [v(n.$slots, "leading")])) : o("", !0),
1020
- c("h1", xn, b(e.title), 1),
1021
- x(G)(x(t).actions?.()) ? (h(), s("div", Sn, [v(n.$slots, "actions")])) : o("", !0)
1022
- ]));
1002
+ c("div", wn, [S(t.$slots, "default")]),
1003
+ T(z)(T(l).footer?.()) ? (v(), s("div", Tn, [S(t.$slots, "footer")])) : o("", !0)
1004
+ ])], 40, yn));
1023
1005
  }
1024
- }), wn = [
1006
+ }), Dn = [
1025
1007
  "sm",
1026
1008
  "md",
1027
1009
  "lg"
1028
1010
  ];
1029
- function Tn(e) {
1030
- return A(e, wn, "md");
1011
+ function On(e) {
1012
+ return N(e, Dn, "md");
1031
1013
  }
1032
1014
  //#endregion
1033
1015
  //#region src/PlinthIcon.vue?vue&type=script&setup=true&lang.ts
1034
- var En = [
1016
+ var kn = [
1035
1017
  "data-size",
1036
1018
  "data-mirror",
1037
1019
  "role",
1038
1020
  "aria-label",
1039
1021
  "aria-hidden"
1040
- ], Dn = /* @__PURE__ */ d({
1022
+ ], An = /* @__PURE__ */ d({
1041
1023
  inheritAttrs: !1,
1042
1024
  __name: "PlinthIcon",
1043
1025
  props: {
@@ -1049,38 +1031,38 @@ var En = [
1049
1031
  }
1050
1032
  },
1051
1033
  setup(e) {
1052
- let t = e, n = S(), r = i(() => Tn(t.size)), a = i(() => {
1034
+ let t = e, n = E(), r = i(() => On(t.size)), a = i(() => {
1053
1035
  let e = t.label ?? n["aria-label"];
1054
1036
  return e?.trim() ? e : void 0;
1055
1037
  }), o = i(() => Object.fromEntries(Object.entries(n).filter(([e]) => e !== "aria-label")));
1056
- return (t, n) => (h(), s("span", f({
1038
+ return (t, n) => (v(), s("span", m({
1057
1039
  class: "plinth-icon",
1058
1040
  "data-size": r.value,
1059
1041
  "data-mirror": e.mirror ? "" : void 0,
1060
1042
  role: a.value ? "img" : void 0,
1061
1043
  "aria-label": a.value,
1062
1044
  "aria-hidden": a.value ? void 0 : "true"
1063
- }, o.value), [v(t.$slots, "default")], 16, En));
1045
+ }, o.value), [S(t.$slots, "default")], 16, kn));
1064
1046
  }
1065
- }), On = [
1047
+ }), jn = [
1066
1048
  "h2",
1067
1049
  "h3",
1068
1050
  "h4",
1069
1051
  "h5",
1070
1052
  "h6"
1071
1053
  ];
1072
- function kn(e) {
1073
- return On.includes(e) ? e : "h2";
1054
+ function Mn(e) {
1055
+ return jn.includes(e) ? e : "h2";
1074
1056
  }
1075
1057
  //#endregion
1076
1058
  //#region src/PlinthListCard.vue?vue&type=script&setup=true&lang.ts
1077
- var An = { class: "plinth-list-card" }, jn = {
1059
+ var Nn = { class: "plinth-list-card" }, Pn = {
1078
1060
  class: "plinth-list-card-list",
1079
1061
  role: "list"
1080
- }, Mn = {
1062
+ }, Fn = {
1081
1063
  key: 1,
1082
1064
  class: "plinth-list-card-footer"
1083
- }, Nn = /* @__PURE__ */ d({
1065
+ }, In = /* @__PURE__ */ d({
1084
1066
  __name: "PlinthListCard",
1085
1067
  props: {
1086
1068
  heading: { default: void 0 },
@@ -1088,35 +1070,35 @@ var An = { class: "plinth-list-card" }, jn = {
1088
1070
  footer: { default: void 0 }
1089
1071
  },
1090
1072
  setup(e) {
1091
- let t = e, n = i(() => kn(t.headingLevel));
1092
- return (t, r) => (h(), s("div", An, [
1093
- e.heading?.trim() ? (h(), a(y(n.value), {
1073
+ let t = e, n = i(() => Mn(t.headingLevel));
1074
+ return (t, r) => (v(), s("div", Nn, [
1075
+ e.heading?.trim() ? (v(), a(C(n.value), {
1094
1076
  key: 0,
1095
1077
  class: "plinth-list-card-heading"
1096
1078
  }, {
1097
- default: D(() => [l(b(e.heading), 1)]),
1079
+ default: j(() => [l(w(e.heading), 1)]),
1098
1080
  _: 1
1099
1081
  })) : o("", !0),
1100
- c("ul", jn, [v(t.$slots, "default")]),
1101
- e.footer?.trim() ? (h(), s("p", Mn, b(e.footer), 1)) : o("", !0)
1082
+ c("ul", Pn, [S(t.$slots, "default")]),
1083
+ e.footer?.trim() ? (v(), s("p", Fn, w(e.footer), 1)) : o("", !0)
1102
1084
  ]));
1103
1085
  }
1104
- }), Pn = {
1086
+ }), Ln = {
1105
1087
  key: 0,
1106
1088
  class: "plinth-list-row-leading"
1107
- }, Fn = { class: "plinth-list-row-content" }, In = { class: "plinth-list-row-title" }, Ln = {
1089
+ }, Rn = { class: "plinth-list-row-content" }, zn = { class: "plinth-list-row-title" }, Bn = {
1108
1090
  key: 0,
1109
1091
  class: "plinth-list-row-description"
1110
- }, Rn = {
1092
+ }, Vn = {
1111
1093
  key: 1,
1112
1094
  class: "plinth-list-row-trailing"
1113
- }, zn = {
1095
+ }, Hn = {
1114
1096
  key: 0,
1115
1097
  class: "plinth-icon plinth-list-row-chevron",
1116
1098
  "data-size": "sm",
1117
1099
  "data-mirror": "",
1118
1100
  "aria-hidden": "true"
1119
- }, Q = /* @__PURE__ */ d({
1101
+ }, Y = /* @__PURE__ */ d({
1120
1102
  __name: "PlinthListRow",
1121
1103
  props: {
1122
1104
  description: { default: void 0 },
@@ -1140,7 +1122,7 @@ var An = { class: "plinth-list-card" }, jn = {
1140
1122
  },
1141
1123
  setup(e) {
1142
1124
  let t = e, n = i(() => t.href ? "a" : t.button ? "button" : "div");
1143
- return (t, r) => (h(), a(y(n.value), {
1125
+ return (t, r) => (v(), a(C(n.value), {
1144
1126
  class: "plinth-list-row",
1145
1127
  type: n.value === "button" ? "button" : void 0,
1146
1128
  href: n.value === "a" && !e.disabled ? e.href : void 0,
@@ -1149,10 +1131,10 @@ var An = { class: "plinth-list-card" }, jn = {
1149
1131
  role: n.value === "a" && e.disabled ? "link" : void 0,
1150
1132
  "aria-disabled": n.value === "a" && e.disabled ? "true" : void 0
1151
1133
  }, {
1152
- default: D(() => [
1153
- t.$slots.leading ? (h(), s("span", Pn, [v(t.$slots, "leading")])) : o("", !0),
1154
- c("span", Fn, [c("span", In, [v(t.$slots, "default")]), e.description ? (h(), s("span", Ln, b(e.description), 1)) : o("", !0)]),
1155
- t.$slots.trailing || e.chevron ? (h(), s("span", Rn, [v(t.$slots, "trailing"), e.chevron ? (h(), s("span", zn, [...r[0] ||= [c("svg", {
1134
+ default: j(() => [
1135
+ t.$slots.leading ? (v(), s("span", Ln, [S(t.$slots, "leading")])) : o("", !0),
1136
+ c("span", Rn, [c("span", zn, [S(t.$slots, "default")]), e.description ? (v(), s("span", Bn, w(e.description), 1)) : o("", !0)]),
1137
+ t.$slots.trailing || e.chevron ? (v(), s("span", Vn, [S(t.$slots, "trailing"), e.chevron ? (v(), s("span", Hn, [...r[0] ||= [c("svg", {
1156
1138
  viewBox: "0 0 24 24",
1157
1139
  fill: "none",
1158
1140
  stroke: "currentColor",
@@ -1171,20 +1153,113 @@ var An = { class: "plinth-list-card" }, jn = {
1171
1153
  "aria-disabled"
1172
1154
  ]));
1173
1155
  }
1174
- }), Bn = [
1156
+ }), Un = ["neutral", "danger"];
1157
+ function Wn(e) {
1158
+ return Un.includes(e) ? e : "neutral";
1159
+ }
1160
+ var X = Symbol("plinth-menu-id"), Gn = ["id"], Kn = /* @__PURE__ */ d({
1161
+ __name: "PlinthMenu",
1162
+ props: { id: {} },
1163
+ setup(e, { expose: t }) {
1164
+ let n = e;
1165
+ if (!n.id?.trim()) throw Error("<PlinthMenu> needs an id: its button names it in popovertarget.");
1166
+ let r = i(() => n.id.trim());
1167
+ y(X, r);
1168
+ let a = b();
1169
+ return t({
1170
+ showPopover: (e) => a.value?.showPopover(e),
1171
+ hidePopover: () => a.value?.hidePopover()
1172
+ }), (e, t) => (v(), s("div", {
1173
+ id: r.value,
1174
+ ref_key: "menu",
1175
+ ref: a,
1176
+ class: "plinth-menu",
1177
+ popover: "auto"
1178
+ }, [S(e.$slots, "default")], 8, Gn));
1179
+ }
1180
+ }), qn = ["aria-label"], Jn = {
1181
+ key: 0,
1182
+ class: "plinth-menu-heading",
1183
+ "aria-hidden": "true"
1184
+ }, Yn = /* @__PURE__ */ d({
1185
+ __name: "PlinthMenuGroup",
1186
+ props: { label: {} },
1187
+ setup(e) {
1188
+ return (t, n) => (v(), s("div", {
1189
+ class: "plinth-menu-group",
1190
+ role: "group",
1191
+ "aria-label": e.label?.trim() ? e.label : void 0
1192
+ }, [e.label?.trim() ? (v(), s("div", Jn, w(e.label), 1)) : o("", !0), S(t.$slots, "default")], 8, qn));
1193
+ }
1194
+ }), Xn = {
1195
+ key: 0,
1196
+ class: "plinth-menu-icon",
1197
+ "aria-hidden": "true"
1198
+ }, Zn = { class: "plinth-menu-label" }, Qn = {
1199
+ key: 1,
1200
+ class: "plinth-menu-shortcut",
1201
+ "aria-hidden": "true"
1202
+ }, $n = /* @__PURE__ */ d({
1203
+ __name: "PlinthMenuItem",
1204
+ props: {
1205
+ href: { default: void 0 },
1206
+ tone: { default: "neutral" },
1207
+ shortcut: { default: void 0 },
1208
+ disabled: {
1209
+ type: Boolean,
1210
+ default: !1
1211
+ },
1212
+ menu: { default: void 0 }
1213
+ },
1214
+ setup(e) {
1215
+ let t = e, n = k(), r = f(X, void 0), l = i(() => t.href?.trim() ? "a" : "button"), u = i(() => l.value === "button" ? t.menu?.trim() || r?.value : void 0), d = i(() => Wn(t.tone));
1216
+ return (t, r) => (v(), a(C(l.value), {
1217
+ class: "plinth-menu-item",
1218
+ type: l.value === "button" ? "button" : void 0,
1219
+ href: l.value === "a" && !e.disabled ? e.href : void 0,
1220
+ commandfor: u.value || void 0,
1221
+ command: u.value ? "hide-popover" : void 0,
1222
+ "data-tone": d.value === "danger" ? "danger" : void 0,
1223
+ disabled: l.value === "button" && e.disabled ? !0 : void 0,
1224
+ role: l.value === "a" && e.disabled ? "link" : void 0,
1225
+ "aria-disabled": l.value === "a" && e.disabled ? "true" : void 0
1226
+ }, {
1227
+ default: j(() => [
1228
+ T(z)(T(n).icon?.()) ? (v(), s("span", Xn, [S(t.$slots, "icon")])) : o("", !0),
1229
+ c("span", Zn, [S(t.$slots, "default")]),
1230
+ e.shortcut?.trim() ? (v(), s("kbd", Qn, w(e.shortcut), 1)) : o("", !0)
1231
+ ]),
1232
+ _: 3
1233
+ }, 8, [
1234
+ "type",
1235
+ "href",
1236
+ "commandfor",
1237
+ "command",
1238
+ "data-tone",
1239
+ "disabled",
1240
+ "role",
1241
+ "aria-disabled"
1242
+ ]));
1243
+ }
1244
+ }), er = { class: "plinth-menu-separator" }, tr = /* @__PURE__ */ d({
1245
+ __name: "PlinthMenuSeparator",
1246
+ setup(e) {
1247
+ return (e, t) => (v(), s("hr", er));
1248
+ }
1249
+ }), nr = [
1175
1250
  "id",
1176
1251
  "data-side",
1177
1252
  "data-side-phone",
1178
1253
  "aria-labelledby",
1179
1254
  "aria-describedby"
1180
- ], Vn = { class: "plinth-sheet-panel" }, Hn = {
1255
+ ], rr = { class: "plinth-sheet-panel" }, ir = {
1181
1256
  key: 0,
1182
1257
  class: "plinth-sheet-handle",
1183
1258
  "aria-hidden": "true"
1184
- }, Un = { class: "plinth-sheet-header" }, Wn = ["id"], Gn = ["id"], Kn = { class: "plinth-sheet-body" }, qn = {
1259
+ }, ar = { class: "plinth-sheet-header" }, or = ["id"], sr = ["id"], cr = { class: "plinth-sheet-body" }, lr = {
1185
1260
  key: 1,
1186
1261
  class: "plinth-sheet-footer"
1187
- }, $ = /* @__PURE__ */ d({
1262
+ }, Z = /* @__PURE__ */ d({
1188
1263
  __name: "PlinthSheet",
1189
1264
  props: {
1190
1265
  id: { default: void 0 },
@@ -1198,41 +1273,41 @@ var An = { class: "plinth-list-card" }, jn = {
1198
1273
  setup(e, { expose: t, emit: n }) {
1199
1274
  let r = e, a = n;
1200
1275
  if (!r.title?.trim()) throw Error("<PlinthSheet> needs a title: it is the sheet's accessible name.");
1201
- let l = w(), d = C(), f = i(() => r.id?.trim() || `plinth-sheet-${d}`), p = i(() => tt(r.side)), m = i(() => K(r.sidePhone)), _ = i(() => !!r.description?.trim()), y = g(), S = i(() => (m.value ?? p.value) === "bottom");
1202
- return Z(y), t({
1203
- showModal: () => y.value?.showModal(),
1204
- close: () => y.value?.close()
1205
- }), (t, n) => (h(), s("dialog", {
1276
+ let l = k(), d = D(), f = i(() => r.id?.trim() || `plinth-sheet-${d}`), p = i(() => ct(r.side)), m = i(() => W(r.sidePhone)), h = i(() => !!r.description?.trim()), g = b(), _ = i(() => (m.value ?? p.value) === "bottom");
1277
+ return J(g), t({
1278
+ showModal: () => g.value?.showModal(),
1279
+ close: () => g.value?.close()
1280
+ }), (t, n) => (v(), s("dialog", {
1206
1281
  id: f.value,
1207
1282
  ref_key: "dialog",
1208
- ref: y,
1283
+ ref: g,
1209
1284
  class: "plinth-sheet",
1210
1285
  "data-side": p.value,
1211
1286
  "data-side-phone": m.value,
1212
1287
  closedby: "any",
1213
1288
  "aria-labelledby": `${f.value}-title`,
1214
- "aria-describedby": _.value ? `${f.value}-description` : void 0,
1289
+ "aria-describedby": h.value ? `${f.value}-description` : void 0,
1215
1290
  onClose: n[0] ||= (e) => a("close", e)
1216
- }, [c("div", Vn, [
1217
- S.value ? (h(), s("div", Hn)) : o("", !0),
1218
- c("div", Un, [
1291
+ }, [c("div", rr, [
1292
+ _.value ? (v(), s("div", ir)) : o("", !0),
1293
+ c("div", ar, [
1219
1294
  c("h2", {
1220
1295
  id: `${f.value}-title`,
1221
1296
  class: "plinth-sheet-title"
1222
- }, b(e.title), 9, Wn),
1223
- _.value ? (h(), s("p", {
1297
+ }, w(e.title), 9, or),
1298
+ h.value ? (v(), s("p", {
1224
1299
  key: 0,
1225
1300
  id: `${f.value}-description`,
1226
1301
  class: "plinth-sheet-description"
1227
- }, b(e.description), 9, Gn)) : o("", !0),
1228
- u(X, {
1302
+ }, w(e.description), 9, sr)) : o("", !0),
1303
+ u(q, {
1229
1304
  class: "plinth-sheet-close",
1230
1305
  label: e.closeLabel,
1231
1306
  variant: "ghost",
1232
1307
  commandfor: f.value,
1233
1308
  command: "close"
1234
1309
  }, {
1235
- default: D(() => [...n[1] ||= [c("svg", {
1310
+ default: j(() => [...n[1] ||= [c("svg", {
1236
1311
  viewBox: "0 0 24 24",
1237
1312
  fill: "none",
1238
1313
  stroke: "currentColor",
@@ -1243,14 +1318,14 @@ var An = { class: "plinth-list-card" }, jn = {
1243
1318
  _: 1
1244
1319
  }, 8, ["label", "commandfor"])
1245
1320
  ]),
1246
- c("div", Kn, [v(t.$slots, "default")]),
1247
- x(G)(x(l).footer?.()) ? (h(), s("div", qn, [v(t.$slots, "footer")])) : o("", !0)
1248
- ])], 40, Bn));
1321
+ c("div", cr, [S(t.$slots, "default")]),
1322
+ T(z)(T(l).footer?.()) ? (v(), s("div", lr, [S(t.$slots, "footer")])) : o("", !0)
1323
+ ])], 40, nr));
1249
1324
  }
1250
- }), Jn = ["aria-labelledby"], Yn = {
1325
+ }), ur = ["aria-labelledby"], dr = {
1251
1326
  key: 1,
1252
1327
  class: "plinth-menu-sheet-account"
1253
- }, Xn = /* @__PURE__ */ d({
1328
+ }, fr = /* @__PURE__ */ d({
1254
1329
  __name: "PlinthMenuSheet",
1255
1330
  props: {
1256
1331
  id: { default: void 0 },
@@ -1263,14 +1338,14 @@ var An = { class: "plinth-list-card" }, jn = {
1263
1338
  },
1264
1339
  emits: ["close"],
1265
1340
  setup(e, { expose: t, emit: n }) {
1266
- let r = e, d = n, f = w(), p = C(), m = i(() => r.id?.trim() || `plinth-menu-sheet-${p}`), _ = i(() => !!r.userName?.trim()), y = i(() => r.userHref?.trim() ? r.userHref : void 0), S = i(() => r.userSrc?.trim() ? r.userSrc : void 0), T = i(() => r.userDetail?.trim() ? r.userDetail : void 0), E = g();
1341
+ let r = e, d = n, f = k(), p = D(), m = i(() => r.id?.trim() || `plinth-menu-sheet-${p}`), h = i(() => !!r.userName?.trim()), g = i(() => r.userHref?.trim() ? r.userHref : void 0), _ = i(() => r.userSrc?.trim() ? r.userSrc : void 0), y = i(() => r.userDetail?.trim() ? r.userDetail : void 0), x = b();
1267
1342
  return t({
1268
- showModal: () => E.value?.showModal(),
1269
- close: () => E.value?.close()
1270
- }), (t, n) => (h(), a($, {
1343
+ showModal: () => x.value?.showModal(),
1344
+ close: () => x.value?.close()
1345
+ }), (t, n) => (v(), a(Z, {
1271
1346
  id: m.value,
1272
1347
  ref_key: "sheet",
1273
- ref: E,
1348
+ ref: x,
1274
1349
  class: "plinth-menu-sheet",
1275
1350
  title: e.title,
1276
1351
  "close-label": e.closeLabel,
@@ -1278,21 +1353,21 @@ var An = { class: "plinth-list-card" }, jn = {
1278
1353
  "side-phone": "bottom",
1279
1354
  onClose: n[0] ||= (e) => d("close", e)
1280
1355
  }, {
1281
- default: D(() => [
1282
- _.value ? (h(), a(Q, {
1356
+ default: j(() => [
1357
+ h.value ? (v(), a(Y, {
1283
1358
  key: 0,
1284
1359
  class: "plinth-menu-sheet-user",
1285
- description: T.value,
1286
- href: y.value,
1287
- chevron: !!y.value
1360
+ description: y.value,
1361
+ href: g.value,
1362
+ chevron: !!g.value
1288
1363
  }, {
1289
- leading: D(() => [u(P, {
1364
+ leading: j(() => [u(I, {
1290
1365
  name: e.userName,
1291
- src: S.value,
1366
+ src: _.value,
1292
1367
  size: "lg",
1293
1368
  decorative: ""
1294
1369
  }, null, 8, ["name", "src"])]),
1295
- default: D(() => [l(b(e.userName), 1)]),
1370
+ default: j(() => [l(w(e.userName), 1)]),
1296
1371
  _: 1
1297
1372
  }, 8, [
1298
1373
  "description",
@@ -1302,8 +1377,8 @@ var An = { class: "plinth-list-card" }, jn = {
1302
1377
  c("nav", {
1303
1378
  class: "plinth-menu-sheet-nav",
1304
1379
  "aria-labelledby": `${m.value}-title`
1305
- }, [v(t.$slots, "default")], 8, Jn),
1306
- x(G)(x(f).account?.()) ? (h(), s("div", Yn, [v(t.$slots, "account")])) : o("", !0)
1380
+ }, [S(t.$slots, "default")], 8, ur),
1381
+ T(z)(T(f).account?.()) ? (v(), s("div", dr, [S(t.$slots, "account")])) : o("", !0)
1307
1382
  ]),
1308
1383
  _: 3
1309
1384
  }, 8, [
@@ -1312,10 +1387,55 @@ var An = { class: "plinth-list-card" }, jn = {
1312
1387
  "close-label"
1313
1388
  ]));
1314
1389
  }
1315
- }), Zn = { class: "plinth-pill-label" }, Qn = {
1390
+ }), pr = [
1391
+ "h1",
1392
+ "h2",
1393
+ "h3",
1394
+ "h4",
1395
+ "h5",
1396
+ "h6"
1397
+ ];
1398
+ function Q(e) {
1399
+ return pr.includes(e) ? e : "h1";
1400
+ }
1401
+ //#endregion
1402
+ //#region src/PlinthPageHeader.vue?vue&type=script&setup=true&lang.ts
1403
+ var mr = ["data-top"], hr = {
1404
+ key: 0,
1405
+ class: "plinth-page-header-leading"
1406
+ }, gr = {
1407
+ key: 1,
1408
+ class: "plinth-page-header-actions"
1409
+ }, _r = /* @__PURE__ */ d({
1410
+ __name: "PlinthPageHeader",
1411
+ props: {
1412
+ heading: {},
1413
+ level: { default: "h1" },
1414
+ top: {
1415
+ type: Boolean,
1416
+ default: !1
1417
+ }
1418
+ },
1419
+ setup(e) {
1420
+ let t = e;
1421
+ if (!t.heading?.trim()) throw Error("<PlinthPageHeader> needs a heading: it is the page's heading.");
1422
+ let n = i(() => Q(t.level)), r = k();
1423
+ return (t, i) => (v(), s("header", {
1424
+ class: "plinth-page-header",
1425
+ "data-top": e.top ? "" : void 0
1426
+ }, [
1427
+ T(z)(T(r).leading?.()) ? (v(), s("div", hr, [S(t.$slots, "leading")])) : o("", !0),
1428
+ (v(), a(C(n.value), { class: "plinth-page-header-heading" }, {
1429
+ default: j(() => [l(w(e.heading), 1)]),
1430
+ _: 1
1431
+ })),
1432
+ T(z)(T(r).actions?.()) ? (v(), s("div", gr, [S(t.$slots, "actions")])) : o("", !0)
1433
+ ], 8, mr));
1434
+ }
1435
+ }), vr = { class: "plinth-pill-label" }, yr = {
1316
1436
  key: 0,
1317
1437
  class: "plinth-pill-count"
1318
- }, $n = /* @__PURE__ */ d({
1438
+ }, br = /* @__PURE__ */ d({
1319
1439
  __name: "PlinthPill",
1320
1440
  props: {
1321
1441
  count: { default: void 0 },
@@ -1331,7 +1451,7 @@ var An = { class: "plinth-list-card" }, jn = {
1331
1451
  },
1332
1452
  setup(e) {
1333
1453
  let t = e, n = i(() => t.href ? "a" : "button"), r = i(() => t.count != null && String(t.count).trim() !== "");
1334
- return (t, i) => (h(), a(y(n.value), {
1454
+ return (t, i) => (v(), a(C(n.value), {
1335
1455
  class: "plinth-pill",
1336
1456
  type: n.value === "button" ? "button" : void 0,
1337
1457
  href: n.value === "a" && !e.disabled ? e.href : void 0,
@@ -1341,7 +1461,7 @@ var An = { class: "plinth-list-card" }, jn = {
1341
1461
  role: n.value === "a" && e.disabled ? "link" : void 0,
1342
1462
  "aria-disabled": n.value === "a" && e.disabled ? "true" : void 0
1343
1463
  }, {
1344
- default: D(() => [c("span", Zn, [v(t.$slots, "default")]), r.value ? (h(), s("span", Qn, b(e.count), 1)) : o("", !0)]),
1464
+ default: j(() => [c("span", vr, [S(t.$slots, "default")]), r.value ? (v(), s("span", yr, w(e.count), 1)) : o("", !0)]),
1345
1465
  _: 3
1346
1466
  }, 8, [
1347
1467
  "type",
@@ -1353,7 +1473,7 @@ var An = { class: "plinth-list-card" }, jn = {
1353
1473
  "aria-disabled"
1354
1474
  ]));
1355
1475
  }
1356
- }), er = /* @__PURE__ */ d({
1476
+ }), xr = /* @__PURE__ */ d({
1357
1477
  __name: "PlinthPillRow",
1358
1478
  props: {
1359
1479
  label: { default: void 0 },
@@ -1363,16 +1483,16 @@ var An = { class: "plinth-list-card" }, jn = {
1363
1483
  }
1364
1484
  },
1365
1485
  setup(e) {
1366
- return (t, n) => (h(), a(y(e.nav ? "nav" : "div"), {
1486
+ return (t, n) => (v(), a(C(e.nav ? "nav" : "div"), {
1367
1487
  class: "plinth-pill-row",
1368
1488
  role: e.nav ? void 0 : "group",
1369
1489
  "aria-label": e.label || void 0
1370
1490
  }, {
1371
- default: D(() => [v(t.$slots, "default")]),
1491
+ default: j(() => [S(t.$slots, "default")]),
1372
1492
  _: 3
1373
1493
  }, 8, ["role", "aria-label"]));
1374
1494
  }
1375
- }), tr = /* @__PURE__ */ d({
1495
+ }), Sr = /* @__PURE__ */ d({
1376
1496
  __name: "PlinthSectionMenu",
1377
1497
  props: {
1378
1498
  label: { default: void 0 },
@@ -1382,19 +1502,19 @@ var An = { class: "plinth-list-card" }, jn = {
1382
1502
  }
1383
1503
  },
1384
1504
  setup(e) {
1385
- return (t, n) => (h(), a(y(e.nav ? "nav" : "div"), {
1505
+ return (t, n) => (v(), a(C(e.nav ? "nav" : "div"), {
1386
1506
  class: "plinth-section-menu",
1387
1507
  role: e.nav ? void 0 : "group",
1388
1508
  "aria-label": e.label?.trim() ? e.label : void 0
1389
1509
  }, {
1390
- default: D(() => [v(t.$slots, "default")]),
1510
+ default: j(() => [S(t.$slots, "default")]),
1391
1511
  _: 3
1392
1512
  }, 8, ["role", "aria-label"]));
1393
1513
  }
1394
- }), nr = { class: "plinth-section-menu-label" }, rr = {
1514
+ }), Cr = { class: "plinth-section-menu-label" }, wr = {
1395
1515
  key: 0,
1396
1516
  class: "plinth-section-menu-count"
1397
- }, ir = /* @__PURE__ */ d({
1517
+ }, Tr = /* @__PURE__ */ d({
1398
1518
  __name: "PlinthSectionMenuItem",
1399
1519
  props: {
1400
1520
  count: { default: void 0 },
@@ -1410,7 +1530,7 @@ var An = { class: "plinth-list-card" }, jn = {
1410
1530
  },
1411
1531
  setup(e) {
1412
1532
  let t = e, n = i(() => t.href?.trim() ? "a" : "button"), r = i(() => t.count != null && String(t.count).trim() !== "");
1413
- return (t, i) => (h(), a(y(n.value), {
1533
+ return (t, i) => (v(), a(C(n.value), {
1414
1534
  class: "plinth-section-menu-item",
1415
1535
  type: n.value === "button" ? "button" : void 0,
1416
1536
  href: n.value === "a" && !e.disabled ? e.href : void 0,
@@ -1420,7 +1540,7 @@ var An = { class: "plinth-list-card" }, jn = {
1420
1540
  role: n.value === "a" && e.disabled ? "link" : void 0,
1421
1541
  "aria-disabled": n.value === "a" && e.disabled ? "true" : void 0
1422
1542
  }, {
1423
- default: D(() => [c("span", nr, [v(t.$slots, "default")]), r.value ? (h(), s("span", rr, b(e.count), 1)) : o("", !0)]),
1543
+ default: j(() => [c("span", Cr, [S(t.$slots, "default")]), r.value ? (v(), s("span", wr, w(e.count), 1)) : o("", !0)]),
1424
1544
  _: 3
1425
1545
  }, 8, [
1426
1546
  "type",
@@ -1432,8 +1552,181 @@ var An = { class: "plinth-list-card" }, jn = {
1432
1552
  "aria-disabled"
1433
1553
  ]));
1434
1554
  }
1435
- }), ar = "<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>", or = { install(e) {
1436
- e.component("PlinthAvatar", P), e.component("PlinthBadge", F), e.component("PlinthButton", R), e.component("PlinthCallout", ke), e.component("PlinthCodeBlock", qe), e.component("PlinthConfirmDialog", Y), e.component("PlinthDataTable", St), e.component("PlinthDataTableCell", jt), e.component("PlinthDataTableColumn", Nt), e.component("PlinthDataTableEmpty", It), e.component("PlinthDataTableRow", Rt), e.component("PlinthDataTableSort", Vt), e.component("PlinthDialog", rn), e.component("PlinthDrawer", vn), e.component("PlinthHeader", Cn), e.component("PlinthIcon", Dn), e.component("PlinthIconButton", X), e.component("PlinthListCard", Nn), e.component("PlinthListRow", Q), e.component("PlinthMenuSheet", Xn), e.component("PlinthPill", $n), e.component("PlinthPillRow", er), e.component("PlinthSectionMenu", tr), e.component("PlinthSectionMenuItem", ir), e.component("PlinthSheet", $);
1555
+ }), Er = ["sm", "md"];
1556
+ function Dr(e) {
1557
+ return N(e, Er, "md");
1558
+ }
1559
+ function $(e, t, n) {
1560
+ let r = [t?.trim() ? `${e}-description` : "", n?.trim() ? `${e}-error` : ""].filter(Boolean);
1561
+ return r.length ? r.join(" ") : void 0;
1562
+ }
1563
+ //#endregion
1564
+ //#region src/PlinthTextarea.vue?vue&type=script&setup=true&lang.ts
1565
+ var Or = ["data-label"], kr = ["for"], Ar = [
1566
+ "id",
1567
+ "rows",
1568
+ "data-grow",
1569
+ "value",
1570
+ "disabled",
1571
+ "readonly",
1572
+ "aria-describedby",
1573
+ "aria-invalid"
1574
+ ], jr = ["id"], Mr = ["id"], Nr = /* @__PURE__ */ d({
1575
+ inheritAttrs: !1,
1576
+ __name: "PlinthTextarea",
1577
+ props: /*@__PURE__*/ p({
1578
+ label: {},
1579
+ hideLabel: {
1580
+ type: Boolean,
1581
+ default: !1
1582
+ },
1583
+ id: { default: void 0 },
1584
+ rows: { default: 3 },
1585
+ grow: {
1586
+ type: Boolean,
1587
+ default: !1
1588
+ },
1589
+ maxRows: { default: 8 },
1590
+ description: { default: void 0 },
1591
+ error: { default: void 0 },
1592
+ disabled: {
1593
+ type: Boolean,
1594
+ default: !1
1595
+ },
1596
+ readonly: {
1597
+ type: Boolean,
1598
+ default: !1
1599
+ }
1600
+ }, {
1601
+ modelValue: {},
1602
+ modelModifiers: {}
1603
+ }),
1604
+ emits: ["update:modelValue"],
1605
+ setup(e) {
1606
+ let t = e, n = O(e, "modelValue");
1607
+ if (!t.label?.trim()) throw Error("<PlinthTextarea> needs a label: it is the field's accessible name.");
1608
+ let r = E(), a = D(), l = i(() => t.id?.trim() || `plinth-textarea-${a}`), u = i(() => !!t.description?.trim()), d = i(() => !!t.error?.trim()), f = i(() => $(l.value, t.description, t.error)), p = i(() => m(t.grow ? { style: `--plinth-textarea-rows: ${t.rows}; --plinth-textarea-max-rows: ${Math.max(t.maxRows, t.rows)}` } : {}, Object.fromEntries(Object.entries(r).filter(([e]) => e !== "class"))));
1609
+ function g(e) {
1610
+ n.value = e.target.value;
1611
+ }
1612
+ return (t, i) => (v(), s("div", {
1613
+ class: h(["plinth-textarea", T(r).class]),
1614
+ "data-label": e.hideLabel ? "hidden" : void 0
1615
+ }, [
1616
+ c("label", {
1617
+ class: "plinth-textarea-label",
1618
+ for: l.value
1619
+ }, w(e.label), 9, kr),
1620
+ c("textarea", m({
1621
+ id: l.value,
1622
+ class: "plinth-textarea-input",
1623
+ rows: e.rows,
1624
+ "data-grow": e.grow ? "" : void 0,
1625
+ value: n.value,
1626
+ disabled: e.disabled || void 0,
1627
+ readonly: e.readonly || void 0,
1628
+ "aria-describedby": f.value,
1629
+ "aria-invalid": d.value ? "true" : void 0
1630
+ }, p.value, { onInput: g }), null, 16, Ar),
1631
+ u.value ? (v(), s("p", {
1632
+ key: 0,
1633
+ id: `${l.value}-description`,
1634
+ class: "plinth-textarea-description"
1635
+ }, w(e.description), 9, jr)) : o("", !0),
1636
+ d.value ? (v(), s("p", {
1637
+ key: 1,
1638
+ id: `${l.value}-error`,
1639
+ class: "plinth-textarea-error"
1640
+ }, w(e.error), 9, Mr)) : o("", !0)
1641
+ ], 10, Or));
1642
+ }
1643
+ }), Pr = ["data-size", "data-label"], Fr = ["for"], Ir = { class: "plinth-text-field-control" }, Lr = {
1644
+ key: 0,
1645
+ class: "plinth-icon",
1646
+ "data-size": "sm",
1647
+ "aria-hidden": "true"
1648
+ }, Rr = [
1649
+ "id",
1650
+ "type",
1651
+ "value",
1652
+ "disabled",
1653
+ "readonly",
1654
+ "aria-describedby",
1655
+ "aria-invalid"
1656
+ ], zr = {
1657
+ key: 1,
1658
+ class: "plinth-text-field-trailing"
1659
+ }, Br = ["id"], Vr = ["id"], Hr = /* @__PURE__ */ d({
1660
+ inheritAttrs: !1,
1661
+ __name: "PlinthTextField",
1662
+ props: /*@__PURE__*/ p({
1663
+ label: {},
1664
+ hideLabel: {
1665
+ type: Boolean,
1666
+ default: !1
1667
+ },
1668
+ id: { default: void 0 },
1669
+ type: { default: "text" },
1670
+ size: { default: "md" },
1671
+ description: { default: void 0 },
1672
+ error: { default: void 0 },
1673
+ disabled: {
1674
+ type: Boolean,
1675
+ default: !1
1676
+ },
1677
+ readonly: {
1678
+ type: Boolean,
1679
+ default: !1
1680
+ }
1681
+ }, {
1682
+ modelValue: {},
1683
+ modelModifiers: {}
1684
+ }),
1685
+ emits: ["update:modelValue"],
1686
+ setup(e) {
1687
+ let t = e, n = O(e, "modelValue");
1688
+ if (!t.label?.trim()) throw Error("<PlinthTextField> needs a label: it is the field's accessible name.");
1689
+ let r = E(), a = k(), l = D(), u = i(() => t.id?.trim() || `plinth-text-field-${l}`), d = i(() => Dr(t.size)), f = i(() => !!t.description?.trim()), p = i(() => !!t.error?.trim()), g = i(() => $(u.value, t.description, t.error)), _ = i(() => Object.fromEntries(Object.entries(r).filter(([e]) => e !== "class")));
1690
+ function y(e) {
1691
+ n.value = e.target.value;
1692
+ }
1693
+ return (t, i) => (v(), s("div", {
1694
+ class: h(["plinth-text-field", T(r).class]),
1695
+ "data-size": d.value,
1696
+ "data-label": e.hideLabel ? "hidden" : void 0
1697
+ }, [
1698
+ c("label", {
1699
+ class: "plinth-text-field-label",
1700
+ for: u.value
1701
+ }, w(e.label), 9, Fr),
1702
+ c("div", Ir, [
1703
+ T(z)(T(a).icon?.()) ? (v(), s("span", Lr, [S(t.$slots, "icon")])) : o("", !0),
1704
+ c("input", m({
1705
+ id: u.value,
1706
+ type: e.type,
1707
+ class: "plinth-text-field-input",
1708
+ value: n.value,
1709
+ disabled: e.disabled || void 0,
1710
+ readonly: e.readonly || void 0,
1711
+ "aria-describedby": g.value,
1712
+ "aria-invalid": p.value ? "true" : void 0
1713
+ }, _.value, { onInput: y }), null, 16, Rr),
1714
+ T(z)(T(a).trailing?.()) ? (v(), s("span", zr, [S(t.$slots, "trailing")])) : o("", !0)
1715
+ ]),
1716
+ f.value ? (v(), s("p", {
1717
+ key: 0,
1718
+ id: `${u.value}-description`,
1719
+ class: "plinth-text-field-description"
1720
+ }, w(e.description), 9, Br)) : o("", !0),
1721
+ p.value ? (v(), s("p", {
1722
+ key: 1,
1723
+ id: `${u.value}-error`,
1724
+ class: "plinth-text-field-error"
1725
+ }, w(e.error), 9, Vr)) : o("", !0)
1726
+ ], 10, Pr));
1727
+ }
1728
+ }), Ur = "<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>", Wr = { install(e) {
1729
+ e.component("PlinthAvatar", I), e.component("PlinthBadge", he), e.component("PlinthButton", L), e.component("PlinthCallout", Be), e.component("PlinthCodeBlock", V), e.component("PlinthConfirmDialog", wt), e.component("PlinthDataTable", At), e.component("PlinthDataTableCell", zt), e.component("PlinthDataTableColumn", Vt), e.component("PlinthDataTableEmpty", Wt), e.component("PlinthDataTableRow", Kt), e.component("PlinthDataTableSort", Yt), e.component("PlinthDialog", fn), e.component("PlinthDrawer", En), e.component("PlinthIcon", An), e.component("PlinthIconButton", q), e.component("PlinthListCard", In), e.component("PlinthListRow", Y), e.component("PlinthMenu", Kn), e.component("PlinthMenuGroup", Yn), e.component("PlinthMenuItem", $n), e.component("PlinthMenuSeparator", tr), e.component("PlinthMenuSheet", fr), e.component("PlinthPageHeader", _r), e.component("PlinthPill", br), e.component("PlinthPillRow", xr), e.component("PlinthSectionMenu", Sr), e.component("PlinthSectionMenuItem", Tr), e.component("PlinthSheet", Z), e.component("PlinthTextarea", Nr), e.component("PlinthTextField", Hr);
1437
1730
  } };
1438
1731
  //#endregion
1439
- export { or as Plinth, P as PlinthAvatar, F as PlinthBadge, R as PlinthButton, ke as PlinthCallout, qe as PlinthCodeBlock, Y as PlinthConfirmDialog, St as PlinthDataTable, jt as PlinthDataTableCell, Nt as PlinthDataTableColumn, It as PlinthDataTableEmpty, Rt as PlinthDataTableRow, Vt as PlinthDataTableSort, rn as PlinthDialog, vn as PlinthDrawer, Cn as PlinthHeader, Dn as PlinthIcon, X as PlinthIconButton, Nn as PlinthListCard, Q as PlinthListRow, Xn as PlinthMenuSheet, $n as PlinthPill, er as PlinthPillRow, tr as PlinthSectionMenu, ir as PlinthSectionMenuItem, $ as PlinthSheet, ne as avatarGlyph, ee as avatarSizes, I as buttonVariants, W as calloutIcons, H as calloutRole, V as calloutRoles, B as calloutTone, z as calloutTones, Qe as confirmDialogFieldLabels, Ye as confirmDialogKind, Je as confirmDialogKinds, $e as confirmDialogPattern, Ze as confirmDialogTone, Xe as confirmDialogTones, k as controlSizes, Et as dataTableCellKind, Tt as dataTableCellKinds, wt as dataTableSort, Dt as dataTableSortIcon, Ct as dataTableSorts, rt as dialogCloseIcon, J as dialogSidePhone, nt as dialogSidePhones, un as drawerCloseIcon, on as drawerDesktop, an as drawerDesktops, ln as drawerSnap, cn as drawerSnapPoints, sn as drawerSnaps, kn as headingLevel, On as headingLevels, j as iconSizeFor, wn as iconSizes, M as initialsFrom, ar as listRowChevron, A as resolveSize, q as sheetCloseIcon, tt as sheetSide, K as sheetSidePhone, et as sheetSides, O as sizes, Jt as swipeToClose, N as tones, Z as useSwipeToClose };
1732
+ export { Wr as Plinth, I as PlinthAvatar, he as PlinthBadge, L as PlinthButton, Be as PlinthCallout, V as PlinthCodeBlock, wt as PlinthConfirmDialog, At as PlinthDataTable, zt as PlinthDataTableCell, Vt as PlinthDataTableColumn, Wt as PlinthDataTableEmpty, Kt as PlinthDataTableRow, Yt as PlinthDataTableSort, fn as PlinthDialog, En as PlinthDrawer, An as PlinthIcon, q as PlinthIconButton, In as PlinthListCard, Y as PlinthListRow, Kn as PlinthMenu, Yn as PlinthMenuGroup, $n as PlinthMenuItem, tr as PlinthMenuSeparator, fr as PlinthMenuSheet, _r as PlinthPageHeader, br as PlinthPill, xr as PlinthPillRow, Sr as PlinthSectionMenu, Tr as PlinthSectionMenuItem, Z as PlinthSheet, Hr as PlinthTextField, Nr as PlinthTextarea, ae as avatarGlyph, ne as avatarSizes, ge as buttonVariants, Me as calloutIcons, je as calloutRole, Ae as calloutRoles, ke as calloutTone, Oe as calloutTones, at as confirmDialogFieldLabels, U as confirmDialogKind, H as confirmDialogKinds, ot as confirmDialogPattern, it as confirmDialogTone, rt as confirmDialogTones, M as controlSizes, Pt as dataTableCellKind, Nt as dataTableCellKinds, Mt as dataTableSort, Ft as dataTableSortIcon, jt as dataTableSorts, ut as dialogCloseIcon, K as dialogSidePhone, lt as dialogSidePhones, vn as drawerCloseIcon, mn as drawerDesktop, pn as drawerDesktops, _n as drawerSnap, gn as drawerSnapPoints, hn as drawerSnaps, $ as fieldDescribedBy, Mn as headingLevel, jn as headingLevels, P as iconSizeFor, Dn as iconSizes, ie as initialsFrom, Ur as listRowChevron, X as menuIdKey, Wn as menuItemTone, Un as menuItemTones, Q as pageHeaderLevel, pr as pageHeaderLevels, N as resolveSize, G as sheetCloseIcon, ct as sheetSide, W as sheetSidePhone, st as sheetSides, te as sizes, nn as swipeToClose, Dr as textFieldSize, Er as textFieldSizes, F as tones, J as useSwipeToClose };