asheeui 0.6.10 → 0.6.12

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 (29) hide show
  1. package/dist/components/accordion/Accordion.js +7 -7
  2. package/dist/components/autocomplete/Autocomplete.d.ts +5 -5
  3. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  4. package/dist/components/autocomplete/Autocomplete.js +41 -40
  5. package/dist/components/carousel/Carousel.js +43 -43
  6. package/dist/components/chip/Chip.js +8 -8
  7. package/dist/components/date-picker/DatePicker.d.ts +6 -5
  8. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  9. package/dist/components/date-picker/DatePicker.js +87 -87
  10. package/dist/components/marquee/Marquee.js +22 -22
  11. package/dist/components/multi-select/MultiSelect.d.ts +5 -5
  12. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  13. package/dist/components/multi-select/MultiSelect.js +44 -43
  14. package/dist/components/select/Select.d.ts +5 -5
  15. package/dist/components/select/Select.d.ts.map +1 -1
  16. package/dist/components/select/Select.js +53 -52
  17. package/dist/components/select-menu/SelectMenu.d.ts +15 -3
  18. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  19. package/dist/components/select-menu/SelectMenu.js +144 -116
  20. package/dist/components/select-menu/use-select-floating.d.ts +5 -2
  21. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
  22. package/dist/components/select-menu/use-select-floating.js +14 -7
  23. package/dist/components/toast/ToastItem.js +30 -30
  24. package/dist/components/toast/ToastProvider.d.ts +5 -5
  25. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  26. package/dist/components/toast/ToastProvider.js +66 -66
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/package.json +3 -20
@@ -1,192 +1,192 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as g, Fragment as de } from "react/jsx-runtime";
3
- import { useClick as me, useDismiss as fe, useRole as pe, useInteractions as ve, FloatingFocusManager as ye } from "@floating-ui/react";
4
- import { forwardRef as Ie, useId as Pe, useState as h, useRef as Re, useEffect as Se, useCallback as d } from "react";
5
- import { createPortal as Fe } from "react-dom";
6
- import { CalendarIcon as Ne } from "../../icons/CalendarIcon.js";
7
- import { ClearIcon as xe } from "../../icons/ClearIcon.js";
8
- import { ClockIcon as Ae } from "../../icons/ClockIcon.js";
9
- import { useAsheeConfig as De } from "../../libs/context.js";
10
- import { resolveCascade as m, resolveRadiusKey as Ke, resolveClassKey as we } from "../../utils/resolve-token.js";
11
- import { Input as Ee } from "../input/Input.js";
12
- import { Calendar as _e } from "./Calendar.js";
13
- import { formatDisplay as I, parseDateString as Le, getNewCursorPosition as Te, getDefaultPlaceholder as ze } from "./date-picker.helpers.js";
2
+ import { jsx as r, jsxs as h, Fragment as me } from "react/jsx-runtime";
3
+ import { useClick as fe, useDismiss as pe, useRole as ve, useInteractions as ye, FloatingFocusManager as Ie, FloatingPortal as Pe } from "@floating-ui/react";
4
+ import { forwardRef as Re, useId as Se, useState as M, useRef as Fe, useEffect as Ne, useCallback as d } from "react";
5
+ import { CalendarIcon as xe } from "../../icons/CalendarIcon.js";
6
+ import { ClearIcon as Ae } from "../../icons/ClearIcon.js";
7
+ import { ClockIcon as De } from "../../icons/ClockIcon.js";
8
+ import { useAsheeConfig as Ke } from "../../libs/context.js";
9
+ import { resolveCascade as m, resolveRadiusKey as we, resolveClassKey as Ee } from "../../utils/resolve-token.js";
10
+ import { Input as _e } from "../input/Input.js";
11
+ import { Calendar as Le } from "./Calendar.js";
12
+ import { formatDisplay as I, parseDateString as Te, getNewCursorPosition as ze, getDefaultPlaceholder as Oe } from "./date-picker.helpers.js";
14
13
  import { FALLBACK_DATE_PICKER_CONFIG as f } from "./date-picker-config.js";
