@ufoui/core 0.0.4 → 0.0.12

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 (151) hide show
  1. package/README.md +9 -3
  2. package/assets/icons.d.ts +11 -0
  3. package/assets/index.d.ts +1 -0
  4. package/components/accordion/accordion.d.ts +52 -0
  5. package/components/accordion/accordionItem.d.ts +65 -0
  6. package/components/accordion/accordionItem.guards.d.ts +15 -0
  7. package/components/accordion/index.d.ts +2 -0
  8. package/components/avatar/avatar.d.ts +26 -29
  9. package/components/avatar/avatar.guards.d.ts +15 -0
  10. package/components/avatar/avatarGroup.d.ts +29 -0
  11. package/components/avatar/index.d.ts +2 -0
  12. package/components/badge/badge.d.ts +1 -1
  13. package/components/base/{boxBase/boxBase.d.ts → boxBase.d.ts} +18 -11
  14. package/components/base/{buttonBase/buttonBase.d.ts → buttonBase.d.ts} +2 -3
  15. package/components/base/{checkboxBase/checkboxBase.d.ts → checkboxBase.d.ts} +2 -3
  16. package/components/base/dialogBase.d.ts +34 -0
  17. package/components/base/{fieldBase/fieldBase.d.ts → fieldBase.d.ts} +2 -3
  18. package/components/base/index.d.ts +6 -0
  19. package/components/base/textBase.d.ts +44 -0
  20. package/components/breadcrumbs/breadcrumbs.d.ts +48 -0
  21. package/components/button/button.d.ts +1 -1
  22. package/components/calendar/calendar.d.ts +23 -0
  23. package/components/calendar/calendarUtils.d.ts +18 -0
  24. package/components/checkbox/checkbox.d.ts +1 -1
  25. package/components/chip/chip.d.ts +1 -1
  26. package/components/collapse/collapse.d.ts +33 -0
  27. package/components/dialogs/bottomSheet.d.ts +23 -0
  28. package/components/dialogs/dialog.d.ts +21 -0
  29. package/components/{dialog → dialogs}/dialogActions.d.ts +1 -2
  30. package/components/{dialog → dialogs}/dialogTitle.d.ts +2 -3
  31. package/components/dialogs/drawer.d.ts +23 -0
  32. package/components/dialogs/index.d.ts +6 -0
  33. package/components/divider/divider.d.ts +1 -1
  34. package/components/divider/divider.guards.d.ts +1 -1
  35. package/components/fab/fab.d.ts +1 -1
  36. package/components/fields/dateField.d.ts +24 -0
  37. package/components/fields/dateTimeField.d.ts +24 -0
  38. package/components/fields/emailField.d.ts +24 -0
  39. package/components/fields/index.d.ts +11 -0
  40. package/components/fields/monthField.d.ts +24 -0
  41. package/components/fields/numberField.d.ts +24 -0
  42. package/components/fields/passwordField.d.ts +24 -0
  43. package/components/fields/phoneField.d.ts +24 -0
  44. package/components/fields/textField.d.ts +24 -0
  45. package/components/fields/timeField.d.ts +24 -0
  46. package/components/fields/urlField.d.ts +24 -0
  47. package/components/fields/weekField.d.ts +24 -0
  48. package/components/fieldset/fieldset.d.ts +2 -1
  49. package/components/iconButton/iconButton.d.ts +1 -1
  50. package/components/{article → layout}/article.d.ts +1 -1
  51. package/components/{aside → layout}/aside.d.ts +1 -1
  52. package/components/{content → layout}/content.d.ts +1 -1
  53. package/components/{div → layout}/div.d.ts +1 -1
  54. package/components/{flex → layout}/flex.d.ts +1 -1
  55. package/components/{footer → layout}/footer.d.ts +1 -1
  56. package/components/{grid → layout}/grid.d.ts +1 -1
  57. package/components/{header → layout}/header.d.ts +1 -1
  58. package/components/layout/index.d.ts +11 -0
  59. package/components/{main → layout}/main.d.ts +1 -1
  60. package/components/{nav → layout}/nav.d.ts +1 -1
  61. package/components/{section → layout}/section.d.ts +1 -1
  62. package/components/link/link.d.ts +58 -0
  63. package/components/list/list.d.ts +8 -0
  64. package/components/{listItem → list}/listItem.d.ts +2 -3
  65. package/components/{listItem → list}/listItem.guards.d.ts +1 -1
  66. package/components/menu/menu.d.ts +2 -4
  67. package/components/menu/menu.guards.d.ts +1 -1
  68. package/components/menuItem/menuItem.d.ts +2 -3
  69. package/components/menuItem/menuItem.guards.d.ts +1 -1
  70. package/components/option/option.d.ts +1 -1
  71. package/components/option/option.guards.d.ts +1 -1
  72. package/components/progress/progress.d.ts +27 -0
  73. package/components/radio/radio.d.ts +1 -1
  74. package/components/radiogroup/radioGroup.d.ts +1 -1
  75. package/components/rating/rating.d.ts +68 -0
  76. package/components/select/select.d.ts +1 -1
  77. package/components/slider/slider.d.ts +11 -0
  78. package/components/switch/switch.d.ts +1 -10
  79. package/components/tabs/index.d.ts +2 -0
  80. package/components/tabs/tab.d.ts +37 -0
  81. package/components/tabs/tab.guards.d.ts +15 -0
  82. package/components/tabs/tabs.d.ts +7 -0
  83. package/components/toast/index.d.ts +2 -0
  84. package/components/toast/toast.d.ts +52 -0
  85. package/components/toast/toastViewport.d.ts +7 -0
  86. package/components/toggleButton/toggleButton.d.ts +1 -1
  87. package/components/toolbar/toolbar.d.ts +51 -0
  88. package/components/tooltip/tooltip.d.ts +1 -1
  89. package/components/typography/h1.d.ts +18 -0
  90. package/components/typography/h2.d.ts +18 -0
  91. package/components/typography/h3.d.ts +18 -0
  92. package/components/typography/h4.d.ts +18 -0
  93. package/components/typography/h5.d.ts +18 -0
  94. package/components/typography/h6.d.ts +18 -0
  95. package/components/typography/index.d.ts +9 -0
  96. package/components/typography/label.d.ts +18 -0
  97. package/components/typography/p.d.ts +18 -0
  98. package/components/typography/span.d.ts +18 -0
  99. package/context/index.d.ts +4 -0
  100. package/context/selectionContext.d.ts +32 -0
  101. package/context/themeContext.d.ts +2 -2
  102. package/hooks/index.d.ts +10 -0
  103. package/hooks/useAnimate.d.ts +38 -18
  104. package/hooks/useFocusTrap.d.ts +32 -0
  105. package/hooks/useFocusVisible.d.ts +16 -14
  106. package/hooks/useResizeObserver.d.ts +30 -0
  107. package/hooks/useRovingFocus.d.ts +30 -0
  108. package/hooks/useSelection.d.ts +16 -0
  109. package/hooks/useSelectionState.d.ts +29 -0
  110. package/hooks/useSliderKeys.d.ts +41 -0
  111. package/index.css +1 -1
  112. package/index.d.ts +22 -36
  113. package/index.js +4881 -0
  114. package/internal/controlGrid/controlGrid.d.ts +32 -0
  115. package/internal/controlLabel/controlLabel.d.ts +31 -0
  116. package/internal/description/description.d.ts +18 -0
  117. package/internal/index.d.ts +6 -0
  118. package/internal/inlineTooltip/index.d.ts +1 -0
  119. package/internal/inlineTooltip/inlineTooltipManager.d.ts +2 -2
  120. package/internal/slots/slot.d.ts +44 -0
  121. package/internal/stateLayer/stateLayer.d.ts +33 -0
  122. package/package.json +12 -3
  123. package/utils/calculateFloatingPosition.d.ts +1 -1
  124. package/utils/color.d.ts +2 -194
  125. package/utils/controlStyle.d.ts +67 -0
  126. package/utils/generateMaterialColors.d.ts +1 -1
  127. package/utils/generateSchemes.d.ts +1 -1
  128. package/utils/getWrapperStyle.d.ts +53 -0
  129. package/utils/index.d.ts +10 -0
  130. package/utils/{inputhMethod.d.ts → interactionMode.d.ts} +1 -1
  131. package/utils/toasts/ensureViewport.d.ts +7 -0
  132. package/utils/toasts/index.d.ts +1 -0
  133. package/utils/toasts/toast.d.ts +85 -0
  134. package/utils/toasts/toastStore.d.ts +65 -0
  135. package/utils/uniqueID.d.ts +14 -0
  136. package/utils/utils.d.ts +81 -81
  137. package/components/base/dialogBase/dialog.d.ts +0 -35
  138. package/components/base/inlineBase/inlineBase.d.ts +0 -62
  139. package/components/dateInput/dateInput.d.ts +0 -2
  140. package/components/dateTimeInput/dateTimeInput.d.ts +0 -2
  141. package/components/emailInput/emailInput.d.ts +0 -2
  142. package/components/numberInput/numberInput.d.ts +0 -2
  143. package/components/telInput/telInput.d.ts +0 -2
  144. package/components/textField/textField.d.ts +0 -9
  145. package/components/timeInput/timeInput.d.ts +0 -2
  146. package/components/urlInput/urlInput.d.ts +0 -2
  147. package/hooks/useFocusState.d.ts +0 -16
  148. package/index.mjs +0 -3832
  149. package/internal/inlineTooltip/inlineTooltip.d.ts +0 -11
  150. package/internal/inlineTooltip/inlineTooltip2.d.ts +0 -10
  151. /package/components/{dialog → dialogs}/dialogContent.d.ts +0 -0
