@konstructio/ui 0.0.13-alpha.2 → 0.1.0-alpha.3

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 (100) hide show
  1. package/dist/DatePicker.css +1 -0
  2. package/dist/{Modal-i7eolhYH.js → Modal-B2ujmsSW.js} +2 -2
  3. package/dist/components/Alert/Alert.js +1 -1
  4. package/dist/components/AlertDialog/AlertDialog.js +55 -41
  5. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  6. package/dist/components/AlertDialog/components/index.js +1 -1
  7. package/dist/components/Badge/Badge.js +79 -0
  8. package/dist/components/Badge/Badge.variants.js +68 -0
  9. package/dist/components/Breadcrumb/Breadcrumb.js +43 -52
  10. package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
  11. package/dist/components/Breadcrumb/components/Item/Item.js +22 -23
  12. package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
  13. package/dist/components/Button/Button.js +30 -26
  14. package/dist/components/Button/Button.variants.js +115 -28
  15. package/dist/components/Checkbox/Checkbox.js +297 -187
  16. package/dist/components/Checkbox/Checkbox.variants.js +12 -15
  17. package/dist/components/Command/Command.js +2 -2
  18. package/dist/components/Command/components/Command.js +1 -1
  19. package/dist/components/Command/components/CommandEmpty.js +1 -1
  20. package/dist/components/Command/components/CommandGroup.js +1 -1
  21. package/dist/components/Command/components/CommandInput.js +1 -1
  22. package/dist/components/Command/components/CommandItem.js +1 -1
  23. package/dist/components/Command/components/CommandList.js +1 -1
  24. package/dist/components/Command/components/CommandSeparator.js +1 -1
  25. package/dist/components/Command/components/DialogContent.js +1 -1
  26. package/dist/components/Command/components/DialogOverlay.js +1 -1
  27. package/dist/components/Datepicker/DatePicker.js +2711 -0
  28. package/dist/components/Datepicker/DatePicker.variants.js +5 -0
  29. package/dist/components/Divider/Divider.variants.js +9 -12
  30. package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
  31. package/dist/components/Input/Input.js +106 -137
  32. package/dist/components/Input/Input.variants.js +15 -13
  33. package/dist/components/Loading/Loading.js +14 -99
  34. package/dist/components/Modal/Modal.js +2 -2
  35. package/dist/components/Modal/components/Body/Body.js +1 -1
  36. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  37. package/dist/components/Modal/components/Header/Header.js +1 -1
  38. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  39. package/dist/components/Modal/components/index.js +1 -1
  40. package/dist/components/NumberInput/NumberInput.js +1 -1
  41. package/dist/components/Radio/Radio.variants.js +14 -12
  42. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  43. package/dist/components/Range/Range.js +1 -1
  44. package/dist/components/Slider/Slider.js +1 -1
  45. package/dist/components/Switch/Switch.js +141 -126
  46. package/dist/components/Tabs/Tabs.js +24 -0
  47. package/dist/components/Tabs/Tabs.variants.js +58 -0
  48. package/dist/components/Tabs/components/Content.js +19 -0
  49. package/dist/components/Tabs/components/List.js +20 -0
  50. package/dist/components/Tabs/components/Trigger.js +26 -0
  51. package/dist/components/Tag/Tag.js +1 -1
  52. package/dist/components/TimePicker/TimePicker.js +8 -0
  53. package/dist/components/TimePicker/TimePicker.variants.js +62 -0
  54. package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
  55. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
  56. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
  57. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +102 -0
  58. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
  59. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
  60. package/dist/components/TimePicker/components/index.js +4 -0
  61. package/dist/components/TimePicker/contexts/index.js +8 -0
  62. package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
  63. package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
  64. package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
  65. package/dist/components/TimePicker/utils/index.js +6 -0
  66. package/dist/components/Toast/Toast.js +37 -35
  67. package/dist/components/Tooltip/Tooltip.js +1 -1
  68. package/dist/components/Typography/Typography.js +1 -1
  69. package/dist/components/index.js +72 -66
  70. package/dist/createLucideIcon-BA2PlKw1.js +94 -0
  71. package/dist/index-55GVbfLI.js +432 -0
  72. package/dist/{index-D9BbbgUq.js → index-B-qIIQlg.js} +2 -2
  73. package/dist/index-BRcC_VTj.js +31 -0
  74. package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
  75. package/dist/index-BdMNhZnh.js +9 -0
  76. package/dist/index-C2xwUZXm.js +323 -0
  77. package/dist/{index-YaQrdkGE.js → index-CQ6ORxI_.js} +31 -30
  78. package/dist/index-Cq1I1cG9.js +129 -0
  79. package/dist/index-Cs8Lv8Wj.js +13 -0
  80. package/dist/{index-dRxIWVBr.js → index-DmCJ8fIR.js} +6 -5
  81. package/dist/index-DwYXX2sM.js +13 -0
  82. package/dist/{index-g-TFwd6Y.js → index-ObZsP5Eh.js} +2 -1
  83. package/dist/{index-DvFiic6N.js → index-Ud3-A7-K.js} +95 -101
  84. package/dist/{index-G_6jG4Qc.js → index-Y44iCJcQ.js} +18 -18
  85. package/dist/index-tIydFizp.js +83 -0
  86. package/dist/{index-AM3avohj.js → index-xPmNHv1y.js} +3 -3
  87. package/dist/index.d.ts +72 -13
  88. package/dist/index.js +78 -72
  89. package/dist/package.json +25 -22
  90. package/dist/styles.css +1 -1
  91. package/dist/ui/civo-theme.css +263 -0
  92. package/dist/ui/kubefirst-theme.css +1 -1
  93. package/dist/ui/theme.css +11 -0
  94. package/dist/ui/utilities.css +11 -2
  95. package/dist/utils/index.js +3 -3
  96. package/package.json +25 -22
  97. package/dist/index-BOx5P4tS.js +0 -423
  98. package/dist/index-Bk324h27.js +0 -82
  99. package/dist/index-CWKdynYu.js +0 -32
  100. package/dist/index-bYyfdsls.js +0 -118
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.0.13-alpha.2",
5
+ "version": "0.1.0-alpha.3",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -55,23 +55,26 @@
55
55
  "test:watch": "vitest dev"