15
- import { RADIUS_CLASS as Oe } from "../../shared/radius.js";
16
- import { useSelectFloating as be } from "../select-menu/use-select-floating.js";
17
- import { cn as Me } from "../../utils/cn.js";
18
- import { FALLBACK_SELECT_MENU_CONFIG as Ve } from "../select-menu/select-menu-config.js";
19
- const ge = Ie(
14
+ import { RADIUS_CLASS as be } from "../../shared/radius.js";
15
+ import { useSelectFloating as ge } from "../select-menu/use-select-floating.js";
16
+ import { cn as he } from "../../utils/cn.js";
17
+ import { FALLBACK_SELECT_MENU_CONFIG as Me } from "../select-menu/select-menu-config.js";
18
+ const Ve = Re(
20
19
  ({
21
- selected: r,
20
+ selected: l,
22
21
  onChange: t,
23
- mode: j,
22
+ mode: V,
24
23
  isClearable: x = !1,
25
- disableFuture: B = !1,
26
- placeholder: G,
24
+ disableFuture: j = !1,
25
+ placeholder: B,
27
26
  size: A,
28
27
  radius: P,
29
28
  color: D,
30
29
  disabled: u,
31
- picker: l,
30
+ picker: a,
32
31
  ...K
33
32
  }, c) => {
34
- var T, z, O;
35
- const R = De(), e = (T = R.components) == null ? void 0 : T.datePicker, U = Pe(), W = K.id ?? U, [p, v] = h(!1), [S, a] = h(""), w = Re(null), s = m(
36
- j,
33
+ var L, T, z;
34
+ const R = Ke(), e = (L = R.components) == null ? void 0 : L.datePicker, G = Se(), U = K.id ?? G, [p, v] = M(!1), [S, n] = M(""), w = Fe(null), s = m(
35
+ V,
37
36
  e == null ? void 0 : e.mode,
38
37
  void 0,
39
38
  f.mode
40
- ), q = m(
41
- l == null ? void 0 : l.portal,
42
- (z = e == null ? void 0 : e.picker) == null ? void 0 : z.portal,
39
+ ), W = m(
40
+ a == null ? void 0 : a.portal,
41
+ (T = e == null ? void 0 : e.picker) == null ? void 0 : T.portal,
43
42
  void 0,
44
- Ve.portal
45
- ), H = m(
46
- l == null ? void 0 : l.portalTarget,
47
- (O = e == null ? void 0 : e.picker) == null ? void 0 : O.portalTarget,
43
+ Me.portal
44
+ ), q = m(
45
+ a == null ? void 0 : a.portalTarget,
46
+ (z = e == null ? void 0 : e.picker) == null ? void 0 : z.portalTarget,
48
47
  void 0,
49
48
  null
50
- ), J = m(
49
+ ), H = m(
51
50
  A,
52
51
  e == null ? void 0 : e.size,
53
52
  void 0,
54
53
  f.size
55
- ), Q = m(
54
+ ), J = m(
56
55
  D,
57
56
  e == null ? void 0 : e.color,
58
57
  R.defaultColor,
59
58
  f.color
60
- ), E = Ke(
59
+ ), E = we(
61
60
  typeof P == "string" ? P : void 0,
62
61
  typeof (e == null ? void 0 : e.radius) == "string" ? e.radius : void 0,
63
62
  R.defaultRadius,
64
63
  f.radius
65
- ), X = we(
64
+ ), Q = Ee(
66
65
  E === "full" ? "xl" : E,
67
- Oe,
66
+ be,
68
67
  f.radius
69
- ), { refs: F, floatingStyles: Y, context: y } = be({
68
+ ), { refs: F, floatingStyles: X, context: y, isPositioned: Y } = ge({
70
69
  isOpen: p,
71
70
  onOpenChange: v,
72
71
  disabled: u,
73
72
  matchReferenceWidth: !1
74
73
  // Allow calendar to size naturally side-by-side
75
- }), Z = me(y, { enabled: !u }), $ = fe(y, {
74
+ }), Z = fe(y, { enabled: !u }), $ = pe(y, {
76
75
  enabled: !u,
77
76
  outsidePress: !0,
78
77
  outsidePressEvent: "mousedown",
79
78
  escapeKey: !0
80
- }), C = pe(y, { role: "dialog" }), { getReferenceProps: k, getFloatingProps: ee } = ve([
79
+ }), C = ve(y, { role: "dialog" }), { getReferenceProps: k, getFloatingProps: ee } = ye([
81
80
  Z,
82
81
  $,
83
82
  C
84
83
  ]);
85
- Se(() => {
86
- a(r ? I(r, s) : "");
87
- }, [r, s]);
84
+ Ne(() => {
85
+ n(l ? I(l, s) : "");
86
+ }, [l, s]);
88
87
  const te = d(
89
88
  (o) => {
90
- t == null || t(o), a(o ? I(o, s) : ""), (s === "date" || o === null) && v(!1);
89
+ t == null || t(o), n(o ? I(o, s) : ""), (s === "date" || o === null) && v(!1);
91
90
  },
92
91
  [t, s]
93
92
  ), oe = d(() => v(!1), []), se = d(
94
93
  (o) => {
95
94
  var i;
96
- o.stopPropagation(), t == null || t(null), a(""), v(!1), (i = w.current) == null || i.focus();
95
+ o.stopPropagation(), t == null || t(null), n(""), v(!1), (i = w.current) == null || i.focus();
97
96
  },
98
97
  [t]
99
98
  ), re = d(
100
99
  (o) => {
101
- const i = o.target, ie = i.value, ue = S, ce = i.selectionStart ?? 0, b = ie.replace(/\D/g, "");
102
- if (b.length === 0) {
103
- a(""), t == null || t(null);
100
+ const i = o.target, ue = i.value, ce = S, de = i.selectionStart ?? 0, O = ue.replace(/\D/g, "");
101
+ if (O.length === 0) {
102
+ n(""), t == null || t(null);
104
103
  return;
105
104
  }
106
- const N = Le(
107
- b,
105
+ const N = Te(
106
+ O,
108
107
  s,
109
- r ?? void 0
108
+ l ?? void 0
110
109
  );
111
110
  if (N) {
112
111
  t == null || t(N);
113
- const M = I(N, s);
114
- a(M);
115
- const V = Te(
116
- ue,
117
- M,
118
- ce
112
+ const b = I(N, s);
113
+ n(b);
114
+ const g = ze(
115
+ ce,
116
+ b,
117
+ de
119
118
  );
120
119
  requestAnimationFrame(() => {
121
- i.setSelectionRange(V, V);
120
+ i.setSelectionRange(g, g);
122
121
  });
123
122
  } else
124
- a(r ? I(r, s) : "");
123
+ n(l ? I(l, s) : "");
125
124
  },
126
- [s, r, t, S]
127
- ), le = G ?? ze(s), ae = /* @__PURE__ */ g(de, { children: [
128
- x && r && !u && /* @__PURE__ */ n(
125
+ [s, l, t, S]
126
+ ), le = B ?? Oe(s), ae = /* @__PURE__ */ h(me, { children: [
127
+ x && l && !u && /* @__PURE__ */ r(
129
128
  "button",
130
129
  {
131
130
  type: "button",
132
131
  onClick: se,
133
132
  "aria-label": "Clear selection",
134
133
  className: "p-0.5 rounded text-foreground/70 hover:text-foreground transition-colors",
135
- children: /* @__PURE__ */ n(xe, { className: "size-3.5" })
134
+ children: /* @__PURE__ */ r(Ae, { className: "size-3.5" })
136
135
  }
137
136
  ),
138
- /* @__PURE__ */ n("span", { className: "text-foreground/70 pointer-events-none", children: s === "time" ? /* @__PURE__ */ n(Ae, {}) : /* @__PURE__ */ n(Ne, {}) })
139
- ] }), _ = p ? /* @__PURE__ */ n(
140
- ye,
137
+ /* @__PURE__ */ r("span", { className: "text-foreground/70 pointer-events-none", children: s === "time" ? /* @__PURE__ */ r(De, {}) : /* @__PURE__ */ r(xe, {}) })
138
+ ] }), _ = p ? /* @__PURE__ */ r(
139
+ Ie,
141
140
  {
142
141
  context: y,
143
142
  modal: !1,
144
143
  initialFocus: -1,
145
144
  returnFocus: !1,
146
- children: /* @__PURE__ */ n(
145
+ children: /* @__PURE__ */ r(
147
146
  "div",
148
147
  {
149
148
  ref: F.setFloating,
150
149
  style: {
151
- ...Y,
150
+ ...X,
152
151
  width: "max-content",
153
152
  minWidth: "fit-content"
154
153
  },
155
- className: Me(
156
- "z-100 outline-none animate-in fade-in-0 zoom-in-95 duration-150 ease-out",
157
- l == null ? void 0 : l.className
154
+ className: he(
155
+ "z-100 outline-none",
156
+ Y ? "animate-in fade-in-0 zoom-in-95 duration-150 ease-out" : "invisible opacity-0 pointer-events-none",
157
+ a == null ? void 0 : a.className
158
158
  ),
159
159
  ...ee(),
160
- children: /* @__PURE__ */ n(
161
- _e,
160
+ children: /* @__PURE__ */ r(
161
+ Le,
162
162
  {
163
- selected: r,
163
+ selected: l,
164
164
  mode: s,
165
165
  isClearable: x,
166
- resolvedSizeKey: J,
166
+ resolvedSizeKey: H,
167
167
  onSelect: te,
168
168
  onClose: oe,
169
- disableFuture: B,
170
- resolvedColor: Q,
171
- radiusClass: X
169
+ disableFuture: j,
170
+ resolvedColor: J,
171
+ radiusClass: Q
172
172
  }
173
173
  )
174
174
  }
175
175
  )
176
176
  }
177
- ) : null, L = H ?? (typeof document < "u" ? document.body : null), ne = d(
177
+ ) : null, ne = q ?? (typeof document < "u" ? document.body : null), ie = d(
178
178
  (o) => {
179
179
  o && (F.setReference(o), w.current = o, typeof c == "function" ? c(o) : c && (c.current = o));
180
180
  },
181
181
  [F, c]
182
182
  );
183
- return /* @__PURE__ */ g("div", { className: "w-full relative inline-block", children: [
184
- /* @__PURE__ */ n(
185
- Ee,
183
+ return /* @__PURE__ */ h("div", { className: "w-full relative inline-block", children: [
184
+ /* @__PURE__ */ r(
185
+ _e,
186
186
  {
187
187
  ...K,
188
- ref: ne,
189
- id: W,
188
+ ref: ie,
189
+ id: U,
190
190
  size: A,
191
191
  radius: P,
192
192
  color: D,
@@ -200,11 +200,11 @@ const ge = Ie(
200
200
  ...k()
201
201
  }
202
202
  ),
203
- p && (q && L ? Fe(_, L) : _)
203
+ p && (W ? /* @__PURE__ */ r(Pe, { root: ne, children: _ }) : _)
204
204
  ] });
205
205
  }
206
206
  );
207
- ge.displayName = "DatePicker";
207
+ Ve.displayName = "DatePicker";
208
208
  export {
209
- ge as DatePicker
209
+ Ve as DatePicker
210
210
  };
@@ -1,26 +1,26 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as f, Fragment as P } from "react/jsx-runtime";
3
- import { forwardRef as Q, useMemo as T, isValidElement as U } from "react";
4
- import { useAsheeConfig as b } from "../../libs/context.js";
2
+ import { jsx as r, jsxs as f, Fragment as O } from "react/jsx-runtime";
3
+ import { forwardRef as P, useMemo as Q, isValidElement as T } from "react";
4
+ import { useAsheeConfig as U } from "../../libs/context.js";
5
5
  import { resolveCascade as a } from "../../utils/resolve-token.js";
6
6
  import { FALLBACK_MARQUEE_CONFIG as o } from "./marquee-config.js";
7
7
  import { MARQUEE_SPEED_PRESETS as E, MARQUEE_FADE_START_CLASS as g, MARQUEE_FADE_END_CLASS as H } from "./marquee-styles.js";
8
8
  import { cn as s } from "../../utils/cn.js";
9
- const j = Q(
9
+ const j = P(
10
10
  ({
11
11
  children: i,
12
12
  axis: y,
13
13
  direction: x,
14
14
  speed: A,
15
- gap: S,
16
- pauseOnHover: h,
15
+ gap: h,
16
+ pauseOnHover: S,
17
17
  fadeEdges: _,
18
18
  className: N,
19
- itemClassName: c,
19
+ itemClassName: p,
20
20
  ...q
21
21
  }, D) => {
22
22
  var v;
23
- const e = (v = b().components) == null ? void 0 : v.marquee, m = a(
23
+ const e = (v = U().components) == null ? void 0 : v.marquee, l = a(
24
24
  y,
25
25
  e == null ? void 0 : e.axis,
26
26
  void 0,
@@ -30,18 +30,18 @@ const j = Q(
30
30
  e == null ? void 0 : e.direction,
31
31
  void 0,
32
32
  o.direction
33
- ), l = a(
33
+ ), m = a(
34
34
  A,
35
35
  e == null ? void 0 : e.speed,
36
36
  void 0,
37
37
  o.speed
38
38
  ), d = a(
39
- S,
39
+ h,
40
40
  e == null ? void 0 : e.gap,
41
41
  void 0,
42
42
  o.gap
43
43
  ), M = a(
44
- h,
44
+ S,
45
45
  e == null ? void 0 : e.pauseOnHover,
46
46
  void 0,
47
47
  o.pauseOnHover
@@ -50,9 +50,9 @@ const j = Q(
50
50
  e == null ? void 0 : e.fadeEdges,
51
51
  void 0,
52
52
  o.fadeEdges
53
- ), k = typeof l == "number" ? l : E[l] ?? E.normal, t = m === "y", w = T(
53
+ ), k = typeof m == "number" ? m : E[m] ?? E.normal, t = l === "y", w = Q(
54
54
  () => [i, i].map(($, u) => {
55
- const p = u === 0 ? "primary" : "secondary";
55
+ const c = u === 0 ? "primary" : "secondary";
56
56
  return /* @__PURE__ */ r(
57
57
  "div",
58
58
  {
@@ -64,22 +64,22 @@ const j = Q(
64
64
  gap: d
65
65
  },
66
66
  "aria-hidden": u === 1,
67
- children: $.map((n, L) => {
68
- const O = U(n) && n.key ? `${p}-${n.key}` : `${p}-item-${L}`;
69
- return /* @__PURE__ */ r("div", { className: s("shrink-0", c), children: n }, O);
67
+ children: $.map((n, b) => {
68
+ const L = T(n) && n.key ? `${c}-${n.key}` : `${c}-item-${b}`;
69
+ return /* @__PURE__ */ r("div", { className: s("shrink-0", p), children: n }, L);
70
70
  })
71
71
  },
72
- `${p}-set`
72
+ `${c}-set`
73
73
  );
74
74
  }),
75
- [i, t, d, c]
75
+ [i, t, d, p]
76
76
  );
77
77
  return /* @__PURE__ */ f(
78
78
  "div",
79
79
  {
80
80
  ref: D,
81
81
  className: s(
82
- "group relative overflow-clip",
82
+ "group relative scrollbar-hide overflow-hidden",
83
83
  t ? "h-full" : "w-full",
84
84
  N
85
85
  ),
@@ -114,13 +114,13 @@ const j = Q(
114
114
  children: w
115
115
  }
116
116
  ),
117
- R && /* @__PURE__ */ f(P, { children: [
117
+ R && /* @__PURE__ */ f(O, { children: [
118
118
  /* @__PURE__ */ r(
119
119
  "div",
120
120
  {
121
121
  className: s(
122
122
  "absolute z-10 pointer-events-none",
123
- g[m]
123
+ g[l]
124
124
  )
125
125
  }
126
126
  ),
@@ -129,7 +129,7 @@ const j = Q(
129
129
  {
130
130
  className: s(
131
131
  "absolute z-10 pointer-events-none",
132
- H[m]
132
+ H[l]
133
133
  )
134
134
  }
135
135
  )
@@ -121,11 +121,11 @@ export interface MultiSelectProps extends MultiSelectFieldProps, MultiSelectCont
121
121
  * label, description, and message handling, and uses Floating UI for
122
122
  * positioning and accessibility.
123
123
  *
124
- * By default, the dropdown menu uses React's createPortal to render at the
125
- * document body level. This ensures the menu escapes CSS containment, overflow
126
- * clipping, and stacking context issues. The portal can be disabled via the
127
- * `menu.portal` prop or `components.multiSelect.menu.portal` in the config
128
- * if the menu needs to stay within a specific parent container.
124
+ * By default, the dropdown menu uses Floating UI's FloatingPortal to render
125
+ * at the document body level. This ensures the menu escapes CSS containment,
126
+ * overflow clipping, and stacking context issues. The portal can be disabled
127
+ * via the `menu.portal` prop or `components.multiSelect.menu.portal` in the
128
+ * config if the menu needs to stay within a specific parent container.
129
129
  *
130
130
  * @param props - MultiSelect configuration options.
131
131
  * @param props.options - Available options to select from.
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/MultiSelect.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,2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}
@@ -1,21 +1,21 @@
1
1
  "use client";
2
- import { jsx as l, jsxs as S, Fragment as Pe } from "react/jsx-runtime";
3
- import { useClick as Re, useDismiss as Ue, useRole as je, useInteractions as Ve } from "@floating-ui/react";
4
- import { forwardRef as $e, useId as Be, useState as B, useMemo as A, useCallback as z } from "react";
5
- import { ChevronDownIcon as Ge } from "../../icons/ChevronDownIcon.js";
6
- import { CloseIcon as He } from "../../icons/CloseIcon.js";
7
- import { useAsheeConfig as Qe } from "../../libs/context.js";
2
+ import { jsx as l, jsxs as S, Fragment as Re } from "react/jsx-runtime";
3
+ import { useClick as Ue, useDismiss as je, useRole as Ve, useInteractions as $e } from "@floating-ui/react";
4
+ import { forwardRef as Be, useId as Ge, useState as B, useMemo as A, useCallback as z } from "react";
5
+ import { ChevronDownIcon as He } from "../../icons/ChevronDownIcon.js";
6
+ import { CloseIcon as Qe } from "../../icons/CloseIcon.js";
7
+ import { useAsheeConfig as he } from "../../libs/context.js";
8
8
  import { resolveCascade as m, resolveRadiusKey as G, resolveClassKey as N } from "../../utils/resolve-token.js";
9
- import { Button as he } from "../button/Button.js";
10
- import { Chip as We } from "../chip/Chip.js";
11
- import { FieldShell as qe } from "../field/FieldShell.js";
12
- import { SelectMenu as Je } from "../select-menu/SelectMenu.js";
9
+ import { Button as We } from "../button/Button.js";
10
+ import { Chip as qe } from "../chip/Chip.js";
11
+ import { FieldShell as Je } from "../field/FieldShell.js";
12
+ import { SelectMenu as Xe } from "../select-menu/SelectMenu.js";
13
13
  import { FALLBACK_MULTI_SELECT_CONFIG as s } from "./multi-select-config.js";
14
- import { MULTI_SELECT_HEIGHT_CLASS as Xe, MULTI_SELECT_PADDING_CLASS as Ye, MULTI_SELECT_FONT_CLASS as Ze, STATUS_BORDER_CLASS as Ce } from "./multi-select-styles.js";
15
- import { RADIUS_CLASS as er } from "../../shared/radius.js";
16
- import { useSelectFloating as rr } from "../select-menu/use-select-floating.js";
14
+ import { MULTI_SELECT_HEIGHT_CLASS as Ye, MULTI_SELECT_PADDING_CLASS as Ze, MULTI_SELECT_FONT_CLASS as Ce, STATUS_BORDER_CLASS as er } from "./multi-select-styles.js";
15
+ import { RADIUS_CLASS as rr } from "../../shared/radius.js";
16
+ import { useSelectFloating as sr } from "../select-menu/use-select-floating.js";
17
17
  import { cn as v } from "../../utils/cn.js";
18
- const sr = $e(
18
+ const tr = Be(
19
19
  ({
20
20
  options: _ = [],
21
21
  value: n,
@@ -52,7 +52,7 @@ const sr = $e(
52
52
  endContent: ce
53
53
  }, x) => {
54
54
  var R, U, j, V;
55
- const p = Qe(), e = (R = p.components) == null ? void 0 : R.multiSelect, ue = Be(), y = le ?? ue, [b, de] = B(!1), [me, fe] = B(""), g = m(
55
+ const p = he(), e = (R = p.components) == null ? void 0 : R.multiSelect, ue = Ge(), y = le ?? ue, [b, de] = B(!1), [me, fe] = B(""), g = m(
56
56
  Y,
57
57
  e == null ? void 0 : e.size,
58
58
  void 0,
@@ -94,39 +94,39 @@ const sr = $e(
94
94
  s.labelAlign
95
95
  ), ge = N(
96
96
  g,
97
- Xe,
97
+ Ye,
98
98
  s.size
99
99
  ), Ie = N(
100
100
  g,
101
- Ye,
101
+ Ze,
102
102
  s.size
103
103
  ), Ne = N(
104
104
  g,
105
- Ze,
105
+ Ce,
106
106
  s.size
107
107
  ), _e = N(
108
108
  pe,
109
- er,
109
+ rr,
110
110
  s.chip.radius
111
- ), { refs: K, floatingStyles: Le, context: I } = rr({
111
+ ), { refs: K, floatingStyles: Le, context: I, isPositioned: we } = sr({
112
112
  isOpen: b,
113
113
  onOpenChange: de,
114
114
  disabled: c
115
- }), we = Re(I, { enabled: !c }), Ae = Ue(I), ze = je(I, { role: "listbox" }), { getReferenceProps: Te, getFloatingProps: Ee } = Ve([
116
- we,
115
+ }), Ae = Ue(I, { enabled: !c }), ze = je(I), Te = Ve(I, { role: "listbox" }), { getReferenceProps: Ee, getFloatingProps: ke } = $e([
117
116
  Ae,
118
- ze
117
+ ze,
118
+ Te
119
119
  ]), o = A(() => L !== void 0 ? L : Array.isArray(n) ? _.filter((r) => n.includes(r.value)) : [], [L, n, _]), O = z(
120
120
  (r) => o.some((t) => t.value === r),
121
121
  [o]
122
- ), ke = z(
122
+ ), Me = z(
123
123
  (r) => {
124
124
  const t = O(r.value);
125
125
  if (f || i)
126
126
  t ? i == null || i(r.value) : f == null || f(r);
127
127
  else if (u) {
128
- const $ = n ?? [], Ke = t ? $.filter((Oe) => Oe !== r.value) : [...$, r.value];
129
- u(Ke);
128
+ const $ = n ?? [], Oe = t ? $.filter((Pe) => Pe !== r.value) : [...$, r.value];
129
+ u(Oe);
130
130
  }
131
131
  },
132
132
  [O, f, i, u, n]
@@ -135,12 +135,12 @@ const sr = $e(
135
135
  i ? i(r) : u && Array.isArray(n) && u(n.filter((t) => t !== r));
136
136
  },
137
137
  [i, u, n]
138
- ), Me = A(
138
+ ), De = A(
139
139
  () => o.map((r) => r.value),
140
140
  [o]
141
- ), De = A(() => o.length > 0 ? `${o.length} selected` : T, [o.length, T]), Fe = Te();
141
+ ), Fe = A(() => o.length > 0 ? `${o.length} selected` : T, [o.length, T]), Ke = Ee();
142
142
  return /* @__PURE__ */ l(
143
- qe,
143
+ Je,
144
144
  {
145
145
  id: y,
146
146
  label: ee,
@@ -160,7 +160,7 @@ const sr = $e(
160
160
  children: [
161
161
  /* @__PURE__ */ S("div", { className: "relative w-full", children: [
162
162
  /* @__PURE__ */ l(
163
- he,
163
+ We,
164
164
  {
165
165
  ref: (r) => {
166
166
  K.setReference(r), typeof x == "function" ? x(r) : x && (x.current = r);
@@ -180,17 +180,17 @@ const sr = $e(
180
180
  "aria-describedby": [w ? `${y}-description` : void 0].filter(Boolean).join(" ") || void 0,
181
181
  className: v(
182
182
  "font-normal text-left justify-between",
183
- Ce[d],
183
+ er[d],
184
184
  ge,
185
185
  Ie,
186
186
  Ne,
187
187
  oe
188
188
  ),
189
189
  startContent: ie,
190
- endContent: /* @__PURE__ */ S(Pe, { children: [
190
+ endContent: /* @__PURE__ */ S(Re, { children: [
191
191
  ce,
192
192
  /* @__PURE__ */ l(
193
- Ge,
193
+ He,
194
194
  {
195
195
  className: v(
196
196
  "shrink-0 text-foreground/70 transition-transform duration-200",
@@ -199,7 +199,7 @@ const sr = $e(
199
199
  }
200
200
  )
201
201
  ] }),
202
- ...Fe,
202
+ ...Ke,
203
203
  children: /* @__PURE__ */ l(
204
204
  "span",
205
205
  {
@@ -207,22 +207,23 @@ const sr = $e(
207
207
  "truncate",
208
208
  o.length > 0 ? "text-foreground" : "text-foreground/70"
209
209
  ),
210
- children: De
210
+ children: Fe
211
211
  }
212
212
  )
213
213
  }
214
214
  ),
215
215
  /* @__PURE__ */ l(
216
- Je,
216
+ Xe,
217
217
  {
218
218
  isOpen: b,
219
219
  context: I,
220
220
  floatingStyles: Le,
221
- getFloatingProps: Ee,
221
+ getFloatingProps: ke,
222
222
  setFloatingRef: K.setFloating,
223
+ isPositioned: we,
223
224
  options: _,
224
- selectedValues: Me,
225
- onSelectMenuOption: ke,
225
+ selectedValues: De,
226
+ onSelectMenuOption: Me,
226
227
  isSearch: H,
227
228
  searchPlaceholder: Q,
228
229
  searchInputName: h,
@@ -237,7 +238,7 @@ const sr = $e(
237
238
  !q && /* @__PURE__ */ S("div", { className: "flex flex-col gap-1.5", children: [
238
239
  E && /* @__PURE__ */ l("span", { className: "text-xs font-medium text-foreground/70", children: E }),
239
240
  /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1.5 p-2 min-h-12 bg-secondary/20 border border-dashed border-border rounded-lg items-center", children: o.length === 0 ? /* @__PURE__ */ l("span", { className: "text-xs text-foreground/70 px-2 py-1", children: "No selections made" }) : o.map((r) => /* @__PURE__ */ S(
240
- We,
241
+ qe,
241
242
  {
242
243
  variant: "bordered",
243
244
  color: ve,
@@ -262,7 +263,7 @@ const sr = $e(
262
263
  },
263
264
  "aria-label": `Remove ${r.label}`,
264
265
  className: "inline-flex items-center justify-center h-3.5 w-3.5 rounded-full hover:bg-black/20 dark:hover:bg-white/20 transition-colors cursor-pointer shrink-0",
265
- children: /* @__PURE__ */ l(He, { className: "w-3 h-3" })
266
+ children: /* @__PURE__ */ l(Qe, { className: "w-3 h-3" })
266
267
  }
267
268
  )
268
269
  ]
@@ -277,7 +278,7 @@ const sr = $e(
277
278
  );
278
279
  }
279
280
  );
280
- sr.displayName = "MultiSelect";
281
+ tr.displayName = "MultiSelect";
281
282
  export {
282
- sr as MultiSelect
283
+ tr as MultiSelect
283
284
  };