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