@adamosuiteservices/ui 2.14.2 → 2.15.1

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 (41) hide show
  1. package/dist/combobox-DGuQtXjP.js +608 -0
  2. package/dist/combobox-hTCtPMUL.cjs +40 -0
  3. package/dist/combobox.cjs +1 -1
  4. package/dist/combobox.js +1 -1
  5. package/dist/components/ui/combobox/combobox.d.ts +5 -1
  6. package/dist/components/ui/date-picker-selector/date-picker-selector.d.ts +5 -1
  7. package/dist/components/ui/file-upload/file-upload.d.ts +4 -1
  8. package/dist/components/ui/slider/slider.d.ts +1 -1
  9. package/dist/components/ui/switch/switch.d.ts +1 -1
  10. package/dist/date-picker-selector.cjs +1 -1
  11. package/dist/date-picker-selector.js +38 -28
  12. package/dist/field.cjs +2 -2
  13. package/dist/field.js +2 -2
  14. package/dist/file-upload.cjs +5 -3
  15. package/dist/file-upload.js +191 -150
  16. package/dist/slider.cjs +5 -5
  17. package/dist/slider.js +196 -177
  18. package/dist/styles.css +1 -1
  19. package/dist/switch.cjs +3 -3
  20. package/dist/switch.js +105 -85
  21. package/docs/components/ui/accordion-rounded.md +2 -6
  22. package/docs/components/ui/avatar.md +3 -1
  23. package/docs/components/ui/button.md +22 -16
  24. package/docs/components/ui/card.md +49 -31
  25. package/docs/components/ui/checkbox.md +44 -8
  26. package/docs/components/ui/combobox.md +62 -4
  27. package/docs/components/ui/date-picker-selector.md +90 -26
  28. package/docs/components/ui/file-upload.md +364 -95
  29. package/docs/components/ui/icon.md +1 -1
  30. package/docs/components/ui/input.md +4 -1
  31. package/docs/components/ui/radio-group.md +1 -1
  32. package/docs/components/ui/select.md +51 -34
  33. package/docs/components/ui/sheet.md +3 -9
  34. package/docs/components/ui/slider.md +120 -99
  35. package/docs/components/ui/switch.md +408 -408
  36. package/docs/components/ui/textarea.md +37 -22
  37. package/docs/components/ui/tooltip.md +5 -2
  38. package/docs/components/ui/typography.md +63 -39
  39. package/package.json +1 -1
  40. package/dist/combobox-CCJGIMFQ.cjs +0 -40
  41. package/dist/combobox-Cj-GEp-T.js +0 -604
package/dist/slider.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { j as u } from "./jsx-runtime-BzflLqGi.js";
2
+ import { j as h } from "./jsx-runtime-BzflLqGi.js";
3
3
  import * as l from "react";
4
4
  import { c as Y } from "./index-rKs9bXHr.js";
5
5
  import { u as le, c as _ } from "./index-C0UREtMP.js";
6
6
  import { u as M } from "./index-DLcqcWxM.js";
7
7
  import { c as ce } from "./index-FxyLF8MY.js";
8
- import { c as ue, u as me } from "./index-CmWhhuj7.js";
9
- import { u as fe } from "./index-BZPx6jYI.js";
8
+ import { c as ue, u as fe } from "./index-CmWhhuj7.js";
9
+ import { u as me } from "./index-BZPx6jYI.js";
10
10
  import { u as he } from "./index-BGQepRFJ.js";
11
- import { P as I } from "./index-BMWt1NBG.js";
11
+ import { P as K } from "./index-BMWt1NBG.js";
12
12
  import { c as N } from "./index-CRiPKpXj.js";
