@tomny-dev/uzi 0.2.4 → 0.2.6

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 (183) hide show
  1. package/dist/index.cjs +66 -2
  2. package/dist/index.js +25 -1594
  3. package/dist/index10.cjs +26 -0
  4. package/dist/index10.cjs.map +1 -0
  5. package/dist/index10.js +19 -0
  6. package/dist/index10.js.map +1 -0
  7. package/dist/index11.cjs +22 -0
  8. package/dist/index11.cjs.map +1 -0
  9. package/dist/index11.js +22 -0
  10. package/dist/index11.js.map +1 -0
  11. package/dist/index12.cjs +22 -0
  12. package/dist/index12.cjs.map +1 -0
  13. package/dist/index12.js +41 -0
  14. package/dist/index12.js.map +1 -0
  15. package/dist/index13.cjs +56 -0
  16. package/dist/index13.cjs.map +1 -0
  17. package/dist/index13.js +84 -0
  18. package/dist/index13.js.map +1 -0
  19. package/dist/index14.cjs +87 -0
  20. package/dist/index14.cjs.map +1 -0
  21. package/dist/index14.js +17 -0
  22. package/dist/index14.js.map +1 -0
  23. package/dist/index15.cjs +22 -0
  24. package/dist/index15.cjs.map +1 -0
  25. package/dist/index15.js +16 -0
  26. package/dist/index15.js.map +1 -0
  27. package/dist/index16.cjs +16 -0
  28. package/dist/index16.cjs.map +1 -0
  29. package/dist/index16.js +45 -0
  30. package/dist/index16.js.map +1 -0
  31. package/dist/index17.cjs +64 -0
  32. package/dist/index17.cjs.map +1 -0
  33. package/dist/index17.js +435 -0
  34. package/dist/index17.js.map +1 -0
  35. package/dist/index18.cjs +438 -0
  36. package/dist/index18.cjs.map +1 -0
  37. package/dist/index18.js +7 -0
  38. package/dist/index18.js.map +1 -0
  39. package/dist/index19.cjs +8 -0
  40. package/dist/index19.cjs.map +1 -0
  41. package/dist/index19.js +18 -0
  42. package/dist/index19.js.map +1 -0
  43. package/dist/index2.cjs +23 -0
  44. package/dist/index20.cjs +20 -0
  45. package/dist/index20.cjs.map +1 -0
  46. package/dist/index20.js +7 -0
  47. package/dist/index20.js.map +1 -0
  48. package/dist/index21.cjs +8 -0
  49. package/dist/index21.cjs.map +1 -0
  50. package/dist/index21.js +15 -0
  51. package/dist/index21.js.map +1 -0
  52. package/dist/index22.cjs +17 -0
  53. package/dist/index22.cjs.map +1 -0
  54. package/dist/index22.js +7 -0
  55. package/dist/index22.js.map +1 -0
  56. package/dist/index23.cjs +8 -0
  57. package/dist/index23.cjs.map +1 -0
  58. package/dist/index23.js +18 -0
  59. package/dist/index23.js.map +1 -0
  60. package/dist/index24.cjs +20 -0
  61. package/dist/index24.cjs.map +1 -0
  62. package/dist/index24.js +41 -0
  63. package/dist/index24.js.map +1 -0
  64. package/dist/index25.cjs +58 -0
  65. package/dist/index25.cjs.map +1 -0
  66. package/dist/index25.js +123 -0
  67. package/dist/index25.js.map +1 -0
  68. package/dist/index26.cjs +126 -0
  69. package/dist/index26.cjs.map +1 -0
  70. package/dist/index26.js +29 -0
  71. package/dist/index26.js.map +1 -0
  72. package/dist/index27.cjs +40 -0
  73. package/dist/index27.cjs.map +1 -0
  74. package/dist/index27.js +110 -0
  75. package/dist/index27.js.map +1 -0
  76. package/dist/index28.cjs +113 -0
  77. package/dist/index28.cjs.map +1 -0
  78. package/dist/index28.js +26 -0
  79. package/dist/index28.js.map +1 -0
  80. package/dist/index29.cjs +28 -0
  81. package/dist/index29.cjs.map +1 -0
  82. package/dist/index29.js +29 -0
  83. package/dist/index29.js.map +1 -0
  84. package/dist/index3.js +8 -0
  85. package/dist/index3.js.map +1 -0
  86. package/dist/index30.cjs +40 -0
  87. package/dist/index30.cjs.map +1 -0
  88. package/dist/index30.js +118 -0
  89. package/dist/index30.js.map +1 -0
  90. package/dist/index31.cjs +134 -0
  91. package/dist/index31.cjs.map +1 -0
  92. package/dist/index31.js +20 -0
  93. package/dist/index31.js.map +1 -0
  94. package/dist/index32.cjs +23 -0
  95. package/dist/index32.cjs.map +1 -0
  96. package/dist/index32.js +114 -0
  97. package/dist/index32.js.map +1 -0
  98. package/dist/index33.cjs +115 -0
  99. package/dist/index33.cjs.map +1 -0
  100. package/dist/index33.js +7 -0
  101. package/dist/index33.js.map +1 -0
  102. package/dist/index34.cjs +8 -0
  103. package/dist/index34.cjs.map +1 -0
  104. package/dist/index34.js +66 -0
  105. package/dist/index34.js.map +1 -0
  106. package/dist/index35.cjs +66 -0
  107. package/dist/index35.cjs.map +1 -0
  108. package/dist/index35.js +25 -0
  109. package/dist/index35.js.map +1 -0
  110. package/dist/index36.cjs +34 -0
  111. package/dist/index36.cjs.map +1 -0
  112. package/dist/index36.js +55 -0
  113. package/dist/index36.js.map +1 -0
  114. package/dist/index37.cjs +55 -0
  115. package/dist/index37.cjs.map +1 -0
  116. package/dist/index37.js +35 -0
  117. package/dist/index37.js.map +1 -0
  118. package/dist/index38.cjs +49 -0
  119. package/dist/index38.cjs.map +1 -0
  120. package/dist/index38.js +150 -0
  121. package/dist/index38.js.map +1 -0
  122. package/dist/index39.cjs +150 -0
  123. package/dist/index39.cjs.map +1 -0
  124. package/dist/index39.js +43 -0
  125. package/dist/index39.js.map +1 -0
  126. package/dist/index4.cjs +8 -0
  127. package/dist/index4.cjs.map +1 -0
  128. package/dist/index4.js +29 -0
  129. package/dist/index4.js.map +1 -0
  130. package/dist/index40.cjs +61 -0
  131. package/dist/index40.cjs.map +1 -0
  132. package/dist/index40.js +173 -0
  133. package/dist/index40.js.map +1 -0
  134. package/dist/index41.cjs +173 -0
  135. package/dist/index41.cjs.map +1 -0
  136. package/dist/index41.js +14 -0
  137. package/dist/index41.js.map +1 -0
  138. package/dist/index42.cjs +15 -0
  139. package/dist/index42.cjs.map +1 -0
  140. package/dist/index42.js +21 -0
  141. package/dist/index42.js.map +1 -0
  142. package/dist/index43.cjs +21 -0
  143. package/dist/index43.cjs.map +1 -0
  144. package/dist/index43.js +15 -0
  145. package/dist/index43.js.map +1 -0
  146. package/dist/index44.cjs +17 -0
  147. package/dist/index44.cjs.map +1 -0
  148. package/dist/index44.js +24 -0
  149. package/dist/index44.js.map +1 -0
  150. package/dist/index45.cjs +24 -0
  151. package/dist/index45.cjs.map +1 -0
  152. package/dist/index45.js +13 -0
  153. package/dist/index45.js.map +1 -0
  154. package/dist/index46.cjs +16 -0
  155. package/dist/index46.cjs.map +1 -0
  156. package/dist/index46.js +96 -0
  157. package/dist/index46.js.map +1 -0
  158. package/dist/index47.cjs +98 -0
  159. package/dist/index47.cjs.map +1 -0
  160. package/dist/index5.cjs +40 -0
  161. package/dist/index5.cjs.map +1 -0
  162. package/dist/index5.js +45 -0
  163. package/dist/index5.js.map +1 -0
  164. package/dist/index6.cjs +47 -0
  165. package/dist/index6.cjs.map +1 -0
  166. package/dist/index6.js +17 -0
  167. package/dist/index6.js.map +1 -0
  168. package/dist/index7.cjs +20 -0
  169. package/dist/index7.cjs.map +1 -0
  170. package/dist/index7.js +30 -0
  171. package/dist/index7.js.map +1 -0
  172. package/dist/index8.cjs +35 -0
  173. package/dist/index8.cjs.map +1 -0
  174. package/dist/index8.js +18 -0
  175. package/dist/index8.js.map +1 -0
  176. package/dist/index9.cjs +20 -0
  177. package/dist/index9.cjs.map +1 -0
  178. package/dist/index9.js +26 -0
  179. package/dist/index9.js.map +1 -0
  180. package/dist/style.css +2025 -1
  181. package/package.json +1 -1
  182. package/dist/index.cjs.map +0 -1
  183. package/dist/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,1594 +1,25 @@
