@konstructio/ui 0.1.0-alpha.9 → 0.1.1-alpha.2

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 (167) hide show
  1. package/dist/DatePicker.css +1 -1
  2. package/dist/{Modal-CrG0m703.js → Modal-0oht63vU.js} +32 -32
  3. package/dist/assets/icons/components/Search.js +26 -0
  4. package/dist/assets/icons/components/Warning.js +22 -0
  5. package/dist/assets/icons/components/index.js +6 -0
  6. package/dist/{chevron-down-UW8ts6wI.js → chevron-down-CVce9Mvh.js} +2 -2
  7. package/dist/components/Alert/Alert.js +23 -25
  8. package/dist/components/Alert/Alert.variants.js +1 -1
  9. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  10. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  11. package/dist/components/AlertDialog/components/index.js +1 -1
  12. package/dist/components/AlertDialog/hooks/useAlertDialog.js +7 -7
  13. package/dist/components/Autocomplete/Autocomplete.variants.js +3 -4
  14. package/dist/components/Autocomplete/components/List/List.variants.js +3 -7
  15. package/dist/components/Autocomplete/hooks/useAutocomplete.js +38 -43
  16. package/dist/components/Autocomplete/hooks/useNavigationList.js +29 -37
  17. package/dist/components/Badge/Badge.js +40 -42
  18. package/dist/components/Badge/Badge.variants.js +1 -1
  19. package/dist/components/Breadcrumb/Breadcrumb.variants.js +1 -1
  20. package/dist/components/Breadcrumb/components/Item/Item.js +22 -21
  21. package/dist/components/Breadcrumb/components/Item/Item.variants.js +1 -1
  22. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  23. package/dist/components/Button/Button.js +15 -15
  24. package/dist/components/Button/Button.variants.js +10 -77
  25. package/dist/components/Card/Card.variants.js +3 -5
  26. package/dist/components/Checkbox/Checkbox.js +48 -47
  27. package/dist/components/Checkbox/Checkbox.variants.js +3 -4
  28. package/dist/components/Command/Command.js +2 -2
  29. package/dist/components/Command/Command.variants.js +1 -1
  30. package/dist/components/Command/components/Command.js +1 -1
  31. package/dist/components/Command/components/CommandEmpty.js +1 -1
  32. package/dist/components/Command/components/CommandGroup.js +1 -1
  33. package/dist/components/Command/components/CommandInput.js +1 -1
  34. package/dist/components/Command/components/CommandItem.js +13 -13
  35. package/dist/components/Command/components/CommandList.js +1 -1
  36. package/dist/components/Command/components/CommandSeparator.js +1 -1
  37. package/dist/components/Command/components/DialogContent.js +1 -1
  38. package/dist/components/Command/components/DialogOverlay.js +1 -1
  39. package/dist/components/Datepicker/DatePicker.js +1496 -1577
  40. package/dist/components/Datepicker/DatePicker.variants.js +1 -1
  41. package/dist/components/Divider/Divider.variants.js +1 -1
  42. package/dist/components/Dropdown/Dropdown.js +28 -6
  43. package/dist/components/Dropdown/Dropdown.variants.js +43 -26
  44. package/dist/components/Dropdown/components/List/List.variants.js +1 -1
  45. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +5 -5
  46. package/dist/components/Dropdown/components/Wrapper.js +96 -86
  47. package/dist/components/Dropdown/contexts/dropdown.provider.js +12 -12
  48. package/dist/components/Dropdown/hooks/useDropdown.js +26 -30
  49. package/dist/components/Dropdown/hooks/useNavigationList.js +25 -31
  50. package/dist/components/DropdownButton/DropdownButton.js +135 -0
  51. package/dist/components/Filter/Filter.variants.js +1 -1
  52. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +47 -49
  53. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  54. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +41 -42
  55. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +30 -30
  56. package/dist/components/Filter/components/ResetButton/ResetButton.js +22 -16
  57. package/dist/components/Input/Input.js +116 -109
  58. package/dist/components/Input/Input.variants.js +18 -5
  59. package/dist/components/Loading/Loading.js +2 -2
  60. package/dist/components/Loading/Loading.variants.js +1 -2
  61. package/dist/components/Modal/Modal.js +2 -2
  62. package/dist/components/Modal/components/Body/Body.js +1 -1
  63. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  64. package/dist/components/Modal/components/Header/Header.js +1 -1
  65. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  66. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +7 -9
  67. package/dist/components/Modal/components/index.js +1 -1
  68. package/dist/components/Modal/hooks/useModal.js +16 -17
  69. package/dist/components/NumberInput/NumberInput.js +91 -91
  70. package/dist/components/NumberInput/NumberInput.variants.js +1 -1
  71. package/dist/components/PieChart/PieChart.js +5138 -0
  72. package/dist/components/ProgressBar/ProgressBar.js +58 -26
  73. package/dist/components/ProgressBar/ProgressBar.variants.js +1 -1
  74. package/dist/components/Radio/Radio.js +64 -48
  75. package/dist/components/Radio/Radio.variants.js +3 -3
  76. package/dist/components/RadioCard/RadioCard.js +26 -23
  77. package/dist/components/RadioCard/RadioCard.variants.js +1 -1
  78. package/dist/components/RadioCardGroup/RadioCardGroup.js +28 -28
  79. package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +1 -1
  80. package/dist/components/RadioGroup/RadioGroup.js +37 -37
  81. package/dist/components/RadioGroup/RadioGroup.variants.js +1 -1
  82. package/dist/components/Range/Range.js +1 -1
  83. package/dist/components/Range/Range.variants.js +2 -3
  84. package/dist/components/Sidebar/Sidebar.js +4 -3
  85. package/dist/components/Sidebar/Sidebar.variants.js +1 -1
  86. package/dist/components/Sidebar/components/Footer/Footer.js +5 -4
  87. package/dist/components/Sidebar/components/Footer/Footer.variants.js +1 -1
  88. package/dist/components/Sidebar/components/Logo/Logo.js +6 -5
  89. package/dist/components/Sidebar/components/Logo/Logo.variants.js +1 -1
  90. package/dist/components/Sidebar/components/Navigation/Navigation.js +5 -4
  91. package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +1 -1
  92. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -13
  93. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +1 -1
  94. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +13 -12
  95. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -1
  96. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +5 -6
  97. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +1 -1
  98. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -8
  99. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +1 -1
  100. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +15 -14
  101. package/dist/components/Slider/Slider.js +1 -1
  102. package/dist/components/Slider/Slider.variants.js +2 -8
  103. package/dist/components/Switch/Switch.js +54 -54
  104. package/dist/components/Switch/Switch.variants.js +2 -3
  105. package/dist/components/Table/Table.variants.js +1 -1
  106. package/dist/components/Tabs/Tabs.js +20 -16
  107. package/dist/components/Tabs/Tabs.variants.js +3 -5
  108. package/dist/components/Tabs/components/Content.js +10 -13
  109. package/dist/components/Tabs/components/List.js +9 -8
  110. package/dist/components/Tabs/components/Trigger.js +12 -16
  111. package/dist/components/Tabs/components/index.js +8 -0
  112. package/dist/components/Tag/Tag.js +1 -1
  113. package/dist/components/Tag/Tag.variants.js +1 -1
  114. package/dist/components/TagSelect/TagSelect.variants.js +1 -1
  115. package/dist/components/TagSelect/components/Item/Item.variants.js +1 -1
  116. package/dist/components/TagSelect/components/List/List.variants.js +1 -1
  117. package/dist/components/TagSelect/hooks/useTagSelect.js +14 -16
  118. package/dist/components/TextArea/TextArea.variants.js +4 -5
  119. package/dist/components/TimePicker/TimePicker.variants.js +6 -7
  120. package/dist/components/TimePicker/components/HoursList/HoursList.js +21 -26
  121. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +19 -20
  122. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +24 -25
  123. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +33 -34
  124. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +1 -1
  125. package/dist/components/Toast/Toast.js +223 -232
  126. package/dist/components/Toast/Toast.variants.js +8 -11
  127. package/dist/components/Tooltip/Tooltip.js +1 -1
  128. package/dist/components/Tooltip/Tooltip.variants.js +7 -14
  129. package/dist/components/Tooltip/hooks/useTooltip.js +8 -9
  130. package/dist/components/Typography/Typography.js +26 -31
  131. package/dist/components/Typography/Typography.variants.js +1 -1
  132. package/dist/components/index.js +78 -66
  133. package/dist/contexts/theme.provider.js +28 -29
  134. package/dist/{createLucideIcon-ByJ0JZvK.js → createLucideIcon-BpsAkT97.js} +4 -4
  135. package/dist/index-0ioNhtNM.js +10 -0
  136. package/dist/{index-CvfCCTEO.js → index-BAraV3ai.js} +7 -7
  137. package/dist/index-BXuxPoz7.js +435 -0
  138. package/dist/index-BfXxHr_2.js +125 -0
  139. package/dist/index-C1g_chDT.js +70 -0
  140. package/dist/{index-BCGvACM9.js → index-C9T9HQaa.js} +1 -1
  141. package/dist/{index-Bc1LNrRD.js → index-CZnD2QxM.js} +1 -1
  142. package/dist/index-CrBonFvu.js +144 -0
  143. package/dist/{index-rUBNhTeF.js → index-Cvx4lqTq.js} +2 -2
  144. package/dist/{index-BNmRGtA6.js → index-D29mdTf5.js} +3 -3
  145. package/dist/{index-Dkt8F6CZ.js → index-D3xzCzcO.js} +12 -12
  146. package/dist/index-DB2XhXHn.js +431 -0
  147. package/dist/{index-B5MIi2tR.js → index-DQH6odE9.js} +2 -3
  148. package/dist/index-Oq5GlCHP.js +131 -0
  149. package/dist/{index-Cs8Lv8Wj.js → index-bwWKd82e.js} +1 -1
  150. package/dist/{index--EmNlyHx.js → index-iXyXtdgP.js} +1 -1
  151. package/dist/index.d.ts +157 -9
  152. package/dist/index.js +88 -76
  153. package/dist/package.json +41 -37
  154. package/dist/styles.css +1 -1
  155. package/dist/ui/civo-theme.css +261 -241
  156. package/dist/ui/kubefirst-theme.css +4 -4
  157. package/dist/ui/theme.css +0 -2
  158. package/dist/{useBreadcrumb-DMERrNkJ.js → useBreadcrumb-B8DnuqkR.js} +254 -261
  159. package/dist/utils/index.js +25 -26
  160. package/package.json +41 -37
  161. package/dist/index-BNU3RH-3.js +0 -133
  162. package/dist/index-BvCZBMfr.js +0 -432
  163. package/dist/index-Cq1I1cG9.js +0 -129
  164. package/dist/index-DLYwlPRZ.js +0 -440
  165. package/dist/index-DNRcvRTB.js +0 -145
  166. package/dist/index-Dm-ooN_M.js +0 -71
  167. package/dist/index-DwYXX2sM.js +0 -13
@@ -1,432 +0,0 @@
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
- };
@@ -1,129 +0,0 @@
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
- };