@lagroon/inkwell-design-system 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1366 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { cloneElement as n, createContext as r, isValidElement as i, useContext as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
3
+ //#region src/components/icons.jsx
4
+ function u({ size: t = "1em", style: n, children: r, ...i }) {
5
+ return /* @__PURE__ */ e("svg", {
6
+ viewBox: "0 0 24 24",
7
+ width: t,
8
+ height: t,
9
+ fill: "none",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ "aria-hidden": "true",
12
+ style: {
13
+ flexShrink: 0,
14
+ ...n
15
+ },
16
+ ...i,
17
+ children: r
18
+ });
19
+ }
20
+ function d(t) {
21
+ return /* @__PURE__ */ e(u, {
22
+ ...t,
23
+ children: /* @__PURE__ */ e("path", {
24
+ stroke: "currentColor",
25
+ strokeLinecap: "round",
26
+ strokeLinejoin: "round",
27
+ strokeWidth: "2",
28
+ d: "m19 9l-7 6l-7-6"
29
+ })
30
+ });
31
+ }
32
+ function f(n) {
33
+ return /* @__PURE__ */ e(u, {
34
+ ...n,
35
+ children: /* @__PURE__ */ t("g", {
36
+ stroke: "currentColor",
37
+ strokeWidth: "1.5",
38
+ children: [/* @__PURE__ */ e("circle", {
39
+ cx: "12",
40
+ cy: "12",
41
+ r: "10"
42
+ }), /* @__PURE__ */ e("path", {
43
+ strokeLinecap: "round",
44
+ strokeLinejoin: "round",
45
+ d: "m8.5 12.5l2 2l5-5"
46
+ })]
47
+ })
48
+ });
49
+ }
50
+ function p({ style: n, ...r }) {
51
+ return /* @__PURE__ */ e(u, {
52
+ style: {
53
+ transform: "rotate(90deg)",
54
+ ...n
55
+ },
56
+ ...r,
57
+ children: /* @__PURE__ */ t("g", {
58
+ stroke: "currentColor",
59
+ strokeWidth: "1.5",
60
+ children: [
61
+ /* @__PURE__ */ e("circle", {
62
+ cx: "5",
63
+ cy: "12",
64
+ r: "2"
65
+ }),
66
+ /* @__PURE__ */ e("circle", {
67
+ cx: "12",
68
+ cy: "12",
69
+ r: "2"
70
+ }),
71
+ /* @__PURE__ */ e("circle", {
72
+ cx: "19",
73
+ cy: "12",
74
+ r: "2"
75
+ })
76
+ ]
77
+ })
78
+ });
79
+ }
80
+ function m(n) {
81
+ return /* @__PURE__ */ e(u, {
82
+ ...n,
83
+ children: /* @__PURE__ */ t("g", {
84
+ stroke: "currentColor",
85
+ strokeWidth: "1.5",
86
+ children: [/* @__PURE__ */ e("path", { d: "M3.275 15.296C2.425 14.192 2 13.639 2 12c0-1.64.425-2.191 1.275-3.296C4.972 6.5 7.818 4 12 4s7.028 2.5 8.725 4.704C21.575 9.81 22 10.361 22 12c0 1.64-.425 2.191-1.275 3.296C19.028 17.5 16.182 20 12 20s-7.028-2.5-8.725-4.704Z" }), /* @__PURE__ */ e("path", { d: "M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0Z" })]
87
+ })
88
+ });
89
+ }
90
+ function h(n) {
91
+ return /* @__PURE__ */ e(u, {
92
+ ...n,
93
+ children: /* @__PURE__ */ t("g", {
94
+ stroke: "currentColor",
95
+ strokeLinecap: "round",
96
+ strokeWidth: "1.5",
97
+ children: [/* @__PURE__ */ e("path", { d: "M12 20a8 8 0 1 1 0-16" }), /* @__PURE__ */ e("path", {
98
+ strokeLinejoin: "round",
99
+ d: "M10 12h10m0 0l-3-3m3 3l-3 3"
100
+ })]
101
+ })
102
+ });
103
+ }
104
+ function g(n) {
105
+ return /* @__PURE__ */ e(u, {
106
+ ...n,
107
+ children: /* @__PURE__ */ t("g", {
108
+ stroke: "currentColor",
109
+ strokeWidth: "1.5",
110
+ children: [
111
+ /* @__PURE__ */ e("path", { d: "M12 16c-5.76 0-6.78-5.74-6.96-10.294c-.051-1.266-.076-1.9.4-2.485c.475-.586 1.044-.682 2.183-.874A26.4 26.4 0 0 1 12 2c1.784 0 3.253.157 4.377.347c1.139.192 1.708.288 2.184.874s.45 1.219.4 2.485C18.781 10.26 17.761 16 12.001 16Z" }),
112
+ /* @__PURE__ */ e("path", {
113
+ strokeLinecap: "round",
114
+ d: "M12 16v3"
115
+ }),
116
+ /* @__PURE__ */ e("path", {
117
+ strokeLinecap: "round",
118
+ strokeLinejoin: "round",
119
+ d: "M15.5 22h-7l.34-1.696a1 1 0 0 1 .98-.804h4.36a1 1 0 0 1 .98.804z"
120
+ }),
121
+ /* @__PURE__ */ e("path", { d: "m19 5l.949.316c.99.33 1.485.495 1.768.888S22 7.12 22 8.162v.073c0 .86 0 1.291-.207 1.643s-.584.561-1.336.98L17.5 12.5M5 5l-.949.316c-.99.33-1.485.495-1.768.888S2 7.12 2 8.162v.073c0 .86 0 1.291.207 1.643s.584.561 1.336.98L6.5 12.5m4.646-6.477C11.526 5.34 11.716 5 12 5s.474.34.854 1.023l.098.176c.108.194.162.29.246.354c.085.064.19.088.4.135l.19.044c.738.167 1.107.25 1.195.532s-.164.577-.667 1.165l-.13.152c-.143.167-.215.25-.247.354s-.021.215 0 .438l.02.203c.076.785.114 1.178-.115 1.352c-.23.174-.576.015-1.267-.303l-.178-.082c-.197-.09-.295-.135-.399-.135s-.202.045-.399.135l-.178.082c-.691.319-1.037.477-1.267.303s-.191-.567-.115-1.352l.02-.203c.021-.223.032-.334 0-.438s-.104-.187-.247-.354l-.13-.152c-.503-.588-.755-.882-.667-1.165c.088-.282.457-.365 1.195-.532l.19-.044c.21-.047.315-.07.4-.135c.084-.064.138-.16.246-.354z" }),
122
+ /* @__PURE__ */ e("path", {
123
+ strokeLinecap: "round",
124
+ d: "M18 22H6"
125
+ })
126
+ ]
127
+ })
128
+ });
129
+ }
130
+ function _(n) {
131
+ return /* @__PURE__ */ e(u, {
132
+ ...n,
133
+ children: /* @__PURE__ */ t("g", {
134
+ stroke: "currentColor",
135
+ strokeWidth: "1.5",
136
+ children: [
137
+ /* @__PURE__ */ e("circle", {
138
+ cx: "9",
139
+ cy: "6",
140
+ r: "4"
141
+ }),
142
+ /* @__PURE__ */ e("path", {
143
+ strokeLinecap: "round",
144
+ d: "M15 9a3 3 0 1 0 0-6"
145
+ }),
146
+ /* @__PURE__ */ e("ellipse", {
147
+ cx: "9",
148
+ cy: "17",
149
+ rx: "7",
150
+ ry: "4"
151
+ }),
152
+ /* @__PURE__ */ e("path", {
153
+ strokeLinecap: "round",
154
+ d: "M18 14c1.754.385 3 1.359 3 2.5c0 1.03-1.014 1.923-2.5 2.37"
155
+ })
156
+ ]
157
+ })
158
+ });
159
+ }
160
+ function v(n) {
161
+ return /* @__PURE__ */ e(u, {
162
+ ...n,
163
+ children: /* @__PURE__ */ t("g", {
164
+ stroke: "currentColor",
165
+ strokeWidth: "1.5",
166
+ children: [/* @__PURE__ */ e("circle", {
167
+ cx: "12",
168
+ cy: "12",
169
+ r: "3"
170
+ }), /* @__PURE__ */ e("path", { d: "M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z" })]
171
+ })
172
+ });
173
+ }
174
+ function y(n) {
175
+ return /* @__PURE__ */ e(u, {
176
+ ...n,
177
+ children: /* @__PURE__ */ t("g", {
178
+ stroke: "currentColor",
179
+ strokeWidth: "1.5",
180
+ children: [/* @__PURE__ */ e("path", { d: "M6 11c0-2.828 0-4.243.879-5.121C7.757 5 9.172 5 12 5h3c2.828 0 4.243 0 5.121.879C21 6.757 21 8.172 21 11v5c0 2.828 0 4.243-.879 5.121C19.243 22 17.828 22 15 22h-3c-2.828 0-4.243 0-5.121-.879C6 20.243 6 18.828 6 16z" }), /* @__PURE__ */ e("path", { d: "M6 19a3 3 0 0 1-3-3v-6c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h4a3 3 0 0 1 3 3" })]
181
+ })
182
+ });
183
+ }
184
+ function b(t) {
185
+ return /* @__PURE__ */ e(u, {
186
+ ...t,
187
+ children: /* @__PURE__ */ e("path", {
188
+ stroke: "currentColor",
189
+ strokeLinecap: "round",
190
+ strokeLinejoin: "round",
191
+ strokeWidth: "1.5",
192
+ d: "m18.364 8.05l-.707-.707a8 8 0 1 0 2.28 4.658m-1.573-3.95h-4.243m4.243 0V3.807"
193
+ })
194
+ });
195
+ }
196
+ function x(n) {
197
+ return /* @__PURE__ */ e(u, {
198
+ ...n,
199
+ children: /* @__PURE__ */ t("g", {
200
+ stroke: "currentColor",
201
+ strokeWidth: "1.5",
202
+ children: [/* @__PURE__ */ e("circle", {
203
+ cx: "12",
204
+ cy: "12",
205
+ r: "10"
206
+ }), /* @__PURE__ */ e("path", {
207
+ strokeLinecap: "round",
208
+ d: "m14.5 9.5l-5 5m0-5l5 5"
209
+ })]
210
+ })
211
+ });
212
+ }
213
+ function S(n) {
214
+ return /* @__PURE__ */ e(u, {
215
+ ...n,
216
+ children: /* @__PURE__ */ t("g", {
217
+ stroke: "currentColor",
218
+ strokeWidth: "1.5",
219
+ children: [
220
+ /* @__PURE__ */ e("path", { d: "M11.146 7.023C11.526 6.34 11.716 6 12 6s.474.34.854 1.023l.098.176c.108.194.162.29.246.354c.085.064.19.088.4.135l.19.044c.738.167 1.107.25 1.195.532s-.164.577-.667 1.165l-.13.152c-.143.167-.215.25-.247.354s-.021.215 0 .438l.02.203c.076.785.114 1.178-.115 1.352c-.23.174-.576.015-1.267-.303l-.178-.082c-.197-.09-.295-.135-.399-.135s-.202.045-.399.135l-.178.082c-.691.319-1.037.477-1.267.303s-.191-.567-.115-1.352l.02-.203c.021-.223.032-.334 0-.438s-.104-.187-.247-.354l-.13-.152c-.503-.588-.755-.882-.667-1.165c.088-.282.457-.365 1.195-.532l.19-.044c.21-.047.315-.07.4-.135c.084-.064.138-.16.246-.354z" }),
221
+ /* @__PURE__ */ e("path", { d: "M19 9A7 7 0 1 1 5 9a7 7 0 0 1 14 0Z" }),
222
+ /* @__PURE__ */ e("path", { d: "m12 16.068l-3.771 3.905c-.54.56-.81.839-1.04.935c-.52.22-1.099.032-1.373-.448c-.12-.21-.158-.59-.232-1.35c-.043-.43-.064-.644-.128-.824a1.43 1.43 0 0 0-.835-.864c-.173-.067-.38-.088-.795-.132c-.734-.078-1.101-.117-1.305-.241c-.463-.284-.646-.883-.433-1.422c.094-.237.364-.517.904-1.076L5.456 12M12 16.068l3.771 3.905c.54.56.81.839 1.04.935c.52.22 1.099.032 1.373-.448c.12-.21.157-.59.232-1.35c.043-.43.064-.644.128-.824c.144-.402.446-.715.835-.864c.173-.067.38-.088.795-.132c.734-.078 1.101-.117 1.305-.241c.463-.284.646-.883.433-1.422c-.094-.237-.364-.517-.904-1.076L18.544 12" })
223
+ ]
224
+ })
225
+ });
226
+ }
227
+ function C(t) {
228
+ return /* @__PURE__ */ e(u, {
229
+ ...t,
230
+ children: /* @__PURE__ */ e("path", {
231
+ stroke: "currentColor",
232
+ strokeLinecap: "round",
233
+ strokeWidth: "1.5",
234
+ d: "M20 7H4m11 5H4m5 5H4"
235
+ })
236
+ });
237
+ }
238
+ function w(t) {
239
+ return /* @__PURE__ */ e(u, {
240
+ ...t,
241
+ children: /* @__PURE__ */ e("path", {
242
+ stroke: "currentColor",
243
+ strokeLinecap: "round",
244
+ strokeWidth: "1.5",
245
+ d: "M5.777 10.296v7.969c0 1.323 0 1.985.449 2.547c.448.562.985.66 2.058.858c.992.182 2.249.33 3.716.33s2.724-.148 3.716-.33c1.073-.198 1.61-.296 2.059-.858c.448-.562.448-1.224.448-2.547v-7.97c0-.683 0-1.025.132-1.326c.131-.3.378-.523.871-.968l.186-.167c1.056-.952 1.584-1.429 1.588-2.118c.004-.69-.465-1.122-1.401-1.988a8 8 0 0 0-.418-.362c-.472-.378-1.138-.792-1.648-1.09a2.05 2.05 0 0 0-1.567-.205l-.49.129a1.6 1.6 0 0 0-.949.703c-1.202 1.897-3.852 1.897-5.054 0a1.6 1.6 0 0 0-.948-.703l-.49-.129a2.05 2.05 0 0 0-1.568.205c-.51.298-1.176.712-1.648 1.09a8 8 0 0 0-.418.362C3.464 4.594 2.996 5.027 3 5.716s.532 1.166 1.588 2.118l.186.167c.493.445.74.668.871.968c.132.3.132.643.132 1.327Z"
246
+ })
247
+ });
248
+ }
249
+ function T(n) {
250
+ return /* @__PURE__ */ e(u, {
251
+ ...n,
252
+ children: /* @__PURE__ */ t("g", {
253
+ stroke: "currentColor",
254
+ strokeLinecap: "round",
255
+ strokeWidth: "1.5",
256
+ children: [/* @__PURE__ */ e("path", { d: "M12 20a8 8 0 1 0 0-16" }), /* @__PURE__ */ e("path", {
257
+ strokeLinejoin: "round",
258
+ d: "M4 12h10m0 0l-3-3m3 3l-3 3"
259
+ })]
260
+ })
261
+ });
262
+ }
263
+ function E(t) {
264
+ return /* @__PURE__ */ e(u, {
265
+ ...t,
266
+ children: /* @__PURE__ */ e("path", {
267
+ fill: "currentColor",
268
+ d: "M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"
269
+ })
270
+ });
271
+ }
272
+ function D(t) {
273
+ return /* @__PURE__ */ e(u, {
274
+ ...t,
275
+ children: /* @__PURE__ */ e("path", {
276
+ fill: "currentColor",
277
+ d: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"
278
+ })
279
+ });
280
+ }
281
+ function O({ id: t }) {
282
+ return e(t === "google" ? E : t === "discord" ? D : T, {});
283
+ }
284
+ //#endregion
285
+ //#region src/components/button.tsx
286
+ function k({ variant: t = "primary", size: n = "md", type: r = "button", className: i = "", children: a, ...o }) {
287
+ return /* @__PURE__ */ e("button", {
288
+ type: r,
289
+ className: [
290
+ `${t}-button`,
291
+ n === "md" ? "" : `button--${n}`,
292
+ i
293
+ ].filter(Boolean).join(" "),
294
+ ...o,
295
+ children: a
296
+ });
297
+ }
298
+ //#endregion
299
+ //#region src/components/iconButton.tsx
300
+ function A({ icon: t, size: n = "md", className: r = "", type: i = "button", ...a }) {
301
+ return /* @__PURE__ */ e("button", {
302
+ type: i,
303
+ className: [
304
+ "icon-btn",
305
+ n === "sm" ? "icon-btn--sm" : n === "lg" ? "icon-btn--lg" : "",
306
+ r
307
+ ].filter(Boolean).join(" "),
308
+ ...a,
309
+ children: t
310
+ });
311
+ }
312
+ //#endregion
313
+ //#region src/components/pill.tsx
314
+ function j({ tone: t = "default", children: n, className: r = "", ...i }) {
315
+ return /* @__PURE__ */ e("span", {
316
+ className: [
317
+ "pill",
318
+ t === "default" ? "" : t,
319
+ r
320
+ ].filter(Boolean).join(" "),
321
+ ...i,
322
+ children: n
323
+ });
324
+ }
325
+ //#endregion
326
+ //#region src/components/statusBanner.tsx
327
+ function ee({ message: n, tone: r, onDismiss: i }) {
328
+ return n ? /* @__PURE__ */ t("div", {
329
+ className: ["status-banner", r === "error" ? "error" : r === "warning" ? "warning" : ""].filter(Boolean).join(" "),
330
+ children: [/* @__PURE__ */ e("span", { children: n }), i ? /* @__PURE__ */ e("button", {
331
+ type: "button",
332
+ className: "banner-dismiss",
333
+ "aria-label": "Dismiss",
334
+ onClick: i,
335
+ children: /* @__PURE__ */ e(x, {})
336
+ }) : null]
337
+ }) : null;
338
+ }
339
+ //#endregion
340
+ //#region src/components/select.tsx
341
+ function M(e) {
342
+ return e.findIndex((e) => !e.disabled);
343
+ }
344
+ function te(e) {
345
+ for (let t = e.length - 1; t >= 0; t--) if (!e[t].disabled) return t;
346
+ return -1;
347
+ }
348
+ function N(e, t, n) {
349
+ let r = e.length;
350
+ if (r === 0) return -1;
351
+ let i = t;
352
+ for (let t = 0; t < r; t++) if (i = (i + n + r) % r, !e[i].disabled) return i;
353
+ return t;
354
+ }
355
+ function ne({ value: n, onChange: r, options: i = [], placeholder: a = "", variant: s = "form", disabled: u = !1, "aria-label": p, id: m }) {
356
+ let [h, g] = l(!1), [_, v] = l(-1), y = c(null), b = c(null), x = c([]), S = c({
357
+ buffer: "",
358
+ timer: void 0
359
+ }), C = i.findIndex((e) => e.value === n), w = C >= 0 ? i[C] : void 0, T = w?.label ?? a, E = !w;
360
+ o(() => {
361
+ if (!h) return;
362
+ function e(e) {
363
+ y.current && !y.current.contains(e.target) && g(!1);
364
+ }
365
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
366
+ }, [h]), o(() => {
367
+ h && v(C >= 0 ? C : M(i));
368
+ }, [h]), o(() => {
369
+ !h || _ < 0 || x.current[_]?.focus();
370
+ }, [h, _]);
371
+ function D(e = !0) {
372
+ g(!1), v(-1), e && b.current?.focus();
373
+ }
374
+ function O(e) {
375
+ let t = i[e];
376
+ !t || t.disabled || (r?.(t.value), D());
377
+ }
378
+ function k(e) {
379
+ let t = S.current;
380
+ t.buffer += e.toLowerCase(), t.timer && window.clearTimeout(t.timer), t.timer = window.setTimeout(() => {
381
+ t.buffer = "";
382
+ }, 500);
383
+ let n = i.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(t.buffer));
384
+ n >= 0 && v(n);
385
+ }
386
+ function A(e) {
387
+ u || (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " " ? (e.preventDefault(), h || g(!0)) : e.key === "Escape" && h && (e.preventDefault(), D()));
388
+ }
389
+ function j(e) {
390
+ switch (e.key) {
391
+ case "ArrowDown":
392
+ e.preventDefault(), v((e) => N(i, e < 0 ? -1 : e, 1));
393
+ break;
394
+ case "ArrowUp":
395
+ e.preventDefault(), v((e) => N(i, e < 0 ? 0 : e, -1));
396
+ break;
397
+ case "Home":
398
+ e.preventDefault(), v(M(i));
399
+ break;
400
+ case "End":
401
+ e.preventDefault(), v(te(i));
402
+ break;
403
+ case "Enter":
404
+ case " ":
405
+ e.preventDefault(), _ >= 0 && O(_);
406
+ break;
407
+ case "Escape":
408
+ e.preventDefault(), D();
409
+ break;
410
+ case "Tab":
411
+ D(!1);
412
+ break;
413
+ default: e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && k(e.key);
414
+ }
415
+ }
416
+ return /* @__PURE__ */ t("div", {
417
+ className: [
418
+ "cselect",
419
+ s === "control" ? "cselect--control" : "",
420
+ h ? "open" : ""
421
+ ].filter(Boolean).join(" "),
422
+ ref: y,
423
+ children: [/* @__PURE__ */ t("button", {
424
+ type: "button",
425
+ ref: b,
426
+ className: "cselect-trigger",
427
+ disabled: u,
428
+ "aria-haspopup": "listbox",
429
+ "aria-expanded": h ? "true" : "false",
430
+ "aria-label": p,
431
+ id: m,
432
+ onClick: () => g((e) => !e),
433
+ onKeyDown: A,
434
+ children: [/* @__PURE__ */ e("span", {
435
+ className: ["cselect-value", E ? "placeholder" : ""].filter(Boolean).join(" "),
436
+ children: T
437
+ }), /* @__PURE__ */ e(d, { className: "cselect-chevron" })]
438
+ }), h && /* @__PURE__ */ e("div", {
439
+ className: "cselect-dropdown",
440
+ role: "listbox",
441
+ onKeyDown: j,
442
+ children: i.map((r, i) => /* @__PURE__ */ t("button", {
443
+ type: "button",
444
+ ref: (e) => {
445
+ x.current[i] = e;
446
+ },
447
+ tabIndex: _ === i ? 0 : -1,
448
+ className: [
449
+ "cselect-option",
450
+ r.value === n ? "selected" : "",
451
+ r.disabled ? "cselect-option--disabled" : ""
452
+ ].filter(Boolean).join(" "),
453
+ role: "option",
454
+ "aria-selected": r.value === n ? "true" : "false",
455
+ disabled: r.disabled,
456
+ onClick: () => O(i),
457
+ children: [/* @__PURE__ */ e("span", { children: r.label }), r.value === n && /* @__PURE__ */ e(f, { className: "check-icon" })]
458
+ }, r.value))
459
+ })]
460
+ });
461
+ }
462
+ //#endregion
463
+ //#region src/components/popoverMenu.tsx
464
+ var re = [
465
+ "a[href]",
466
+ "button:not([disabled])",
467
+ "textarea:not([disabled])",
468
+ "input:not([disabled])",
469
+ "select:not([disabled])",
470
+ "[tabindex]:not([tabindex=\"-1\"])"
471
+ ].join(",");
472
+ function P(e) {
473
+ return e ? Array.from(e.querySelectorAll(re)).filter((e) => e.offsetWidth > 0 || e.offsetHeight > 0) : [];
474
+ }
475
+ function F({ trigger: n, children: r, menuClassName: i = "ink-popover-menu", popoverClassName: a = "ink-popover-surface", menuRole: s = "menu", menuLabel: u = "Menu" }) {
476
+ let [d, f] = l(!1), p = c(null), m = c(null), h = c(null), g = () => f((e) => !e);
477
+ o(() => {
478
+ if (!d) return;
479
+ function e(e) {
480
+ p.current && !p.current.contains(e.target) && f(!1);
481
+ }
482
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
483
+ }, [d]), o(() => {
484
+ d && (h.current = document.activeElement, P(m.current)[0]?.focus());
485
+ }, [d]);
486
+ function _(e) {
487
+ let t = P(m.current);
488
+ t.length !== 0 && t[(t.indexOf(document.activeElement) + e + t.length) % t.length].focus();
489
+ }
490
+ function v(e) {
491
+ let t = P(m.current);
492
+ t.length !== 0 && (e === "first" ? t[0] : t[t.length - 1]).focus();
493
+ }
494
+ function y(e) {
495
+ switch (e.key) {
496
+ case "Escape":
497
+ d && (e.preventDefault(), f(!1), h.current?.focus());
498
+ break;
499
+ case "ArrowDown":
500
+ e.preventDefault(), d ? _(1) : f(!0);
501
+ break;
502
+ case "ArrowUp":
503
+ d && (e.preventDefault(), _(-1));
504
+ break;
505
+ case "Home":
506
+ d && (e.preventDefault(), v("first"));
507
+ break;
508
+ case "End":
509
+ d && (e.preventDefault(), v("last"));
510
+ break;
511
+ case "Tab":
512
+ d && f(!1);
513
+ break;
514
+ }
515
+ }
516
+ return /* @__PURE__ */ t("div", {
517
+ ref: p,
518
+ className: [i, d ? "open" : ""].filter(Boolean).join(" "),
519
+ onKeyDown: y,
520
+ children: [n({
521
+ open: d,
522
+ onToggle: g
523
+ }), /* @__PURE__ */ e("div", {
524
+ ref: m,
525
+ className: a,
526
+ role: s,
527
+ "aria-label": u,
528
+ children: r
529
+ })]
530
+ });
531
+ }
532
+ //#endregion
533
+ //#region src/components/ui.jsx
534
+ function ie({ children: t, className: n = "panel", ...r }) {
535
+ return /* @__PURE__ */ e("section", {
536
+ className: n,
537
+ ...r,
538
+ children: t
539
+ });
540
+ }
541
+ function I({ eyebrow: n, title: r, titleId: i, copy: a, compact: o = !1, children: s, className: c = "" }) {
542
+ return /* @__PURE__ */ t("div", {
543
+ className: [
544
+ "section-heading",
545
+ o ? "compact" : "",
546
+ c
547
+ ].filter(Boolean).join(" "),
548
+ children: [
549
+ /* @__PURE__ */ t("div", { children: [n ? /* @__PURE__ */ e("p", {
550
+ className: "eyebrow",
551
+ children: n
552
+ }) : null, r ? /* @__PURE__ */ e("h2", {
553
+ id: i,
554
+ children: r
555
+ }) : null] }),
556
+ a ? /* @__PURE__ */ e("div", {
557
+ className: "section-heading-copy subtle",
558
+ children: a
559
+ }) : null,
560
+ s
561
+ ]
562
+ });
563
+ }
564
+ function ae({ children: t, className: n = "empty-state", ...r }) {
565
+ return /* @__PURE__ */ e("div", {
566
+ className: n,
567
+ ...r,
568
+ children: t
569
+ });
570
+ }
571
+ function L({ id: n, message: r, tone: i, onDismiss: a }) {
572
+ return /* @__PURE__ */ t("article", {
573
+ className: ["toast", i].filter(Boolean).join(" "),
574
+ children: [/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("strong", { children: r }) }), /* @__PURE__ */ e("button", {
575
+ type: "button",
576
+ "aria-label": "Dismiss",
577
+ onClick: a,
578
+ children: /* @__PURE__ */ e(x, {})
579
+ })]
580
+ });
581
+ }
582
+ function oe({ toasts: t = [], onDismiss: n }) {
583
+ return /* @__PURE__ */ e("div", {
584
+ id: "toastRegion",
585
+ className: "toast-region",
586
+ "aria-live": "polite",
587
+ "aria-atomic": "true",
588
+ children: t.map((t) => /* @__PURE__ */ e(L, {
589
+ ...t,
590
+ onDismiss: () => n?.(t.id)
591
+ }, t.id))
592
+ });
593
+ }
594
+ //#endregion
595
+ //#region src/components/modalFrame.tsx
596
+ var R = {
597
+ default: "modal-card panel modal-panel modal-panel--wide",
598
+ compact: "modal-card panel modal-panel modal-panel--compact",
599
+ picker: "modal-card panel modal-panel modal-panel--compact",
600
+ settings: "modal-card panel modal-panel--settings"
601
+ }, z = [
602
+ "a[href]",
603
+ "button:not([disabled])",
604
+ "textarea:not([disabled])",
605
+ "input:not([disabled])",
606
+ "select:not([disabled])",
607
+ "[tabindex]:not([tabindex=\"-1\"])"
608
+ ].join(",");
609
+ function se({ id: n, titleId: r, title: i, onClose: a, children: s, size: l = "default", cardClassName: u, describedBy: d, open: f = !1, className: p = "" }) {
610
+ let m = c(null), h = u ?? R[l] ?? R.default, g = [
611
+ "modal",
612
+ f ? "" : "hidden",
613
+ p
614
+ ].filter(Boolean).join(" ");
615
+ o(() => {
616
+ if (!f) return;
617
+ let e = m.current, t = document.activeElement;
618
+ ((e ? Array.from(e.querySelectorAll(z)) : [])[0] ?? e)?.focus();
619
+ let n = document.body, r = n.style.overflow;
620
+ return n.style.overflow = "hidden", () => {
621
+ n.style.overflow = r, t?.focus?.();
622
+ };
623
+ }, [f]);
624
+ function _(e) {
625
+ if (!f) return;
626
+ if (e.key === "Escape") {
627
+ e.stopPropagation(), a?.();
628
+ return;
629
+ }
630
+ if (e.key !== "Tab") return;
631
+ let t = m.current;
632
+ if (!t) return;
633
+ let n = Array.from(t.querySelectorAll(z)).filter((e) => e.offsetWidth > 0 || e.offsetHeight > 0 || e === document.activeElement);
634
+ if (n.length === 0) {
635
+ e.preventDefault(), t.focus();
636
+ return;
637
+ }
638
+ let r = n[0], i = n[n.length - 1], o = document.activeElement;
639
+ e.shiftKey ? (o === r || !t.contains(o)) && (e.preventDefault(), i.focus()) : o === i && (e.preventDefault(), r.focus());
640
+ }
641
+ return /* @__PURE__ */ t("div", {
642
+ id: n,
643
+ className: g,
644
+ role: "dialog",
645
+ "aria-modal": "true",
646
+ "aria-labelledby": r,
647
+ "aria-describedby": d,
648
+ "aria-hidden": f ? "false" : "true",
649
+ onKeyDown: _,
650
+ children: [/* @__PURE__ */ e("div", {
651
+ className: "modal-backdrop",
652
+ onClick: a
653
+ }), /* @__PURE__ */ t("div", {
654
+ className: h,
655
+ ref: m,
656
+ tabIndex: -1,
657
+ children: [/* @__PURE__ */ e(I, {
658
+ title: i,
659
+ titleId: r,
660
+ children: /* @__PURE__ */ e(k, {
661
+ variant: "ghost",
662
+ className: "modal-close-button",
663
+ "aria-label": "Close",
664
+ onClick: a,
665
+ children: /* @__PURE__ */ e(x, {})
666
+ })
667
+ }), s]
668
+ })]
669
+ });
670
+ }
671
+ //#endregion
672
+ //#region src/components/splitButton.jsx
673
+ function B({ primaryLabel: n, onPrimaryClick: r, items: i = [] }) {
674
+ let [a, s] = l(!1), u = c(null);
675
+ o(() => {
676
+ if (!a) return;
677
+ function e(e) {
678
+ u.current && !u.current.contains(e.target) && s(!1);
679
+ }
680
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
681
+ }, [a]);
682
+ function f(e) {
683
+ s(!1), e?.();
684
+ }
685
+ return /* @__PURE__ */ t("div", {
686
+ className: "split-button",
687
+ ref: u,
688
+ children: [
689
+ /* @__PURE__ */ e("button", {
690
+ type: "button",
691
+ className: "split-button-primary",
692
+ onClick: r,
693
+ children: n
694
+ }),
695
+ /* @__PURE__ */ e("div", { className: "split-button-divider" }),
696
+ /* @__PURE__ */ e("button", {
697
+ type: "button",
698
+ className: "split-button-chevron",
699
+ onClick: () => s((e) => !e),
700
+ "aria-label": "More round types",
701
+ "aria-haspopup": "menu",
702
+ "aria-expanded": a ? "true" : "false",
703
+ children: /* @__PURE__ */ e(d, { style: a ? { transform: "rotate(180deg)" } : void 0 })
704
+ }),
705
+ a && /* @__PURE__ */ e("div", {
706
+ className: "split-dropdown",
707
+ role: "menu",
708
+ children: i.map((n) => /* @__PURE__ */ t("button", {
709
+ type: "button",
710
+ className: "split-dropdown-item",
711
+ role: "menuitem",
712
+ onClick: () => f(n.onClick),
713
+ children: [/* @__PURE__ */ e("span", {
714
+ className: "split-dropdown-icon",
715
+ style: {
716
+ background: n.iconBg,
717
+ color: n.iconColor
718
+ },
719
+ "aria-hidden": "true",
720
+ children: n.icon
721
+ }), /* @__PURE__ */ t("span", {
722
+ className: "split-dropdown-copy",
723
+ children: [/* @__PURE__ */ e("span", {
724
+ className: "split-dropdown-label",
725
+ children: n.label
726
+ }), /* @__PURE__ */ e("span", {
727
+ className: "split-dropdown-desc",
728
+ children: n.description
729
+ })]
730
+ })]
731
+ }, n.label))
732
+ })
733
+ ]
734
+ });
735
+ }
736
+ //#endregion
737
+ //#region src/components/forms.tsx
738
+ var V = r(null);
739
+ function H({ label: n, hint: r, error: i, htmlFor: a, required: o = !1, className: c = "", children: l }) {
740
+ let u = s(), d = a ?? u, f = r ? `${d}-hint` : void 0, p = i ? `${d}-error` : void 0, m = [f, p].filter(Boolean).join(" ") || void 0, h = !!i, g = [
741
+ "field",
742
+ h ? "field--invalid" : "",
743
+ c
744
+ ].filter(Boolean).join(" ");
745
+ return /* @__PURE__ */ e(V.Provider, {
746
+ value: {
747
+ id: d,
748
+ describedBy: m,
749
+ invalid: h,
750
+ required: o
751
+ },
752
+ children: /* @__PURE__ */ t("div", {
753
+ className: g,
754
+ children: [
755
+ n ? /* @__PURE__ */ t("label", {
756
+ className: "field-label",
757
+ htmlFor: d,
758
+ children: [n, o ? /* @__PURE__ */ e("span", {
759
+ className: "field-required",
760
+ "aria-hidden": "true",
761
+ children: " *"
762
+ }) : null]
763
+ }) : null,
764
+ l,
765
+ r && !i ? /* @__PURE__ */ e("p", {
766
+ className: "field-hint",
767
+ id: f,
768
+ children: r
769
+ }) : null,
770
+ i ? /* @__PURE__ */ e("p", {
771
+ className: "field-error",
772
+ id: p,
773
+ role: "alert",
774
+ children: i
775
+ }) : null
776
+ ]
777
+ })
778
+ });
779
+ }
780
+ function U({ id: t, type: n = "text", invalid: r = !1, describedBy: i, className: o = "", ...s }) {
781
+ let c = a(V), l = r || c?.invalid || !1, u = [
782
+ "input",
783
+ l ? "input--invalid" : "",
784
+ o
785
+ ].filter(Boolean).join(" ");
786
+ return /* @__PURE__ */ e("input", {
787
+ id: t ?? c?.id,
788
+ type: n,
789
+ className: u,
790
+ "aria-invalid": l || void 0,
791
+ "aria-describedby": i ?? c?.describedBy,
792
+ required: c?.required,
793
+ ...s
794
+ });
795
+ }
796
+ function W({ id: t, rows: n = 4, invalid: r = !1, describedBy: i, className: o = "", ...s }) {
797
+ let c = a(V), l = r || c?.invalid || !1, u = [
798
+ "textarea",
799
+ l ? "input--invalid" : "",
800
+ o
801
+ ].filter(Boolean).join(" ");
802
+ return /* @__PURE__ */ e("textarea", {
803
+ id: t ?? c?.id,
804
+ rows: n,
805
+ className: u,
806
+ "aria-invalid": l || void 0,
807
+ "aria-describedby": i ?? c?.describedBy,
808
+ required: c?.required,
809
+ ...s
810
+ });
811
+ }
812
+ function G({ id: n, label: r, invalid: i = !1, className: a = "", ...o }) {
813
+ let c = s(), l = n ?? c;
814
+ return /* @__PURE__ */ t("label", {
815
+ className: [
816
+ "checkbox",
817
+ o.disabled ? "checkbox--disabled" : "",
818
+ a
819
+ ].filter(Boolean).join(" "),
820
+ htmlFor: l,
821
+ children: [/* @__PURE__ */ e("input", {
822
+ id: l,
823
+ type: "checkbox",
824
+ className: "checkbox-input",
825
+ "aria-invalid": i || void 0,
826
+ ...o
827
+ }), r ? /* @__PURE__ */ e("span", {
828
+ className: "checkbox-label",
829
+ children: r
830
+ }) : null]
831
+ });
832
+ }
833
+ //#endregion
834
+ //#region src/components/card.tsx
835
+ function K({ variant: t = "plain", tone: n = "default", className: r = "", children: i, ...a }) {
836
+ return /* @__PURE__ */ e("div", {
837
+ className: [
838
+ "card",
839
+ t === "outlined" ? "card--outlined" : "",
840
+ n === "danger" ? "card--danger" : "",
841
+ r
842
+ ].filter(Boolean).join(" "),
843
+ ...a,
844
+ children: i
845
+ });
846
+ }
847
+ function ce({ className: t = "", children: n, ...r }) {
848
+ return /* @__PURE__ */ e("div", {
849
+ className: ["card-actions", t].filter(Boolean).join(" "),
850
+ ...r,
851
+ children: n
852
+ });
853
+ }
854
+ //#endregion
855
+ //#region src/components/badge.tsx
856
+ function le({ tone: t = "brand", dot: n = !1, className: r = "", children: i, ...a }) {
857
+ return /* @__PURE__ */ e("span", {
858
+ className: [
859
+ "badge",
860
+ n ? "badge--dot" : "",
861
+ t === "brand" ? "" : `badge--${t}`,
862
+ r
863
+ ].filter(Boolean).join(" "),
864
+ ...a,
865
+ children: n ? null : i
866
+ });
867
+ }
868
+ //#endregion
869
+ //#region src/components/tabs.tsx
870
+ function ue(e) {
871
+ return e.findIndex((e) => !e.disabled);
872
+ }
873
+ function de(e) {
874
+ for (let t = e.length - 1; t >= 0; t--) if (!e[t].disabled) return t;
875
+ return -1;
876
+ }
877
+ function q(e, t, n) {
878
+ let r = e.length;
879
+ if (r === 0) return -1;
880
+ let i = t;
881
+ for (let t = 0; t < r; t++) if (i = (i + n + r) % r, !e[i].disabled) return i;
882
+ return t;
883
+ }
884
+ function fe({ tabs: n, value: r, onChange: i, "aria-label": a, id: s }) {
885
+ let u = c([]), [d, f] = l({
886
+ left: 0,
887
+ width: 0
888
+ }), p = n.findIndex((e) => e.value === r);
889
+ o(() => {
890
+ let e = u.current[p];
891
+ e && f({
892
+ left: e.offsetLeft,
893
+ width: e.offsetWidth
894
+ });
895
+ }, [p, n]);
896
+ function m(e) {
897
+ let t = n[e];
898
+ !t || t.disabled || (i(t.value), u.current[e]?.focus());
899
+ }
900
+ function h(e) {
901
+ switch (e.key) {
902
+ case "ArrowRight":
903
+ case "ArrowDown":
904
+ e.preventDefault(), m(q(n, p < 0 ? -1 : p, 1));
905
+ break;
906
+ case "ArrowLeft":
907
+ case "ArrowUp":
908
+ e.preventDefault(), m(q(n, p < 0 ? 0 : p, -1));
909
+ break;
910
+ case "Home":
911
+ e.preventDefault(), m(ue(n));
912
+ break;
913
+ case "End":
914
+ e.preventDefault(), m(de(n));
915
+ break;
916
+ }
917
+ }
918
+ return /* @__PURE__ */ t("div", {
919
+ className: "ink-tabs",
920
+ role: "tablist",
921
+ "aria-label": a,
922
+ onKeyDown: h,
923
+ children: [n.map((t, n) => {
924
+ let a = t.value === r;
925
+ return /* @__PURE__ */ e("button", {
926
+ ref: (e) => {
927
+ u.current[n] = e;
928
+ },
929
+ type: "button",
930
+ role: "tab",
931
+ id: s ? `${s}-tab-${t.value}` : void 0,
932
+ "aria-selected": a ? "true" : "false",
933
+ "aria-controls": s ? `${s}-panel-${t.value}` : void 0,
934
+ tabIndex: a ? 0 : -1,
935
+ disabled: t.disabled,
936
+ className: ["ink-tab", a ? "ink-tab--active" : ""].filter(Boolean).join(" "),
937
+ onClick: () => i(t.value),
938
+ children: t.label
939
+ }, t.value);
940
+ }), /* @__PURE__ */ e("span", {
941
+ className: "ink-tab-indicator",
942
+ "aria-hidden": "true",
943
+ style: {
944
+ transform: `translateX(${d.left}px)`,
945
+ width: `${d.width}px`
946
+ }
947
+ })]
948
+ });
949
+ }
950
+ //#endregion
951
+ //#region src/components/collapsible.tsx
952
+ function pe({ title: n, description: r, meta: i, defaultOpen: a = !1, open: o, onOpenChange: c, divided: u = !1, children: f, id: p, className: m = "" }) {
953
+ let h = s(), g = p ?? h, _ = `${g}-trigger`, v = `${g}-content`, [y, b] = l(a), x = o !== void 0, S = x ? o : y;
954
+ function C() {
955
+ let e = !S;
956
+ x || b(e), c?.(e);
957
+ }
958
+ return /* @__PURE__ */ t("div", {
959
+ className: [
960
+ "collapsible",
961
+ u ? "collapsible--divided" : "",
962
+ m
963
+ ].filter(Boolean).join(" "),
964
+ children: [/* @__PURE__ */ t("button", {
965
+ type: "button",
966
+ id: _,
967
+ className: "collapsible-trigger",
968
+ "aria-expanded": S ? "true" : "false",
969
+ "aria-controls": v,
970
+ onClick: C,
971
+ children: [
972
+ /* @__PURE__ */ t("span", {
973
+ className: "collapsible-main",
974
+ children: [/* @__PURE__ */ e("strong", { children: n }), r ? /* @__PURE__ */ e("span", {
975
+ className: "subtle",
976
+ children: r
977
+ }) : null]
978
+ }),
979
+ i ? /* @__PURE__ */ e("span", {
980
+ className: "collapsible-meta",
981
+ children: i
982
+ }) : null,
983
+ /* @__PURE__ */ e("span", {
984
+ className: "collapsible-chevron-box",
985
+ "aria-hidden": "true",
986
+ children: /* @__PURE__ */ e(d, { className: ["collapsible-chevron", S ? "collapsible-chevron--open" : ""].filter(Boolean).join(" ") })
987
+ })
988
+ ]
989
+ }), /* @__PURE__ */ e("div", {
990
+ id: v,
991
+ className: "collapsible-content",
992
+ role: "region",
993
+ "aria-labelledby": _,
994
+ hidden: !S,
995
+ children: f
996
+ })]
997
+ });
998
+ }
999
+ //#endregion
1000
+ //#region src/components/tooltip.tsx
1001
+ function me({ content: r, placement: a = "top", trigger: o, triggerLabel: c = "More information", id: u, className: d = "" }) {
1002
+ let f = s(), p = `${u ?? f}-content`, [m, h] = l(!1);
1003
+ function g(e) {
1004
+ e.key === "Escape" && !m && h(!0);
1005
+ }
1006
+ function _() {
1007
+ m && h(!1);
1008
+ }
1009
+ let v = o == null ? /* @__PURE__ */ e("button", {
1010
+ type: "button",
1011
+ className: "info-tooltip-trigger",
1012
+ "aria-describedby": p,
1013
+ "aria-label": c,
1014
+ children: "i"
1015
+ }) : i(o) ? n(o, { "aria-describedby": p }) : o;
1016
+ return /* @__PURE__ */ t("span", {
1017
+ className: ["info-tooltip", d].filter(Boolean).join(" "),
1018
+ "data-tooltip-dismissed": m ? "" : void 0,
1019
+ onKeyDown: g,
1020
+ onMouseLeave: _,
1021
+ onBlur: _,
1022
+ children: [v, /* @__PURE__ */ e("span", {
1023
+ id: p,
1024
+ role: "tooltip",
1025
+ className: "info-tooltip-content",
1026
+ "data-placement": a,
1027
+ children: r
1028
+ })]
1029
+ });
1030
+ }
1031
+ //#endregion
1032
+ //#region src/components/divider.tsx
1033
+ function he({ orientation: t = "horizontal", label: n, id: r, className: i = "" }) {
1034
+ return t === "vertical" ? /* @__PURE__ */ e("div", {
1035
+ id: r,
1036
+ role: "separator",
1037
+ "aria-orientation": "vertical",
1038
+ className: [
1039
+ "ink-divider",
1040
+ "ink-divider--vertical",
1041
+ i
1042
+ ].filter(Boolean).join(" ")
1043
+ }) : n == null ? /* @__PURE__ */ e("hr", {
1044
+ id: r,
1045
+ className: ["ink-divider", i].filter(Boolean).join(" ")
1046
+ }) : /* @__PURE__ */ e("div", {
1047
+ id: r,
1048
+ role: "separator",
1049
+ className: [
1050
+ "ink-divider",
1051
+ "ink-divider--labeled",
1052
+ i
1053
+ ].filter(Boolean).join(" "),
1054
+ children: /* @__PURE__ */ e("span", {
1055
+ className: "ink-divider-label",
1056
+ children: n
1057
+ })
1058
+ });
1059
+ }
1060
+ //#endregion
1061
+ //#region src/components/avatar.tsx
1062
+ function ge(e) {
1063
+ return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e.charAt(0).toUpperCase()).join("");
1064
+ }
1065
+ function _e({ name: t, src: n, alt: r, size: i = "md", shape: a = "circle", children: o, decorative: s = !1, interactive: c = !1, onClick: l, buttonLabel: u, id: d, className: f = "" }) {
1066
+ let p = [
1067
+ "ink-avatar",
1068
+ i === "md" ? "" : `ink-avatar--${i}`,
1069
+ a === "square" ? "ink-avatar--square" : "",
1070
+ c ? "" : f
1071
+ ].filter(Boolean).join(" "), m = t ? ge(t) : "", h = r ?? t, g;
1072
+ g = n ? /* @__PURE__ */ e("img", {
1073
+ className: "ink-avatar-image",
1074
+ src: n,
1075
+ alt: s || c ? "" : h ?? ""
1076
+ }) : o ?? /* @__PURE__ */ e("span", {
1077
+ className: "ink-avatar-initials",
1078
+ children: m
1079
+ });
1080
+ let _ = /* @__PURE__ */ e("span", {
1081
+ id: c ? void 0 : d,
1082
+ className: p,
1083
+ ...s || c || n ? { "aria-hidden": s || void 0 } : h ? {
1084
+ role: "img",
1085
+ "aria-label": h
1086
+ } : { "aria-hidden": !0 },
1087
+ children: g
1088
+ });
1089
+ return c ? /* @__PURE__ */ e("button", {
1090
+ type: "button",
1091
+ id: d,
1092
+ className: ["ink-avatar-button", f].filter(Boolean).join(" "),
1093
+ "aria-label": u ?? h ?? "Account",
1094
+ onClick: l,
1095
+ children: _
1096
+ }) : _;
1097
+ }
1098
+ //#endregion
1099
+ //#region src/components/table.tsx
1100
+ function ve({ columns: n, data: r, getRowKey: i, sortBy: a, sortDirection: o, onSortChange: s, defaultSortBy: c, defaultSortDirection: u = "asc", density: f = "comfortable", stickyHeader: p = !1, hoverable: m = !1, caption: h, empty: g, id: _, className: v = "" }) {
1101
+ let y = a !== void 0, [b, x] = l({
1102
+ by: c,
1103
+ direction: u
1104
+ }), S = y ? a : b.by, C = y ? o ?? "asc" : b.direction;
1105
+ function w(e) {
1106
+ let t = S === e && C === "asc" ? "desc" : "asc";
1107
+ y || x({
1108
+ by: e,
1109
+ direction: t
1110
+ }), s?.(e, t);
1111
+ }
1112
+ return /* @__PURE__ */ t("table", {
1113
+ id: _,
1114
+ className: [
1115
+ "ink-table",
1116
+ f === "compact" ? "ink-table--compact" : "",
1117
+ p ? "ink-table--sticky" : "",
1118
+ m ? "ink-table--hoverable" : "",
1119
+ v
1120
+ ].filter(Boolean).join(" "),
1121
+ children: [
1122
+ h ? /* @__PURE__ */ e("caption", {
1123
+ className: "ink-table-caption",
1124
+ children: h
1125
+ }) : null,
1126
+ n.some((e) => e.width) ? /* @__PURE__ */ e("colgroup", { children: n.map((t) => /* @__PURE__ */ e("col", { style: t.width ? { width: t.width } : void 0 }, t.id)) }) : null,
1127
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: n.map((n) => {
1128
+ let r = n.align ?? "start", i = n.sortable && S === n.id;
1129
+ return /* @__PURE__ */ e("th", {
1130
+ scope: "col",
1131
+ "aria-sort": n.sortable ? i ? C === "asc" ? "ascending" : "descending" : "none" : void 0,
1132
+ "data-align": r,
1133
+ children: n.sortable ? /* @__PURE__ */ t("button", {
1134
+ type: "button",
1135
+ className: "ink-table-sort-button",
1136
+ onClick: () => w(n.id),
1137
+ children: [/* @__PURE__ */ e("span", {
1138
+ className: "ink-table-header-label",
1139
+ children: n.header
1140
+ }), /* @__PURE__ */ e(d, {
1141
+ className: [
1142
+ "ink-table-sort-icon",
1143
+ i ? "ink-table-sort-icon--active" : "",
1144
+ i && C === "asc" ? "ink-table-sort-icon--asc" : ""
1145
+ ].filter(Boolean).join(" "),
1146
+ "aria-hidden": "true"
1147
+ })]
1148
+ }) : /* @__PURE__ */ e("span", {
1149
+ className: "ink-table-header-label",
1150
+ children: n.header
1151
+ })
1152
+ }, n.id);
1153
+ }) }) }),
1154
+ /* @__PURE__ */ e("tbody", { children: r.length === 0 ? /* @__PURE__ */ e("tr", {
1155
+ className: "ink-table-empty-row",
1156
+ children: /* @__PURE__ */ e("td", {
1157
+ colSpan: n.length,
1158
+ children: g ?? "No data."
1159
+ })
1160
+ }) : r.map((t) => /* @__PURE__ */ e("tr", { children: n.map((n) => /* @__PURE__ */ e("td", {
1161
+ "data-align": n.align ?? "start",
1162
+ children: n.render(t)
1163
+ }, n.id)) }, i(t))) })
1164
+ ]
1165
+ });
1166
+ }
1167
+ //#endregion
1168
+ //#region src/components/list.tsx
1169
+ function J({ columns: t, density: n = "comfortable", bordered: r = !0, children: i, id: a, className: o = "" }) {
1170
+ return /* @__PURE__ */ e("div", {
1171
+ id: a,
1172
+ className: [
1173
+ "ink-list",
1174
+ n === "compact" ? "ink-list--compact" : "",
1175
+ r ? "ink-list--bordered" : "",
1176
+ o
1177
+ ].filter(Boolean).join(" "),
1178
+ style: { "--ink-list-cols": t },
1179
+ role: "list",
1180
+ children: i
1181
+ });
1182
+ }
1183
+ J.Row = function({ children: t, id: n, className: r = "" }) {
1184
+ return /* @__PURE__ */ e("div", {
1185
+ id: n,
1186
+ role: "listitem",
1187
+ className: ["ink-list-row", r].filter(Boolean).join(" "),
1188
+ children: t
1189
+ });
1190
+ };
1191
+ //#endregion
1192
+ //#region src/components/spinner.tsx
1193
+ function ye({ size: t = "md", tone: n = "muted", label: r = "Loading", decorative: i = !1, id: a, className: o = "" }) {
1194
+ let s = [
1195
+ "ink-spinner",
1196
+ t === "md" ? "" : `ink-spinner--${t}`,
1197
+ n === "muted" ? "" : `ink-spinner--${n}`,
1198
+ o
1199
+ ].filter(Boolean).join(" ");
1200
+ return i ? /* @__PURE__ */ e("span", {
1201
+ id: a,
1202
+ className: s,
1203
+ "aria-hidden": "true"
1204
+ }) : /* @__PURE__ */ e("span", {
1205
+ id: a,
1206
+ className: s,
1207
+ role: "status",
1208
+ "aria-live": "polite",
1209
+ children: /* @__PURE__ */ e("span", {
1210
+ className: "sr-only",
1211
+ children: r
1212
+ })
1213
+ });
1214
+ }
1215
+ //#endregion
1216
+ //#region src/components/skeleton.tsx
1217
+ function Y(e) {
1218
+ if (e != null) return typeof e == "number" ? `${e}px` : e;
1219
+ }
1220
+ function be({ variant: t = "text", width: n, height: r, size: i = 40, lines: a, id: o, className: s = "" }) {
1221
+ let c = [
1222
+ "ink-skeleton",
1223
+ `ink-skeleton--${t}`,
1224
+ s
1225
+ ].filter(Boolean).join(" "), l = (e) => {
1226
+ if (t === "circle") {
1227
+ let e = Y(n ?? i);
1228
+ return {
1229
+ width: e,
1230
+ height: Y(r ?? i) ?? e
1231
+ };
1232
+ }
1233
+ return t === "rect" ? {
1234
+ width: Y(n) ?? "100%",
1235
+ height: Y(r)
1236
+ } : {
1237
+ width: a != null && e === a - 1 ? "68%" : Y(n) ?? "100%",
1238
+ height: Y(r)
1239
+ };
1240
+ };
1241
+ return t === "text" && a != null && a > 1 ? /* @__PURE__ */ e("span", {
1242
+ id: o,
1243
+ className: "ink-skeleton-lines",
1244
+ "aria-hidden": "true",
1245
+ children: Array.from({ length: a }, (t, n) => /* @__PURE__ */ e("span", {
1246
+ className: c,
1247
+ style: l(n)
1248
+ }, n))
1249
+ }) : /* @__PURE__ */ e("span", {
1250
+ id: o,
1251
+ className: c,
1252
+ style: l(),
1253
+ "aria-hidden": "true"
1254
+ });
1255
+ }
1256
+ //#endregion
1257
+ //#region src/components/progress.tsx
1258
+ function xe(e) {
1259
+ return Number.isNaN(e) ? 0 : Math.round(Math.min(100, Math.max(0, e)));
1260
+ }
1261
+ function Se({ value: n, tone: r = "brand", size: i = "md", label: a, valueFormatter: o, ariaLabel: c, id: l, className: u = "" }) {
1262
+ let d = s(), f = a == null ? void 0 : `${l ?? d}-label`, p = typeof n == "number", m = p ? xe(n) : 0, h = p ? (o ?? ((e) => `${e}%`))(m) : null;
1263
+ return /* @__PURE__ */ t("div", {
1264
+ id: l,
1265
+ className: [
1266
+ "ink-progress",
1267
+ r === "brand" ? "" : `ink-progress--${r}`,
1268
+ i === "md" ? "" : `ink-progress--${i}`,
1269
+ u
1270
+ ].filter(Boolean).join(" "),
1271
+ children: [a == null ? null : /* @__PURE__ */ t("div", {
1272
+ className: "ink-progress-heading",
1273
+ children: [/* @__PURE__ */ e("span", {
1274
+ id: f,
1275
+ className: "ink-progress-label",
1276
+ children: a
1277
+ }), h == null ? null : /* @__PURE__ */ e("span", {
1278
+ className: "ink-progress-value",
1279
+ children: h
1280
+ })]
1281
+ }), /* @__PURE__ */ e("div", {
1282
+ className: "ink-progress-track",
1283
+ role: "progressbar",
1284
+ "aria-valuemin": 0,
1285
+ "aria-valuemax": 100,
1286
+ "aria-valuenow": p ? m : void 0,
1287
+ "aria-valuetext": p ? void 0 : "indeterminate",
1288
+ "aria-labelledby": f,
1289
+ "aria-label": f ? void 0 : c,
1290
+ children: /* @__PURE__ */ e("div", {
1291
+ className: ["ink-progress-fill", p ? "" : "ink-progress-fill--indeterminate"].filter(Boolean).join(" "),
1292
+ style: p ? { transform: `scaleX(${m / 100})` } : void 0
1293
+ })
1294
+ })]
1295
+ });
1296
+ }
1297
+ //#endregion
1298
+ //#region src/components/layout.tsx
1299
+ var X = {
1300
+ none: "0",
1301
+ xs: "var(--space-1)",
1302
+ sm: "var(--space-2)",
1303
+ md: "var(--space-3)",
1304
+ lg: "var(--space-4)",
1305
+ xl: "var(--space-6)"
1306
+ }, Z = {
1307
+ start: "flex-start",
1308
+ center: "center",
1309
+ end: "flex-end",
1310
+ stretch: "stretch",
1311
+ baseline: "baseline"
1312
+ }, Ce = {
1313
+ start: "flex-start",
1314
+ center: "center",
1315
+ end: "flex-end",
1316
+ between: "space-between",
1317
+ around: "space-around"
1318
+ };
1319
+ function Q(e, t) {
1320
+ let n = {};
1321
+ for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] = r);
1322
+ return {
1323
+ ...e,
1324
+ ...n
1325
+ };
1326
+ }
1327
+ function $({ gap: t = "md", align: n, className: r = "", style: i, children: a, ...o }) {
1328
+ return /* @__PURE__ */ e("div", {
1329
+ className: ["ink-stack", r].filter(Boolean).join(" "),
1330
+ style: Q(i, {
1331
+ "--ink-stack-gap": X[t],
1332
+ "--ink-stack-align": n && Z[n]
1333
+ }),
1334
+ ...o,
1335
+ children: a
1336
+ });
1337
+ }
1338
+ function we({ gap: t = "md", align: n, justify: r, wrap: i = !0, className: a = "", style: o, children: s, ...c }) {
1339
+ return /* @__PURE__ */ e("div", {
1340
+ className: ["ink-inline", a].filter(Boolean).join(" "),
1341
+ style: Q(o, {
1342
+ "--ink-inline-gap": X[t],
1343
+ "--ink-inline-align": n && Z[n],
1344
+ "--ink-inline-justify": r && Ce[r],
1345
+ "--ink-inline-wrap": i ? "wrap" : "nowrap"
1346
+ }),
1347
+ ...c,
1348
+ children: s
1349
+ });
1350
+ }
1351
+ function Te({ gap: t = "md", columns: n = 2, align: r, className: i = "", style: a, children: o, ...s }) {
1352
+ return /* @__PURE__ */ e("div", {
1353
+ className: ["ink-grid", i].filter(Boolean).join(" "),
1354
+ style: Q(a, {
1355
+ "--ink-grid-gap": X[t],
1356
+ "--ink-grid-columns": `repeat(${n}, minmax(0, 1fr))`,
1357
+ "--ink-grid-align": r && Z[r]
1358
+ }),
1359
+ ...s,
1360
+ children: o
1361
+ });
1362
+ }
1363
+ //#endregion
1364
+ export { _e as Avatar, le as Badge, O as BrandIcon, k as Button, K as Card, ce as CardActions, G as Checkbox, pe as Collapsible, he as Divider, ae as EmptyState, H as FormField, Te as Grid, d as IconArrowDown, S as IconAward, A as IconButton, f as IconCheck, x as IconClose, y as IconCopy, D as IconDiscord, p as IconDotsVertical, m as IconEye, E as IconGoogle, C as IconList, T as IconLogin, h as IconLogout, b as IconRestart, v as IconSettings, w as IconShirt, g as IconTrophy, _ as IconUsers, we as Inline, J as List, se as ModalFrame, ie as Panel, j as Pill, F as PopoverMenu, Se as Progress, I as SectionHeading, ne as Select, be as Skeleton, ye as Spinner, B as SplitButton, $ as Stack, ee as StatusBanner, ve as Table, fe as Tabs, U as TextInput, W as Textarea, L as Toast, oe as ToastRegion, me as Tooltip };
1365
+
1366
+ //# sourceMappingURL=index.js.map