sonahang-ui 1.0.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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -0
  3. package/dist/components/Accordion/Accordion.d.ts +36 -0
  4. package/dist/components/Accordion/AccordionItem.d.ts +15 -0
  5. package/dist/components/Accordion/accordion.context.d.ts +18 -0
  6. package/dist/components/Accordion/index.d.ts +5 -0
  7. package/dist/components/Alert/Alert.d.ts +24 -0
  8. package/dist/components/Alert/alert.tokens.d.ts +2 -0
  9. package/dist/components/Alert/index.d.ts +4 -0
  10. package/dist/components/Avatar/Avatar.d.ts +17 -0
  11. package/dist/components/Avatar/AvatarGroup.d.ts +12 -0
  12. package/dist/components/Avatar/avatar.context.d.ts +7 -0
  13. package/dist/components/Avatar/avatar.tokens.d.ts +2 -0
  14. package/dist/components/Avatar/getInitials.d.ts +6 -0
  15. package/dist/components/Avatar/index.d.ts +6 -0
  16. package/dist/components/Breadcrumb/Breadcrumb.d.ts +19 -0
  17. package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +25 -0
  18. package/dist/components/Breadcrumb/breadcrumb.context.d.ts +10 -0
  19. package/dist/components/Breadcrumb/index.d.ts +4 -0
  20. package/dist/components/Button/Button.d.ts +20 -0
  21. package/dist/components/Button/button.tokens.d.ts +4 -0
  22. package/dist/components/Button/buttonClassNames.d.ts +17 -0
  23. package/dist/components/Button/index.d.ts +6 -0
  24. package/dist/components/Checkbox/Checkbox.d.ts +24 -0
  25. package/dist/components/Checkbox/CheckboxGroup.d.ts +28 -0
  26. package/dist/components/Checkbox/checkbox.context.d.ts +17 -0
  27. package/dist/components/Checkbox/index.d.ts +4 -0
  28. package/dist/components/Chip/Chip.d.ts +21 -0
  29. package/dist/components/Chip/chip.tokens.d.ts +4 -0
  30. package/dist/components/Chip/index.d.ts +4 -0
  31. package/dist/components/CodeBlock/CodeBlock.d.ts +41 -0
  32. package/dist/components/CodeBlock/dedentCode.d.ts +12 -0
  33. package/dist/components/CodeBlock/index.d.ts +3 -0
  34. package/dist/components/Dialog/Dialog.d.ts +70 -0
  35. package/dist/components/Dialog/dialog.tokens.d.ts +8 -0
  36. package/dist/components/Dialog/index.d.ts +4 -0
  37. package/dist/components/Drawer/Drawer.d.ts +72 -0
  38. package/dist/components/Drawer/drawer.tokens.d.ts +10 -0
  39. package/dist/components/Drawer/index.d.ts +4 -0
  40. package/dist/components/Dropdown/Dropdown.d.ts +24 -0
  41. package/dist/components/Dropdown/DropdownItem.d.ts +16 -0
  42. package/dist/components/Dropdown/DropdownMenu.d.ts +13 -0
  43. package/dist/components/Dropdown/DropdownSeparator.d.ts +10 -0
  44. package/dist/components/Dropdown/DropdownTrigger.d.ts +8 -0
  45. package/dist/components/Dropdown/dropdown.context.d.ts +24 -0
  46. package/dist/components/Dropdown/index.d.ts +11 -0
  47. package/dist/components/EmptyState/EmptyState.d.ts +47 -0
  48. package/dist/components/EmptyState/index.d.ts +2 -0
  49. package/dist/components/FileDrop/FileDrop.d.ts +41 -0
  50. package/dist/components/FileDrop/index.d.ts +3 -0
  51. package/dist/components/FileDrop/isFileAccepted.d.ts +11 -0
  52. package/dist/components/Input/Input.d.ts +20 -0
  53. package/dist/components/Input/index.d.ts +2 -0
  54. package/dist/components/InputOtp/InputOtp.d.ts +39 -0
  55. package/dist/components/InputOtp/index.d.ts +4 -0
  56. package/dist/components/InputOtp/sanitizeOtpValue.d.ts +20 -0
  57. package/dist/components/MinMaxSlider/MinMaxSlider.d.ts +41 -0
  58. package/dist/components/MinMaxSlider/index.d.ts +2 -0
  59. package/dist/components/Pagination/Pagination.d.ts +41 -0
  60. package/dist/components/Pagination/getPaginationRange.d.ts +25 -0
  61. package/dist/components/Pagination/index.d.ts +4 -0
  62. package/dist/components/ProgressBar/ProgressBar.d.ts +34 -0
  63. package/dist/components/ProgressBar/index.d.ts +4 -0
  64. package/dist/components/ProgressBar/progressBar.tokens.d.ts +2 -0
  65. package/dist/components/Radio/Radio.d.ts +18 -0
  66. package/dist/components/Radio/RadioGroup.d.ts +28 -0
  67. package/dist/components/Radio/index.d.ts +4 -0
  68. package/dist/components/Radio/radio.context.d.ts +17 -0
  69. package/dist/components/RangeSlider/RangeSlider.d.ts +36 -0
  70. package/dist/components/RangeSlider/index.d.ts +2 -0
  71. package/dist/components/SegmentedControl/SegmentedControl.d.ts +39 -0
  72. package/dist/components/SegmentedControl/index.d.ts +2 -0
  73. package/dist/components/Select/Select.d.ts +39 -0
  74. package/dist/components/Select/index.d.ts +2 -0
  75. package/dist/components/Skeleton/Skeleton.d.ts +24 -0
  76. package/dist/components/Skeleton/index.d.ts +4 -0
  77. package/dist/components/Skeleton/skeleton.tokens.d.ts +4 -0
  78. package/dist/components/Spinner/Spinner.d.ts +22 -0
  79. package/dist/components/Spinner/index.d.ts +4 -0
  80. package/dist/components/Spinner/spinner.tokens.d.ts +2 -0
  81. package/dist/components/Stepper/Step.d.ts +20 -0
  82. package/dist/components/Stepper/Stepper.d.ts +25 -0
  83. package/dist/components/Stepper/index.d.ts +5 -0
  84. package/dist/components/Stepper/stepper.context.d.ts +14 -0
  85. package/dist/components/Switch/Switch.d.ts +22 -0
  86. package/dist/components/Switch/SwitchGroup.d.ts +30 -0
  87. package/dist/components/Switch/index.d.ts +4 -0
  88. package/dist/components/Switch/switch.context.d.ts +19 -0
  89. package/dist/components/Tabs/Tab.d.ts +10 -0
  90. package/dist/components/Tabs/TabList.d.ts +20 -0
  91. package/dist/components/Tabs/TabPanel.d.ts +16 -0
  92. package/dist/components/Tabs/Tabs.d.ts +22 -0
  93. package/dist/components/Tabs/index.d.ts +9 -0
  94. package/dist/components/Tabs/tabs.context.d.ts +24 -0
  95. package/dist/components/Tag/Tag.d.ts +10 -0
  96. package/dist/components/Tag/index.d.ts +4 -0
  97. package/dist/components/Tag/tag.tokens.d.ts +2 -0
  98. package/dist/components/Text/Text.d.ts +19 -0
  99. package/dist/components/Text/index.d.ts +4 -0
  100. package/dist/components/Text/text.tokens.d.ts +8 -0
  101. package/dist/components/Textarea/Textarea.d.ts +19 -0
  102. package/dist/components/Textarea/index.d.ts +2 -0
  103. package/dist/components/Tooltip/Tooltip.d.ts +44 -0
  104. package/dist/components/Tooltip/index.d.ts +4 -0
  105. package/dist/components/Tooltip/resolveTooltipPlacement.d.ts +39 -0
  106. package/dist/index.d.ts +82 -0
  107. package/dist/internal/bodyScrollLock.d.ts +2 -0
  108. package/dist/internal/portalInto.d.ts +7 -0
  109. package/dist/internal/useModalSurface.d.ts +27 -0
  110. package/dist/sonahang-ui.cjs +7 -0
  111. package/dist/sonahang-ui.cjs.map +1 -0
  112. package/dist/sonahang-ui.css +2 -0
  113. package/dist/sonahang-ui.js +2578 -0
  114. package/dist/sonahang-ui.js.map +1 -0
  115. package/dist/tokens/colors.d.ts +167 -0
  116. package/package.json +101 -0
  117. package/style.css.d.ts +17 -0
