@konstructio/ui 0.1.0-alpha.2 → 0.1.0-alpha.20

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 (133) hide show
  1. package/dist/{Combination-b348x__d.js → Combination-VYaRRJBZ.js} +155 -157
  2. package/dist/DatePicker.css +1 -0
  3. package/dist/Modal-CrG0m703.js +98 -0
  4. package/dist/assets/icons/components/Search.js +26 -0
  5. package/dist/assets/icons/components/Warning.js +22 -0
  6. package/dist/assets/icons/components/index.js +6 -0
  7. package/dist/chevron-down-3QGcvbP_.js +11 -0
  8. package/dist/{chevron-up-DgLBQCKD.js → chevron-up-RLP4nX7V.js} +1 -1
  9. package/dist/components/Alert/Alert.js +2 -2
  10. package/dist/components/AlertDialog/AlertDialog.js +55 -41
  11. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  12. package/dist/components/AlertDialog/components/index.js +1 -1
  13. package/dist/components/Badge/Badge.js +14 -14
  14. package/dist/components/Badge/Badge.variants.js +18 -17
  15. package/dist/components/Breadcrumb/Breadcrumb.js +44 -53
  16. package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
  17. package/dist/components/Breadcrumb/components/Item/Item.js +27 -27
  18. package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
  19. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  20. package/dist/components/Button/Button.js +30 -26
  21. package/dist/components/Button/Button.variants.js +116 -29
  22. package/dist/components/Checkbox/Checkbox.js +300 -185
  23. package/dist/components/Checkbox/Checkbox.variants.js +12 -15
  24. package/dist/components/Command/Command.js +2 -2
  25. package/dist/components/Command/components/Command.js +1 -1
  26. package/dist/components/Command/components/CommandEmpty.js +1 -1
  27. package/dist/components/Command/components/CommandGroup.js +1 -1
  28. package/dist/components/Command/components/CommandInput.js +2 -2
  29. package/dist/components/Command/components/CommandItem.js +1 -1
  30. package/dist/components/Command/components/CommandList.js +1 -1
  31. package/dist/components/Command/components/CommandSeparator.js +1 -1
  32. package/dist/components/Command/components/DialogContent.js +2 -2
  33. package/dist/components/Command/components/DialogOverlay.js +1 -1
  34. package/dist/components/Datepicker/DatePicker.js +2728 -0
  35. package/dist/components/Datepicker/DatePicker.variants.js +5 -0
  36. package/dist/components/Dropdown/components/List/List.js +55 -18
  37. package/dist/components/Dropdown/components/List/List.variants.js +5 -3
  38. package/dist/components/Dropdown/components/ListItem/ListItem.js +28 -22
  39. package/dist/components/Dropdown/components/Wrapper.js +110 -86
  40. package/dist/components/Dropdown/contexts/dropdown.context.js +6 -2
  41. package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +18 -11
  43. package/dist/components/DropdownButton/DropdownButton.js +136 -0
  44. package/dist/components/Filter/Filter.js +20 -0
  45. package/dist/components/Filter/Filter.variants.js +22 -0
  46. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +86 -0
  47. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +95 -0
  48. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +87 -0
  49. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +90 -0
  50. package/dist/components/Filter/components/ResetButton/ResetButton.js +24 -0
  51. package/dist/components/Filter/components/index.js +8 -0
  52. package/dist/components/Filter/events/index.js +12 -0
  53. package/dist/components/Input/Input.js +134 -163
  54. package/dist/components/Input/Input.variants.js +15 -13
  55. package/dist/components/Loading/Loading.js +2 -2
  56. package/dist/components/Modal/Modal.js +2 -2
  57. package/dist/components/Modal/components/Body/Body.js +1 -1
  58. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  59. package/dist/components/Modal/components/Header/Header.js +1 -1
  60. package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
  61. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +4 -6
  62. package/dist/components/Modal/components/index.js +1 -1
  63. package/dist/components/NumberInput/NumberInput.js +2 -2
  64. package/dist/components/PieChart/PieChart.js +5130 -0
  65. package/dist/components/Radio/Radio.js +64 -49
  66. package/dist/components/Radio/Radio.variants.js +14 -12
  67. package/dist/components/RadioCard/RadioCard.js +23 -21
  68. package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
  69. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  70. package/dist/components/Range/Range.js +1 -1
  71. package/dist/components/Slider/Slider.js +1 -1
  72. package/dist/components/Switch/Switch.js +141 -126
  73. package/dist/components/Tabs/Tabs.js +27 -0
  74. package/dist/components/Tabs/Tabs.variants.js +58 -0
  75. package/dist/components/Tabs/components/Content.js +19 -0
  76. package/dist/components/Tabs/components/List.js +20 -0
  77. package/dist/components/Tabs/components/Trigger.js +26 -0
  78. package/dist/components/Tabs/components/index.js +8 -0
  79. package/dist/components/Tag/Tag.js +1 -1
  80. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
  81. package/dist/components/TimePicker/TimePicker.js +8 -0
  82. package/dist/components/TimePicker/TimePicker.variants.js +62 -0
  83. package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
  84. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
  85. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
  86. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +96 -0
  87. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
  88. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
  89. package/dist/components/TimePicker/components/index.js +4 -0
  90. package/dist/components/TimePicker/contexts/index.js +8 -0
  91. package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
  92. package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
  93. package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
  94. package/dist/components/TimePicker/utils/index.js +6 -0
  95. package/dist/components/Toast/Toast.js +38 -36
  96. package/dist/components/Tooltip/Tooltip.js +1 -1
  97. package/dist/components/Typography/Typography.js +14 -16
  98. package/dist/components/index.js +90 -66
  99. package/dist/createLucideIcon-B7yPYScZ.js +94 -0
  100. package/dist/index--EmNlyHx.js +31 -0
  101. package/dist/{index-Bk324h27.js → index-B5MIi2tR.js} +6 -5
  102. package/dist/{index-g-TFwd6Y.js → index-BCGvACM9.js} +2 -1
  103. package/dist/{index-AM3avohj.js → index-BNU3RH-3.js} +3 -3
  104. package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
  105. package/dist/index-BdMNhZnh.js +9 -0
  106. package/dist/index-BvCZBMfr.js +432 -0
  107. package/dist/index-Cq1I1cG9.js +129 -0
  108. package/dist/index-Cs8Lv8Wj.js +13 -0
  109. package/dist/index-CvfCCTEO.js +323 -0
  110. package/dist/{index-DvFiic6N.js → index-DLYwlPRZ.js} +96 -102
  111. package/dist/{index-YaQrdkGE.js → index-DNRcvRTB.js} +31 -30
  112. package/dist/{index-dRxIWVBr.js → index-Dkt8F6CZ.js} +6 -5
  113. package/dist/{index-G_6jG4Qc.js → index-Dm-ooN_M.js} +18 -18
  114. package/dist/index-DwYXX2sM.js +13 -0
  115. package/dist/{index-C5psggHV.js → index-h-Ul0anl.js} +1 -2
  116. package/dist/{index-D9BbbgUq.js → index-rUBNhTeF.js} +2 -2
  117. package/dist/index.d.ts +263 -18
  118. package/dist/index.js +96 -72
  119. package/dist/package.json +42 -40
  120. package/dist/styles.css +1 -1
  121. package/dist/ui/civo-theme.css +263 -0
  122. package/dist/ui/kubefirst-theme.css +1 -1
  123. package/dist/ui/theme.css +11 -0
  124. package/dist/useBreadcrumb-DMERrNkJ.js +1280 -0
  125. package/dist/utils/index.js +4 -4
  126. package/dist/{x-DU-Zw-L_.js → x-BPcqkRZd.js} +1 -1
  127. package/package.json +42 -40
  128. package/dist/Modal-i7eolhYH.js +0 -926
  129. package/dist/createLucideIcon-CoF3ywd5.js +0 -89
  130. package/dist/index-BOx5P4tS.js +0 -423
  131. package/dist/index-CWKdynYu.js +0 -32
  132. package/dist/index-bYyfdsls.js +0 -118
  133. package/dist/useBreadcrumb-BsIeMoR1.js +0 -1279