56
56
  },
57
57
  "dependencies": {
58
- "@radix-ui/react-alert-dialog": "^1.1.7",
59
- "@radix-ui/react-checkbox": "^1.1.5",
60
- "@radix-ui/react-dialog": "^1.1.7",
61
- "@radix-ui/react-slider": "^1.2.4",
62
- "@radix-ui/react-slot": "^1.2.0",
63
- "@radix-ui/react-switch": "^1.1.4",
64
- "@radix-ui/react-toast": "^1.2.7",
65
- "@radix-ui/react-visually-hidden": "^1.1.3",
58
+ "@radix-ui/react-alert-dialog": "^1.1.13",
59
+ "@radix-ui/react-checkbox": "^1.3.1",
60
+ "@radix-ui/react-dialog": "^1.1.13",
61
+ "@radix-ui/react-slider": "^1.3.4",
62
+ "@radix-ui/react-slot": "^1.2.2",
63
+ "@radix-ui/react-switch": "^1.2.4",
64
+ "@radix-ui/react-toast": "^1.2.13",
65
+ "@radix-ui/react-tabs": "^1.1.11",
66
+ "@radix-ui/react-visually-hidden": "^1.2.2",
66
67
  "class-variance-authority": "^0.7.1",
67
68
  "clsx": "^2.1.1",
68
69
  "cmdk": "^1.1.1",
70
+ "countries-and-timezones": "^3.8.0",
69
71
  "js-cookie": "^3.0.5",
70
- "lucide-react": "^0.488.0",
72
+ "lucide-react": "^0.510.0",
73
+ "react-day-picker": "^9.7.0",
71
74
  "react-feather": "^2.0.10",
72
75
  "react-focus-lock": "^2.13.6",
73
76
  "react-remove-scroll": "^2.6.3",
74
- "tailwind-merge": "^3.2.0"
77
+ "tailwind-merge": "^3.3.0"
75
78
  },
76
79
  "peerDependencies": {
77
80
  "@types/react": "*",
@@ -112,25 +115,25 @@
112
115
  "@storybook/react": "^8.6.12",
113
116
  "@storybook/react-vite": "^8.6.12",
114
117
  "@storybook/test": "^8.6.12",
115
- "@tailwindcss/vite": "^4.1.4",
118
+ "@tailwindcss/vite": "^4.1.6",
116
119
  "@testing-library/jest-dom": "^6.6.3",
117
120
  "@testing-library/react": "^16.3.0",
118
121
  "@testing-library/user-event": "^14.6.1",
119
122
  "@types/jest-axe": "^3.5.9",
120
123
  "@types/js-cookie": "^3.0.6",
121
124
  "@types/lodash": "^4.17.16",
122
- "@types/react": "^19.1.2",
123
- "@types/react-dom": "^19.1.2",
124
- "@typescript-eslint/eslint-plugin": "^8.29.1",
125
- "@typescript-eslint/parser": "^8.29.1",
126
- "@vitejs/plugin-react": "^4.3.4",
127
- "@vitest/coverage-v8": "^3.1.1",
125
+ "@types/react": "^19.1.4",
126
+ "@types/react-dom": "^19.1.5",
127
+ "@typescript-eslint/eslint-plugin": "^8.32.1",
128
+ "@typescript-eslint/parser": "^8.32.1",
129
+ "@vitejs/plugin-react": "^4.4.1",
130
+ "@vitest/coverage-v8": "^3.1.3",
128
131
  "autoprefixer": "^10.4.21",
129
132
  "eslint": "^8.57.0",
130
133
  "eslint-plugin-react-hooks": "^4.6.2",
131
134
  "eslint-plugin-react-refresh": "^0.4.7",
132
135
  "eslint-plugin-storybook": "^0.9.0",
133
- "glob": "^11.0.1",
136
+ "glob": "^11.0.2",
134
137
  "husky": "^9.1.7",
135
138
  "jest-axe": "^10.0.0",
136
139
  "jsdom": "^26.1.0",
@@ -139,14 +142,14 @@
139
142
  "prettier": "^3.5.3",
140
143
  "rimraf": "^6.0.1",
141
144
  "storybook": "^8.6.12",
142
- "tailwindcss": "^4.1.4",
145
+ "tailwindcss": "^4.1.6",
143
146
  "ts-node": "^10.9.2",
144
147
  "typescript": "^5.8.3",
145
- "vite": "^6.2.6",
148
+ "vite": "^6.3.5",
146
149
  "vite-plugin-dts": "^4.5.3",
147
150
  "vite-plugin-lib-inject-css": "^2.2.2",
148
151
  "vite-plugin-svgr": "^4.3.0",
149
152
  "vite-tsconfig-paths": "^5.1.4",
150
- "vitest": "^3.1.1"
153
+ "vitest": "^3.1.3"
151
154
  }
