@tomny-dev/uzi 0.2.5 → 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 (182) hide show
  1. package/dist/index.cjs +65 -1925
  2. package/dist/index.js +24 -1857
  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/package.json +1 -1
  181. package/dist/index.cjs.map +0 -1
  182. package/dist/index.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,1926 +1,66 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region \0rolldown/runtime.js
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
- get: ((k) => from[k]).bind(null, key),
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
- value: mod,
21
- enumerable: true
22
- }) : target, mod));
23
- //#endregion
24
- let react = require("react");
25
- react = __toESM(react, 1);
26
- let _radix_ui_react_slot = require("@radix-ui/react-slot");
27
- let react_jsx_runtime = require("react/jsx-runtime");
28
- let _radix_ui_react_avatar = require("@radix-ui/react-avatar");
29
- _radix_ui_react_avatar = __toESM(_radix_ui_react_avatar, 1);
30
- let _radix_ui_react_dialog = require("@radix-ui/react-dialog");
31
- _radix_ui_react_dialog = __toESM(_radix_ui_react_dialog, 1);
32
- let _radix_ui_react_toast = require("@radix-ui/react-toast");
33
- _radix_ui_react_toast = __toESM(_radix_ui_react_toast, 1);
34
- let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
35
- _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu, 1);
36
- let _radix_ui_react_select = require("@radix-ui/react-select");
37
- _radix_ui_react_select = __toESM(_radix_ui_react_select, 1);
38
- //#region src/utils/cx.ts
39
- function cx(...values) {
40
- return values.filter(Boolean).join(" ");
41
- }
42
- var button_module_default = {
43
- button: "uzi-button-module__button__5dzDN",
44
- sizeSm: "uzi-button-module__sizeSm__jb544",
45
- sizeMd: "uzi-button-module__sizeMd__lIo8M",
46
- sizeLg: "uzi-button-module__sizeLg__QSSuW",
47
- sizeIcon: "uzi-button-module__sizeIcon__Aa9tN",
48
- variantPrimary: "uzi-button-module__variantPrimary__zp2Pg",
49
- variantSecondary: "uzi-button-module__variantSecondary__oX5CB",
50
- variantOutline: "uzi-button-module__variantOutline__uXfiP",
51
- variantGhost: "uzi-button-module__variantGhost__-OEB8",
52
- variantDestructive: "uzi-button-module__variantDestructive__5IeYA",
53
- variantLink: "uzi-button-module__variantLink__Olx4I"
54
- };
55
- //#endregion
56
- //#region src/components/button/Button.tsx
57
- var variantClass = {
58
- default: "variantPrimary",
59
- primary: "variantPrimary",
60
- secondary: "variantSecondary",
61
- outline: "variantOutline",
62
- ghost: "variantGhost",
63
- destructive: "variantDestructive",
64
- link: "variantLink"
65
- };
66
- var sizeClass = {
67
- default: "sizeMd",
68
- sm: "sizeSm",
69
- md: "sizeMd",
70
- lg: "sizeLg",
71
- icon: "sizeIcon"
72
- };
73
- function Button({ as, variant = "default", size = "default", className, children, asChild = false, ...rest }) {
74
- const classes = cx(button_module_default.button, button_module_default[variantClass[variant]], button_module_default[sizeClass[size]], className);
75
- if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_slot.Slot, {
76
- className: classes,
77
- ...rest,
78
- children
79
- });
80
- if (as === "a") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
81
- className: classes,
82
- ...rest,
83
- children
84
- });
85
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
86
- type: "button",
87
- className: classes,
88
- ...rest,
89
- children
90
- });
91
- }
92
- var avatar_module_default = {
93
- avatar: "uzi-avatar-module__avatar__yPIOs",
94
- "size-sm": "uzi-avatar-module__size-sm__v5riJ",
95
- "size-md": "uzi-avatar-module__size-md__g7IQS",
96
- "size-lg": "uzi-avatar-module__size-lg__Ca4xk",
97
- "size-xl": "uzi-avatar-module__size-xl__K0Dfk",
98
- image: "uzi-avatar-module__image__Ngo7A",
99
- fallback: "uzi-avatar-module__fallback__Tf3oZ"
100
- };
101
- //#endregion
102
- //#region src/components/avatar/Avatar.tsx
103
- function Avatar({ className, size = "md", ...props }) {
104
- const sizeClass = size === "sm" ? avatar_module_default["size-sm"] : size === "lg" ? avatar_module_default["size-lg"] : size === "xl" ? avatar_module_default["size-xl"] : avatar_module_default["size-md"];
105
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Root, {
106
- className: cx(avatar_module_default.avatar, sizeClass, className),
107
- ...props
108
- });
109
- }
110
- function AvatarImage({ className, ...props }) {
111
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Image, {
112
- className: cx(avatar_module_default.image, className),
113
- ...props
114
- });
115
- }
116
- function AvatarFallback({ className, ...props }) {
117
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Fallback, {
118
- className: cx(avatar_module_default.fallback, className),
119
- ...props
120
- });
121
- }
122
- var card_module_default = {
123
- card: "uzi-card-module__card__ZPFTz",
124
- "tone-default": "uzi-card-module__tone-default__7Ujf9",
125
- "tone-muted": "uzi-card-module__tone-muted__RQy5B",
126
- "tone-contrast": "uzi-card-module__tone-contrast__JpFxL",
127
- interactive: "uzi-card-module__interactive__zlPML",
128
- "padding-none": "uzi-card-module__padding-none__LXdx-",
129
- "padding-sm": "uzi-card-module__padding-sm__-Ub1s",
130
- "padding-md": "uzi-card-module__padding-md__kUf46",
131
- "padding-lg": "uzi-card-module__padding-lg__a5mWP"
132
- };
133
- //#endregion
134
- //#region src/components/card/Card.tsx
135
- function Card({ as, tone = "default", padding = "md", interactive = false, className, children, ...rest }) {
136
- const Component = as ?? "div";
137
- const TONE_CLASS = {
138
- default: null,
139
- muted: "tone-muted",
140
- contrast: "tone-contrast"
141
- };
142
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
143
- className: cx(card_module_default.card, TONE_CLASS[tone] ? card_module_default[TONE_CLASS[tone]] : null, card_module_default[{
144
- none: "padding-none",
145
- sm: "padding-sm",
146
- md: "padding-md",
147
- lg: "padding-lg"
148
- }[padding]], interactive && card_module_default.interactive, className),
149
- ...rest,
150
- children
151
- });
152
- }
153
- var pill_module_default = {
154
- pill: "uzi-pill-module__pill__uCKcP",
155
- "size-sm": "uzi-pill-module__size-sm__JANOQ",
156
- "size-md": "uzi-pill-module__size-md__fdsqR",
157
- "tone-success": "uzi-pill-module__tone-success__kW2Kf",
158
- "tone-warning": "uzi-pill-module__tone-warning__Rc5-s",
159
- "tone-info": "uzi-pill-module__tone-info__0vQrj",
160
- "tone-danger": "uzi-pill-module__tone-danger__gzNOa",
161
- icon: "uzi-pill-module__icon__KQ8zg",
162
- content: "uzi-pill-module__content__T7AG1"
163
- };
164
- //#endregion
165
- //#region src/components/pill/Pill.tsx
166
- function Pill({ as, tone = "neutral", size = "md", icon, className, children, ...rest }) {
167
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(as ?? "span", {
168
- className: cx(pill_module_default.pill, pill_module_default[`tone-${tone}`], pill_module_default[`size-${size}`], className),
169
- ...rest,
170
- children: [icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
171
- className: pill_module_default.icon,
172
- "aria-hidden": "true",
173
- children: icon
174
- }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
175
- className: pill_module_default.content,
176
- children
177
- })]
178
- });
179
- }
180
- var modal_module_default = {
181
- portalLayer: "uzi-modal-module__portalLayer__t7blc",
182
- backdrop: "uzi-modal-module__backdrop__IMd3b",
183
- backdropFadeIn: "uzi-modal-module__backdropFadeIn__GNJdx",
184
- backdropFadeOut: "uzi-modal-module__backdropFadeOut__R-3K5",
185
- overlayContent: "uzi-modal-module__overlayContent__0DtbP",
186
- modalContentIn: "uzi-modal-module__modalContentIn__fub8M",
187
- modalContentOut: "uzi-modal-module__modalContentOut__elTJ3",
188
- modal: "uzi-modal-module__modal__Mao59",
189
- "size-sm": "uzi-modal-module__size-sm__Uu9je",
190
- "size-md": "uzi-modal-module__size-md__TiiWy",
191
- "size-lg": "uzi-modal-module__size-lg__BrTIO",
192
- "size-xl": "uzi-modal-module__size-xl__sj0mh",
193
- header: "uzi-modal-module__header__PmCaO",
194
- titles: "uzi-modal-module__titles__IboyQ",
195
- title: "uzi-modal-module__title__Zd7pL",
196
- subtitle: "uzi-modal-module__subtitle__t-LRK",
197
- closeButton: "uzi-modal-module__closeButton__GTiZr",
198
- body: "uzi-modal-module__body__km6FQ",
199
- footer: "uzi-modal-module__footer__jWLTv"
200
- };
201
- //#endregion
202
- //#region src/components/modal/Modal.tsx
203
- function ModalOverlay({ open, onClose, className, children }) {
204
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Root, {
205
- open,
206
- onOpenChange: (nextOpen) => {
207
- if (!nextOpen) onClose();
208
- },
209
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
210
- className: modal_module_default.portalLayer,
211
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Overlay, { className: cx(modal_module_default.backdrop, className) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Content, {
212
- className: modal_module_default.overlayContent,
213
- children
214
- })]
215
- }) })
216
- });
217
- }
218
- function Modal({ open, onClose, title, subtitle, size = "md", children, footer }) {
219
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalOverlay, {
220
- open,
221
- onClose,
222
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
223
- className: cx(modal_module_default.modal, modal_module_default[`size-${size}`]),
224
- children: [
225
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
226
- className: modal_module_default.header,
227
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
228
- className: modal_module_default.titles,
229
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Title, {
230
- className: modal_module_default.title,
231
- children: title
232
- }), subtitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Description, {
233
- className: modal_module_default.subtitle,
234
- children: subtitle
235
- }) : null]
236
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Close, {
237
- asChild: true,
238
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
239
- className: modal_module_default.closeButton,
240
- "aria-label": "Close",
241
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
242
- width: "14",
243
- height: "14",
244
- viewBox: "0 0 24 24",
245
- fill: "none",
246
- stroke: "currentColor",
247
- strokeWidth: "2.5",
248
- strokeLinecap: "round",
249
- strokeLinejoin: "round",
250
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
251
- x1: "18",
252
- y1: "6",
253
- x2: "6",
254
- y2: "18"
255
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
256
- x1: "6",
257
- y1: "6",
258
- x2: "18",
259
- y2: "18"
260
- })]
261
- })
262
- })
263
- })]
264
- }),
265
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
266
- className: modal_module_default.body,
267
- children
268
- }),
269
- footer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
270
- className: modal_module_default.footer,
271
- children: footer
272
- })
273
- ]
274
- })
275
- });
276
- }
277
- var alert_module_default = {
278
- alert: "uzi-alert-module__alert__7Bt6c",
279
- success: "uzi-alert-module__success__apdFG",
280
- error: "uzi-alert-module__error__KLgi1",
281
- warning: "uzi-alert-module__warning__F4fpk",
282
- info: "uzi-alert-module__info__1IKHt"
283
- };
284
- //#endregion
285
- //#region src/components/alert/Alert.tsx
286
- function Alert({ tone, children, className }) {
287
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
288
- className: cx(alert_module_default.alert, alert_module_default[tone], className),
289
- role: "alert",
290
- children
291
- });
292
- }
293
- var toast_module_default = {
294
- stack: "uzi-toast-module__stack__SRrda",
295
- topRight: "uzi-toast-module__topRight__WiZzM",
296
- topLeft: "uzi-toast-module__topLeft__SzFS9",
297
- topCenter: "uzi-toast-module__topCenter__X5W-x",
298
- bottomRight: "uzi-toast-module__bottomRight__DMtoS",
299
- bottomLeft: "uzi-toast-module__bottomLeft__ZZ7VF",
300
- bottomCenter: "uzi-toast-module__bottomCenter__QNJrM",
301
- toast: "uzi-toast-module__toast__HNUcj",
302
- toastSlideIn: "uzi-toast-module__toastSlideIn__BTXfm",
303
- toastSlideOut: "uzi-toast-module__toastSlideOut__mBX-G",
304
- toastSwipeOut: "uzi-toast-module__toastSwipeOut__R-jk2",
305
- icon: "uzi-toast-module__icon__LIAqr",
306
- body: "uzi-toast-module__body__9vzs7",
307
- message: "uzi-toast-module__message__TBY65",
308
- actions: "uzi-toast-module__actions__Iykd9",
309
- actionButton: "uzi-toast-module__actionButton__cvUr0",
310
- controls: "uzi-toast-module__controls__LqA4Q",
311
- iconButton: "uzi-toast-module__iconButton__FOsOp",
312
- iconButtonError: "uzi-toast-module__iconButtonError__NJsLX"
313
- };
314
- //#endregion
315
- //#region src/components/toast/ToastContext.tsx
316
- /** Default provider configuration. */
317
- var DEFAULT_CONFIG = {
318
- position: "top-right",
319
- maxToasts: 5,
320
- defaultDuration: 4e3,
321
- pauseOnHover: true,
322
- pauseOnFocusLoss: true
323
- };
324
- var ToastContext = (0, react.createContext)(void 0);
325
- var toastIdCounter = 0;
326
- var generateToastId = () => `toast-${++toastIdCounter}-${Date.now()}`;
327
- /**
328
- * Toast notification context provider.
329
- *
330
- * @remarks
331
- * Wrap your app (or a section) to enable `useToast` calls. Supports configurable placement,
332
- * maximum visible toasts, and pause behavior on hover or window blur.
333
- *
334
- * @param props.children - React subtree that can consume the toast context.
335
- * @param props.config - Optional provider configuration overrides.
336
- */
337
- function ToastProvider({ children, config }) {
338
- const [toasts, setToasts] = (0, react.useState)([]);
339
- const [isPaused, setIsPaused] = (0, react.useState)(false);
340
- const merged = (0, react.useMemo)(() => ({
341
- ...DEFAULT_CONFIG,
342
- ...config
343
- }), [config]);
344
- const push = (0, react.useCallback)((message, options = {}) => {
345
- const id = generateToastId();
346
- setToasts((prev) => {
347
- const next = [...prev, {
348
- id,
349
- message,
350
- type: options.type ?? "info",
351
- duration: options.duration ?? (options.type === "error" ? 6e3 : merged.defaultDuration),
352
- dismissible: options.dismissible ?? true,
353
- copyable: options.copyable ?? false,
354
- action: options.action
355
- }];
356
- if (next.length > merged.maxToasts) next.shift();
357
- return next;
358
- });
359
- return id;
360
- }, [merged.defaultDuration, merged.maxToasts]);
361
- const success = (0, react.useCallback)((message, options) => push(message, {
362
- ...options,
363
- type: "success"
364
- }), [push]);
365
- const error = (0, react.useCallback)((message, options) => push(message, {
366
- copyable: true,
367
- ...options,
368
- type: "error"
369
- }), [push]);
370
- const warning = (0, react.useCallback)((message, options) => push(message, {
371
- ...options,
372
- type: "warning"
373
- }), [push]);
374
- const info = (0, react.useCallback)((message, options) => push(message, {
375
- ...options,
376
- type: "info"
377
- }), [push]);
378
- const dismiss = (0, react.useCallback)((id) => {
379
- setToasts((prev) => prev.filter((t) => t.id !== id));
380
- }, []);
381
- const dismissAll = (0, react.useCallback)(() => setToasts([]), []);
382
- (0, react.useEffect)(() => {
383
- if (!merged.pauseOnFocusLoss) return;
384
- const handleVisibility = () => setIsPaused(document.visibilityState !== "visible");
385
- document.addEventListener("visibilitychange", handleVisibility);
386
- return () => document.removeEventListener("visibilitychange", handleVisibility);
387
- }, [merged.pauseOnFocusLoss]);
388
- const value = (0, react.useMemo)(() => ({
389
- toasts,
390
- push,
391
- success,
392
- error,
393
- warning,
394
- info,
395
- dismiss,
396
- dismissAll
397
- }), [
398
- toasts,
399
- push,
400
- success,
401
- error,
402
- warning,
403
- info,
404
- dismiss,
405
- dismissAll
406
- ]);
407
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContext.Provider, {
408
- value,
409
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Provider, {
410
- swipeDirection: "right",
411
- children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContainer, {
412
- toasts,
413
- position: merged.position,
414
- pauseOnHover: merged.pauseOnHover,
415
- isPaused,
416
- onDismiss: dismiss,
417
- onPauseChange: setIsPaused
418
- })]
419
- })
420
- });
421
- }
422
- /**
423
- * Hook to access the toast API.
424
- *
425
- * @remarks
426
- * Exposes `push`, intent helpers (`success`, `error`, `warning`, `info`), and dismissal helpers.
427
- * Must be called within a `ToastProvider`.
428
- *
429
- * @throws Error if used outside of a `ToastProvider`.
430
- */
431
- function useToast() {
432
- const ctx = (0, react.useContext)(ToastContext);
433
- if (!ctx) throw new Error("useToast must be used within a ToastProvider");
434
- return ctx;
435
- }
436
- /** Renders the positioned toast stack. */
437
- function ToastContainer({ toasts, position, pauseOnHover, isPaused, onDismiss, onPauseChange }) {
438
- const posClass = (() => {
439
- switch (position) {
440
- case "top-left": return "topLeft";
441
- case "top-center": return "topCenter";
442
- case "bottom-right": return "bottomRight";
443
- case "bottom-left": return "bottomLeft";
444
- case "bottom-center": return "bottomCenter";
445
- default: return "topRight";
446
- }
447
- })();
448
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [toasts.map((toast) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastItem, {
449
- toast,
450
- isPaused,
451
- onDismiss
452
- }, toast.id)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Viewport, {
453
- className: cx(toast_module_default.stack, toast_module_default[posClass]),
454
- label: "Notifications",
455
- onMouseEnter: () => pauseOnHover && onPauseChange(true),
456
- onMouseLeave: () => pauseOnHover && onPauseChange(false)
457
- })] });
458
- }
459
- /** Individual toast item with timers and actions. */
460
- function ToastItem({ toast, isPaused, onDismiss }) {
461
- const [open, setOpen] = (0, react.useState)(true);
462
- const [copyState, setCopyState] = (0, react.useState)("idle");
463
- const copyTimerRef = (0, react.useRef)(null);
464
- const timerRef = (0, react.useRef)(null);
465
- const startRef = (0, react.useRef)(0);
466
- const remainingRef = (0, react.useRef)(toast.duration ?? 0);
467
- const closingRef = (0, react.useRef)(false);
468
- const palette = getPalette(toast.type);
469
- const styleVars = {
470
- ["--toast-bg"]: palette.background,
471
- ["--toast-border"]: palette.border,
472
- ["--toast-accent"]: palette.accent,
473
- ["--toast-text"]: palette.text,
474
- ["--toast-action-bg"]: palette.actionBg,
475
- ["--toast-action-border"]: palette.actionBorder
476
- };
477
- const stopTimer = () => {
478
- if (timerRef.current) {
479
- window.clearTimeout(timerRef.current);
480
- timerRef.current = null;
481
- }
482
- };
483
- const triggerDismiss = (0, react.useCallback)(() => {
484
- if (closingRef.current) return;
485
- closingRef.current = true;
486
- setOpen(false);
487
- stopTimer();
488
- window.setTimeout(() => onDismiss(toast.id), 160);
489
- }, [onDismiss, toast.id]);
490
- const schedule = (0, react.useCallback)((delay) => {
491
- if (!delay || delay <= 0) {
492
- triggerDismiss();
493
- return;
494
- }
495
- startRef.current = performance.now();
496
- stopTimer();
497
- timerRef.current = window.setTimeout(() => triggerDismiss(), delay);
498
- }, [triggerDismiss]);
499
- (0, react.useEffect)(() => {
500
- if (!toast.duration || toast.duration <= 0) return void 0;
501
- schedule(toast.duration);
502
- return stopTimer;
503
- }, [schedule, toast.duration]);
504
- (0, react.useEffect)(() => {
505
- if (!toast.duration || toast.duration <= 0) return;
506
- if (isPaused) {
507
- const elapsed = performance.now() - startRef.current;
508
- remainingRef.current = Math.max(0, remainingRef.current - elapsed);
509
- stopTimer();
510
- } else schedule(remainingRef.current);
511
- }, [
512
- isPaused,
513
- schedule,
514
- toast.duration
515
- ]);
516
- (0, react.useEffect)(() => {
517
- return () => {
518
- if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);
519
- };
520
- }, []);
521
- const handleCopy = (0, react.useCallback)(async () => {
522
- if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);
523
- try {
524
- if (!navigator.clipboard) throw new Error("Clipboard API unavailable");
525
- await navigator.clipboard.writeText(toast.message);
526
- setCopyState("copied");
527
- } catch {
528
- setCopyState("failed");
529
- }
530
- copyTimerRef.current = window.setTimeout(() => setCopyState("idle"), 1800);
531
- }, [toast.message]);
532
- const icon = getIcon(toast.type);
533
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Root, {
534
- open,
535
- onOpenChange: (nextOpen) => {
536
- if (!nextOpen) triggerDismiss();
537
- },
538
- duration: 2147483647,
539
- className: toast_module_default.toast,
540
- style: styleVars,
541
- children: [
542
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
543
- className: toast_module_default.icon,
544
- "aria-hidden": true,
545
- children: icon
546
- }),
547
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
548
- className: toast_module_default.body,
549
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Description, {
550
- className: toast_module_default.message,
551
- children: toast.message
552
- }), toast.action && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
553
- className: toast_module_default.actions,
554
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Action, {
555
- asChild: true,
556
- altText: toast.action.label,
557
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
558
- type: "button",
559
- className: toast_module_default.actionButton,
560
- onClick: () => {
561
- toast.action?.onClick();
562
- triggerDismiss();
563
- },
564
- children: toast.action.label
565
- })
566
- })
567
- })]
568
- }),
569
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
570
- className: toast_module_default.controls,
571
- children: [toast.copyable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
572
- type: "button",
573
- className: cx(toast_module_default.iconButton, copyState === "failed" && toast_module_default.iconButtonError),
574
- "aria-label": "Copy message",
575
- onClick: handleCopy,
576
- children: copyState === "copied" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
577
- width: "13",
578
- height: "13",
579
- viewBox: "0 0 13 13",
580
- fill: "none",
581
- "aria-hidden": true,
582
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
583
- d: "M2 6.5l3 3 6-6",
584
- stroke: "currentColor",
585
- strokeWidth: "1.5",
586
- strokeLinecap: "round",
587
- strokeLinejoin: "round"
588
- })
589
- }) : copyState === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
590
- width: "13",
591
- height: "13",
592
- viewBox: "0 0 13 13",
593
- fill: "none",
594
- "aria-hidden": true,
595
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
596
- d: "M10 3L3 10M3 3l7 7",
597
- stroke: "currentColor",
598
- strokeWidth: "1.5",
599
- strokeLinecap: "round"
600
- })
601
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
602
- width: "13",
603
- height: "13",
604
- viewBox: "0 0 13 13",
605
- fill: "none",
606
- "aria-hidden": true,
607
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
608
- x: "4.5",
609
- y: "1.5",
610
- width: "7",
611
- height: "7",
612
- rx: "1.5",
613
- stroke: "currentColor",
614
- strokeWidth: "1.25"
615
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
616
- d: "M1.5 5.5v5a1.5 1.5 0 001.5 1.5h5",
617
- stroke: "currentColor",
618
- strokeWidth: "1.25",
619
- strokeLinecap: "round"
620
- })]
621
- })
622
- }), toast.dismissible !== false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Close, {
623
- asChild: true,
624
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
625
- type: "button",
626
- className: toast_module_default.iconButton,
627
- "aria-label": "Dismiss notification",
628
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
629
- width: "13",
630
- height: "13",
631
- viewBox: "0 0 13 13",
632
- fill: "none",
633
- "aria-hidden": true,
634
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
635
- d: "M10 3L3 10M3 3l7 7",
636
- stroke: "currentColor",
637
- strokeWidth: "1.5",
638
- strokeLinecap: "round"
639
- })
640
- })
641
- })
642
- })]
643
- })
644
- ]
645
- });
646
- }
647
- function getPalette(type) {
648
- switch (type) {
649
- case "success": return {
650
- background: "color-mix(in srgb, var(--success) 12%, var(--popover))",
651
- border: "color-mix(in srgb, var(--success) 30%, transparent)",
652
- accent: "var(--success)",
653
- text: "var(--popover-foreground)",
654
- actionBg: "color-mix(in srgb, var(--success) 14%, transparent)",
655
- actionBorder: "color-mix(in srgb, var(--success) 35%, transparent)"
656
- };
657
- case "error": return {
658
- background: "color-mix(in srgb, var(--destructive) 12%, var(--popover))",
659
- border: "color-mix(in srgb, var(--destructive) 30%, transparent)",
660
- accent: "var(--destructive)",
661
- text: "var(--popover-foreground)",
662
- actionBg: "color-mix(in srgb, var(--destructive) 14%, transparent)",
663
- actionBorder: "color-mix(in srgb, var(--destructive) 35%, transparent)"
664
- };
665
- case "warning": return {
666
- background: "color-mix(in srgb, var(--warning) 12%, var(--popover))",
667
- border: "color-mix(in srgb, var(--warning) 30%, transparent)",
668
- accent: "var(--warning)",
669
- text: "var(--popover-foreground)",
670
- actionBg: "color-mix(in srgb, var(--warning) 14%, transparent)",
671
- actionBorder: "color-mix(in srgb, var(--warning) 35%, transparent)"
672
- };
673
- default: return {
674
- background: "color-mix(in srgb, var(--primary) 12%, var(--popover))",
675
- border: "color-mix(in srgb, var(--primary) 30%, transparent)",
676
- accent: "var(--primary)",
677
- text: "var(--popover-foreground)",
678
- actionBg: "color-mix(in srgb, var(--primary) 14%, transparent)",
679
- actionBorder: "color-mix(in srgb, var(--primary) 35%, transparent)"
680
- };
681
- }
682
- }
683
- function getIcon(type) {
684
- switch (type) {
685
- case "success": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
686
- width: "16",
687
- height: "16",
688
- viewBox: "0 0 16 16",
689
- fill: "none",
690
- "aria-hidden": true,
691
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
692
- d: "M3 8l3.5 3.5L13 4.5",
693
- stroke: "currentColor",
694
- strokeWidth: "1.75",
695
- strokeLinecap: "round",
696
- strokeLinejoin: "round"
697
- })
698
- });
699
- case "error": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
700
- width: "16",
701
- height: "16",
702
- viewBox: "0 0 16 16",
703
- fill: "none",
704
- "aria-hidden": true,
705
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
706
- d: "M4 4l8 8M12 4l-8 8",
707
- stroke: "currentColor",
708
- strokeWidth: "1.75",
709
- strokeLinecap: "round"
710
- })
711
- });
712
- case "warning": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
713
- width: "16",
714
- height: "16",
715
- viewBox: "0 0 16 16",
716
- fill: "none",
717
- "aria-hidden": true,
718
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
719
- d: "M8 3v6M8 11.5v1",
720
- stroke: "currentColor",
721
- strokeWidth: "1.75",
722
- strokeLinecap: "round"
723
- })
724
- });
725
- default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
726
- width: "16",
727
- height: "16",
728
- viewBox: "0 0 16 16",
729
- fill: "none",
730
- "aria-hidden": true,
731
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
732
- d: "M8 7v5M8 4.5v.5",
733
- stroke: "currentColor",
734
- strokeWidth: "1.75",
735
- strokeLinecap: "round"
736
- })
737
- });
738
- }
739
- }
740
- var input_module_default = { input: "uzi-input-module__input__-ipHD" };
741
- //#endregion
742
- //#region src/components/input/Input.tsx
743
- var Input = react.forwardRef(({ className, type, ...props }, ref) => {
744
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
745
- ref,
746
- type,
747
- className: cx(input_module_default.input, className),
748
- ...props
749
- });
750
- });
751
- Input.displayName = "Input";
752
- var label_module_default = { label: "uzi-label-module__label__gKflt" };
753
- //#endregion
754
- //#region src/components/label/Label.tsx
755
- var Label = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
756
- ref,
757
- className: cx(label_module_default.label, className),
758
- ...props
759
- }));
760
- Label.displayName = "Label";
761
- var checkbox_module_default = { checkbox: "uzi-checkbox-module__checkbox__zAB1y" };
762
- //#endregion
763
- //#region src/components/checkbox/Checkbox.tsx
764
- var Checkbox = react.forwardRef(({ className, ...props }, ref) => {
765
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
766
- ref,
767
- type: "checkbox",
768
- className: cx(checkbox_module_default.checkbox, className),
769
- ...props
770
- });
771
- });
772
- Checkbox.displayName = "Checkbox";
773
- var multi_select_module_default = {
774
- wrapper: "uzi-multi-select-module__wrapper__Izj2x",
775
- wrapperFullWidth: "uzi-multi-select-module__wrapperFullWidth__eH8pf",
776
- trigger: "uzi-multi-select-module__trigger__r3816",
777
- value: "uzi-multi-select-module__value__PuUmG",
778
- placeholder: "uzi-multi-select-module__placeholder__dJIU-",
779
- chip: "uzi-multi-select-module__chip__46Ms-",
780
- chipSummary: "uzi-multi-select-module__chipSummary__zLwi8",
781
- chevron: "uzi-multi-select-module__chevron__SWK5l",
782
- menu: "uzi-multi-select-module__menu__q8auA",
783
- menuFadeIn: "uzi-multi-select-module__menuFadeIn__Plo7-",
784
- option: "uzi-multi-select-module__option__-Ioqk",
785
- optionDisabled: "uzi-multi-select-module__optionDisabled__qtCi8",
786
- optionSelected: "uzi-multi-select-module__optionSelected__74IO8",
787
- optionLabel: "uzi-multi-select-module__optionLabel__cVoN7",
788
- indicator: "uzi-multi-select-module__indicator__NO-WE",
789
- indicatorSelected: "uzi-multi-select-module__indicatorSelected__9sEAy",
790
- indicatorDisabled: "uzi-multi-select-module__indicatorDisabled__vqdiH"
791
- };
792
- //#endregion
793
- //#region src/components/multi-select/MultiSelect.tsx
794
- var MultiSelect = react.forwardRef(({ options, value, onChange, placeholder = "Select options", fullWidth = true, maxVisibleValues = 2, className, disabled = false, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }, ref) => {
795
- const selectedSet = react.useMemo(() => new Set(value), [value]);
796
- const selectedOptions = react.useMemo(() => options.filter((opt) => selectedSet.has(opt.value)), [options, selectedSet]);
797
- const toggleValue = react.useCallback((nextValue) => {
798
- if (selectedSet.has(nextValue)) {
799
- onChange(value.filter((entry) => entry !== nextValue));
800
- return;
801
- }
802
- onChange([...value, nextValue]);
803
- }, [
804
- onChange,
805
- selectedSet,
806
- value
807
- ]);
808
- const visibleCount = Math.max(1, maxVisibleValues);
809
- const visibleOptions = selectedOptions.slice(0, visibleCount);
810
- const overflowCount = Math.max(0, selectedOptions.length - visibleOptions.length);
811
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Root, {
812
- modal: false,
813
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
814
- className: cx(multi_select_module_default.wrapper, fullWidth && multi_select_module_default.wrapperFullWidth, className),
815
- children: [
816
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Trigger, {
817
- asChild: true,
818
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
819
- ref,
820
- type: "button",
821
- className: multi_select_module_default.trigger,
822
- "aria-label": ariaLabel,
823
- "aria-labelledby": ariaLabelledBy,
824
- disabled,
825
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
826
- className: multi_select_module_default.value,
827
- children: selectedOptions.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
828
- className: multi_select_module_default.placeholder,
829
- children: placeholder
830
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [visibleOptions.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
831
- className: multi_select_module_default.chip,
832
- children: option.label
833
- }, option.value)), overflowCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
834
- className: cx(multi_select_module_default.chip, multi_select_module_default.chipSummary),
835
- children: ["+", overflowCount]
836
- }) : null] })
837
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
838
- className: multi_select_module_default.chevron,
839
- "aria-hidden": "true",
840
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
841
- viewBox: "0 0 10 10",
842
- fill: "none",
843
- xmlns: "http://www.w3.org/2000/svg",
844
- width: "10",
845
- height: "10",
846
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
847
- d: "M2 3.5L5 6.5L8 3.5",
848
- stroke: "currentColor",
849
- strokeWidth: "1.5",
850
- strokeLinecap: "round",
851
- strokeLinejoin: "round"
852
- })
853
- })
854
- })]
855
- })
856
- }),
857
- name ? value.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
858
- type: "hidden",
859
- name,
860
- value: entry
861
- }, entry)) : null,
862
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
863
- className: multi_select_module_default.menu,
864
- sideOffset: 4,
865
- align: "start",
866
- children: options.map((option) => {
867
- const selected = selectedSet.has(option.value);
868
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
869
- className: cx(multi_select_module_default.option, selected && multi_select_module_default.optionSelected, option.disabled && multi_select_module_default.optionDisabled),
870
- checked: selected,
871
- disabled: option.disabled,
872
- onCheckedChange: () => toggleValue(option.value),
873
- onSelect: (event) => event.preventDefault(),
874
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
875
- className: cx(multi_select_module_default.indicator, selected && multi_select_module_default.indicatorSelected, option.disabled && multi_select_module_default.indicatorDisabled),
876
- "aria-hidden": "true",
877
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, {
878
- forceMount: true,
879
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
880
- viewBox: "0 0 16 16",
881
- width: "16",
882
- height: "16",
883
- fill: "none",
884
- xmlns: "http://www.w3.org/2000/svg",
885
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
886
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
887
- stroke: "currentColor",
888
- strokeWidth: "1.8",
889
- strokeLinecap: "round",
890
- strokeLinejoin: "round"
891
- })
892
- })
893
- })
894
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
895
- className: multi_select_module_default.optionLabel,
896
- children: option.label
897
- })]
898
- }, option.value);
899
- })
900
- }) })
901
- ]
902
- })
903
- });
904
- });
905
- MultiSelect.displayName = "MultiSelect";
906
- var select_module_default = {
907
- wrapper: "uzi-select-module__wrapper__7szq0",
908
- wrapperFullWidth: "uzi-select-module__wrapperFullWidth__IyOIG",
909
- trigger: "uzi-select-module__trigger__ldh8w",
910
- value: "uzi-select-module__value__FTUJh",
911
- chevron: "uzi-select-module__chevron__U6HXS",
912
- content: "uzi-select-module__content__pOWWy",
913
- selectFadeIn: "uzi-select-module__selectFadeIn__Z-yKX",
914
- viewport: "uzi-select-module__viewport__VGZM6",
915
- item: "uzi-select-module__item__6uM6-",
916
- indicator: "uzi-select-module__indicator__ZHcg5",
917
- indicatorIcon: "uzi-select-module__indicatorIcon__kOV2G"
918
- };
919
- //#endregion
920
- //#region src/components/select/Select.tsx
921
- var EMPTY_OPTION_VALUE = "__uzi_select_empty__";
922
- var Select = react.forwardRef(({ options, value, onChange, placeholder, allowEmptyOption = false, fullWidth = true, className, id, name, disabled, required, autoComplete, form, title, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onBlur, onFocus }, ref) => {
923
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
924
- className: cx(select_module_default.wrapper, fullWidth && select_module_default.wrapperFullWidth, className),
925
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Root, {
926
- value,
927
- onValueChange: (nextValue) => onChange(nextValue === EMPTY_OPTION_VALUE ? "" : nextValue),
928
- name,
929
- disabled,
930
- required,
931
- autoComplete,
932
- form,
933
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Trigger, {
934
- ref,
935
- id,
936
- className: select_module_default.trigger,
937
- title,
938
- "aria-label": ariaLabel,
939
- "aria-labelledby": ariaLabelledBy,
940
- onBlur,
941
- onFocus,
942
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, {
943
- className: select_module_default.value,
944
- placeholder
945
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Icon, {
946
- className: select_module_default.chevron,
947
- "aria-hidden": "true",
948
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
949
- viewBox: "0 0 10 10",
950
- fill: "none",
951
- xmlns: "http://www.w3.org/2000/svg",
952
- width: "10",
953
- height: "10",
954
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
955
- d: "M2 3.5L5 6.5L8 3.5",
956
- stroke: "currentColor",
957
- strokeWidth: "1.5",
958
- strokeLinecap: "round",
959
- strokeLinejoin: "round"
960
- })
961
- })
962
- })]
963
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Content, {
964
- className: select_module_default.content,
965
- position: "popper",
966
- sideOffset: 4,
967
- align: "start",
968
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Viewport, {
969
- className: select_module_default.viewport,
970
- children: [placeholder && allowEmptyOption ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
971
- value: EMPTY_OPTION_VALUE,
972
- className: select_module_default.item,
973
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
974
- className: select_module_default.indicator,
975
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
976
- viewBox: "0 0 16 16",
977
- width: "16",
978
- height: "16",
979
- "aria-hidden": "true",
980
- className: select_module_default.indicatorIcon,
981
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
982
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
983
- fill: "none",
984
- stroke: "currentColor",
985
- strokeWidth: "1.8",
986
- strokeLinecap: "round",
987
- strokeLinejoin: "round"
988
- })
989
- }) })
990
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children: placeholder })]
991
- }) : null, options.map((opt) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
992
- value: opt.value,
993
- disabled: opt.disabled,
994
- className: select_module_default.item,
995
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
996
- className: select_module_default.indicator,
997
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
998
- viewBox: "0 0 16 16",
999
- width: "16",
1000
- height: "16",
1001
- "aria-hidden": "true",
1002
- className: select_module_default.indicatorIcon,
1003
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1004
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
1005
- fill: "none",
1006
- stroke: "currentColor",
1007
- strokeWidth: "1.8",
1008
- strokeLinecap: "round",
1009
- strokeLinejoin: "round"
1010
- })
1011
- }) })
1012
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children: opt.label })]
1013
- }, opt.value))]
1014
- })
1015
- }) })]
1016
- })
1017
- });
1018
- });
1019
- Select.displayName = "Select";
1020
- //#endregion
1021
- //#region src/components/dropdown/Dropdown.tsx
1022
- /**
1023
- * @deprecated Use Select for value selection and DropdownMenu for action menus.
1024
- * Dropdown remains as a compatibility alias during migration.
1025
- */
1026
- var Dropdown = react.forwardRef(({ options, value, onChange, placeholder = "All", allowClear = true, ...rest }, ref) => {
1027
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
1028
- ref,
1029
- options,
1030
- value,
1031
- onChange,
1032
- placeholder,
1033
- allowEmptyOption: allowClear,
1034
- fullWidth: false,
1035
- ...rest
1036
- });
1037
- });
1038
- Dropdown.displayName = "Dropdown";
1039
- var dropdown_menu_module_default = {
1040
- content: "uzi-dropdown-menu-module__content__n-ElH",
1041
- menuFadeIn: "uzi-dropdown-menu-module__menuFadeIn__ITxMo",
1042
- item: "uzi-dropdown-menu-module__item__tBNtW",
1043
- itemDestructive: "uzi-dropdown-menu-module__itemDestructive__oWmKd",
1044
- insetItem: "uzi-dropdown-menu-module__insetItem__g7ONJ",
1045
- indicator: "uzi-dropdown-menu-module__indicator__5qwFh",
1046
- indicatorIcon: "uzi-dropdown-menu-module__indicatorIcon__nhJMw",
1047
- radioDot: "uzi-dropdown-menu-module__radioDot__GWUVT",
1048
- label: "uzi-dropdown-menu-module__label__sFnNR",
1049
- separator: "uzi-dropdown-menu-module__separator__PgUob",
1050
- chevron: "uzi-dropdown-menu-module__chevron__kxfiF"
1051
- };
1052
- //#endregion
1053
- //#region src/components/dropdown-menu/DropdownMenu.tsx
1054
- function DropdownMenu(props) {
1055
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Root, { ...props });
1056
- }
1057
- function DropdownMenuTrigger(props) {
1058
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Trigger, { ...props });
1059
- }
1060
- function DropdownMenuGroup(props) {
1061
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Group, { ...props });
1062
- }
1063
- function DropdownMenuPortal(props) {
1064
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { ...props });
1065
- }
1066
- function DropdownMenuSub(props) {
1067
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Sub, { ...props });
1068
- }
1069
- function DropdownMenuRadioGroup(props) {
1070
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.RadioGroup, { ...props });
1071
- }
1072
- function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
1073
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
1074
- sideOffset,
1075
- className: cx(dropdown_menu_module_default.content, className),
1076
- ...props
1077
- }) });
1078
- }
1079
- function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
1080
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Item, {
1081
- "data-inset": inset ? "true" : void 0,
1082
- className: cx(dropdown_menu_module_default.item, variant === "destructive" && dropdown_menu_module_default.itemDestructive, className),
1083
- ...props
1084
- });
1085
- }
1086
- function DropdownMenuCheckboxItem({ className, children, ...props }) {
1087
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
1088
- className: cx(dropdown_menu_module_default.item, dropdown_menu_module_default.insetItem, className),
1089
- ...props,
1090
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1091
- className: dropdown_menu_module_default.indicator,
1092
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
1093
- viewBox: "0 0 16 16",
1094
- width: "16",
1095
- height: "16",
1096
- "aria-hidden": "true",
1097
- className: dropdown_menu_module_default.indicatorIcon,
1098
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1099
- d: "M3.5 8.5 6.5 11.5 12.5 4.5",
1100
- fill: "none",
1101
- stroke: "currentColor",
1102
- strokeWidth: "1.8",
1103
- strokeLinecap: "round",
1104
- strokeLinejoin: "round"
1105
- })
1106
- }) })
1107
- }), children]
1108
- });
1109
- }
1110
- function DropdownMenuRadioItem({ className, children, ...props }) {
1111
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.RadioItem, {
1112
- className: cx(dropdown_menu_module_default.item, dropdown_menu_module_default.insetItem, className),
1113
- ...props,
1114
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1115
- className: dropdown_menu_module_default.indicator,
1116
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: dropdown_menu_module_default.radioDot }) })
1117
- }), children]
1118
- });
1119
- }
1120
- function DropdownMenuLabel({ className, inset, ...props }) {
1121
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Label, {
1122
- "data-inset": inset ? "true" : void 0,
1123
- className: cx(dropdown_menu_module_default.label, className),
1124
- ...props
1125
- });
1126
- }
1127
- function DropdownMenuSeparator({ className, ...props }) {
1128
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
1129
- className: cx(dropdown_menu_module_default.separator, className),
1130
- ...props
1131
- });
1132
- }
1133
- function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
1134
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
1135
- "data-inset": inset ? "true" : void 0,
1136
- className: cx(dropdown_menu_module_default.item, className),
1137
- ...props,
1138
- children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
1139
- viewBox: "0 0 16 16",
1140
- width: "16",
1141
- height: "16",
1142
- "aria-hidden": "true",
1143
- className: dropdown_menu_module_default.chevron,
1144
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1145
- d: "M6 3.5 10.5 8 6 12.5",
1146
- fill: "none",
1147
- stroke: "currentColor",
1148
- strokeWidth: "1.6",
1149
- strokeLinecap: "round",
1150
- strokeLinejoin: "round"
1151
- })
1152
- })]
1153
- });
1154
- }
1155
- function DropdownMenuSubContent({ className, ...props }) {
1156
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
1157
- className: cx(dropdown_menu_module_default.content, className),
1158
- ...props
1159
- });
1160
- }
1161
- //#endregion
1162
- //#region src/theme/constants.ts
1163
- var UZI_THEMES = [
1164
- "light",
1165
- "dark",
1166
- "system"
1167
- ];
1168
- var UZI_ACCENTS = [
1169
- "blue",
1170
- "cyan",
1171
- "violet",
1172
- "emerald",
1173
- "amber",
1174
- "rose"
1175
- ];
1176
- var THEME_STORAGE_KEY$1 = "uzi-theme";
1177
- var ACCENT_STORAGE_KEY$1 = "uzi-accent";
1178
- //#endregion
1179
- //#region src/theme/ThemeProvider.tsx
1180
- var THEME_STORAGE_KEY = THEME_STORAGE_KEY$1;
1181
- var ACCENT_STORAGE_KEY = ACCENT_STORAGE_KEY$1;
1182
- var THEME_ATTRIBUTE = "data-uzi-theme";
1183
- var ACCENT_ATTRIBUTE = "data-uzi-accent";
1184
- var ThemeContext = (0, react.createContext)(void 0);
1185
- function isTheme(value) {
1186
- return UZI_THEMES.includes(value);
1187
- }
1188
- function isAccent(value) {
1189
- return UZI_ACCENTS.includes(value);
1190
- }
1191
- function getSystemTheme() {
1192
- if (typeof window === "undefined") return "light";
1193
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1194
- }
1195
- function ThemeProvider({ children, theme, defaultTheme = "system", accent, defaultAccent = "blue", onThemeChange, onAccentChange, storageKey = THEME_STORAGE_KEY, accentStorageKey = ACCENT_STORAGE_KEY, disableStorage = false, toastConfig }) {
1196
- const [internalTheme, setInternalTheme] = (0, react.useState)(defaultTheme);
1197
- const [internalAccent, setInternalAccent] = (0, react.useState)(defaultAccent);
1198
- const [systemTheme, setSystemTheme] = (0, react.useState)("light");
1199
- (0, react.useEffect)(() => {
1200
- setSystemTheme(getSystemTheme());
1201
- if (!disableStorage) {
1202
- const storedTheme = window.localStorage.getItem(storageKey);
1203
- if (isTheme(storedTheme)) setInternalTheme(storedTheme);
1204
- const storedAccent = window.localStorage.getItem(accentStorageKey);
1205
- if (isAccent(storedAccent)) setInternalAccent(storedAccent);
1206
- }
1207
- }, [
1208
- disableStorage,
1209
- storageKey,
1210
- accentStorageKey
1211
- ]);
1212
- const isThemeControlled = theme !== void 0;
1213
- const isAccentControlled = accent !== void 0;
1214
- const currentTheme = isThemeControlled ? theme : internalTheme;
1215
- const currentAccent = isAccentControlled ? accent : internalAccent;
1216
- const resolvedTheme = currentTheme === "system" ? systemTheme : currentTheme;
1217
- (0, react.useEffect)(() => {
1218
- if (typeof window === "undefined") return;
1219
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
1220
- const handleChange = () => setSystemTheme(mediaQuery.matches ? "dark" : "light");
1221
- handleChange();
1222
- mediaQuery.addEventListener("change", handleChange);
1223
- return () => mediaQuery.removeEventListener("change", handleChange);
1224
- }, []);
1225
- (0, react.useEffect)(() => {
1226
- if (typeof document === "undefined") return;
1227
- const root = document.documentElement;
1228
- root.setAttribute(THEME_ATTRIBUTE, resolvedTheme);
1229
- root.setAttribute(ACCENT_ATTRIBUTE, currentAccent);
1230
- root.style.colorScheme = resolvedTheme;
1231
- root.classList.toggle("dark", resolvedTheme === "dark");
1232
- }, [currentAccent, resolvedTheme]);
1233
- const setTheme = (0, react.useCallback)((nextTheme) => {
1234
- if (!isThemeControlled) setInternalTheme(nextTheme);
1235
- if (!disableStorage && typeof window !== "undefined") window.localStorage.setItem(storageKey, nextTheme);
1236
- onThemeChange?.(nextTheme);
1237
- }, [
1238
- disableStorage,
1239
- isThemeControlled,
1240
- onThemeChange,
1241
- storageKey
1242
- ]);
1243
- const setAccent = (0, react.useCallback)((nextAccent) => {
1244
- if (!isAccentControlled) setInternalAccent(nextAccent);
1245
- if (!disableStorage && typeof window !== "undefined") window.localStorage.setItem(accentStorageKey, nextAccent);
1246
- onAccentChange?.(nextAccent);
1247
- }, [
1248
- accentStorageKey,
1249
- disableStorage,
1250
- isAccentControlled,
1251
- onAccentChange
1252
- ]);
1253
- const toggleTheme = (0, react.useCallback)(() => {
1254
- setTheme(resolvedTheme === "dark" ? "light" : "dark");
1255
- }, [resolvedTheme, setTheme]);
1256
- const value = (0, react.useMemo)(() => ({
1257
- theme: currentTheme,
1258
- resolvedTheme,
1259
- accent: currentAccent,
1260
- setTheme,
1261
- setAccent,
1262
- toggleTheme
1263
- }), [
1264
- currentAccent,
1265
- currentTheme,
1266
- resolvedTheme,
1267
- setAccent,
1268
- setTheme,
1269
- toggleTheme
1270
- ]);
1271
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
1272
- value,
1273
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastProvider, {
1274
- config: toastConfig,
1275
- children
1276
- })
1277
- });
1278
- }
1279
- function useTheme() {
1280
- const context = (0, react.useContext)(ThemeContext);
1281
- if (!context) throw new Error("useTheme must be used within a ThemeProvider");
1282
- return context;
1283
- }
1284
- var theme_toggle_button_module_default = { withLabel: "uzi-theme-toggle-button-module__withLabel__KqtDj" };
1285
- //#endregion
1286
- //#region src/components/theme-toggle-button/ThemeToggleButton.tsx
1287
- function MoonIcon() {
1288
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
1289
- viewBox: "0 0 24 24",
1290
- "aria-hidden": "true",
1291
- width: "16",
1292
- height: "16",
1293
- fill: "none",
1294
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1295
- d: "M20 15.2A8.5 8.5 0 0 1 8.8 4 9 9 0 1 0 20 15.2Z",
1296
- stroke: "currentColor",
1297
- strokeWidth: "1.8",
1298
- strokeLinecap: "round",
1299
- strokeLinejoin: "round"
1300
- })
1301
- });
1302
- }
1303
- function SunIcon() {
1304
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1305
- viewBox: "0 0 24 24",
1306
- "aria-hidden": "true",
1307
- width: "16",
1308
- height: "16",
1309
- fill: "none",
1310
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1311
- cx: "12",
1312
- cy: "12",
1313
- r: "4",
1314
- stroke: "currentColor",
1315
- strokeWidth: "1.8"
1316
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1317
- 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",
1318
- stroke: "currentColor",
1319
- strokeWidth: "1.8",
1320
- strokeLinecap: "round"
1321
- })]
1322
- });
1323
- }
1324
- function ThemeToggleButton({ showLabel = false, lightLabel = "Light mode", darkLabel = "Dark mode", className, onClick, ...rest }) {
1325
- const { resolvedTheme, toggleTheme } = useTheme();
1326
- const nextThemeLabel = resolvedTheme === "dark" ? lightLabel : darkLabel;
1327
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
1328
- type: "button",
1329
- variant: "ghost",
1330
- size: showLabel ? "sm" : "icon",
1331
- className: cx(showLabel && theme_toggle_button_module_default.withLabel, className),
1332
- "aria-label": `Switch to ${nextThemeLabel.toLowerCase()}`,
1333
- title: `Switch to ${nextThemeLabel.toLowerCase()}`,
1334
- onClick: (event) => {
1335
- onClick?.(event);
1336
- if (!event.defaultPrevented) toggleTheme();
1337
- },
1338
- ...rest,
1339
- children: [resolvedTheme === "dark" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SunIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MoonIcon, {}), showLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: nextThemeLabel })]
1340
- });
1341
- }
1342
- var top_bar_module_default = {
1343
- topBar: "uzi-top-bar-module__topBar__MJ-7S",
1344
- topBarStatic: "uzi-top-bar-module__topBarStatic__JvEwt",
1345
- topBarInner: "uzi-top-bar-module__topBarInner__PBbi8",
1346
- topBarStart: "uzi-top-bar-module__topBarStart__DrdN2",
1347
- topBarBrand: "uzi-top-bar-module__topBarBrand__80VV3",
1348
- topBarBrandContent: "uzi-top-bar-module__topBarBrandContent__O4Uto",
1349
- topBarCenter: "uzi-top-bar-module__topBarCenter__Kwxg-",
1350
- topBarCenterGroup: "uzi-top-bar-module__topBarCenterGroup__7Ishp",
1351
- topBarActions: "uzi-top-bar-module__topBarActions__mgMd8"
1352
- };
1353
- //#endregion
1354
- //#region src/components/top-bar/TopBar.tsx
1355
- function TopBar({ leading, brand, brandHref, brandingLocation = "left", start, center, actions, showThemeToggle = false, themeToggleProps, className, innerClassName, isSticky, sticky = true, children, ...rest }) {
1356
- const shouldStick = isSticky ?? sticky;
1357
- const brandNode = !brand ? null : brandHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1358
- href: brandHref,
1359
- className: top_bar_module_default.topBarBrand,
1360
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1361
- className: top_bar_module_default.topBarBrandContent,
1362
- children: brand
1363
- })
1364
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1365
- className: top_bar_module_default.topBarBrand,
1366
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1367
- className: top_bar_module_default.topBarBrandContent,
1368
- children: brand
1369
- })
1370
- });
1371
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
1372
- className: cx(top_bar_module_default.topBar, !shouldStick && top_bar_module_default.topBarStatic, className),
1373
- ...rest,
1374
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1375
- className: cx(top_bar_module_default.topBarInner, innerClassName),
1376
- children: [
1377
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1378
- className: top_bar_module_default.topBarStart,
1379
- children: [
1380
- leading,
1381
- brandingLocation === "left" && brandNode,
1382
- start
1383
- ]
1384
- }),
1385
- brandNode && brandingLocation === "center" || center || children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1386
- className: top_bar_module_default.topBarCenter,
1387
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1388
- className: top_bar_module_default.topBarCenterGroup,
1389
- children: [brandingLocation === "center" && brandNode, center ?? children]
1390
- })
1391
- }) : null,
1392
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1393
- className: top_bar_module_default.topBarActions,
1394
- children: [showThemeToggle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeToggleButton, { ...themeToggleProps }), actions]
1395
- })
1396
- ]
1397
- })
1398
- });
1399
- }
1400
- var app_shell_module_default = {
1401
- appShell: "uzi-app-shell-module__appShell__S0cVI",
1402
- appShellAnimated: "uzi-app-shell-module__appShellAnimated__-CRIl",
1403
- appShellOpen: "uzi-app-shell-module__appShellOpen__1rZUl",
1404
- appShellCollapsed: "uzi-app-shell-module__appShellCollapsed__fSasN",
1405
- appShellTopbar: "uzi-app-shell-module__appShellTopbar__rgXsW",
1406
- appShellTopbarLeft: "uzi-app-shell-module__appShellTopbarLeft__-EVuB",
1407
- appShellTopbarStart: "uzi-app-shell-module__appShellTopbarStart__XXQpq",
1408
- appShellTopbarRight: "uzi-app-shell-module__appShellTopbarRight__l1G57",
1409
- appShellBrand: "uzi-app-shell-module__appShellBrand__TXwyN",
1410
- appShellHamburger: "uzi-app-shell-module__appShellHamburger__BciFA",
1411
- appShellSidebar: "uzi-app-shell-module__appShellSidebar__oY7uj",
1412
- appShellMain: "uzi-app-shell-module__appShellMain__eHP2r",
1413
- appShellBackdrop: "uzi-app-shell-module__appShellBackdrop__y31xs",
1414
- appShellSidebarOpen: "uzi-app-shell-module__appShellSidebarOpen__Z5AIo"
1415
- };
1416
- //#endregion
1417
- //#region src/components/app-shell/AppShell.tsx
1418
- var DESKTOP_BREAKPOINT = 960;
1419
- function getIsDesktop() {
1420
- if (typeof window === "undefined") return false;
1421
- return window.innerWidth >= DESKTOP_BREAKPOINT;
1422
- }
1423
- /**
1424
- * Responsive application shell with a collapsible sidebar and sticky top bar.
1425
- *
1426
- * - Sidebar opens by default on desktop, collapses on mobile.
1427
- * - Closes on outside click/scroll/touch when in mobile mode.
1428
- * - Provides optional hook to close the sidebar when a prop value changes
1429
- * (e.g., route transitions).
1430
- */
1431
- function AppShell({ children, sidebar, brand, brandHref, topbarStart, topbarEnd, showThemeToggle = false, themeToggleProps, topBarBrandingLocation = "left", className, sidebarClassName, topbarClassName, mainClassName, sidebarWidth, closeSidebarOnChangeKey, hamburgerLabel = "Toggle navigation", onSidebarToggle }) {
1432
- const [isDesktop, setIsDesktop] = (0, react.useState)(false);
1433
- const [sidebarOpen, setSidebarOpen] = (0, react.useState)(false);
1434
- const [transitionsReady, setTransitionsReady] = (0, react.useState)(false);
1435
- const prevIsDesktopRef = (0, react.useRef)(false);
1436
- const closeKeyRef = (0, react.useRef)(closeSidebarOnChangeKey);
1437
- const sidebarRef = (0, react.useRef)(null);
1438
- const hamburgerRef = (0, react.useRef)(null);
1439
- const mainRef = (0, react.useRef)(null);
1440
- const sidebarId = (0, react.useId)();
1441
- (0, react.useEffect)(() => {
1442
- const desktop = getIsDesktop();
1443
- setIsDesktop(desktop);
1444
- setSidebarOpen(desktop);
1445
- prevIsDesktopRef.current = desktop;
1446
- const transitionFrame = window.requestAnimationFrame(() => {
1447
- setTransitionsReady(true);
1448
- });
1449
- const handleResize = () => {
1450
- const nowDesktop = getIsDesktop();
1451
- setIsDesktop(nowDesktop);
1452
- if (nowDesktop !== prevIsDesktopRef.current) {
1453
- setSidebarOpen(nowDesktop);
1454
- prevIsDesktopRef.current = nowDesktop;
1455
- }
1456
- };
1457
- window.addEventListener("resize", handleResize);
1458
- return () => {
1459
- window.cancelAnimationFrame(transitionFrame);
1460
- window.removeEventListener("resize", handleResize);
1461
- };
1462
- }, []);
1463
- (0, react.useEffect)(() => {
1464
- if (isDesktop || !sidebarOpen) return;
1465
- const mainElement = mainRef.current;
1466
- const closeSidebar = () => setSidebarOpen(false);
1467
- const onPointerDown = (e) => {
1468
- const target = e.target;
1469
- if (!target) return;
1470
- if (sidebarRef.current?.contains(target)) return;
1471
- if (hamburgerRef.current?.contains(target)) return;
1472
- closeSidebar();
1473
- };
1474
- const timeoutId = window.setTimeout(() => {
1475
- document.addEventListener("pointerdown", onPointerDown);
1476
- window.addEventListener("scroll", closeSidebar, { passive: true });
1477
- mainElement?.addEventListener("scroll", closeSidebar, { passive: true });
1478
- document.addEventListener("touchmove", closeSidebar, { passive: true });
1479
- }, 10);
1480
- return () => {
1481
- window.clearTimeout(timeoutId);
1482
- document.removeEventListener("pointerdown", onPointerDown);
1483
- window.removeEventListener("scroll", closeSidebar);
1484
- mainElement?.removeEventListener("scroll", closeSidebar);
1485
- document.removeEventListener("touchmove", closeSidebar);
1486
- };
1487
- }, [sidebarOpen, isDesktop]);
1488
- (0, react.useEffect)(() => {
1489
- if (!isDesktop && closeKeyRef.current !== closeSidebarOnChangeKey) setSidebarOpen(false);
1490
- closeKeyRef.current = closeSidebarOnChangeKey;
1491
- }, [closeSidebarOnChangeKey, isDesktop]);
1492
- (0, react.useEffect)(() => {
1493
- onSidebarToggle?.(sidebarOpen);
1494
- }, [sidebarOpen, onSidebarToggle]);
1495
- const toggleSidebar = () => setSidebarOpen((open) => !open);
1496
- const sidebarWidthValue = sidebarWidth === void 0 ? void 0 : typeof sidebarWidth === "number" ? `${sidebarWidth}px` : sidebarWidth;
1497
- const shellStyle = sidebarWidthValue ? { ["--app-shell-sidebar-width"]: sidebarWidthValue } : void 0;
1498
- const shellClasses = cx(app_shell_module_default.appShell, transitionsReady && app_shell_module_default.appShellAnimated, sidebarOpen ? app_shell_module_default.appShellOpen : app_shell_module_default.appShellCollapsed, className);
1499
- const sidebarClasses = cx(app_shell_module_default.appShellSidebar, sidebarOpen && app_shell_module_default.appShellSidebarOpen, sidebarClassName);
1500
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1501
- className: shellClasses,
1502
- style: shellStyle,
1503
- "data-app-shell": true,
1504
- "data-desktop": isDesktop ? "true" : "false",
1505
- "data-sidebar-open": sidebarOpen ? "true" : "false",
1506
- children: [
1507
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopBar, {
1508
- className: cx(app_shell_module_default.appShellTopbar, topbarClassName),
1509
- leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1510
- ref: hamburgerRef,
1511
- type: "button",
1512
- className: app_shell_module_default.appShellHamburger,
1513
- onClick: toggleSidebar,
1514
- "aria-label": hamburgerLabel,
1515
- "aria-expanded": sidebarOpen,
1516
- "aria-controls": sidebarId,
1517
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
1518
- viewBox: "0 0 24 24",
1519
- "aria-hidden": "true",
1520
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1521
- d: "M3 6h18M3 12h18M3 18h18",
1522
- stroke: "currentColor",
1523
- strokeWidth: "2.5",
1524
- strokeLinecap: "round"
1525
- })
1526
- })
1527
- }),
1528
- brand,
1529
- brandHref,
1530
- brandingLocation: topBarBrandingLocation,
1531
- start: topbarStart,
1532
- actions: topbarEnd,
1533
- showThemeToggle,
1534
- themeToggleProps
1535
- }),
1536
- !isDesktop && sidebarOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1537
- className: app_shell_module_default.appShellBackdrop,
1538
- onClick: () => setSidebarOpen(false),
1539
- onTouchStart: () => setSidebarOpen(false),
1540
- "aria-hidden": "true"
1541
- }),
1542
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
1543
- ref: sidebarRef,
1544
- id: sidebarId,
1545
- className: sidebarClasses,
1546
- "aria-label": "Sidebar navigation",
1547
- children: sidebar
1548
- }),
1549
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("main", {
1550
- ref: mainRef,
1551
- className: cx(app_shell_module_default.appShellMain, mainClassName),
1552
- children
1553
- })
1554
- ]
1555
- });
1556
- }
1557
- var sidebar_nav_module_default = {
1558
- sidebarNav: "uzi-sidebar-nav-module__sidebarNav__eUI5c",
1559
- sidebarNavCollapsed: "uzi-sidebar-nav-module__sidebarNavCollapsed__xTM9s",
1560
- header: "uzi-sidebar-nav-module__header__Y4NLy",
1561
- footer: "uzi-sidebar-nav-module__footer__GjWky",
1562
- sections: "uzi-sidebar-nav-module__sections__mXuGQ",
1563
- section: "uzi-sidebar-nav-module__section__yjtCY",
1564
- sectionItems: "uzi-sidebar-nav-module__sectionItems__tNcph",
1565
- sectionLabel: "uzi-sidebar-nav-module__sectionLabel__Wx94m",
1566
- item: "uzi-sidebar-nav-module__item__uMHkJ",
1567
- itemActive: "uzi-sidebar-nav-module__itemActive__wBbiS",
1568
- itemCollapsed: "uzi-sidebar-nav-module__itemCollapsed__jLJN-",
1569
- itemDisabled: "uzi-sidebar-nav-module__itemDisabled__Yf8Il",
1570
- icon: "uzi-sidebar-nav-module__icon__tyrUg",
1571
- itemBody: "uzi-sidebar-nav-module__itemBody__wI0iy",
1572
- labelRow: "uzi-sidebar-nav-module__labelRow__D8sEJ",
1573
- label: "uzi-sidebar-nav-module__label__A-nt6",
1574
- description: "uzi-sidebar-nav-module__description__Xf3Si",
1575
- badge: "uzi-sidebar-nav-module__badge__-hnFd"
1576
- };
1577
- //#endregion
1578
- //#region src/components/sidebar-nav/SidebarNav.tsx
1579
- var isActivePrefix = (item, path) => {
1580
- if (item.active !== void 0) return item.active;
1581
- if (!item.href) return false;
1582
- if (!path) return false;
1583
- if (item.href === "/") return path === "/";
1584
- return path.startsWith(item.href);
1585
- };
1586
- var isActiveExact = (item, path) => {
1587
- if (item.active !== void 0) return item.active;
1588
- if (!item.href) return false;
1589
- if (!path) return false;
1590
- if (item.href === "/") return path === "/";
1591
- const normalizedHref = item.href.endsWith("/") ? item.href.slice(0, -1) : item.href;
1592
- return normalizedHref === path || path.startsWith(`${normalizedHref}/`);
1593
- };
1594
- var isNaturalPrefixMatch = (href, path) => {
1595
- if (href === "/") return path === "/";
1596
- return path.startsWith(href);
1597
- };
1598
- var isNaturalExactMatch = (href, path) => {
1599
- if (href === "/") return path === "/";
1600
- return (href.endsWith("/") ? href.slice(0, -1) : href) === path;
1601
- };
1602
- var hrefLength = (href) => href.endsWith("/") ? href.length - 1 : href.length;
1603
- var findMostSpecific = (items, currentPath) => {
1604
- const result = /* @__PURE__ */ new Set();
1605
- if (!currentPath) return result;
1606
- const matchingItems = items.filter((item) => {
1607
- if (item.disabled || !item.href) return false;
1608
- return item.exact ? isNaturalExactMatch(item.href, currentPath) : isNaturalPrefixMatch(item.href, currentPath);
1609
- });
1610
- if (matchingItems.length === 0) return result;
1611
- let maxLen = 0;
1612
- for (const item of matchingItems) {
1613
- if (!item.href) continue;
1614
- const len = hrefLength(item.href);
1615
- if (len > maxLen) maxLen = len;
1616
- }
1617
- for (const item of matchingItems) {
1618
- if (!item.href) continue;
1619
- if (hrefLength(item.href) === maxLen) result.add(item.href);
1620
- }
1621
- return result;
1622
- };
1623
- function SidebarNav({ items = [], sections, currentPath, getIsActive, matchStrategy = "prefix", onItemClick, header, footer, ariaLabel = "Sidebar navigation", collapsed = false, iconSize, className, itemClassName, sectionClassName }) {
1624
- const resolvedSections = (0, react.useMemo)(() => {
1625
- return sections?.length ? sections : [{
1626
- id: "default",
1627
- items
1628
- }];
1629
- }, [sections, items]);
1630
- const allItems = (0, react.useMemo)(() => resolvedSections.flatMap((section) => section.items), [resolvedSections]);
1631
- const defaultIsActiveFn = (0, react.useMemo)(() => {
1632
- if (matchStrategy === "most-specific") {
1633
- const mostSpecificHrefs = findMostSpecific(allItems, currentPath);
1634
- return (item) => {
1635
- if (item.active !== void 0) return item.active;
1636
- if (!item.href) return false;
1637
- return mostSpecificHrefs.has(item.href);
1638
- };
1639
- } else return (item, path) => {
1640
- if (item.active !== void 0) return item.active;
1641
- if (item.exact) return isActiveExact(item, path);
1642
- return isActivePrefix(item, path);
1643
- };
1644
- }, [
1645
- matchStrategy,
1646
- allItems,
1647
- currentPath
1648
- ]);
1649
- const resolvedGetIsActive = getIsActive ?? defaultIsActiveFn;
1650
- const style = iconSize !== void 0 ? { ["--sidebar-nav-icon-size"]: typeof iconSize === "number" ? `${iconSize}px` : iconSize } : void 0;
1651
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
1652
- className: cx(sidebar_nav_module_default.sidebarNav, collapsed && sidebar_nav_module_default.sidebarNavCollapsed, className),
1653
- "aria-label": ariaLabel,
1654
- style,
1655
- children: [
1656
- header ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1657
- className: sidebar_nav_module_default.header,
1658
- children: header
1659
- }) : null,
1660
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1661
- className: sidebar_nav_module_default.sections,
1662
- children: resolvedSections.map((section, sectionIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1663
- className: cx(sidebar_nav_module_default.section, sectionClassName),
1664
- children: [section.label && !collapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1665
- className: sidebar_nav_module_default.sectionLabel,
1666
- children: section.label
1667
- }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1668
- className: sidebar_nav_module_default.sectionItems,
1669
- children: section.items.map((item, itemIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarNavEntry, {
1670
- item,
1671
- active: resolvedGetIsActive(item, currentPath),
1672
- collapsed,
1673
- itemClassName,
1674
- onItemClick
1675
- }, `${section.id ?? sectionIndex}-${item.href ?? item.title ?? itemIndex}`))
1676
- })]
1677
- }, section.id ?? `section-${sectionIndex}`))
1678
- }),
1679
- footer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1680
- className: sidebar_nav_module_default.footer,
1681
- children: footer
1682
- }) : null
1683
- ]
1684
- });
1685
- }
1686
- function SidebarNavEntry({ item, active, collapsed, itemClassName, onItemClick }) {
1687
- const rel = item.rel ?? (item.target === "_blank" ? "noreferrer" : void 0);
1688
- const title = item.title ?? (typeof item.label === "string" ? item.label : void 0);
1689
- const classes = cx(sidebar_nav_module_default.item, active && sidebar_nav_module_default.itemActive, collapsed && sidebar_nav_module_default.itemCollapsed, item.disabled && sidebar_nav_module_default.itemDisabled, itemClassName);
1690
- const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [item.icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1691
- className: sidebar_nav_module_default.icon,
1692
- children: item.icon
1693
- }), !collapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1694
- className: sidebar_nav_module_default.itemBody,
1695
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1696
- className: sidebar_nav_module_default.labelRow,
1697
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1698
- className: sidebar_nav_module_default.label,
1699
- children: item.label
1700
- }), item.badge && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1701
- className: sidebar_nav_module_default.badge,
1702
- children: item.badge
1703
- })]
1704
- }), item.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1705
- className: sidebar_nav_module_default.description,
1706
- children: item.description
1707
- }) : null]
1708
- }) : null] });
1709
- const handleClick = () => {
1710
- if (item.disabled) return;
1711
- item.onClick?.();
1712
- onItemClick?.(item);
1713
- };
1714
- if (!item.href) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1715
- type: "button",
1716
- className: classes,
1717
- "aria-current": active ? "page" : void 0,
1718
- "aria-disabled": item.disabled ? "true" : void 0,
1719
- disabled: item.disabled,
1720
- title: collapsed ? title : void 0,
1721
- onClick: handleClick,
1722
- children: content
1723
- });
1724
- if (item.disabled) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1725
- className: classes,
1726
- "aria-current": active ? "page" : void 0,
1727
- "aria-disabled": "true",
1728
- title: collapsed ? title : void 0,
1729
- children: content
1730
- });
1731
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1732
- className: classes,
1733
- href: item.href,
1734
- target: item.target,
1735
- rel,
1736
- "aria-current": active ? "page" : void 0,
1737
- title: collapsed ? title : void 0,
1738
- onClick: handleClick,
1739
- children: content
1740
- });
1741
- }
1742
- var skeleton_module_default = {
1743
- skeleton: "uzi-skeleton-module__skeleton__fula5",
1744
- "skeleton-pulse": "uzi-skeleton-module__skeleton-pulse__Yp45W",
1745
- "radius-sm": "uzi-skeleton-module__radius-sm__FdccD",
1746
- "radius-md": "uzi-skeleton-module__radius-md__zH3RE",
1747
- "radius-lg": "uzi-skeleton-module__radius-lg__YVrHw",
1748
- "radius-full": "uzi-skeleton-module__radius-full__5o2m0"
1749
- };
1750
- //#endregion
1751
- //#region src/components/skeleton/Skeleton.tsx
1752
- function Skeleton({ width, height, radius = "md", className, style, ...rest }) {
1753
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1754
- className: cx(skeleton_module_default.skeleton, skeleton_module_default[`radius-${radius}`], className),
1755
- style: {
1756
- width,
1757
- height,
1758
- ...style
1759
- },
1760
- "aria-hidden": "true",
1761
- ...rest
1762
- });
1763
- }
1764
- var progress_module_default = {
1765
- track: "uzi-progress-module__track__gM0oV",
1766
- fill: "uzi-progress-module__fill__aLAbp",
1767
- "tone-default": "uzi-progress-module__tone-default__fhf7o",
1768
- "tone-success": "uzi-progress-module__tone-success__FsGHD",
1769
- "tone-warning": "uzi-progress-module__tone-warning__UAttL",
1770
- "tone-danger": "uzi-progress-module__tone-danger__-L-Ee"
1771
- };
1772
- //#endregion
1773
- //#region src/components/progress/Progress.tsx
1774
- function Progress({ value, tone = "default", className, "aria-label": ariaLabel, ...rest }) {
1775
- const clamped = Math.max(0, Math.min(100, value));
1776
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1777
- className: cx(progress_module_default.track, className),
1778
- role: "progressbar",
1779
- "aria-valuenow": clamped,
1780
- "aria-valuemin": 0,
1781
- "aria-valuemax": 100,
1782
- "aria-label": ariaLabel,
1783
- ...rest,
1784
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1785
- className: cx(progress_module_default.fill, progress_module_default[`tone-${tone}`]),
1786
- style: { width: `${clamped}%` }
1787
- })
1788
- });
1789
- }
1790
- var segmented_toggle_module_default = {
1791
- track: "uzi-segmented-toggle-module__track__M4fjm",
1792
- option: "uzi-segmented-toggle-module__option__7cEZJ",
1793
- label: "uzi-segmented-toggle-module__label__bDAIv"
1794
- };
1795
- //#endregion
1796
- //#region src/components/segmented-toggle/SegmentedToggle.tsx
1797
- function SegmentedToggle({ options, value, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className }) {
1798
- const itemRefs = react.useRef([]);
1799
- const selectedIndex = options.findIndex((opt) => opt.value === value);
1800
- const fallbackIndex = options.findIndex((opt) => !opt.disabled);
1801
- let lastEnabledIndex = -1;
1802
- for (let index = options.length - 1; index >= 0; index -= 1) if (!options[index]?.disabled) {
1803
- lastEnabledIndex = index;
1804
- break;
1805
- }
1806
- const tabbableIndex = selectedIndex >= 0 && !options[selectedIndex]?.disabled ? selectedIndex : fallbackIndex;
1807
- const focusItem = (index) => {
1808
- itemRefs.current[index]?.focus();
1809
- };
1810
- const findEnabledIndex = (startIndex, direction) => {
1811
- if (options.length === 0) return -1;
1812
- let nextIndex = startIndex;
1813
- for (let i = 0; i < options.length; i += 1) {
1814
- nextIndex = (nextIndex + direction + options.length) % options.length;
1815
- if (!options[nextIndex]?.disabled) return nextIndex;
1816
- }
1817
- return startIndex;
1818
- };
1819
- const selectIndex = (index) => {
1820
- const nextOption = options[index];
1821
- if (!nextOption || nextOption.disabled || nextOption.value === value) return;
1822
- onChange(nextOption.value);
1823
- };
1824
- const handleKeyDown = (event, index) => {
1825
- switch (event.key) {
1826
- case "ArrowRight":
1827
- case "ArrowDown": {
1828
- event.preventDefault();
1829
- const nextIndex = findEnabledIndex(index, 1);
1830
- focusItem(nextIndex);
1831
- selectIndex(nextIndex);
1832
- break;
1833
- }
1834
- case "ArrowLeft":
1835
- case "ArrowUp": {
1836
- event.preventDefault();
1837
- const nextIndex = findEnabledIndex(index, -1);
1838
- focusItem(nextIndex);
1839
- selectIndex(nextIndex);
1840
- break;
1841
- }
1842
- case "Home":
1843
- event.preventDefault();
1844
- focusItem(fallbackIndex);
1845
- if (fallbackIndex >= 0) selectIndex(fallbackIndex);
1846
- break;
1847
- case "End":
1848
- event.preventDefault();
1849
- if (lastEnabledIndex >= 0) {
1850
- focusItem(lastEnabledIndex);
1851
- selectIndex(lastEnabledIndex);
1852
- }
1853
- break;
1854
- default: break;
1855
- }
1856
- };
1857
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1858
- className: cx(segmented_toggle_module_default.track, className),
1859
- role: "radiogroup",
1860
- "aria-label": ariaLabel,
1861
- "aria-labelledby": ariaLabelledBy,
1862
- children: options.map((opt, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1863
- ref: (node) => {
1864
- itemRefs.current[index] = node;
1865
- },
1866
- type: "button",
1867
- role: "radio",
1868
- "aria-checked": opt.value === value,
1869
- disabled: opt.disabled,
1870
- tabIndex: opt.disabled ? -1 : index === tabbableIndex ? 0 : -1,
1871
- onClick: () => {
1872
- if (opt.value !== value) onChange(opt.value);
1873
- },
1874
- onKeyDown: (event) => handleKeyDown(event, index),
1875
- className: cx(segmented_toggle_module_default.option),
1876
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1877
- className: segmented_toggle_module_default.label,
1878
- children: opt.label
1879
- })
1880
- }, opt.value))
1881
- });
1882
- }
1883
- //#endregion
1884
- exports.Alert = Alert;
1885
- exports.AppShell = AppShell;
1886
- exports.Avatar = Avatar;
1887
- exports.AvatarFallback = AvatarFallback;
1888
- exports.AvatarImage = AvatarImage;
1889
- exports.Button = Button;
1890
- exports.Card = Card;
1891
- exports.Checkbox = Checkbox;
1892
- exports.Dropdown = Dropdown;
1893
- exports.DropdownMenu = DropdownMenu;
1894
- exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
1895
- exports.DropdownMenuContent = DropdownMenuContent;
1896
- exports.DropdownMenuGroup = DropdownMenuGroup;
1897
- exports.DropdownMenuItem = DropdownMenuItem;
1898
- exports.DropdownMenuLabel = DropdownMenuLabel;
1899
- exports.DropdownMenuPortal = DropdownMenuPortal;
1900
- exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
1901
- exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
1902
- exports.DropdownMenuSeparator = DropdownMenuSeparator;
1903
- exports.DropdownMenuSub = DropdownMenuSub;
1904
- exports.DropdownMenuSubContent = DropdownMenuSubContent;
1905
- exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
1906
- exports.DropdownMenuTrigger = DropdownMenuTrigger;
1907
- exports.Input = Input;
1908
- exports.Label = Label;
1909
- exports.Modal = Modal;
1910
- exports.ModalOverlay = ModalOverlay;
1911
- exports.MultiSelect = MultiSelect;
1912
- exports.Pill = Pill;
1913
- exports.Progress = Progress;
1914
- exports.SegmentedToggle = SegmentedToggle;
1915
- exports.Select = Select;
1916
- exports.SidebarNav = SidebarNav;
1917
- exports.Skeleton = Skeleton;
1918
- exports.ThemeProvider = ThemeProvider;
1919
- exports.ThemeToggleButton = ThemeToggleButton;
1920
- exports.ToastProvider = ToastProvider;
1921
- exports.TopBar = TopBar;
1922
- exports.cx = cx;
1923
- exports.useTheme = useTheme;
1924
- exports.useToast = useToast;
1925
-
1926
- //# sourceMappingURL=index.cjs.map
2
+ ;/* empty css */
3
+ const require_cx = require("./index4.cjs");
4
+ const require_Button = require("./index6.cjs");
5
+ const require_Avatar = require("./index8.cjs");
6
+ const require_Card = require("./index10.cjs");
7
+ const require_Pill = require("./index12.cjs");
8
+ const require_Modal = require("./index14.cjs");
9
+ const require_Alert = require("./index16.cjs");
10
+ const require_ToastContext = require("./index18.cjs");
11
+ const require_Input = require("./index20.cjs");
12
+ const require_Label = require("./index22.cjs");
13
+ const require_Checkbox = require("./index24.cjs");
14
+ const require_MultiSelect = require("./index26.cjs");
15
+ const require_Select = require("./index28.cjs");
16
+ const require_Dropdown = require("./index29.cjs");
17
+ const require_DropdownMenu = require("./index31.cjs");
18
+ const require_ThemeProvider = require("./index33.cjs");
19
+ const require_ThemeToggleButton = require("./index35.cjs");
20
+ const require_TopBar = require("./index37.cjs");
21
+ const require_AppShell = require("./index39.cjs");
22
+ const require_SidebarNav = require("./index41.cjs");
23
+ const require_Skeleton = require("./index43.cjs");
24
+ const require_Progress = require("./index45.cjs");
25
+ const require_SegmentedToggle = require("./index47.cjs");
26
+ exports.Alert = require_Alert.Alert;
27
+ exports.AppShell = require_AppShell.AppShell;
28
+ exports.Avatar = require_Avatar.Avatar;
29
+ exports.AvatarFallback = require_Avatar.AvatarFallback;
30
+ exports.AvatarImage = require_Avatar.AvatarImage;
31
+ exports.Button = require_Button.Button;
32
+ exports.Card = require_Card.Card;
33
+ exports.Checkbox = require_Checkbox.Checkbox;
34
+ exports.Dropdown = require_Dropdown.Dropdown;
35
+ exports.DropdownMenu = require_DropdownMenu.DropdownMenu;
36
+ exports.DropdownMenuCheckboxItem = require_DropdownMenu.DropdownMenuCheckboxItem;
37
+ exports.DropdownMenuContent = require_DropdownMenu.DropdownMenuContent;
38
+ exports.DropdownMenuGroup = require_DropdownMenu.DropdownMenuGroup;
39
+ exports.DropdownMenuItem = require_DropdownMenu.DropdownMenuItem;
40
+ exports.DropdownMenuLabel = require_DropdownMenu.DropdownMenuLabel;
41
+ exports.DropdownMenuPortal = require_DropdownMenu.DropdownMenuPortal;
42
+ exports.DropdownMenuRadioGroup = require_DropdownMenu.DropdownMenuRadioGroup;
43
+ exports.DropdownMenuRadioItem = require_DropdownMenu.DropdownMenuRadioItem;
44
+ exports.DropdownMenuSeparator = require_DropdownMenu.DropdownMenuSeparator;
45
+ exports.DropdownMenuSub = require_DropdownMenu.DropdownMenuSub;
46
+ exports.DropdownMenuSubContent = require_DropdownMenu.DropdownMenuSubContent;
47
+ exports.DropdownMenuSubTrigger = require_DropdownMenu.DropdownMenuSubTrigger;
48
+ exports.DropdownMenuTrigger = require_DropdownMenu.DropdownMenuTrigger;
49
+ exports.Input = require_Input.Input;
50
+ exports.Label = require_Label.Label;
51
+ exports.Modal = require_Modal.Modal;
52
+ exports.ModalOverlay = require_Modal.ModalOverlay;
53
+ exports.MultiSelect = require_MultiSelect.MultiSelect;
54
+ exports.Pill = require_Pill.Pill;
55
+ exports.Progress = require_Progress.Progress;
56
+ exports.SegmentedToggle = require_SegmentedToggle.SegmentedToggle;
57
+ exports.Select = require_Select.Select;
58
+ exports.SidebarNav = require_SidebarNav.SidebarNav;
59
+ exports.Skeleton = require_Skeleton.Skeleton;
60
+ exports.ThemeProvider = require_ThemeProvider.ThemeProvider;
61
+ exports.ThemeToggleButton = require_ThemeToggleButton.ThemeToggleButton;
62
+ exports.ToastProvider = require_ToastContext.ToastProvider;
63
+ exports.TopBar = require_TopBar.TopBar;
64
+ exports.cx = require_cx.cx;
65
+ exports.useTheme = require_ThemeProvider.useTheme;
66
+ exports.useToast = require_ToastContext.useToast;