1
- import * as e from "react";
2
- import { createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
3
- import { Slot as l } from "@radix-ui/react-slot";
4
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
5
- import * as p from "@radix-ui/react-avatar";
6
- import * as m from "@radix-ui/react-dialog";
7
- import * as h from "@radix-ui/react-toast";
8
- import * as g from "@radix-ui/react-dropdown-menu";
9
- import * as _ from "@radix-ui/react-select";
10
- //#region src/utils/cx.ts
11
- function v(...e) {
12
- return e.filter(Boolean).join(" ");
13
- }
14
- var y = {
15
- button: "uzi-button-module__button__5dzDN",
16
- sizeSm: "uzi-button-module__sizeSm__jb544",
17
- sizeMd: "uzi-button-module__sizeMd__lIo8M",
18
- sizeLg: "uzi-button-module__sizeLg__QSSuW",
19
- sizeIcon: "uzi-button-module__sizeIcon__Aa9tN",
20
- variantPrimary: "uzi-button-module__variantPrimary__zp2Pg",
21
- variantSecondary: "uzi-button-module__variantSecondary__oX5CB",
22
- variantOutline: "uzi-button-module__variantOutline__uXfiP",
23
- variantGhost: "uzi-button-module__variantGhost__-OEB8",
24
- variantDestructive: "uzi-button-module__variantDestructive__5IeYA",
25
- variantLink: "uzi-button-module__variantLink__Olx4I"
26
- }, b = {
27
- default: "variantPrimary",
28
- primary: "variantPrimary",
29
- secondary: "variantSecondary",
30
- outline: "variantOutline",
31
- ghost: "variantGhost",
32
- destructive: "variantDestructive",
33
- link: "variantLink"
34
- }, x = {
35
- default: "sizeMd",
36
- sm: "sizeSm",
37
- md: "sizeMd",
38
- lg: "sizeLg",
39
- icon: "sizeIcon"
40
- };
41
- function S({ as: e, variant: t = "default", size: n = "default", className: r, children: i, asChild: a = !1, ...o }) {
42
- let s = v(y.button, y[b[t]], y[x[n]], r);
43
- return a ? /* @__PURE__ */ d(l, {
44
- className: s,
45
- ...o,
46
- children: i
47
- }) : e === "a" ? /* @__PURE__ */ d("a", {
48
- className: s,
49
- ...o,
50
- children: i
51
- }) : /* @__PURE__ */ d("button", {
52
- type: "button",
53
- className: s,
54
- ...o,
55
- children: i
56
- });
57
- }
58
- var C = {
59
- avatar: "uzi-avatar-module__avatar__yPIOs",
60
- "size-sm": "uzi-avatar-module__size-sm__v5riJ",
61
- "size-md": "uzi-avatar-module__size-md__g7IQS",
62
- "size-lg": "uzi-avatar-module__size-lg__Ca4xk",
63
- "size-xl": "uzi-avatar-module__size-xl__K0Dfk",
64
- image: "uzi-avatar-module__image__Ngo7A",
65
- fallback: "uzi-avatar-module__fallback__Tf3oZ"
66
- };
67
- //#endregion
68
- //#region src/components/avatar/Avatar.tsx
69
- function w({ className: e, size: t = "md", ...n }) {
70
- let r = t === "sm" ? C["size-sm"] : t === "lg" ? C["size-lg"] : t === "xl" ? C["size-xl"] : C["size-md"];
71
- return /* @__PURE__ */ d(p.Root, {
72
- className: v(C.avatar, r, e),
73
- ...n
74
- });
75
- }
76
- function T({ className: e, ...t }) {
77
- return /* @__PURE__ */ d(p.Image, {
78
- className: v(C.image, e),
79
- ...t
80
- });
81
- }
82
- function E({ className: e, ...t }) {
83
- return /* @__PURE__ */ d(p.Fallback, {
84
- className: v(C.fallback, e),
85
- ...t
86
- });
87
- }
88
- var D = {
89
- card: "uzi-card-module__card__ZPFTz",
90
- "tone-default": "uzi-card-module__tone-default__7Ujf9",
91
- "tone-muted": "uzi-card-module__tone-muted__RQy5B",
92
- "tone-contrast": "uzi-card-module__tone-contrast__JpFxL",
93
- interactive: "uzi-card-module__interactive__zlPML",
94
- "padding-none": "uzi-card-module__padding-none__LXdx-",
95
- "padding-sm": "uzi-card-module__padding-sm__-Ub1s",
96
- "padding-md": "uzi-card-module__padding-md__kUf46",
97
- "padding-lg": "uzi-card-module__padding-lg__a5mWP"
98
- };
99
- //#endregion
100
- //#region src/components/card/Card.tsx
101
- function O({ as: e, tone: t = "default", padding: n = "md", interactive: r = !1, className: i, children: a, ...o }) {
102
- let s = e ?? "div", c = {
103
- default: null,
104
- muted: "tone-muted",
105
- contrast: "tone-contrast"
106
- };
107
- return /* @__PURE__ */ d(s, {
108
- className: v(D.card, c[t] ? D[c[t]] : null, D[{
109
- none: "padding-none",
110
- sm: "padding-sm",
111
- md: "padding-md",
112
- lg: "padding-lg"
113
- }[n]], r && D.interactive, i),
114
- ...o,
115
- children: a
116
- });
117
- }
118
- var k = {
119
- pill: "uzi-pill-module__pill__uCKcP",
120
- "size-sm": "uzi-pill-module__size-sm__JANOQ",
121
- "size-md": "uzi-pill-module__size-md__fdsqR",
122
- "tone-success": "uzi-pill-module__tone-success__kW2Kf",
123
- "tone-warning": "uzi-pill-module__tone-warning__Rc5-s",
124
- "tone-info": "uzi-pill-module__tone-info__0vQrj",
125
- "tone-danger": "uzi-pill-module__tone-danger__gzNOa",
126
- icon: "uzi-pill-module__icon__KQ8zg",
127
- content: "uzi-pill-module__content__T7AG1"
128
- };
129
- //#endregion
130
- //#region src/components/pill/Pill.tsx
131
- function A({ as: e, tone: t = "neutral", size: n = "md", icon: r, className: i, children: a, ...o }) {
132
- return /* @__PURE__ */ f(e ?? "span", {
133
- className: v(k.pill, k[`tone-${t}`], k[`size-${n}`], i),
134
- ...o,
135
- children: [r ? /* @__PURE__ */ d("span", {
136
- className: k.icon,
137
- "aria-hidden": "true",
138
- children: r
139
- }) : null, /* @__PURE__ */ d("span", {
140
- className: k.content,
141
- children: a
142
- })]
143
- });
144
- }
145
- var j = {
146
- portalLayer: "uzi-modal-module__portalLayer__t7blc",
147
- backdrop: "uzi-modal-module__backdrop__IMd3b",
148
- backdropFadeIn: "uzi-modal-module__backdropFadeIn__GNJdx",
149
- backdropFadeOut: "uzi-modal-module__backdropFadeOut__R-3K5",
150
- overlayContent: "uzi-modal-module__overlayContent__0DtbP",
151
- modalContentIn: "uzi-modal-module__modalContentIn__fub8M",
152
- modalContentOut: "uzi-modal-module__modalContentOut__elTJ3",
153
- modal: "uzi-modal-module__modal__Mao59",
154
- "size-sm": "uzi-modal-module__size-sm__Uu9je",
155
- "size-md": "uzi-modal-module__size-md__TiiWy",
156
- "size-lg": "uzi-modal-module__size-lg__BrTIO",
157
- "size-xl": "uzi-modal-module__size-xl__sj0mh",
158
- header: "uzi-modal-module__header__PmCaO",
159
- titles: "uzi-modal-module__titles__IboyQ",
160
- title: "uzi-modal-module__title__Zd7pL",
161
- subtitle: "uzi-modal-module__subtitle__t-LRK",
162
- closeButton: "uzi-modal-module__closeButton__GTiZr",
163
- body: "uzi-modal-module__body__km6FQ",
164
- footer: "uzi-modal-module__footer__jWLTv"
165
- };
166
- //#endregion
167
- //#region src/components/modal/Modal.tsx
168
- function M({ open: e, onClose: t, className: n, children: r }) {
169
- return /* @__PURE__ */ d(m.Root, {
170
- open: e,
171
- onOpenChange: (e) => {
172
- e || t();
173
- },
174
- children: /* @__PURE__ */ d(m.Portal, { children: /* @__PURE__ */ f("div", {
175
- className: j.portalLayer,
176
- children: [/* @__PURE__ */ d(m.Overlay, { className: v(j.backdrop, n) }), /* @__PURE__ */ d(m.Content, {
177
- className: j.overlayContent,
178
- children: r
179
- })]
180
- }) })
181
- });
182
- }
183
- function N({ open: e, onClose: t, title: n, subtitle: r, size: i = "md", children: a, footer: o }) {
184
- return /* @__PURE__ */ d(M, {
185
- open: e,
186
- onClose: t,
187
- children: /* @__PURE__ */ f("div", {
188
- className: v(j.modal, j[`size-${i}`]),
189
- children: [
190
- /* @__PURE__ */ f("div", {
191
- className: j.header,
192
- children: [/* @__PURE__ */ f("div", {
193
- className: j.titles,
194
- children: [/* @__PURE__ */ d(m.Title, {
195
- className: j.title,
196
- children: n
197
- }), r ? /* @__PURE__ */ d(m.Description, {
198
- className: j.subtitle,
199
- children: r
200
- }) : null]
201
- }), /* @__PURE__ */ d(m.Close, {
202
- asChild: !0,
203
- children: /* @__PURE__ */ d("button", {
204
- className: j.closeButton,
205
- "aria-label": "Close",
206
- children: /* @__PURE__ */ f("svg", {
207
- width: "14",
208
- height: "14",
209
- viewBox: "0 0 24 24",
210
- fill: "none",
211
- stroke: "currentColor",
212
- strokeWidth: "2.5",
213
- strokeLinecap: "round",
214
- strokeLinejoin: "round",
215
- children: [/* @__PURE__ */ d("line", {
216
- x1: "18",
217
- y1: "6",
218
- x2: "6",
219
- y2: "18"
220
- }), /* @__PURE__ */ d("line", {
221
- x1: "6",
222
- y1: "6",
223
- x2: "18",
224
- y2: "18"
225
- })]
226
- })
227
- })
228
- })]
229
- }),
230
- /* @__PURE__ */ d("div", {
231
- className: j.body,
232
- children: a
233
- }),
234
- o && /* @__PURE__ */ d("div", {
235
- className: j.footer,
236
- children: o
237
- })
238
- ]
239
- })
240
- });
241
- }
242
- var P = {
243
- alert: "uzi-alert-module__alert__7Bt6c",
244
- success: "uzi-alert-module__success__apdFG",
245
- error: "uzi-alert-module__error__KLgi1",
246
- warning: "uzi-alert-module__warning__F4fpk",
247
- info: "uzi-alert-module__info__1IKHt"
248
- };
249
- //#endregion
250
- //#region src/components/alert/Alert.tsx
251
- function F({ tone: e, children: t, className: n }) {
252
- return /* @__PURE__ */ d("div", {
253
- className: v(P.alert, P[e], n),
254
- role: "alert",
255
- children: t
256
- });
257
- }
258
- var I = {
259
- stack: "uzi-toast-module__stack__SRrda",
260
- topRight: "uzi-toast-module__topRight__WiZzM",
261
- topLeft: "uzi-toast-module__topLeft__SzFS9",
262
- topCenter: "uzi-toast-module__topCenter__X5W-x",
263
- bottomRight: "uzi-toast-module__bottomRight__DMtoS",
264
- bottomLeft: "uzi-toast-module__bottomLeft__ZZ7VF",
265
- bottomCenter: "uzi-toast-module__bottomCenter__QNJrM",
266
- toast: "uzi-toast-module__toast__HNUcj",
267
- toastSlideIn: "uzi-toast-module__toastSlideIn__BTXfm",
268
- toastSlideOut: "uzi-toast-module__toastSlideOut__mBX-G",
269
- toastSwipeOut: "uzi-toast-module__toastSwipeOut__R-jk2",
270
- icon: "uzi-toast-module__icon__LIAqr",
271
- body: "uzi-toast-module__body__9vzs7",
272
- message: "uzi-toast-module__message__TBY65",
273
- actions: "uzi-toast-module__actions__Iykd9",
274
- actionButton: "uzi-toast-module__actionButton__cvUr0",
275
- controls: "uzi-toast-module__controls__LqA4Q",
276
- iconButton: "uzi-toast-module__iconButton__FOsOp",
277
- iconButtonError: "uzi-toast-module__iconButtonError__NJsLX"
278
- }, L = {
279
- position: "top-right",
280
- maxToasts: 5,
281
- defaultDuration: 4e3,
282
- pauseOnHover: !0,
283
- pauseOnFocusLoss: !0
284
- }, R = t(void 0), z = 0, B = () => `toast-${++z}-${Date.now()}`;
285
- function V({ children: e, config: t }) {
286
- let [r, a] = c([]), [s, l] = c(!1), u = o(() => ({
287
- ...L,
288
- ...t
289
- }), [t]), p = n((e, t = {}) => {
290
- let n = B();
291
- return a((r) => {
292
- let i = [...r, {
293
- id: n,
294
- message: e,
295
- type: t.type ?? "info",
296
- duration: t.duration ?? (t.type === "error" ? 6e3 : u.defaultDuration),
297
- dismissible: t.dismissible ?? !0,
298
- copyable: t.copyable ?? !1,
299
- action: t.action
300
- }];
301
- return i.length > u.maxToasts && i.shift(), i;
302
- }), n;
303
- }, [u.defaultDuration, u.maxToasts]), m = n((e, t) => p(e, {
304
- ...t,
305
- type: "success"
306
- }), [p]), g = n((e, t) => p(e, {
307
- copyable: !0,
308
- ...t,
309
- type: "error"
310
- }), [p]), _ = n((e, t) => p(e, {
311
- ...t,
312
- type: "warning"
313
- }), [p]), v = n((e, t) => p(e, {
314
- ...t,
315
- type: "info"
316
- }), [p]), y = n((e) => {
317
- a((t) => t.filter((t) => t.id !== e));
318
- }, []), b = n(() => a([]), []);
319
- i(() => {
320
- if (!u.pauseOnFocusLoss) return;
321
- let e = () => l(document.visibilityState !== "visible");
322
- return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
323
- }, [u.pauseOnFocusLoss]);
324
- let x = o(() => ({
325
- toasts: r,
326
- push: p,
327
- success: m,
328
- error: g,
329
- warning: _,
330
- info: v,
331
- dismiss: y,
332
- dismissAll: b
333
- }), [
334
- r,
335
- p,
336
- m,
337
- g,
338
- _,
339
- v,
340
- y,
341
- b
342
- ]);
343
- return /* @__PURE__ */ d(R.Provider, {
344
- value: x,
345
- children: /* @__PURE__ */ f(h.Provider, {
346
- swipeDirection: "right",
347
- children: [e, /* @__PURE__ */ d(te, {
348
- toasts: r,
349
- position: u.position,
350
- pauseOnHover: u.pauseOnHover,
351
- isPaused: s,
352
- onDismiss: y,
353
- onPauseChange: l
354
- })]
355
- })
356
- });
357
- }
358
- function ee() {
359
- let e = r(R);
360
- if (!e) throw Error("useToast must be used within a ToastProvider");
361
- return e;
362
- }
363
- function te({ toasts: e, position: t, pauseOnHover: n, isPaused: r, onDismiss: i, onPauseChange: a }) {
364
- let o = (() => {
365
- switch (t) {
366
- case "top-left": return "topLeft";
367
- case "top-center": return "topCenter";
368
- case "bottom-right": return "bottomRight";
369
- case "bottom-left": return "bottomLeft";
370
- case "bottom-center": return "bottomCenter";
371
- default: return "topRight";
372
- }
373
- })();
374
- return /* @__PURE__ */ f(u, { children: [e.map((e) => /* @__PURE__ */ d(ne, {
375
- toast: e,
376
- isPaused: r,
377
- onDismiss: i
378
- }, e.id)), /* @__PURE__ */ d(h.Viewport, {
379
- className: v(I.stack, I[o]),
380
- label: "Notifications",
381
- onMouseEnter: () => n && a(!0),
382
- onMouseLeave: () => n && a(!1)
383
- })] });
384
- }
385
- function ne({ toast: e, isPaused: t, onDismiss: r }) {
386
- let [a, o] = c(!0), [l, u] = c("idle"), p = s(null), m = s(null), g = s(0), _ = s(e.duration ?? 0), y = s(!1), b = re(e.type), x = {
387
- "--toast-bg": b.background,
388
- "--toast-border": b.border,
389
- "--toast-accent": b.accent,
390
- "--toast-text": b.text,
391
- "--toast-action-bg": b.actionBg,
392
- "--toast-action-border": b.actionBorder
393
- }, S = () => {
394
- m.current &&= (window.clearTimeout(m.current), null);
395
- }, C = n(() => {
396
- y.current || (y.current = !0, o(!1), S(), window.setTimeout(() => r(e.id), 160));
397
- }, [r, e.id]), w = n((e) => {
398
- if (!e || e <= 0) {
399
- C();
400
- return;
401
- }
402
- g.current = performance.now(), S(), m.current = window.setTimeout(() => C(), e);
403
- }, [C]);
404
- i(() => {
405
- if (!(!e.duration || e.duration <= 0)) return w(e.duration), S;
406
- }, [w, e.duration]), i(() => {
407
- if (!(!e.duration || e.duration <= 0)) if (t) {
408
- let e = performance.now() - g.current;
409
- _.current = Math.max(0, _.current - e), S();
410
- } else w(_.current);
411
- }, [
412
- t,
413
- w,
414
- e.duration
415
- ]), i(() => () => {
416
- p.current && window.clearTimeout(p.current);
417
- }, []);
418
- let T = n(async () => {
419
- p.current && window.clearTimeout(p.current);
420
- try {
421
- if (!navigator.clipboard) throw Error("Clipboard API unavailable");
422
- await navigator.clipboard.writeText(e.message), u("copied");
423
- } catch {
424
- u("failed");
425
- }
426
- p.current = window.setTimeout(() => u("idle"), 1800);
427
- }, [e.message]), E = ie(e.type);
428
- return /* @__PURE__ */ f(h.Root, {
429
- open: a,
430
- onOpenChange: (e) => {
431
- e || C();
432
- },
433
- duration: 2147483647,
434
- className: I.toast,
435
- style: x,
436
- children: [
437
- /* @__PURE__ */ d("span", {
438
- className: I.icon,
439
- "aria-hidden": !0,
440
- children: E
441
- }),
442
- /* @__PURE__ */ f("div", {
443
- className: I.body,
444
- children: [/* @__PURE__ */ d(h.Description, {
445
- className: I.message,
446
- children: e.message
447
- }), e.action && /* @__PURE__ */ d("div", {
448
- className: I.actions,
449
- children: /* @__PURE__ */ d(h.Action, {
450
- asChild: !0,
451
- altText: e.action.label,
452
- children: /* @__PURE__ */ d("button", {
453
- type: "button",
454
- className: I.actionButton,
455
- onClick: () => {
456
- e.action?.onClick(), C();
457
- },
458
- children: e.action.label
459
- })
460
- })
461
- })]
462
- }),
463
- /* @__PURE__ */ f("div", {
464
- className: I.controls,
465
- children: [e.copyable && /* @__PURE__ */ d("button", {
466
- type: "button",
467
- className: v(I.iconButton, l === "failed" && I.iconButtonError),
468
- "aria-label": "Copy message",
469
- onClick: T,
470
- children: l === "copied" ? /* @__PURE__ */ d("svg", {
471
- width: "13",
472
- height: "13",
473
- viewBox: "0 0 13 13",
474
- fill: "none",
475
- "aria-hidden": !0,
476
- children: /* @__PURE__ */ d("path", {
477
- d: "M2 6.5l3 3 6-6",
478
- stroke: "currentColor",
479
- strokeWidth: "1.5",
480
- strokeLinecap: "round",
481
- strokeLinejoin: "round"
482
- })
483
- }) : l === "failed" ? /* @__PURE__ */ d("svg", {
484
- width: "13",
485
- height: "13",
486
- viewBox: "0 0 13 13",
487
- fill: "none",
488
- "aria-hidden": !0,
489
- children: /* @__PURE__ */ d("path", {
490
- d: "M10 3L3 10M3 3l7 7",
491
- stroke: "currentColor",
492
- strokeWidth: "1.5",
493
- strokeLinecap: "round"
494
- })
495
- }) : /* @__PURE__ */ f("svg", {
496
- width: "13",
497
- height: "13",
498
- viewBox: "0 0 13 13",
499
- fill: "none",
500
- "aria-hidden": !0,
501
- children: [/* @__PURE__ */ d("rect", {
502
- x: "4.5",
503
- y: "1.5",
504
- width: "7",
505
- height: "7",
506
- rx: "1.5",
507
- stroke: "currentColor",
508
- strokeWidth: "1.25"
509
- }), /* @__PURE__ */ d("path", {
510
- d: "M1.5 5.5v5a1.5 1.5 0 001.5 1.5h5",
511
- stroke: "currentColor",
512
- strokeWidth: "1.25",
513
- strokeLinecap: "round"
514
- })]
515
- })
516
- }), e.dismissible !== !1 && /* @__PURE__ */ d(h.Close, {
517
- asChild: !0,
518
- children: /* @__PURE__ */ d("button", {
519
- type: "button",
520
- className: I.iconButton,
521
- "aria-label": "Dismiss notification",
522
- children: /* @__PURE__ */ d("svg", {
523
- width: "13",
524
- height: "13",
525
- viewBox: "0 0 13 13",
526
- fill: "none",
527
- "aria-hidden": !0,
528
- children: /* @__PURE__ */ d("path", {
529
- d: "M10 3L3 10M3 3l7 7",
530
- stroke: "currentColor",
531
- strokeWidth: "1.5",
532
- strokeLinecap: "round"
533
- })
534
- })
535
- })
536
- })]
537
- })
538
- ]
539
- });
540
- }
541
- function re(e) {
542
- switch (e) {
543
- case "success": return {
544
- background: "color-mix(in srgb, var(--success) 12%, var(--popover))",
545
- border: "color-mix(in srgb, var(--success) 30%, transparent)",
546
- accent: "var(--success)",
547
- text: "var(--popover-foreground)",
548
- actionBg: "color-mix(in srgb, var(--success) 14%, transparent)",
549
- actionBorder: "color-mix(in srgb, var(--success) 35%, transparent)"
550
- };
551
- case "error": return {
552
- background: "color-mix(in srgb, var(--destructive) 12%, var(--popover))",
553
- border: "color-mix(in srgb, var(--destructive) 30%, transparent)",
554
- accent: "var(--destructive)",
555
- text: "var(--popover-foreground)",
556
- actionBg: "color-mix(in srgb, var(--destructive) 14%, transparent)",
557
- actionBorder: "color-mix(in srgb, var(--destructive) 35%, transparent)"
558
- };
559
- case "warning": return {
560
- background: "color-mix(in srgb, var(--warning) 12%, var(--popover))",
561
- border: "color-mix(in srgb, var(--warning) 30%, transparent)",
562
- accent: "var(--warning)",
563
- text: "var(--popover-foreground)",
564
- actionBg: "color-mix(in srgb, var(--warning) 14%, transparent)",
565
- actionBorder: "color-mix(in srgb, var(--warning) 35%, transparent)"
566
- };
567
- default: return {
568
- background: "color-mix(in srgb, var(--primary) 12%, var(--popover))",
569
- border: "color-mix(in srgb, var(--primary) 30%, transparent)",
570
- accent: "var(--primary)",
571
- text: "var(--popover-foreground)",
572
- actionBg: "color-mix(in srgb, var(--primary) 14%, transparent)",
573
- actionBorder: "color-mix(in srgb, var(--primary) 35%, transparent)"
574
- };
575
- }
576
- }
577
- function ie(e) {
578
- switch (e) {
579
- case "success": return /* @__PURE__ */ d("svg", {
580
- width: "16",
581
- height: "16",
582
- viewBox: "0 0 16 16",
583
- fill: "none",
584
- "aria-hidden": !0,
585
- children: /* @__PURE__ */ d("path", {
586
- d: "M3 8l3.5 3.5L13 4.5",
587
- stroke: "currentColor",
588
- strokeWidth: "1.75",
589
- strokeLinecap: "round",
590
- strokeLinejoin: "round"
591
- })
592
- });
593
- case "error": return /* @__PURE__ */ d("svg", {
594
- width: "16",
595
- height: "16",
596
- viewBox: "0 0 16 16",
597
- fill: "none",
598
- "aria-hidden": !0,
599
- children: /* @__PURE__ */ d("path", {
600
- d: "M4 4l8 8M12 4l-8 8",
601
- stroke: "currentColor",
602
- strokeWidth: "1.75",
603
- strokeLinecap: "round"
604
- })
605
- });
606
- case "warning": return /* @__PURE__ */ d("svg", {
607
- width: "16",
608
- height: "16",
609
- viewBox: "0 0 16 16",
610
- fill: "none",
611
- "aria-hidden": !0,
612
- children: /* @__PURE__ */ d("path", {
613
- d: "M8 3v6M8 11.5v1",
614
- stroke: "currentColor",
615
- strokeWidth: "1.75",
616
- strokeLinecap: "round"
617
- })
618
- });
619
- default: return /* @__PURE__ */ d("svg", {
620
- width: "16",
621
- height: "16",
622
- viewBox: "0 0 16 16",
623
- fill: "none",
624
- "aria-hidden": !0,
625
- children: /* @__PURE__ */ d("path", {
626
- d: "M8 7v5M8 4.5v.5",
627
- stroke: "currentColor",
628
- strokeWidth: "1.75",
629
- strokeLinecap: "round"
630
- })
631
- });
632
- }
633
- }
634
- var ae = { input: "uzi-input-module__input__-ipHD" }, H = e.forwardRef(({ className: e, type: t, ...n }, r) => /* @__PURE__ */ d("input", {
635
- ref: r,
636
- type: t,
637
- className: v(ae.input, e),
638
- ...n
639
- }));
640
- H.displayName = "Input";
641
- var oe = { label: "uzi-label-module__label__gKflt" }, U = e.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d("label", {
642
- ref: n,
643
- className: v(oe.label, e),
644
- ...t
645
- }));
646
- U.displayName = "Label";
647
- var se = { checkbox: "uzi-checkbox-module__checkbox__zAB1y" }, W = e.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d("input", {
648
- ref: n,
649
- type: "checkbox",
650
- className: v(se.checkbox, e),
651
- ...t
652
- }));
653
- W.displayName = "Checkbox";
654
- var G = {
655
- wrapper: "uzi-multi-select-module__wrapper__Izj2x",
656
- wrapperFullWidth: "uzi-multi-select-module__wrapperFullWidth__eH8pf",
657
- trigger: "uzi-multi-select-module__trigger__r3816",
658
- value: "uzi-multi-select-module__value__PuUmG",
659
- placeholder: "uzi-multi-select-module__placeholder__dJIU-",
660
- chip: "uzi-multi-select-module__chip__46Ms-",
661
- chipSummary: "uzi-multi-select-module__chipSummary__zLwi8",
662
- chevron: "uzi-multi-select-module__chevron__SWK5l",
663
- menu: "uzi-multi-select-module__menu__q8auA",
664
- menuFadeIn: "uzi-multi-select-module__menuFadeIn__Plo7-",
665
- option: "uzi-multi-select-module__option__-Ioqk",
666
- optionDisabled: "uzi-multi-select-module__optionDisabled__qtCi8",
667
- optionSelected: "uzi-multi-select-module__optionSelected__74IO8",
668
- optionLabel: "uzi-multi-select-module__optionLabel__cVoN7",
669
- indicator: "uzi-multi-select-module__indicator__NO-WE",
670
- indicatorSelected: "uzi-multi-select-module__indicatorSelected__9sEAy",
671
- indicatorDisabled: "uzi-multi-select-module__indicatorDisabled__vqdiH"
672
- }, ce = e.forwardRef(({ options: t, value: n, onChange: r, placeholder: i = "Select options", fullWidth: a = !0, maxVisibleValues: o = 2, className: s, disabled: c = !1, name: l, "aria-label": p, "aria-labelledby": m }, h) => {
673
- let _ = e.useMemo(() => new Set(n), [n]), y = e.useMemo(() => t.filter((e) => _.has(e.value)), [t, _]), b = e.useCallback((e) => {
674
- if (_.has(e)) {
675
- r(n.filter((t) => t !== e));
676
- return;
677
- }
678
- r([...n, e]);
679
- }, [
680
- r,
681
- _,
682
- n
683
- ]), x = Math.max(1, o), S = y.slice(0, x), C = Math.max(0, y.length - S.length);
684
- return /* @__PURE__ */ d(g.Root, {
685
- modal: !1,
686
- children: /* @__PURE__ */ f("div", {
687
- className: v(G.wrapper, a && G.wrapperFullWidth, s),
688
- children: [
689
- /* @__PURE__ */ d(g.Trigger, {
690
- asChild: !0,
691
- children: /* @__PURE__ */ f("button", {
692
- ref: h,
693
- type: "button",
694
- className: G.trigger,
695
- "aria-label": p,
696
- "aria-labelledby": m,
697
- disabled: c,
698
- children: [/* @__PURE__ */ d("span", {
699
- className: G.value,
700
- children: y.length === 0 ? /* @__PURE__ */ d("span", {
701
- className: G.placeholder,
702
- children: i
703
- }) : /* @__PURE__ */ f(u, { children: [S.map((e) => /* @__PURE__ */ d("span", {
704
- className: G.chip,
705
- children: e.label
706
- }, e.value)), C > 0 ? /* @__PURE__ */ f("span", {
707
- className: v(G.chip, G.chipSummary),
708
- children: ["+", C]
709
- }) : null] })
710
- }), /* @__PURE__ */ d("span", {
711
- className: G.chevron,
712
- "aria-hidden": "true",
713
- children: /* @__PURE__ */ d("svg", {
714
- viewBox: "0 0 10 10",
715
- fill: "none",
716
- xmlns: "http://www.w3.org/2000/svg",
717
- width: "10",
718
- height: "10",
719
- children: /* @__PURE__ */ d("path", {
720
- d: "M2 3.5L5 6.5L8 3.5",
721
- stroke: "currentColor",
722
- strokeWidth: "1.5",
723
- strokeLinecap: "round",
724
- strokeLinejoin: "round"
725
- })
726
- })
727
- })]
728
- })
729
- }),
730
- l ? n.map((e) => /* @__PURE__ */ d("input", {
731
- type: "hidden",
732
- name: l,
733
- value: e
734
- }, e)) : null,
735
- /* @__PURE__ */ d(g.Portal, { children: /* @__PURE__ */ d(g.Content, {
736
- className: G.menu,
737
- sideOffset: 4,
738
- align: "start",
739
- children: t.map((e) => {
740
- let t = _.has(e.value);
741
- return /* @__PURE__ */ f(g.CheckboxItem, {
742
- className: v(G.option, t && G.optionSelected, e.disabled && G.optionDisabled),
743
- checked: t,
744
- disabled: e.disabled,
745
- onCheckedChange: () => b(e.value),
746
- onSelect: (e) => e.preventDefault(),
747
- children: [/* @__PURE__ */ d("span", {
748
- className: v(G.indicator, t && G.indicatorSelected, e.disabled && G.indicatorDisabled),
749
- "aria-hidden": "true",
750
- children: /* @__PURE__ */ d(g.ItemIndicator, {
751
- forceMount: !0,
752
- children: /* @__PURE__ */ d("svg", {
753
- viewBox: "0 0 16 16",
754
- width: "16",
755
- height: "16",
756
- fill: "none",
757
- xmlns: "http://www.w3.org/2000/svg",
758
- children: /* @__PURE__ */ d("path", {
759
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
760
- stroke: "currentColor",
761
- strokeWidth: "1.8",
762
- strokeLinecap: "round",
763
- strokeLinejoin: "round"
764
- })
765
- })
766
- })
767
- }), /* @__PURE__ */ d("span", {
768
- className: G.optionLabel,
769
- children: e.label
770
- })]
771
- }, e.value);
772
- })
773
- }) })
774
- ]
775
- })
776
- });
777
- });
778
- ce.displayName = "MultiSelect";
779
- var K = {
780
- wrapper: "uzi-select-module__wrapper__7szq0",
781
- wrapperFullWidth: "uzi-select-module__wrapperFullWidth__IyOIG",
782
- trigger: "uzi-select-module__trigger__ldh8w",
783
- value: "uzi-select-module__value__FTUJh",
784
- chevron: "uzi-select-module__chevron__U6HXS",
785
- content: "uzi-select-module__content__pOWWy",
786
- selectFadeIn: "uzi-select-module__selectFadeIn__Z-yKX",
787
- viewport: "uzi-select-module__viewport__VGZM6",
788
- item: "uzi-select-module__item__6uM6-",
789
- indicator: "uzi-select-module__indicator__ZHcg5",
790
- indicatorIcon: "uzi-select-module__indicatorIcon__kOV2G"
791
- }, le = "__uzi_select_empty__", q = e.forwardRef(({ options: e, value: t, onChange: n, placeholder: r, allowEmptyOption: i = !1, fullWidth: a = !0, className: o, id: s, name: c, disabled: l, required: u, autoComplete: p, form: m, title: h, "aria-label": g, "aria-labelledby": y, onBlur: b, onFocus: x }, S) => /* @__PURE__ */ d("div", {
792
- className: v(K.wrapper, a && K.wrapperFullWidth, o),
793
- children: /* @__PURE__ */ f(_.Root, {
794
- value: t,
795
- onValueChange: (e) => n(e === le ? "" : e),
796
- name: c,
797
- disabled: l,
798
- required: u,
799
- autoComplete: p,
800
- form: m,
801
- children: [/* @__PURE__ */ f(_.Trigger, {
802
- ref: S,
803
- id: s,
804
- className: K.trigger,
805
- title: h,
806
- "aria-label": g,
807
- "aria-labelledby": y,
808
- onBlur: b,
809
- onFocus: x,
810
- children: [/* @__PURE__ */ d(_.Value, {
811
- className: K.value,
812
- placeholder: r
813
- }), /* @__PURE__ */ d(_.Icon, {
814
- className: K.chevron,
815
- "aria-hidden": "true",
816
- children: /* @__PURE__ */ d("svg", {
817
- viewBox: "0 0 10 10",
818
- fill: "none",
819
- xmlns: "http://www.w3.org/2000/svg",
820
- width: "10",
821
- height: "10",
822
- children: /* @__PURE__ */ d("path", {
823
- d: "M2 3.5L5 6.5L8 3.5",
824
- stroke: "currentColor",
825
- strokeWidth: "1.5",
826
- strokeLinecap: "round",
827
- strokeLinejoin: "round"
828
- })
829
- })
830
- })]
831
- }), /* @__PURE__ */ d(_.Portal, { children: /* @__PURE__ */ d(_.Content, {
832
- className: K.content,
833
- position: "popper",
834
- sideOffset: 4,
835
- align: "start",
836
- children: /* @__PURE__ */ f(_.Viewport, {
837
- className: K.viewport,
838
- children: [r && i ? /* @__PURE__ */ f(_.Item, {
839
- value: le,
840
- className: K.item,
841
- children: [/* @__PURE__ */ d("span", {
842
- className: K.indicator,
843
- children: /* @__PURE__ */ d(_.ItemIndicator, { children: /* @__PURE__ */ d("svg", {
844
- viewBox: "0 0 16 16",
845
- width: "16",
846
- height: "16",
847
- "aria-hidden": "true",
848
- className: K.indicatorIcon,
849
- children: /* @__PURE__ */ d("path", {
850
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
851
- fill: "none",
852
- stroke: "currentColor",
853
- strokeWidth: "1.8",
854
- strokeLinecap: "round",
855
- strokeLinejoin: "round"
856
- })
857
- }) })
858
- }), /* @__PURE__ */ d(_.ItemText, { children: r })]
859
- }) : null, e.map((e) => /* @__PURE__ */ f(_.Item, {
860
- value: e.value,
861
- disabled: e.disabled,
862
- className: K.item,
863
- children: [/* @__PURE__ */ d("span", {
864
- className: K.indicator,
865
- children: /* @__PURE__ */ d(_.ItemIndicator, { children: /* @__PURE__ */ d("svg", {
866
- viewBox: "0 0 16 16",
867
- width: "16",
868
- height: "16",
869
- "aria-hidden": "true",
870
- className: K.indicatorIcon,
871
- children: /* @__PURE__ */ d("path", {
872
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
873
- fill: "none",
874
- stroke: "currentColor",
875
- strokeWidth: "1.8",
876
- strokeLinecap: "round",
877
- strokeLinejoin: "round"
878
- })
879
- }) })
880
- }), /* @__PURE__ */ d(_.ItemText, { children: e.label })]
881
- }, e.value))]
882
- })
883
- }) })]
884
- })
885
- }));
886
- q.displayName = "Select";
887
- //#endregion
888
- //#region src/components/dropdown/Dropdown.tsx
889
- var ue = e.forwardRef(({ options: e, value: t, onChange: n, placeholder: r = "All", allowClear: i = !0, ...a }, o) => /* @__PURE__ */ d(q, {
890
- ref: o,
891
- options: e,
892
- value: t,
893
- onChange: n,
894
- placeholder: r,
895
- allowEmptyOption: i,
896
- fullWidth: !1,
897
- ...a
898
- }));
899
- ue.displayName = "Dropdown";
900
- var J = {
901
- content: "uzi-dropdown-menu-module__content__n-ElH",
902
- menuFadeIn: "uzi-dropdown-menu-module__menuFadeIn__ITxMo",
903
- item: "uzi-dropdown-menu-module__item__tBNtW",
904
- itemDestructive: "uzi-dropdown-menu-module__itemDestructive__oWmKd",
905
- insetItem: "uzi-dropdown-menu-module__insetItem__g7ONJ",
906
- indicator: "uzi-dropdown-menu-module__indicator__5qwFh",
907
- indicatorIcon: "uzi-dropdown-menu-module__indicatorIcon__nhJMw",
908
- radioDot: "uzi-dropdown-menu-module__radioDot__GWUVT",
909
- label: "uzi-dropdown-menu-module__label__sFnNR",
910
- separator: "uzi-dropdown-menu-module__separator__PgUob",
911
- chevron: "uzi-dropdown-menu-module__chevron__kxfiF"
912
- };
913
- //#endregion
914
- //#region src/components/dropdown-menu/DropdownMenu.tsx
915
- function de(e) {
916
- return /* @__PURE__ */ d(g.Root, { ...e });
917
- }
918
- function fe(e) {
919
- return /* @__PURE__ */ d(g.Trigger, { ...e });
920
- }
921
- function pe(e) {
922
- return /* @__PURE__ */ d(g.Group, { ...e });
923
- }
924
- function me(e) {
925
- return /* @__PURE__ */ d(g.Portal, { ...e });
926
- }
927
- function he(e) {
928
- return /* @__PURE__ */ d(g.Sub, { ...e });
929
- }
930
- function ge(e) {
931
- return /* @__PURE__ */ d(g.RadioGroup, { ...e });
932
- }
933
- function _e({ className: e, sideOffset: t = 4, ...n }) {
934
- return /* @__PURE__ */ d(g.Portal, { children: /* @__PURE__ */ d(g.Content, {
935
- sideOffset: t,
936
- className: v(J.content, e),
937
- ...n
938
- }) });
939
- }
940
- function ve({ className: e, inset: t, variant: n = "default", ...r }) {
941
- return /* @__PURE__ */ d(g.Item, {
942
- "data-inset": t ? "true" : void 0,
943
- className: v(J.item, n === "destructive" && J.itemDestructive, e),
944
- ...r
945
- });
946
- }
947
- function ye({ className: e, children: t, ...n }) {
948
- return /* @__PURE__ */ f(g.CheckboxItem, {
949
- className: v(J.item, J.insetItem, e),
950
- ...n,
951
- children: [/* @__PURE__ */ d("span", {
952
- className: J.indicator,
953
- children: /* @__PURE__ */ d(g.ItemIndicator, { children: /* @__PURE__ */ d("svg", {
954
- viewBox: "0 0 16 16",
955
- width: "16",
956
- height: "16",
957
- "aria-hidden": "true",
958
- className: J.indicatorIcon,
959
- children: /* @__PURE__ */ d("path", {
960
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
961
- fill: "none",
962
- stroke: "currentColor",
963
- strokeWidth: "1.8",
964
- strokeLinecap: "round",
965
- strokeLinejoin: "round"
966
- })
967
- }) })
968
- }), t]
969
- });
970
- }
971
- function be({ className: e, children: t, ...n }) {
972
- return /* @__PURE__ */ f(g.RadioItem, {
973
- className: v(J.item, J.insetItem, e),
974
- ...n,
975
- children: [/* @__PURE__ */ d("span", {
976
- className: J.indicator,
977
- children: /* @__PURE__ */ d(g.ItemIndicator, { children: /* @__PURE__ */ d("span", { className: J.radioDot }) })
978
- }), t]
979
- });
980
- }
981
- function xe({ className: e, inset: t, ...n }) {
982
- return /* @__PURE__ */ d(g.Label, {
983
- "data-inset": t ? "true" : void 0,
984
- className: v(J.label, e),
985
- ...n
986
- });
987
- }
988
- function Se({ className: e, ...t }) {
989
- return /* @__PURE__ */ d(g.Separator, {
990
- className: v(J.separator, e),
991
- ...t
992
- });
993
- }
994
- function Ce({ className: e, inset: t, children: n, ...r }) {
995
- return /* @__PURE__ */ f(g.SubTrigger, {
996
- "data-inset": t ? "true" : void 0,
997
- className: v(J.item, e),
998
- ...r,
999
- children: [n, /* @__PURE__ */ d("svg", {
1000
- viewBox: "0 0 16 16",
1001
- width: "16",
1002
- height: "16",
1003
- "aria-hidden": "true",
1004
- className: J.chevron,
1005
- children: /* @__PURE__ */ d("path", {
1006
- d: "M6 3.5 10.5 8 6 12.5",
1007
- fill: "none",
1008
- stroke: "currentColor",
1009
- strokeWidth: "1.6",
1010
- strokeLinecap: "round",
1011
- strokeLinejoin: "round"
1012
- })
1013
- })]
1014
- });
1015
- }
1016
- function we({ className: e, ...t }) {
1017
- return /* @__PURE__ */ d(g.SubContent, {
1018
- className: v(J.content, e),
1019
- ...t
1020
- });
1021
- }
1022
- //#endregion
1023
- //#region src/theme/constants.ts
1024
- var Te = [
1025
- "light",
1026
- "dark",
1027
- "system"
1028
- ], Ee = [
1029
- "blue",
1030
- "cyan",
1031
- "violet",
1032
- "emerald",
1033
- "amber",
1034
- "rose"
1035
- ], De = "uzi-theme", Oe = "uzi-accent", ke = De, Ae = Oe, je = "data-uzi-theme", Me = "data-uzi-accent", Ne = t(void 0);
1036
- function Pe(e) {
1037
- return Te.includes(e);
1038
- }
1039
- function Fe(e) {
1040
- return Ee.includes(e);
1041
- }
1042
- function Ie() {
1043
- return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1044
- }
1045
- function Le({ children: e, theme: t, defaultTheme: r = "system", accent: a, defaultAccent: s = "blue", onThemeChange: l, onAccentChange: u, storageKey: f = ke, accentStorageKey: p = Ae, disableStorage: m = !1, toastConfig: h }) {
1046
- let [g, _] = c(r), [v, y] = c(s), [b, x] = c("light");
1047
- i(() => {
1048
- if (x(Ie()), !m) {
1049
- let e = window.localStorage.getItem(f);
1050
- Pe(e) && _(e);
1051
- let t = window.localStorage.getItem(p);
1052
- Fe(t) && y(t);
1053
- }
1054
- }, [
1055
- m,
1056
- f,
1057
- p
1058
- ]);
1059
- let S = t !== void 0, C = a !== void 0, w = S ? t : g, T = C ? a : v, E = w === "system" ? b : w;
1060
- i(() => {
1061
- if (typeof window > "u") return;
1062
- let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => x(e.matches ? "dark" : "light");
1063
- return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
1064
- }, []), i(() => {
1065
- if (typeof document > "u") return;
1066
- let e = document.documentElement;
1067
- e.setAttribute(je, E), e.setAttribute(Me, T), e.style.colorScheme = E, e.classList.toggle("dark", E === "dark");
1068
- }, [T, E]);
1069
- let D = n((e) => {
1070
- S || _(e), !m && typeof window < "u" && window.localStorage.setItem(f, e), l?.(e);
1071
- }, [
1072
- m,
1073
- S,
1074
- l,
1075
- f
1076
- ]), O = n((e) => {
1077
- C || y(e), !m && typeof window < "u" && window.localStorage.setItem(p, e), u?.(e);
1078
- }, [
1079
- p,
1080
- m,
1081
- C,
1082
- u
1083
- ]), k = n(() => {
1084
- D(E === "dark" ? "light" : "dark");
1085
- }, [E, D]), A = o(() => ({
1086
- theme: w,
1087
- resolvedTheme: E,
1088
- accent: T,
1089
- setTheme: D,
1090
- setAccent: O,
1091
- toggleTheme: k
1092
- }), [
1093
- T,
1094
- w,
1095
- E,
1096
- O,
1097
- D,
1098
- k
1099
- ]);
1100
- return /* @__PURE__ */ d(Ne.Provider, {
1101
- value: A,
1102
- children: /* @__PURE__ */ d(V, {
1103
- config: h,
1104
- children: e
1105
- })
1106
- });
1107
- }
1108
- function Re() {
1109
- let e = r(Ne);
1110
- if (!e) throw Error("useTheme must be used within a ThemeProvider");
1111
- return e;
1112
- }
1113
- var ze = { withLabel: "uzi-theme-toggle-button-module__withLabel__KqtDj" };
1114
- //#endregion
1115
- //#region src/components/theme-toggle-button/ThemeToggleButton.tsx
1116
- function Be() {
1117
- return /* @__PURE__ */ d("svg", {
1118
- viewBox: "0 0 24 24",
1119
- "aria-hidden": "true",
1120
- width: "16",
1121
- height: "16",
1122
- fill: "none",
1123
- children: /* @__PURE__ */ d("path", {
1124
- d: "M20 15.2A8.5 8.5 0 0 1 8.8 4 9 9 0 1 0 20 15.2Z",
1125
- stroke: "currentColor",
1126
- strokeWidth: "1.8",
1127
- strokeLinecap: "round",
1128
- strokeLinejoin: "round"
1129
- })
1130
- });
1131
- }
1132
- function Ve() {
1133
- return /* @__PURE__ */ f("svg", {
1134
- viewBox: "0 0 24 24",
1135
- "aria-hidden": "true",
1136
- width: "16",
1137
- height: "16",
1138
- fill: "none",
1139
- children: [/* @__PURE__ */ d("circle", {
1140
- cx: "12",
1141
- cy: "12",
1142
- r: "4",
1143
- stroke: "currentColor",
1144
- strokeWidth: "1.8"
1145
- }), /* @__PURE__ */ d("path", {
1146
- d: "M12 2.75v2.5M12 18.75v2.5M21.25 12h-2.5M5.25 12h-2.5M18.54 5.46l-1.77 1.77M7.23 16.77l-1.77 1.77M18.54 18.54l-1.77-1.77M7.23 7.23 5.46 5.46",
1147
- stroke: "currentColor",
1148
- strokeWidth: "1.8",
1149
- strokeLinecap: "round"
1150
- })]
1151
- });
1152
- }
1153
- function He({ showLabel: e = !1, lightLabel: t = "Light mode", darkLabel: n = "Dark mode", className: r, onClick: i, ...a }) {
1154
- let { resolvedTheme: o, toggleTheme: s } = Re(), c = o === "dark" ? t : n;
1155
- return /* @__PURE__ */ f(S, {
1156
- type: "button",
1157
- variant: "ghost",
1158
- size: e ? "sm" : "icon",
1159
- className: v(e && ze.withLabel, r),
1160
- "aria-label": `Switch to ${c.toLowerCase()}`,
1161
- title: `Switch to ${c.toLowerCase()}`,
1162
- onClick: (e) => {
1163
- i?.(e), e.defaultPrevented || s();
1164
- },
1165
- ...a,
1166
- children: [d(o === "dark" ? Ve : Be, {}), e && /* @__PURE__ */ d("span", { children: c })]
1167
- });
1168
- }
1169
- var Y = {
1170
- topBar: "uzi-top-bar-module__topBar__MJ-7S",
1171
- topBarStatic: "uzi-top-bar-module__topBarStatic__JvEwt",
1172
- topBarInner: "uzi-top-bar-module__topBarInner__PBbi8",
1173
- topBarStart: "uzi-top-bar-module__topBarStart__DrdN2",
1174
- topBarBrand: "uzi-top-bar-module__topBarBrand__80VV3",
1175
- topBarBrandContent: "uzi-top-bar-module__topBarBrandContent__O4Uto",
1176
- topBarCenter: "uzi-top-bar-module__topBarCenter__Kwxg-",
1177
- topBarCenterGroup: "uzi-top-bar-module__topBarCenterGroup__7Ishp",
1178
- topBarActions: "uzi-top-bar-module__topBarActions__mgMd8"
1179
- };
1180
- //#endregion
1181
- //#region src/components/top-bar/TopBar.tsx
1182
- function Ue({ leading: e, brand: t, brandHref: n, brandingLocation: r = "left", start: i, center: a, actions: o, showThemeToggle: s = !1, themeToggleProps: c, className: l, innerClassName: u, isSticky: p, sticky: m = !0, children: h, ...g }) {
1183
- let _ = p ?? m, y = t ? n ? /* @__PURE__ */ d("a", {
1184
- href: n,
1185
- className: Y.topBarBrand,
1186
- children: /* @__PURE__ */ d("span", {
1187
- className: Y.topBarBrandContent,
1188
- children: t
1189
- })
1190
- }) : /* @__PURE__ */ d("div", {
1191
- className: Y.topBarBrand,
1192
- children: /* @__PURE__ */ d("span", {
1193
- className: Y.topBarBrandContent,
1194
- children: t
1195
- })
1196
- }) : null;
1197
- return /* @__PURE__ */ d("header", {
1198
- className: v(Y.topBar, !_ && Y.topBarStatic, l),
1199
- ...g,
1200
- children: /* @__PURE__ */ f("div", {
1201
- className: v(Y.topBarInner, u),
1202
- children: [
1203
- /* @__PURE__ */ f("div", {
1204
- className: Y.topBarStart,
1205
- children: [
1206
- e,
1207
- r === "left" && y,
1208
- i
1209
- ]
1210
- }),
1211
- y && r === "center" || a || h ? /* @__PURE__ */ d("div", {
1212
- className: Y.topBarCenter,
1213
- children: /* @__PURE__ */ f("div", {
1214
- className: Y.topBarCenterGroup,
1215
- children: [r === "center" && y, a ?? h]
1216
- })
1217
- }) : null,
1218
- /* @__PURE__ */ f("div", {
1219
- className: Y.topBarActions,
1220
- children: [s && /* @__PURE__ */ d(He, { ...c }), o]
1221
- })
1222
- ]
1223
- })
1224
- });
1225
- }
1226
- var X = {
1227
- appShell: "uzi-app-shell-module__appShell__S0cVI",
1228
- appShellAnimated: "uzi-app-shell-module__appShellAnimated__-CRIl",
1229
- appShellOpen: "uzi-app-shell-module__appShellOpen__1rZUl",
1230
- appShellCollapsed: "uzi-app-shell-module__appShellCollapsed__fSasN",
1231
- appShellTopbar: "uzi-app-shell-module__appShellTopbar__rgXsW",
1232
- appShellTopbarLeft: "uzi-app-shell-module__appShellTopbarLeft__-EVuB",
1233
- appShellTopbarStart: "uzi-app-shell-module__appShellTopbarStart__XXQpq",
1234
- appShellTopbarRight: "uzi-app-shell-module__appShellTopbarRight__l1G57",
1235
- appShellBrand: "uzi-app-shell-module__appShellBrand__TXwyN",
1236
- appShellHamburger: "uzi-app-shell-module__appShellHamburger__BciFA",
1237
- appShellSidebar: "uzi-app-shell-module__appShellSidebar__oY7uj",
1238
- appShellMain: "uzi-app-shell-module__appShellMain__eHP2r",
1239
- appShellBackdrop: "uzi-app-shell-module__appShellBackdrop__y31xs",
1240
- appShellSidebarOpen: "uzi-app-shell-module__appShellSidebarOpen__Z5AIo"
1241
- }, We = 960;
1242
- function Ge() {
1243
- return typeof window > "u" ? !1 : window.innerWidth >= We;
1244
- }
1245
- function Ke({ children: e, sidebar: t, brand: n, brandHref: r, topbarStart: o, topbarEnd: l, showThemeToggle: u = !1, themeToggleProps: p, topBarBrandingLocation: m = "left", className: h, sidebarClassName: g, topbarClassName: _, mainClassName: y, sidebarWidth: b, closeSidebarOnChangeKey: x, hamburgerLabel: S = "Toggle navigation", onSidebarToggle: C }) {
1246
- let [w, T] = c(!1), [E, D] = c(!1), [O, k] = c(!1), A = s(!1), j = s(x), M = s(null), N = s(null), P = s(null), F = a();
1247
- i(() => {
1248
- let e = Ge();
1249
- T(e), D(e), A.current = e;
1250
- let t = window.requestAnimationFrame(() => {
1251
- k(!0);
1252
- }), n = () => {
1253
- let e = Ge();
1254
- T(e), e !== A.current && (D(e), A.current = e);
1255
- };
1256
- return window.addEventListener("resize", n), () => {
1257
- window.cancelAnimationFrame(t), window.removeEventListener("resize", n);
1258
- };
1259
- }, []), i(() => {
1260
- if (w || !E) return;
1261
- let e = P.current, t = () => D(!1), n = (e) => {
1262
- let n = e.target;
1263
- n && (M.current?.contains(n) || N.current?.contains(n) || t());
1264
- }, r = window.setTimeout(() => {
1265
- document.addEventListener("pointerdown", n), window.addEventListener("scroll", t, { passive: !0 }), e?.addEventListener("scroll", t, { passive: !0 }), document.addEventListener("touchmove", t, { passive: !0 });
1266
- }, 10);
1267
- return () => {
1268
- window.clearTimeout(r), document.removeEventListener("pointerdown", n), window.removeEventListener("scroll", t), e?.removeEventListener("scroll", t), document.removeEventListener("touchmove", t);
1269
- };
1270
- }, [E, w]), i(() => {
1271
- !w && j.current !== x && D(!1), j.current = x;
1272
- }, [x, w]), i(() => {
1273
- C?.(E);
1274
- }, [E, C]);
1275
- let I = () => D((e) => !e), L = b === void 0 ? void 0 : typeof b == "number" ? `${b}px` : b, R = L ? { "--app-shell-sidebar-width": L } : void 0, z = v(X.appShell, O && X.appShellAnimated, E ? X.appShellOpen : X.appShellCollapsed, h), B = v(X.appShellSidebar, E && X.appShellSidebarOpen, g);
1276
- return /* @__PURE__ */ f("div", {
1277
- className: z,
1278
- style: R,
1279
- "data-app-shell": !0,
1280
- "data-desktop": w ? "true" : "false",
1281
- "data-sidebar-open": E ? "true" : "false",
1282
- children: [
1283
- /* @__PURE__ */ d(Ue, {
1284
- className: v(X.appShellTopbar, _),
1285
- leading: /* @__PURE__ */ d("button", {
1286
- ref: N,
1287
- type: "button",
1288
- className: X.appShellHamburger,
1289
- onClick: I,
1290
- "aria-label": S,
1291
- "aria-expanded": E,
1292
- "aria-controls": F,
1293
- children: /* @__PURE__ */ d("svg", {
1294
- viewBox: "0 0 24 24",
1295
- "aria-hidden": "true",
1296
- children: /* @__PURE__ */ d("path", {
1297
- d: "M3 6h18M3 12h18M3 18h18",
1298
- stroke: "currentColor",
1299
- strokeWidth: "2.5",
1300
- strokeLinecap: "round"
1301
- })
1302
- })
1303
- }),
1304
- brand: n,
1305
- brandHref: r,
1306
- brandingLocation: m,
1307
- start: o,
1308
- actions: l,
1309
- showThemeToggle: u,
1310
- themeToggleProps: p
1311
- }),
1312
- !w && E && /* @__PURE__ */ d("div", {
1313
- className: X.appShellBackdrop,
1314
- onClick: () => D(!1),
1315
- onTouchStart: () => D(!1),
1316
- "aria-hidden": "true"
1317
- }),
1318
- /* @__PURE__ */ d("aside", {
1319
- ref: M,
1320
- id: F,
1321
- className: B,
1322
- "aria-label": "Sidebar navigation",
1323
- children: t
1324
- }),
1325
- /* @__PURE__ */ d("main", {
1326
- ref: P,
1327
- className: v(X.appShellMain, y),
1328
- children: e
1329
- })
1330
- ]
1331
- });
1332
- }
1333
- var Z = {
1334
- sidebarNav: "uzi-sidebar-nav-module__sidebarNav__eUI5c",
1335
- sidebarNavCollapsed: "uzi-sidebar-nav-module__sidebarNavCollapsed__xTM9s",
1336
- header: "uzi-sidebar-nav-module__header__Y4NLy",
1337
- footer: "uzi-sidebar-nav-module__footer__GjWky",
1338
- sections: "uzi-sidebar-nav-module__sections__mXuGQ",
1339
- section: "uzi-sidebar-nav-module__section__yjtCY",
1340
- sectionItems: "uzi-sidebar-nav-module__sectionItems__tNcph",
1341
- sectionLabel: "uzi-sidebar-nav-module__sectionLabel__Wx94m",
1342
- item: "uzi-sidebar-nav-module__item__uMHkJ",
1343
- itemActive: "uzi-sidebar-nav-module__itemActive__wBbiS",
1344
- itemCollapsed: "uzi-sidebar-nav-module__itemCollapsed__jLJN-",
1345
- itemDisabled: "uzi-sidebar-nav-module__itemDisabled__Yf8Il",
1346
- icon: "uzi-sidebar-nav-module__icon__tyrUg",
1347
- itemBody: "uzi-sidebar-nav-module__itemBody__wI0iy",
1348
- labelRow: "uzi-sidebar-nav-module__labelRow__D8sEJ",
1349
- label: "uzi-sidebar-nav-module__label__A-nt6",
1350
- description: "uzi-sidebar-nav-module__description__Xf3Si",
1351
- badge: "uzi-sidebar-nav-module__badge__-hnFd"
1352
- }, qe = (e, t) => e.active === void 0 ? !e.href || !t ? !1 : e.href === "/" ? t === "/" : t.startsWith(e.href) : e.active, Je = (e, t) => {
1353
- if (e.active !== void 0) return e.active;
1354
- if (!e.href || !t) return !1;
1355
- if (e.href === "/") return t === "/";
1356
- let n = e.href.endsWith("/") ? e.href.slice(0, -1) : e.href;
1357
- return n === t || t.startsWith(`${n}/`);
1358
- }, Ye = (e, t) => e === "/" ? t === "/" : t.startsWith(e), Xe = (e, t) => e === "/" ? t === "/" : (e.endsWith("/") ? e.slice(0, -1) : e) === t, Ze = (e) => e.endsWith("/") ? e.length - 1 : e.length, Qe = (e, t) => {
1359
- let n = /* @__PURE__ */ new Set();
1360
- if (!t) return n;
1361
- let r = e.filter((e) => e.disabled || !e.href ? !1 : e.exact ? Xe(e.href, t) : Ye(e.href, t));
1362
- if (r.length === 0) return n;
1363
- let i = 0;
1364
- for (let e of r) {
1365
- if (!e.href) continue;
1366
- let t = Ze(e.href);
1367
- t > i && (i = t);
1368
- }
1369
- for (let e of r) e.href && Ze(e.href) === i && n.add(e.href);
1370
- return n;
1371
- };
1372
- function $e({ items: e = [], sections: t, currentPath: n, getIsActive: r, matchStrategy: i = "prefix", onItemClick: a, header: s, footer: c, ariaLabel: l = "Sidebar navigation", collapsed: u = !1, iconSize: p, className: m, itemClassName: h, sectionClassName: g }) {
1373
- let _ = o(() => t?.length ? t : [{
1374
- id: "default",
1375
- items: e
1376
- }], [t, e]), y = o(() => _.flatMap((e) => e.items), [_]), b = o(() => {
1377
- if (i === "most-specific") {
1378
- let e = Qe(y, n);
1379
- return (t) => t.active === void 0 ? t.href ? e.has(t.href) : !1 : t.active;
1380
- } else return (e, t) => e.active === void 0 ? e.exact ? Je(e, t) : qe(e, t) : e.active;
1381
- }, [
1382
- i,
1383
- y,
1384
- n
1385
- ]), x = r ?? b, S = p === void 0 ? void 0 : { "--sidebar-nav-icon-size": typeof p == "number" ? `${p}px` : p };
1386
- return /* @__PURE__ */ f("nav", {
1387
- className: v(Z.sidebarNav, u && Z.sidebarNavCollapsed, m),
1388
- "aria-label": l,
1389
- style: S,
1390
- children: [
1391
- s ? /* @__PURE__ */ d("div", {
1392
- className: Z.header,
1393
- children: s
1394
- }) : null,
1395
- /* @__PURE__ */ d("div", {
1396
- className: Z.sections,
1397
- children: _.map((e, t) => /* @__PURE__ */ f("div", {
1398
- className: v(Z.section, g),
1399
- children: [e.label && !u ? /* @__PURE__ */ d("div", {
1400
- className: Z.sectionLabel,
1401
- children: e.label
1402
- }) : null, /* @__PURE__ */ d("div", {
1403
- className: Z.sectionItems,
1404
- children: e.items.map((r, i) => /* @__PURE__ */ d(et, {
1405
- item: r,
1406
- active: x(r, n),
1407
- collapsed: u,
1408
- itemClassName: h,
1409
- onItemClick: a
1410
- }, `${e.id ?? t}-${r.href ?? r.title ?? i}`))
1411
- })]
1412
- }, e.id ?? `section-${t}`))
1413
- }),
1414
- c ? /* @__PURE__ */ d("div", {
1415
- className: Z.footer,
1416
- children: c
1417
- }) : null
1418
- ]
1419
- });
1420
- }
1421
- function et({ item: e, active: t, collapsed: n, itemClassName: r, onItemClick: i }) {
1422
- let a = e.rel ?? (e.target === "_blank" ? "noreferrer" : void 0), o = e.title ?? (typeof e.label == "string" ? e.label : void 0), s = v(Z.item, t && Z.itemActive, n && Z.itemCollapsed, e.disabled && Z.itemDisabled, r), c = /* @__PURE__ */ f(u, { children: [e.icon && /* @__PURE__ */ d("span", {
1423
- className: Z.icon,
1424
- children: e.icon
1425
- }), n ? null : /* @__PURE__ */ f("span", {
1426
- className: Z.itemBody,
1427
- children: [/* @__PURE__ */ f("span", {
1428
- className: Z.labelRow,
1429
- children: [/* @__PURE__ */ d("span", {
1430
- className: Z.label,
1431
- children: e.label
1432
- }), e.badge && /* @__PURE__ */ d("span", {
1433
- className: Z.badge,
1434
- children: e.badge
1435
- })]
1436
- }), e.description ? /* @__PURE__ */ d("span", {
1437
- className: Z.description,
1438
- children: e.description
1439
- }) : null]
1440
- })] }), l = () => {
1441
- e.disabled || (e.onClick?.(), i?.(e));
1442
- };
1443
- return e.href ? e.disabled ? /* @__PURE__ */ d("div", {
1444
- className: s,
1445
- "aria-current": t ? "page" : void 0,
1446
- "aria-disabled": "true",
1447
- title: n ? o : void 0,
1448
- children: c
1449
- }) : /* @__PURE__ */ d("a", {
1450
- className: s,
1451
- href: e.href,
1452
- target: e.target,
1453
- rel: a,
1454
- "aria-current": t ? "page" : void 0,
1455
- title: n ? o : void 0,
1456
- onClick: l,
1457
- children: c
1458
- }) : /* @__PURE__ */ d("button", {
1459
- type: "button",
1460
- className: s,
1461
- "aria-current": t ? "page" : void 0,
1462
- "aria-disabled": e.disabled ? "true" : void 0,
1463
- disabled: e.disabled,
1464
- title: n ? o : void 0,
1465
- onClick: l,
1466
- children: c
1467
- });
1468
- }
1469
- var tt = {
1470
- skeleton: "uzi-skeleton-module__skeleton__fula5",
1471
- "skeleton-pulse": "uzi-skeleton-module__skeleton-pulse__Yp45W",
1472
- "radius-sm": "uzi-skeleton-module__radius-sm__FdccD",
1473
- "radius-md": "uzi-skeleton-module__radius-md__zH3RE",
1474
- "radius-lg": "uzi-skeleton-module__radius-lg__YVrHw",
1475
- "radius-full": "uzi-skeleton-module__radius-full__5o2m0"
1476
- };
1477
- //#endregion
1478
- //#region src/components/skeleton/Skeleton.tsx
1479
- function nt({ width: e, height: t, radius: n = "md", className: r, style: i, ...a }) {
1480
- return /* @__PURE__ */ d("div", {
1481
- className: v(tt.skeleton, tt[`radius-${n}`], r),
1482
- style: {
1483
- width: e,
1484
- height: t,
1485
- ...i
1486
- },
1487
- "aria-hidden": "true",
1488
- ...a
1489
- });
1490
- }
1491
- var Q = {
1492
- track: "uzi-progress-module__track__gM0oV",
1493
- fill: "uzi-progress-module__fill__aLAbp",
1494
- "tone-default": "uzi-progress-module__tone-default__fhf7o",
1495
- "tone-success": "uzi-progress-module__tone-success__FsGHD",
1496
- "tone-warning": "uzi-progress-module__tone-warning__UAttL",
1497
- "tone-danger": "uzi-progress-module__tone-danger__-L-Ee"
1498
- };
1499
- //#endregion
1500
- //#region src/components/progress/Progress.tsx
1501
- function rt({ value: e, tone: t = "default", className: n, "aria-label": r, ...i }) {
1502
- let a = Math.max(0, Math.min(100, e));
1503
- return /* @__PURE__ */ d("div", {
1504
- className: v(Q.track, n),
1505
- role: "progressbar",
1506
- "aria-valuenow": a,
1507
- "aria-valuemin": 0,
1508
- "aria-valuemax": 100,
1509
- "aria-label": r,
1510
- ...i,
1511
- children: /* @__PURE__ */ d("div", {
1512
- className: v(Q.fill, Q[`tone-${t}`]),
1513
- style: { width: `${a}%` }
1514
- })
1515
- });
1516
- }
1517
- var $ = {
1518
- track: "uzi-segmented-toggle-module__track__M4fjm",
1519
- option: "uzi-segmented-toggle-module__option__7cEZJ",
1520
- label: "uzi-segmented-toggle-module__label__bDAIv"
1521
- };
1522
- //#endregion
1523
- //#region src/components/segmented-toggle/SegmentedToggle.tsx
1524
- function it({ options: t, value: n, onChange: r, "aria-label": i, "aria-labelledby": a, className: o }) {
1525
- let s = e.useRef([]), c = t.findIndex((e) => e.value === n), l = t.findIndex((e) => !e.disabled), u = -1;
1526
- for (let e = t.length - 1; e >= 0; --e) if (!t[e]?.disabled) {
1527
- u = e;
1528
- break;
1529
- }
1530
- let f = c >= 0 && !t[c]?.disabled ? c : l, p = (e) => {
1531
- s.current[e]?.focus();
1532
- }, m = (e, n) => {
1533
- if (t.length === 0) return -1;
1534
- let r = e;
1535
- for (let e = 0; e < t.length; e += 1) if (r = (r + n + t.length) % t.length, !t[r]?.disabled) return r;
1536
- return e;
1537
- }, h = (e) => {
1538
- let i = t[e];
1539
- !i || i.disabled || i.value === n || r(i.value);
1540
- }, g = (e, t) => {
1541
- switch (e.key) {
1542
- case "ArrowRight":
1543
- case "ArrowDown": {
1544
- e.preventDefault();
1545
- let n = m(t, 1);
1546
- p(n), h(n);
1547
- break;
1548
- }
1549
- case "ArrowLeft":
1550
- case "ArrowUp": {
1551
- e.preventDefault();
1552
- let n = m(t, -1);
1553
- p(n), h(n);
1554
- break;
1555
- }
1556
- case "Home":
1557
- e.preventDefault(), p(l), l >= 0 && h(l);
1558
- break;
1559
- case "End":
1560
- e.preventDefault(), u >= 0 && (p(u), h(u));
1561
- break;
1562
- default: break;
1563
- }
1564
- };
1565
- return /* @__PURE__ */ d("div", {
1566
- className: v($.track, o),
1567
- role: "radiogroup",
1568
- "aria-label": i,
1569
- "aria-labelledby": a,
1570
- children: t.map((e, t) => /* @__PURE__ */ d("button", {
1571
- ref: (e) => {
1572
- s.current[t] = e;
1573
- },
1574
- type: "button",
1575
- role: "radio",
1576
- "aria-checked": e.value === n,
1577
- disabled: e.disabled,
1578
- tabIndex: e.disabled ? -1 : t === f ? 0 : -1,
1579
- onClick: () => {
1580
- e.value !== n && r(e.value);
1581
- },
1582
- onKeyDown: (e) => g(e, t),
1583
- className: v($.option),
1584
- children: /* @__PURE__ */ d("span", {
1585
- className: $.label,
1586
- children: e.label
1587
- })
1588
- }, e.value))
1589
- });
1590
- }
1591
- //#endregion
1592
- export { F as Alert, Ke as AppShell, w as Avatar, E as AvatarFallback, T as AvatarImage, S as Button, O as Card, W as Checkbox, ue as Dropdown, de as DropdownMenu, ye as DropdownMenuCheckboxItem, _e as DropdownMenuContent, pe as DropdownMenuGroup, ve as DropdownMenuItem, xe as DropdownMenuLabel, me as DropdownMenuPortal, ge as DropdownMenuRadioGroup, be as DropdownMenuRadioItem, Se as DropdownMenuSeparator, he as DropdownMenuSub, we as DropdownMenuSubContent, Ce as DropdownMenuSubTrigger, fe as DropdownMenuTrigger, H as Input, U as Label, N as Modal, M as ModalOverlay, ce as MultiSelect, A as Pill, rt as Progress, it as SegmentedToggle, q as Select, $e as SidebarNav, nt as Skeleton, Le as ThemeProvider, He as ThemeToggleButton, V as ToastProvider, Ue as TopBar, v as cx, Re as useTheme, ee as useToast };
1593
-
1594
- //# sourceMappingURL=index.js.map
1
+ /* empty css */
2
+ import { cx } from "./index3.js";
3
+ import { Button } from "./index5.js";
4
+ import { Avatar, AvatarFallback, AvatarImage } from "./index7.js";
5
+ import { Card } from "./index9.js";
6
+ import { Pill } from "./index11.js";
7
+ import { Modal, ModalOverlay } from "./index13.js";
8
+ import { Alert } from "./index15.js";
9
+ import { ToastProvider, useToast } from "./index17.js";
10
+ import { Input } from "./index19.js";
11
+ import { Label } from "./index21.js";
12
+ import { Checkbox } from "./index23.js";
13
+ import { MultiSelect } from "./index25.js";
14
+ import { Select } from "./index27.js";
15
+ import { Dropdown } from "./index28.js";
16
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./index30.js";
17
+ import { ThemeProvider, useTheme } from "./index32.js";
18
+ import { ThemeToggleButton } from "./index34.js";
19
+ import { TopBar } from "./index36.js";
20
+ import { AppShell } from "./index38.js";
21
+ import { SidebarNav } from "./index40.js";
22
+ import { Skeleton } from "./index42.js";
23
+ import { Progress } from "./index44.js";
24
+ import { SegmentedToggle } from "./index46.js";
25
+ export { Alert, AppShell, Avatar, AvatarFallback, AvatarImage, Button, Card, Checkbox, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, Label, Modal, ModalOverlay, MultiSelect, Pill, Progress, SegmentedToggle, Select, SidebarNav, Skeleton, ThemeProvider, ThemeToggleButton, ToastProvider, TopBar, cx, useTheme, useToast };