152
155
  }
@@ -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,82 +0,0 @@
1
- import * as i from "react";
2
- import { jsx as f, Fragment as g } from "react/jsx-runtime";
3
- function d(e, n) {
4
- if (typeof e == "function")
5
- return e(n);
6
- e != null && (e.current = n);
7
- }
8
- function m(...e) {
9
- return (n) => {
10
- let r = !1;
11
- const o = e.map((t) => {
12
- const l = d(t, n);
13
- return !r && typeof l == "function" && (r = !0), l;
14
- });
15
- if (r)
16
- return () => {
17
- for (let t = 0; t < o.length; t++) {
18
- const l = o[t];
19
- typeof l == "function" ? l() : d(e[t], null);
20
- }
21
- };
22
- };
23
- }
24
- function x(...e) {
25
- return i.useCallback(m(...e), e);
26
- }
27
- // @__NO_SIDE_EFFECTS__
28
- function C(e) {
29
- const n = /* @__PURE__ */ b(e), r = i.forwardRef((o, t) => {
30
- const { children: l, ...a } = o, s = i.Children.toArray(l), u = s.find(E);
31
- if (u) {
32
- const c = u.props.children, S = s.map((p) => p === u ? i.Children.count(c) > 1 ? i.Children.only(null) : i.isValidElement(c) ? c.props.children : null : p);
33
- return /* @__PURE__ */ f(n, { ...a, ref: t, children: i.isValidElement(c) ? i.cloneElement(c, void 0, S) : null });
34
- }
35
- return /* @__PURE__ */ f(n, { ...a, ref: t, children: l });
36
- });
37
- return r.displayName = `${e}.Slot`, r;
38
- }
39
- var I = /* @__PURE__ */ C("Slot");
40
- // @__NO_SIDE_EFFECTS__
41
- function b(e) {
42
- const n = i.forwardRef((r, o) => {
43
- const { children: t, ...l } = r;
44
- if (i.isValidElement(t)) {
45
- const a = h(t), s = R(l, t.props);
46
- return t.type !== i.Fragment && (s.ref = o ? m(o, a) : a), i.cloneElement(t, s);
47
- }
48
- return i.Children.count(t) > 1 ? i.Children.only(null) : null;
49
- });
50
- return n.displayName = `${e}.SlotClone`, n;
51
- }
52
- var y = Symbol("radix.slottable");
53
- // @__NO_SIDE_EFFECTS__
54
- function V(e) {
55
- const n = ({ children: r }) => /* @__PURE__ */ f(g, { children: r });
56
- return n.displayName = `${e}.Slottable`, n.__radixId = y, n;
57
- }
58
- function E(e) {
59
- return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === y;
60
- }
61
- function R(e, n) {
62
- const r = { ...n };
63
- for (const o in n) {
64
- const t = e[o], l = n[o];
65
- /^on[A-Z]/.test(o) ? t && l ? r[o] = (...s) => {
66
- l(...s), t(...s);
67
- } : t && (r[o] = t) : o === "style" ? r[o] = { ...t, ...l } : o === "className" && (r[o] = [t, l].filter(Boolean).join(" "));
68
- }
69
- return { ...e, ...r };
70
- }
71
- function h(e) {
72
- var o, t;
73
- let n = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning;
74
- return r ? e.ref : (n = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
75
- }
76
- export {
77
- I as S,
78
- m as a,
79
- V as b,
80
- C as c,
81
- x as u
82
- };
@@ -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
- };