@ptbdynamic/plinth 0.0.0-stage → 0.1.1

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