@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
@@ -1,89 +0,0 @@
1
- import { forwardRef as i, createElement as n } from "react";
2
- /**
3
- * @license lucide-react v0.488.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const w = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), g = (e) => e.replace(
9
- /^([A-Z])|[\s-_]+(\w)/g,
10
- (t, r, o) => o ? o.toUpperCase() : r.toLowerCase()
11
- ), c = (e) => {
12
- const t = g(e);
13
- return t.charAt(0).toUpperCase() + t.slice(1);
14
- }, l = (...e) => e.filter((t, r, o) => !!t && t.trim() !== "" && o.indexOf(t) === r).join(" ").trim();
15
- /**
16
- * @license lucide-react v0.488.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- var h = {
22
- xmlns: "http://www.w3.org/2000/svg",
23
- width: 24,
24
- height: 24,
25
- viewBox: "0 0 24 24",
26
- fill: "none",
27
- stroke: "currentColor",
28
- strokeWidth: 2,
29
- strokeLinecap: "round",
30
- strokeLinejoin: "round"
31
- };
32
- /**
33
- * @license lucide-react v0.488.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */
38
- const f = i(
39
- ({
40
- color: e = "currentColor",
41
- size: t = 24,
42
- strokeWidth: r = 2,
43
- absoluteStrokeWidth: o,
44
- className: a = "",
45
- children: s,
46
- iconNode: u,
47
- ...m
48
- }, C) => n(
49
- "svg",
50
- {
51
- ref: C,
52
- ...h,
53
- width: t,
54
- height: t,
55
- stroke: e,
56
- strokeWidth: o ? Number(r) * 24 / Number(t) : r,
57
- className: l("lucide", a),
58
- ...m
59
- },
60
- [
61
- ...u.map(([p, d]) => n(p, d)),
62
- ...Array.isArray(s) ? s : [s]
63
- ]
64
- )
65
- );
66
- /**
67
- * @license lucide-react v0.488.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */
72
- const b = (e, t) => {
73
- const r = i(
74
- ({ className: o, ...a }, s) => n(f, {
75
- ref: s,
76
- iconNode: t,
77
- className: l(
78
- `lucide-${w(c(e))}`,
79
- `lucide-${e}`,
80
- o
81
- ),
82
- ...a
83
- })
84
- );
85
- return r.displayName = c(e), r;
86
- };
87
- export {
88
- b as c
89
- };
@@ -1,423 +0,0 @@
1
- import * as d from "react";
2
- import { a as ae, c as ce, b as _ } from "./index-bYyfdsls.js";
3
- import { u as K } from "./index-Bk324h27.js";
4
- import { a as le, u as de } from "./index-Bry5AFQ2.js";
5
- import { P as T } from "./index-g-TFwd6Y.js";
6
- import { c as ue } from "./index-D9BbbgUq.js";
7
- import { jsx as g, jsxs as fe } from "react/jsx-runtime";
8
- function $(e, [t, n]) {
9
- return Math.min(n, Math.max(t, e));
10
- }
11
- var me = d.createContext(void 0);
12
- function pe(e) {
13
- const t = d.useContext(me);
14
- return e || t || "ltr";
15
- }
16
- var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
17
- "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
18
- "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
19
- "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
20
- "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
21
- }, M = "Slider", [N, he, Se] = ue(M), [W, ke] = ce(M, [
22
- Se
23
- ]), [ge, B] = W(M), q = d.forwardRef(
24
- (e, t) => {
25
- const {
26
- name: n,
27
- min: o = 0,
28
- max: i = 100,
29
- step: c = 1,
30
- orientation: r = "horizontal",
31
- disabled: a = !1,
32
- minStepsBetweenThumbs: l = 0,
33
- defaultValue: m = [o],
34
- value: x,
35
- onValueChange: s = () => {
36
- },
37
- onValueCommit: u = () => {
38
- },
39
- inverted: v = !1,
40
- form: P,
41
- ...S
42
- } = e, p = d.useRef(/* @__PURE__ */ new Set()), f = d.useRef(0), w = r === "horizontal" ? ve : we, [h = [], A] = ae({
43
- prop: x,
44
- defaultProp: m,
45
- onChange: (b) => {
46
- var C;
47
- (C = [...p.current][f.current]) == null || C.focus(), s(b);
48
- }
49
- }), k = d.useRef(h);
50
- function H(b) {
51
- const R = ye(h, b);
52
- I(b, R);
53
- }
54
- function ie(b) {
55
- I(b, f.current);
56
- }
57
- function se() {
58
- const b = k.current[f.current];
59
- h[f.current] !== b && u(h);
60
- }
61
- function I(b, R, { commit: C } = { commit: !1 }) {
62
- const U = _e(c), z = Me(Math.round((b - o) / c) * c + o, U), V = $(z, [o, i]);
63
- A((E = []) => {
64
- const y = Pe(E, V, R);
65
- if (Ee(y, l * c)) {
66
- f.current = y.indexOf(V);
67
- const Y = String(y) !== String(E);
68
- return Y && C && u(y), Y ? y : E;
69
- } else
70
- return E;
71
- });
72
- }
73
- return /* @__PURE__ */ g(
74
- ge,
75
- {
76
- scope: e.__scopeSlider,
77
- name: n,
78
- disabled: a,
79
- min: o,
80
- max: i,
81
- valueIndexToChangeRef: f,
82
- thumbs: p.current,
83
- values: h,
84
- orientation: r,
85
- form: P,
86
- children: /* @__PURE__ */ g(N.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(N.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(
87
- w,
88
- {
89
- "aria-disabled": a,
90
- "data-disabled": a ? "" : void 0,
91
- ...S,
92
- ref: t,
93
- onPointerDown: _(S.onPointerDown, () => {
94
- a || (k.current = h);
95
- }),
96
- min: o,
97
- max: i,
98
- inverted: v,
99
- onSlideStart: a ? void 0 : H,
100
- onSlideMove: a ? void 0 : ie,
101
- onSlideEnd: a ? void 0 : se,
102
- onHomeKeyDown: () => !a && I(o, 0, { commit: !0 }),
103
- onEndKeyDown: () => !a && I(i, h.length - 1, { commit: !0 }),
104
- onStepKeyDown: ({ event: b, direction: R }) => {
105
- if (!a) {
106
- const z = j.includes(b.key) || b.shiftKey && X.includes(b.key) ? 10 : 1, V = f.current, E = h[V], y = c * z * R;
107
- I(E + y, V, { commit: !0 });
108
- }
109
- }
110
- }
111
- ) }) })
112
- }
113
- );
114
- }
115
- );
116
- q.displayName = M;
117
- var [J, Q] = W(M, {
118
- startEdge: "left",
119
- endEdge: "right",
120
- size: "width",
121
- direction: 1
122
- }), ve = d.forwardRef(
123
- (e, t) => {
124
- const {
125
- min: n,
126
- max: o,
127
- dir: i,
128
- inverted: c,
129
- onSlideStart: r,
130
- onSlideMove: a,
131
- onSlideEnd: l,
132
- onStepKeyDown: m,
133
- ...x
134
- } = e, [s, u] = d.useState(null), v = K(t, (w) => u(w)), P = d.useRef(void 0), S = pe(i), p = S === "ltr", f = p && !c || !p && c;
135
- function D(w) {
136
- const h = P.current || s.getBoundingClientRect(), A = [0, h.width], H = F(A, f ? [n, o] : [o, n]);
137
- return P.current = h, H(w - h.left);
138
- }
139
- return /* @__PURE__ */ g(
140
- J,
141
- {
142
- scope: e.__scopeSlider,
143
- startEdge: f ? "left" : "right",
144
- endEdge: f ? "right" : "left",
145
- direction: f ? 1 : -1,
146
- size: "width",
147
- children: /* @__PURE__ */ g(
148
- Z,
149
- {
150
- dir: S,
151
- "data-orientation": "horizontal",
152
- ...x,
153
- ref: v,
154
- style: {
155
- ...x.style,
156
- "--radix-slider-thumb-transform": "translateX(-50%)"
157
- },
158
- onSlideStart: (w) => {
159
- const h = D(w.clientX);
160
- r == null || r(h);
161
- },
162
- onSlideMove: (w) => {
163
- const h = D(w.clientX);
164
- a == null || a(h);
165
- },
166
- onSlideEnd: () => {
167
- P.current = void 0, l == null || l();
168
- },
169
- onStepKeyDown: (w) => {
170
- const A = G[f ? "from-left" : "from-right"].includes(w.key);
171
- m == null || m({ event: w, direction: A ? -1 : 1 });
172
- }
173
- }
174
- )
175
- }
176
- );
177
- }
178
- ), we = d.forwardRef(
179
- (e, t) => {
180
- const {
181
- min: n,
182
- max: o,
183
- inverted: i,
184
- onSlideStart: c,
185
- onSlideMove: r,
186
- onSlideEnd: a,
187
- onStepKeyDown: l,
188
- ...m
189
- } = e, x = d.useRef(null), s = K(t, x), u = d.useRef(void 0), v = !i;
190
- function P(S) {
191
- const p = u.current || x.current.getBoundingClientRect(), f = [0, p.height], w = F(f, v ? [o, n] : [n, o]);
192
- return u.current = p, w(S - p.top);
193
- }
194
- return /* @__PURE__ */ g(
195
- J,
196
- {
197
- scope: e.__scopeSlider,
198
- startEdge: v ? "bottom" : "top",
199
- endEdge: v ? "top" : "bottom",
200
- size: "height",
201
- direction: v ? 1 : -1,
202
- children: /* @__PURE__ */ g(
203
- Z,
204
- {
205
- "data-orientation": "vertical",
206
- ...m,
207
- ref: s,
208
- style: {
209
- ...m.style,
210
- "--radix-slider-thumb-transform": "translateY(50%)"
211
- },
212
- onSlideStart: (S) => {
213
- const p = P(S.clientY);
214
- c == null || c(p);
215
- },
216
- onSlideMove: (S) => {
217
- const p = P(S.clientY);
218
- r == null || r(p);
219
- },
220
- onSlideEnd: () => {
221
- u.current = void 0, a == null || a();
222
- },
223
- onStepKeyDown: (S) => {
224
- const f = G[v ? "from-bottom" : "from-top"].includes(S.key);
225
- l == null || l({ event: S, direction: f ? -1 : 1 });
226
- }
227
- }
228
- )
229
- }
230
- );
231
- }
232
- ), Z = d.forwardRef(
233
- (e, t) => {
234
- const {
235
- __scopeSlider: n,
236
- onSlideStart: o,
237
- onSlideMove: i,
238
- onSlideEnd: c,
239
- onHomeKeyDown: r,
240
- onEndKeyDown: a,
241
- onStepKeyDown: l,
242
- ...m
243
- } = e, x = B(M, n);
244
- return /* @__PURE__ */ g(
245
- T.span,
246
- {
247
- ...m,
248
- ref: t,
249
- onKeyDown: _(e.onKeyDown, (s) => {
250
- s.key === "Home" ? (r(s), s.preventDefault()) : s.key === "End" ? (a(s), s.preventDefault()) : j.concat(X).includes(s.key) && (l(s), s.preventDefault());
251
- }),
252
- onPointerDown: _(e.onPointerDown, (s) => {
253
- const u = s.target;
254
- u.setPointerCapture(s.pointerId), s.preventDefault(), x.thumbs.has(u) ? u.focus() : o(s);
255
- }),
256
- onPointerMove: _(e.onPointerMove, (s) => {
257
- s.target.hasPointerCapture(s.pointerId) && i(s);
258
- }),
259
- onPointerUp: _(e.onPointerUp, (s) => {
260
- const u = s.target;
261
- u.hasPointerCapture(s.pointerId) && (u.releasePointerCapture(s.pointerId), c(s));
262
- })
263
- }
264
- );
265
- }
266
- ), ee = "SliderTrack", te = d.forwardRef(
267
- (e, t) => {
268
- const { __scopeSlider: n, ...o } = e, i = B(ee, n);
269
- return /* @__PURE__ */ g(
270
- T.span,
271
- {
272
- "data-disabled": i.disabled ? "" : void 0,
273
- "data-orientation": i.orientation,
274
- ...o,
275
- ref: t
276
- }
277
- );
278
- }
279
- );
280
- te.displayName = ee;
281
- var O = "SliderRange", ne = d.forwardRef(
282
- (e, t) => {
283
- const { __scopeSlider: n, ...o } = e, i = B(O, n), c = Q(O, n), r = d.useRef(null), a = K(t, r), l = i.values.length, m = i.values.map(
284
- (u) => re(u, i.min, i.max)
285
- ), x = l > 1 ? Math.min(...m) : 0, s = 100 - Math.max(...m);
286
- return /* @__PURE__ */ g(
287
- T.span,
288
- {
289
- "data-orientation": i.orientation,
290
- "data-disabled": i.disabled ? "" : void 0,
291
- ...o,
292
- ref: a,
293
- style: {
294
- ...e.style,
295
- [c.startEdge]: x + "%",
296
- [c.endEdge]: s + "%"
297
- }
298
- }
299
- );
300
- }
301
- );
302
- ne.displayName = O;
303
- var L = "SliderThumb", oe = d.forwardRef(
304
- (e, t) => {
305
- const n = he(e.__scopeSlider), [o, i] = d.useState(null), c = K(t, (a) => i(a)), r = d.useMemo(
306
- () => o ? n().findIndex((a) => a.ref.current === o) : -1,
307
- [n, o]
308
- );
309
- return /* @__PURE__ */ g(be, { ...e, ref: c, index: r });
310
- }
311
- ), be = d.forwardRef(
312
- (e, t) => {
313
- const { __scopeSlider: n, index: o, name: i, ...c } = e, r = B(L, n), a = Q(L, n), [l, m] = d.useState(null), x = K(t, (D) => m(D)), s = l ? r.form || !!l.closest("form") : !0, u = le(l), v = r.values[o], P = v === void 0 ? 0 : re(v, r.min, r.max), S = Re(o, r.values.length), p = u == null ? void 0 : u[a.size], f = p ? De(p, P, a.direction) : 0;
314
- return d.useEffect(() => {
315
- if (l)
316
- return r.thumbs.add(l), () => {
317
- r.thumbs.delete(l);
318
- };
319
- }, [l, r.thumbs]), /* @__PURE__ */ fe(
320
- "span",
321
- {
322
- style: {
323
- transform: "var(--radix-slider-thumb-transform)",
324
- position: "absolute",
325
- [a.startEdge]: `calc(${P}% + ${f}px)`
326
- },
327
- children: [
328
- /* @__PURE__ */ g(N.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(
329
- T.span,
330
- {
331
- role: "slider",
332
- "aria-label": e["aria-label"] || S,
333
- "aria-valuemin": r.min,
334
- "aria-valuenow": v,
335
- "aria-valuemax": r.max,
336
- "aria-orientation": r.orientation,
337
- "data-orientation": r.orientation,
338
- "data-disabled": r.disabled ? "" : void 0,
339
- tabIndex: r.disabled ? void 0 : 0,
340
- ...c,
341
- ref: x,
342
- style: v === void 0 ? { display: "none" } : e.style,
343
- onFocus: _(e.onFocus, () => {
344
- r.valueIndexToChangeRef.current = o;
345
- })
346
- }
347
- ) }),
348
- s && /* @__PURE__ */ g(
349
- xe,
350
- {
351
- name: i ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
352
- form: r.form,
353
- value: v
354
- },
355
- o
356
- )
357
- ]
358
- }
359
- );
360
- }
361
- );
362
- oe.displayName = L;
363
- var xe = (e) => {
364
- const { value: t, ...n } = e, o = d.useRef(null), i = de(t);
365
- return d.useEffect(() => {
366
- const c = o.current, r = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(r, "value").set;
367
- if (i !== t && l) {
368
- const m = new Event("input", { bubbles: !0 });
369
- l.call(c, t), c.dispatchEvent(m);
370
- }
371
- }, [i, t]), /* @__PURE__ */ g("input", { style: { display: "none" }, ...n, ref: o, defaultValue: t });
372
- };
373
- function Pe(e = [], t, n) {
374
- const o = [...e];
375
- return o[n] = t, o.sort((i, c) => i - c);
376
- }
377
- function re(e, t, n) {
378
- const c = 100 / (n - t) * (e - t);
379
- return $(c, [0, 100]);
380
- }
381
- function Re(e, t) {
382
- return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
383
- }
384
- function ye(e, t) {
385
- if (e.length === 1) return 0;
386
- const n = e.map((i) => Math.abs(i - t)), o = Math.min(...n);
387
- return n.indexOf(o);
388
- }
389
- function De(e, t, n) {
390
- const o = e / 2, c = F([0, 50], [0, o]);
391
- return (o - c(t) * n) * n;
392
- }
393
- function Ce(e) {
394
- return e.slice(0, -1).map((t, n) => e[n + 1] - t);
395
- }
396
- function Ee(e, t) {
397
- if (t > 0) {
398
- const n = Ce(e);
399
- return Math.min(...n) >= t;
400
- }
401
- return !0;
402
- }
403
- function F(e, t) {
404
- return (n) => {
405
- if (e[0] === e[1] || t[0] === t[1]) return t[0];
406
- const o = (t[1] - t[0]) / (e[1] - e[0]);
407
- return t[0] + o * (n - e[0]);
408
- };
409
- }
410
- function _e(e) {
411
- return (String(e).split(".")[1] || "").length;
412
- }
413
- function Me(e, t) {
414
- const n = Math.pow(10, t);
415
- return Math.round(e * n) / n;
416
- }
417
- var He = q, ze = te, Ne = ne, Oe = oe;
418
- export {
419
- He as R,
420
- ze as T,
421
- Ne as a,
422
- Oe as b
423
- };
@@ -1,32 +0,0 @@
1
- import * as e from "react";
2
- import { P as o } from "./index-g-TFwd6Y.js";
3
- import { jsx as t } from "react/jsx-runtime";
4
- var d = "VisuallyHidden", a = e.forwardRef(
5
- (r, i) => /* @__PURE__ */ t(
6
- o.span,
7
- {
8
- ...r,
9
- ref: i,
10
- style: {
11
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
12
- position: "absolute",
13
- border: 0,
14
- width: 1,
15
- height: 1,
16
- padding: 0,
17
- margin: -1,
18
- overflow: "hidden",
19
- clip: "rect(0, 0, 0, 0)",
20
- whiteSpace: "nowrap",
21
- wordWrap: "normal",
22
- ...r.style
23
- }
24
- }
25
- )
26
- );
27
- a.displayName = d;
28
- var m = a;
29
- export {
30
- m as R,
31
- a as V
32
- };
@@ -1,118 +0,0 @@
1
- import * as u from "react";
2
- import { jsx as v } from "react/jsx-runtime";
3
- function _(t, e) {
4
- const n = u.createContext(e), s = (c) => {
5
- const { children: r, ...i } = c, f = u.useMemo(() => i, Object.values(i));
6
- return /* @__PURE__ */ v(n.Provider, { value: f, children: r });
7
- };
8
- s.displayName = t + "Provider";
9
- function o(c) {
10
- const r = u.useContext(n);
11
- if (r) return r;
12
- if (e !== void 0) return e;
13
- throw new Error(`\`${c}\` must be used within \`${t}\``);
14
- }
15
- return [s, o];
16
- }
17
- function y(t, e = []) {
18
- let n = [];
19
- function s(c, r) {
20
- const i = u.createContext(r), f = n.length;
21
- n = [...n, r];
22
- const a = (d) => {
23
- var S;
24
- const { scope: l, children: h, ...x } = d, m = ((S = l == null ? void 0 : l[t]) == null ? void 0 : S[f]) || i, p = u.useMemo(() => x, Object.values(x));
25
- return /* @__PURE__ */ v(m.Provider, { value: p, children: h });
26
- };
27
- a.displayName = c + "Provider";
28
- function C(d, l) {
29
- var m;
30
- const h = ((m = l == null ? void 0 : l[t]) == null ? void 0 : m[f]) || i, x = u.useContext(h);
31
- if (x) return x;
32
- if (r !== void 0) return r;
33
- throw new Error(`\`${d}\` must be used within \`${c}\``);
34
- }
35
- return [a, C];
36
- }
37
- const o = () => {
38
- const c = n.map((r) => u.createContext(r));
39
- return function(i) {
40
- const f = (i == null ? void 0 : i[t]) || c;
41
- return u.useMemo(
42
- () => ({ [`__scope${t}`]: { ...i, [t]: f } }),
43
- [i, f]
44
- );
45
- };
46
- };
47
- return o.scopeName = t, [s, b(o, ...e)];
48
- }
49
- function b(...t) {
50
- const e = t[0];
51
- if (t.length === 1) return e;
52
- const n = () => {
53
- const s = t.map((o) => ({
54
- useScope: o(),
55
- scopeName: o.scopeName
56
- }));
57
- return function(c) {
58
- const r = s.reduce((i, { useScope: f, scopeName: a }) => {
59
- const d = f(c)[`__scope${a}`];
60
- return { ...i, ...d };
61
- }, {});
62
- return u.useMemo(() => ({ [`__scope${e.scopeName}`]: r }), [r]);
63
- };
64
- };
65
- return n.scopeName = e.scopeName, n;
66
- }
67
- function M(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
68
- return function(o) {
69
- if (t == null || t(o), n === !1 || !o.defaultPrevented)
70
- return e == null ? void 0 : e(o);
71
- };
72
- }
73
- var R = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
74
- };
75
- function P(t) {
76
- const e = u.useRef(t);
77
- return u.useEffect(() => {
78
- e.current = t;
79
- }), u.useMemo(() => (...n) => {
80
- var s;
81
- return (s = e.current) == null ? void 0 : s.call(e, ...n);
82
- }, []);
83
- }
84
- function j({
85
- prop: t,
86
- defaultProp: e,
87
- onChange: n = () => {
88
- }
89
- }) {
90
- const [s, o] = $({ defaultProp: e, onChange: n }), c = t !== void 0, r = c ? t : s, i = P(n), f = u.useCallback(
91
- (a) => {
92
- if (c) {
93
- const d = typeof a == "function" ? a(t) : a;
94
- d !== t && i(d);
95
- } else
96
- o(a);
97
- },
98
- [c, t, o, i]
99
- );
100
- return [r, f];
101
- }
102
- function $({
103
- defaultProp: t,
104
- onChange: e
105
- }) {
106
- const n = u.useState(t), [s] = n, o = u.useRef(s), c = P(e);
107
- return u.useEffect(() => {
108
- o.current !== s && (c(s), o.current = s);
109
- }, [s, o, c]), n;
110
- }
111
- export {
112
- j as a,
113
- M as b,
114
- y as c,
115
- P as d,
116
- _ as e,
117
- R as u
118
- };