@@ -0,0 +1,432 @@
1
+ import * as d from "react";
2
+ import { a as ce, c as le, b as C } from "./index-Cq1I1cG9.js";
3
+ import { u as M } from "./index-B5MIi2tR.js";
4
+ import { u as de } from "./index-BdMNhZnh.js";
5
+ import { a as ue, u as fe } from "./index-Bc1LNrRD.js";
6
+ import { P as B } from "./index-BCGvACM9.js";
7
+ import { c as me } from "./index-rUBNhTeF.js";
8
+ import { jsx as v, jsxs as pe } from "react/jsx-runtime";
9
+ function $(e, [t, n]) {
10
+ return Math.min(n, Math.max(t, e));
11
+ }
12
+ var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
13
+ "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
14
+ "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
15
+ "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
16
+ "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
17
+ }, I = "Slider", [z, he, Se] = me(I), [W, He] = le(I, [
18
+ Se
19
+ ]), [ge, K] = W(I), q = d.forwardRef(
20
+ (e, t) => {
21
+ const {
22
+ name: n,
23
+ min: o = 0,
24
+ max: a = 100,
25
+ step: c = 1,
26
+ orientation: r = "horizontal",
27
+ disabled: s = !1,
28
+ minStepsBetweenThumbs: l = 0,
29
+ defaultValue: h = [o],
30
+ value: S,
31
+ onValueChange: i = () => {
32
+ },
33
+ onValueCommit: u = () => {
34
+ },
35
+ inverted: w = !1,
36
+ form: P,
37
+ ...g
38
+ } = e, m = d.useRef(/* @__PURE__ */ new Set()), f = d.useRef(0), b = r === "horizontal" ? ve : we, [p = [], A] = ce({
39
+ prop: S,
40
+ defaultProp: h,
41
+ onChange: (R) => {
42
+ var E;
43
+ (E = [...m.current][f.current]) == null || E.focus(), i(R);
44
+ }
45
+ }), k = d.useRef(p);
46
+ function H(R) {
47
+ const x = ye(p, R);
48
+ T(R, x);
49
+ }
50
+ function se(R) {
51
+ T(R, f.current);
52
+ }
53
+ function ae() {
54
+ const R = k.current[f.current];
55
+ p[f.current] !== R && u(p);
56
+ }
57
+ function T(R, x, { commit: E } = { commit: !1 }) {
58
+ const F = Ce(c), N = Me(Math.round((R - o) / c) * c + o, F), V = $(N, [o, a]);
59
+ A((_ = []) => {
60
+ const y = Pe(_, V, x);
61
+ if (_e(y, l * c)) {
62
+ f.current = y.indexOf(V);
63
+ const Y = String(y) !== String(_);
64
+ return Y && E && u(y), Y ? y : _;
65
+ } else
66
+ return _;
67
+ });
68
+ }
69
+ return /* @__PURE__ */ v(
70
+ ge,
71
+ {
72
+ scope: e.__scopeSlider,
73
+ name: n,
74
+ disabled: s,
75
+ min: o,
76
+ max: a,
77
+ valueIndexToChangeRef: f,
78
+ thumbs: m.current,
79
+ values: p,
80
+ orientation: r,
81
+ form: P,
82
+ children: /* @__PURE__ */ v(z.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(z.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
83
+ b,
84
+ {
85
+ "aria-disabled": s,
86
+ "data-disabled": s ? "" : void 0,
87
+ ...g,
88
+ ref: t,
89
+ onPointerDown: C(g.onPointerDown, () => {
90
+ s || (k.current = p);
91
+ }),
92
+ min: o,
93
+ max: a,
94
+ inverted: w,
95
+ onSlideStart: s ? void 0 : H,
96
+ onSlideMove: s ? void 0 : se,
97
+ onSlideEnd: s ? void 0 : ae,
98
+ onHomeKeyDown: () => !s && T(o, 0, { commit: !0 }),
99
+ onEndKeyDown: () => !s && T(a, p.length - 1, { commit: !0 }),
100
+ onStepKeyDown: ({ event: R, direction: x }) => {
101
+ if (!s) {
102
+ const N = j.includes(R.key) || R.shiftKey && X.includes(R.key) ? 10 : 1, V = f.current, _ = p[V], y = c * N * x;
103
+ T(_ + y, V, { commit: !0 });
104
+ }
105
+ }
106
+ }
107
+ ) }) })
108
+ }
109
+ );
110
+ }
111
+ );
112
+ q.displayName = I;
113
+ var [J, Q] = W(I, {
114
+ startEdge: "left",
115
+ endEdge: "right",
116
+ size: "width",
117
+ direction: 1
118
+ }), ve = d.forwardRef(
119
+ (e, t) => {
120
+ const {
121
+ min: n,
122
+ max: o,
123
+ dir: a,
124
+ inverted: c,
125
+ onSlideStart: r,
126
+ onSlideMove: s,
127
+ onSlideEnd: l,
128
+ onStepKeyDown: h,
129
+ ...S
130
+ } = e, [i, u] = d.useState(null), w = M(t, (b) => u(b)), P = d.useRef(void 0), g = de(a), m = g === "ltr", f = m && !c || !m && c;
131
+ function D(b) {
132
+ const p = P.current || i.getBoundingClientRect(), A = [0, p.width], H = U(A, f ? [n, o] : [o, n]);
133
+ return P.current = p, H(b - p.left);
134
+ }
135
+ return /* @__PURE__ */ v(
136
+ J,
137
+ {
138
+ scope: e.__scopeSlider,
139
+ startEdge: f ? "left" : "right",
140
+ endEdge: f ? "right" : "left",
141
+ direction: f ? 1 : -1,
142
+ size: "width",
143
+ children: /* @__PURE__ */ v(
144
+ Z,
145
+ {
146
+ dir: g,
147
+ "data-orientation": "horizontal",
148
+ ...S,
149
+ ref: w,
150
+ style: {
151
+ ...S.style,
152
+ "--radix-slider-thumb-transform": "translateX(-50%)"
153
+ },
154
+ onSlideStart: (b) => {
155
+ const p = D(b.clientX);
156
+ r == null || r(p);
157
+ },
158
+ onSlideMove: (b) => {
159
+ const p = D(b.clientX);
160
+ s == null || s(p);
161
+ },
162
+ onSlideEnd: () => {
163
+ P.current = void 0, l == null || l();
164
+ },
165
+ onStepKeyDown: (b) => {
166
+ const A = G[f ? "from-left" : "from-right"].includes(b.key);
167
+ h == null || h({ event: b, direction: A ? -1 : 1 });
168
+ }
169
+ }
170
+ )
171
+ }
172
+ );
173
+ }
174
+ ), we = d.forwardRef(
175
+ (e, t) => {
176
+ const {
177
+ min: n,
178
+ max: o,
179
+ inverted: a,
180
+ onSlideStart: c,
181
+ onSlideMove: r,
182
+ onSlideEnd: s,
183
+ onStepKeyDown: l,
184
+ ...h
185
+ } = e, S = d.useRef(null), i = M(t, S), u = d.useRef(void 0), w = !a;
186
+ function P(g) {
187
+ const m = u.current || S.current.getBoundingClientRect(), f = [0, m.height], b = U(f, w ? [o, n] : [n, o]);
188
+ return u.current = m, b(g - m.top);
189
+ }
190
+ return /* @__PURE__ */ v(
191
+ J,
192
+ {
193
+ scope: e.__scopeSlider,
194
+ startEdge: w ? "bottom" : "top",
195
+ endEdge: w ? "top" : "bottom",
196
+ size: "height",
197
+ direction: w ? 1 : -1,
198
+ children: /* @__PURE__ */ v(
199
+ Z,
200
+ {
201
+ "data-orientation": "vertical",
202
+ ...h,
203
+ ref: i,
204
+ style: {
205
+ ...h.style,
206
+ "--radix-slider-thumb-transform": "translateY(50%)"
207
+ },
208
+ onSlideStart: (g) => {
209
+ const m = P(g.clientY);
210
+ c == null || c(m);
211
+ },
212
+ onSlideMove: (g) => {
213
+ const m = P(g.clientY);
214
+ r == null || r(m);
215
+ },
216
+ onSlideEnd: () => {
217
+ u.current = void 0, s == null || s();
218
+ },
219
+ onStepKeyDown: (g) => {
220
+ const f = G[w ? "from-bottom" : "from-top"].includes(g.key);
221
+ l == null || l({ event: g, direction: f ? -1 : 1 });
222
+ }
223
+ }
224
+ )
225
+ }
226
+ );
227
+ }
228
+ ), Z = d.forwardRef(
229
+ (e, t) => {
230
+ const {
231
+ __scopeSlider: n,
232
+ onSlideStart: o,
233
+ onSlideMove: a,
234
+ onSlideEnd: c,
235
+ onHomeKeyDown: r,
236
+ onEndKeyDown: s,
237
+ onStepKeyDown: l,
238
+ ...h
239
+ } = e, S = K(I, n);
240
+ return /* @__PURE__ */ v(
241
+ B.span,
242
+ {
243
+ ...h,
244
+ ref: t,
245
+ onKeyDown: C(e.onKeyDown, (i) => {
246
+ i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (s(i), i.preventDefault()) : j.concat(X).includes(i.key) && (l(i), i.preventDefault());
247
+ }),
248
+ onPointerDown: C(e.onPointerDown, (i) => {
249
+ const u = i.target;
250
+ u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : o(i);
251
+ }),
252
+ onPointerMove: C(e.onPointerMove, (i) => {
253
+ i.target.hasPointerCapture(i.pointerId) && a(i);
254
+ }),
255
+ onPointerUp: C(e.onPointerUp, (i) => {
256
+ const u = i.target;
257
+ u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), c(i));
258
+ })
259
+ }
260
+ );
261
+ }
262
+ ), ee = "SliderTrack", te = d.forwardRef(
263
+ (e, t) => {
264
+ const { __scopeSlider: n, ...o } = e, a = K(ee, n);
265
+ return /* @__PURE__ */ v(
266
+ B.span,
267
+ {
268
+ "data-disabled": a.disabled ? "" : void 0,
269
+ "data-orientation": a.orientation,
270
+ ...o,
271
+ ref: t
272
+ }
273
+ );
274
+ }
275
+ );
276
+ te.displayName = ee;
277
+ var L = "SliderRange", ne = d.forwardRef(
278
+ (e, t) => {
279
+ const { __scopeSlider: n, ...o } = e, a = K(L, n), c = Q(L, n), r = d.useRef(null), s = M(t, r), l = a.values.length, h = a.values.map(
280
+ (u) => ie(u, a.min, a.max)
281
+ ), S = l > 1 ? Math.min(...h) : 0, i = 100 - Math.max(...h);
282
+ return /* @__PURE__ */ v(
283
+ B.span,
284
+ {
285
+ "data-orientation": a.orientation,
286
+ "data-disabled": a.disabled ? "" : void 0,
287
+ ...o,
288
+ ref: s,
289
+ style: {
290
+ ...e.style,
291
+ [c.startEdge]: S + "%",
292
+ [c.endEdge]: i + "%"
293
+ }
294
+ }
295
+ );
296
+ }
297
+ );
298
+ ne.displayName = L;
299
+ var O = "SliderThumb", oe = d.forwardRef(
300
+ (e, t) => {
301
+ const n = he(e.__scopeSlider), [o, a] = d.useState(null), c = M(t, (s) => a(s)), r = d.useMemo(
302
+ () => o ? n().findIndex((s) => s.ref.current === o) : -1,
303
+ [n, o]
304
+ );
305
+ return /* @__PURE__ */ v(be, { ...e, ref: c, index: r });
306
+ }
307
+ ), be = d.forwardRef(
308
+ (e, t) => {
309
+ const { __scopeSlider: n, index: o, name: a, ...c } = e, r = K(O, n), s = Q(O, n), [l, h] = d.useState(null), S = M(t, (D) => h(D)), i = l ? r.form || !!l.closest("form") : !0, u = ue(l), w = r.values[o], P = w === void 0 ? 0 : ie(w, r.min, r.max), g = xe(o, r.values.length), m = u == null ? void 0 : u[s.size], f = m ? De(m, P, s.direction) : 0;
310
+ return d.useEffect(() => {
311
+ if (l)
312
+ return r.thumbs.add(l), () => {
313
+ r.thumbs.delete(l);
314
+ };
315
+ }, [l, r.thumbs]), /* @__PURE__ */ pe(
316
+ "span",
317
+ {
318
+ style: {
319
+ transform: "var(--radix-slider-thumb-transform)",
320
+ position: "absolute",
321
+ [s.startEdge]: `calc(${P}% + ${f}px)`
322
+ },
323
+ children: [
324
+ /* @__PURE__ */ v(z.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
325
+ B.span,
326
+ {
327
+ role: "slider",
328
+ "aria-label": e["aria-label"] || g,
329
+ "aria-valuemin": r.min,
330
+ "aria-valuenow": w,
331
+ "aria-valuemax": r.max,
332
+ "aria-orientation": r.orientation,
333
+ "data-orientation": r.orientation,
334
+ "data-disabled": r.disabled ? "" : void 0,
335
+ tabIndex: r.disabled ? void 0 : 0,
336
+ ...c,
337
+ ref: S,
338
+ style: w === void 0 ? { display: "none" } : e.style,
339
+ onFocus: C(e.onFocus, () => {
340
+ r.valueIndexToChangeRef.current = o;
341
+ })
342
+ }
343
+ ) }),
344
+ i && /* @__PURE__ */ v(
345
+ re,
346
+ {
347
+ name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
348
+ form: r.form,
349
+ value: w
350
+ },
351
+ o
352
+ )
353
+ ]
354
+ }
355
+ );
356
+ }
357
+ );
358
+ oe.displayName = O;
359
+ var Re = "RadioBubbleInput", re = d.forwardRef(
360
+ ({ __scopeSlider: e, value: t, ...n }, o) => {
361
+ const a = d.useRef(null), c = M(a, o), r = fe(t);
362
+ return d.useEffect(() => {
363
+ const s = a.current;
364
+ if (!s) return;
365
+ const l = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(l, "value").set;
366
+ if (r !== t && S) {
367
+ const i = new Event("input", { bubbles: !0 });
368
+ S.call(s, t), s.dispatchEvent(i);
369
+ }
370
+ }, [r, t]), /* @__PURE__ */ v(
371
+ B.input,
372
+ {
373
+ style: { display: "none" },
374
+ ...n,
375
+ ref: c,
376
+ defaultValue: t
377
+ }
378
+ );
379
+ }
380
+ );
381
+ re.displayName = Re;
382
+ function Pe(e = [], t, n) {
383
+ const o = [...e];
384
+ return o[n] = t, o.sort((a, c) => a - c);
385
+ }
386
+ function ie(e, t, n) {
387
+ const c = 100 / (n - t) * (e - t);
388
+ return $(c, [0, 100]);
389
+ }
390
+ function xe(e, t) {
391
+ return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
392
+ }
393
+ function ye(e, t) {
394
+ if (e.length === 1) return 0;
395
+ const n = e.map((a) => Math.abs(a - t)), o = Math.min(...n);
396
+ return n.indexOf(o);
397
+ }
398
+ function De(e, t, n) {
399
+ const o = e / 2, c = U([0, 50], [0, o]);
400
+ return (o - c(t) * n) * n;
401
+ }
402
+ function Ee(e) {
403
+ return e.slice(0, -1).map((t, n) => e[n + 1] - t);
404
+ }
405
+ function _e(e, t) {
406
+ if (t > 0) {
407
+ const n = Ee(e);
408
+ return Math.min(...n) >= t;
409
+ }
410
+ return !0;
411
+ }
412
+ function U(e, t) {
413
+ return (n) => {
414
+ if (e[0] === e[1] || t[0] === t[1]) return t[0];
415
+ const o = (t[1] - t[0]) / (e[1] - e[0]);
416
+ return t[0] + o * (n - e[0]);
417
+ };
418
+ }
419
+ function Ce(e) {
420
+ return (String(e).split(".")[1] || "").length;
421
+ }
422
+ function Me(e, t) {
423
+ const n = Math.pow(10, t);
424
+ return Math.round(e * n) / n;
425
+ }
426
+ var Ne = q, ze = te, Le = ne, Oe = oe;
427
+ export {
428
+ Ne as R,
429
+ ze as T,
430
+ Le as a,
431
+ Oe as b
432
+ };
@@ -0,0 +1,129 @@
1
+ import * as u from "react";
2
+ import { jsx as h } from "react/jsx-runtime";
3
+ function M(t, r) {
4
+ const o = u.createContext(r), i = (c) => {
5
+ const { children: e, ...n } = c, f = u.useMemo(() => n, Object.values(n));
6
+ return /* @__PURE__ */ h(o.Provider, { value: f, children: e });
7
+ };
8
+ i.displayName = t + "Provider";
9
+ function s(c) {
10
+ const e = u.useContext(o);
11
+ if (e) return e;
12
+ if (r !== void 0) return r;
13
+ throw new Error(`\`${c}\` must be used within \`${t}\``);
14
+ }
15
+ return [i, s];
16
+ }
17
+ function R(t, r = []) {
18
+ let o = [];
19
+ function i(c, e) {
20
+ const n = u.createContext(e), f = o.length;
21
+ o = [...o, e];
22
+ const m = (l) => {
23
+ var S;
24
+ const { scope: a, children: v, ...x } = l, C = ((S = a == null ? void 0 : a[t]) == null ? void 0 : S[f]) || n, P = u.useMemo(() => x, Object.values(x));
25
+ return /* @__PURE__ */ h(C.Provider, { value: P, children: v });
26
+ };
27
+ m.displayName = c + "Provider";
28
+ function d(l, a) {
29
+ var C;
30
+ const v = ((C = a == null ? void 0 : a[t]) == null ? void 0 : C[f]) || n, x = u.useContext(v);
31
+ if (x) return x;
32
+ if (e !== void 0) return e;
33
+ throw new Error(`\`${l}\` must be used within \`${c}\``);
34
+ }
35
+ return [m, d];
36
+ }
37
+ const s = () => {
38
+ const c = o.map((e) => u.createContext(e));
39
+ return function(n) {
40
+ const f = (n == null ? void 0 : n[t]) || c;
41
+ return u.useMemo(
42
+ () => ({ [`__scope${t}`]: { ...n, [t]: f } }),
43
+ [n, f]
44
+ );
45
+ };
46
+ };
47
+ return s.scopeName = t, [i, b(s, ...r)];
48
+ }
49
+ function b(...t) {
50
+ const r = t[0];
51
+ if (t.length === 1) return r;
52
+ const o = () => {
53
+ const i = t.map((s) => ({
54
+ useScope: s(),
55
+ scopeName: s.scopeName
56
+ }));
57
+ return function(c) {
58
+ const e = i.reduce((n, { useScope: f, scopeName: m }) => {
59
+ const l = f(c)[`__scope${m}`];
60
+ return { ...n, ...l };
61
+ }, {});
62
+ return u.useMemo(() => ({ [`__scope${r.scopeName}`]: e }), [e]);
63
+ };
64
+ };
65
+ return o.scopeName = r.scopeName, o;
66
+ }
67
+ function j(t, r, { checkForDefaultPrevented: o = !0 } = {}) {
68
+ return function(s) {
69
+ if (t == null || t(s), o === !1 || !s.defaultPrevented)
70
+ return r == null ? void 0 : r(s);
71
+ };
72
+ }
73
+ var p = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
74
+ }, w = u[" useInsertionEffect ".trim().toString()] || p;
75
+ function k({
76
+ prop: t,
77
+ defaultProp: r,
78
+ onChange: o = () => {
79
+ },
80
+ caller: i
81
+ }) {
82
+ const [s, c, e] = $({
83
+ defaultProp: r,
84
+ onChange: o
85
+ }), n = t !== void 0, f = n ? t : s;
86
+ {
87
+ const d = u.useRef(t !== void 0);
88
+ u.useEffect(() => {
89
+ const l = d.current;
90
+ l !== n && console.warn(
91
+ `${i} is changing from ${l ? "controlled" : "uncontrolled"} to ${n ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
92
+ ), d.current = n;
93
+ }, [n, i]);
94
+ }
95
+ const m = u.useCallback(
96
+ (d) => {
97
+ var l;
98
+ if (n) {
99
+ const a = _(d) ? d(t) : d;
100
+ a !== t && ((l = e.current) == null || l.call(e, a));
101
+ } else
102
+ c(d);
103
+ },
104
+ [n, t, c, e]
105
+ );
106
+ return [f, m];
107
+ }
108
+ function $({
109
+ defaultProp: t,
110
+ onChange: r
111
+ }) {
112
+ const [o, i] = u.useState(t), s = u.useRef(o), c = u.useRef(r);
113
+ return w(() => {
114
+ c.current = r;
115
+ }, [r]), u.useEffect(() => {
116
+ var e;
117
+ s.current !== o && ((e = c.current) == null || e.call(c, o), s.current = o);
118
+ }, [o, s]), [o, i, c];
119
+ }
120
+ function _(t) {
121
+ return typeof t == "function";
122
+ }
123
+ export {
124
+ k as a,
125
+ j as b,
126
+ R as c,
127
+ M as d,
128
+ p as u
129
+ };
@@ -0,0 +1,13 @@
1
+ import * as r from "react";
2
+ import { u as a } from "./index-Cq1I1cG9.js";
3
+ var s = r[" useId ".trim().toString()] || (() => {
4
+ }), i = 0;
5
+ function n(e) {
6
+ const [t, o] = r.useState(s());
7
+ return a(() => {
8
+ o((u) => u ?? String(i++));
9
+ }, [e]), t ? `radix-${t}` : "";
10
+ }
11
+ export {
12
+ n as u
13
+ };