package/index.mjs DELETED
@@ -1,3832 +0,0 @@
1
- import { jsx as i, jsxs as j, Fragment as tt } from "react/jsx-runtime";
2
- import lt, { forwardRef as P, isValidElement as vt, createContext as xt, useSyncExternalStore as kn, useState as ee, useRef as ce, useCallback as yt, useEffect as ye, useContext as It, cloneElement as At, useLayoutEffect as ln, useMemo as an } from "react";
3
- import { createPortal as Wt } from "react-dom";
4
- import { argbFromHex as bt, themeFromSourceColor as Fn, hexFromArgb as be, TonalPalette as Ln } from "@material/material-color-utilities";
5
- const Bn = (e) => ({
6
- topLeft: "uui-top-left",
7
- topCenter: "uui-top-center",
8
- topRight: "uui-top-right",
9
- topRightOut: "uui-top-right-out",
10
- topLeftOut: "uui-top-left-out",
11
- centerLeft: "uui-center-left",
12
- center: "uui-center",
13
- centerRight: "uui-center-right",
14
- bottomLeft: "uui-bottom-left",
15
- bottomCenter: "uui-bottom-center",
16
- bottomRight: "uui-bottom-right",
17
- auto: "uui-top-right"
18
- })[e], Ue = (e) => {
19
- switch (e) {
20
- case "square":
21
- return "uui-square";
22
- case "smooth":
23
- return "uui-smooth";
24
- case "rounded":
25
- return "uui-rounded";
26
- case "round":
27
- return "uui-round";
28
- default:
29
- return "";
30
- }
31
- }, wt = (e) => ({
32
- extraSmall: "uui-extra-small",
33
- small: "uui-small",
34
- medium: "uui-medium",
35
- large: "uui-large",
36
- extraLarge: "uui-extra-large"
37
- })[e], nt = (e) => {
38
- const n = un(0, 5, e);
39
- return n === void 0 ? "" : `uui-border-${n}`;
40
- }, ut = (e) => {
41
- switch (e) {
42
- case 0:
43
- return "uui-elevation-0";
44
- case 1:
45
- return "uui-elevation-1";
46
- case 2:
47
- return "uui-elevation-2";
48
- case 3:
49
- return "uui-elevation-3";
50
- case 4:
51
- return "uui-elevation-4";
52
- case 5:
53
- return "uui-elevation-5";
54
- default:
55
- return "";
56
- }
57
- }, dt = (e) => {
58
- switch (e) {
59
- case "compact":
60
- return "uui-compact";
61
- case "dense":
62
- return "uui-dense";
63
- default:
64
- return "";
65
- }
66
- }, Ie = (e) => ({
67
- displayLarge: "uui-font-display-large",
68
- displayMedium: "uui-font-display-medium",
69
- displaySmall: "uui-font-display-small",
70
- headlineLarge: "uui-font-headline-large",
71
- headlineMedium: "uui-font-headline-medium",
72
- headlineSmall: "uui-font-headline-small",
73
- titleLarge: "uui-font-title-large",
74
- titleMedium: "uui-font-title-medium",
75
- titleSmall: "uui-font-title-small",
76
- labelLarge: "uui-font-label-large",
77
- labelMedium: "uui-font-label-medium",
78
- labelSmall: "uui-font-label-small",
79
- bodyLarge: "uui-font-body-large",
80
- bodyMedium: "uui-font-body-medium",
81
- bodySmall: "uui-font-body-small",
82
- caption: "uui-font-caption",
83
- overline: "uui-font-overline"
84
- })[e];
85
- function ft(...e) {
86
- return (n) => {
87
- e.forEach((t) => {
88
- if (typeof t == "function")
89
- t(n);
90
- else if (t) {
91
- const r = t;
92
- r.current = n;
93
- }
94
- });
95
- };
96
- }
97
- const St = (e, n, t) => {
98
- const r = t ?? e, s = r.querySelector(".ripple-container");
99
- s && s.remove();
100
- const o = e.getBoundingClientRect(), u = r.getBoundingClientRect(), l = n.clientX - o.left, m = n.clientY - o.top, p = l >= 0 && l <= o.width && m >= 0 && m <= o.height, c = p ? l : o.width / 2, a = p ? m : o.height / 2, f = Math.sqrt(
101
- o.width * o.width + o.height * o.height
102
- ), x = f / 2, g = document.createElement("div");
103
- g.className = "ripple-container", g.style.position = "absolute", g.style.pointerEvents = "none", g.style.overflow = "hidden", g.style.width = `${o.width}px`, g.style.height = `${o.height}px`, g.style.left = `${o.left - u.left}px`, g.style.top = `${o.top - u.top}px`, requestAnimationFrame(() => {
104
- g.style.borderRadius = getComputedStyle(e).borderRadius;
105
- });
106
- const w = document.createElement("span");
107
- w.className = "ripple", w.style.position = "absolute", w.style.width = `${f}px`, w.style.height = `${f}px`, w.style.left = `${c - x}px`, w.style.top = `${a - x}px`, g.appendChild(w), r.appendChild(g), w.addEventListener("animationend", () => {
108
- g.remove();
109
- });
110
- }, $t = (e) => (
111
- // eslint-disable-next-line sonarjs/pseudo-random
112
- `${e}_${Math.floor((1 + Math.random()) * 65536).toString(16).substring(1)}`
113
- );
114
- function Et(e) {
115
- return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
116
- }
117
- function un(e, n, t, r) {
118
- const s = Number(t);
119
- return Number.isFinite(s) ? Math.min(n, Math.max(e, Math.round(s))) : r;
120
- }
121
- const cn = [
122
- "primary",
123
- "secondary",
124
- "tertiary",
125
- "warning",
126
- "info",
127
- "success",
128
- "error"
129
- ], Nn = [
130
- ...cn,
131
- "primaryContainer",
132
- "primaryFixed",
133
- "primaryFixedDim",
134
- "secondaryContainer",
135
- "secondaryFixed",
136
- "secondaryFixedDim",
137
- "tertiaryContainer",
138
- "tertiaryFixed",
139
- "tertiaryFixedDim",
140
- "warningContainer",
141
- "warningFixed",
142
- "warningFixedDim",
143
- "infoContainer",
144
- "infoFixed",
145
- "infoFixedDim",
146
- "successContainer",
147
- "successFixed",
148
- "successFixedDim",
149
- "errorContainer",
150
- "errorFixed",
151
- "errorFixedDim",
152
- "black",
153
- "white"
154
- ], dn = [
155
- ...Nn,
156
- "outline",
157
- "outlineVariant",
158
- "surface",
159
- "surfaceVariant",
160
- "background",
161
- "inverseSurface",
162
- "inversePrimary",
163
- "surfaceContainerHighest",
164
- "surfaceContainerHigh",
165
- "surfaceContainer",
166
- "surfaceContainerLow",
167
- "surfaceContainerLowest",
168
- "surfaceBright",
169
- "surfaceDim"
170
- ], fn = [
171
- ...dn,
172
- "onPrimary",
173
- "onPrimaryContainer",
174
- "onPrimaryFixed",
175
- "onPrimaryFixedVariant",
176
- "onSecondary",
177
- "onSecondaryContainer",
178
- "onSecondaryFixed",
179
- "onSecondaryFixedVariant",
180
- "onTertiary",
181
- "onTertiaryContainer",
182
- "onTertiaryFixed",
183
- "onTertiaryFixedVariant",
184
- "onWarning",
185
- "onWarningContainer",
186
- "onWarningFixed",
187
- "onWarningFixedVariant",
188
- "onInfo",
189
- "onInfoContainer",
190
- "onInfoFixed",
191
- "onInfoFixedVariant",
192
- "onSuccess",
193
- "onSuccessContainer",
194
- "onSuccessFixed",
195
- "onSuccessFixedVariant",
196
- "onError",
197
- "onErrorContainer",
198
- "onErrorFixed",
199
- "onErrorFixedVariant",
200
- "onSurface",
201
- "onSurfaceVariant",
202
- "onBackground",
203
- "inverseOnSurface",
204
- "inversePrimary",
205
- "shadow",
206
- "surfaceTint",
207
- "scrim"
208
- ], Mt = {
209
- fade: "uui-motion-fade",
210
- fadeBlur: "uui-motion-fade-blur",
211
- scale: "uui-motion-scale",
212
- scaleBlur: "uui-motion-scale-blur",
213
- popup: "uui-motion-popup",
214
- slideUp: "uui-motion-slide-up",
215
- slideDown: "uui-motion-slide-down",
216
- slideLeft: "uui-motion-slide-left",
217
- slideRight: "uui-motion-slide-right",
218
- slideUpBlur: "uui-motion-slide-up-blur",
219
- slideDownBlur: "uui-motion-slide-down-blur",
220
- slideLeftBlur: "uui-motion-slide-left-blur",
221
- slideRightBlur: "uui-motion-slide-right-blur",
222
- rotate: "uui-motion-rotate",
223
- rotateUpRight: "uui-motion-rotate-up-right",
224
- rotateUpLeft: "uui-motion-rotate-up-left",
225
- rollLeft: "uui-motion-roll-left",
226
- rollRight: "uui-motion-roll-right",
227
- flipX: "uui-motion-flip-x",
228
- flipY: "uui-motion-flip-y",
229
- bounce: "uui-motion-bounce",
230
- squish: "uui-motion-squish",
231
- rubber: "uui-motion-rubber",
232
- popElastic: "uui-motion-pop-elastic",
233
- jelly: "uui-motion-jelly"
234
- };
235
- function In(e) {
236
- return e ? Mt[e] ?? "" : "";
237
- }
238
- function Wr() {
239
- return Object.keys(Mt);
240
- }
241
- function En(e) {
242
- return e === "expressive" ? "uui-motion-expressive" : "";
243
- }
244
- const Tn = (e) => {
245
- const n = cn.includes(e) ? e : "primary";
246
- return {
247
- textColor: `uui-text-${n}`,
248
- borderColor: `uui-border-${n}`,
249
- bgColor: `uui-bg-${n}`,
250
- textOnColor: `uui-text-on-${n}`,
251
- borderOnColor: `uui-border-on-${n}`,
252
- bgOnColor: `uui-bg-on-${n}`,
253
- textContainer: `uui-text-${n}-container`,
254
- borderContainer: `uui-border-${n}-container`,
255
- bgContainer: `uui-bg-${n}-container`,
256
- textOnContainer: `uui-text-on-${n}-container`,
257
- borderOnContainer: `uui-border-on-${n}-container`,
258
- bgOnContainer: `uui-bg-on-${n}-container`,
259
- textFixed: `uui-text-${n}-fixed`,
260
- borderFixed: `uui-border-${n}-fixed`,
261
- bgFixed: `uui-bg-${n}-fixed`,
262
- textOnFixed: `uui-text-on-${n}-fixed`,
263
- borderOnFixed: `uui-border-on-${n}-fixed`,
264
- bgOnFixed: `uui-bg-on-${n}-fixed`,
265
- textFixedDim: `uui-text-${n}-fixed-dim`,
266
- borderFixedDim: `uui-border-${n}-fixed-dim`,
267
- bgFixedDim: `uui-bg-${n}-fixed-dim`,
268
- textOnFixedVariant: `uui-text-on-${n}-fixed-variant`,
269
- borderOnFixedVariant: `uui-border-on-${n}-fixed-variant`,
270
- bgOnFixedVariant: `uui-bg-on-${n}-fixed-variant`
271
- };
272
- }, Tt = {
273
- // SURFACE
274
- surface: "onSurface",
275
- surfaceVariant: "onSurfaceVariant",
276
- surfaceContainerLowest: "onSurface",
277
- surfaceContainerLow: "onSurface",
278
- surfaceContainer: "onSurface",
279
- surfaceContainerHigh: "onSurface",
280
- surfaceContainerHighest: "onSurface",
281
- surfaceDim: "onSurface",
282
- surfaceBright: "onSurface",
283
- background: "onBackground",
284
- inverseSurface: "inverseOnSurface",
285
- // SEMANTIC
286
- primary: "onPrimary",
287
- secondary: "onSecondary",
288
- tertiary: "onTertiary",
289
- warning: "onWarning",
290
- info: "onInfo",
291
- success: "onSuccess",
292
- error: "onError",
293
- // EXTENDED
294
- primaryContainer: "onPrimaryContainer",
295
- primaryFixed: "onPrimaryFixed",
296
- primaryFixedDim: "onPrimaryFixedVariant",
297
- secondaryContainer: "onSecondaryContainer",
298
- secondaryFixed: "onSecondaryFixed",
299
- secondaryFixedDim: "onSecondaryFixedVariant",
300
- tertiaryContainer: "onTertiaryContainer",
301
- tertiaryFixed: "onTertiaryFixed",
302
- tertiaryFixedDim: "onTertiaryFixedVariant",
303
- warningContainer: "onWarningContainer",
304
- warningFixed: "onWarningFixed",
305
- warningFixedDim: "onWarningFixedVariant",
306
- infoContainer: "onInfoContainer",
307
- infoFixed: "onInfoFixed",
308
- infoFixedDim: "onInfoFixedVariant",
309
- successContainer: "onSuccessContainer",
310
- successFixed: "onSuccessFixed",
311
- successFixedDim: "onSuccessFixedVariant",
312
- errorContainer: "onErrorContainer",
313
- errorFixed: "onErrorFixed",
314
- errorFixedDim: "onErrorFixedVariant",
315
- // NEUTRAL / TECHNICAL (for TS completeness)
316
- outline: "surface",
317
- outlineVariant: "inverseSurface",
318
- inversePrimary: "onPrimaryContainer",
319
- black: "white",
320
- white: "black",
321
- onSurface: "surface",
322
- onSurfaceVariant: "surfaceVariant",
323
- onBackground: "background",
324
- inverseOnSurface: "inverseSurface",
325
- onPrimary: "primary",
326
- onSecondary: "secondary",
327
- onTertiary: "tertiary",
328
- onWarning: "warning",
329
- onInfo: "info",
330
- onSuccess: "success",
331
- onError: "error",
332
- onPrimaryContainer: "primaryContainer",
333
- onSecondaryContainer: "secondaryContainer",
334
- onTertiaryContainer: "tertiaryContainer",
335
- onWarningContainer: "warningContainer",
336
- onInfoContainer: "infoContainer",
337
- onSuccessContainer: "successContainer",
338
- onErrorContainer: "errorContainer"
339
- }, Vt = (e) => {
340
- const n = dn.includes(e) ? e : "primary", t = Et(n), r = Et(Tt[n]);
341
- return {
342
- textColor: `uui-text-${t}`,
343
- textOnColor: `uui-text-${r}`,
344
- borderColor: `uui-border-${t}`,
345
- borderOnColor: `uui-border-${r}`,
346
- bgColor: `uui-bg-${t}`,
347
- bgOnColor: `uui-bg-${r}`
348
- };
349
- }, Hr = (e) => {
350
- const n = fn.includes(e) ? e : "primary", t = Et(n);
351
- return {
352
- textColor: `uui-text-${t}`,
353
- borderColor: `uui-border-${t}`,
354
- bgColor: `uui-bg-${t}`
355
- };
356
- };
357
- function Ht(e) {
358
- return Vt(e).borderColor;
359
- }
360
- const qr = (e) => {
361
- const n = e.toLowerCase(), t = `--uui-color-${n}`, r = `--uui-color-on-${n}`;
362
- return {
363
- color: `var(${t})`,
364
- onColor: `var(${r})`,
365
- container: `var(${t}-container)`,
366
- onContainer: `var(${r}-container)`,
367
- fixed: `var(${t}-fixed)`,
368
- fixedDim: `var(${t}-fixed-dim)`,
369
- onFixed: `var(${r}-fixed)`,
370
- onFixedVariant: `var(${r}-fixed-variant)`
371
- };
372
- }, mn = (e) => {
373
- const n = e.toLowerCase(), t = `--uui-color-${n}`, r = `--uui-color-on-${n}`;
374
- return {
375
- color: `var(${t})`,
376
- onColor: `var(${r})`
377
- };
378
- }, Mn = (e) => [
379
- parseInt(e.slice(1, 3), 16),
380
- parseInt(e.slice(3, 5), 16),
381
- parseInt(e.slice(5, 7), 16)
382
- ], Zr = (e) => [
383
- parseInt(e.slice(1, 3), 16),
384
- parseInt(e.slice(3, 5), 16),
385
- parseInt(e.slice(5, 7), 16)
386
- ].join(",");
387
- function _r(e, n) {
388
- const r = {
389
- 0: "0",
390
- 1: "0.05",
391
- 2: "0.08",
392
- 3: "0.11",
393
- 4: "0.12",
394
- 5: "0.14"
395
- }[e] ?? 0, [s, o, u] = Mn(n);
396
- return `rgba(${String(s)}, ${String(o)}, ${String(u)}, ${r})`;
397
- }
398
- const Kr = () => {
399
- const e = [
400
- "surface",
401
- "onSurface",
402
- "surfaceDim",
403
- "surfaceBright",
404
- "surfaceContainerLowest",
405
- "surfaceContainerLow",
406
- "surfaceContainer",
407
- "surfaceContainerHigh",
408
- "surfaceContainerHighest",
409
- "onSurfaceVariant",
410
- "inverseSurface",
411
- "inverseOnSurface",
412
- "outline",
413
- "outlineVariant",
414
- "inversePrimary",
415
- "scrim",
416
- "shadow",
417
- "white",
418
- "black",
419
- "background",
420
- "onBackground",
421
- "surfaceTint"
422
- ], n = {};
423
- for (const t of e) {
424
- const r = t.charAt(0).toUpperCase() + t.slice(1);
425
- n[`text${r}`] = `uui-text-${t}`, n[`border${r}`] = `uui-border-${t}`, n[`outline${r}`] = `uui-outline-${t}`, n[`bg${r}`] = `uui-bg-${t}`;
426
- }
427
- return n;
428
- }, Gr = (e) => {
429
- const n = Et(e), t = [
430
- ["currentColor", `uui-current-${n}`],
431
- ["currentOnColor", `uui-current-on-${n}`],
432
- ["currentContainer", `uui-current-${n}-container`],
433
- ["currentOnContainer", `uui-current-on-${n}-container`],
434
- ["currentFixed", `uui-current-${n}-fixed`],
435
- ["currentOnFixed", `uui-current-on-${n}-fixed`],
436
- ["currentFixedDim", `uui-current-${n}-fixed-dim`],
437
- ["currentOnFixedVariant", `uui-current-on-${n}-fixed-variant`],
438
- ["currentOnSurface", "uui-current-on-surface"],
439
- ["currentSurface", "uui-current-surface"],
440
- ["currentSurfaceDim", "uui-current-surface-dim"],
441
- ["currentSurfaceBright", "uui-current-surface-bright"],
442
- ["currentSurfaceContainerLowest", "uui-current-surface-container-lowest"],
443
- ["currentSurfaceContainerLow", "uui-current-surface-container-low"],
444
- ["currentSurfaceContainer", "uui-current-surface-container"],
445
- ["currentSurfaceContainerHigh", "uui-current-surface-container-high"],
446
- ["currentSurfaceContainerHighest", "uui-current-surface-container-highest"],
447
- ["currentOnSurfaceVariant", "uui-current-on-surface-variant"],
448
- ["currentInverseSurface", "uui-current-inverse-surface"],
449
- ["currentInverseOnSurface", "uui-current-inverse-on-surface"],
450
- ["currentOutline", "uui-current-outline"],
451
- ["currentOutlineVariant", "uui-current-outline-variant"],
452
- ["currentInversePrimary", "uui-current-inverse-primary"],
453
- ["currentScrim", "uui-current-scrim"],
454
- ["currentShadow", "uui-current-shadow"],
455
- ["currentWhite", "uui-current-white"],
456
- ["currentBlack", "uui-current-black"]
457
- ];
458
- return Object.fromEntries(t);
459
- };
460
- function Vn(e) {
461
- return e.charAt(0).toUpperCase() + e.slice(1);
462
- }
463
- function T(e) {
464
- const n = { ...e || {} };
465
- function t(c, a) {
466
- n[c] = a;
467
- }
468
- const r = (c) => `var(--uui-color-${c.replace(/[A-Z]/g, (a) => "-" + a.toLowerCase())})`, s = (c) => Object.assign(
469
- (a) => {
470
- a && c(r(a));
471
- },
472
- {
473
- on(a) {
474
- if (a) {
475
- const f = Tt[a];
476
- f !== void 0 && c(r(f));
477
- }
478
- },
479
- container(a) {
480
- a && c(r(`${a}Container`));
481
- },
482
- onContainer(a) {
483
- a && c(r(`on${Vn(a)}Container`));
484
- },
485
- fixed(a) {
486
- a && c(r(`${a}Fixed`));
487
- },
488
- fixedDim(a) {
489
- a && c(r(`${a}FixedDim`));
490
- }
491
- }
492
- ), o = s((c) => {
493
- t("backgroundColor", c);
494
- }), u = s((c) => {
495
- t("color", c);
496
- }), l = s((c) => {
497
- t("borderColor", c);
498
- }), m = s((c) => {
499
- t("outlineColor", c);
500
- }), p = s((c) => {
501
- t("--uui-current-color", c);
502
- });
503
- return {
504
- bg: o,
505
- text: u,
506
- border: l,
507
- outline: m,
508
- current: p,
509
- set: t,
510
- get() {
511
- return n;
512
- },
513
- merge(c) {
514
- c && Object.assign(n, c);
515
- }
516
- };
517
- }
518
- function mt(e) {
519
- return e ?? "outlineVariant";
520
- }
521
- const Dn = P(
522
- ({ font: e, size: n = "small", ...t }, r) => /* @__PURE__ */ i(
523
- Ct,
524
- {
525
- font: e ?? {
526
- extraSmall: "labelLarge",
527
- small: "labelLarge",
528
- medium: "titleMedium",
529
- large: "headlineSmall",
530
- extraLarge: "headlineLarge"
531
- }[n],
532
- ref: r,
533
- size: n,
534
- ...t,
535
- elementClass: "uui-button"
536
- }
537
- )
538
- );
539
- Dn.displayName = "Button";
540
- const Rn = P(
541
- ({
542
- font: e,
543
- size: n = "small",
544
- shape: t = "smooth",
545
- selectedShape: r = "smooth",
546
- borderColor: s = "outlineVariant",
547
- ...o
548
- }, u) => /* @__PURE__ */ i(
549
- Ct,
550
- {
551
- borderColor: s,
552
- font: e ?? {
553
- extraSmall: "labelLarge",
554
- small: "labelLarge",
555
- medium: "titleMedium",
556
- large: "headlineSmall",
557
- extraLarge: "headlineLarge"
558
- }[n],
559
- ref: u,
560
- selectedShape: r,
561
- ...o,
562
- elementClass: "uui-chip",
563
- shape: t,
564
- size: n
565
- }
566
- )
567
- );
568
- Rn.displayName = "Chip";
569
- const qt = (e) => {
570
- const {
571
- children: n,
572
- className: t,
573
- border: r,
574
- borderColor: s,
575
- color: o = "error",
576
- align: u = "topRight",
577
- shape: l = "round",
578
- size: m = "medium",
579
- elevation: p,
580
- ariaLabel: c,
581
- value: a,
582
- font: f,
583
- offset: x,
584
- ...g
585
- } = e, w = "uui-badge", F = f ?? (m === "extraLarge" || m === "large" ? "labelMedium" : "labelSmall"), b = [
586
- "uui-badge-control",
587
- t,
588
- Ue(l),
589
- wt(m),
590
- Ie(F)
591
- ], h = ["uui-badge-slot", Bn(u)].filter(Boolean).join(" "), $ = T();
592
- $.bg(o), $.text.on(o), x !== void 0 && $.set("--uui-badge-offset", `${x}px`), p !== void 0 && b.push(ut(p)), r !== void 0 && (b.push(nt(r)), $.border(mt(s)));
593
- const k = b.filter(Boolean).join(" "), S = /* @__PURE__ */ i(
594
- "span",
595
- {
596
- "aria-label": c,
597
- className: k,
598
- style: $.get(),
599
- children: m !== "small" && m !== "extraSmall" && a
600
- }
601
- );
602
- return n ? /* @__PURE__ */ j("span", { className: w, ...g, children: [
603
- n,
604
- /* @__PURE__ */ i("span", { className: h, children: S })
605
- ] }) : S;
606
- };
607
- qt.displayName = "Badge";
608
- const Xr = (e) => ({
609
- topLeft: "uui-top-left",
610
- topCenter: "uui-top-center",
611
- topRight: "uui-top-right",
612
- topRightOut: "uui-top-right-out",
613
- topLeftOut: "uui-top-left-out",
614
- centerLeft: "uui-center-left",
615
- center: "uui-center",
616
- centerRight: "uui-center-right",
617
- bottomLeft: "uui-bottom-left",
618
- bottomCenter: "uui-bottom-center",
619
- bottomRight: "uui-bottom-right",
620
- auto: "uui-top-right"
621
- })[e], jn = (e) => {
622
- switch (e) {
623
- case "square":
624
- return "uui-square";
625
- case "smooth":
626
- return "uui-smooth";
627
- case "rounded":
628
- return "uui-rounded";
629
- case "round":
630
- return "uui-round";
631
- default:
632
- return "";
633
- }
634
- }, zr = (e) => {
635
- switch (e) {
636
- case "large":
637
- return "uui-font-body-large";
638
- case "medium":
639
- return "uui-font-body-medium";
640
- default:
641
- return "uui-font-body-small";
642
- }
643
- }, Yr = (e) => ({
644
- extraSmall: "uui-extra-small",
645
- small: "uui-small",
646
- medium: "uui-medium",
647
- large: "uui-large",
648
- extraLarge: "uui-extra-large"
649
- })[e], An = (e) => {
650
- const n = Pn(0, 5, e);
651
- return n === void 0 ? "" : `uui-border-${n}`;
652
- }, Jr = (e) => +e > 0 || +e < 5 ? `uui-outline-${String(e)}` : "uui-outline-0", On = (e) => {
653
- switch (e) {
654
- case 0:
655
- return "uui-elevation-0";
656
- case 1:
657
- return "uui-elevation-1";
658
- case 2:
659
- return "uui-elevation-2";
660
- case 3:
661
- return "uui-elevation-3";
662
- case 4:
663
- return "uui-elevation-4";
664
- case 5:
665
- return "uui-elevation-5";
666
- default:
667
- return "";
668
- }
669
- }, Qr = (e) => {
670
- switch (e) {
671
- case "compact":
672
- return "uui-compact";
673
- case "dense":
674
- return "uui-dense";
675
- default:
676
- return "";
677
- }
678
- }, tn = (e) => ({
679
- displayLarge: "uui-font-display-large",
680
- displayMedium: "uui-font-display-medium",
681
- displaySmall: "uui-font-display-small",
682
- headlineLarge: "uui-font-headline-large",
683
- headlineMedium: "uui-font-headline-medium",
684
- headlineSmall: "uui-font-headline-small",
685
- titleLarge: "uui-font-title-large",
686
- titleMedium: "uui-font-title-medium",
687
- titleSmall: "uui-font-title-small",
688
- labelLarge: "uui-font-label-large",
689
- labelMedium: "uui-font-label-medium",
690
- labelSmall: "uui-font-label-small",
691
- bodyLarge: "uui-font-body-large",
692
- bodyMedium: "uui-font-body-medium",
693
- bodySmall: "uui-font-body-small",
694
- caption: "uui-font-caption",
695
- overline: "uui-font-overline"
696
- })[e];
697
- function ei(...e) {
698
- return (n) => {
699
- e.forEach((t) => {
700
- if (typeof t == "function")
701
- t(n);
702
- else if (t) {
703
- const r = t;
704
- r.current = n;
705
- }
706
- });
707
- };
708
- }
709
- const ti = (e, n, t) => {
710
- const r = t ?? e, s = r.querySelector(".ripple-container");
711
- s && s.remove();
712
- const o = e.getBoundingClientRect(), u = r.getBoundingClientRect(), l = n.clientX - o.left, m = n.clientY - o.top, p = l >= 0 && l <= o.width && m >= 0 && m <= o.height, c = p ? l : o.width / 2, a = p ? m : o.height / 2, f = Math.sqrt(
713
- o.width * o.width + o.height * o.height
714
- ), x = f / 2, g = document.createElement("div");
715
- g.className = "ripple-container", g.style.position = "absolute", g.style.pointerEvents = "none", g.style.overflow = "hidden", g.style.width = `${o.width}px`, g.style.height = `${o.height}px`, g.style.left = `${o.left - u.left}px`, g.style.top = `${o.top - u.top}px`, requestAnimationFrame(() => {
716
- g.style.borderRadius = getComputedStyle(e).borderRadius;
717
- });
718
- const w = document.createElement("span");
719
- w.className = "ripple", w.style.position = "absolute", w.style.width = `${f}px`, w.style.height = `${f}px`, w.style.left = `${c - x}px`, w.style.top = `${a - x}px`, g.appendChild(w), r.appendChild(g), w.addEventListener("animationend", () => {
720
- g.remove();
721
- });
722
- }, ni = (e) => (
723
- // eslint-disable-next-line sonarjs/pseudo-random
724
- `${e}_${Math.floor((1 + Math.random()) * 65536).toString(16).substring(1)}`
725
- );
726
- function nn(e) {
727
- return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
728
- }
729
- function ri(e) {
730
- if (!vt(e))
731
- return;
732
- const n = e.type;
733
- if (typeof n == "function" && "displayName" in n)
734
- return n.displayName;
735
- const t = n;
736
- if (t && typeof t == "object" && "type" in t) {
737
- const r = t.type;
738
- if (typeof r == "function" && "displayName" in r)
739
- return r.displayName;
740
- }
741
- if (t && typeof t == "object" && "render" in t) {
742
- const r = t.render;
743
- if (typeof r == "function" && "displayName" in r)
744
- return r.displayName;
745
- }
746
- }
747
- function ii(e) {
748
- e && (e.classList.remove("uui-focus-visible"), e.focus(), e.classList.add("uui-focus-visible"), e.addEventListener(
749
- "blur",
750
- () => {
751
- e.classList.remove("uui-focus-visible");
752
- },
753
- { once: !0 }
754
- ));
755
- }
756
- function Pn(e, n, t, r) {
757
- const s = Number(t);
758
- return Number.isFinite(s) ? Math.min(n, Math.max(e, Math.round(s))) : r;
759
- }
760
- const Un = P(
761
- ({
762
- children: e,
763
- className: n = "",
764
- color: t = "error",
765
- position: r = "topRight",
766
- shape: s = "round",
767
- size: o = "medium",
768
- outlined: u,
769
- raised: l,
770
- filled: m = !0,
771
- value: p,
772
- ...c
773
- }, a) => {
774
- const { bgColor: f, textOnColor: x, textColor: g } = Tn(t);
775
- return Ht(t), /* @__PURE__ */ i("span", { className: ["uui-card-wrapper"].join(" "), ref: a, ...c, children: e });
776
- }
777
- );
778
- Un.displayName = "Card";
779
- const Wn = xt(
780
- null
781
- ), Zt = xt(null);
782
- let rn = !1, Ut = "pointer";
783
- function Hn() {
784
- rn || typeof window > "u" || (rn = !0, window.addEventListener(
785
- "keydown",
786
- () => {
787
- Ut = "keyboard";
788
- },
789
- !0
790
- ), window.addEventListener(
791
- "pointerdown",
792
- () => {
793
- Ut = "pointer";
794
- },
795
- !0
796
- ));
797
- }
798
- function qn() {
799
- return Ut;
800
- }
801
- function Dt() {
802
- return Hn(), kn(
803
- () => () => {
804
- },
805
- () => qn() === "keyboard",
806
- () => !1
807
- );
808
- }
809
- function Zn(e = {}) {
810
- const { action: n = "idle" } = e, [t, r] = ee("idle"), [s, o] = ee(!1), { t1: u = 0, t2: l, oneShot: m = !1 } = e, p = l ?? Math.round(u * 0.67), c = ce(null), a = () => c.current !== null ? (clearTimeout(c.current), c.current = null, !0) : !1, f = yt(
811
- (h) => {
812
- function $(S, M) {
813
- c.current = window.setTimeout(() => {
814
- r(S);
815
- }, M);
816
- }
817
- if (a() && o(!0), m) {
818
- u ? ($("open", u), r("opening")) : r((S) => S === "opening" ? "open" : "opening");
819
- return;
820
- }
821
- if (u) {
822
- const S = (
823
- // eslint-disable-next-line sonarjs/no-nested-conditional,no-nested-ternary
824
- h === "closed" ? !0 : h === "open" ? !1 : t === "open" || t === "opening"
825
- ), M = S ? "closing" : "opening", A = S ? "closed" : "open";
826
- r(M), $(A, A === "open" ? u : p);
827
- return;
828
- }
829
- r((S) => {
830
- switch (S) {
831
- case "idle":
832
- case "closed":
833
- return "opening";
834
- case "opening":
835
- return "open";
836
- case "open":
837
- return "closing";
838
- case "closing":
839
- return "closed";
840
- default:
841
- return S;
842
- }
843
- });
844
- },
845
- [m, t, u, p]
846
- );
847
- ye(() => {
848
- s && o(!1);
849
- }, [s]), ye(() => {
850
- n !== "idle" && f(n === "open" ? "open" : "closed");
851
- }, []);
852
- const x = t === "closing", g = t === "opening";
853
- return {
854
- opening: g,
855
- closing: x,
856
- animating: (g || x) && !s,
857
- idle: t === "idle",
858
- animationVars: {
859
- "--uui-duration": `${g ? u : p}ms`,
860
- "--uui-reverse": x ? "reverse" : "normal"
861
- },
862
- animate: f
863
- };
864
- }
865
- const _t = P(
866
- (e, n) => {
867
- const {
868
- elementClass: t,
869
- density: r,
870
- icon: s,
871
- disabled: o,
872
- elevation: u,
873
- checked: l,
874
- children: m,
875
- color: p,
876
- uncheckedColor: c,
877
- defaultChecked: a,
878
- indeterminate: f,
879
- hoverEffects: x = ["overlay"],
880
- touchEffects: g = ["ripple"],
881
- focusEffects: w = ["ring"],
882
- selectedEffects: F = [],
883
- pressedEffects: b = ["overlay"],
884
- id: h,
885
- name: $,
886
- label: k,
887
- font: S,
888
- border: M,
889
- borderColor: A,
890
- uncheckedBorder: q,
891
- uncheckedBorderColor: E,
892
- onChange: I,
893
- onClick: y,
894
- type: C,
895
- required: v,
896
- shape: N = "smooth",
897
- title: Z,
898
- filled: U,
899
- value: X,
900
- size: we = "small",
901
- uncheckedIcon: he,
902
- indeterminateIcon: K,
903
- description: Me,
904
- descriptionColor: De,
905
- descriptionFont: V,
906
- className: O,
907
- error: Q,
908
- animation: fe,
909
- duration: de = 150,
910
- motionStyle: D = "regular",
911
- focusColor: Ve,
912
- labelColor: ke,
913
- textColor: z,
914
- readOnly: te,
915
- tooltipAlign: W = "auto",
916
- textPlacement: ie = "end",
917
- "aria-label": We,
918
- ...oe
919
- } = e, { animationVars: ne, animate: ve, animating: He } = Zn({
920
- t1: de,
921
- oneShot: !0
922
- }), _ = It(Wn), me = C === "radio" ? $ ?? (_ == null ? void 0 : _.name) : $, Ee = It(Zt), Re = o ?? (Ee == null ? void 0 : Ee.disabled), se = Dt(), [Se, Ce] = ee(!1), Fe = ce(null), $e = ce(null), pe = ce(null), qe = ce($t("check")), ge = h ?? qe.current, Le = l !== void 0, [Be, Ze] = ee(
923
- a ?? !1
924
- );
925
- let le;
926
- Le ? le = !!l : (_ == null ? void 0 : _.value) !== void 0 ? le = _.value === X : le = Be;
927
- const L = f ? "indeterminate" : le ? "checked" : "unchecked", [Y, Te] = ee(L), G = We ?? (k ? void 0 : Z), Je = Q ? "error" : !le && !f && c ? c : p, _e = Z ? /* @__PURE__ */ i("div", { id: `${ge}-tip`, children: Z }) : null, H = (Pe) => {
928
- if (te) {
929
- Pe.preventDefault();
930
- return;
931
- }
932
- const rt = Pe.currentTarget;
933
- Le || (C === "radio" && (_ != null && _.setValue) && _.setValue(rt.value), Ze(rt.checked)), I == null || I(Pe);
934
- }, ae = (Pe) => {
935
- if (te) {
936
- Pe.preventDefault();
937
- return;
938
- }
939
- g.includes("ripple") && pe.current && $e.current && St(pe.current, Pe, $e.current), y == null || y(Pe);
940
- }, je = (Pe) => {
941
- var rt;
942
- Ce(!0), (rt = e.onFocus) == null || rt.call(e, Pe);
943
- }, Ae = (Pe) => {
944
- var rt;
945
- Ce(!1), (rt = e.onBlur) == null || rt.call(e, Pe);
946
- };
947
- ye(() => {
948
- L !== Y && fe && ve();
949
- }, [L, Y, fe, ve]), ye(() => {
950
- He || Te(L);
951
- }, [He, L]);
952
- const Oe = T(), J = [
953
- t,
954
- "uui-cb",
955
- dt(r),
956
- O,
957
- Re && "uui-disabled",
958
- ...m ? [] : [wt(we)]
959
- ].filter(Boolean).join(" "), Xe = [
960
- "uui-cb-control",
961
- le && "uui-checked",
962
- f && "uui-indeterminate",
963
- U && "uui-filled",
964
- ...x.includes("overlay") && !te ? ["uui-hover-overlay"] : [],
965
- ...w.includes("overlay") && se && Se ? ["uui-focus-overlay"] : [],
966
- ...F.includes("overlay") ? ["uui-selected-overlay"] : [],
967
- ...b.includes("overlay") && !te ? ["uui-pressed-overlay"] : [],
968
- ...m ? [Ue(N)] : ["uui-round"]
969
- ].filter(Boolean).join(" "), Ne = T();
970
- Ve && se && Se && Ne.set(
971
- "--uui-focus-color",
972
- mn(Ve).color
973
- );
974
- const re = [
975
- "uui-input",
976
- w.includes("ring") && se && Se && "uui-focus-visible uui-focus-ring"
977
- ].filter(Boolean).join(" "), Qe = ["uui-state"].filter(Boolean).join(" "), Ge = T();
978
- Ge.bg(Je);
979
- const ot = [
980
- "uui-cb-glyph",
981
- ut(u),
982
- Ue(N),
983
- nt(le ? M : q)
984
- ].filter(Boolean).join(" "), et = T(), pt = In(fe), Ke = [
985
- "uui-icon",
986
- He && pt,
987
- En(D)
988
- ].filter(Boolean).join(" "), ue = T();
989
- ue.merge(ne), le || f || c ? (et.border(Q ? "error" : A), U ? (!le && !he && !f || et.bg(Je), ue.text.on(Je)) : ue.text(Je)) : (U && he ? (ue.text(Q ? "onError" : "surface"), et.bg(Q ? "error" : "onSurfaceVariant")) : he && ue.text(Q ? "error" : "onSurfaceVariant"), et.border(Q ? "error" : E));
990
- let ze;
991
- if (m) {
992
- const Pe = [
993
- "uui-cb-content uui-overflow-hidden",
994
- Ue(N),
995
- nt(M)
996
- ].filter(Boolean).join(" ");
997
- ze = /* @__PURE__ */ i("div", { className: Pe, children: m });
998
- } else {
999
- const Pe = (
1000
- // eslint-disable-next-line sonarjs/no-nested-conditional,no-nested-ternary
1001
- Y === "indeterminate" ? K : Y === "checked" ? s : he
1002
- );
1003
- ze = /* @__PURE__ */ i("div", { className: ot, style: et.get(), children: /* @__PURE__ */ i("div", { className: Ke, style: ue.get(), children: Pe }) });
1004
- }
1005
- const gt = T();
1006
- gt.text(
1007
- (Q ? "error" : void 0) ?? ke ?? z ?? "onSurface"
1008
- );
1009
- const Ft = [
1010
- Ie(S ?? "bodyMedium"),
1011
- "uui-cb-label"
1012
- ].join(" "), Lt = k && /* @__PURE__ */ j("label", { className: Ft, htmlFor: ge, style: gt.get(), children: [
1013
- k,
1014
- v && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
1015
- ] }), st = T();
1016
- Q ? st.text("error") : De ? st.text(De) : st.text.on("surfaceVariant");
1017
- const Rt = [
1018
- Ie(V ?? "bodySmall"),
1019
- Q && "uui-error uui-support-text",
1020
- Me && !Q && "uui-description uui-support-text"
1021
- ].filter(Boolean).join(" "), Bt = (Me ?? Q) && /* @__PURE__ */ i("div", { className: Rt, style: st.get(), children: Q ?? Me }), jt = (Lt ?? Bt) && /* @__PURE__ */ j(tt, { children: [
1022
- Lt,
1023
- Bt
1024
- ] }), ct = T();
1025
- return ie === "end" ? (gt.set("gridColumn", 2), st.set("gridColumn", 2), ct.set("gridColumn", 1)) : ie === "start" ? (gt.set("gridColumn", 1), st.set("gridColumn", 1), ct.set("gridColumn", 2), ct.set("gridRow", 1)) : (Oe.set("gridTemplateColumns", "1fr"), Oe.set("justifyItems", "start")), ie === "top" && (ct.set("order", 1), st.set("order", 2)), /* @__PURE__ */ j("div", { className: J, style: Oe.get(), children: [
1026
- /* @__PURE__ */ i(
1027
- "div",
1028
- {
1029
- className: "uui-cb-control-wrapper",
1030
- style: ct.get(),
1031
- children: /* @__PURE__ */ j(
1032
- "div",
1033
- {
1034
- className: Xe,
1035
- ref: $e,
1036
- style: Ne.get(),
1037
- children: [
1038
- /* @__PURE__ */ i(
1039
- "input",
1040
- {
1041
- "aria-label": G,
1042
- "aria-readonly": te === !0 ? !0 : void 0,
1043
- checked: !!le,
1044
- className: re,
1045
- disabled: Re,
1046
- id: ge,
1047
- name: me,
1048
- onBlur: Ae,
1049
- onChange: H,
1050
- onClick: ae,
1051
- onFocus: je,
1052
- readOnly: te,
1053
- ref: ft(Fe, n),
1054
- type: C,
1055
- value: X,
1056
- ...oe
1057
- }
1058
- ),
1059
- /* @__PURE__ */ i(
1060
- "div",
1061
- {
1062
- className: Qe,
1063
- ref: pe,
1064
- style: Ge.get()
1065
- }
1066
- ),
1067
- ze
1068
- ]
1069
- }
1070
- )
1071
- }
1072
- ),
1073
- jt,
1074
- _e && /* @__PURE__ */ i(
1075
- kt,
1076
- {
1077
- align: W,
1078
- tooltip: _e,
1079
- triggerRef: Fe
1080
- }
1081
- )
1082
- ] });
1083
- }
1084
- );
1085
- _t.displayName = "CheckBoxBase";
1086
- const _n = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "3 3 18 18", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
1087
- "path",
1088
- {
1089
- d: "M10 16.4L6 12.4L7.4 11L10 13.6L16.6 7L18 8.4L10 16.4Z",
1090
- fill: "currentColor"
1091
- }
1092
- ) }), Kn = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "3 3 18 18", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("path", { d: "M6 13V11H18V13H6Z", fill: "currentColor" }) }), Gn = P(
1093
- ({
1094
- shape: e = "smooth",
1095
- border: n,
1096
- uncheckedBorder: t,
1097
- color: r,
1098
- borderColor: s,
1099
- animation: o,
1100
- uncheckedBorderColor: u,
1101
- uncheckedIcon: l,
1102
- indeterminateIcon: m,
1103
- indeterminate: p,
1104
- icon: c,
1105
- size: a = "small",
1106
- filled: f = !0,
1107
- ...x
1108
- }, g) => {
1109
- const w = r ?? "primary", F = !c && n === void 0 ? void 0 : n;
1110
- let b;
1111
- return p ? b = n : b = !l && t === void 0 ? n ?? 2 : t, /* @__PURE__ */ i(
1112
- _t,
1113
- {
1114
- animation: o ?? "scale",
1115
- border: F,
1116
- borderColor: s ?? w,
1117
- color: w,
1118
- elementClass: "uui-checkbox",
1119
- filled: f,
1120
- icon: c ?? _n,
1121
- indeterminate: p,
1122
- indeterminateIcon: m ?? Kn,
1123
- ref: g,
1124
- shape: e,
1125
- size: a,
1126
- type: "checkbox",
1127
- uncheckedBorder: b,
1128
- uncheckedBorderColor: u ?? s ?? "onSurfaceVariant",
1129
- uncheckedIcon: l,
1130
- ...x
1131
- }
1132
- );
1133
- }
1134
- );
1135
- Gn.displayName = "Checkbox";
1136
- const oi = P(
1137
- (e, n) => /* @__PURE__ */ i(
1138
- at,
1139
- {
1140
- ref: n,
1141
- ...e,
1142
- type: "date",
1143
- className: "UIDateInput"
1144
- }
1145
- )
1146
- ), si = P(
1147
- (e, n) => /* @__PURE__ */ i(
1148
- at,
1149
- {
1150
- ref: n,
1151
- ...e,
1152
- type: "datetime-local",
1153
- className: "UIDateTimeInput"
1154
- }
1155
- )
1156
- ), li = P(
1157
- (e, n) => /* @__PURE__ */ i(
1158
- at,
1159
- {
1160
- ref: n,
1161
- ...e,
1162
- type: "email",
1163
- className: "UIFormEmailInput"
1164
- }
1165
- )
1166
- ), Xn = P(
1167
- ({
1168
- elevation: e = 3,
1169
- font: n,
1170
- size: t = "medium",
1171
- shape: r = "rounded",
1172
- label: s,
1173
- ...o
1174
- }, u) => /* @__PURE__ */ i(
1175
- Ct,
1176
- {
1177
- ref: u,
1178
- ...o,
1179
- elementClass: s ? "uui-fab uui-fab-extended" : "uui-fab",
1180
- elevation: e,
1181
- font: n ?? {
1182
- extraSmall: "labelLarge",
1183
- small: "titleMedium",
1184
- medium: "titleMedium",
1185
- large: "headlineSmall",
1186
- extraLarge: "headlineLarge"
1187
- }[t],
1188
- label: s,
1189
- shape: r,
1190
- size: t
1191
- }
1192
- )
1193
- );
1194
- Xn.displayName = "Fab";
1195
- const zn = P(
1196
- ({
1197
- "aria-label": e,
1198
- endIcon: n,
1199
- trailing: t,
1200
- loading: r,
1201
- size: s = "small",
1202
- shape: o = "round",
1203
- label: u,
1204
- title: l,
1205
- children: m,
1206
- ...p
1207
- }, c) => /* @__PURE__ */ i(
1208
- Ct,
1209
- {
1210
- ref: c,
1211
- ...p,
1212
- "aria-label": e ?? u,
1213
- elementClass: "uui-icon-button",
1214
- loading: r,
1215
- shape: o,
1216
- size: s,
1217
- title: l,
1218
- children: !r && m
1219
- }
1220
- )
1221
- );
1222
- zn.displayName = "IconButton";
1223
- const Yn = P(
1224
- ({
1225
- selected: e = !1,
1226
- shape: n = "rounded",
1227
- size: t = "medium",
1228
- ...r
1229
- }, s) => /* @__PURE__ */ i(
1230
- Ct,
1231
- {
1232
- ref: s,
1233
- ...r,
1234
- "aria-pressed": e,
1235
- elementClass: `uui-toggle-button${e ? " uui-selected" : ""}`,
1236
- filled: e,
1237
- shape: n,
1238
- size: t
1239
- }
1240
- )
1241
- );
1242
- Yn.displayName = "ToggleButton";
1243
- const pn = Symbol.for("uui.menu");
1244
- function ht(e) {
1245
- return vt(e) && typeof e.type != "string" && !!e.type[pn];
1246
- }
1247
- function gn(e, n, t = {}) {
1248
- const { placement: r = "topCenter", offset: s = 8, mode: o = "tooltip" } = t, u = 12, l = {
1249
- tooltip: ["topCenter", "bottomCenter", "centerRight", "centerLeft"],
1250
- dropdown: ["bottomCenter", "topCenter", "centerRight", "centerLeft"],
1251
- menu: [
1252
- "bottomLeft",
1253
- "bottomRight",
1254
- "topLeft",
1255
- "topRight",
1256
- "centerRight",
1257
- "centerLeft"
1258
- ],
1259
- submenu: [
1260
- "topRightOut",
1261
- "topLeftOut",
1262
- "centerRight",
1263
- "centerLeft",
1264
- "bottomCenter",
1265
- "topCenter"
1266
- ]
1267
- }, m = r === "auto" ? l[o] : [r, ...l[o]], p = e.current, c = n.current;
1268
- if (!p || !c)
1269
- return null;
1270
- const a = p.getBoundingClientRect(), f = c.getBoundingClientRect(), x = window.innerWidth, g = window.innerHeight, w = (b) => {
1271
- let h = 0, $ = 0;
1272
- switch (b) {
1273
- case "topCenter":
1274
- h = a.left + (a.width - f.width) / 2, $ = a.top - f.height - s;
1275
- break;
1276
- case "topLeft":
1277
- h = a.left, $ = a.top - f.height - s;
1278
- break;
1279
- case "topRight":
1280
- h = a.right - f.width, $ = a.top - f.height - s;
1281
- break;
1282
- case "bottomCenter":
1283
- h = a.left + (a.width - f.width) / 2, $ = a.bottom + s;
1284
- break;
1285
- case "bottomLeft":
1286
- h = a.left, $ = a.bottom + s;
1287
- break;
1288
- case "bottomRight":
1289
- h = a.right - f.width, $ = a.bottom + s;
1290
- break;
1291
- case "centerLeft":
1292
- h = a.left - f.width - s, $ = a.top + (a.height - f.height) / 2;
1293
- break;
1294
- case "centerRight":
1295
- h = a.right + s, $ = a.top + (a.height - f.height) / 2;
1296
- break;
1297
- case "center":
1298
- h = a.left + (a.width - f.width) / 2, $ = a.top + (a.height - f.height) / 2;
1299
- break;
1300
- case "topRightOut":
1301
- h = a.right + s, $ = a.top;
1302
- break;
1303
- case "topLeftOut":
1304
- h = a.left - f.width - s, $ = a.top;
1305
- break;
1306
- }
1307
- return { x: h, y: $, placement: b };
1308
- };
1309
- for (const b of m) {
1310
- const h = w(b), $ = h.x >= 0 && h.x + f.width <= x, k = h.y >= 0 && h.y + f.height <= g;
1311
- let S = !1;
1312
- if (b === "centerLeft" || b === "centerRight" ? S = $ : b === "topCenter" || b === "bottomCenter" || b === "center" ? S = k : S = $ && k, S)
1313
- return h.x = Math.max(
1314
- u,
1315
- Math.min(h.x, x - f.width - u)
1316
- ), h.y = Math.max(
1317
- u,
1318
- Math.min(h.y, g - f.height - u)
1319
- ), h;
1320
- }
1321
- const F = w(r);
1322
- return F.x = Math.max(
1323
- u,
1324
- Math.min(F.x, x - f.width - u)
1325
- ), F.y = Math.max(
1326
- u,
1327
- Math.min(F.y, g - f.height - u)
1328
- ), F;
1329
- }
1330
- function Jn(e, n, t, r) {
1331
- ye(() => {
1332
- if (!e)
1333
- return;
1334
- const s = (o) => {
1335
- var p, c;
1336
- const u = o.target;
1337
- if (Array.isArray(n)) {
1338
- const a = n.some((x) => {
1339
- var g;
1340
- return (g = x.current) == null ? void 0 : g.contains(u);
1341
- }), f = ((p = r == null ? void 0 : r.current) == null ? void 0 : p.contains(u)) ?? !1;
1342
- !a && !f && t();
1343
- return;
1344
- }
1345
- const l = !!u.closest(n), m = ((c = r == null ? void 0 : r.current) == null ? void 0 : c.contains(u)) ?? !1;
1346
- !l && !m && t();
1347
- };
1348
- return document.addEventListener("mousedown", s), () => {
1349
- document.removeEventListener("mousedown", s);
1350
- };
1351
- }, [e, n, t, r]);
1352
- }
1353
- const Qn = (e) => e === "none" ? "none" : e === "auto" ? "scale" : e, Kt = P(
1354
- ({
1355
- anchorRef: e,
1356
- open: n = !1,
1357
- horizontal: t = !1,
1358
- placement: r = "auto",
1359
- floatingMode: s,
1360
- offset: o = 4,
1361
- color: u,
1362
- elevation: l,
1363
- dockedElevation: m,
1364
- shape: p,
1365
- border: c,
1366
- borderColor: a,
1367
- className: f,
1368
- children: x,
1369
- style: g,
1370
- id: w,
1371
- onClose: F,
1372
- variant: b = "classic",
1373
- animation: h = "scale",
1374
- duration: $,
1375
- motionStyle: k = "regular",
1376
- fixedLeading: S,
1377
- density: M,
1378
- __level: A,
1379
- __groupId: q,
1380
- __closeRootMenu: E,
1381
- __navigateHorizontal: I,
1382
- __horizontalDepth: y,
1383
- docked: C,
1384
- textColor: v,
1385
- descriptionColor: N,
1386
- labelColor: Z,
1387
- shortcutColor: U,
1388
- uncheckedIcon: X,
1389
- checkedIcon: we,
1390
- radioUncheckedIcon: he,
1391
- radioCheckedIcon: K,
1392
- selectedColor: Me,
1393
- itemTouchEffects: De,
1394
- itemSelectedEffects: V,
1395
- itemFocusEffects: O,
1396
- closeOnChange: Q = !1,
1397
- openOnHover: fe = !0,
1398
- labelFont: de,
1399
- font: D,
1400
- descriptionFont: Ve,
1401
- shortcutFont: ke,
1402
- ...z
1403
- }, te) => {
1404
- const W = ce("closed"), [ie, We] = ee(-1), [oe, ne] = ee(-1), [ve, He] = ee(!1), _ = Dt(), me = A ?? 0, Ee = ce(w ?? $t("menu")).current, Re = q ?? Ee, se = ce(null), Se = ce(null), [Ce, Fe] = ee(
1405
- null
1406
- ), $e = ie === -1, [pe, qe] = ee(!1), [ge, Le] = ee(!1), [Be, Ze] = ee("normal"), [le, L] = ee(!1), [Y, Te] = ee(-1), G = u ?? (b === "modern" ? "surfaceContainerLow" : "surfaceContainer"), Je = (C ? m : void 0) ?? l ?? (b === "modern" ? 3 : 2), [_e, H] = ee(!1), ae = h !== "none" ? $ ?? 220 : 0, je = C ? 0 : ae, Ae = ce(null), Oe = ce(null), J = ie !== -1;
1407
- function Xe(d) {
1408
- return Ot(d) || Pt(d);
1409
- }
1410
- const Ne = lt.Children.toArray(x).filter(
1411
- Xe
1412
- ), re = Ne.reduce(
1413
- (d, B, R) => (Ot(B) && (B.props.disabled || d.push(R)), d),
1414
- []
1415
- );
1416
- function Qe() {
1417
- J && (H(!0), We(-1));
1418
- }
1419
- function Ge() {
1420
- F == null || F(), !F && J && (Qe(), ne(-1)), me === 0 && (e != null && e.current) && e.current.focus();
1421
- }
1422
- function ot() {
1423
- E ? E() : Ge();
1424
- }
1425
- function et(d) {
1426
- return !se.current || d === -1 ? null : se.current.querySelector(
1427
- `[data-menu-index="${String(d)}"]`
1428
- );
1429
- }
1430
- function pt(d) {
1431
- const R = lt.Children.toArray(
1432
- Ne[d].props.children
1433
- ).find((it) => ht(it));
1434
- return vt(R) ? lt.Children.toArray(
1435
- R.props.children
1436
- ).filter(
1437
- (it) => Pt(it) || Xe(it)
1438
- ) : void 0;
1439
- }
1440
- function Ke(d) {
1441
- if (d === -1 || re.indexOf(d) === -1)
1442
- return;
1443
- if (J) {
1444
- Te(d), Qe();
1445
- return;
1446
- }
1447
- const R = pt(d);
1448
- if (!R || R.length === 0)
1449
- return;
1450
- const xe = et(d);
1451
- xe && (Se.current = xe, H(!0), We(d), setTimeout(() => {
1452
- H(!1);
1453
- }, ae));
1454
- }
1455
- function ue(d) {
1456
- return d < 0 ? !1 : lt.Children.toArray(
1457
- Ne[d].props.children
1458
- ).some((R) => ht(R));
1459
- }
1460
- function ze(d) {
1461
- if (oe === -1)
1462
- return;
1463
- const B = re.indexOf(oe);
1464
- if (B === -1)
1465
- return;
1466
- let R;
1467
- d ? R = re[B + 1 < re.length ? B + 1 : 0] : R = B > 0 ? re[B - 1] : re[re.length - 1], R !== oe && (ne(R), ue(R) ? Ke(R) : Qe());
1468
- }
1469
- ye(() => {
1470
- J || setTimeout(() => {
1471
- L(!0);
1472
- }, ae * 0.67);
1473
- }, [ae, J]), ye(() => {
1474
- var d;
1475
- !J && le && (L(!1), We(-1), Y !== -1 ? (Te(-1), Ke(Y)) : (d = se.current) == null || d.focus(), H(!1));
1476
- }, [le, Y, J]), ye(() => {
1477
- n ? (W.current = "opening", H(!0), Ze("normal"), qe(!0), We(-1), Le(!1), ne(-1)) : (W.current = "closing", H(!0), Le(!1), Ze("reverse"));
1478
- }, [n]), ye(() => {
1479
- if (!n || !pe || !se.current)
1480
- return;
1481
- const d = () => {
1482
- const B = s ?? (t ? "dropdown" : "menu");
1483
- if (e != null && e.current) {
1484
- const R = gn(e, se, {
1485
- placement: r,
1486
- mode: B,
1487
- offset: o
1488
- });
1489
- R && Fe({ x: R.x, y: R.y });
1490
- }
1491
- };
1492
- return C ? Fe({ x: 0, y: 0 }) : (window.addEventListener("resize", d), d()), Le(!0), () => {
1493
- C || window.removeEventListener("resize", d);
1494
- };
1495
- }, [
1496
- e,
1497
- C,
1498
- s,
1499
- t,
1500
- o,
1501
- n,
1502
- r,
1503
- pe
1504
- ]), ye(() => {
1505
- n && pe && Ce && setTimeout(() => {
1506
- var d;
1507
- W.current === "opening" && (H(!1), W.current = "opened", C || (d = se.current) == null || d.focus(), ne(_ ? re[0] ?? -1 : -1));
1508
- }, je);
1509
- }, [n, Ce, pe]), ye(() => {
1510
- Be === "reverse" && W.current === "closing" && (Le(!0), ne(-1), setTimeout(() => {
1511
- W.current === "closing" && (W.current = "closed", qe(!1), Fe(null), H(!1));
1512
- }, ae * 0.67));
1513
- }, [ae, Be]), ye(() => {
1514
- if (oe < 0 || !ve || W.current !== "opened")
1515
- return;
1516
- const d = et(oe);
1517
- d && (d.focus({ preventScroll: !0 }), d.scrollIntoView({
1518
- block: "nearest",
1519
- inline: "nearest"
1520
- }), setTimeout(() => {
1521
- var B;
1522
- (B = se.current) == null || B.focus({ preventScroll: !0 });
1523
- }, 0));
1524
- }, [oe, ve]), ye(() => {
1525
- ve && _ && oe === -1 && W.current === "opened" && re.length > 0 && ne(re[0]);
1526
- }, [oe, _, ve]);
1527
- function gt(d) {
1528
- He(!0);
1529
- }
1530
- Jn(
1531
- n && me === 0,
1532
- `[data-menu-group="${Re}"]`,
1533
- () => {
1534
- ot();
1535
- },
1536
- e
1537
- );
1538
- function Ft(d) {
1539
- var R, xe, it, en;
1540
- const B = d;
1541
- B !== -1 && (Ne[B].props.disabled || (ne(B), ue(B) ? J && B === ie ? Qe() : Ke(B) : Ne[B].props.type === "radio" || Ne[B].props.type === "checkbox" || Ne[B].props.type === "option" ? ((xe = (R = Ne[B].props).onChange) == null || xe.call(R), Q && ot()) : ((en = (it = Ne[B].props).onClick) == null || en.call(it), ot())));
1542
- }
1543
- function Lt(d, B) {
1544
- if (_e) {
1545
- d == null || d.preventDefault();
1546
- return;
1547
- }
1548
- Ft(B);
1549
- }
1550
- function st(d, B) {
1551
- if (!(!fe || _ && ve)) {
1552
- if (Oe.current && (clearTimeout(Oe.current), Oe.current = null), Ae.current && (clearTimeout(Ae.current), Ae.current = null), !ue(B)) {
1553
- J && (Oe.current = window.setTimeout(() => {
1554
- Qe();
1555
- }, 150));
1556
- return;
1557
- }
1558
- J && ie === B || (Ae.current = window.setTimeout(() => {
1559
- ne(B), Ke(B);
1560
- }, 150));
1561
- }
1562
- }
1563
- function Rt() {
1564
- Oe.current && (clearTimeout(Oe.current), Oe.current = null), Ae.current && (clearTimeout(Ae.current), Ae.current = null);
1565
- }
1566
- const Bt = Ne.some(
1567
- (d) => d.props.icon !== void 0 || d.props.leading !== void 0 || d.props.type === "radio" || d.props.type === "checkbox"
1568
- ), jt = Ne.map((d, B) => {
1569
- if (Ot(d)) {
1570
- const R = {
1571
- "data-menu-index": B,
1572
- __interactionsDisabled: _e,
1573
- __index: B,
1574
- disabled: d.props.disabled,
1575
- active: B === oe && ve,
1576
- focusVisible: _ && ve,
1577
- horizontal: t,
1578
- expanded: J && ie === B,
1579
- fixedLeading: d.props.fixedLeading ?? (S && Bt),
1580
- variant: d.props.variant ?? b,
1581
- shape: d.props.shape ?? p,
1582
- color: d.props.color ?? u,
1583
- density: d.props.density ?? M,
1584
- shortcutColor: d.props.shortcutColor ?? U,
1585
- textColor: d.props.textColor ?? v,
1586
- labelColor: d.props.labelColor ?? Z,
1587
- descriptionColor: d.props.descriptionColor ?? N,
1588
- checkedIcon: d.props.checkedIcon ?? (d.props.type === "checkbox" ? we : K),
1589
- uncheckedIcon: d.props.uncheckedIcon ?? (d.props.type === "checkbox" ? X : he),
1590
- selectedColor: d.props.selectedColor ?? Me,
1591
- touchEffects: d.props.touchEffects ?? De,
1592
- selectedEffects: d.props.selectedEffects ?? V,
1593
- focusEffects: d.props.focusEffects ?? O,
1594
- labelFont: d.props.labelFont ?? de,
1595
- font: d.props.font ?? D,
1596
- descriptionFont: d.props.descriptionFont ?? Ve,
1597
- shortcutFont: d.props.shortcutFont ?? ke,
1598
- onClick: (xe) => {
1599
- Lt(xe, B);
1600
- },
1601
- onMouseEnter: (xe) => {
1602
- st(xe, B);
1603
- },
1604
- onMouseLeave: (xe) => {
1605
- Rt();
1606
- }
1607
- };
1608
- return At(d, {
1609
- ...d.props,
1610
- ...R
1611
- });
1612
- } else if (Pt(d)) {
1613
- const R = Tt[G] === "onSurface" ? "outlineVariant" : Tt[G], xe = {
1614
- borderColor: d.props.borderColor ?? d.props.color ?? R,
1615
- vertical: t,
1616
- insetSize: d.props.insetSize ?? 8,
1617
- spacing: d.props.spacing ?? (b === "modern" ? 5 : 8),
1618
- inset: d.props.inset ?? (b === "modern" ? "middle" : void 0)
1619
- };
1620
- return At(d, { ...d.props, ...xe });
1621
- }
1622
- return At(d, {
1623
- ...d.props
1624
- });
1625
- });
1626
- function ct(d) {
1627
- d.target.closest("[data-menu-index]") || J && Qe();
1628
- }
1629
- const Pe = (d) => {
1630
- if (!n || _e)
1631
- return;
1632
- let B = d.key;
1633
- if (t) {
1634
- const it = {
1635
- ArrowDown: "ArrowRight",
1636
- ArrowUp: "ArrowLeft",
1637
- ArrowRight: "ArrowDown",
1638
- ArrowLeft: "ArrowUp"
1639
- };
1640
- B = it[B] ? it[B] : B;
1641
- }
1642
- if (re.length === 0 && B !== "Tab")
1643
- return;
1644
- const R = re.indexOf(oe);
1645
- let xe;
1646
- switch (B) {
1647
- case "ArrowUp":
1648
- d.preventDefault(), oe === -1 || R === -1 ? xe = re[re.length - 1] : xe = R > 0 ? re[R - 1] : re[re.length - 1], ne(xe), t && ue(xe) && Ke(xe);
1649
- break;
1650
- case "ArrowDown":
1651
- d.preventDefault(), oe === -1 || R === -1 ? xe = re[0] : xe = re[R + 1 < re.length ? R + 1 : 0], ne(xe), t && ue(xe) && Ke(xe);
1652
- break;
1653
- case "Home":
1654
- ne(re[0]);
1655
- break;
1656
- case "End":
1657
- ne(re[re.length - 1]);
1658
- break;
1659
- case "Enter":
1660
- case " ":
1661
- d.stopPropagation(), d.preventDefault(), R >= 0 && Ft(re[R]);
1662
- break;
1663
- case "ArrowRight":
1664
- d.preventDefault(), R >= 0 && ue(re[R]) ? Ke(re[R]) : I && I(!0);
1665
- break;
1666
- case "ArrowLeft":
1667
- d.preventDefault(), I && y === 1 ? I(!1) : Ge();
1668
- break;
1669
- case "Escape":
1670
- d.preventDefault(), Ge();
1671
- break;
1672
- case "Tab":
1673
- C || (d.stopPropagation(), d.preventDefault()), ot();
1674
- break;
1675
- }
1676
- };
1677
- if (!n && !pe || !e && !C)
1678
- return null;
1679
- const rt = {
1680
- "--uui-reverse": Be,
1681
- "--uui-duration": Be === "reverse" ? String(je * 0.67) + "ms" : String(je) + "ms"
1682
- }, zt = Qn(h), xn = zt === "none" ? "" : Mt[zt], wn = k === "expressive" ? "uui-motion-expressive" : "", Nt = T({ ...g, ...rt });
1683
- Nt.bg(G), Nt.text.on(G), c && +c > 0 && Nt.border(mt(a));
1684
- const Sn = [
1685
- "uui-menu",
1686
- `uui-menu-level-${String(me)}`,
1687
- t && "uui-menu-horizontal",
1688
- $e && "uui-menu-active",
1689
- b === "modern" ? "uui-menu-modern" : "uui-menu-classic",
1690
- ge && xn,
1691
- wn,
1692
- dt(M),
1693
- Ue(p ?? (b === "modern" ? "rounded" : "smooth")),
1694
- ut(Je),
1695
- c !== void 0 ? nt(c) : null,
1696
- f
1697
- ].filter(Boolean).join(" "), Yt = /* @__PURE__ */ i(
1698
- "div",
1699
- {
1700
- "aria-orientation": t ? "horizontal" : "vertical",
1701
- className: Sn,
1702
- "data-menu-group": Re,
1703
- id: w,
1704
- onBlur: () => {
1705
- He(!1);
1706
- },
1707
- onClick: ct,
1708
- onFocus: gt,
1709
- onKeyDown: Pe,
1710
- ref: ft(te, se),
1711
- role: "menu",
1712
- style: {
1713
- position: C ? "relative" : "fixed",
1714
- left: (Ce == null ? void 0 : Ce.x) ?? 0,
1715
- top: (Ce == null ? void 0 : Ce.y) ?? 0,
1716
- zIndex: 9999,
1717
- visibility: Ce ? "visible" : "hidden",
1718
- ...Nt.get()
1719
- },
1720
- tabIndex: 0,
1721
- ...z,
1722
- children: /* @__PURE__ */ i("div", { className: "uui-menu-scroll", children: jt })
1723
- }
1724
- ), $n = document.getElementById("menu-root") ?? document.body;
1725
- let Jt = null;
1726
- if (ie !== -1) {
1727
- const d = pt(ie);
1728
- d && d.length > 0 && (Jt = d);
1729
- }
1730
- const Qt = Wt(
1731
- /* @__PURE__ */ j(tt, { children: [
1732
- !C && Yt,
1733
- Se.current && ie !== -1 && /* @__PURE__ */ i(
1734
- Kt,
1735
- {
1736
- __closeRootMenu: E ?? ot,
1737
- __groupId: Re,
1738
- __horizontalDepth: t ? 1 : y && y + 1,
1739
- __level: me + 1,
1740
- __navigateHorizontal: t ? ze : I,
1741
- anchorRef: Se,
1742
- animation: h,
1743
- "aria-orientation": "vertical",
1744
- border: c,
1745
- borderColor: a,
1746
- checkedIcon: we,
1747
- closeOnChange: Q,
1748
- color: G,
1749
- density: M,
1750
- descriptionColor: N,
1751
- descriptionFont: Ve,
1752
- duration: $,
1753
- elevation: l,
1754
- fixedLeading: S,
1755
- floatingMode: t ? "menu" : "submenu",
1756
- font: D,
1757
- itemFocusEffects: O,
1758
- itemSelectedEffects: V,
1759
- itemTouchEffects: De,
1760
- labelColor: Z,
1761
- labelFont: de,
1762
- motionStyle: k,
1763
- offset: 0,
1764
- onClose: Qe,
1765
- open: n && J,
1766
- openOnHover: fe,
1767
- placement: "auto",
1768
- radioCheckedIcon: K,
1769
- radioUncheckedIcon: he,
1770
- role: "menu",
1771
- selectedColor: Me,
1772
- shape: p,
1773
- shortcutColor: U,
1774
- shortcutFont: ke,
1775
- textColor: v,
1776
- uncheckedIcon: X,
1777
- variant: b,
1778
- children: Jt
1779
- }
1780
- )
1781
- ] }),
1782
- $n
1783
- );
1784
- return C && me === 0 ? /* @__PURE__ */ j(tt, { children: [
1785
- Yt,
1786
- Qt
1787
- ] }) : Qt;
1788
- }
1789
- );
1790
- Kt[pn] = !0;
1791
- Kt.displayName = "Menu";
1792
- const Gt = Symbol.for("uui.menuitem");
1793
- function Ot(e) {
1794
- return vt(e) && typeof e.type != "string" && !!e.type[Gt];
1795
- }
1796
- const er = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("path", { d: "M10 17V7L15 12L10 17Z", fill: "currentColor" }) }), tr = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
1797
- "path",
1798
- {
1799
- d: "M9.5501 18L3.8501 12.3L5.2751 10.875L9.5501 15.15L18.7251 5.97498L20.1501 7.39998L9.5501 18Z",
1800
- fill: "currentColor"
1801
- }
1802
- ) }), nr = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
1803
- "path",
1804
- {
1805
- d: "M12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z",
1806
- fill: "currentColor"
1807
- }
1808
- ) }), rr = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
1809
- "path",
1810
- {
1811
- d: "M12 17C13.3833 17 14.5625 16.5125 15.5375 15.5375C16.5125 14.5625 17 13.3833 17 12C17 10.6167 16.5125 9.4375 15.5375 8.4625C14.5625 7.4875 13.3833 7 12 7C10.6167 7 9.4375 7.4875 8.4625 8.4625C7.4875 9.4375 7 10.6167 7 12C7 13.3833 7.4875 14.5625 8.4625 15.5375C9.4375 16.5125 10.6167 17 12 17ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z",
1812
- fill: "currentColor"
1813
- }
1814
- ) }), hn = P(
1815
- ({
1816
- shape: e,
1817
- touchEffects: n = ["ripple"],
1818
- focusEffects: t = ["ring", "overlay"],
1819
- selectedEffects: r = ["color"],
1820
- checkedIcon: s,
1821
- uncheckedIcon: o,
1822
- selectedColor: u,
1823
- textColor: l,
1824
- labelColor: m,
1825
- descriptionColor: p,
1826
- shortcutColor: c,
1827
- fixedLeading: a,
1828
- color: f,
1829
- icon: x,
1830
- endIcon: g,
1831
- leading: w,
1832
- trailing: F,
1833
- label: b,
1834
- disabled: h = !1,
1835
- className: $,
1836
- onClick: k,
1837
- badge: S,
1838
- expanded: M,
1839
- active: A,
1840
- children: q,
1841
- focusVisible: E,
1842
- type: I = "item",
1843
- checked: y,
1844
- description: C,
1845
- shortcut: v,
1846
- density: N,
1847
- horizontal: Z,
1848
- labelFont: U,
1849
- font: X,
1850
- descriptionFont: we,
1851
- shortcutFont: he,
1852
- selected: K,
1853
- __index: Me,
1854
- __interactionsDisabled: De,
1855
- onChange: V,
1856
- variant: O = "classic",
1857
- ...Q
1858
- }, fe) => {
1859
- const de = ce(null), D = lt.Children.toArray(q), Ve = D.find((G) => ht(G)), ke = D.filter((G) => !ht(G)), z = !!Ve;
1860
- let te;
1861
- I !== "item" && (I === "radio" ? te = y ? s ?? rr : o ?? nr : I === "checkbox" && (te = y ? s ?? tr : o));
1862
- const W = te ?? w ?? x ?? (a && !Z), ie = W && /* @__PURE__ */ i("div", { className: "uui-icon uui-leading", children: W }), We = F ?? g;
1863
- let oe;
1864
- S && (typeof S == "string" || typeof S == "number" ? oe = /* @__PURE__ */ i(qt, { value: S }) : oe = S);
1865
- const ne = O === "modern" ? "labelLarge" : "bodyLarge", ve = U ?? X ?? ne, He = we ?? (O === "modern" ? "bodySmall" : "bodyMedium"), _ = he ?? ne, me = T();
1866
- me.text(c);
1867
- const Ee = z && !Z ? er : We, Re = v && /* @__PURE__ */ i(
1868
- "div",
1869
- {
1870
- className: `uui-menu-item-shortcut ${Ie(_)}`,
1871
- style: me.get(),
1872
- children: v
1873
- }
1874
- ), se = (v ?? S ?? Ee) && /* @__PURE__ */ j(tt, { children: [
1875
- Re,
1876
- oe,
1877
- Ee && /* @__PURE__ */ i("div", { className: "uui-icon uui-trailing", children: Ee })
1878
- ] }), Se = T();
1879
- Se.text(m);
1880
- const Ce = b && /* @__PURE__ */ i(
1881
- "div",
1882
- {
1883
- className: `uui-menu-item-label ${Ie(ve)}`,
1884
- style: Se.get(),
1885
- children: b
1886
- }
1887
- ), Fe = T();
1888
- (p || !l && O === "classic" && (f != null && f.startsWith("surface"))) && (p ? Fe.text(p) : Fe.text.on("surfaceVariant"));
1889
- const $e = C && /* @__PURE__ */ i(
1890
- "div",
1891
- {
1892
- className: `uui-menu-item-description ${Ie(He)}`,
1893
- style: Fe.get(),
1894
- children: C
1895
- }
1896
- ), pe = (Ce ?? $e) && /* @__PURE__ */ j("div", { className: "uui-menu-item-text", children: [
1897
- Ce,
1898
- $e
1899
- ] }), qe = (G) => {
1900
- if (De || h) {
1901
- G == null || G.preventDefault();
1902
- return;
1903
- }
1904
- k == null || k(G), n.includes("ripple") && de.current && G && St(de.current, G);
1905
- };
1906
- let ge = f ?? (O === "modern" ? "surfaceContainerLow" : "surfaceContainer");
1907
- I === "option" && K && r.includes("color") && (ge = u ?? (O === "modern" ? "tertiaryContainer" : "secondaryContainer"));
1908
- const Le = T();
1909
- Le.bg.on(ge);
1910
- const Be = T();
1911
- Be.bg(ge), l ? Be.text(l) : Be.text.on(ge);
1912
- const Ze = [
1913
- "uui-menu-item",
1914
- $,
1915
- dt(N),
1916
- h && "uui-disabled",
1917
- O === "modern" ? "uui-menu-item-modern" : "uui-menu-item-classic"
1918
- ].filter(Boolean).join(" "), le = Ue(
1919
- e ?? (O === "modern" ? "rounded" : "smooth")
1920
- ), L = [
1921
- "uui-menu-item-content",
1922
- le,
1923
- ...t.includes("ring") && A ? ["uui-focus-ring-in"] : [],
1924
- ...t.includes("overlay") && A ? ["uui-focus-overlay"] : [],
1925
- A && "uui-active",
1926
- A && E && "uui-focus-visible"
1927
- ].filter(Boolean).join(" "), Y = /* @__PURE__ */ j("div", { className: L, style: Be.get(), children: [
1928
- ke.length > 0 ? /* @__PURE__ */ i("div", { className: "uui-menu-item-children", children: ke }) : /* @__PURE__ */ j(tt, { children: [
1929
- ie,
1930
- pe,
1931
- se
1932
- ] }),
1933
- /* @__PURE__ */ i(
1934
- "div",
1935
- {
1936
- className: ["uui-state", le].join(" "),
1937
- style: Le.get()
1938
- }
1939
- )
1940
- ] });
1941
- let Te = "menuitem";
1942
- return (I === "radio" || I === "checkbox") && (Te = I === "radio" ? "menuitemradio" : "menuitemcheckbox"), // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
1943
- /* @__PURE__ */ i(
1944
- "div",
1945
- {
1946
- ...Q,
1947
- "aria-checked": I === "radio" || I === "checkbox" ? y ?? !1 : void 0,
1948
- "aria-disabled": h ? "true" : void 0,
1949
- "aria-expanded": z ? M : void 0,
1950
- "aria-haspopup": z ? "menu" : void 0,
1951
- className: Ze,
1952
- onClick: qe,
1953
- ref: ft(de, fe),
1954
- role: Te,
1955
- tabIndex: -1,
1956
- children: Y
1957
- }
1958
- );
1959
- }
1960
- );
1961
- hn[Gt] = !0;
1962
- hn.displayName = "MenuItem";
1963
- const Cn = Symbol.for("uui.divider");
1964
- function Pt(e) {
1965
- return vt(e) && typeof e.type != "string" && !!e.type[Cn];
1966
- }
1967
- const bn = (e) => {
1968
- const {
1969
- className: n,
1970
- borderColor: t,
1971
- color: r,
1972
- border: s = 1,
1973
- inset: o = "none",
1974
- insetSize: u = 16,
1975
- spacing: l = 8,
1976
- vertical: m,
1977
- variant: p = "strong",
1978
- elevation: c,
1979
- shape: a,
1980
- style: f,
1981
- height: x,
1982
- ...g
1983
- } = e, w = ce(null), [F, b] = ee(!1);
1984
- ln(() => {
1985
- const M = w.current;
1986
- if (!(M != null && M.parentElement))
1987
- return;
1988
- const A = getComputedStyle(M.parentElement).display;
1989
- b(A.includes("flex"));
1990
- }, []);
1991
- const h = Math.min(4, Math.max(0, s)), $ = [
1992
- "uui-divider",
1993
- An(h === 0 ? 0 : 1),
1994
- n,
1995
- c && On(c),
1996
- a && jn(a)
1997
- ].filter(Boolean).join(" "), k = T(f), S = mt(t ?? r ?? "outlineVariant");
1998
- if (k.border(S), k.bg(S), p !== "strong" && (p === "subtle" ? k.set("opacity", "var(--uui-subtle-opacity)") : k.set("opacity", "var(--uui-medium-opacity)")), F ? m ? k.merge({
1999
- height: x,
2000
- alignSelf: "stretch",
2001
- width: `${h}px`,
2002
- marginInline: `${l}px`
2003
- }) : k.merge({
2004
- flex: "1 1 auto",
2005
- height: `${h}px`,
2006
- marginBlock: `${l}px`
2007
- }) : m ? k.merge({
2008
- height: x,
2009
- display: "inline-block",
2010
- verticalAlign: "middle",
2011
- width: `${h}px`,
2012
- marginInline: `${l}px`
2013
- }) : k.merge({
2014
- height: `${h}px`,
2015
- marginBlock: `${l}px`
2016
- }), o !== "none") {
2017
- const M = o === "left" || o === "top" || o === "middle", A = o === "right" || o === "bottom" || o === "middle";
2018
- M && (m ? k.set("marginBlockStart", `${u}px`) : k.set("marginInlineStart", `${u}px`)), A && (m ? k.set("marginBlockEnd", `${u}px`) : k.set("marginInlineEnd", `${u}px`));
2019
- }
2020
- return /* @__PURE__ */ i(
2021
- "div",
2022
- {
2023
- "aria-hidden": "true",
2024
- className: $,
2025
- ref: w,
2026
- role: "separator",
2027
- style: k.get(),
2028
- ...g
2029
- }
2030
- );
2031
- };
2032
- bn[Cn] = !0;
2033
- bn.displayName = "Divider";
2034
- const ai = P(
2035
- (e, n) => /* @__PURE__ */ i(
2036
- at,
2037
- {
2038
- ref: n,
2039
- ...e,
2040
- type: "number",
2041
- className: "UINumberInput"
2042
- }
2043
- )
2044
- ), ir = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "2 2 20 20", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
2045
- "path",
2046
- {
2047
- d: "M12 17C13.3833 17 14.5625 16.5125 15.5375 15.5375C16.5125 14.5625 17 13.3833 17 12C17 10.6167 16.5125 9.4375 15.5375 8.4625C14.5625 7.4875 13.3833 7 12 7C10.6167 7 9.4375 7.4875 8.4625 8.4625C7.4875 9.4375 7 10.6167 7 12C7 13.3833 7.4875 14.5625 8.4625 15.5375C9.4375 16.5125 10.6167 17 12 17Z",
2048
- fill: "currentColor"
2049
- }
2050
- ) }), or = P(
2051
- ({
2052
- uncheckedBorder: e,
2053
- border: n,
2054
- color: t,
2055
- borderColor: r,
2056
- uncheckedBorderColor: s,
2057
- shape: o = "round",
2058
- size: u = "small",
2059
- filled: l = !1,
2060
- icon: m,
2061
- uncheckedIcon: p,
2062
- animation: c,
2063
- ...a
2064
- }, f) => {
2065
- const x = t ?? "primary";
2066
- return /* @__PURE__ */ i(
2067
- _t,
2068
- {
2069
- animation: c ?? "scale",
2070
- border: !m && n === void 0 ? 2 : n,
2071
- borderColor: r ?? x,
2072
- color: x,
2073
- elementClass: "uui-radio",
2074
- filled: l,
2075
- icon: m ?? ir,
2076
- indeterminateIcon: void 0,
2077
- ref: f,
2078
- shape: o,
2079
- size: u,
2080
- type: "radio",
2081
- uncheckedBorder: e ?? n ?? (p ? void 0 : 2),
2082
- uncheckedBorderColor: s ?? r ?? "onSurfaceVariant",
2083
- uncheckedIcon: p,
2084
- ...a
2085
- }
2086
- );
2087
- }
2088
- );
2089
- or.displayName = "Radio";
2090
- const ui = P(
2091
- (e, n) => /* @__PURE__ */ i(
2092
- at,
2093
- {
2094
- ref: n,
2095
- ...e,
2096
- type: "tel",
2097
- className: "UITelInput"
2098
- }
2099
- )
2100
- );
2101
- function sr(e) {
2102
- const n = Dt(), [t, r] = ee(!1);
2103
- return ye(() => {
2104
- const s = e.current;
2105
- if (!s)
2106
- return;
2107
- const o = () => {
2108
- r(!0);
2109
- }, u = () => {
2110
- r(!1);
2111
- };
2112
- return s.addEventListener("focus", o, !0), s.addEventListener("blur", u, !0), () => {
2113
- s.removeEventListener("focus", o, !0), s.removeEventListener("blur", u, !0);
2114
- };
2115
- }, [e]), {
2116
- isFocused: t,
2117
- focusVisible: n
2118
- };
2119
- }
2120
- const at = P(
2121
- (e, n) => {
2122
- const {
2123
- elementClass: t,
2124
- color: r,
2125
- density: s,
2126
- label: o,
2127
- labelColor: u,
2128
- labelFont: l,
2129
- id: m,
2130
- outlined: p,
2131
- filled: c,
2132
- classic: a,
2133
- disabled: f,
2134
- font: x,
2135
- placeholderFont: g,
2136
- placeholderColor: w,
2137
- border: F,
2138
- borderColor: b,
2139
- shape: h,
2140
- required: $,
2141
- title: k,
2142
- description: S,
2143
- descriptionColor: M,
2144
- descriptionFont: A,
2145
- name: q,
2146
- error: E,
2147
- className: I,
2148
- placeholder: y,
2149
- type: C = "text",
2150
- icon: v,
2151
- leading: N,
2152
- trailing: Z,
2153
- endIcon: U,
2154
- variant: X,
2155
- value: we,
2156
- textColor: he,
2157
- defaultValue: K,
2158
- ...Me
2159
- } = e, [De, V] = ee(K ?? ""), O = we !== void 0, fe = (O ? we : De).length === 0, de = ce(null), D = ce(null), Ve = m ?? $t("input"), [ke, z] = ee(0), te = N ?? v, W = X ?? (c && "filled") ?? (p && "outlined") ?? (a && "classic") ?? "filled", { isFocused: ie } = sr(de), We = (H) => {
2160
- var ae;
2161
- O || V(H.target.value), (ae = e.onChange) == null || ae.call(e, H);
2162
- }, oe = (H) => {
2163
- var ae;
2164
- H.preventDefault(), (ae = de.current) == null || ae.focus();
2165
- };
2166
- ye(() => {
2167
- const H = de.current;
2168
- H && H.value && V(H.value);
2169
- }, []), ln(() => {
2170
- const H = D.current, ae = de.current;
2171
- if (!H || !ae)
2172
- return;
2173
- const je = H.getBoundingClientRect().left - ae.getBoundingClientRect().left + 16;
2174
- z((Ae) => Ae === je ? Ae : je);
2175
- }, [te]);
2176
- const ne = [
2177
- t,
2178
- I,
2179
- "uui-field uui-field-wrapper",
2180
- `uui-${W}`,
2181
- dt(s)
2182
- ], ve = te && /* @__PURE__ */ i("div", { className: "uui-leading", children: lt.Children.map(
2183
- te,
2184
- (H) => H ? /* @__PURE__ */ i(
2185
- "span",
2186
- {
2187
- className: "uui-slot",
2188
- onClick: (ae) => {
2189
- ae.stopPropagation();
2190
- },
2191
- children: H
2192
- }
2193
- ) : null
2194
- ) }), He = Z ?? U, _ = He && /* @__PURE__ */ i("div", { className: "uui-trailing", children: lt.Children.map(
2195
- He,
2196
- (H) => H ? /* @__PURE__ */ i(
2197
- "span",
2198
- {
2199
- className: "uui-slot",
2200
- onClick: (ae) => {
2201
- ae.stopPropagation();
2202
- },
2203
- children: H
2204
- }
2205
- ) : null
2206
- ) }), me = o && /* @__PURE__ */ j(tt, { children: [
2207
- o,
2208
- $ && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
2209
- ] }), Ee = F ?? (W !== "filled" ? 1 : void 0), Re = [
2210
- "uui-field-control",
2211
- Ie(x ?? "bodyLarge"),
2212
- Ue(h ?? "rounded"),
2213
- W !== "outlined" && nt(Ee),
2214
- E && "uui-error",
2215
- ie && "uui-active",
2216
- f && "uui-disabled",
2217
- ve && "uui-has-leading",
2218
- _ && "uui-has-trailing"
2219
- ];
2220
- let se, Se, Ce, Fe;
2221
- const $e = T(), pe = ["uui-fb-label"];
2222
- if (me)
2223
- if (W !== "classic")
2224
- ie || !fe ? ($e.text((E ? "error" : void 0) ?? r ?? "primary"), pe.push(Ie(l ?? "bodySmall")), Re.push("uui-fb-label-up")) : ($e.text((E ? "error" : void 0) ?? "onSurfaceVariant"), pe.push(Ie(x ?? "bodyLarge"))), pe.push("uui-field-float-label"), W === "outlined" ? (Ce = /* @__PURE__ */ i("legend", { className: Ie(l ?? "bodySmall"), children: me }), se = /* @__PURE__ */ i("span", { className: pe.join(" "), children: me })) : (Se = /* @__PURE__ */ i("span", { className: Ie(l ?? "bodySmall"), children: " " }), se = /* @__PURE__ */ i("span", { className: pe.join(" "), children: me }));
2225
- else {
2226
- $e.text((E ? "error" : void 0) ?? "onSurface"), pe.push(Ie(l ?? "bodyMedium"));
2227
- const H = pe.filter(Boolean).join(" ");
2228
- Fe = /* @__PURE__ */ i(
2229
- "label",
2230
- {
2231
- className: H,
2232
- htmlFor: Ve,
2233
- style: $e.get(),
2234
- children: me
2235
- }
2236
- );
2237
- }
2238
- let qe;
2239
- if (W === "outlined") {
2240
- const H = [
2241
- "uui-field-fieldset",
2242
- Ue(h ?? "rounded")
2243
- ].filter(Boolean).join(" "), ae = T(), je = un(0, 4, F, 1);
2244
- ae.set("borderWidth", `${je}px`), ae.border(b ?? "onSurfaceVariant"), qe = /* @__PURE__ */ i("fieldset", { className: H, style: ae.get(), children: Ce });
2245
- }
2246
- const ge = T();
2247
- ge.set("--uui-label-up-x", `${ke}px`), W === "classic" && ge.border(b ?? "outline"), W === "filled" && ge.border(b ?? "onSurfaceVariant");
2248
- const Le = ["uui-field-state"].filter(Boolean).join(" "), Be = T(), Ze = T();
2249
- E ? Ze.text("error") : M ? Ze.text(M) : Ze.text.on("surfaceVariant");
2250
- const le = [
2251
- Ie(A ?? "bodySmall"),
2252
- E && "uui-error uui-support-text",
2253
- S && !E && "uui-description uui-support-text"
2254
- ].filter(Boolean).join(" "), L = (S ?? E) && /* @__PURE__ */ i("div", { className: le, style: Ze.get(), children: E ?? S }), Y = "uui-field-input", Te = T();
2255
- Te.text("onSurface"), !ie && se && fe && Te.set("opacity", 0);
2256
- const G = ["uui-field-input-wrapper"].filter(Boolean).join(" "), Je = ne.filter(Boolean).join(" "), _e = Re.filter(Boolean).join(" ");
2257
- return /* @__PURE__ */ j("div", { className: Je, title: k, children: [
2258
- Fe,
2259
- /* @__PURE__ */ j(
2260
- "div",
2261
- {
2262
- className: _e,
2263
- onPointerDown: oe,
2264
- ref: D,
2265
- style: ge.get(),
2266
- children: [
2267
- ve,
2268
- /* @__PURE__ */ j("div", { className: G, children: [
2269
- Se,
2270
- se,
2271
- /* @__PURE__ */ i(
2272
- "input",
2273
- {
2274
- ...Me,
2275
- ...O ? { value: we } : { defaultValue: K },
2276
- "aria-invalid": !!E,
2277
- autoComplete: "email",
2278
- className: Y,
2279
- disabled: f,
2280
- id: Ve,
2281
- name: q,
2282
- onChange: We,
2283
- placeholder: y,
2284
- ref: ft(n, de),
2285
- style: Te.get(),
2286
- type: C
2287
- }
2288
- )
2289
- ] }),
2290
- _,
2291
- W === "filled" && /* @__PURE__ */ i("div", { className: Le, style: Be.get() }),
2292
- qe
2293
- ]
2294
- }
2295
- ),
2296
- L
2297
- ] });
2298
- }
2299
- );
2300
- at.displayName = "FieldBase";
2301
- const lr = P(
2302
- ({ ...e }, n) => /* @__PURE__ */ i(at, { ref: n, ...e, elementClass: "uui-field" })
2303
- );
2304
- lr.displayName = "Field";
2305
- const on = {
2306
- darkMode: !1,
2307
- schemes: { light: {}, dark: {} }
2308
- }, yn = xt(null);
2309
- function ar(e = "#6750A4", n, t = {}) {
2310
- var c, a, f, x, g, w, F, b, h, $, k, S, M, A, q, E, I;
2311
- const r = { light: {}, dark: {} }, s = (c = t.light) != null && c.primary ? bt(t.light.primary) : bt(e), o = {
2312
- info: "#03a9f4",
2313
- warning: "#ffd600",
2314
- success: "#689f38",
2315
- ...n
2316
- }, u = [];
2317
- Object.keys(o).forEach((y) => {
2318
- var v;
2319
- const C = (v = t.light) == null ? void 0 : v[y];
2320
- C ? u.push({
2321
- value: bt(C),
2322
- name: y,
2323
- blend: !0
2324
- }) : u.push({
2325
- value: bt(
2326
- o[y]
2327
- ),
2328
- name: y,
2329
- blend: !0
2330
- });
2331
- }), ["secondary", "tertiary", "error"].forEach((y) => {
2332
- var v;
2333
- const C = (v = t.light) == null ? void 0 : v[y];
2334
- C && u.push({
2335
- value: bt(C),
2336
- name: y,
2337
- blend: !0
2338
- });
2339
- });
2340
- const l = Fn(s, u);
2341
- ["light", "dark"].forEach((y) => {
2342
- const C = y;
2343
- fn.forEach((v) => {
2344
- var N;
2345
- (N = t[C]) != null && N[v] ? r[C][v] = t[C][v] : typeof l.schemes[C][v] == "number" && (r[C][v] = be(
2346
- l.schemes[C][v]
2347
- ));
2348
- });
2349
- }), r.light.scrim = "#00000052", r.dark.scrim = "#00000052", l.customColors.forEach((y) => {
2350
- const C = y.color.name[0].toUpperCase() + y.color.name.slice(1), v = {
2351
- color: y.color.name,
2352
- onColor: `on${C}`,
2353
- colorContainer: `${y.color.name}Container`,
2354
- onColorContainer: `on${C}Container`
2355
- };
2356
- ["light", "dark"].forEach((N) => {
2357
- const Z = N;
2358
- Object.keys(v).forEach((U) => {
2359
- var X;
2360
- r[N][v[U]] = ((X = t[N]) == null ? void 0 : X[v[U]]) ?? be(y[Z][U]);
2361
- });
2362
- });
2363
- }), ["primary", "secondary", "tertiary", "error"].forEach((y) => {
2364
- const C = y[0].toUpperCase() + y.slice(1);
2365
- ["light", "dark"].forEach((v) => {
2366
- var N, Z, U, X;
2367
- r[v][`${y}Fixed`] = (N = t[v]) != null && N[`${y}Fixed`] ? t[v][`${y}Fixed`] : be(
2368
- l.palettes[y].tone(90)
2369
- ), r[v][`${y}FixedDim`] = (Z = t[v]) != null && Z[`${y}FixedDim`] ? t[v][`${y}FixedDim`] : be(
2370
- l.palettes[y].tone(80)
2371
- ), r[v][`on${C}Fixed`] = (U = t[v]) != null && U[`on${C}Fixed`] ? t[v][`on${C}Fixed`] : be(
2372
- l.palettes[y].tone(10)
2373
- ), r[v][`on${C}FixedVariant`] = (X = t[v]) != null && X[`on${C}FixedVariant`] ? t[v][`on${C}FixedVariant`] : be(
2374
- l.palettes[y].tone(30)
2375
- );
2376
- });
2377
- });
2378
- const m = (y, C) => {
2379
- const v = Ln.fromInt(y);
2380
- return be(v.tone(C));
2381
- };
2382
- l.customColors.forEach((y) => {
2383
- const C = y.color.name, v = C[0].toUpperCase() + C.slice(1);
2384
- ["light", "dark"].forEach((N) => {
2385
- var U, X, we, he;
2386
- const Z = y[N].color;
2387
- r[N][`${C}Fixed`] = (U = t[N]) != null && U[`${C}Fixed`] ? t[N][`${C}Fixed`] : m(Z, 90), r[N][`${C}FixedDim`] = (X = t[N]) != null && X[`${C}FixedDim`] ? t[N][`${C}FixedDim`] : m(Z, 80), r[N][`on${v}Fixed`] = (we = t[N]) != null && we[`on${v}Fixed`] ? t[N][`on${v}Fixed`] : m(Z, 10), r[N][`on${v}FixedVariant`] = (he = t[N]) != null && he[`on${v}FixedVariant`] ? t[N][`on${v}FixedVariant`] : m(Z, 30);
2388
- });
2389
- });
2390
- const p = {
2391
- black: "#000000",
2392
- onBlack: "#ffffff",
2393
- white: "#ffffff",
2394
- onWhite: "#000000"
2395
- };
2396
- return Object.assign(r.light, p), Object.assign(r.dark, p), r.light.surface = ((a = t.light) == null ? void 0 : a.surface) ?? be(l.palettes.neutral.tone(99)), r.light.surfaceDim = ((f = t.light) == null ? void 0 : f.surfaceDim) ?? be(l.palettes.neutral.tone(87)), r.light.surfaceBright = ((x = t.light) == null ? void 0 : x.surfaceBright) ?? be(l.palettes.neutral.tone(99)), r.light.surfaceContainerLowest = ((g = t.light) == null ? void 0 : g.surfaceContainerLowest) ?? be(l.palettes.neutral.tone(100)), r.light.surfaceContainerLow = ((w = t.light) == null ? void 0 : w.surfaceContainerLow) ?? be(l.palettes.neutral.tone(96)), r.light.surfaceContainer = ((F = t.light) == null ? void 0 : F.surfaceContainer) ?? be(l.palettes.neutral.tone(94)), r.light.surfaceContainerHigh = ((b = t.light) == null ? void 0 : b.surfaceContainerHigh) ?? be(l.palettes.neutral.tone(92)), r.light.surfaceContainerHighest = ((h = t.light) == null ? void 0 : h.surfaceContainerHighest) ?? be(l.palettes.neutral.tone(90)), r.dark.surface = (($ = t.dark) == null ? void 0 : $.surface) ?? be(l.palettes.neutral.tone(6)), r.dark.surfaceDim = ((k = t.dark) == null ? void 0 : k.surfaceDim) ?? be(l.palettes.neutral.tone(6)), r.dark.surfaceBright = ((S = t.dark) == null ? void 0 : S.surfaceBright) ?? be(l.palettes.neutral.tone(24)), r.dark.surfaceContainerLowest = ((M = t.dark) == null ? void 0 : M.surfaceContainerLowest) ?? be(l.palettes.neutral.tone(4)), r.dark.surfaceContainerLow = ((A = t.dark) == null ? void 0 : A.surfaceContainerLow) ?? be(l.palettes.neutral.tone(10)), r.dark.surfaceContainer = ((q = t.dark) == null ? void 0 : q.surfaceContainer) ?? be(l.palettes.neutral.tone(12)), r.dark.surfaceContainerHigh = ((E = t.dark) == null ? void 0 : E.surfaceContainerHigh) ?? be(l.palettes.neutral.tone(17)), r.dark.surfaceContainerHighest = ((I = t.dark) == null ? void 0 : I.surfaceContainerHighest) ?? be(l.palettes.neutral.tone(22)), r.light.surfaceTint = be(l.palettes.primary.tone(40)), r.dark.surfaceTint = be(l.palettes.primary.tone(80)), r;
2397
- }
2398
- function ur(e = "#6750A4", n, t = {}) {
2399
- const r = "ufo-ui-theme";
2400
- let s = document.getElementById(r);
2401
- s || (s = document.createElement("style"), s.id = r, document.head.appendChild(s));
2402
- const o = ar(
2403
- e,
2404
- n,
2405
- t
2406
- ), u = [
2407
- ...Object.entries(o.light).map(
2408
- ([m, p]) => `--uui-color-${nn(m)}: ${p};`
2409
- )
2410
- ].join(""), l = Object.entries(o.dark).map(([m, p]) => `--uui-color-${nn(m)}: ${p};`).join("");
2411
- return s.textContent = `:root{${u}}.dark{${l}}`, o;
2412
- }
2413
- const ci = ({
2414
- children: e,
2415
- colorMode: n,
2416
- seedColor: t,
2417
- extraColors: r
2418
- }) => {
2419
- const [s, o] = ee(on), u = yt(
2420
- (c) => {
2421
- c ? document.body.classList.add("dark") : document.body.classList.remove("dark"), o((a) => ({ ...a, darkMode: c }));
2422
- },
2423
- [o]
2424
- ), l = yt(
2425
- (c) => (s.darkMode ? s.schemes.dark : s.schemes.light)[c] ?? "",
2426
- [s]
2427
- ), m = yt(
2428
- (c, a) => s.schemes[c][a] ?? "",
2429
- [s]
2430
- );
2431
- ye(() => {
2432
- if (n) {
2433
- const c = n === "dark";
2434
- document.body.classList.toggle("dark", c), o((a) => ({ ...a, darkMode: c }));
2435
- }
2436
- }, [n]), ye(() => {
2437
- const { schemes: c } = on;
2438
- o((a) => ({
2439
- darkMode: a.darkMode,
2440
- schemes: ur(t, r, c)
2441
- }));
2442
- }, [r, t]);
2443
- const p = an(
2444
- () => ({
2445
- theme: s,
2446
- setTheme: o,
2447
- darkMode: s.darkMode,
2448
- setDarkMode: u,
2449
- getColorValue: l,
2450
- getThemeColorValue: m
2451
- }),
2452
- [l, m, u, s]
2453
- );
2454
- return /* @__PURE__ */ i(yn.Provider, { value: p, children: e });
2455
- }, di = P(
2456
- (e, n) => /* @__PURE__ */ i(
2457
- at,
2458
- {
2459
- ref: n,
2460
- ...e,
2461
- type: "time",
2462
- className: "UITimeInput"
2463
- }
2464
- )
2465
- ), cr = P(
2466
- ({
2467
- children: e,
2468
- className: n = "",
2469
- title: t = "",
2470
- align: r = "topRight",
2471
- value: s,
2472
- ...o
2473
- }, u) => {
2474
- const l = ce(null);
2475
- return /* @__PURE__ */ j("span", { className: "uui-tooltip", ref: u, ...o, children: [
2476
- /* @__PURE__ */ i(
2477
- kt,
2478
- {
2479
- align: r,
2480
- tooltip: /* @__PURE__ */ i("div", { children: t }),
2481
- triggerRef: l
2482
- }
2483
- ),
2484
- /* @__PURE__ */ i("div", { ref: l, children: e })
2485
- ] });
2486
- }
2487
- );
2488
- cr.displayName = "Tooltip";
2489
- const fi = P(
2490
- (e, n) => /* @__PURE__ */ i(
2491
- at,
2492
- {
2493
- ref: n,
2494
- ...e,
2495
- type: "url",
2496
- className: "UIUrlInput"
2497
- }
2498
- )
2499
- ), Ye = P((e, n) => {
2500
- const {
2501
- type: t = "flex",
2502
- inline: r = !1,
2503
- color: s,
2504
- elevation: o,
2505
- shape: u,
2506
- border: l,
2507
- direction: m,
2508
- flow: p,
2509
- borderColor: c,
2510
- elementClass: a,
2511
- children: f,
2512
- className: x,
2513
- style: g,
2514
- fullWidth: w,
2515
- grow: F,
2516
- p: b,
2517
- px: h,
2518
- py: $,
2519
- pt: k,
2520
- pb: S,
2521
- pl: M,
2522
- pr: A,
2523
- gap: q,
2524
- gapX: E,
2525
- gapY: I,
2526
- justifyContent: y,
2527
- alignItems: C,
2528
- placeItems: v,
2529
- alignContent: N,
2530
- wrap: Z,
2531
- cols: U,
2532
- rows: X,
2533
- component: we,
2534
- row: he,
2535
- col: K,
2536
- ...Me
2537
- } = e, De = we ?? "div", V = T(g);
2538
- l && +l > 0 && V.border(mt(c)), V.bg(s), V.text.on(s);
2539
- const O = [];
2540
- t === "flex" ? O.push(r ? "uui-flex-inline" : "uui-flex") : t === "grid" ? O.push(r ? "uui-grid-inline" : "uui-grid") : O.push(r ? "uui-inline-block" : "uui-block"), w && O.push("uui-full"), F && O.push("uui-grow"), b !== void 0 && V.set("padding", b), h !== void 0 && (V.set("paddingLeft", h), V.set("paddingRight", h)), $ !== void 0 && (V.set("paddingTop", $), V.set("paddingBottom", $)), k !== void 0 && V.set("paddingTop", k), S !== void 0 && V.set("paddingBottom", S), M !== void 0 && V.set("paddingLeft", M), A !== void 0 && V.set("paddingRight", A), q !== void 0 && V.set("gap", q), E !== void 0 && V.set("columnGap", E), I !== void 0 && V.set("rowGap", I), y !== void 0 && V.set("justifyContent", y), C !== void 0 && V.set("alignItems", C), v !== void 0 && V.set("placeItems", v), N !== void 0 && V.set("alignContent", N), Z && V.set("flexWrap", "wrap"), t === "grid" && (U !== void 0 && V.set(
2541
- "gridTemplateColumns",
2542
- typeof U == "number" ? `repeat(${U}, 1fr)` : U
2543
- ), X !== void 0 && V.set(
2544
- "gridTemplateRows",
2545
- typeof X == "number" ? `repeat(${X}, 1fr)` : X
2546
- ));
2547
- const Q = (he ? "row" : void 0) ?? (K ? "col" : void 0) ?? m;
2548
- let fe = "";
2549
- Q && t === "flex" && (fe = Q === "col" ? "uui-flex-col" : "uui-flex-row");
2550
- let de = "";
2551
- p && t === "grid" && (de = p === "col" ? "uui-grid-flow-col" : "uui-grid-flow-row");
2552
- const D = [
2553
- "uui-box",
2554
- a,
2555
- ...O,
2556
- ...u ? [Ue(u)] : [],
2557
- ...o !== void 0 ? [ut(o)] : [],
2558
- ...l !== void 0 ? [nt(l)] : [],
2559
- fe,
2560
- de,
2561
- x
2562
- ].filter(Boolean).join(" ");
2563
- return /* @__PURE__ */ i(De, { className: D, ref: n, ...Me, style: V.get(), children: f });
2564
- });
2565
- Ye.displayName = "BoxBase";
2566
- const dr = P(
2567
- ({ direction: e = "row", ...n }, t) => /* @__PURE__ */ i(
2568
- Ye,
2569
- {
2570
- ref: t,
2571
- ...n,
2572
- component: "header",
2573
- direction: e,
2574
- elementClass: "uui-header"
2575
- }
2576
- )
2577
- );
2578
- dr.displayName = "Header";
2579
- const fr = P(
2580
- ({ direction: e = "row", ...n }, t) => /* @__PURE__ */ i(
2581
- Ye,
2582
- {
2583
- ref: t,
2584
- ...n,
2585
- component: "footer",
2586
- direction: e,
2587
- elementClass: "uui-footer"
2588
- }
2589
- )
2590
- );
2591
- fr.displayName = "Footer";
2592
- const mr = P(
2593
- ({ direction: e = "col", ...n }, t) => /* @__PURE__ */ i(
2594
- Ye,
2595
- {
2596
- ref: t,
2597
- ...n,
2598
- component: "main",
2599
- direction: e,
2600
- elementClass: "uui-main"
2601
- }
2602
- )
2603
- );
2604
- mr.displayName = "Main";
2605
- const pr = P(
2606
- ({ direction: e = "col", ...n }, t) => /* @__PURE__ */ i(
2607
- Ye,
2608
- {
2609
- ref: t,
2610
- ...n,
2611
- component: "article",
2612
- direction: e,
2613
- elementClass: "uui-article"
2614
- }
2615
- )
2616
- );
2617
- pr.displayName = "Article";
2618
- const gr = P(
2619
- ({ direction: e = "col", ...n }, t) => /* @__PURE__ */ i(
2620
- Ye,
2621
- {
2622
- ref: t,
2623
- ...n,
2624
- direction: e,
2625
- elementClass: "uui-article-content"
2626
- }
2627
- )
2628
- );
2629
- gr.displayName = "Content";
2630
- const hr = P(
2631
- ({ direction: e = "col", ...n }, t) => /* @__PURE__ */ i(
2632
- Ye,
2633
- {
2634
- ref: t,
2635
- ...n,
2636
- component: "section",
2637
- direction: e,
2638
- elementClass: "uui-section"
2639
- }
2640
- )
2641
- );
2642
- hr.displayName = "Section";
2643
- const Cr = P(
2644
- ({ direction: e = "col", ...n }, t) => /* @__PURE__ */ i(
2645
- Ye,
2646
- {
2647
- ref: t,
2648
- ...n,
2649
- component: "aside",
2650
- direction: e,
2651
- elementClass: "uui-aside"
2652
- }
2653
- )
2654
- );
2655
- Cr.displayName = "Aside";
2656
- const br = P(
2657
- ({ direction: e = "row", ...n }, t) => /* @__PURE__ */ i(
2658
- Ye,
2659
- {
2660
- ref: t,
2661
- ...n,
2662
- component: "nav",
2663
- direction: e,
2664
- elementClass: "uui-nav"
2665
- }
2666
- )
2667
- );
2668
- br.displayName = "Nav";
2669
- const yr = P(
2670
- ({ direction: e = "row", ...n }, t) => /* @__PURE__ */ i(Ye, { ...n, direction: e, ref: t, type: "flex" })
2671
- );
2672
- yr.displayName = "Flex";
2673
- const vr = P((e, n) => /* @__PURE__ */ i(Ye, { ...e, ref: n, type: "grid" }));
2674
- vr.displayName = "Grid";
2675
- const xr = P((e, n) => /* @__PURE__ */ i(Ye, { ...e, ref: n, type: "block" }));
2676
- xr.displayName = "Div";
2677
- function wr(e, n) {
2678
- ye(() => {
2679
- if (!e)
2680
- return;
2681
- const t = (r) => {
2682
- r.key === "Escape" && n();
2683
- };
2684
- return document.addEventListener("keydown", t), () => {
2685
- document.removeEventListener("keydown", t);
2686
- };
2687
- }, [e, n]);
2688
- }
2689
- const Sr = {
2690
- basic: "scale",
2691
- fullscreen: "fade",
2692
- dockBottom: "slideUp",
2693
- dockTop: "slideDown",
2694
- dockRight: "slideRight",
2695
- dockLeft: "slideLeft"
2696
- }, $r = (e, n) => e === "auto" ? Sr[n] : e, sn = typeof document < "u" ? document.getElementById("dialog-root") ?? document.body : null, kr = ({
2697
- open: e,
2698
- onClose: n,
2699
- type: t = "basic",
2700
- color: r = "surfaceContainerHigh",
2701
- elevation: s = 3,
2702
- shape: o = "rounded",
2703
- border: u = 0,
2704
- borderColor: l,
2705
- size: m = "small",
2706
- animation: p = "auto",
2707
- duration: c = 250,
2708
- disableBackdropClose: a,
2709
- disableEscapeKey: f,
2710
- children: x,
2711
- className: g,
2712
- motionStyle: w = "regular",
2713
- modal: F = !1
2714
- }) => {
2715
- const b = ce(null), [h, $] = ee(!1), [k, S] = ee(!1), [M, A] = ee(), [q, E] = ee(!1), [I, y] = ee("normal"), C = ce(null), v = () => b.current ? Array.from(
2716
- b.current.querySelectorAll(
2717
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
2718
- )
2719
- ).filter(
2720
- (D) => !D.hasAttribute("disabled") && D.getAttribute("aria-hidden") !== "true"
2721
- ) : [];
2722
- ye(() => {
2723
- if (e)
2724
- $(!0), y("normal"), E(!0), A(!0);
2725
- else {
2726
- y("reverse"), E(!1), A(!1);
2727
- const D = setTimeout(() => {
2728
- $(!1);
2729
- }, c);
2730
- return () => {
2731
- clearTimeout(D);
2732
- };
2733
- }
2734
- }, [e, c]), ye(() => {
2735
- I === "reverse" && E(!0);
2736
- }, [I]), ye(() => {
2737
- M === !0 ? S(!0) : M === !1 && S(!1);
2738
- }, [M]), wr(!f && h, () => n == null ? void 0 : n());
2739
- const N = (D) => {
2740
- a || D.target === D.currentTarget && (n == null || n());
2741
- };
2742
- if (ye(() => {
2743
- if (h) {
2744
- const D = document.body.style.overflow;
2745
- return document.body.style.overflow = "hidden", () => {
2746
- document.body.style.overflow = D;
2747
- };
2748
- }
2749
- }, [h]), ye(() => {
2750
- if (!h || !F)
2751
- return;
2752
- const D = v();
2753
- C.current = document.activeElement;
2754
- const Ve = D.length > 0 ? D[0] : b.current;
2755
- Ve && Ve.focus();
2756
- const ke = (z) => {
2757
- if (z.key !== "Tab")
2758
- return;
2759
- const te = v();
2760
- if (te.length === 0) {
2761
- z.preventDefault();
2762
- return;
2763
- }
2764
- const W = te[0], ie = te[te.length - 1];
2765
- z.shiftKey && document.activeElement === W && (z.preventDefault(), ie.focus()), !z.shiftKey && document.activeElement === ie && (z.preventDefault(), W.focus());
2766
- };
2767
- return document.addEventListener("keydown", ke), () => {
2768
- var z;
2769
- document.removeEventListener("keydown", ke), (z = C.current) == null || z.focus();
2770
- };
2771
- }, [F, h]), !h || !sn)
2772
- return null;
2773
- const Z = Ue(o), U = nt(u), X = Ht(mt(l)), we = ut(s), { bgColor: he, textOnColor: K } = Vt(r), Me = $r(p, t), De = Me === "none" ? "" : Mt[Me], V = w === "expressive" ? "uui-motion-expressive" : "", O = {
2774
- "--uui-duration": String(c * 0.65) + "ms"
2775
- }, Q = {
2776
- "--uui-reverse": I,
2777
- "--uui-duration": I === "reverse" ? String(c * 0.67) + "ms" : String(c) + "ms"
2778
- }, fe = ["uui-dialog-backdrop", k && "uui-open"].filter(Boolean).join(" "), de = [
2779
- "uui-db",
2780
- `uui-dialog-${t}`,
2781
- Z,
2782
- U,
2783
- wt(m),
2784
- X,
2785
- we,
2786
- he,
2787
- K,
2788
- q && De,
2789
- V,
2790
- g
2791
- ].filter(Boolean).join(" ");
2792
- return Wt(
2793
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
2794
- /* @__PURE__ */ i(
2795
- "div",
2796
- {
2797
- className: fe,
2798
- onClick: N,
2799
- style: O,
2800
- children: /* @__PURE__ */ i("div", { className: de, ref: b, style: Q, children: x })
2801
- }
2802
- ),
2803
- sn
2804
- );
2805
- };
2806
- kr.displayName = "Dialog";
2807
- const Fr = ({
2808
- icon: e,
2809
- label: n,
2810
- children: t,
2811
- className: r,
2812
- font: s = "headlineSmall"
2813
- }) => {
2814
- const o = n ?? t ?? null, u = ["uui-dialog-title", r];
2815
- u.push(Ie(s));
2816
- const l = u.filter(Boolean).join(" ");
2817
- return o ? /* @__PURE__ */ j("div", { className: l, children: [
2818
- e && /* @__PURE__ */ i("div", { className: "uui-icon", children: e }),
2819
- o && /* @__PURE__ */ i("div", { className: "uui-content", children: o })
2820
- ] }) : null;
2821
- };
2822
- Fr.displayName = "DialogTitle";
2823
- const Lr = ({ children: e, className: n }) => {
2824
- const t = ["uui-dialog-content", n].filter(Boolean).join(" ");
2825
- return e ? /* @__PURE__ */ i("div", { className: t, children: /* @__PURE__ */ i("div", { className: "uui-content", children: e }) }) : null;
2826
- };
2827
- Lr.displayName = "DialogContent";
2828
- const Br = ({
2829
- children: e,
2830
- className: n,
2831
- color: t,
2832
- borderTop: r = !1,
2833
- borderTopWidth: s = 1,
2834
- borderColor: o
2835
- }) => {
2836
- if (!e)
2837
- return null;
2838
- const u = t ? Vt(t) : null, l = r ? nt(s) : "", m = r && t ? Ht(mt(o)) : "", p = [
2839
- "uui-dialog-actions",
2840
- u == null ? void 0 : u.bgColor,
2841
- u == null ? void 0 : u.textOnColor,
2842
- r ? "uui-dialog-actions-border-top" : "",
2843
- l,
2844
- m,
2845
- n
2846
- ].filter(Boolean).join(" ");
2847
- return /* @__PURE__ */ i("div", { className: p, children: e });
2848
- };
2849
- Br.displayName = "DialogActions";
2850
- const vn = P(
2851
- ({
2852
- description: e,
2853
- error: n,
2854
- font: t,
2855
- label: r,
2856
- disabled: s,
2857
- legend: o,
2858
- children: u,
2859
- direction: l = "col",
2860
- required: m,
2861
- descriptionColor: p,
2862
- descriptionFont: c,
2863
- alignItems: a = "start",
2864
- ...f
2865
- }, x) => {
2866
- const g = o ?? r, w = [
2867
- "uui-fieldset-legend",
2868
- tn(t ?? "labelLarge")
2869
- ].filter(Boolean).join(" "), F = T();
2870
- n ? F.text("error") : p ? F.text(p) : F.text.on("surfaceVariant");
2871
- const b = [
2872
- "uui-support-text",
2873
- tn(c ?? "bodySmall"),
2874
- n && "uui-error",
2875
- e && !n && "uui-description"
2876
- ].filter(Boolean).join(" "), h = (e ?? n) && /* @__PURE__ */ i("div", { className: b, style: F.get(), children: n ?? e });
2877
- return /* @__PURE__ */ j(tt, { children: [
2878
- /* @__PURE__ */ i(Zt.Provider, { value: { disabled: s }, children: /* @__PURE__ */ j(
2879
- Ye,
2880
- {
2881
- ref: x,
2882
- ...f,
2883
- alignItems: a,
2884
- component: "fieldset",
2885
- direction: l,
2886
- disabled: s,
2887
- elementClass: "uui-fieldset",
2888
- children: [
2889
- g && /* @__PURE__ */ j("legend", { className: w, children: [
2890
- g,
2891
- m && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
2892
- ] }),
2893
- u
2894
- ]
2895
- }
2896
- ) }),
2897
- h
2898
- ] });
2899
- }
2900
- );
2901
- vn.displayName = "Fieldset";
2902
- const Nr = P(
2903
- ({
2904
- name: e,
2905
- disabled: n,
2906
- onChange: t,
2907
- value: r,
2908
- defaultValue: s,
2909
- children: o,
2910
- ...u
2911
- }, l) => {
2912
- const [m, p] = ee(s), c = r !== void 0, a = c ? r : m, f = yt(
2913
- (g) => {
2914
- c || p(g), t == null || t(g);
2915
- },
2916
- [c, t]
2917
- ), x = an(
2918
- () => ({ name: e, value: a, setValue: f, disabled: n }),
2919
- [e, a, f, n]
2920
- );
2921
- return /* @__PURE__ */ i(vn, { disabled: n, ref: l, ...u, children: /* @__PURE__ */ i(jr.Provider, { value: x, children: o }) });
2922
- }
2923
- );
2924
- Nr.displayName = "RadioGroup";
2925
- const Ir = Symbol.for("uui.listItem"), Er = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("path", { d: "M10 17V7L15 12L10 17Z", fill: "currentColor" }) }), Tr = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
2926
- "path",
2927
- {
2928
- d: "M9.5501 18L3.8501 12.3L5.2751 10.875L9.5501 15.15L18.7251 5.97498L20.1501 7.39998L9.5501 18Z",
2929
- fill: "currentColor"
2930
- }
2931
- ) }), Mr = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
2932
- "path",
2933
- {
2934
- d: "M12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z",
2935
- fill: "currentColor"
2936
- }
2937
- ) }), Vr = /* @__PURE__ */ i("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i(
2938
- "path",
2939
- {
2940
- d: "M12 17C13.3833 17 14.5625 16.5125 15.5375 15.5375C16.5125 14.5625 17 13.3833 17 12C17 10.6167 16.5125 9.4375 15.5375 8.4625C14.5625 7.4875 13.3833 7 12 7C10.6167 7 9.4375 7.4875 8.4625 8.4625C7.4875 9.4375 7 10.6167 7 12C7 13.3833 7.4875 14.5625 8.4625 15.5375C9.4375 16.5125 10.6167 17 12 17ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z",
2941
- fill: "currentColor"
2942
- }
2943
- ) }), Xt = P(
2944
- ({
2945
- shape: e,
2946
- touchEffects: n = ["ripple"],
2947
- focusEffects: t = ["ring", "overlay"],
2948
- selectedEffects: r = ["color"],
2949
- checkedIcon: s,
2950
- uncheckedIcon: o,
2951
- selectedColor: u,
2952
- textColor: l,
2953
- labelColor: m,
2954
- descriptionColor: p,
2955
- shortcutColor: c,
2956
- fixedLeading: a,
2957
- color: f,
2958
- icon: x,
2959
- endIcon: g,
2960
- leading: w,
2961
- trailing: F,
2962
- label: b,
2963
- disabled: h = !1,
2964
- className: $,
2965
- onClick: k,
2966
- badge: S,
2967
- expanded: M,
2968
- active: A,
2969
- children: q,
2970
- focusVisible: E,
2971
- type: I = "item",
2972
- checked: y,
2973
- description: C,
2974
- shortcut: v,
2975
- density: N,
2976
- horizontal: Z,
2977
- labelFont: U,
2978
- font: X,
2979
- descriptionFont: we,
2980
- shortcutFont: he,
2981
- selected: K,
2982
- __index: Me,
2983
- __interactionsDisabled: De,
2984
- onChange: V,
2985
- variant: O = "classic",
2986
- ...Q
2987
- }, fe) => {
2988
- const de = ce(null), D = lt.Children.toArray(q), Ve = D.find((G) => ht(G)), ke = D.filter((G) => !ht(G)), z = !!Ve;
2989
- let te;
2990
- I !== "item" && (I === "radio" ? te = y ? s ?? Vr : o ?? Mr : I === "checkbox" && (te = y ? s ?? Tr : o));
2991
- const W = te ?? w ?? x ?? (a && !Z), ie = W && /* @__PURE__ */ i("div", { className: "uui-icon uui-leading", children: W }), We = F ?? g;
2992
- let oe;
2993
- S && (typeof S == "string" || typeof S == "number" ? oe = /* @__PURE__ */ i(qt, { value: S }) : oe = S);
2994
- const ne = O === "modern" ? "labelLarge" : "bodyLarge", ve = U ?? X ?? ne, He = we ?? (O === "modern" ? "bodySmall" : "bodyMedium"), _ = he ?? ne, me = T();
2995
- me.text(c);
2996
- const Ee = z && !Z ? Er : We, Re = v && /* @__PURE__ */ i(
2997
- "div",
2998
- {
2999
- className: `uui-menu-item-shortcut ${Ie(_)}`,
3000
- style: me.get(),
3001
- children: v
3002
- }
3003
- ), se = (v ?? S ?? Ee) && /* @__PURE__ */ j(tt, { children: [
3004
- Re,
3005
- oe,
3006
- Ee && /* @__PURE__ */ i("div", { className: "uui-icon uui-trailing", children: Ee })
3007
- ] }), Se = T();
3008
- Se.text(m);
3009
- const Ce = b && /* @__PURE__ */ i(
3010
- "div",
3011
- {
3012
- className: `uui-menu-item-label ${Ie(ve)}`,
3013
- style: Se.get(),
3014
- children: b
3015
- }
3016
- ), Fe = T();
3017
- (p || !l && O === "classic" && (f != null && f.startsWith("surface"))) && (p ? Fe.text(p) : Fe.text.on("surfaceVariant"));
3018
- const $e = C && /* @__PURE__ */ i(
3019
- "div",
3020
- {
3021
- className: `uui-menu-item-description ${Ie(He)}`,
3022
- style: Fe.get(),
3023
- children: C
3024
- }
3025
- ), pe = (Ce ?? $e) && /* @__PURE__ */ j("div", { className: "uui-menu-item-text", children: [
3026
- Ce,
3027
- $e
3028
- ] }), qe = (G) => {
3029
- if (De || h) {
3030
- G == null || G.preventDefault();
3031
- return;
3032
- }
3033
- k == null || k(G), n.includes("ripple") && de.current && G && St(de.current, G);
3034
- };
3035
- let ge = f ?? (O === "modern" ? "surfaceContainerLow" : "surfaceContainer");
3036
- I === "option" && K && r.includes("color") && (ge = u ?? (O === "modern" ? "tertiaryContainer" : "secondaryContainer"));
3037
- const Le = T();
3038
- Le.bg.on(ge);
3039
- const Be = T();
3040
- Be.bg(ge), l ? Be.text(l) : Be.text.on(ge);
3041
- const Ze = [
3042
- "uui-menu-item",
3043
- $,
3044
- dt(N),
3045
- h && "uui-disabled",
3046
- O === "modern" ? "uui-menu-item-modern" : "uui-menu-item-classic"
3047
- ].filter(Boolean).join(" "), le = Ue(
3048
- e ?? (O === "modern" ? "rounded" : "smooth")
3049
- ), L = [
3050
- "uui-menu-item-content",
3051
- le,
3052
- ...t.includes("ring") && A ? ["uui-focus-ring-in"] : [],
3053
- ...t.includes("overlay") && A ? ["uui-focus-overlay"] : [],
3054
- A && "uui-active",
3055
- A && E && "uui-focus-visible"
3056
- ].filter(Boolean).join(" "), Y = /* @__PURE__ */ j("div", { className: L, style: Be.get(), children: [
3057
- ke.length > 0 ? /* @__PURE__ */ i("div", { className: "uui-menu-item-children", children: ke }) : /* @__PURE__ */ j(tt, { children: [
3058
- ie,
3059
- pe,
3060
- se
3061
- ] }),
3062
- /* @__PURE__ */ i(
3063
- "div",
3064
- {
3065
- className: ["uui-state", le].join(" "),
3066
- style: Le.get()
3067
- }
3068
- )
3069
- ] });
3070
- return (
3071
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
3072
- /* @__PURE__ */ i(
3073
- "div",
3074
- {
3075
- ...Q,
3076
- "aria-checked": I === "radio" || I === "checkbox" ? y ?? !1 : void 0,
3077
- "aria-disabled": h ? "true" : void 0,
3078
- "aria-expanded": z ? M : void 0,
3079
- "aria-haspopup": z ? "menu" : void 0,
3080
- className: Ze,
3081
- onClick: qe,
3082
- ref: ft(de, fe),
3083
- role: "option",
3084
- tabIndex: -1,
3085
- children: Y
3086
- }
3087
- )
3088
- );
3089
- }
3090
- );
3091
- Xt[Ir] = !0;
3092
- Xt[Gt] = !0;
3093
- Xt.displayName = "ListItem";
3094
- const Dr = P(
3095
- (e, n) => {
3096
- const {
3097
- density: t,
3098
- icon: r,
3099
- disabled: s,
3100
- elevation: o,
3101
- checked: u,
3102
- children: l,
3103
- color: m = "primary",
3104
- uncheckedColor: p,
3105
- defaultChecked: c,
3106
- hoverEffects: a = ["overlay"],
3107
- touchEffects: f = ["ripple"],
3108
- focusEffects: x = ["ring"],
3109
- selectedEffects: g = [],
3110
- pressedEffects: w = ["overlay", "scale"],
3111
- id: F,
3112
- name: b,
3113
- label: h,
3114
- font: $,
3115
- border: k,
3116
- borderColor: S,
3117
- uncheckedBorder: M,
3118
- uncheckedBorderColor: A,
3119
- onChange: q,
3120
- onClick: E,
3121
- required: I,
3122
- shape: y = "round",
3123
- title: C,
3124
- value: v,
3125
- size: N = "small",
3126
- uncheckedIcon: Z,
3127
- description: U,
3128
- descriptionColor: X,
3129
- descriptionFont: we,
3130
- className: he,
3131
- error: K,
3132
- focusColor: Me,
3133
- labelColor: De,
3134
- textColor: V,
3135
- duration: O = 200,
3136
- tooltipAlign: Q = "auto",
3137
- textPlacement: fe = "end",
3138
- "aria-label": de,
3139
- readOnly: D,
3140
- ...Ve
3141
- } = e, ke = ce(null), z = It(Zt), te = s ?? (z == null ? void 0 : z.disabled), W = Dt(), [ie, We] = ee(!1), oe = ce(null), ne = ce(null), ve = ce(null), He = ce($t("check")), _ = F ?? He.current, me = u !== void 0, [Ee, Re] = ee(
3142
- c ?? !1
3143
- ), se = me ? !!u : Ee, Se = de ?? (h ? void 0 : C), Ce = K ? "error" : m, Fe = C ? /* @__PURE__ */ i("div", { id: `${_}-tip`, children: C }) : null, $e = (ue) => {
3144
- if (D) {
3145
- ue.preventDefault();
3146
- return;
3147
- }
3148
- const ze = ue.currentTarget;
3149
- me || Re(ze.checked), q == null || q(ue);
3150
- }, pe = (ue) => {
3151
- if (D) {
3152
- ue.preventDefault();
3153
- return;
3154
- }
3155
- f.includes("ripple") && (ke.current && clearTimeout(ke.current), ke.current = window.setTimeout(() => {
3156
- ve.current && ne.current && (St(ve.current, ue, ne.current), ke.current = null);
3157
- }, O)), E == null || E(ue);
3158
- }, qe = (ue) => {
3159
- var ze;
3160
- We(!0), (ze = e.onFocus) == null || ze.call(e, ue);
3161
- }, ge = (ue) => {
3162
- var ze;
3163
- We(!1), (ze = e.onBlur) == null || ze.call(e, ue);
3164
- }, Le = T(), Be = [
3165
- "uui-switch",
3166
- dt(t),
3167
- he,
3168
- te && "uui-disabled",
3169
- ...l ? [] : [wt(N)]
3170
- ].filter(Boolean).join(" "), Ze = [
3171
- "uui-switch-control",
3172
- se && "uui-checked",
3173
- Z && "uui-symmetric-thumb",
3174
- ...a.includes("overlay") && !D ? ["uui-hover-overlay"] : [],
3175
- ...x.includes("overlay") && W && ie ? ["uui-focus-overlay"] : [],
3176
- ...g.includes("overlay") ? ["uui-selected-overlay"] : [],
3177
- ...w.includes("overlay") && !D ? ["uui-pressed-overlay"] : [],
3178
- ...w.includes("scale") && !D ? ["uui-pressed-scale"] : [],
3179
- Ue(y),
3180
- x.includes("ring") && W && ie && "uui-focus-visible uui-focus-ring"
3181
- ].filter(Boolean).join(" "), le = T();
3182
- Me && W && ie && le.set(
3183
- "--uui-focus-color",
3184
- mn(Me).color
3185
- ), le.set("--uui-switch-duration", `${O}ms`);
3186
- const L = ["uui-input"].filter(Boolean).join(" "), Y = ["uui-state", Ue("round")].filter(Boolean).join(" "), Te = T(), Je = [
3187
- "uui-switch-track",
3188
- nt(se ? k : M ?? k ?? 2),
3189
- Ue(y),
3190
- ut(o)
3191
- ].filter(Boolean).join(" "), _e = T(), H = ["uui-switch-thumb", Ue(y)].filter(Boolean).join(" "), ae = ["uui-icon"].filter(Boolean).join(" "), je = T(), Ae = ["uui-switch-glyph"].filter(Boolean).join(" "), Oe = T(), J = T();
3192
- _e.border(K ? "error" : S ?? "outline"), J.border(K ? "error" : S ?? "outline"), se ? (Te.bg(Ce), _e.bg(K ? "errorContainer" : m), Oe.bg.on(m), je.text.onContainer(m)) : (A && (_e.border(K ? "error" : A), J.border(K ? "error" : A)), Te.bg(K ? "error" : p ?? "onSurface"), _e.bg(
3193
- K ? "errorContainer" : p ?? "surfaceContainerHighest"
3194
- ), p ? (Oe.bg.on(p), je.text.onContainer(p)) : (Oe.bg(Z ? "onSurfaceVariant" : "outline"), je.text("surfaceContainerHighest")));
3195
- let Xe;
3196
- if (l) {
3197
- const ue = [
3198
- "uui-switch-content uui-overflow-hidden",
3199
- Ue(y),
3200
- nt(k),
3201
- ut(o)
3202
- ].filter(Boolean).join(" ");
3203
- Xe = /* @__PURE__ */ j("div", { className: ue, style: J.get(), children: [
3204
- l,
3205
- /* @__PURE__ */ i(
3206
- "div",
3207
- {
3208
- className: Y,
3209
- ref: ve,
3210
- style: Te.get()
3211
- }
3212
- )
3213
- ] });
3214
- } else {
3215
- const ue = se ? r : Z;
3216
- Xe = /* @__PURE__ */ j(tt, { children: [
3217
- /* @__PURE__ */ i("div", { className: Je, style: _e.get() }),
3218
- /* @__PURE__ */ j("div", { className: H, children: [
3219
- /* @__PURE__ */ i("div", { className: Ae, style: Oe.get(), children: /* @__PURE__ */ i("div", { className: ae, style: je.get(), children: ue }) }),
3220
- /* @__PURE__ */ i(
3221
- "div",
3222
- {
3223
- className: Y,
3224
- ref: ve,
3225
- style: Te.get()
3226
- }
3227
- )
3228
- ] })
3229
- ] });
3230
- }
3231
- const Ne = T();
3232
- Ne.text(
3233
- (K ? "error" : void 0) ?? De ?? V ?? "onSurface"
3234
- );
3235
- const re = [
3236
- Ie($ ?? "bodyMedium"),
3237
- "uui-switch-label"
3238
- ].join(" "), Qe = h && /* @__PURE__ */ j("label", { className: re, htmlFor: _, style: Ne.get(), children: [
3239
- h,
3240
- I && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
3241
- ] }), Ge = T();
3242
- K ? Ge.text("error") : X ? Ge.text(X) : Ge.text.on("surfaceVariant");
3243
- const ot = [
3244
- Ie(we ?? "bodySmall"),
3245
- K && "uui-error uui-support-text",
3246
- U && !K && "uui-description uui-support-text"
3247
- ].filter(Boolean).join(" "), et = (U ?? K) && /* @__PURE__ */ i("div", { className: ot, style: Ge.get(), children: K ?? U }), pt = (Qe ?? et) && /* @__PURE__ */ j(tt, { children: [
3248
- Qe,
3249
- et
3250
- ] }), Ke = T();
3251
- return fe === "end" ? (Ne.set("gridColumn", 2), Ge.set("gridColumn", 2), Ke.set("gridColumn", 1)) : fe === "start" ? (Ne.set("gridColumn", 1), Ge.set("gridColumn", 1), Ke.set("gridColumn", 2), Ke.set("gridRow", 1)) : (Le.set("gridTemplateColumns", "1fr"), Le.set("justifyItems", "start")), fe === "top" && (Ke.set("order", 1), Ge.set("order", 2)), /* @__PURE__ */ j("div", { className: Be, style: Le.get(), children: [
3252
- /* @__PURE__ */ i(
3253
- "div",
3254
- {
3255
- className: "uui-switch-control-wrapper",
3256
- style: Ke.get(),
3257
- children: /* @__PURE__ */ j(
3258
- "div",
3259
- {
3260
- className: Ze,
3261
- ref: ne,
3262
- style: le.get(),
3263
- children: [
3264
- /* @__PURE__ */ i(
3265
- "input",
3266
- {
3267
- "aria-label": Se,
3268
- "aria-readonly": D === !0 ? !0 : void 0,
3269
- checked: !!se,
3270
- className: L,
3271
- disabled: te,
3272
- id: _,
3273
- name: b,
3274
- onBlur: ge,
3275
- onChange: $e,
3276
- onClick: pe,
3277
- onFocus: qe,
3278
- readOnly: D,
3279
- ref: ft(oe, n),
3280
- type: "checkbox",
3281
- value: v,
3282
- ...Ve
3283
- }
3284
- ),
3285
- Xe
3286
- ]
3287
- }
3288
- )
3289
- }
3290
- ),
3291
- pt,
3292
- Fe && /* @__PURE__ */ i(
3293
- kt,
3294
- {
3295
- align: Q,
3296
- tooltip: Fe,
3297
- triggerRef: oe
3298
- }
3299
- )
3300
- ] });
3301
- }
3302
- );
3303
- Dr.displayName = "Switch";
3304
- function Rr({
3305
- variant: e = "circular",
3306
- inline: n,
3307
- className: t
3308
- }) {
3309
- const r = [
3310
- "uui-spinner",
3311
- `uui-spinner-${e}`,
3312
- n && "uui-spinner-inline",
3313
- t
3314
- ].filter(Boolean).join(" ");
3315
- return e === "circular" ? /* @__PURE__ */ i("svg", { "aria-hidden": "true", className: r, viewBox: "22 22 44 44", children: /* @__PURE__ */ i(
3316
- "circle",
3317
- {
3318
- className: "uui-spinner-circle",
3319
- cx: "44",
3320
- cy: "44",
3321
- fill: "none",
3322
- r: "19.8",
3323
- strokeWidth: "4.6"
3324
- }
3325
- ) }) : e === "bars2" ? /* @__PURE__ */ j(
3326
- "svg",
3327
- {
3328
- className: "uui-bars-spinner",
3329
- viewBox: "0 0 48 48",
3330
- xmlns: "http://www.w3.org/2000/svg",
3331
- children: [
3332
- /* @__PURE__ */ i("rect", { height: "12", rx: "2", width: "4", x: "22" }),
3333
- /* @__PURE__ */ i(
3334
- "rect",
3335
- {
3336
- height: "12",
3337
- rx: "2",
3338
- transform: "rotate(-135 33.9 16.9)",
3339
- width: "4",
3340
- x: "33.9",
3341
- y: "16.9"
3342
- }
3343
- ),
3344
- /* @__PURE__ */ i(
3345
- "rect",
3346
- {
3347
- height: "12",
3348
- rx: "2",
3349
- transform: "rotate(-90 36 26)",
3350
- width: "4",
3351
- x: "36",
3352
- y: "26"
3353
- }
3354
- ),
3355
- /* @__PURE__ */ i(
3356
- "rect",
3357
- {
3358
- height: "12",
3359
- rx: "2",
3360
- transform: "rotate(-45 31.1 33.9)",
3361
- width: "4",
3362
- x: "31.1",
3363
- y: "33.9"
3364
- }
3365
- ),
3366
- /* @__PURE__ */ i("rect", { height: "12", rx: "2", width: "4", x: "22", y: "36" }),
3367
- /* @__PURE__ */ i(
3368
- "rect",
3369
- {
3370
- height: "12",
3371
- rx: "2",
3372
- transform: "rotate(-135 8.4 42.4)",
3373
- width: "4",
3374
- x: "8.4",
3375
- y: "42.4"
3376
- }
3377
- ),
3378
- /* @__PURE__ */ i(
3379
- "rect",
3380
- {
3381
- height: "12",
3382
- rx: "2",
3383
- transform: "rotate(-90 0 26)",
3384
- width: "4",
3385
- y: "26"
3386
- }
3387
- ),
3388
- /* @__PURE__ */ i(
3389
- "rect",
3390
- {
3391
- height: "12",
3392
- rx: "2",
3393
- transform: "rotate(-45 5.6 8.4)",
3394
- width: "4",
3395
- x: "5.6",
3396
- y: "8.4"
3397
- }
3398
- )
3399
- ]
3400
- }
3401
- ) : e === "orbit" ? /* @__PURE__ */ j(
3402
- "svg",
3403
- {
3404
- className: "uui-orbit-spinner",
3405
- viewBox: "0 0 48 48",
3406
- xmlns: "http://www.w3.org/2000/svg",
3407
- children: [
3408
- /* @__PURE__ */ i("circle", { cx: "24", cy: "4", r: "4" }),
3409
- /* @__PURE__ */ i("circle", { cx: "38.1421", cy: "9.8579", r: "4" }),
3410
- /* @__PURE__ */ i("circle", { cx: "44", cy: "24", r: "4" }),
3411
- /* @__PURE__ */ i("circle", { cx: "38.1421", cy: "38.1421", r: "4" }),
3412
- /* @__PURE__ */ i("circle", { cx: "24", cy: "44", r: "4" }),
3413
- /* @__PURE__ */ i("circle", { cx: "9.8579", cy: "38.1421", r: "4" }),
3414
- /* @__PURE__ */ i("circle", { cx: "4", cy: "24", r: "4" }),
3415
- /* @__PURE__ */ i("circle", { cx: "9.8579", cy: "9.8579", r: "4" })
3416
- ]
3417
- }
3418
- ) : e === "arc" ? /* @__PURE__ */ j(
3419
- "svg",
3420
- {
3421
- className: "uui-ring-spinner",
3422
- viewBox: "0 0 56 56",
3423
- xmlns: "http://www.w3.org/2000/svg",
3424
- children: [
3425
- /* @__PURE__ */ i(
3426
- "circle",
3427
- {
3428
- cx: "28",
3429
- cy: "28",
3430
- fill: "none",
3431
- opacity: "0.25",
3432
- r: "22",
3433
- stroke: "currentColor",
3434
- strokeWidth: "8"
3435
- }
3436
- ),
3437
- /* @__PURE__ */ i(
3438
- "circle",
3439
- {
3440
- cx: "28",
3441
- cy: "28",
3442
- fill: "none",
3443
- r: "22",
3444
- stroke: "currentColor",
3445
- strokeDasharray: "69 69",
3446
- strokeDashoffset: "0",
3447
- strokeLinecap: "butt",
3448
- strokeWidth: "8"
3449
- }
3450
- )
3451
- ]
3452
- }
3453
- ) : e === "stepBar" ? /* @__PURE__ */ j("svg", { className: "uui-bars-steps", viewBox: "0 0 48 48", children: [
3454
- /* @__PURE__ */ i("rect", { height: "8", rx: "4", width: "8", x: "6", y: "20" }),
3455
- /* @__PURE__ */ i("rect", { height: "8", rx: "4", width: "8", x: "20", y: "20" }),
3456
- /* @__PURE__ */ i("rect", { height: "8", rx: "4", width: "8", x: "34", y: "20" })
3457
- ] }) : /* @__PURE__ */ j(
3458
- "svg",
3459
- {
3460
- className: "uui-dots2-spinner",
3461
- viewBox: "0 0 48 48",
3462
- xmlns: "http://www.w3.org/2000/svg",
3463
- children: [
3464
- /* @__PURE__ */ i("circle", { cx: "10", cy: "24", r: "4" }),
3465
- /* @__PURE__ */ i("circle", { cx: "24", cy: "24", r: "4" }),
3466
- /* @__PURE__ */ i("circle", { cx: "38", cy: "24", r: "4" })
3467
- ]
3468
- }
3469
- );
3470
- }
3471
- function mi() {
3472
- const e = It(yn);
3473
- if (!e)
3474
- throw new Error("useTheme must be used within a <ThemeProvider>");
3475
- return e;
3476
- }
3477
- const jr = xt(
3478
- null
3479
- ), pi = xt(null), kt = ({
3480
- tooltip: e,
3481
- align: n,
3482
- triggerRef: t
3483
- }) => {
3484
- const [r, s] = ee(!1), [o, u] = ee(null), l = ce(null), { bgColor: m, textOnColor: p } = Vt("inverseSurface");
3485
- ye(() => {
3486
- const f = t.current;
3487
- if (!f)
3488
- return;
3489
- const x = () => {
3490
- s(!0);
3491
- }, g = () => {
3492
- s(!1), u(null);
3493
- }, w = (F) => {
3494
- F.target.matches(":focus-visible") && s(!0);
3495
- };
3496
- return f.addEventListener("mouseenter", x), f.addEventListener("mouseleave", g), f.addEventListener("focus", w), f.addEventListener("blur", g), () => {
3497
- f.removeEventListener("mouseenter", x), f.removeEventListener("mouseleave", g), f.removeEventListener("focus", w), f.removeEventListener("blur", g);
3498
- };
3499
- }, [t]), ye(() => {
3500
- if (!r)
3501
- return;
3502
- const f = requestAnimationFrame(() => {
3503
- if (!l.current || !t.current)
3504
- return;
3505
- const x = gn(t, l, {
3506
- placement: n,
3507
- offset: 8
3508
- });
3509
- x && u({ x: x.x, y: x.y });
3510
- });
3511
- return () => {
3512
- cancelAnimationFrame(f);
3513
- };
3514
- }, [n, r, t]);
3515
- const c = {
3516
- position: "absolute",
3517
- top: (o == null ? void 0 : o.y) ?? -9999,
3518
- left: (o == null ? void 0 : o.x) ?? -9999,
3519
- zIndex: 1e3,
3520
- opacity: o ? 1 : 0,
3521
- pointerEvents: "none",
3522
- visibility: o && r ? "visible" : "hidden"
3523
- }, a = [
3524
- p,
3525
- m,
3526
- "uui-tooltip",
3527
- "uui-font-body-small",
3528
- "uui-elevation-2",
3529
- "uui-px-2",
3530
- "uui-py-1",
3531
- "uui-corner-small"
3532
- ].join(" ");
3533
- return Wt(
3534
- /* @__PURE__ */ i("div", { className: a, ref: l, role: "tooltip", style: c, children: e }),
3535
- document.body
3536
- );
3537
- };
3538
- kt.displayName = "InlineTooltipManager";
3539
- const Ct = P(
3540
- (e, n) => {
3541
- const {
3542
- color: t,
3543
- selectedColor: r,
3544
- className: s,
3545
- label: o,
3546
- title: u,
3547
- type: l = "button",
3548
- size: m = "small",
3549
- border: p,
3550
- borderColor: c,
3551
- hoverEffects: a = ["overlay", "elevate"],
3552
- pressedEffects: f = ["overlay", "elevate"],
3553
- touchEffects: x = ["ripple"],
3554
- selectedEffects: g = ["morph", "color"],
3555
- focusEffects: w = ["ring", "overlay"],
3556
- children: F,
3557
- outlined: b = !1,
3558
- filled: h = !1,
3559
- tonal: $ = !1,
3560
- elevated: k = !1,
3561
- flat: S = !1,
3562
- elevation: M,
3563
- disabled: A,
3564
- textColor: q,
3565
- selectedTextColor: E,
3566
- shape: I = "round",
3567
- selectedShape: y = "rounded",
3568
- icon: C,
3569
- selectedIcon: v,
3570
- leading: N,
3571
- endIcon: Z,
3572
- trailing: U,
3573
- onClick: X,
3574
- elementClass: we,
3575
- font: he = "labelLarge",
3576
- upload: K,
3577
- uploadAccept: Me,
3578
- uploadMultiple: De,
3579
- onUploadChange: V,
3580
- id: O = "",
3581
- name: Q = "",
3582
- loading: fe,
3583
- fullWidth: de = !1,
3584
- link: D,
3585
- selected: Ve,
3586
- defaultSelected: ke,
3587
- toggle: z = !1,
3588
- tooltipAlign: te = "auto",
3589
- density: W,
3590
- style: ie,
3591
- "aria-label": We,
3592
- ...oe
3593
- } = e, ne = Ve !== void 0, [ve, He] = ee(
3594
- ke ?? !1
3595
- ), _ = ne ? Ve : ve, me = ce(null), Ee = ce(null), Re = ce(null), se = ce($t("button")), Se = O || Q || se.current, Ce = D ? lt.cloneElement(D, { ref: Ee, style: { display: "none" } }) : null, Fe = [
3596
- we,
3597
- s,
3598
- "uui-wrapper uui-bb",
3599
- dt(W),
3600
- ...de ? ["uui-full"] : []
3601
- ].filter(Boolean).join(" "), $e = [
3602
- "uui-btn-control",
3603
- Ie(he),
3604
- ...h ? ["uui-filled"] : [],
3605
- ...k ? ["uui-elevated"] : [],
3606
- ...$ ? ["uui-tonal"] : [],
3607
- ...b ? ["uui-outlined"] : [],
3608
- ...w.includes("ring") ? ["uui-focus-ring"] : [],
3609
- ...w.includes("overlay") ? ["uui-focus-overlay"] : [],
3610
- ...a.includes("overlay") ? ["uui-hover-overlay"] : [],
3611
- ...f.includes("overlay") ? ["uui-pressed-overlay"] : [],
3612
- ...g.includes("overlay") ? ["uui-selected-overlay"] : [],
3613
- ...fe ? ["uui-loading"] : [],
3614
- ...de ? ["uui-full"] : [],
3615
- ...F ? [] : [wt(m)],
3616
- ..._ ? ["uui-selected"] : []
3617
- ], pe = ["uui-state"], qe = z && _ && g.includes("morph") ? Ue(y) : Ue(I);
3618
- $e.push(qe), pe.push(qe);
3619
- const ge = "uui-icon", Le = z && _ ? v ?? N ?? C : N ?? C, Be = fe ? /* @__PURE__ */ i("div", { className: ge, children: /* @__PURE__ */ i(Rr, {}) }) : Le && /* @__PURE__ */ i("div", { className: ge, children: Le }), Ze = (U ?? Z) && /* @__PURE__ */ i("div", { className: ge, children: U ?? Z });
3620
- let le;
3621
- if (F) {
3622
- const J = [
3623
- "uui-btn-content uui-overflow-hidden",
3624
- qe,
3625
- Ie(he)
3626
- ].filter(Boolean).join(" ");
3627
- le = /* @__PURE__ */ i("div", { className: J, children: F });
3628
- } else
3629
- le = /* @__PURE__ */ j("div", { className: "uui-btn-content", children: [
3630
- Be,
3631
- o && /* @__PURE__ */ i("span", { className: "uui-label " + Ie(he), children: o }),
3632
- Ze
3633
- ] });
3634
- const L = T(ie), Y = T();
3635
- if (b || p !== void 0) {
3636
- L.border(mt(c));
3637
- const Xe = nt(p ?? (b ? 1 : 0));
3638
- $e.push(Xe);
3639
- }
3640
- let Te = M;
3641
- M === void 0 && ($ || h ? S || (Te = k ? 1 : 0) : k && (Te = 1));
3642
- const G = [
3643
- ...a.includes("elevate") && !S ? ["uui-hover-elevate"] : [],
3644
- ...f.includes("elevate") && !S ? ["uui-pressed-elevate"] : []
3645
- ];
3646
- $e.push(
3647
- ...G,
3648
- ut(Te)
3649
- );
3650
- const Je = () => {
3651
- h ? (L.bg(t ?? "primary"), Y.bg.on(t ?? "primary"), q ? L.text(q) : L.text.on(t ?? "primary")) : $ ? (L.bg.container("secondary"), Y.bg.onContainer("secondary"), q ? L.text(q) : L.text.onContainer("secondary")) : k ? (L.bg("surfaceContainerLow"), L.text(q ?? t ?? "primary"), Y.bg(t ?? "primary")) : b && !q ? (L.text.on("surfaceVariant"), Y.bg.on("surfaceVariant")) : (L.text(q ?? t ?? "primary"), Y.bg(q ?? t ?? "primary"));
3652
- }, _e = () => {
3653
- t ? (L.bg(t), Y.bg.on(t), L.text.on(t)) : h ? (L.bg("surfaceContainer"), Y.bg.on("surfaceContainer"), L.text.on("surfaceVariant")) : k ? (L.bg("surfaceContainerLow"), Y.bg.on("surfaceContainerLow"), L.text("primary")) : $ ? (L.bg.container("secondary"), Y.bg("secondary"), L.text.onContainer("secondary")) : b && !q ? (L.text.on("surfaceVariant"), Y.bg.on("surfaceVariant")) : (L.text(q ?? t ?? "primary"), Y.bg(q ?? t ?? "primary")), q && L.text(q);
3654
- }, H = () => {
3655
- const J = r ?? t ?? "primary";
3656
- $ && !r ? (L.bg("secondary"), Y.bg.on("secondary"), E ? L.text(E) : L.text.on("secondary")) : b && !r ? (L.bg("inverseSurface"), Y.bg.on("inverseSurface"), E ? L.text(E) : L.text.on("inverseSurface")) : (L.bg(J), Y.bg.on(J), E ? L.text(E) : L.text.on(J));
3657
- };
3658
- z && g.includes("color") ? _ ? H() : _e() : Je();
3659
- const ae = (J) => {
3660
- var Xe;
3661
- if (!A) {
3662
- if (z) {
3663
- const Ne = !_;
3664
- ne || He(Ne), (Xe = e.onChange) == null || Xe.call(e, {
3665
- ...J,
3666
- target: {
3667
- ...J.target,
3668
- name: Q,
3669
- value: Ne
3670
- }
3671
- });
3672
- }
3673
- if (Ee.current) {
3674
- Ee.current.click();
3675
- return;
3676
- }
3677
- if (K && me.current) {
3678
- me.current.click();
3679
- return;
3680
- }
3681
- X && X(J), x.includes("ripple") && St(J.currentTarget, J);
3682
- }
3683
- }, je = u ? /* @__PURE__ */ i("div", { id: `${Se}-tip`, children: u }) : null;
3684
- let Ae;
3685
- o && F && (Ae = o), !o && !F && (Ae = u);
3686
- const Oe = We ?? Ae;
3687
- return /* @__PURE__ */ j("div", { className: Fe, children: [
3688
- K && /* @__PURE__ */ i(
3689
- "input",
3690
- {
3691
- accept: Me,
3692
- "aria-labelledby": Se,
3693
- multiple: De,
3694
- onChange: V,
3695
- ref: me,
3696
- style: { display: "none" },
3697
- type: "file"
3698
- }
3699
- ),
3700
- /* @__PURE__ */ j(
3701
- "button",
3702
- {
3703
- "aria-busy": fe,
3704
- "aria-describedby": u ? `${Se}-tip` : void 0,
3705
- "aria-haspopup": K ? "dialog" : void 0,
3706
- "aria-label": Oe,
3707
- "aria-pressed": z ? _ : void 0,
3708
- className: $e.join(" "),
3709
- disabled: A,
3710
- id: Se,
3711
- name: Q || void 0,
3712
- onClick: ae,
3713
- ref: ft(n, Re),
3714
- style: L.get(),
3715
- type: l,
3716
- ...oe,
3717
- children: [
3718
- /* @__PURE__ */ i("div", { className: pe.join(" "), style: Y.get() }),
3719
- le
3720
- ]
3721
- }
3722
- ),
3723
- Ce,
3724
- je && /* @__PURE__ */ i(
3725
- kt,
3726
- {
3727
- align: te,
3728
- tooltip: je,
3729
- triggerRef: Re
3730
- }
3731
- )
3732
- ] });
3733
- }
3734
- );
3735
- Ct.displayName = "ButtonBase";
3736
- export {
3737
- pr as Article,
3738
- Cr as Aside,
3739
- qt as Badge,
3740
- Ye as BoxBase,
3741
- Dn as Button,
3742
- Ct as ButtonBase,
3743
- Un as Card,
3744
- Gn as Checkbox,
3745
- _t as CheckboxBase,
3746
- Rn as Chip,
3747
- gr as Content,
3748
- T as ControlStyle,
3749
- oi as DateInput,
3750
- si as DateTimeInput,
3751
- kr as Dialog,
3752
- Br as DialogActions,
3753
- Lr as DialogContent,
3754
- Fr as DialogTitle,
3755
- xr as Div,
3756
- bn as Divider,
3757
- li as EmailInput,
3758
- Xn as Fab,
3759
- at as FieldBase,
3760
- vn as Fieldset,
3761
- pi as FieldsetContext,
3762
- yr as Flex,
3763
- fr as Footer,
3764
- vr as Grid,
3765
- dr as Header,
3766
- Cn as IS_DIVIDER,
3767
- pn as IS_MENU,
3768
- Gt as IS_MENU_ITEM,
3769
- zn as IconButton,
3770
- Xt as ListItem,
3771
- mr as Main,
3772
- Kt as Menu,
3773
- hn as MenuItem,
3774
- br as Nav,
3775
- ai as NumberInput,
3776
- or as Radio,
3777
- Nr as RadioGroup,
3778
- jr as RadioGroupContext,
3779
- hr as Section,
3780
- Rr as Spinner,
3781
- Dr as Switch,
3782
- ui as TelInput,
3783
- lr as TextField,
3784
- Nn as ThemeExtendedColorKeys,
3785
- ci as ThemeProvider,
3786
- fn as ThemeSchemeKeys,
3787
- cn as ThemeSemanticColorKeys,
3788
- dn as ThemeSurfaceColorKeys,
3789
- di as TimeInput,
3790
- Yn as ToggleButton,
3791
- cr as Tooltip,
3792
- fi as UrlInput,
3793
- gn as calculateFloatingPosition,
3794
- Pn as clampInt,
3795
- ti as createRipple,
3796
- Xr as getAlignClass,
3797
- In as getAnimationClass,
3798
- Wr as getAnimationList,
3799
- zr as getBodySizeClass,
3800
- An as getBorderClass,
3801
- mt as getBorderColor,
3802
- Ht as getBorderColorClass,
3803
- Hr as getColorClasses,
3804
- Gr as getCurrentColorClasses,
3805
- Qr as getDensityClass,
3806
- ri as getElementDisplayName,
3807
- On as getElevationClass,
3808
- Kr as getFixedColorClasses,
3809
- tn as getFontClass,
3810
- En as getMotionStyleClass,
3811
- Jr as getOutlineClass,
3812
- Tn as getSemanticColorClasses,
3813
- qr as getSemanticColorVar,
3814
- jn as getShapeClass,
3815
- Yr as getSizeClass,
3816
- Vt as getSurfaceColorClasses,
3817
- mn as getSurfaceColorVar,
3818
- _r as getTintOverlayColor,
3819
- Zr as hexToRgb,
3820
- Mn as hexToRgbValues,
3821
- Tt as inverseColorMap,
3822
- Pt as isDivider,
3823
- ht as isMenu,
3824
- Ot as isMenuItem,
3825
- ei as mergeRefs,
3826
- Mt as motionClassMap,
3827
- ii as setFocusVisible,
3828
- nn as toKebabCase,
3829
- ni as uniqueID,
3830
- Zn as useAnimate,
3831
- mi as useTheme
3832
- };