@@ -0,0 +1,2578 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { Children as r, Fragment as i, cloneElement as a, createContext as o, createElement as s, isValidElement as c, useCallback as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useRef as m, useState as h } from "react";
3
+ import { createPortal as g } from "react-dom";
4
+ //#region \0rolldown/runtime.js
5
+ var _ = Object.defineProperty, v = (e, t) => {
6
+ let n = {};
7
+ for (var r in e) _(n, r, {
8
+ get: e[r],
9
+ enumerable: !0
10
+ });
11
+ return t || _(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, y = [
13
+ "display",
14
+ "heading-1",
15
+ "heading-2",
16
+ "heading-3",
17
+ "heading-4",
18
+ "body-lg",
19
+ "body",
20
+ "body-sm",
21
+ "caption"
22
+ ], b = [
23
+ "default",
24
+ "subtle",
25
+ "inverse",
26
+ "accent"
27
+ ], x = [
28
+ "regular",
29
+ "medium",
30
+ "semibold",
31
+ "bold"
32
+ ], S = {
33
+ display: "h1",
34
+ "heading-1": "h1",
35
+ "heading-2": "h2",
36
+ "heading-3": "h3",
37
+ "heading-4": "h4",
38
+ "body-lg": "p",
39
+ body: "p",
40
+ "body-sm": "p",
41
+ caption: "span"
42
+ };
43
+ //#endregion
44
+ //#region src/components/Text/Text.tsx
45
+ function C({ as: e, variant: n = "body", color: r = "default", weight: i, align: a, className: o, style: s, children: c, ...l }) {
46
+ let u = e ?? S[n], d = [
47
+ "sh-text",
48
+ `sh-text--${n}`,
49
+ `sh-text--color-${r}`,
50
+ o
51
+ ].filter(Boolean).join(" ");
52
+ return /* @__PURE__ */ t(u, {
53
+ className: d,
54
+ style: {
55
+ ...i ? { fontWeight: `var(--font-weight-${i})` } : void 0,
56
+ ...a ? { textAlign: a } : void 0,
57
+ ...s
58
+ },
59
+ ...l,
60
+ children: c
61
+ });
62
+ }
63
+ //#endregion
64
+ //#region src/components/Button/buttonClassNames.ts
65
+ function w({ variant: e = "primary", size: t = "md", fullWidth: n = !1, loading: r = !1, className: i } = {}) {
66
+ return [
67
+ "sh-button",
68
+ `sh-button--${e}`,
69
+ `sh-button--${t}`,
70
+ n && "sh-button--full-width",
71
+ r && "sh-button--loading",
72
+ i
73
+ ].filter(Boolean).join(" ");
74
+ }
75
+ //#endregion
76
+ //#region src/components/Button/Button.tsx
77
+ function T({ variant: r = "primary", size: i = "md", fullWidth: a = !1, icon: o, iconPosition: s = "left", loading: c = !1, disabled: l, className: u, children: d, ...f }) {
78
+ let p = r === "icon", m = w({
79
+ variant: r,
80
+ size: i,
81
+ fullWidth: a,
82
+ loading: c,
83
+ className: u
84
+ });
85
+ return /* @__PURE__ */ t("button", {
86
+ className: m,
87
+ disabled: l || c,
88
+ "aria-busy": c || void 0,
89
+ ...f,
90
+ children: /* @__PURE__ */ n("span", {
91
+ className: "sh-button__content",
92
+ children: [c && /* @__PURE__ */ t("span", {
93
+ className: "sh-button__spinner",
94
+ "aria-hidden": "true"
95
+ }), p ? !c && /* @__PURE__ */ t("span", {
96
+ className: "sh-button__icon",
97
+ children: o
98
+ }) : /* @__PURE__ */ n(e, { children: [
99
+ o && s === "left" && !c && /* @__PURE__ */ t("span", {
100
+ className: "sh-button__icon",
101
+ children: o
102
+ }),
103
+ d,
104
+ o && s === "right" && /* @__PURE__ */ t("span", {
105
+ className: "sh-button__icon",
106
+ children: o
107
+ })
108
+ ] })]
109
+ })
110
+ });
111
+ }
112
+ //#endregion
113
+ //#region src/components/Button/button.tokens.ts
114
+ var E = [
115
+ "primary",
116
+ "secondary",
117
+ "outline",
118
+ "ghost",
119
+ "icon"
120
+ ], D = [
121
+ "sm",
122
+ "md",
123
+ "lg"
124
+ ], O = () => /* @__PURE__ */ t("svg", {
125
+ viewBox: "0 0 24 24",
126
+ fill: "none",
127
+ stroke: "currentColor",
128
+ strokeWidth: 1.5,
129
+ "aria-hidden": "true",
130
+ children: /* @__PURE__ */ t("path", {
131
+ d: "M3 13.5h4l1.5 2.5h7l1.5-2.5h4M3 13.5 5.8 6.2A1.5 1.5 0 0 1 7.2 5.2h9.6a1.5 1.5 0 0 1 1.4 1L21 13.5v3.3a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.8Z",
132
+ strokeLinecap: "round",
133
+ strokeLinejoin: "round"
134
+ })
135
+ });
136
+ function k({ title: e, description: r, icon: i, action: a, secondaryAction: o, headingLevel: c = 3, size: l = "md", children: u, className: d, ...f }) {
137
+ let p = i === void 0 ? /* @__PURE__ */ t(O, {}) : i, m = p !== !1 && p !== null, h = (e, r) => {
138
+ let { label: i, href: a, onClick: o, icon: s, variant: c, target: u, rel: d } = e, f = c ?? r;
139
+ return a === void 0 ? /* @__PURE__ */ t(T, {
140
+ variant: f,
141
+ size: l === "sm" ? "sm" : "md",
142
+ icon: s,
143
+ onClick: o,
144
+ children: i
145
+ }) : /* @__PURE__ */ t("a", {
146
+ href: a,
147
+ target: u,
148
+ rel: d ?? (u === "_blank" ? "noopener noreferrer" : void 0),
149
+ onClick: o,
150
+ className: w({
151
+ variant: f,
152
+ size: l === "sm" ? "sm" : "md"
153
+ }),
154
+ children: /* @__PURE__ */ n("span", {
155
+ className: "sh-button__content",
156
+ children: [s && /* @__PURE__ */ t("span", {
157
+ className: "sh-button__icon",
158
+ children: s
159
+ }), i]
160
+ })
161
+ });
162
+ };
163
+ return /* @__PURE__ */ n("div", {
164
+ className: [
165
+ "sh-empty-state",
166
+ `sh-empty-state--${l}`,
167
+ d
168
+ ].filter(Boolean).join(" "),
169
+ ...f,
170
+ children: [
171
+ m && /* @__PURE__ */ t("span", {
172
+ className: "sh-empty-state__icon",
173
+ children: p
174
+ }),
175
+ s(`h${c}`, { className: "sh-empty-state__title" }, e),
176
+ r && /* @__PURE__ */ t("p", {
177
+ className: "sh-empty-state__description",
178
+ children: r
179
+ }),
180
+ (a || o) && /* @__PURE__ */ n("div", {
181
+ className: "sh-empty-state__actions",
182
+ children: [a && h(a, "primary"), o && h(o, "secondary")]
183
+ }),
184
+ u && /* @__PURE__ */ t("div", {
185
+ className: "sh-empty-state__extra",
186
+ children: u
187
+ })
188
+ ]
189
+ });
190
+ }
191
+ //#endregion
192
+ //#region src/components/Tag/Tag.tsx
193
+ function A({ variant: e = "primary", className: n, children: r, ...i }) {
194
+ let a = [
195
+ "sh-tag",
196
+ `sh-tag--${e}`,
197
+ n
198
+ ].filter(Boolean).join(" ");
199
+ return /* @__PURE__ */ t("span", {
200
+ className: a,
201
+ ...i,
202
+ children: r
203
+ });
204
+ }
205
+ //#endregion
206
+ //#region src/components/Tag/tag.tokens.ts
207
+ var j = [
208
+ "primary",
209
+ "secondary",
210
+ "outline"
211
+ ], M = {
212
+ add: /* @__PURE__ */ t("svg", {
213
+ viewBox: "0 0 16 16",
214
+ fill: "none",
215
+ stroke: "currentColor",
216
+ strokeWidth: 1.75,
217
+ "aria-hidden": "true",
218
+ children: /* @__PURE__ */ t("path", {
219
+ d: "M8 3.5v9M3.5 8h9",
220
+ strokeLinecap: "round"
221
+ })
222
+ }),
223
+ remove: /* @__PURE__ */ t("svg", {
224
+ viewBox: "0 0 16 16",
225
+ fill: "none",
226
+ stroke: "currentColor",
227
+ strokeWidth: 1.75,
228
+ "aria-hidden": "true",
229
+ children: /* @__PURE__ */ t("path", {
230
+ d: "M4.5 4.5l7 7M11.5 4.5l-7 7",
231
+ strokeLinecap: "round"
232
+ })
233
+ })
234
+ }, N = {
235
+ add: "Add",
236
+ remove: "Remove"
237
+ };
238
+ function P({ variant: e = "primary", action: r, onAction: i, actionLabel: a, disabled: o = !1, className: s, children: c, ...l }) {
239
+ let u = [
240
+ "sh-chip",
241
+ `sh-chip--${e}`,
242
+ r && "sh-chip--with-action",
243
+ o && "sh-chip--disabled",
244
+ s
245
+ ].filter(Boolean).join(" "), d = a ?? (r ? typeof c == "string" ? `${N[r]} ${c}` : N[r] : void 0);
246
+ return /* @__PURE__ */ n("span", {
247
+ className: u,
248
+ ...l,
249
+ children: [/* @__PURE__ */ t("span", {
250
+ className: "sh-chip__label",
251
+ children: c
252
+ }), r && /* @__PURE__ */ t("button", {
253
+ type: "button",
254
+ className: "sh-chip__action",
255
+ onClick: i,
256
+ disabled: o,
257
+ "aria-label": d,
258
+ children: M[r]
259
+ })]
260
+ });
261
+ }
262
+ //#endregion
263
+ //#region src/components/Chip/chip.tokens.ts
264
+ var F = [
265
+ "primary",
266
+ "secondary",
267
+ "outline"
268
+ ], I = ["add", "remove"], L = o(void 0);
269
+ //#endregion
270
+ //#region src/components/Avatar/getInitials.ts
271
+ function R(e, t = 2) {
272
+ let n = e.trim().split(/\s+/).filter(Boolean);
273
+ return n.length === 0 ? "" : (n.length > t ? [n[0], n[n.length - 1]] : n).slice(0, t).map((e) => e.charAt(0).toUpperCase()).join("");
274
+ }
275
+ //#endregion
276
+ //#region src/components/Avatar/Avatar.tsx
277
+ var z = () => /* @__PURE__ */ t("svg", {
278
+ viewBox: "0 0 24 24",
279
+ fill: "currentColor",
280
+ "aria-hidden": "true",
281
+ className: "sh-avatar__icon",
282
+ children: /* @__PURE__ */ t("path", { d: "M12 12a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Zm0 1.8c-3.6 0-7.2 1.8-7.2 4.05V21h14.4v-3.15c0-2.25-3.6-4.05-7.2-4.05Z" })
283
+ });
284
+ function B({ src: e, name: n, alt: r, size: i, className: a, children: o, ...s }) {
285
+ let [c, l] = h(void 0), d = u(L), f = i ?? d ?? "md", p = !!e && c !== e, m = n ? R(n) : "", g = r ?? n, _ = [
286
+ "sh-avatar",
287
+ `sh-avatar--${f}`,
288
+ a
289
+ ].filter(Boolean).join(" ");
290
+ return /* @__PURE__ */ t("span", {
291
+ className: _,
292
+ ...!p && g ? {
293
+ role: "img",
294
+ "aria-label": g
295
+ } : void 0,
296
+ ...s,
297
+ children: p ? /* @__PURE__ */ t("img", {
298
+ className: "sh-avatar__image",
299
+ src: e,
300
+ alt: g ?? "",
301
+ onError: () => l(e)
302
+ }) : o ?? /* @__PURE__ */ t("span", {
303
+ className: "sh-avatar__fallback",
304
+ "aria-hidden": "true",
305
+ children: m || /* @__PURE__ */ t(z, {})
306
+ })
307
+ });
308
+ }
309
+ //#endregion
310
+ //#region src/components/Avatar/AvatarGroup.tsx
311
+ function ee({ max: e, size: i = "md", className: a, children: o, ...s }) {
312
+ let l = r.toArray(o).filter(c), u = typeof e == "number" && e >= 0 ? e : l.length, d = l.slice(0, u), f = l.length - d.length, p = ["sh-avatar-group", a].filter(Boolean).join(" ");
313
+ return /* @__PURE__ */ t(L.Provider, {
314
+ value: i,
315
+ children: /* @__PURE__ */ n("div", {
316
+ className: p,
317
+ ...s,
318
+ children: [d, f > 0 && /* @__PURE__ */ t("span", {
319
+ className: `sh-avatar sh-avatar--${i} sh-avatar--overflow`,
320
+ role: "img",
321
+ "aria-label": `${f} more`,
322
+ children: /* @__PURE__ */ n("span", {
323
+ className: "sh-avatar__fallback",
324
+ "aria-hidden": "true",
325
+ children: ["+", f]
326
+ })
327
+ })]
328
+ })
329
+ });
330
+ }
331
+ //#endregion
332
+ //#region src/components/Avatar/avatar.tokens.ts
333
+ var V = [
334
+ "sm",
335
+ "md",
336
+ "lg"
337
+ ];
338
+ //#endregion
339
+ //#region src/components/Input/Input.tsx
340
+ function te({ label: e, helperText: r, error: i, icon: a, iconPosition: o = "left", className: s, inputClassName: c, id: l, required: u, disabled: d, "aria-describedby": p, ...m }) {
341
+ let h = f(), g = l ?? h, _ = `${g}-message`, v = !!i, y = i ?? r, b = [p, y ? _ : void 0].filter(Boolean).join(" ") || void 0, x = [
342
+ "sh-input",
343
+ v && "sh-input--invalid",
344
+ d && "sh-input--disabled",
345
+ a && `sh-input--with-icon-${o}`,
346
+ s
347
+ ].filter(Boolean).join(" ");
348
+ return /* @__PURE__ */ n("div", {
349
+ className: x,
350
+ children: [
351
+ e && /* @__PURE__ */ n("label", {
352
+ className: "sh-input__label",
353
+ htmlFor: g,
354
+ children: [e, u && /* @__PURE__ */ t("span", {
355
+ className: "sh-input__required",
356
+ "aria-hidden": "true",
357
+ children: "*"
358
+ })]
359
+ }),
360
+ /* @__PURE__ */ n("span", {
361
+ className: "sh-input__field",
362
+ children: [a && /* @__PURE__ */ t("span", {
363
+ className: "sh-input__icon",
364
+ "aria-hidden": "true",
365
+ children: a
366
+ }), /* @__PURE__ */ t("input", {
367
+ id: g,
368
+ className: ["sh-input__control", c].filter(Boolean).join(" "),
369
+ required: u,
370
+ disabled: d,
371
+ "aria-invalid": v || void 0,
372
+ "aria-describedby": b,
373
+ ...m
374
+ })]
375
+ }),
376
+ y && /* @__PURE__ */ t("span", {
377
+ id: _,
378
+ className: "sh-input__message",
379
+ children: y
380
+ })
381
+ ]
382
+ });
383
+ }
384
+ //#endregion
385
+ //#region src/components/InputOtp/sanitizeOtpValue.ts
386
+ var H = ["numeric", "alphanumeric"], ne = {
387
+ numeric: /[0-9]/,
388
+ alphanumeric: /[a-zA-Z0-9]/
389
+ };
390
+ function U(e, { length: t, type: n = "numeric" }) {
391
+ let r = ne[n], i = "";
392
+ for (let n of e) {
393
+ if (i.length >= t) break;
394
+ r.test(n) && (i += n);
395
+ }
396
+ return i;
397
+ }
398
+ //#endregion
399
+ //#region src/components/InputOtp/InputOtp.tsx
400
+ function re({ length: e = 6, value: r, defaultValue: a = "", onChange: o, onComplete: s, type: c = "numeric", mask: l = !1, groupSize: u, label: d, helperText: p, error: g, className: _, id: v, required: y, disabled: b, "aria-describedby": x, onFocus: S, onBlur: C, onSelect: w, onClick: T, ...E }) {
401
+ let D = f(), O = v ?? D, k = `${O}-message`, A = m(null), [j, M] = h(!1), [N, P] = h(0), [F, I] = h(() => U(a, {
402
+ length: e,
403
+ type: c
404
+ })), L = r !== void 0, R = L ? U(r, {
405
+ length: e,
406
+ type: c
407
+ }) : F, z = !!g, B = g ?? p, ee = [x, B ? k : void 0].filter(Boolean).join(" ") || void 0, V = () => {
408
+ let e = A.current;
409
+ if (!e) return;
410
+ let t = e.value.length;
411
+ e.setSelectionRange(t, t), P(t);
412
+ }, te = Array.from({ length: e }, (e, t) => R[t] ?? ""), H = j && !b ? Math.min(N, e - 1) : -1;
413
+ return /* @__PURE__ */ n("div", {
414
+ className: [
415
+ "sh-input-otp",
416
+ z && "sh-input-otp--invalid",
417
+ b && "sh-input-otp--disabled",
418
+ _
419
+ ].filter(Boolean).join(" "),
420
+ children: [
421
+ d && /* @__PURE__ */ n("label", {
422
+ className: "sh-input-otp__label",
423
+ htmlFor: O,
424
+ children: [d, y && /* @__PURE__ */ t("span", {
425
+ className: "sh-input-otp__required",
426
+ "aria-hidden": "true",
427
+ children: "*"
428
+ })]
429
+ }),
430
+ /* @__PURE__ */ n("div", {
431
+ className: "sh-input-otp__field",
432
+ children: [/* @__PURE__ */ t("input", {
433
+ ref: A,
434
+ id: O,
435
+ className: "sh-input-otp__control",
436
+ value: R,
437
+ required: y,
438
+ disabled: b,
439
+ inputMode: c === "numeric" ? "numeric" : "text",
440
+ autoComplete: "one-time-code",
441
+ autoCorrect: "off",
442
+ autoCapitalize: "off",
443
+ spellCheck: !1,
444
+ "aria-invalid": z || void 0,
445
+ "aria-describedby": ee,
446
+ onChange: (t) => {
447
+ let n = U(t.target.value, {
448
+ length: e,
449
+ type: c
450
+ });
451
+ n !== R && (L || I(n), o?.(n), n.length === e && s?.(n));
452
+ },
453
+ onFocus: (e) => {
454
+ S?.(e), M(!0), V();
455
+ },
456
+ onBlur: (e) => {
457
+ C?.(e), M(!1);
458
+ },
459
+ onClick: (e) => {
460
+ T?.(e), V();
461
+ },
462
+ onSelect: (e) => {
463
+ w?.(e), P(e.currentTarget.selectionStart ?? R.length);
464
+ },
465
+ ...E
466
+ }), /* @__PURE__ */ t("div", {
467
+ className: "sh-input-otp__boxes",
468
+ "aria-hidden": "true",
469
+ children: te.map((e, r) => /* @__PURE__ */ n(i, { children: [u !== void 0 && r > 0 && r % u === 0 && /* @__PURE__ */ t("span", { className: "sh-input-otp__separator" }), /* @__PURE__ */ t("span", {
470
+ className: [
471
+ "sh-input-otp__slot",
472
+ e && "sh-input-otp__slot--filled",
473
+ r === H && "sh-input-otp__slot--active"
474
+ ].filter(Boolean).join(" "),
475
+ children: e && l ? "•" : e
476
+ })] }, r))
477
+ })]
478
+ }),
479
+ B && /* @__PURE__ */ t("span", {
480
+ id: k,
481
+ className: "sh-input-otp__message",
482
+ children: B
483
+ })
484
+ ]
485
+ });
486
+ }
487
+ //#endregion
488
+ //#region src/components/Dropdown/dropdown.context.ts
489
+ var ie = o(void 0);
490
+ function W(e) {
491
+ let t = u(ie);
492
+ if (!t) throw Error(`<${e}> must be rendered inside <Dropdown>.`);
493
+ return t;
494
+ }
495
+ //#endregion
496
+ //#region src/components/Dropdown/Dropdown.tsx
497
+ function ae({ children: e, open: n, defaultOpen: r = !1, onOpenChange: i, placement: a = "bottom", align: o = "start", className: s, ...c }) {
498
+ let u = f(), p = m(null), g = m(null), [_, v] = h(r), y = n !== void 0, b = y ? n : _, [x, S] = h(null), C = l((e = null) => {
499
+ S(e), y || v(!0), i?.(!0);
500
+ }, [y, i]), w = l(({ restoreFocus: e = !0 } = {}) => {
501
+ S(null), y || v(!1), i?.(!1), e && p.current?.focus();
502
+ }, [y, i]);
503
+ return d(() => {
504
+ if (!b) return;
505
+ let e = (e) => {
506
+ g.current?.contains(e.target) || w({ restoreFocus: !1 });
507
+ };
508
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
509
+ }, [b, w]), d(() => {
510
+ if (!b) return;
511
+ let e = (e) => {
512
+ e.key === "Escape" && (e.preventDefault(), w());
513
+ };
514
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
515
+ }, [b, w]), /* @__PURE__ */ t(ie.Provider, {
516
+ value: {
517
+ isOpen: b,
518
+ open: C,
519
+ close: w,
520
+ focusOnOpen: x,
521
+ triggerId: `${u}-trigger`,
522
+ menuId: `${u}-menu`,
523
+ triggerRef: p,
524
+ placement: a,
525
+ align: o
526
+ },
527
+ children: /* @__PURE__ */ t("div", {
528
+ ref: g,
529
+ className: ["sh-dropdown", s].filter(Boolean).join(" "),
530
+ ...c,
531
+ children: e
532
+ })
533
+ });
534
+ }
535
+ //#endregion
536
+ //#region src/components/Dropdown/DropdownTrigger.tsx
537
+ function oe({ children: e, className: n, onClick: r, onKeyDown: i, ...a }) {
538
+ let { isOpen: o, open: s, close: c, triggerId: l, menuId: u, triggerRef: d } = W("DropdownTrigger");
539
+ return /* @__PURE__ */ t("button", {
540
+ ref: d,
541
+ type: "button",
542
+ id: l,
543
+ className: ["sh-dropdown__trigger", n].filter(Boolean).join(" "),
544
+ "aria-haspopup": "menu",
545
+ "aria-expanded": o,
546
+ "aria-controls": o ? u : void 0,
547
+ onClick: (e) => {
548
+ r?.(e), !e.defaultPrevented && (o ? c({ restoreFocus: !1 }) : s("first"));
549
+ },
550
+ onKeyDown: (e) => {
551
+ i?.(e), !(e.defaultPrevented || o) && (e.key === "ArrowDown" ? (e.preventDefault(), s("first")) : e.key === "ArrowUp" && (e.preventDefault(), s("last")));
552
+ },
553
+ ...a,
554
+ children: e
555
+ });
556
+ }
557
+ //#endregion
558
+ //#region src/components/Dropdown/DropdownMenu.tsx
559
+ function se({ children: e, className: n, onKeyDown: r, ...i }) {
560
+ let { isOpen: a, close: o, focusOnOpen: s, triggerId: c, menuId: l, placement: u, align: f } = W("DropdownMenu"), p = m(null), h = () => Array.from(p.current?.querySelectorAll("[role=\"menuitem\"]:not([disabled])") ?? []);
561
+ return d(() => {
562
+ if (!a || !s) return;
563
+ let e = h();
564
+ (s === "last" ? e[e.length - 1] : e[0])?.focus();
565
+ }, [a, s]), a ? /* @__PURE__ */ t("div", {
566
+ ref: p,
567
+ id: l,
568
+ className: [
569
+ "sh-dropdown__menu",
570
+ `sh-dropdown__menu--${u}`,
571
+ `sh-dropdown__menu--${f}`,
572
+ n
573
+ ].filter(Boolean).join(" "),
574
+ role: "menu",
575
+ "aria-labelledby": c,
576
+ onKeyDown: (e) => {
577
+ if (r?.(e), e.defaultPrevented) return;
578
+ if (e.key === "Tab") {
579
+ o({ restoreFocus: !1 });
580
+ return;
581
+ }
582
+ if (![
583
+ "ArrowDown",
584
+ "ArrowUp",
585
+ "Home",
586
+ "End"
587
+ ].includes(e.key)) return;
588
+ let t = h();
589
+ if (t.length === 0) return;
590
+ let n = t.indexOf(document.activeElement), i;
591
+ i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : n === -1 ? 0 : e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length, e.preventDefault(), t[i]?.focus();
592
+ },
593
+ ...i,
594
+ children: e
595
+ }) : null;
596
+ }
597
+ //#endregion
598
+ //#region src/components/Dropdown/DropdownItem.tsx
599
+ function ce({ children: e, onSelect: r, closeOnSelect: i = !0, icon: a, destructive: o = !1, className: s, onClick: c, ...l }) {
600
+ let { close: u } = W("DropdownItem");
601
+ return /* @__PURE__ */ n("button", {
602
+ type: "button",
603
+ role: "menuitem",
604
+ className: [
605
+ "sh-dropdown__item",
606
+ o && "sh-dropdown__item--destructive",
607
+ s
608
+ ].filter(Boolean).join(" "),
609
+ tabIndex: -1,
610
+ onClick: (e) => {
611
+ c?.(e), !e.defaultPrevented && (r?.(), i && u());
612
+ },
613
+ ...l,
614
+ children: [a && /* @__PURE__ */ t("span", {
615
+ className: "sh-dropdown__item-icon",
616
+ "aria-hidden": "true",
617
+ children: a
618
+ }), /* @__PURE__ */ t("span", {
619
+ className: "sh-dropdown__item-label",
620
+ children: e
621
+ })]
622
+ });
623
+ }
624
+ //#endregion
625
+ //#region src/components/Dropdown/DropdownSeparator.tsx
626
+ function le({ className: e, ...n }) {
627
+ return /* @__PURE__ */ t("div", {
628
+ className: ["sh-dropdown__separator", e].filter(Boolean).join(" "),
629
+ role: "separator",
630
+ ...n
631
+ });
632
+ }
633
+ //#endregion
634
+ //#region src/components/CodeBlock/dedentCode.ts
635
+ function ue(e) {
636
+ let t = e.replace(/\r\n/g, "\n").split("\n");
637
+ for (; t.length > 0 && t[0].trim() === "";) t.shift();
638
+ for (; t.length > 0 && t[t.length - 1].trim() === "";) t.pop();
639
+ if (t.length === 0) return "";
640
+ let n = t.filter((e) => e.trim() !== "").map((e) => e.length - e.trimStart().length), r = Math.min(...n);
641
+ return t.map((e) => e.slice(r)).join("\n");
642
+ }
643
+ //#endregion
644
+ //#region src/components/CodeBlock/CodeBlock.tsx
645
+ var de = () => /* @__PURE__ */ n("svg", {
646
+ viewBox: "0 0 16 16",
647
+ fill: "none",
648
+ stroke: "currentColor",
649
+ strokeWidth: 1.5,
650
+ "aria-hidden": "true",
651
+ children: [/* @__PURE__ */ t("rect", {
652
+ x: "5.75",
653
+ y: "5.75",
654
+ width: "8",
655
+ height: "8",
656
+ rx: "1.5"
657
+ }), /* @__PURE__ */ t("path", { d: "M10.5 3.5A1.5 1.5 0 0 0 9 2H3.5A1.5 1.5 0 0 0 2 3.5V9a1.5 1.5 0 0 0 1.5 1.5" })]
658
+ }), fe = () => /* @__PURE__ */ t("svg", {
659
+ viewBox: "0 0 16 16",
660
+ fill: "none",
661
+ stroke: "currentColor",
662
+ strokeWidth: 1.75,
663
+ "aria-hidden": "true",
664
+ children: /* @__PURE__ */ t("path", {
665
+ d: "M3.5 8.5l3 3 6-6.5",
666
+ strokeLinecap: "round",
667
+ strokeLinejoin: "round"
668
+ })
669
+ }), pe = 2e3;
670
+ function me({ children: e, filename: r, language: i, showLineNumbers: a = !1, wrap: o = !1, copyable: s = !0, copyLabel: c = "Copy code", maxHeight: l, className: u, ...p }) {
671
+ let g = ue(e), _ = f(), [v, y] = h("idle"), b = m(void 0);
672
+ d(() => () => window.clearTimeout(b.current), []);
673
+ let x = async () => {
674
+ window.clearTimeout(b.current);
675
+ try {
676
+ await navigator.clipboard.writeText(g), y("copied");
677
+ } catch {
678
+ y("error");
679
+ }
680
+ b.current = window.setTimeout(() => y("idle"), pe);
681
+ }, S = r ?? i, C = S !== void 0 || s;
682
+ return /* @__PURE__ */ n("div", {
683
+ className: [
684
+ "sh-code-block",
685
+ o && "sh-code-block--wrap",
686
+ a && "sh-code-block--numbered",
687
+ u
688
+ ].filter(Boolean).join(" "),
689
+ ...p,
690
+ children: [
691
+ C && /* @__PURE__ */ n("div", {
692
+ className: "sh-code-block__header",
693
+ children: [S !== void 0 && /* @__PURE__ */ t("span", {
694
+ id: _,
695
+ className: "sh-code-block__filename",
696
+ children: S
697
+ }), s && /* @__PURE__ */ t("button", {
698
+ type: "button",
699
+ className: "sh-code-block__copy",
700
+ "aria-label": c,
701
+ onClick: x,
702
+ children: t(v === "copied" ? fe : de, {})
703
+ })]
704
+ }),
705
+ /* @__PURE__ */ t("pre", {
706
+ className: "sh-code-block__pre",
707
+ tabIndex: 0,
708
+ role: S === void 0 ? void 0 : "group",
709
+ "aria-labelledby": S === void 0 ? void 0 : _,
710
+ style: l === void 0 ? void 0 : { maxHeight: l },
711
+ children: /* @__PURE__ */ t("code", {
712
+ className: ["sh-code-block__code", i && `language-${i}`].filter(Boolean).join(" "),
713
+ children: a ? g.split("\n").map((e, t, r) => /* @__PURE__ */ n("span", {
714
+ className: "sh-code-block__line",
715
+ children: [e, t < r.length - 1 ? "\n" : ""]
716
+ }, t)) : g
717
+ })
718
+ }),
719
+ s && /* @__PURE__ */ t("span", {
720
+ role: "status",
721
+ "aria-live": "polite",
722
+ className: "sh-code-block__status",
723
+ children: v === "copied" ? "Copied" : v === "error" ? "Copy failed" : ""
724
+ })
725
+ ]
726
+ });
727
+ }
728
+ //#endregion
729
+ //#region src/internal/portalInto.ts
730
+ function he(e, t) {
731
+ if (!t) return e;
732
+ let n = t === !0 ? typeof document > "u" ? null : document.body : t;
733
+ return n ? g(e, n) : null;
734
+ }
735
+ //#endregion
736
+ //#region src/internal/bodyScrollLock.ts
737
+ var G = 0, K = null;
738
+ function ge() {
739
+ if (G === 0) {
740
+ let { body: e } = document, t = e.style.overflow, n = e.style.paddingRight, r = window.innerWidth - document.documentElement.clientWidth;
741
+ if (e.style.overflow = "hidden", r > 0) {
742
+ let t = Number.parseFloat(window.getComputedStyle(e).paddingRight) || 0;
743
+ e.style.paddingRight = `${t + r}px`;
744
+ }
745
+ K = () => {
746
+ e.style.overflow = t, e.style.paddingRight = n;
747
+ };
748
+ }
749
+ G += 1;
750
+ let e = !1;
751
+ return () => {
752
+ e || (e = !0, --G, G === 0 && (K?.(), K = null));
753
+ };
754
+ }
755
+ //#endregion
756
+ //#region src/internal/useModalSurface.ts
757
+ function _e({ open: e, onClose: t, closeOnEscape: n, closeOnBackdropClick: r, initialFocus: i, lockScroll: a }) {
758
+ let o = m(null), s = m(null), c = f();
759
+ return d(() => {
760
+ let t = o.current;
761
+ if (t) {
762
+ if (!e) {
763
+ t.open && t.close();
764
+ return;
765
+ }
766
+ return t.open || t.showModal(), i?.current?.focus(), a ? ge() : void 0;
767
+ }
768
+ }, [e, a]), d(() => {
769
+ let e = o.current;
770
+ if (!e) return;
771
+ let r = (e) => {
772
+ e.preventDefault(), n && t();
773
+ };
774
+ return e.addEventListener("cancel", r), () => e.removeEventListener("cancel", r);
775
+ }, [n, t]), {
776
+ titleId: `${c}-title`,
777
+ descriptionId: `${c}-description`,
778
+ surfaceProps: {
779
+ ref: o,
780
+ onMouseDown: (e) => {
781
+ s.current = e.target;
782
+ },
783
+ onClick: (e) => {
784
+ r && s.current === e.currentTarget && e.target === e.currentTarget && t();
785
+ }
786
+ }
787
+ };
788
+ }
789
+ //#endregion
790
+ //#region src/components/Dialog/Dialog.tsx
791
+ var ve = () => /* @__PURE__ */ t("svg", {
792
+ viewBox: "0 0 16 16",
793
+ fill: "none",
794
+ stroke: "currentColor",
795
+ strokeWidth: 1.75,
796
+ "aria-hidden": "true",
797
+ children: /* @__PURE__ */ t("path", {
798
+ d: "M4.5 4.5l7 7M11.5 4.5l-7 7",
799
+ strokeLinecap: "round"
800
+ })
801
+ });
802
+ function ye({ open: e, onClose: r, title: i, description: a, children: o, footer: s, size: c = "md", role: l = "dialog", closeOnEscape: u = !0, closeOnBackdropClick: d = !0, showClose: f = !0, closeLabel: p = "Close", initialFocus: m, lockScroll: h = !0, portal: g = !1, className: _, ...v }) {
803
+ let { titleId: y, descriptionId: b, surfaceProps: x } = _e({
804
+ open: e,
805
+ onClose: r,
806
+ closeOnEscape: u,
807
+ closeOnBackdropClick: d,
808
+ initialFocus: m,
809
+ lockScroll: h
810
+ });
811
+ return he(/* @__PURE__ */ n("dialog", {
812
+ role: l,
813
+ "aria-labelledby": y,
814
+ "aria-describedby": a ? b : void 0,
815
+ className: [
816
+ "sh-dialog",
817
+ `sh-dialog--${c}`,
818
+ _
819
+ ].filter(Boolean).join(" "),
820
+ ...x,
821
+ ...v,
822
+ children: [
823
+ /* @__PURE__ */ n("div", {
824
+ className: "sh-dialog__header",
825
+ children: [/* @__PURE__ */ n("div", {
826
+ className: "sh-dialog__heading",
827
+ children: [/* @__PURE__ */ t("h2", {
828
+ id: y,
829
+ className: "sh-dialog__title",
830
+ children: i
831
+ }), a && /* @__PURE__ */ t("p", {
832
+ id: b,
833
+ className: "sh-dialog__description",
834
+ children: a
835
+ })]
836
+ }), f && /* @__PURE__ */ t("button", {
837
+ type: "button",
838
+ className: "sh-dialog__close",
839
+ "aria-label": p,
840
+ onClick: r,
841
+ children: /* @__PURE__ */ t(ve, {})
842
+ })]
843
+ }),
844
+ o != null && o !== !1 && /* @__PURE__ */ t("div", {
845
+ className: "sh-dialog__body",
846
+ children: o
847
+ }),
848
+ s && /* @__PURE__ */ t("div", {
849
+ className: "sh-dialog__footer",
850
+ children: s
851
+ })
852
+ ]
853
+ }), g);
854
+ }
855
+ //#endregion
856
+ //#region src/components/Dialog/dialog.tokens.ts
857
+ var be = [
858
+ "sm",
859
+ "md",
860
+ "lg",
861
+ "fullscreen"
862
+ ], xe = ["dialog", "alertdialog"], Se = () => /* @__PURE__ */ t("svg", {
863
+ viewBox: "0 0 16 16",
864
+ fill: "none",
865
+ stroke: "currentColor",
866
+ strokeWidth: 1.75,
867
+ "aria-hidden": "true",
868
+ children: /* @__PURE__ */ t("path", {
869
+ d: "M4.5 4.5l7 7M11.5 4.5l-7 7",
870
+ strokeLinecap: "round"
871
+ })
872
+ });
873
+ function Ce({ open: e, onClose: r, title: i, description: a, children: o, footer: s, side: c = "right", size: l = "md", closeOnEscape: u = !0, closeOnBackdropClick: d = !0, showClose: f = !0, closeLabel: p = "Close", initialFocus: m, lockScroll: h = !0, portal: g = !1, className: _, ...v }) {
874
+ let { titleId: y, descriptionId: b, surfaceProps: x } = _e({
875
+ open: e,
876
+ onClose: r,
877
+ closeOnEscape: u,
878
+ closeOnBackdropClick: d,
879
+ initialFocus: m,
880
+ lockScroll: h
881
+ });
882
+ return he(/* @__PURE__ */ n("dialog", {
883
+ "aria-labelledby": y,
884
+ "aria-describedby": a ? b : void 0,
885
+ className: [
886
+ "sh-drawer",
887
+ `sh-drawer--${c}`,
888
+ `sh-drawer--${l}`,
889
+ _
890
+ ].filter(Boolean).join(" "),
891
+ ...x,
892
+ ...v,
893
+ children: [
894
+ /* @__PURE__ */ n("div", {
895
+ className: "sh-drawer__header",
896
+ children: [/* @__PURE__ */ n("div", {
897
+ className: "sh-drawer__heading",
898
+ children: [/* @__PURE__ */ t("h2", {
899
+ id: y,
900
+ className: "sh-drawer__title",
901
+ children: i
902
+ }), a && /* @__PURE__ */ t("p", {
903
+ id: b,
904
+ className: "sh-drawer__description",
905
+ children: a
906
+ })]
907
+ }), f && /* @__PURE__ */ t("button", {
908
+ type: "button",
909
+ className: "sh-drawer__close",
910
+ "aria-label": p,
911
+ onClick: r,
912
+ children: /* @__PURE__ */ t(Se, {})
913
+ })]
914
+ }),
915
+ o != null && o !== !1 && /* @__PURE__ */ t("div", {
916
+ className: "sh-drawer__body",
917
+ children: o
918
+ }),
919
+ s && /* @__PURE__ */ t("div", {
920
+ className: "sh-drawer__footer",
921
+ children: s
922
+ })
923
+ ]
924
+ }), g);
925
+ }
926
+ //#endregion
927
+ //#region src/components/Drawer/drawer.tokens.ts
928
+ var we = [
929
+ "left",
930
+ "right",
931
+ "top",
932
+ "bottom"
933
+ ], Te = [
934
+ "sm",
935
+ "md",
936
+ "lg",
937
+ "full"
938
+ ], Ee = [
939
+ "top",
940
+ "bottom",
941
+ "right",
942
+ "left"
943
+ ];
944
+ function De({ trigger: e, tip: t, viewport: n, gap: r = 8 }) {
945
+ let i = {
946
+ top: e.top,
947
+ bottom: n.height - e.bottom,
948
+ left: e.left,
949
+ right: n.width - e.right
950
+ }, a = {
951
+ top: t.height + r,
952
+ bottom: t.height + r,
953
+ left: t.width + r,
954
+ right: t.width + r
955
+ };
956
+ return Ee.find((e) => i[e] >= a[e]) || Ee.reduce((e, t) => i[t] - a[t] > i[e] - a[e] ? t : e);
957
+ }
958
+ //#endregion
959
+ //#region src/components/Tooltip/Tooltip.tsx
960
+ var Oe = typeof window > "u" ? d : p;
961
+ function ke({ children: e, content: r, placement: i = "top", delay: o = 150, open: s, defaultOpen: u = !1, onOpenChange: p, disabled: g = !1, className: _, ...v }) {
962
+ let y = f(), b = m(void 0), x = m(null), S = m(null), C = m(!1), [w, T] = h(u), E = s !== void 0, D = E ? s : w, O = !g && r != null && r !== "", k = () => {
963
+ b.current !== void 0 && (window.clearTimeout(b.current), b.current = void 0);
964
+ }, A = l((e) => {
965
+ E || T(e), p?.(e);
966
+ }, [E, p]), j = () => {
967
+ !O || D || C.current || (k(), o > 0 ? b.current = window.setTimeout(() => A(!0), o) : A(!0));
968
+ }, M = () => {
969
+ k(), D && A(!1);
970
+ };
971
+ d(() => k, []);
972
+ let [N, P] = h("top"), F = i === "auto", I = F ? N : i;
973
+ if (Oe(() => {
974
+ if (!F || !D || !O) return;
975
+ let e = () => {
976
+ let e = x.current, t = S.current;
977
+ !e || !t || P(De({
978
+ trigger: e.getBoundingClientRect(),
979
+ tip: {
980
+ width: t.offsetWidth,
981
+ height: t.offsetHeight
982
+ },
983
+ viewport: {
984
+ width: window.innerWidth,
985
+ height: window.innerHeight
986
+ }
987
+ }));
988
+ };
989
+ return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
990
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
991
+ };
992
+ }, [
993
+ F,
994
+ D,
995
+ O
996
+ ]), d(() => {
997
+ if (!D || !O) return;
998
+ let e = (e) => {
999
+ e.key === "Escape" && A(!1);
1000
+ };
1001
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1002
+ }, [
1003
+ D,
1004
+ O,
1005
+ A
1006
+ ]), !c(e)) throw Error("<Tooltip> expects a single element child to describe.");
1007
+ let L = O ? a(e, { "aria-describedby": [e.props["aria-describedby"], y].filter(Boolean).join(" ") }) : e;
1008
+ return /* @__PURE__ */ n("span", {
1009
+ ref: x,
1010
+ className: ["sh-tooltip", _].filter(Boolean).join(" "),
1011
+ onMouseEnter: j,
1012
+ onMouseLeave: () => {
1013
+ C.current = !1, M();
1014
+ },
1015
+ onFocus: j,
1016
+ onBlur: () => {
1017
+ C.current = !1, M();
1018
+ },
1019
+ onMouseDown: () => {
1020
+ C.current = !0, M();
1021
+ },
1022
+ ...v,
1023
+ children: [L, O && /* @__PURE__ */ t("span", {
1024
+ ref: S,
1025
+ id: y,
1026
+ role: "tooltip",
1027
+ className: [
1028
+ "sh-tooltip__tip",
1029
+ `sh-tooltip__tip--${I}`,
1030
+ D && "sh-tooltip__tip--open"
1031
+ ].filter(Boolean).join(" "),
1032
+ children: r
1033
+ })]
1034
+ });
1035
+ }
1036
+ //#endregion
1037
+ //#region src/components/Select/Select.tsx
1038
+ var Ae = () => /* @__PURE__ */ t("svg", {
1039
+ viewBox: "0 0 16 16",
1040
+ fill: "none",
1041
+ stroke: "currentColor",
1042
+ strokeWidth: 1.5,
1043
+ "aria-hidden": "true",
1044
+ children: /* @__PURE__ */ t("path", {
1045
+ d: "M4 6.5 8 10.5l4-4",
1046
+ strokeLinecap: "round",
1047
+ strokeLinejoin: "round"
1048
+ })
1049
+ }), je = (e) => "options" in e;
1050
+ function Me({ label: e, helperText: r, error: i, options: a, placeholder: o, icon: s, className: c, selectClassName: l, children: u, id: d, required: p, disabled: m, multiple: h, "aria-describedby": g, ..._ }) {
1051
+ let v = f(), y = d ?? v, b = `${y}-message`, x = !!i, S = i ?? r, C = [g, S ? b : void 0].filter(Boolean).join(" ") || void 0, w = [
1052
+ "sh-select",
1053
+ x && "sh-select--invalid",
1054
+ m && "sh-select--disabled",
1055
+ s && "sh-select--with-icon",
1056
+ h && "sh-select--multiple",
1057
+ c
1058
+ ].filter(Boolean).join(" "), T = (e) => /* @__PURE__ */ t("option", {
1059
+ value: e.value,
1060
+ disabled: e.disabled,
1061
+ children: e.label
1062
+ }, e.value);
1063
+ return /* @__PURE__ */ n("div", {
1064
+ className: w,
1065
+ children: [
1066
+ e && /* @__PURE__ */ n("label", {
1067
+ className: "sh-select__label",
1068
+ htmlFor: y,
1069
+ children: [e, p && /* @__PURE__ */ t("span", {
1070
+ className: "sh-select__required",
1071
+ "aria-hidden": "true",
1072
+ children: "*"
1073
+ })]
1074
+ }),
1075
+ /* @__PURE__ */ n("span", {
1076
+ className: "sh-select__field",
1077
+ children: [
1078
+ s && /* @__PURE__ */ t("span", {
1079
+ className: "sh-select__icon",
1080
+ "aria-hidden": "true",
1081
+ children: s
1082
+ }),
1083
+ /* @__PURE__ */ n("select", {
1084
+ ..._,
1085
+ id: y,
1086
+ className: ["sh-select__control", l].filter(Boolean).join(" "),
1087
+ required: p,
1088
+ disabled: m,
1089
+ multiple: h,
1090
+ "aria-invalid": x || void 0,
1091
+ "aria-describedby": C,
1092
+ children: [o && /* @__PURE__ */ t("option", {
1093
+ value: "",
1094
+ disabled: !0,
1095
+ children: o
1096
+ }), a ? a.map((e) => je(e) ? /* @__PURE__ */ t("optgroup", {
1097
+ label: e.label,
1098
+ children: e.options.map(T)
1099
+ }, e.label) : T(e)) : u]
1100
+ }),
1101
+ !h && /* @__PURE__ */ t("span", {
1102
+ className: "sh-select__chevron",
1103
+ "aria-hidden": "true",
1104
+ children: /* @__PURE__ */ t(Ae, {})
1105
+ })
1106
+ ]
1107
+ }),
1108
+ S && /* @__PURE__ */ t("span", {
1109
+ id: b,
1110
+ className: "sh-select__message",
1111
+ children: S
1112
+ })
1113
+ ]
1114
+ });
1115
+ }
1116
+ //#endregion
1117
+ //#region src/components/Textarea/Textarea.tsx
1118
+ function Ne({ label: e, helperText: r, error: i, resize: a = "vertical", className: o, textareaClassName: s, id: c, rows: l = 3, required: u, disabled: d, "aria-describedby": p, ...m }) {
1119
+ let h = f(), g = c ?? h, _ = `${g}-message`, v = !!i, y = i ?? r, b = [p, y ? _ : void 0].filter(Boolean).join(" ") || void 0, x = [
1120
+ "sh-textarea",
1121
+ v && "sh-textarea--invalid",
1122
+ d && "sh-textarea--disabled",
1123
+ o
1124
+ ].filter(Boolean).join(" ");
1125
+ return /* @__PURE__ */ n("div", {
1126
+ className: x,
1127
+ children: [
1128
+ e && /* @__PURE__ */ n("label", {
1129
+ className: "sh-textarea__label",
1130
+ htmlFor: g,
1131
+ children: [e, u && /* @__PURE__ */ t("span", {
1132
+ className: "sh-textarea__required",
1133
+ "aria-hidden": "true",
1134
+ children: "*"
1135
+ })]
1136
+ }),
1137
+ /* @__PURE__ */ t("textarea", {
1138
+ id: g,
1139
+ className: [
1140
+ "sh-textarea__control",
1141
+ `sh-textarea__control--resize-${a}`,
1142
+ s
1143
+ ].filter(Boolean).join(" "),
1144
+ rows: l,
1145
+ required: u,
1146
+ disabled: d,
1147
+ "aria-invalid": v || void 0,
1148
+ "aria-describedby": b,
1149
+ ...m
1150
+ }),
1151
+ y && /* @__PURE__ */ t("span", {
1152
+ id: _,
1153
+ className: "sh-textarea__message",
1154
+ children: y
1155
+ })
1156
+ ]
1157
+ });
1158
+ }
1159
+ //#endregion
1160
+ //#region src/components/Checkbox/checkbox.context.ts
1161
+ var Pe = o(void 0);
1162
+ //#endregion
1163
+ //#region src/components/Checkbox/Checkbox.tsx
1164
+ function Fe({ value: e, label: r, indeterminate: i = !1, className: a, inputClassName: o, name: s, checked: c, disabled: l, onChange: f, ref: p, ...h }) {
1165
+ let g = u(Pe), _ = m(null);
1166
+ d(() => {
1167
+ _.current && (_.current.indeterminate = i);
1168
+ }, [i]);
1169
+ let v = (e) => {
1170
+ _.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
1171
+ }, y = s ?? g?.name, b = g && e !== void 0 ? g.value.includes(e) : c, x = l ?? g?.disabled, S = (t) => {
1172
+ g && e !== void 0 && g.onToggle(e, t.target.checked), f?.(t);
1173
+ }, C = [
1174
+ "sh-checkbox",
1175
+ x && "sh-checkbox--disabled",
1176
+ a
1177
+ ].filter(Boolean).join(" ");
1178
+ return /* @__PURE__ */ n("label", {
1179
+ className: C,
1180
+ children: [/* @__PURE__ */ t("input", {
1181
+ ...h,
1182
+ type: "checkbox",
1183
+ ref: v,
1184
+ className: ["sh-checkbox__input", o].filter(Boolean).join(" "),
1185
+ name: y,
1186
+ value: e,
1187
+ checked: b,
1188
+ disabled: x,
1189
+ onChange: S
1190
+ }), r && /* @__PURE__ */ t("span", {
1191
+ className: "sh-checkbox__label",
1192
+ children: r
1193
+ })]
1194
+ });
1195
+ }
1196
+ //#endregion
1197
+ //#region src/components/Checkbox/CheckboxGroup.tsx
1198
+ function Ie({ children: e, value: r, defaultValue: i, onChange: a, label: o, helperText: s, error: c, name: l, orientation: u = "vertical", disabled: d = !1, "aria-label": p, className: m }) {
1199
+ let g = f(), _ = f(), v = f(), y = l ?? g, [b, x] = h(i ?? []), S = r !== void 0, C = S ? r : b, w = (e, t) => {
1200
+ let n = t ? [...C, e] : C.filter((t) => t !== e);
1201
+ S || x(n), a?.(n);
1202
+ }, T = !!c, E = c ?? s, D = [
1203
+ "sh-checkbox-group",
1204
+ T && "sh-checkbox-group--invalid",
1205
+ m
1206
+ ].filter(Boolean).join(" ");
1207
+ return /* @__PURE__ */ n("div", {
1208
+ className: D,
1209
+ children: [
1210
+ o && /* @__PURE__ */ t("span", {
1211
+ className: "sh-checkbox-group__label",
1212
+ id: _,
1213
+ children: o
1214
+ }),
1215
+ /* @__PURE__ */ t("div", {
1216
+ className: `sh-checkbox-group__options sh-checkbox-group__options--${u}`,
1217
+ role: "group",
1218
+ "aria-label": o ? void 0 : p,
1219
+ "aria-labelledby": o ? _ : void 0,
1220
+ "aria-describedby": E ? v : void 0,
1221
+ "aria-invalid": T || void 0,
1222
+ children: /* @__PURE__ */ t(Pe.Provider, {
1223
+ value: {
1224
+ name: y,
1225
+ value: C,
1226
+ onToggle: w,
1227
+ disabled: d
1228
+ },
1229
+ children: e
1230
+ })
1231
+ }),
1232
+ E && /* @__PURE__ */ t("span", {
1233
+ id: v,
1234
+ className: "sh-checkbox-group__message",
1235
+ children: E
1236
+ })
1237
+ ]
1238
+ });
1239
+ }
1240
+ //#endregion
1241
+ //#region src/components/Radio/radio.context.ts
1242
+ var Le = o(void 0);
1243
+ //#endregion
1244
+ //#region src/components/Radio/Radio.tsx
1245
+ function Re({ value: e, label: r, className: i, inputClassName: a, name: o, checked: s, disabled: c, onChange: l, ...d }) {
1246
+ let f = u(Le), p = o ?? f?.name, m = f ? f.value === e : s, h = c ?? f?.disabled, g = (t) => {
1247
+ f && e !== void 0 && f.onSelect(e), l?.(t);
1248
+ }, _ = [
1249
+ "sh-radio",
1250
+ h && "sh-radio--disabled",
1251
+ i
1252
+ ].filter(Boolean).join(" ");
1253
+ return /* @__PURE__ */ n("label", {
1254
+ className: _,
1255
+ children: [/* @__PURE__ */ t("input", {
1256
+ type: "radio",
1257
+ className: ["sh-radio__input", a].filter(Boolean).join(" "),
1258
+ name: p,
1259
+ value: e,
1260
+ checked: m,
1261
+ disabled: h,
1262
+ onChange: g,
1263
+ ...d
1264
+ }), r && /* @__PURE__ */ t("span", {
1265
+ className: "sh-radio__label",
1266
+ children: r
1267
+ })]
1268
+ });
1269
+ }
1270
+ //#endregion
1271
+ //#region src/components/Radio/RadioGroup.tsx
1272
+ function ze({ children: e, value: r, defaultValue: i, onChange: a, label: o, helperText: s, error: c, name: l, orientation: u = "vertical", disabled: d = !1, "aria-label": p, className: m }) {
1273
+ let g = f(), _ = f(), v = f(), y = l ?? g, [b, x] = h(i), S = r !== void 0, C = S ? r : b, w = (e) => {
1274
+ S || x(e), a?.(e);
1275
+ }, T = !!c, E = c ?? s, D = [
1276
+ "sh-radio-group",
1277
+ T && "sh-radio-group--invalid",
1278
+ m
1279
+ ].filter(Boolean).join(" ");
1280
+ return /* @__PURE__ */ n("div", {
1281
+ className: D,
1282
+ children: [
1283
+ o && /* @__PURE__ */ t("span", {
1284
+ className: "sh-radio-group__label",
1285
+ id: _,
1286
+ children: o
1287
+ }),
1288
+ /* @__PURE__ */ t("div", {
1289
+ className: `sh-radio-group__options sh-radio-group__options--${u}`,
1290
+ role: "radiogroup",
1291
+ "aria-label": o ? void 0 : p,
1292
+ "aria-labelledby": o ? _ : void 0,
1293
+ "aria-describedby": E ? v : void 0,
1294
+ "aria-invalid": T || void 0,
1295
+ children: /* @__PURE__ */ t(Le.Provider, {
1296
+ value: {
1297
+ name: y,
1298
+ value: C,
1299
+ onSelect: w,
1300
+ disabled: d
1301
+ },
1302
+ children: e
1303
+ })
1304
+ }),
1305
+ E && /* @__PURE__ */ t("span", {
1306
+ id: v,
1307
+ className: "sh-radio-group__message",
1308
+ children: E
1309
+ })
1310
+ ]
1311
+ });
1312
+ }
1313
+ //#endregion
1314
+ //#region src/components/Pagination/getPaginationRange.ts
1315
+ var q = (e, t) => t < e ? [] : Array.from({ length: t - e + 1 }, (t, n) => e + n);
1316
+ function Be({ page: e, count: t, siblingCount: n = 1, boundaryCount: r = 1 }) {
1317
+ if (t <= 0) return [];
1318
+ let i = q(1, Math.min(r, t)), a = q(Math.max(t - r + 1, r + 1), t), o = Math.max(Math.min(e - n, t - r - n * 2 - 1), r + 2), s = Math.min(Math.max(e + n, r + n * 2 + 2), a.length > 0 ? a[0] - 2 : t - 1);
1319
+ return [
1320
+ ...i,
1321
+ ...o > r + 2 ? ["ellipsis"] : r + 1 < t - r ? [r + 1] : [],
1322
+ ...q(o, s),
1323
+ ...s < t - r - 1 ? ["ellipsis"] : t - r > r ? [t - r] : [],
1324
+ ...a
1325
+ ];
1326
+ }
1327
+ //#endregion
1328
+ //#region src/components/Pagination/Pagination.tsx
1329
+ var Ve = ({ direction: e }) => /* @__PURE__ */ t("svg", {
1330
+ viewBox: "0 0 16 16",
1331
+ fill: "none",
1332
+ stroke: "currentColor",
1333
+ strokeWidth: 1.75,
1334
+ "aria-hidden": "true",
1335
+ children: /* @__PURE__ */ t("path", {
1336
+ d: e === "left" ? "M10 3.5 5.5 8l4.5 4.5" : "M6 3.5 10.5 8 6 12.5",
1337
+ strokeLinecap: "round",
1338
+ strokeLinejoin: "round"
1339
+ })
1340
+ }), He = ({ direction: e }) => /* @__PURE__ */ t("svg", {
1341
+ viewBox: "0 0 16 16",
1342
+ fill: "none",
1343
+ stroke: "currentColor",
1344
+ strokeWidth: 1.75,
1345
+ "aria-hidden": "true",
1346
+ children: /* @__PURE__ */ t("path", {
1347
+ d: e === "left" ? "M8 3.5 3.5 8 8 12.5M13 3.5 8.5 8l4.5 4.5" : "M8 3.5 12.5 8 8 12.5M3 3.5 7.5 8 3 12.5",
1348
+ strokeLinecap: "round",
1349
+ strokeLinejoin: "round"
1350
+ })
1351
+ }), Ue = {
1352
+ first: "First page",
1353
+ previous: "Previous page",
1354
+ next: "Next page",
1355
+ last: "Last page",
1356
+ page: (e) => `Page ${e}`
1357
+ };
1358
+ function We({ count: e, page: r, defaultPage: i = 1, onChange: a, siblingCount: o = 1, boundaryCount: s = 1, showFirstLast: c = !1, hidePrevNext: l = !1, disabled: u = !1, labels: d, "aria-label": f = "Pagination", className: p, ...m }) {
1359
+ let [g, _] = h(i), v = r !== void 0, y = v ? r : g, b = {
1360
+ ...Ue,
1361
+ ...d
1362
+ }, x = (t) => {
1363
+ t < 1 || t > e || t === y || (v || _(t), a?.(t));
1364
+ }, S = Be({
1365
+ page: y,
1366
+ count: e,
1367
+ siblingCount: o,
1368
+ boundaryCount: s
1369
+ });
1370
+ if (e <= 0) return null;
1371
+ let C = (n, r, i, a) => /* @__PURE__ */ t("li", {
1372
+ className: "sh-pagination__item",
1373
+ children: /* @__PURE__ */ t("button", {
1374
+ type: "button",
1375
+ className: "sh-pagination__control",
1376
+ onClick: () => x(i),
1377
+ disabled: u || i < 1 || i > e || i === y,
1378
+ "aria-label": r,
1379
+ children: a
1380
+ })
1381
+ }, n);
1382
+ return /* @__PURE__ */ t("nav", {
1383
+ className: ["sh-pagination", p].filter(Boolean).join(" "),
1384
+ "aria-label": f,
1385
+ ...m,
1386
+ children: /* @__PURE__ */ n("ul", {
1387
+ className: "sh-pagination__list",
1388
+ children: [
1389
+ c && C("first", b.first, 1, /* @__PURE__ */ t(He, { direction: "left" })),
1390
+ !l && C("prev", b.previous, y - 1, /* @__PURE__ */ t(Ve, { direction: "left" })),
1391
+ S.map((e, n) => e === "ellipsis" ? /* @__PURE__ */ t("li", {
1392
+ className: "sh-pagination__item",
1393
+ children: /* @__PURE__ */ t("span", {
1394
+ className: "sh-pagination__ellipsis",
1395
+ "aria-hidden": "true",
1396
+ children: "…"
1397
+ })
1398
+ }, `ellipsis-${n}`) : /* @__PURE__ */ t("li", {
1399
+ className: "sh-pagination__item",
1400
+ children: /* @__PURE__ */ t("button", {
1401
+ type: "button",
1402
+ className: ["sh-pagination__page", e === y && "sh-pagination__page--current"].filter(Boolean).join(" "),
1403
+ onClick: () => x(e),
1404
+ disabled: u,
1405
+ "aria-label": b.page(e),
1406
+ "aria-current": e === y ? "page" : void 0,
1407
+ children: e
1408
+ })
1409
+ }, e)),
1410
+ !l && C("next", b.next, y + 1, /* @__PURE__ */ t(Ve, { direction: "right" })),
1411
+ c && C("last", b.last, e, /* @__PURE__ */ t(He, { direction: "right" }))
1412
+ ]
1413
+ })
1414
+ });
1415
+ }
1416
+ //#endregion
1417
+ //#region src/components/Accordion/accordion.context.ts
1418
+ var Ge = o(void 0);
1419
+ function Ke(e) {
1420
+ let t = u(Ge);
1421
+ if (!t) throw Error(`<${e}> must be rendered inside <Accordion>.`);
1422
+ return t;
1423
+ }
1424
+ var qe = (e, t) => `${e}-trigger-${t}`, Je = (e, t) => `${e}-panel-${t}`;
1425
+ //#endregion
1426
+ //#region src/components/Accordion/Accordion.tsx
1427
+ function Ye({ children: e, type: n = "single", value: r, defaultValue: i, onChange: a, collapsible: o = !0, headingLevel: s = 3, className: c, ...l }) {
1428
+ let u = f(), [d, p] = h(i ?? []), m = r !== void 0, g = m ? r : d;
1429
+ return /* @__PURE__ */ t(Ge.Provider, {
1430
+ value: {
1431
+ value: g,
1432
+ toggle: (e) => {
1433
+ let t = g.includes(e), r;
1434
+ r = n === "multiple" ? t ? g.filter((t) => t !== e) : [...g, e] : t ? o ? [] : g : [e], m || p(r), a?.(r);
1435
+ },
1436
+ baseId: u,
1437
+ headingLevel: s
1438
+ },
1439
+ children: /* @__PURE__ */ t("div", {
1440
+ className: ["sh-accordion", c].filter(Boolean).join(" "),
1441
+ ...l,
1442
+ children: e
1443
+ })
1444
+ });
1445
+ }
1446
+ //#endregion
1447
+ //#region src/components/Accordion/AccordionItem.tsx
1448
+ var Xe = () => /* @__PURE__ */ t("svg", {
1449
+ className: "sh-accordion__chevron",
1450
+ viewBox: "0 0 16 16",
1451
+ fill: "none",
1452
+ stroke: "currentColor",
1453
+ strokeWidth: 1.75,
1454
+ "aria-hidden": "true",
1455
+ children: /* @__PURE__ */ t("path", {
1456
+ d: "M4 6.5 8 10.5l4-4",
1457
+ strokeLinecap: "round",
1458
+ strokeLinejoin: "round"
1459
+ })
1460
+ });
1461
+ function Ze({ value: e, title: r, children: i, disabled: a = !1, className: o, ...c }) {
1462
+ let { value: l, toggle: u, baseId: d, headingLevel: f } = Ke("AccordionItem"), p = l.includes(e), m = /* @__PURE__ */ n("button", {
1463
+ type: "button",
1464
+ id: qe(d, e),
1465
+ className: "sh-accordion__trigger",
1466
+ "aria-expanded": p,
1467
+ "aria-controls": Je(d, e),
1468
+ disabled: a,
1469
+ onClick: () => u(e),
1470
+ children: [/* @__PURE__ */ t("span", {
1471
+ className: "sh-accordion__title",
1472
+ children: r
1473
+ }), /* @__PURE__ */ t(Xe, {})]
1474
+ });
1475
+ return /* @__PURE__ */ n("div", {
1476
+ className: [
1477
+ "sh-accordion__item",
1478
+ p && "sh-accordion__item--open",
1479
+ a && "sh-accordion__item--disabled",
1480
+ o
1481
+ ].filter(Boolean).join(" "),
1482
+ ...c,
1483
+ children: [s(`h${f}`, { className: "sh-accordion__heading" }, m), /* @__PURE__ */ t("div", {
1484
+ id: Je(d, e),
1485
+ className: "sh-accordion__panel",
1486
+ role: "region",
1487
+ "aria-labelledby": qe(d, e),
1488
+ children: /* @__PURE__ */ t("div", {
1489
+ className: "sh-accordion__panel-inner",
1490
+ children: /* @__PURE__ */ t("div", {
1491
+ className: "sh-accordion__content",
1492
+ children: i
1493
+ })
1494
+ })
1495
+ })]
1496
+ });
1497
+ }
1498
+ //#endregion
1499
+ //#region src/components/Stepper/stepper.context.ts
1500
+ var Qe = o(void 0);
1501
+ function $e(e) {
1502
+ let t = u(Qe);
1503
+ if (!t) throw Error(`<${e}> must be rendered inside <Stepper>.`);
1504
+ return t;
1505
+ }
1506
+ //#endregion
1507
+ //#region src/components/Stepper/Stepper.tsx
1508
+ function et({ children: e, activeStep: n = 0, orientation: i = "horizontal", "aria-label": a = "Progress", className: o, ...s }) {
1509
+ let l = r.toArray(e).filter(c), u = (e) => e < n ? "complete" : e === n ? "current" : "upcoming";
1510
+ return /* @__PURE__ */ t("ol", {
1511
+ className: [
1512
+ "sh-stepper",
1513
+ `sh-stepper--${i}`,
1514
+ o
1515
+ ].filter(Boolean).join(" "),
1516
+ "aria-label": a,
1517
+ ...s,
1518
+ children: l.map((e, n) => /* @__PURE__ */ t(Qe.Provider, {
1519
+ value: {
1520
+ index: n,
1521
+ isLast: n === l.length - 1,
1522
+ status: u(n),
1523
+ orientation: i
1524
+ },
1525
+ children: e
1526
+ }, e.key ?? n))
1527
+ });
1528
+ }
1529
+ //#endregion
1530
+ //#region src/components/Stepper/Step.tsx
1531
+ var tt = () => /* @__PURE__ */ t("svg", {
1532
+ viewBox: "0 0 16 16",
1533
+ fill: "none",
1534
+ stroke: "currentColor",
1535
+ strokeWidth: 2,
1536
+ "aria-hidden": "true",
1537
+ children: /* @__PURE__ */ t("path", {
1538
+ d: "M3.5 8.5l3 3 6-6.5",
1539
+ strokeLinecap: "round",
1540
+ strokeLinejoin: "round"
1541
+ })
1542
+ }), nt = () => /* @__PURE__ */ n("svg", {
1543
+ viewBox: "0 0 16 16",
1544
+ fill: "none",
1545
+ stroke: "currentColor",
1546
+ strokeWidth: 2,
1547
+ "aria-hidden": "true",
1548
+ children: [/* @__PURE__ */ t("path", {
1549
+ d: "M8 4.5v4.5",
1550
+ strokeLinecap: "round"
1551
+ }), /* @__PURE__ */ t("circle", {
1552
+ cx: "8",
1553
+ cy: "11.6",
1554
+ r: "0.9",
1555
+ fill: "currentColor",
1556
+ stroke: "none"
1557
+ })]
1558
+ });
1559
+ function rt({ title: r, description: i, status: a, icon: o, onClick: s, disabled: c = !1, className: l }) {
1560
+ let { index: u, isLast: d, status: f, orientation: p } = $e("Step"), m = a ?? f, h = o ?? (m === "complete" ? /* @__PURE__ */ t(tt, {}) : m === "error" ? /* @__PURE__ */ t(nt, {}) : u + 1), g = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
1561
+ className: "sh-step__indicator",
1562
+ children: h
1563
+ }), /* @__PURE__ */ n("span", {
1564
+ className: "sh-step__text",
1565
+ children: [/* @__PURE__ */ t("span", {
1566
+ className: "sh-step__title",
1567
+ children: r
1568
+ }), i && /* @__PURE__ */ t("span", {
1569
+ className: "sh-step__description",
1570
+ children: i
1571
+ })]
1572
+ })] });
1573
+ return /* @__PURE__ */ n("li", {
1574
+ className: [
1575
+ "sh-step",
1576
+ `sh-step--${m}`,
1577
+ `sh-step--${p}`,
1578
+ d && "sh-step--last",
1579
+ l
1580
+ ].filter(Boolean).join(" "),
1581
+ children: [s ? /* @__PURE__ */ t("button", {
1582
+ type: "button",
1583
+ className: "sh-step__body sh-step__body--interactive",
1584
+ onClick: s,
1585
+ disabled: c,
1586
+ "aria-current": m === "current" ? "step" : void 0,
1587
+ children: g
1588
+ }) : /* @__PURE__ */ t("span", {
1589
+ className: "sh-step__body",
1590
+ "aria-current": m === "current" ? "step" : void 0,
1591
+ children: g
1592
+ }), !d && /* @__PURE__ */ t("span", {
1593
+ className: "sh-step__connector",
1594
+ "aria-hidden": "true"
1595
+ })]
1596
+ });
1597
+ }
1598
+ //#endregion
1599
+ //#region src/components/Breadcrumb/breadcrumb.context.ts
1600
+ var it = o(void 0);
1601
+ function at(e) {
1602
+ let t = u(it);
1603
+ if (!t) throw Error(`<${e}> must be rendered inside <Breadcrumb>.`);
1604
+ return t;
1605
+ }
1606
+ //#endregion
1607
+ //#region src/components/Breadcrumb/Breadcrumb.tsx
1608
+ var ot = () => /* @__PURE__ */ t("svg", {
1609
+ viewBox: "0 0 16 16",
1610
+ fill: "none",
1611
+ stroke: "currentColor",
1612
+ strokeWidth: 1.5,
1613
+ children: /* @__PURE__ */ t("path", {
1614
+ d: "M6 3.5 10.5 8 6 12.5",
1615
+ strokeLinecap: "round",
1616
+ strokeLinejoin: "round"
1617
+ })
1618
+ });
1619
+ function st({ children: e, separator: n = /* @__PURE__ */ t(ot, {}), "aria-label": i = "Breadcrumb", className: a, ...o }) {
1620
+ let s = r.toArray(e).filter(c);
1621
+ return /* @__PURE__ */ t("nav", {
1622
+ className: ["sh-breadcrumb", a].filter(Boolean).join(" "),
1623
+ "aria-label": i,
1624
+ ...o,
1625
+ children: /* @__PURE__ */ t("ol", {
1626
+ className: "sh-breadcrumb__list",
1627
+ children: s.map((e, r) => /* @__PURE__ */ t(it.Provider, {
1628
+ value: {
1629
+ isLast: r === s.length - 1,
1630
+ separator: n
1631
+ },
1632
+ children: e
1633
+ }, e.key ?? r))
1634
+ })
1635
+ });
1636
+ }
1637
+ //#endregion
1638
+ //#region src/components/Breadcrumb/BreadcrumbItem.tsx
1639
+ function ct({ children: e, href: r, current: i, className: a, ...o }) {
1640
+ let { isLast: s, separator: c } = at("BreadcrumbItem"), l = i ?? s;
1641
+ return /* @__PURE__ */ n("li", {
1642
+ className: ["sh-breadcrumb__item", a].filter(Boolean).join(" "),
1643
+ children: [l ? /* @__PURE__ */ t("span", {
1644
+ className: "sh-breadcrumb__current",
1645
+ "aria-current": "page",
1646
+ children: e
1647
+ }) : r ? /* @__PURE__ */ t("a", {
1648
+ className: "sh-breadcrumb__link",
1649
+ href: r,
1650
+ ...o,
1651
+ children: e
1652
+ }) : /* @__PURE__ */ t("span", {
1653
+ className: "sh-breadcrumb__text",
1654
+ children: e
1655
+ }), !s && /* @__PURE__ */ t("span", {
1656
+ className: "sh-breadcrumb__separator",
1657
+ "aria-hidden": "true",
1658
+ children: c
1659
+ })]
1660
+ });
1661
+ }
1662
+ //#endregion
1663
+ //#region src/components/Tabs/tabs.context.ts
1664
+ var lt = o(void 0);
1665
+ function J(e) {
1666
+ let t = u(lt);
1667
+ if (!t) throw Error(`<${e}> must be rendered inside <Tabs>.`);
1668
+ return t;
1669
+ }
1670
+ var ut = (e, t) => `${e}-tab-${t}`, dt = (e, t) => `${e}-panel-${t}`;
1671
+ //#endregion
1672
+ //#region src/components/Tabs/Tabs.tsx
1673
+ function ft({ children: e, value: n, defaultValue: r, onChange: i, orientation: a = "horizontal", activation: o = "automatic", className: s, ...c }) {
1674
+ let l = f(), [u, d] = h(r), p = n !== void 0, m = p ? n : u, g = (e) => {
1675
+ p || d(e), i?.(e);
1676
+ }, _ = [
1677
+ "sh-tabs",
1678
+ `sh-tabs--${a}`,
1679
+ s
1680
+ ].filter(Boolean).join(" ");
1681
+ return /* @__PURE__ */ t(lt.Provider, {
1682
+ value: {
1683
+ value: m,
1684
+ select: g,
1685
+ baseId: l,
1686
+ orientation: a,
1687
+ activation: o
1688
+ },
1689
+ children: /* @__PURE__ */ t("div", {
1690
+ className: _,
1691
+ ...c,
1692
+ children: e
1693
+ })
1694
+ });
1695
+ }
1696
+ //#endregion
1697
+ //#region src/components/Tabs/TabList.tsx
1698
+ var pt = typeof window > "u" ? d : p;
1699
+ function mt({ children: e, className: r, onKeyDown: i, ...a }) {
1700
+ let { value: o, orientation: s, activation: c, select: l } = J("TabList"), u = m(null), [d, f] = h(null), p = s === "vertical";
1701
+ return pt(() => {
1702
+ let e = u.current;
1703
+ if (!e) return;
1704
+ let t = Array.from(e.querySelectorAll("[role=\"tab\"]")).find((e) => e.dataset.value === o);
1705
+ if (!t) {
1706
+ f(null);
1707
+ return;
1708
+ }
1709
+ let n = () => {
1710
+ let e = p ? t.offsetTop : t.offsetLeft, n = p ? t.offsetHeight : t.offsetWidth;
1711
+ f((t) => ({
1712
+ offset: e,
1713
+ size: n,
1714
+ animated: t !== null
1715
+ }));
1716
+ };
1717
+ if (n(), typeof ResizeObserver > "u") return;
1718
+ let r = new ResizeObserver(n);
1719
+ return r.observe(e), r.observe(t), () => r.disconnect();
1720
+ }, [o, p]), /* @__PURE__ */ n("div", {
1721
+ ref: u,
1722
+ className: ["sh-tabs__list", r].filter(Boolean).join(" "),
1723
+ role: "tablist",
1724
+ "aria-orientation": s,
1725
+ onKeyDown: (e) => {
1726
+ if (i?.(e), e.defaultPrevented || !u.current) return;
1727
+ let t = p ? "ArrowDown" : "ArrowRight";
1728
+ if (![
1729
+ t,
1730
+ p ? "ArrowUp" : "ArrowLeft",
1731
+ "Home",
1732
+ "End"
1733
+ ].includes(e.key)) return;
1734
+ let n = Array.from(u.current.querySelectorAll("[role=\"tab\"]:not([disabled])"));
1735
+ if (n.length === 0) return;
1736
+ let r = n.indexOf(document.activeElement), a;
1737
+ a = e.key === "Home" ? 0 : e.key === "End" ? n.length - 1 : r === -1 ? 0 : e.key === t ? (r + 1) % n.length : (r - 1 + n.length) % n.length;
1738
+ let o = n[a];
1739
+ if (o && (e.preventDefault(), o.focus(), c === "automatic")) {
1740
+ let e = o.dataset.value;
1741
+ e !== void 0 && l(e);
1742
+ }
1743
+ },
1744
+ ...a,
1745
+ children: [e, d && /* @__PURE__ */ t("span", {
1746
+ className: ["sh-tabs__indicator", d.animated && "sh-tabs__indicator--animated"].filter(Boolean).join(" "),
1747
+ "aria-hidden": "true",
1748
+ style: {
1749
+ "--sh-tabs-indicator-offset": `${d.offset}px`,
1750
+ "--sh-tabs-indicator-size": `${d.size}px`
1751
+ }
1752
+ })]
1753
+ });
1754
+ }
1755
+ //#endregion
1756
+ //#region src/components/Tabs/Tab.tsx
1757
+ function ht({ value: e, children: n, className: r, disabled: i, onClick: a, ...o }) {
1758
+ let { value: s, select: c, baseId: l } = J("Tab"), u = s === e, d = [
1759
+ "sh-tabs__tab",
1760
+ u && "sh-tabs__tab--selected",
1761
+ r
1762
+ ].filter(Boolean).join(" ");
1763
+ return /* @__PURE__ */ t("button", {
1764
+ type: "button",
1765
+ role: "tab",
1766
+ id: ut(l, e),
1767
+ className: d,
1768
+ "data-value": e,
1769
+ "aria-selected": u,
1770
+ "aria-controls": dt(l, e),
1771
+ tabIndex: u ? 0 : -1,
1772
+ disabled: i,
1773
+ onClick: (t) => {
1774
+ a?.(t), t.defaultPrevented || c(e);
1775
+ },
1776
+ ...o,
1777
+ children: n
1778
+ });
1779
+ }
1780
+ //#endregion
1781
+ //#region src/components/Tabs/TabPanel.tsx
1782
+ function gt({ value: e, children: n, keepMounted: r = !1, className: i, ...a }) {
1783
+ let { value: o, baseId: s } = J("TabPanel"), c = o === e;
1784
+ return !c && !r ? null : /* @__PURE__ */ t("div", {
1785
+ id: dt(s, e),
1786
+ className: ["sh-tabs__panel", i].filter(Boolean).join(" "),
1787
+ role: "tabpanel",
1788
+ "aria-labelledby": ut(s, e),
1789
+ hidden: !c,
1790
+ tabIndex: 0,
1791
+ ...a,
1792
+ children: n
1793
+ });
1794
+ }
1795
+ //#endregion
1796
+ //#region src/components/Skeleton/Skeleton.tsx
1797
+ var _t = (e) => typeof e == "number" ? `${e}px` : e;
1798
+ function vt({ variant: e = "text", width: n, height: r, lines: i = 1, animation: a = "pulse", className: o, ...s }) {
1799
+ let c = [
1800
+ "sh-skeleton",
1801
+ `sh-skeleton--${e}`,
1802
+ `sh-skeleton--${a}`
1803
+ ].join(" "), l = {
1804
+ width: _t(n),
1805
+ height: _t(r ?? (e === "circular" ? n : void 0))
1806
+ };
1807
+ return e === "text" && i > 1 ? /* @__PURE__ */ t("div", {
1808
+ className: ["sh-skeleton-lines", o].filter(Boolean).join(" "),
1809
+ "aria-hidden": "true",
1810
+ ...s,
1811
+ children: Array.from({ length: i }, (e, n) => /* @__PURE__ */ t("span", {
1812
+ className: c,
1813
+ style: n === i - 1 ? {
1814
+ ...l,
1815
+ width: "60%"
1816
+ } : l
1817
+ }, n))
1818
+ }) : /* @__PURE__ */ t("span", {
1819
+ className: [c, o].filter(Boolean).join(" "),
1820
+ style: l,
1821
+ "aria-hidden": "true",
1822
+ ...s
1823
+ });
1824
+ }
1825
+ //#endregion
1826
+ //#region src/components/Skeleton/skeleton.tokens.ts
1827
+ var yt = [
1828
+ "text",
1829
+ "rectangular",
1830
+ "circular"
1831
+ ], bt = [
1832
+ "pulse",
1833
+ "wave",
1834
+ "none"
1835
+ ];
1836
+ //#endregion
1837
+ //#region src/components/Spinner/Spinner.tsx
1838
+ function xt({ size: e = "md", label: r = "Loading", showLabel: i = !1, className: a, ...o }) {
1839
+ let s = f(), c = [
1840
+ "sh-spinner",
1841
+ `sh-spinner--${e}`,
1842
+ i && "sh-spinner--with-label",
1843
+ a
1844
+ ].filter(Boolean).join(" ");
1845
+ return /* @__PURE__ */ n("span", {
1846
+ className: c,
1847
+ role: "status",
1848
+ "aria-labelledby": s,
1849
+ ...o,
1850
+ children: [/* @__PURE__ */ t("span", {
1851
+ className: "sh-spinner__ring",
1852
+ "aria-hidden": "true"
1853
+ }), /* @__PURE__ */ t("span", {
1854
+ id: s,
1855
+ className: i ? "sh-spinner__label" : "sh-spinner__label--visually-hidden",
1856
+ children: r
1857
+ })]
1858
+ });
1859
+ }
1860
+ //#endregion
1861
+ //#region src/components/Spinner/spinner.tokens.ts
1862
+ var St = [
1863
+ "sm",
1864
+ "md",
1865
+ "lg"
1866
+ ];
1867
+ //#endregion
1868
+ //#region src/components/ProgressBar/ProgressBar.tsx
1869
+ function Ct({ value: e, max: r = 100, label: i, showValue: a = !1, formatValue: o, size: s = "md", "aria-label": c, className: l, ...u }) {
1870
+ let d = f(), p = e === void 0, m = r > 0 ? r : 0, h = p ? 0 : Math.min(Math.max(e, 0), m), g = m === 0 ? 0 : h / m * 100, _ = o ? o(h, m) : `${Math.round(g)}%`, v = [
1871
+ "sh-progress",
1872
+ `sh-progress--${s}`,
1873
+ p && "sh-progress--indeterminate",
1874
+ l
1875
+ ].filter(Boolean).join(" ");
1876
+ return /* @__PURE__ */ n("div", {
1877
+ className: v,
1878
+ ...u,
1879
+ children: [(i || a && !p) && /* @__PURE__ */ n("span", {
1880
+ className: "sh-progress__header",
1881
+ children: [i && /* @__PURE__ */ t("span", {
1882
+ className: "sh-progress__label",
1883
+ id: d,
1884
+ children: i
1885
+ }), a && !p && /* @__PURE__ */ t("span", {
1886
+ className: "sh-progress__value",
1887
+ children: _
1888
+ })]
1889
+ }), /* @__PURE__ */ t("div", {
1890
+ className: "sh-progress__track",
1891
+ role: "progressbar",
1892
+ "aria-label": i ? void 0 : c,
1893
+ "aria-labelledby": i ? d : void 0,
1894
+ "aria-valuemin": 0,
1895
+ "aria-valuemax": m,
1896
+ "aria-valuenow": p ? void 0 : h,
1897
+ "aria-valuetext": p ? void 0 : o ? _ : void 0,
1898
+ children: /* @__PURE__ */ t("div", {
1899
+ className: "sh-progress__bar",
1900
+ style: { "--sh-progress-fill": `${g}%` }
1901
+ })
1902
+ })]
1903
+ });
1904
+ }
1905
+ //#endregion
1906
+ //#region src/components/ProgressBar/progressBar.tokens.ts
1907
+ var wt = [
1908
+ "sm",
1909
+ "md",
1910
+ "lg"
1911
+ ], Tt = {
1912
+ success: /* @__PURE__ */ n("svg", {
1913
+ viewBox: "0 0 20 20",
1914
+ fill: "none",
1915
+ stroke: "currentColor",
1916
+ strokeWidth: 1.6,
1917
+ "aria-hidden": "true",
1918
+ children: [/* @__PURE__ */ t("circle", {
1919
+ cx: "10",
1920
+ cy: "10",
1921
+ r: "7.5"
1922
+ }), /* @__PURE__ */ t("path", {
1923
+ d: "M6.75 10.25l2.25 2.25 4.25-4.75",
1924
+ strokeLinecap: "round",
1925
+ strokeLinejoin: "round"
1926
+ })]
1927
+ }),
1928
+ info: /* @__PURE__ */ n("svg", {
1929
+ viewBox: "0 0 20 20",
1930
+ fill: "none",
1931
+ stroke: "currentColor",
1932
+ strokeWidth: 1.6,
1933
+ "aria-hidden": "true",
1934
+ children: [
1935
+ /* @__PURE__ */ t("circle", {
1936
+ cx: "10",
1937
+ cy: "10",
1938
+ r: "7.5"
1939
+ }),
1940
+ /* @__PURE__ */ t("path", {
1941
+ d: "M10 9v4.5",
1942
+ strokeLinecap: "round"
1943
+ }),
1944
+ /* @__PURE__ */ t("circle", {
1945
+ cx: "10",
1946
+ cy: "6.4",
1947
+ r: "0.9",
1948
+ fill: "currentColor",
1949
+ stroke: "none"
1950
+ })
1951
+ ]
1952
+ }),
1953
+ warning: /* @__PURE__ */ n("svg", {
1954
+ viewBox: "0 0 20 20",
1955
+ fill: "none",
1956
+ stroke: "currentColor",
1957
+ strokeWidth: 1.6,
1958
+ "aria-hidden": "true",
1959
+ children: [
1960
+ /* @__PURE__ */ t("path", {
1961
+ d: "M10 2.8 18 16.5H2L10 2.8Z",
1962
+ strokeLinejoin: "round"
1963
+ }),
1964
+ /* @__PURE__ */ t("path", {
1965
+ d: "M10 8v3.5",
1966
+ strokeLinecap: "round"
1967
+ }),
1968
+ /* @__PURE__ */ t("circle", {
1969
+ cx: "10",
1970
+ cy: "13.9",
1971
+ r: "0.9",
1972
+ fill: "currentColor",
1973
+ stroke: "none"
1974
+ })
1975
+ ]
1976
+ }),
1977
+ error: /* @__PURE__ */ n("svg", {
1978
+ viewBox: "0 0 20 20",
1979
+ fill: "none",
1980
+ stroke: "currentColor",
1981
+ strokeWidth: 1.6,
1982
+ "aria-hidden": "true",
1983
+ children: [/* @__PURE__ */ t("circle", {
1984
+ cx: "10",
1985
+ cy: "10",
1986
+ r: "7.5"
1987
+ }), /* @__PURE__ */ t("path", {
1988
+ d: "M7.5 7.5l5 5M12.5 7.5l-5 5",
1989
+ strokeLinecap: "round"
1990
+ })]
1991
+ })
1992
+ }, Et = () => /* @__PURE__ */ t("svg", {
1993
+ viewBox: "0 0 16 16",
1994
+ fill: "none",
1995
+ stroke: "currentColor",
1996
+ strokeWidth: 1.75,
1997
+ "aria-hidden": "true",
1998
+ children: /* @__PURE__ */ t("path", {
1999
+ d: "M4.5 4.5l7 7M11.5 4.5l-7 7",
2000
+ strokeLinecap: "round"
2001
+ })
2002
+ }), Dt = {
2003
+ success: "status",
2004
+ info: "status",
2005
+ warning: "alert",
2006
+ error: "alert"
2007
+ };
2008
+ function Ot({ variant: e = "info", title: r, children: i, icon: a, onDismiss: o, dismissLabel: s = "Dismiss", role: c, className: l, ...u }) {
2009
+ let d = [
2010
+ "sh-alert",
2011
+ `sh-alert--${e}`,
2012
+ l
2013
+ ].filter(Boolean).join(" "), f = a === void 0 ? Tt[e] : a;
2014
+ return /* @__PURE__ */ n("div", {
2015
+ className: d,
2016
+ role: c ?? Dt[e],
2017
+ ...u,
2018
+ children: [
2019
+ f !== !1 && /* @__PURE__ */ t("span", {
2020
+ className: "sh-alert__icon",
2021
+ children: f
2022
+ }),
2023
+ /* @__PURE__ */ n("div", {
2024
+ className: "sh-alert__content",
2025
+ children: [r && /* @__PURE__ */ t("p", {
2026
+ className: "sh-alert__title",
2027
+ children: r
2028
+ }), i && /* @__PURE__ */ t("div", {
2029
+ className: "sh-alert__body",
2030
+ children: i
2031
+ })]
2032
+ }),
2033
+ o && /* @__PURE__ */ t("button", {
2034
+ type: "button",
2035
+ className: "sh-alert__dismiss",
2036
+ onClick: o,
2037
+ "aria-label": s,
2038
+ children: /* @__PURE__ */ t(Et, {})
2039
+ })
2040
+ ]
2041
+ });
2042
+ }
2043
+ //#endregion
2044
+ //#region src/components/Alert/alert.tokens.ts
2045
+ var kt = [
2046
+ "success",
2047
+ "info",
2048
+ "warning",
2049
+ "error"
2050
+ ];
2051
+ //#endregion
2052
+ //#region src/components/FileDrop/isFileAccepted.ts
2053
+ function Y(e, t) {
2054
+ if (!t) return !0;
2055
+ let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
2056
+ if (n.length === 0) return !0;
2057
+ let r = e.name.toLowerCase(), i = e.type.toLowerCase();
2058
+ return n.some((e) => e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i.startsWith(e.slice(0, -1)) : i === e);
2059
+ }
2060
+ function At(e) {
2061
+ if (e < 1024) return `${e} B`;
2062
+ let t = [
2063
+ "KB",
2064
+ "MB",
2065
+ "GB",
2066
+ "TB"
2067
+ ], n = e / 1024, r = 0;
2068
+ for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
2069
+ return `${Math.round(n * 10) / 10} ${t[r]}`;
2070
+ }
2071
+ //#endregion
2072
+ //#region src/components/FileDrop/FileDrop.tsx
2073
+ var jt = () => /* @__PURE__ */ n("svg", {
2074
+ className: "sh-filedrop__icon",
2075
+ viewBox: "0 0 24 24",
2076
+ fill: "none",
2077
+ stroke: "currentColor",
2078
+ strokeWidth: 1.5,
2079
+ strokeLinecap: "round",
2080
+ strokeLinejoin: "round",
2081
+ "aria-hidden": "true",
2082
+ children: [/* @__PURE__ */ t("path", { d: "M12 16V4m0 0L8 8m4-4 4 4" }), /* @__PURE__ */ t("path", { d: "M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3" })]
2083
+ }), Mt = () => /* @__PURE__ */ t("svg", {
2084
+ viewBox: "0 0 16 16",
2085
+ fill: "none",
2086
+ stroke: "currentColor",
2087
+ strokeWidth: 1.75,
2088
+ "aria-hidden": "true",
2089
+ children: /* @__PURE__ */ t("path", {
2090
+ d: "M4.5 4.5l7 7M11.5 4.5l-7 7",
2091
+ strokeLinecap: "round"
2092
+ })
2093
+ });
2094
+ function Nt({ label: e, helperText: r, error: i, placeholder: a = "Drag files here, or click to browse", accept: o, multiple: s = !1, value: c, defaultValue: l, onChange: u, onReject: d, hideFileList: p = !1, disabled: g = !1, name: _, "aria-label": v, className: y, inputClassName: b }) {
2095
+ let x = f(), S = f(), [C, w] = h(l ?? []), T = c !== void 0, E = T ? c : C, [D, O] = h(!1), k = m(0), A = !!i, j = i ?? r, M = (e) => {
2096
+ T || w(e), u?.(e);
2097
+ }, N = (e) => {
2098
+ let t = e.filter((e) => Y(e, o)), n = e.filter((e) => !Y(e, o));
2099
+ n.length > 0 && d?.(n), t.length !== 0 && M(s ? [...E, ...t] : [t[0]]);
2100
+ }, P = (e) => {
2101
+ N(Array.from(e.target.files ?? [])), e.target.value = "";
2102
+ }, F = (e) => {
2103
+ g || (e.preventDefault(), k.current += 1, O(!0));
2104
+ }, I = (e) => {
2105
+ g || e.preventDefault();
2106
+ }, L = (e) => {
2107
+ g || (e.preventDefault(), --k.current, k.current <= 0 && (k.current = 0, O(!1)));
2108
+ }, R = (e) => {
2109
+ g || (e.preventDefault(), k.current = 0, O(!1), N(Array.from(e.dataTransfer?.files ?? [])));
2110
+ }, z = (e) => {
2111
+ M(E.filter((t, n) => n !== e));
2112
+ }, B = [
2113
+ "sh-filedrop",
2114
+ A && "sh-filedrop--invalid",
2115
+ g && "sh-filedrop--disabled",
2116
+ D && "sh-filedrop--dragging",
2117
+ y
2118
+ ].filter(Boolean).join(" ");
2119
+ return /* @__PURE__ */ n("div", {
2120
+ className: B,
2121
+ children: [
2122
+ e && /* @__PURE__ */ t("label", {
2123
+ className: "sh-filedrop__label",
2124
+ htmlFor: x,
2125
+ children: e
2126
+ }),
2127
+ /* @__PURE__ */ n("label", {
2128
+ className: "sh-filedrop__dropzone",
2129
+ onDragEnter: F,
2130
+ onDragOver: I,
2131
+ onDragLeave: L,
2132
+ onDrop: R,
2133
+ children: [/* @__PURE__ */ t("input", {
2134
+ id: x,
2135
+ type: "file",
2136
+ className: ["sh-filedrop__input", b].filter(Boolean).join(" "),
2137
+ accept: o,
2138
+ multiple: s,
2139
+ disabled: g,
2140
+ name: _,
2141
+ onChange: P,
2142
+ "aria-label": e ? void 0 : v,
2143
+ "aria-invalid": A || void 0,
2144
+ "aria-describedby": j ? S : void 0
2145
+ }), /* @__PURE__ */ n("span", {
2146
+ className: "sh-filedrop__prompt",
2147
+ "aria-hidden": "true",
2148
+ children: [
2149
+ /* @__PURE__ */ t(jt, {}),
2150
+ /* @__PURE__ */ t("span", {
2151
+ className: "sh-filedrop__placeholder",
2152
+ children: a
2153
+ }),
2154
+ o && /* @__PURE__ */ t("span", {
2155
+ className: "sh-filedrop__accept",
2156
+ children: o
2157
+ })
2158
+ ]
2159
+ })]
2160
+ }),
2161
+ !p && E.length > 0 && /* @__PURE__ */ t("ul", {
2162
+ className: "sh-filedrop__files",
2163
+ children: E.map((e, r) => /* @__PURE__ */ n("li", {
2164
+ className: "sh-filedrop__file",
2165
+ children: [
2166
+ /* @__PURE__ */ t("span", {
2167
+ className: "sh-filedrop__file-name",
2168
+ children: e.name
2169
+ }),
2170
+ /* @__PURE__ */ t("span", {
2171
+ className: "sh-filedrop__file-size",
2172
+ children: At(e.size)
2173
+ }),
2174
+ /* @__PURE__ */ t("button", {
2175
+ type: "button",
2176
+ className: "sh-filedrop__file-remove",
2177
+ onClick: () => z(r),
2178
+ disabled: g,
2179
+ "aria-label": `Remove ${e.name}`,
2180
+ children: /* @__PURE__ */ t(Mt, {})
2181
+ })
2182
+ ]
2183
+ }, `${e.name}-${r}`))
2184
+ }),
2185
+ j && /* @__PURE__ */ t("span", {
2186
+ id: S,
2187
+ className: "sh-filedrop__message",
2188
+ children: j
2189
+ })
2190
+ ]
2191
+ });
2192
+ }
2193
+ //#endregion
2194
+ //#region src/components/RangeSlider/RangeSlider.tsx
2195
+ function Pt({ label: e, helperText: r, error: i, value: a, defaultValue: o, onChange: s, min: c = 0, max: l = 100, step: u = 1, showValue: d = !1, formatValue: p, className: m, inputClassName: g, id: _, disabled: v, "aria-describedby": y, ...b }) {
2196
+ let x = f(), S = _ ?? x, C = `${S}-message`, [w, T] = h(o ?? c), E = a !== void 0, D = E ? a : w, O = !!i, k = i ?? r, A = [y, k ? C : void 0].filter(Boolean).join(" ") || void 0, j = (e) => {
2197
+ let t = Number(e.target.value);
2198
+ E || T(t), s?.(t);
2199
+ }, M = l === c ? 0 : (D - c) / (l - c) * 100, N = p ? p(D) : String(D), P = [
2200
+ "sh-range",
2201
+ O && "sh-range--invalid",
2202
+ v && "sh-range--disabled",
2203
+ m
2204
+ ].filter(Boolean).join(" ");
2205
+ return /* @__PURE__ */ n("div", {
2206
+ className: P,
2207
+ children: [
2208
+ (e || d) && /* @__PURE__ */ n("span", {
2209
+ className: "sh-range__header",
2210
+ children: [e && /* @__PURE__ */ t("label", {
2211
+ className: "sh-range__label",
2212
+ htmlFor: S,
2213
+ children: e
2214
+ }), d && /* @__PURE__ */ t("span", {
2215
+ className: "sh-range__value",
2216
+ children: N
2217
+ })]
2218
+ }),
2219
+ /* @__PURE__ */ t("input", {
2220
+ ...b,
2221
+ type: "range",
2222
+ id: S,
2223
+ className: ["sh-range__input", g].filter(Boolean).join(" "),
2224
+ style: { "--sh-range-fill": `${M}%` },
2225
+ min: c,
2226
+ max: l,
2227
+ step: u,
2228
+ value: D,
2229
+ disabled: v,
2230
+ onChange: j,
2231
+ "aria-invalid": O || void 0,
2232
+ "aria-describedby": A,
2233
+ "aria-valuetext": p ? N : void 0
2234
+ }),
2235
+ k && /* @__PURE__ */ t("span", {
2236
+ id: C,
2237
+ className: "sh-range__message",
2238
+ children: k
2239
+ })
2240
+ ]
2241
+ });
2242
+ }
2243
+ //#endregion
2244
+ //#region src/components/MinMaxSlider/MinMaxSlider.tsx
2245
+ function Ft({ label: e, helperText: r, error: i, value: a, defaultValue: o, onChange: s, min: c = 0, max: l = 100, step: u = 1, minGap: d = 0, showValue: p = !1, formatValue: m, name: g, disabled: _ = !1, "aria-label": v, className: y }) {
2246
+ let b = f(), x = f(), [S, C] = h(o ?? [c, l]), w = a !== void 0, [T, E] = w ? a : S, D = !!i, O = i ?? r, k = (e) => {
2247
+ w || C(e), s?.(e);
2248
+ }, A = (e) => {
2249
+ k([Math.min(Number(e.target.value), E - d), E]);
2250
+ }, j = (e) => {
2251
+ k([T, Math.max(Number(e.target.value), T + d)]);
2252
+ }, M = (e) => l === c ? 0 : (e - c) / (l - c) * 100, N = M(T), P = M(E), F = (e) => m ? m(e) : String(e), I = T > (c + l) / 2, L = [
2253
+ "sh-minmax",
2254
+ D && "sh-minmax--invalid",
2255
+ _ && "sh-minmax--disabled",
2256
+ I && "sh-minmax--from-on-top",
2257
+ y
2258
+ ].filter(Boolean).join(" "), R = e ? void 0 : v, z = (t) => e || v ? `${e ?? v} ${t}` : t;
2259
+ return /* @__PURE__ */ n("div", {
2260
+ className: L,
2261
+ style: {
2262
+ "--sh-minmax-from": `${N}%`,
2263
+ "--sh-minmax-to": `${P}%`
2264
+ },
2265
+ children: [
2266
+ (e || p) && /* @__PURE__ */ n("span", {
2267
+ className: "sh-minmax__header",
2268
+ children: [e && /* @__PURE__ */ t("span", {
2269
+ className: "sh-minmax__label",
2270
+ id: b,
2271
+ children: e
2272
+ }), p && /* @__PURE__ */ n("span", {
2273
+ className: "sh-minmax__value",
2274
+ children: [
2275
+ F(T),
2276
+ " – ",
2277
+ F(E)
2278
+ ]
2279
+ })]
2280
+ }),
2281
+ /* @__PURE__ */ n("div", {
2282
+ className: "sh-minmax__rail",
2283
+ role: "group",
2284
+ "aria-label": R,
2285
+ "aria-labelledby": e ? b : void 0,
2286
+ "aria-describedby": O ? x : void 0,
2287
+ "aria-invalid": D || void 0,
2288
+ children: [
2289
+ /* @__PURE__ */ t("span", {
2290
+ className: "sh-minmax__track",
2291
+ "aria-hidden": "true",
2292
+ children: /* @__PURE__ */ t("span", { className: "sh-minmax__fill" })
2293
+ }),
2294
+ /* @__PURE__ */ t("input", {
2295
+ type: "range",
2296
+ className: "sh-minmax__input sh-minmax__input--from",
2297
+ name: g ? `${g}-min` : void 0,
2298
+ min: c,
2299
+ max: l,
2300
+ step: u,
2301
+ value: T,
2302
+ disabled: _,
2303
+ onChange: A,
2304
+ "aria-label": z("minimum"),
2305
+ "aria-valuetext": m ? F(T) : void 0
2306
+ }),
2307
+ /* @__PURE__ */ t("input", {
2308
+ type: "range",
2309
+ className: "sh-minmax__input sh-minmax__input--to",
2310
+ name: g ? `${g}-max` : void 0,
2311
+ min: c,
2312
+ max: l,
2313
+ step: u,
2314
+ value: E,
2315
+ disabled: _,
2316
+ onChange: j,
2317
+ "aria-label": z("maximum"),
2318
+ "aria-valuetext": m ? F(E) : void 0
2319
+ })
2320
+ ]
2321
+ }),
2322
+ O && /* @__PURE__ */ t("span", {
2323
+ id: x,
2324
+ className: "sh-minmax__message",
2325
+ children: O
2326
+ })
2327
+ ]
2328
+ });
2329
+ }
2330
+ //#endregion
2331
+ //#region src/components/Switch/switch.context.ts
2332
+ var It = o(void 0);
2333
+ //#endregion
2334
+ //#region src/components/Switch/Switch.tsx
2335
+ function Lt({ value: e, label: r, labelPosition: i, className: a, inputClassName: o, name: s, checked: c, disabled: l, onChange: d, ...f }) {
2336
+ let p = u(It), m = s ?? p?.name, h = p && e !== void 0 ? p.value.includes(e) : c, g = l ?? p?.disabled, _ = i ?? p?.labelPosition ?? "right", v = (t) => {
2337
+ p && e !== void 0 && p.onToggle(e, t.target.checked), d?.(t);
2338
+ }, y = [
2339
+ "sh-switch",
2340
+ `sh-switch--label-${_}`,
2341
+ g && "sh-switch--disabled",
2342
+ a
2343
+ ].filter(Boolean).join(" ");
2344
+ return /* @__PURE__ */ n("label", {
2345
+ className: y,
2346
+ children: [
2347
+ /* @__PURE__ */ t("input", {
2348
+ ...f,
2349
+ type: "checkbox",
2350
+ role: "switch",
2351
+ className: ["sh-switch__input", o].filter(Boolean).join(" "),
2352
+ name: m,
2353
+ value: e,
2354
+ checked: h,
2355
+ disabled: g,
2356
+ onChange: v
2357
+ }),
2358
+ /* @__PURE__ */ t("span", {
2359
+ className: "sh-switch__track",
2360
+ "aria-hidden": "true",
2361
+ children: /* @__PURE__ */ t("span", { className: "sh-switch__thumb" })
2362
+ }),
2363
+ r && /* @__PURE__ */ t("span", {
2364
+ className: "sh-switch__label",
2365
+ children: r
2366
+ })
2367
+ ]
2368
+ });
2369
+ }
2370
+ //#endregion
2371
+ //#region src/components/Switch/SwitchGroup.tsx
2372
+ function Rt({ children: e, value: r, defaultValue: i, onChange: a, label: o, helperText: s, error: c, name: l, orientation: u = "vertical", labelPosition: d, disabled: p = !1, "aria-label": m, className: g }) {
2373
+ let _ = f(), v = f(), y = f(), b = l ?? _, [x, S] = h(i ?? []), C = r !== void 0, w = C ? r : x, T = (e, t) => {
2374
+ let n = t ? [...w, e] : w.filter((t) => t !== e);
2375
+ C || S(n), a?.(n);
2376
+ }, E = !!c, D = c ?? s, O = [
2377
+ "sh-switch-group",
2378
+ E && "sh-switch-group--invalid",
2379
+ g
2380
+ ].filter(Boolean).join(" ");
2381
+ return /* @__PURE__ */ n("div", {
2382
+ className: O,
2383
+ children: [
2384
+ o && /* @__PURE__ */ t("span", {
2385
+ className: "sh-switch-group__label",
2386
+ id: v,
2387
+ children: o
2388
+ }),
2389
+ /* @__PURE__ */ t("div", {
2390
+ className: `sh-switch-group__options sh-switch-group__options--${u}`,
2391
+ role: "group",
2392
+ "aria-label": o ? void 0 : m,
2393
+ "aria-labelledby": o ? v : void 0,
2394
+ "aria-describedby": D ? y : void 0,
2395
+ "aria-invalid": E || void 0,
2396
+ children: /* @__PURE__ */ t(It.Provider, {
2397
+ value: {
2398
+ name: b,
2399
+ value: w,
2400
+ onToggle: T,
2401
+ disabled: p,
2402
+ labelPosition: d
2403
+ },
2404
+ children: e
2405
+ })
2406
+ }),
2407
+ D && /* @__PURE__ */ t("span", {
2408
+ id: y,
2409
+ className: "sh-switch-group__message",
2410
+ children: D
2411
+ })
2412
+ ]
2413
+ });
2414
+ }
2415
+ //#endregion
2416
+ //#region src/components/SegmentedControl/SegmentedControl.tsx
2417
+ function zt({ options: e, value: r, defaultValue: i, onChange: a, label: o, name: s, fullWidth: c = !1, disabled: l = !1, "aria-label": u, className: d }) {
2418
+ let p = f(), m = f(), g = s ?? p, [_, v] = h(i), y = r !== void 0, b = y ? r : _, x = (e) => {
2419
+ y || v(e), a?.(e);
2420
+ }, S = e.findIndex((e) => e.value === b), C = [
2421
+ "sh-segmented",
2422
+ c && "sh-segmented--full-width",
2423
+ l && "sh-segmented--disabled",
2424
+ S < 0 && "sh-segmented--unselected",
2425
+ d
2426
+ ].filter(Boolean).join(" "), w = {
2427
+ "--sh-segmented-count": e.length,
2428
+ "--sh-segmented-index": Math.max(S, 0)
2429
+ };
2430
+ return /* @__PURE__ */ n("div", {
2431
+ className: "sh-segmented-field",
2432
+ children: [o && /* @__PURE__ */ t("span", {
2433
+ className: "sh-segmented__group-label",
2434
+ id: m,
2435
+ children: o
2436
+ }), /* @__PURE__ */ t("div", {
2437
+ className: C,
2438
+ style: w,
2439
+ role: "radiogroup",
2440
+ "aria-label": o ? void 0 : u,
2441
+ "aria-labelledby": o ? m : void 0,
2442
+ children: e.map((e) => {
2443
+ let r = l || e.disabled;
2444
+ return /* @__PURE__ */ n("label", {
2445
+ className: ["sh-segmented__item", r && "sh-segmented__item--disabled"].filter(Boolean).join(" "),
2446
+ children: [/* @__PURE__ */ t("input", {
2447
+ className: "sh-segmented__input",
2448
+ type: "radio",
2449
+ name: g,
2450
+ value: e.value,
2451
+ checked: b === e.value,
2452
+ disabled: r,
2453
+ onChange: () => x(e.value)
2454
+ }), /* @__PURE__ */ t("span", {
2455
+ className: "sh-segmented__label",
2456
+ children: e.label
2457
+ })]
2458
+ }, e.value);
2459
+ })
2460
+ })]
2461
+ });
2462
+ }
2463
+ //#endregion
2464
+ //#region src/tokens/colors.ts
2465
+ var Bt = /* @__PURE__ */ v({
2466
+ accent: () => X,
2467
+ accentFill: () => $,
2468
+ colorVar: () => Wt,
2469
+ danger: () => Q,
2470
+ neutral: () => Z,
2471
+ palette: () => Vt,
2472
+ paletteVar: () => Gt,
2473
+ semanticColors: () => Ut
2474
+ }), X = {
2475
+ 50: "#f6f0ff",
2476
+ 100: "#ece0ff",
2477
+ 200: "#d9c2ff",
2478
+ 300: "#c19dff",
2479
+ 400: "#a672ff",
2480
+ 500: "#8b47fa",
2481
+ 600: "#7429e0",
2482
+ 700: "#5d1fb8",
2483
+ 800: "#461890",
2484
+ 900: "#331269",
2485
+ 950: "#1f0b40"
2486
+ }, Z = {
2487
+ 0: "#ffffff",
2488
+ 50: "#f8f7fa",
2489
+ 100: "#efedf3",
2490
+ 200: "#e2dfe8",
2491
+ 300: "#cac6d3",
2492
+ 400: "#a29cae",
2493
+ 500: "#79728a",
2494
+ 600: "#5a5468",
2495
+ 700: "#423d4d",
2496
+ 800: "#2c2836",
2497
+ 900: "#1a1720",
2498
+ 950: "#0d0b12"
2499
+ }, Q = {
2500
+ 50: "#fef3f2",
2501
+ 100: "#fee4e2",
2502
+ 200: "#fecdca",
2503
+ 300: "#fda29b",
2504
+ 400: "#f97066",
2505
+ 500: "#f04438",
2506
+ 600: "#d92d20",
2507
+ 700: "#b42318",
2508
+ 800: "#912018",
2509
+ 900: "#7a271a",
2510
+ 950: "#55160c"
2511
+ }, Vt = {
2512
+ accent: X,
2513
+ neutral: Z,
2514
+ danger: Q
2515
+ }, $ = {
2516
+ bg: X[700],
2517
+ text: X[100]
2518
+ }, Ht = {
2519
+ "accent-fill-bg": $.bg,
2520
+ "accent-fill-text": $.text
2521
+ }, Ut = {
2522
+ light: {
2523
+ "bg-canvas": Z[0],
2524
+ "bg-surface": Z[50],
2525
+ "bg-subtle": Z[100],
2526
+ text: Z[900],
2527
+ "text-subtle": Z[600],
2528
+ "text-inverse": Z[0],
2529
+ border: Z[200],
2530
+ "border-strong": Z[300],
2531
+ accent: X[600],
2532
+ "accent-hover": X[700],
2533
+ "accent-subtle-bg": X[50],
2534
+ "accent-subtle-text": X[700],
2535
+ ...Ht,
2536
+ danger: Q[700],
2537
+ "danger-border": Q[500],
2538
+ scrim: "rgb(0 0 0 / 0.45)",
2539
+ "accent-tint-1": X[50],
2540
+ "accent-tint-2": X[100],
2541
+ "accent-tint-3": X[200],
2542
+ "accent-tint-4": X[300],
2543
+ "accent-on-tint": X[900]
2544
+ },
2545
+ dark: {
2546
+ "bg-canvas": Z[950],
2547
+ "bg-surface": Z[900],
2548
+ "bg-subtle": Z[800],
2549
+ text: Z[50],
2550
+ "text-subtle": Z[400],
2551
+ "text-inverse": Z[950],
2552
+ border: Z[700],
2553
+ "border-strong": Z[600],
2554
+ accent: X[400],
2555
+ "accent-hover": X[300],
2556
+ "accent-subtle-bg": X[900],
2557
+ "accent-subtle-text": X[200],
2558
+ ...Ht,
2559
+ danger: Q[300],
2560
+ "danger-border": Q[400],
2561
+ scrim: "rgb(0 0 0 / 0.65)",
2562
+ "accent-tint-1": X[950],
2563
+ "accent-tint-2": X[900],
2564
+ "accent-tint-3": X[800],
2565
+ "accent-tint-4": X[700],
2566
+ "accent-on-tint": X[100]
2567
+ }
2568
+ };
2569
+ function Wt(e) {
2570
+ return `var(--color-${e})`;
2571
+ }
2572
+ function Gt(e, t) {
2573
+ return `var(--color-${e}-${String(t)})`;
2574
+ }
2575
+ //#endregion
2576
+ export { Ye as Accordion, Ze as AccordionItem, Ot as Alert, B as Avatar, ee as AvatarGroup, st as Breadcrumb, ct as BreadcrumbItem, T as Button, Fe as Checkbox, Ie as CheckboxGroup, P as Chip, me as CodeBlock, ye as Dialog, Ce as Drawer, ae as Dropdown, ce as DropdownItem, se as DropdownMenu, le as DropdownSeparator, oe as DropdownTrigger, k as EmptyState, Nt as FileDrop, te as Input, re as InputOtp, Ft as MinMaxSlider, We as Pagination, Ct as ProgressBar, Re as Radio, ze as RadioGroup, Pt as RangeSlider, zt as SegmentedControl, Me as Select, vt as Skeleton, xt as Spinner, rt as Step, et as Stepper, Lt as Switch, Rt as SwitchGroup, ht as Tab, mt as TabList, gt as TabPanel, ft as Tabs, A as Tag, C as Text, Ne as Textarea, ke as Tooltip, $ as accentFill, kt as alertVariants, V as avatarSizes, w as buttonClassNames, D as buttonSizes, E as buttonVariants, I as chipActions, F as chipVariants, Bt as colorTokens, Wt as colorVar, ue as dedentCode, xe as dialogRoles, be as dialogSizes, we as drawerSides, Te as drawerSizes, At as formatFileSize, Be as getPaginationRange, Y as isFileAccepted, H as otpTypes, Vt as palette, Gt as paletteVar, wt as progressBarSizes, De as resolveTooltipPlacement, U as sanitizeOtpValue, Ut as semanticColors, bt as skeletonAnimations, yt as skeletonVariants, St as spinnerSizes, j as tagVariants, b as textColors, y as textVariants, x as textWeights };
2577
+
2578
+ //# sourceMappingURL=sonahang-ui.js.map