13
13
  var X = ["PageUp", "PageDown"], G = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], W = {
14
14
  "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
@@ -22,85 +22,85 @@ var X = ["PageUp", "PageDown"], G = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arrow
22
22
  const {
23
23
  name: n,
24
24
  min: o = 0,
25
- max: i = 100,
25
+ max: a = 100,
26
26
  step: d = 1,
27
27
  orientation: r = "horizontal",
28
28
  disabled: s = !1,
29
- minStepsBetweenThumbs: c = 0,
30
- defaultValue: g = [o],
31
- value: h,
32
- onValueChange: a = () => {
29
+ minStepsBetweenThumbs: m = 0,
30
+ defaultValue: v = [o],
31
+ value: S,
32
+ onValueChange: i = () => {
33
33
  },
34
- onValueCommit: m = () => {
34
+ onValueCommit: u = () => {
35
35
  },
36
- inverted: w = !1,
36
+ inverted: g = !1,
37
37
  form: y,
38
- ...v
39
- } = e, p = l.useRef(/* @__PURE__ */ new Set()), f = l.useRef(0), b = r === "horizontal" ? ve : we, [S = [], A] = le({
40
- prop: h,
41
- defaultProp: g,
38
+ ...p
39
+ } = e, f = l.useRef(/* @__PURE__ */ new Set()), c = l.useRef(0), w = r === "horizontal" ? be : ve, [b = [], A] = le({
40
+ prop: S,
41
+ defaultProp: v,
42
42
  onChange: (x) => {
43
- [...p.current][f.current]?.focus(), a(x);
43
+ [...f.current][c.current]?.focus(), i(x);
44
44
  }
45
- }), B = l.useRef(S);
45
+ }), B = l.useRef(b);
46
46
  function T(x) {
47
- const R = Pe(S, x);
47
+ const R = Pe(b, x);
48
48
  j(x, R);
49
49
  }
50
50
  function se(x) {
51
- j(x, f.current);
51
+ j(x, c.current);
52
52
  }
53
53
  function de() {
54
- const x = B.current[f.current];
55
- S[f.current] !== x && m(S);
54
+ const x = B.current[c.current];
55
+ b[c.current] !== x && u(b);
56
56
  }
57
57
  function j(x, R, { commit: V } = { commit: !1 }) {
58
- const F = Me(d), z = Ce(Math.round((x - o) / d) * d + o, F), K = Y(z, [o, i]);
58
+ const U = Me(d), z = Ce(Math.round((x - o) / d) * d + o, U), I = Y(z, [o, a]);
59
59
  A((E = []) => {
60
- const P = ye(E, K, R);
61
- if (_e(P, c * d)) {
62
- f.current = P.indexOf(K);
60
+ const P = ye(E, I, R);
61
+ if (_e(P, m * d)) {
62
+ c.current = P.indexOf(I);
63
63
  const $ = String(P) !== String(E);
64
- return $ && V && m(P), $ ? P : E;
64
+ return $ && V && u(P), $ ? P : E;
65
65
  } else
66
66
  return E;
67
67
  });
68
68
  }
69
- return /* @__PURE__ */ u.jsx(
69
+ return /* @__PURE__ */ h.jsx(
70
70
  ge,
71
71
  {
72
72
  scope: e.__scopeSlider,
73
73
  name: n,
74
74
  disabled: s,
75
75
  min: o,
76
- max: i,
77
- valueIndexToChangeRef: f,
78
- thumbs: p.current,
79
- values: S,
76
+ max: a,
77
+ valueIndexToChangeRef: c,
78
+ thumbs: f.current,
79
+ values: b,
80
80
  orientation: r,
81
81
  form: y,
82
- children: /* @__PURE__ */ u.jsx(H.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ u.jsx(H.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ u.jsx(
83
- b,
82
+ children: /* @__PURE__ */ h.jsx(H.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ h.jsx(H.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ h.jsx(
83
+ w,
84
84
  {
85
85
  "aria-disabled": s,
86
86
  "data-disabled": s ? "" : void 0,
87
- ...v,
87
+ ...p,
88
88
  ref: t,
89
- onPointerDown: _(v.onPointerDown, () => {
90
- s || (B.current = S);
89
+ onPointerDown: _(p.onPointerDown, () => {
90
+ s || (B.current = b);
91
91
  }),
92
92
  min: o,
93
- max: i,
94
- inverted: w,
93
+ max: a,
94
+ inverted: g,
95
95
  onSlideStart: s ? void 0 : T,
96
96
  onSlideMove: s ? void 0 : se,
97
97
  onSlideEnd: s ? void 0 : de,
98
98
  onHomeKeyDown: () => !s && j(o, 0, { commit: !0 }),
99
- onEndKeyDown: () => !s && j(i, S.length - 1, { commit: !0 }),
99
+ onEndKeyDown: () => !s && j(a, b.length - 1, { commit: !0 }),
100
100
  onStepKeyDown: ({ event: x, direction: R }) => {
101
101
  if (!s) {
102
- const z = X.includes(x.key) || x.shiftKey && G.includes(x.key) ? 10 : 1, K = f.current, E = S[K], P = d * z * R;
103
- j(E + P, K, { commit: !0 });
102
+ const z = X.includes(x.key) || x.shiftKey && G.includes(x.key) ? 10 : 1, I = c.current, E = b[I], P = d * z * R;
103
+ j(E + P, I, { commit: !0 });
104
104
  }
105
105
  }
106
106
  }
@@ -115,110 +115,110 @@ var [Q, Z] = q(C, {
115
115
  endEdge: "right",
116
116
  size: "width",
117
117
  direction: 1
118
- }), ve = l.forwardRef(
118
+ }), be = l.forwardRef(
119
119
  (e, t) => {
120
120
  const {
121
121
  min: n,
122
122
  max: o,
123
- dir: i,
123
+ dir: a,
124
124
  inverted: d,
125
125
  onSlideStart: r,
126
126
  onSlideMove: s,
127
- onSlideEnd: c,
128
- onStepKeyDown: g,
129
- ...h
130
- } = e, [a, m] = l.useState(null), w = M(t, (b) => m(b)), y = l.useRef(void 0), v = me(i), p = v === "ltr", f = p && !d || !p && d;
131
- function D(b) {
132
- const S = y.current || a.getBoundingClientRect(), A = [0, S.width], T = U(A, f ? [n, o] : [o, n]);
133
- return y.current = S, T(b - S.left);
127
+ onSlideEnd: m,
128
+ onStepKeyDown: v,
129
+ ...S
130
+ } = e, [i, u] = l.useState(null), g = M(t, (w) => u(w)), y = l.useRef(void 0), p = fe(a), f = p === "ltr", c = f && !d || !f && d;
131
+ function D(w) {
132
+ const b = y.current || i.getBoundingClientRect(), A = [0, b.width], T = L(A, c ? [n, o] : [o, n]);
133
+ return y.current = b, T(w - b.left);
134
134
  }
135
- return /* @__PURE__ */ u.jsx(
135
+ return /* @__PURE__ */ h.jsx(
136
136
  Q,
137
137
  {
138
138
  scope: e.__scopeSlider,
139
- startEdge: f ? "left" : "right",
140
- endEdge: f ? "right" : "left",
141
- direction: f ? 1 : -1,
139
+ startEdge: c ? "left" : "right",
140
+ endEdge: c ? "right" : "left",
141
+ direction: c ? 1 : -1,
142
142
  size: "width",
143
- children: /* @__PURE__ */ u.jsx(
143
+ children: /* @__PURE__ */ h.jsx(
144
144
  ee,
145
145
  {
146
- dir: v,
146
+ dir: p,
147
147
  "data-orientation": "horizontal",
148
- ...h,
149
- ref: w,
148
+ ...S,
149
+ ref: g,
150
150
  style: {
151
- ...h.style,
151
+ ...S.style,
152
152
  "--radix-slider-thumb-transform": "translateX(-50%)"
153
153
  },
154
- onSlideStart: (b) => {
155
- const S = D(b.clientX);
156
- r?.(S);
154
+ onSlideStart: (w) => {
155
+ const b = D(w.clientX);
156
+ r?.(b);
157
157
  },
158
- onSlideMove: (b) => {
159
- const S = D(b.clientX);
160
- s?.(S);
158
+ onSlideMove: (w) => {
159
+ const b = D(w.clientX);
160
+ s?.(b);
161
161
  },
162
162
  onSlideEnd: () => {
163
- y.current = void 0, c?.();
163
+ y.current = void 0, m?.();
164
164
  },
165
- onStepKeyDown: (b) => {
166
- const A = W[f ? "from-left" : "from-right"].includes(b.key);
167
- g?.({ event: b, direction: A ? -1 : 1 });
165
+ onStepKeyDown: (w) => {
166
+ const A = W[c ? "from-left" : "from-right"].includes(w.key);
167
+ v?.({ event: w, direction: A ? -1 : 1 });
168
168
  }
169
169
  }
170
170
  )
171
171
  }
172
172
  );
173
173
  }
174
- ), we = l.forwardRef(
174
+ ), ve = l.forwardRef(
175
175
  (e, t) => {
176
176
  const {
177
177
  min: n,
178
178
  max: o,
179
- inverted: i,
179
+ inverted: a,
180
180
  onSlideStart: d,
181
181
  onSlideMove: r,
182
182
  onSlideEnd: s,
183
- onStepKeyDown: c,
184
- ...g
185
- } = e, h = l.useRef(null), a = M(t, h), m = l.useRef(void 0), w = !i;
186
- function y(v) {
187
- const p = m.current || h.current.getBoundingClientRect(), f = [0, p.height], b = U(f, w ? [o, n] : [n, o]);
188
- return m.current = p, b(v - p.top);
183
+ onStepKeyDown: m,
184
+ ...v
185
+ } = e, S = l.useRef(null), i = M(t, S), u = l.useRef(void 0), g = !a;
186
+ function y(p) {
187
+ const f = u.current || S.current.getBoundingClientRect(), c = [0, f.height], w = L(c, g ? [o, n] : [n, o]);
188
+ return u.current = f, w(p - f.top);
189
189
  }
190
- return /* @__PURE__ */ u.jsx(
190
+ return /* @__PURE__ */ h.jsx(
191
191
  Q,
192
192
  {
193
193
  scope: e.__scopeSlider,
194
- startEdge: w ? "bottom" : "top",
195
- endEdge: w ? "top" : "bottom",
194
+ startEdge: g ? "bottom" : "top",
195
+ endEdge: g ? "top" : "bottom",
196
196
  size: "height",
197
- direction: w ? 1 : -1,
198
- children: /* @__PURE__ */ u.jsx(
197
+ direction: g ? 1 : -1,
198
+ children: /* @__PURE__ */ h.jsx(
199
199
  ee,
200
200
  {
201
201
  "data-orientation": "vertical",
202
- ...g,
203
- ref: a,
202
+ ...v,
203
+ ref: i,
204
204
  style: {
205
- ...g.style,
205
+ ...v.style,
206
206
  "--radix-slider-thumb-transform": "translateY(50%)"
207
207
  },
208
- onSlideStart: (v) => {
209
- const p = y(v.clientY);
210
- d?.(p);
208
+ onSlideStart: (p) => {
209
+ const f = y(p.clientY);
210
+ d?.(f);
211
211
  },
212
- onSlideMove: (v) => {
213
- const p = y(v.clientY);
214
- r?.(p);
212
+ onSlideMove: (p) => {
213
+ const f = y(p.clientY);
214
+ r?.(f);
215
215
  },
216
216
  onSlideEnd: () => {
217
- m.current = void 0, s?.();
217
+ u.current = void 0, s?.();
218
218
  },
219
- onStepKeyDown: (v) => {
220
- const f = W[w ? "from-bottom" : "from-top"].includes(v.key);
221
- c?.({ event: v, direction: f ? -1 : 1 });
219
+ onStepKeyDown: (p) => {
220
+ const c = W[g ? "from-bottom" : "from-top"].includes(p.key);
221
+ m?.({ event: p, direction: c ? -1 : 1 });
222
222
  }
223
223
  }
224
224
  )
@@ -230,43 +230,43 @@ var [Q, Z] = q(C, {
230
230
  const {
231
231
  __scopeSlider: n,
232
232
  onSlideStart: o,
233
- onSlideMove: i,
233
+ onSlideMove: a,
234
234
  onSlideEnd: d,
235
235
  onHomeKeyDown: r,
236
236
  onEndKeyDown: s,
237
- onStepKeyDown: c,
238
- ...g
239
- } = e, h = k(C, n);
240
- return /* @__PURE__ */ u.jsx(
241
- I.span,
237
+ onStepKeyDown: m,
238
+ ...v
239
+ } = e, S = k(C, n);
240
+ return /* @__PURE__ */ h.jsx(
241
+ K.span,
242
242
  {
243
- ...g,
243
+ ...v,
244
244
  ref: t,
245
- onKeyDown: _(e.onKeyDown, (a) => {
246
- a.key === "Home" ? (r(a), a.preventDefault()) : a.key === "End" ? (s(a), a.preventDefault()) : X.concat(G).includes(a.key) && (c(a), a.preventDefault());
245
+ onKeyDown: _(e.onKeyDown, (i) => {
246
+ i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (s(i), i.preventDefault()) : X.concat(G).includes(i.key) && (m(i), i.preventDefault());
247
247
  }),
248
- onPointerDown: _(e.onPointerDown, (a) => {
249
- const m = a.target;
250
- m.setPointerCapture(a.pointerId), a.preventDefault(), h.thumbs.has(m) ? m.focus() : o(a);
248
+ onPointerDown: _(e.onPointerDown, (i) => {
249
+ const u = i.target;
250
+ u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : o(i);
251
251
  }),
252
- onPointerMove: _(e.onPointerMove, (a) => {
253
- a.target.hasPointerCapture(a.pointerId) && i(a);
252
+ onPointerMove: _(e.onPointerMove, (i) => {
253
+ i.target.hasPointerCapture(i.pointerId) && a(i);
254
254
  }),
255
- onPointerUp: _(e.onPointerUp, (a) => {
256
- const m = a.target;
257
- m.hasPointerCapture(a.pointerId) && (m.releasePointerCapture(a.pointerId), d(a));
255
+ onPointerUp: _(e.onPointerUp, (i) => {
256
+ const u = i.target;
257
+ u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), d(i));
258
258
  })
259
259
  }
260
260
  );
261
261
  }
262
262
  ), te = "SliderTrack", ne = l.forwardRef(
263
263
  (e, t) => {
264
- const { __scopeSlider: n, ...o } = e, i = k(te, n);
265
- return /* @__PURE__ */ u.jsx(
266
- I.span,
264
+ const { __scopeSlider: n, ...o } = e, a = k(te, n);
265
+ return /* @__PURE__ */ h.jsx(
266
+ K.span,
267
267
  {
268
- "data-disabled": i.disabled ? "" : void 0,
269
- "data-orientation": i.orientation,
268
+ "data-disabled": a.disabled ? "" : void 0,
269
+ "data-orientation": a.orientation,
270
270
  ...o,
271
271
  ref: t
272
272
  }
@@ -274,79 +274,79 @@ var [Q, Z] = q(C, {
274
274
  }
275
275
  );
276
276
  ne.displayName = te;
277
- var L = "SliderRange", oe = l.forwardRef(
277
+ var F = "SliderRange", oe = l.forwardRef(
278
278
  (e, t) => {
279
- const { __scopeSlider: n, ...o } = e, i = k(L, n), d = Z(L, n), r = l.useRef(null), s = M(t, r), c = i.values.length, g = i.values.map(
280
- (m) => ae(m, i.min, i.max)
281
- ), h = c > 1 ? Math.min(...g) : 0, a = 100 - Math.max(...g);
282
- return /* @__PURE__ */ u.jsx(
283
- I.span,
279
+ const { __scopeSlider: n, ...o } = e, a = k(F, n), d = Z(F, n), r = l.useRef(null), s = M(t, r), m = a.values.length, v = a.values.map(
280
+ (u) => ae(u, a.min, a.max)
281
+ ), S = m > 1 ? Math.min(...v) : 0, i = 100 - Math.max(...v);
282
+ return /* @__PURE__ */ h.jsx(
283
+ K.span,
284
284
  {
285
- "data-orientation": i.orientation,
286
- "data-disabled": i.disabled ? "" : void 0,
285
+ "data-orientation": a.orientation,
286
+ "data-disabled": a.disabled ? "" : void 0,
287
287
  ...o,
288
288
  ref: s,
289
289
  style: {
290
290
  ...e.style,
291
- [d.startEdge]: h + "%",
292
- [d.endEdge]: a + "%"
291
+ [d.startEdge]: S + "%",
292
+ [d.endEdge]: i + "%"
293
293
  }
294
294
  }
295
295
  );
296
296
  }
297
297
  );
298
- oe.displayName = L;
298
+ oe.displayName = F;
299
299
  var O = "SliderThumb", re = l.forwardRef(
300
300
  (e, t) => {
301
- const n = pe(e.__scopeSlider), [o, i] = l.useState(null), d = M(t, (s) => i(s)), r = l.useMemo(
301
+ const n = pe(e.__scopeSlider), [o, a] = l.useState(null), d = M(t, (s) => a(s)), r = l.useMemo(
302
302
  () => o ? n().findIndex((s) => s.ref.current === o) : -1,
303
303
  [n, o]
304
304
  );
305
- return /* @__PURE__ */ u.jsx(be, { ...e, ref: d, index: r });
305
+ return /* @__PURE__ */ h.jsx(we, { ...e, ref: d, index: r });
306
306
  }
307
- ), be = l.forwardRef(
307
+ ), we = l.forwardRef(
308
308
  (e, t) => {
309
- const { __scopeSlider: n, index: o, name: i, ...d } = e, r = k(O, n), s = Z(O, n), [c, g] = l.useState(null), h = M(t, (D) => g(D)), a = c ? r.form || !!c.closest("form") : !0, m = he(c), w = r.values[o], y = w === void 0 ? 0 : ae(w, r.min, r.max), v = Re(o, r.values.length), p = m?.[s.size], f = p ? De(p, y, s.direction) : 0;
309
+ const { __scopeSlider: n, index: o, name: a, ...d } = e, r = k(O, n), s = Z(O, n), [m, v] = l.useState(null), S = M(t, (D) => v(D)), i = m ? r.form || !!m.closest("form") : !0, u = he(m), g = r.values[o], y = g === void 0 ? 0 : ae(g, r.min, r.max), p = Re(o, r.values.length), f = u?.[s.size], c = f ? De(f, y, s.direction) : 0;
310
310
  return l.useEffect(() => {
311
- if (c)
312
- return r.thumbs.add(c), () => {
313
- r.thumbs.delete(c);
311
+ if (m)
312
+ return r.thumbs.add(m), () => {
313
+ r.thumbs.delete(m);
314
314
  };
315
- }, [c, r.thumbs]), /* @__PURE__ */ u.jsxs(
315
+ }, [m, r.thumbs]), /* @__PURE__ */ h.jsxs(
316
316
  "span",
317
317
  {
318
318
  style: {
319
319
  transform: "var(--radix-slider-thumb-transform)",
320
320
  position: "absolute",
321
- [s.startEdge]: `calc(${y}% + ${f}px)`
321
+ [s.startEdge]: `calc(${y}% + ${c}px)`
322
322
  },
323
323
  children: [
324
- /* @__PURE__ */ u.jsx(H.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ u.jsx(
325
- I.span,
324
+ /* @__PURE__ */ h.jsx(H.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ h.jsx(
325
+ K.span,
326
326
  {
327
327
  role: "slider",
328
- "aria-label": e["aria-label"] || v,
328
+ "aria-label": e["aria-label"] || p,
329
329
  "aria-valuemin": r.min,
330
- "aria-valuenow": w,
330
+ "aria-valuenow": g,
331
331
  "aria-valuemax": r.max,
332
332
  "aria-orientation": r.orientation,
333
333
  "data-orientation": r.orientation,
334
334
  "data-disabled": r.disabled ? "" : void 0,
335
335
  tabIndex: r.disabled ? void 0 : 0,
336
336
  ...d,
337
- ref: h,
338
- style: w === void 0 ? { display: "none" } : e.style,
337
+ ref: S,
338
+ style: g === void 0 ? { display: "none" } : e.style,
339
339
  onFocus: _(e.onFocus, () => {
340
340
  r.valueIndexToChangeRef.current = o;
341
341
  })
342
342
  }
343
343
  ) }),
344
- a && /* @__PURE__ */ u.jsx(
344
+ i && /* @__PURE__ */ h.jsx(
345
345
  ie,
346
346
  {
347
- name: i ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
347
+ name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
348
348
  form: r.form,
349
- value: w
349
+ value: g
350
350
  },
351
351
  o
352
352
  )
@@ -358,17 +358,17 @@ var O = "SliderThumb", re = l.forwardRef(
358
358
  re.displayName = O;
359
359
  var xe = "RadioBubbleInput", ie = l.forwardRef(
360
360
  ({ __scopeSlider: e, value: t, ...n }, o) => {
361
- const i = l.useRef(null), d = M(i, o), r = fe(t);
361
+ const a = l.useRef(null), d = M(a, o), r = me(t);
362
362
  return l.useEffect(() => {
363
- const s = i.current;
363
+ const s = a.current;
364
364
  if (!s) return;
365
- const c = window.HTMLInputElement.prototype, h = Object.getOwnPropertyDescriptor(c, "value").set;
366
- if (r !== t && h) {
367
- const a = new Event("input", { bubbles: !0 });
368
- h.call(s, t), s.dispatchEvent(a);
365
+ const m = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(m, "value").set;
366
+ if (r !== t && S) {
367
+ const i = new Event("input", { bubbles: !0 });
368
+ S.call(s, t), s.dispatchEvent(i);
369
369
  }
370
- }, [r, t]), /* @__PURE__ */ u.jsx(
371
- I.input,
370
+ }, [r, t]), /* @__PURE__ */ h.jsx(
371
+ K.input,
372
372
  {
373
373
  style: { display: "none" },
374
374
  ...n,
@@ -381,7 +381,7 @@ var xe = "RadioBubbleInput", ie = l.forwardRef(
381
381
  ie.displayName = xe;
382
382
  function ye(e = [], t, n) {
383
383
  const o = [...e];
384
- return o[n] = t, o.sort((i, d) => i - d);
384
+ return o[n] = t, o.sort((a, d) => a - d);
385
385
  }
386
386
  function ae(e, t, n) {
387
387
  const d = 100 / (n - t) * (e - t);
@@ -392,11 +392,11 @@ function Re(e, t) {
392
392
  }
393
393
  function Pe(e, t) {
394
394
  if (e.length === 1) return 0;
395
- const n = e.map((i) => Math.abs(i - t)), o = Math.min(...n);
395
+ const n = e.map((a) => Math.abs(a - t)), o = Math.min(...n);
396
396
  return n.indexOf(o);
397
397
  }
398
398
  function De(e, t, n) {
399
- const o = e / 2, d = U([0, 50], [0, o]);
399
+ const o = e / 2, d = L([0, 50], [0, o]);
400
400
  return (o - d(t) * n) * n;
401
401
  }
402
402
  function Ee(e) {
@@ -409,7 +409,7 @@ function _e(e, t) {
409
409
  }
410
410
  return !0;
411
411
  }
412
- function U(e, t) {
412
+ function L(e, t) {
413
413
  return (n) => {
414
414
  if (e[0] === e[1] || t[0] === t[1]) return t[0];
415
415
  const o = (t[1] - t[0]) / (e[1] - e[0]);
@@ -423,21 +423,38 @@ function Ce(e, t) {
423
423
  const n = Math.pow(10, t);
424
424
  return Math.round(e * n) / n;
425
425
  }
426
- var Ae = J, je = ne, Ke = oe, Ie = re;
427
- function Fe({
426
+ var Ae = J, je = ne, Ie = oe, Ke = re;
427
+ function Ue({
428
428
  className: e,
429
429
  defaultValue: t,
430
430
  value: n,
431
431
  min: o = 0,
432
- max: i = 100,
432
+ max: a = 100,
433
433
  theme: d,
434
434
  colorSlide: r,
435
- ...s
435
+ disabled: s,
436
+ ...m
436
437
  }) {
437
- const c = l.useMemo(
438
- () => Array.isArray(n) ? n : Array.isArray(t) ? t : [o, i],
439
- [n, t, o, i]
440
- ), g = l.useMemo(() => {
438
+ const [v, S] = l.useState(!1), i = l.useRef(null);
439
+ l.useEffect(() => {
440
+ const p = () => {
441
+ if (i.current) {
442
+ const c = i.current.closest("fieldset");
443
+ S(c?.disabled ?? !1);
444
+ }
445
+ };
446
+ p();
447
+ const f = new MutationObserver(p);
448
+ if (i.current) {
449
+ const c = i.current.closest("fieldset");
450
+ c && f.observe(c, { attributes: !0, attributeFilter: ["disabled"] });
451
+ }
452
+ return () => f.disconnect();
453
+ }, []);
454
+ const u = s || v, g = l.useMemo(
455
+ () => Array.isArray(n) ? n : Array.isArray(t) ? t : [o, a],
456
+ [n, t, o, a]
457
+ ), y = l.useMemo(() => {
441
458
  if (r) {
442
459
  if (r === "full")
443
460
  return {
@@ -449,15 +466,17 @@ function Fe({
449
466
  };
450
467
  }
451
468
  }, [r]);
452
- return /* @__PURE__ */ u.jsxs(
469
+ return /* @__PURE__ */ h.jsxs(
453
470
  Ae,
454
471
  {
472
+ ref: i,
455
473
  "data-slot": "slider",
456
474
  "data-theme": d,
457
475
  defaultValue: t,
458
476
  value: n,
459
477
  min: o,
460
- max: i,
478
+ max: a,
479
+ disabled: u,
461
480
  className: N(
462
481
  `
463
482
  adm:relative adm:flex adm:w-full adm:touch-none adm:items-center
@@ -470,9 +489,9 @@ function Fe({
470
489
  `,
471
490
  e
472
491
  ),
473
- ...s,
492
+ ...m,
474
493
  children: [
475
- /* @__PURE__ */ u.jsx(
494
+ /* @__PURE__ */ h.jsx(
476
495
  je,
477
496
  {
478
497
  "data-slot": "slider-track",
@@ -486,9 +505,9 @@ function Fe({
486
505
  `,
487
506
  r ? "" : "adm:bg-muted"
488
507
  ),
489
- style: r ? g : void 0,
490
- children: /* @__PURE__ */ u.jsx(
491
- Ke,
508
+ style: r ? y : void 0,
509
+ children: /* @__PURE__ */ h.jsx(
510
+ Ie,
492
511
  {
493
512
  "data-slot": "slider-range",
494
513
  className: N(
@@ -503,8 +522,8 @@ function Fe({
503
522
  )
504
523
  }
505
524
  ),
506
- Array.from({ length: c.length }, (h, a) => /* @__PURE__ */ u.jsx(
507
- Ie,
525
+ Array.from({ length: g.length }, (p, f) => /* @__PURE__ */ h.jsx(
526
+ Ke,
508
527
  {
509
528
  "data-slot": "slider-thumb",
510
529
  className: `
@@ -516,12 +535,12 @@ function Fe({
516
535
  adm:disabled:pointer-events-none adm:disabled:opacity-50
517
536
  `
518
537
  },
519
- a
538
+ f
520
539
  ))
521
540
  ]
522
541
  }
523
542
  );
524
543
  }
525
544
  export {
526
- Fe as Slider
545
+ Ue as Slider
527
546
  };