asma-ui-core 3.106.0 → 3.107.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.
@@ -1,47 +1,53 @@
1
- import { cn as c } from "../../../../helpers/cn.js";
2
- import { firstTabbable as I } from "../../../../helpers/focusable.js";
3
- import { StyledTooltip as G } from "../../../data-display/tooltip/StyledTooltip.js";
4
- import { DialogBusyContext as j, useDialogBusyBoundary as J } from "../../dialog/DialogBusyContext.js";
5
- import { useMobileMediaQuery as K } from "../../../../hooks/useMediaQuery.hook.js";
6
- import { useFocusTrap as X } from "../../../../hooks/useFocusTrap.hook.js";
7
- import { CloseBtn as D } from "../components/CloseBtn.js";
8
- import { MinimizeBtn as P } from "../components/MinimizeBtn.js";
9
- import { FullScreenBtn as Y } from "../components/FullscreenBtn.js";
10
- import p from "./MinimizableDialogV2.module.js";
11
- import { useTranslations as Z } from "./useTranslations.js";
12
- import { useControlledProps as ee } from "./useControlledProps.js";
13
- import te from "clsx";
14
- import { useLayoutEffect as A, useRef as u } from "react";
15
- import { Fragment as ie, jsx as e, jsxs as o } from "react/jsx-runtime";
16
- var ge = (y) => {
17
- const { showCloseIcon: z = !0, showMinimizeIcon: O = !0, showExpandIcon: V = !0, enableFullscreen: q = !0, title: r, label: x, children: E, open: d, onClose: W, classNameOverrides: v = {
1
+ import { cn as s } from "../../../../helpers/cn.js";
2
+ import { firstTabbable as A } from "../../../../helpers/focusable.js";
3
+ import { StyledTooltip as te } from "../../../data-display/tooltip/StyledTooltip.js";
4
+ import { DialogBusyContext as $, useDialogBusyBoundary as ie } from "../../dialog/DialogBusyContext.js";
5
+ import { useMobileMediaQuery as le } from "../../../../hooks/useMediaQuery.hook.js";
6
+ import { useFocusTrap as ne } from "../../../../hooks/useFocusTrap.hook.js";
7
+ import { CloseBtn as O } from "../components/CloseBtn.js";
8
+ import { MinimizeBtn as V } from "../components/MinimizeBtn.js";
9
+ import { FullScreenBtn as oe } from "../components/FullscreenBtn.js";
10
+ import v from "./MinimizableDialogV2.module.js";
11
+ import { useTranslations as re } from "./useTranslations.js";
12
+ import { useControlledProps as se } from "./useControlledProps.js";
13
+ import ce from "clsx";
14
+ import { useId as q, useLayoutEffect as H, useRef as c } from "react";
15
+ import { Fragment as ae, jsx as e, jsxs as n } from "react/jsx-runtime";
16
+ var Se = (N) => {
17
+ const { showCloseIcon: R = !0, showMinimizeIcon: L = !0, showExpandIcon: W = !0, enableFullscreen: _ = !0, title: u, label: f, children: Q, open: o, onClose: U, classNameOverrides: h = {
18
18
  maximized: "",
19
19
  minimized: "",
20
20
  fullscreen: ""
21
- }, dataTest: _, actionNode: $, locale: H = "en", busyReason: L, style: w, initialFocusRef: N } = y, s = K(), i = Z(H), m = u(null), f = u(null), R = u(null), C = u(null), S = u(!1), { minimized: t, setMinimized: F, fullScreen: l, setFullScreen: T } = ee(y), n = l && !t, { busy: h, busyReason: B, contextValue: M } = J(L ?? i.waitUntilSaved), b = () => {
22
- h || (F(!1), W());
21
+ }, dataTest: G, actionNode: J, locale: K = "en", busyReason: X, style: C, initialFocusRef: S } = N, r = le(), i = re(K), a = c(null), p = c(null), F = c(null), T = c(null), b = c(!1), g = c(null), x = q(), I = q(), { minimized: t, setMinimized: M, fullScreen: l, setFullScreen: B } = se(N), d = l && !t, { busy: y, busyReason: E, contextValue: j } = ie(X ?? i.waitUntilSaved), z = () => {
22
+ y || (M(!1), U());
23
23
  };
24
- A(() => {
25
- m.current?.toggleAttribute("inert", t), f.current?.toggleAttribute("inert", !t);
26
- }, [t]), A(() => {
27
- const g = d && !S.current;
28
- if (S.current = d, !g) return;
29
- const a = t ? f.current : m.current, U = t ? C.current : R.current;
30
- (N?.current ?? U ?? (a ? I(a) : void 0))?.focus({ preventScroll: !0 });
24
+ H(() => {
25
+ a.current?.toggleAttribute("inert", t), p.current?.toggleAttribute("inert", !t);
26
+ }, [t]), H(() => {
27
+ const w = o && !b.current, m = !o && b.current;
28
+ if (b.current = o, m) {
29
+ const P = g.current;
30
+ g.current = null, (!document.activeElement || document.activeElement === document.body) && P?.isConnected && P.focus({ preventScroll: !0 });
31
+ return;
32
+ }
33
+ if (!w) return;
34
+ g.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
35
+ const D = t ? p.current : a.current, ee = t ? T.current : F.current;
36
+ (S?.current ?? ee ?? (D ? A(D) : void 0))?.focus({ preventScroll: !0 });
31
37
  }, [
32
- N,
38
+ S,
33
39
  t,
34
- d
40
+ o
35
41
  ]);
36
42
  const k = () => {
37
- const g = t ? m : f;
38
- F(!t), requestAnimationFrame(() => {
39
- const a = g.current;
40
- a && (a.querySelector('[data-testid="toggle-minimize-btn"]') ?? I(a))?.focus({ preventScroll: !0 });
43
+ const w = t ? a : p;
44
+ M(!t), requestAnimationFrame(() => {
45
+ const m = w.current;
46
+ m && (m.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(m))?.focus({ preventScroll: !0 });
41
47
  });
42
48
  };
43
- X(d && n, m, b);
44
- const Q = n ? s ? {
49
+ ne(o && d, a, z);
50
+ const Y = d ? r ? {
45
51
  inset: 0,
46
52
  maxHeight: "100dvh",
47
53
  maxWidth: "100dvw",
@@ -58,115 +64,120 @@ var ge = (y) => {
58
64
  maxWidth: "min(1000px, calc(100vw - 32px))",
59
65
  height: "95dvh"
60
66
  } : void 0;
61
- return d ? /* @__PURE__ */ o(ie, { children: [
67
+ if (!o) return null;
68
+ const Z = f ? `${I} ${x}` : x;
69
+ return /* @__PURE__ */ n(ae, { children: [
62
70
  /* @__PURE__ */ e("div", {
63
- ref: f,
71
+ ref: p,
64
72
  style: {
65
73
  zIndex: 51,
66
- ...w
74
+ ...C
67
75
  },
68
- className: c(p["minimized-dialog"], !t && p.hidden, v.minimized),
69
- children: /* @__PURE__ */ o("div", {
70
- className: te("flex items-center justify-between", !t && "hidden"),
71
- "data-testid": _,
76
+ className: s(v["minimized-dialog"], !t && v.hidden, h.minimized),
77
+ children: /* @__PURE__ */ n("div", {
78
+ className: ce("flex items-center justify-between", !t && "hidden"),
79
+ "data-testid": G,
72
80
  children: [/* @__PURE__ */ e("div", {
73
81
  className: "max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
74
- children: /* @__PURE__ */ e(G, {
75
- title: r,
82
+ children: /* @__PURE__ */ e(te, {
83
+ title: u,
76
84
  placement: "top",
77
85
  children: /* @__PURE__ */ e("div", {
78
86
  className: "truncate",
79
- children: r
87
+ children: u
80
88
  })
81
89
  })
82
- }), /* @__PURE__ */ o("div", {
90
+ }), /* @__PURE__ */ n("div", {
83
91
  className: "flex items-center gap-x-1",
84
- children: [/* @__PURE__ */ e(P, {
92
+ children: [/* @__PURE__ */ e(V, {
85
93
  type: "expand",
86
- visibility: V,
94
+ visibility: W,
87
95
  onClick: k,
88
96
  tooltipTitle: i.expand
89
- }), /* @__PURE__ */ e(D, {
90
- buttonRef: C,
91
- showCloseIcon: z,
92
- onClick: b,
93
- disabledReason: h ? B : void 0,
97
+ }), /* @__PURE__ */ e(O, {
98
+ buttonRef: T,
99
+ showCloseIcon: R,
100
+ onClick: z,
101
+ disabledReason: y ? E : void 0,
94
102
  tooltipTitle: i.close
95
103
  })]
96
104
  })]
97
105
  })
98
106
  }),
99
- n && /* @__PURE__ */ e("div", {
107
+ d && /* @__PURE__ */ e("div", {
100
108
  className: "fixed inset-0 z-[52] bg-[rgb(98,110,126)] bg-opacity-70",
101
109
  onClick: () => {
102
- T(!1);
110
+ B(!1);
103
111
  }
104
112
  }),
105
- /* @__PURE__ */ o("div", {
113
+ /* @__PURE__ */ n("div", {
106
114
  style: {
107
115
  zIndex: 51,
108
- ...w,
109
- ...Q
116
+ ...C,
117
+ ...Y
110
118
  },
111
- ref: m,
112
- role: n ? "dialog" : void 0,
113
- "aria-modal": n ? !0 : void 0,
114
- "aria-label": n && typeof r == "string" ? r : void 0,
115
- className: c(p.dialog, t && p.hidden, !l && v.maximized, l && v.fullscreen, n && "fixed z-[53] duration-0"),
116
- children: [/* @__PURE__ */ o("div", {
117
- className: c("flex flex-col border-b-[1px] border-delta-200 px-4", s ? "py-3" : "py-4"),
118
- children: [/* @__PURE__ */ o("div", {
119
+ ref: a,
120
+ role: "dialog",
121
+ "aria-modal": d ? !0 : void 0,
122
+ "aria-labelledby": Z,
123
+ className: s(v.dialog, t && v.hidden, !l && h.maximized, l && h.fullscreen, d && "fixed z-[53] duration-0"),
124
+ children: [/* @__PURE__ */ n("div", {
125
+ className: s("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
126
+ children: [/* @__PURE__ */ n("div", {
119
127
  className: "flex items-center justify-between",
120
- children: [x ? /* @__PURE__ */ e("div", {
128
+ children: [f ? /* @__PURE__ */ e("div", {
129
+ id: I,
121
130
  className: "text-sm text-delta-700",
122
- children: x
131
+ children: f
123
132
  }) : /* @__PURE__ */ e("div", {
124
- className: c("font-semibold text-delta-800", s ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
125
- children: r
126
- }), /* @__PURE__ */ o("div", {
133
+ id: x,
134
+ className: s("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
135
+ children: u
136
+ }), /* @__PURE__ */ n("div", {
127
137
  className: "flex items-center gap-x-1",
128
138
  children: [
129
- /* @__PURE__ */ e(j.Provider, {
130
- value: M,
131
- children: $
139
+ /* @__PURE__ */ e($.Provider, {
140
+ value: j,
141
+ children: J
132
142
  }),
133
- /* @__PURE__ */ e(P, {
134
- visibility: O && !s && !l,
143
+ /* @__PURE__ */ e(V, {
144
+ visibility: L && !r && !l,
135
145
  type: "minimize",
136
146
  onClick: k,
137
147
  tooltipTitle: i.minimize
138
148
  }),
139
- /* @__PURE__ */ e(Y, {
140
- showFullScreenIcon: q && !s,
149
+ /* @__PURE__ */ e(oe, {
150
+ showFullScreenIcon: _ && !r,
141
151
  fullScreen: l,
142
152
  onClick: () => {
143
- T(!l);
153
+ B(!l);
144
154
  },
145
155
  tooltipTitle: l ? i.exitFullscreen : i.fullscreen
146
156
  }),
147
- /* @__PURE__ */ e(D, {
148
- buttonRef: R,
149
- showCloseIcon: z,
150
- onClick: b,
151
- disabledReason: h ? B : void 0,
157
+ /* @__PURE__ */ e(O, {
158
+ buttonRef: F,
159
+ showCloseIcon: R,
160
+ onClick: z,
161
+ disabledReason: y ? E : void 0,
152
162
  tooltipTitle: i.close
153
163
  })
154
164
  ]
155
165
  })]
156
- }), x && /* @__PURE__ */ e("div", {
157
- className: c("font-semibold text-delta-800", s ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
158
- children: r
166
+ }), f && /* @__PURE__ */ e("div", {
167
+ id: x,
168
+ className: s("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
169
+ children: u
159
170
  })]
160
171
  }), /* @__PURE__ */ e("div", {
161
- className: c(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
162
- children: /* @__PURE__ */ e(j.Provider, {
163
- value: M,
164
- children: E
172
+ className: s(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
173
+ children: /* @__PURE__ */ e($.Provider, {
174
+ value: j,
175
+ children: Q
165
176
  })
166
177
  })]
167
178
  })
168
- ] }) : null;
179
+ ] });
169
180
  };
170
181
  export {
171
- ge as MinimizableDialogV2
182
+ Se as MinimizableDialogV2
172
183
  };
@@ -11,7 +11,7 @@ import { DynamicInteractiveChipGroup as ne } from "./DynamicInteractiveChipGroup
11
11
  import { createElement as F, forwardRef as se, useCallback as h, useState as de } from "react";
12
12
  import { Fragment as K, jsx as l, jsxs as T } from "react/jsx-runtime";
13
13
  var Ce = se((O, H) => {
14
- const [_, S] = de(!1), { options: k, dataTest: f, value: g, readOnly: u, multiple: o, required: R, onChange: x, size: G, rowSize: v = "compact", title: y, noOptionsText: W, placeholder: J, disabled: I, helperText: M, disableHelperText: N, error: A, valueKey: P = "value", labelKey: Q = "label", renderLabel: s, getOptionTooltip: V, startAdornment: U, autocompleteProps: i, loading: m, maxTags: X, onFocus: Y, onBlur: Z } = O, d = (e) => typeof e == "object" ? e?.[Q]?.toString() ?? "" : e?.toString() ?? "", b = h((e) => typeof e == "object" ? e?.[P] : e, [P]), $ = h((e, t) => b(e) === b(t), [b]), w = (e) => {
14
+ const [_, S] = de(!1), { options: k, dataTest: f, value: g, readOnly: u, multiple: o, required: R, onChange: x, size: W, rowSize: y = "compact", title: v, noOptionsText: G, placeholder: J, disabled: I, helperText: M, disableHelperText: N, error: A, valueKey: P = "value", labelKey: Q = "label", renderLabel: s, getOptionTooltip: V, startAdornment: U, autocompleteProps: i, loading: m, maxTags: X, onFocus: Y, onBlur: Z } = O, d = (e) => typeof e == "object" ? e?.[Q]?.toString() ?? "" : e?.toString() ?? "", b = h((e) => typeof e == "object" ? e?.[P] : e, [P]), $ = h((e, t) => b(e) === b(t), [b]), w = (e) => {
15
15
  const t = b(e);
16
16
  return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : d(e);
17
17
  }, B = h((e) => {
@@ -20,13 +20,13 @@ var Ce = se((O, H) => {
20
20
  S(!1), i?.onClose?.(e, t);
21
21
  }, [i]);
22
22
  if (o && u) return /* @__PURE__ */ l(ne, { ...O });
23
- const C = y ? `${f}-title` : void 0;
23
+ const C = v ? `${f}-title` : void 0;
24
24
  return /* @__PURE__ */ T("div", {
25
25
  className: "flex w-full flex-col gap-y-1",
26
- children: [y && /* @__PURE__ */ l("span", {
26
+ children: [v && /* @__PURE__ */ l("span", {
27
27
  id: C,
28
28
  className: "text-base font-semibold text-delta-800",
29
- children: y
29
+ children: v
30
30
  }), /* @__PURE__ */ l(ie, {
31
31
  open: _,
32
32
  onOpen: B,
@@ -34,12 +34,12 @@ var Ce = se((O, H) => {
34
34
  disableCloseOnSelect: o,
35
35
  dataTest: f,
36
36
  disabled: !!I || !!m,
37
- noOptionsText: W,
37
+ noOptionsText: G,
38
38
  loading: m,
39
39
  readOnly: u,
40
40
  value: g,
41
- size: G,
42
- rowSize: v,
41
+ size: W,
42
+ rowSize: y,
43
43
  disableClearable: R,
44
44
  options: k,
45
45
  fullWidth: !0,
@@ -99,7 +99,7 @@ var Ce = se((O, H) => {
99
99
  "aria-selected": L,
100
100
  key: e.id,
101
101
  onClick: r ? void 0 : e.onClick,
102
- className: q("relative flex cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", v === "regular" ? "min-h-12" : "min-h-10", r && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
102
+ className: q("relative box-border flex cursor-pointer items-center gap-x-1 bg-white px-2 py-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", y === "regular" ? "min-h-12" : "min-h-10", r && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
103
103
  "aria-disabled": r,
104
104
  "aria-describedby": a
105
105
  }, j, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
@@ -114,6 +114,7 @@ var Ce = se((O, H) => {
114
114
  dataTest: `${w(t)}-checkbox`,
115
115
  size: "small",
116
116
  decorative: !0,
117
+ hideWrapper: !0,
117
118
  className: "min-w-[36px]",
118
119
  checked: L
119
120
  }), s ? s(t) : /* @__PURE__ */ l("span", {
@@ -128,7 +129,7 @@ var Ce = se((O, H) => {
128
129
  role: "option",
129
130
  "aria-selected": D,
130
131
  key: e.id,
131
- className: q("relative flex cursor-pointer items-center gap-x-1 px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", v === "regular" ? "min-h-12" : "min-h-10", r && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
132
+ className: q("relative box-border flex cursor-pointer items-center gap-x-1 px-2 py-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", y === "regular" ? "min-h-12" : "min-h-10", r && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
132
133
  onClick: r ? void 0 : e.onClick,
133
134
  "aria-disabled": r,
134
135
  "aria-describedby": a
@@ -1,4 +1,4 @@
1
- import { cn as y } from "../../../helpers/cn.js";
1
+ import { cn as h } from "../../../helpers/cn.js";
2
2
  import { resolveSx as je } from "../../../helpers/sx.js";
3
3
  import { TOP_LAYER_PROPS as Ue, TOP_LAYER_RESET_STYLE as Ve, getOpenModalDialogAncestor as re, shouldUsePopoverTopLayer as qe, useTopLayerRef as Ye } from "../../../hooks/useTopLayer.hook.js";
4
4
  import { ChevronDownIcon as ze } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
@@ -11,12 +11,12 @@ import { useFormControlContext as Xe } from "../../miscellaneous/FormControlCont
11
11
  import { Children as se, cloneElement as Ze, isValidElement as f, useEffect as B, useId as et, useRef as tt, useState as x } from "react";
12
12
  import { jsx as l, jsxs as L } from "react/jsx-runtime";
13
13
  import { FloatingPortal as ot, autoUpdate as rt, flip as st, offset as nt, shift as lt, size as it, useClick as at, useDismiss as ct, useFloating as dt, useInteractions as ut, useMergeRefs as ft, useRole as pt } from "@floating-ui/react";
14
- var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, errorText: ie, helperText: j, reserveHelperText: ae, expandHelperText: ce = !0, allowClear: U, disabled: de, readOnly: c, name: w, placeholder: S, displayEmpty: C, multiple: d, renderValue: V, fullWidth: ue, className: fe, style: pe, sx: me, variant: be, children: q, MenuProps: ge, onFocus: he, onBlur: ye, labelId: v }) => {
15
- const u = Xe(), A = `${T}-listbox`, R = be === "standard", p = le ?? u?.error ?? !1, n = de ?? u?.disabled ?? !1, Y = p ? ie ?? j : j, { show: F, role: xe } = Je("StyledSelect", p, Y, ae, c), z = et(), { fieldRef: we, rowRef: ve, rowStyle: Ae } = Ge(ce && F), [r, K] = x(!1), [k, I] = x(!1), [m, b] = x(null), [Re, W] = x(ne), O = M !== void 0, o = O ? M : Re, i = Array.isArray(o) ? o.length > 0 : o !== void 0 && o !== "" && o !== null, g = se.toArray(q), G = (e) => d ? Array.isArray(o) && o.includes(e) : e === o, s = g.flatMap((e, t) => f(e) && !e.props.disabled ? [t] : []), E = g.findIndex((e) => f(e) && G(e.props.value)), ke = (e = 1) => s.includes(E) ? E : s[e === 1 ? 0 : s.length - 1] ?? null, D = m === null ? void 0 : `${A}-option-${m}`, P = tt(null), h = (e) => {
16
- K(e), e || b(null);
17
- }, { refs: { domReference: De, reference: J, setFloating: Se, setReference: Ce }, floatingStyles: Fe, context: N } = dt({
14
+ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, errorText: ie, helperText: j, reserveHelperText: ae, expandHelperText: ce = !0, allowClear: U, disabled: de, readOnly: c, name: w, placeholder: S, displayEmpty: C, multiple: d, renderValue: V, fullWidth: ue, className: fe, style: pe, sx: me, variant: ge, children: q, MenuProps: be, onFocus: ye, onBlur: he, labelId: v }) => {
15
+ const u = Xe(), A = `${T}-listbox`, R = ge === "standard", p = le ?? u?.error ?? !1, n = de ?? u?.disabled ?? !1, Y = p ? ie ?? j : j, { show: F, role: xe } = Je("StyledSelect", p, Y, ae, c), z = et(), { fieldRef: we, rowRef: ve, rowStyle: Ae } = Ge(ce && F), [r, K] = x(!1), [k, I] = x(!1), [m, g] = x(null), [Re, W] = x(ne), O = M !== void 0, o = O ? M : Re, i = Array.isArray(o) ? o.length > 0 : o !== void 0 && o !== "" && o !== null, b = se.toArray(q), G = (e) => d ? Array.isArray(o) && o.includes(e) : e === o, s = b.flatMap((e, t) => f(e) && !e.props.disabled ? [t] : []), _ = b.findIndex((e) => f(e) && G(e.props.value)), ke = (e = 1) => s.includes(_) ? _ : s[e === 1 ? 0 : s.length - 1] ?? null, D = m === null ? void 0 : `${A}-option-${m}`, E = tt(null), y = (e) => {
16
+ K(e), e || g(null);
17
+ }, { refs: { domReference: De, reference: J, setFloating: Se, setReference: Ce }, floatingStyles: Fe, context: P } = dt({
18
18
  open: r,
19
- onOpenChange: h,
19
+ onOpenChange: y,
20
20
  placement: "bottom-start",
21
21
  strategy: "fixed",
22
22
  whileElementsMounted: rt,
@@ -29,10 +29,10 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
29
29
  } })
30
30
  ]
31
31
  }), { getReferenceProps: Ie, getFloatingProps: Oe } = ut([
32
- at(N, { enabled: !n && !c }),
33
- ct(N),
34
- pt(N, { role: "listbox" })
35
- ]), [Q, X] = x(), _ = qe(Q), Ee = ft([Ye(Se, _), P]);
32
+ at(P, { enabled: !n && !c }),
33
+ ct(P),
34
+ pt(P, { role: "listbox" })
35
+ ]), [Q, X] = x(), N = qe(Q), _e = ft([Ye(Se, N), E]);
36
36
  B(() => u?.setFocused(r || k), [
37
37
  r,
38
38
  k,
@@ -45,8 +45,8 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
45
45
  ]), B(() => {
46
46
  if (!r) return;
47
47
  const e = requestAnimationFrame(() => {
48
- const t = D ? document.getElementById(D) : P.current?.querySelector('[role="option"][aria-selected="true"]');
49
- t && P.current?.contains(t) && t.scrollIntoView({ block: "nearest" });
48
+ const t = D ? document.getElementById(D) : E.current?.querySelector('[role="option"][aria-selected="true"]');
49
+ t && E.current?.contains(t) && t.scrollIntoView({ block: "nearest" });
50
50
  });
51
51
  return () => cancelAnimationFrame(e);
52
52
  }, [D, r]);
@@ -55,14 +55,14 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
55
55
  O || W(oe), $?.({ target: {
56
56
  value: oe,
57
57
  name: w
58
- } }, t), a && (h(!1), requestAnimationFrame(() => De.current?.focus()));
58
+ } }, t), a && (y(!1), requestAnimationFrame(() => De.current?.focus()));
59
59
  }, ee = () => {
60
60
  const e = d ? [] : "";
61
61
  O || W(e), $?.({ target: {
62
62
  value: e,
63
63
  name: w
64
- } }, null), h(!1), I(!1);
65
- }, Pe = se.map(q, (e, t) => {
64
+ } }, null), y(!1), I(!1);
65
+ }, Ee = se.map(q, (e, t) => {
66
66
  if (!f(e)) return e;
67
67
  const a = e.props.value;
68
68
  return Ze(e, {
@@ -70,22 +70,22 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
70
70
  active: t === m,
71
71
  selected: G(a),
72
72
  onClick: () => {
73
- b(null), Z(a, e.props.children);
73
+ g(null), Z(a, e.props.children);
74
74
  }
75
75
  });
76
- }), Ne = g.find((e) => f(e) && e.props.value === o), _e = V ? V(o) : d && Array.isArray(o) ? g.filter((e) => f(e) && o.includes(e.props.value)).map((e) => {
76
+ }), Pe = b.find((e) => f(e) && e.props.value === o), Ne = V ? V(o) : d && Array.isArray(o) ? b.filter((e) => f(e) && o.includes(e.props.value)).map((e) => {
77
77
  const t = e.props.children;
78
78
  return typeof t == "string" || typeof t == "number" ? String(t) : "";
79
- }).join(", ") : Ne?.props.children, He = (e) => {
80
- s.length !== 0 && b((t) => {
81
- const a = s.indexOf(t ?? E ?? -1);
79
+ }).join(", ") : Pe?.props.children, He = (e) => {
80
+ s.length !== 0 && g((t) => {
81
+ const a = s.indexOf(t ?? _ ?? -1);
82
82
  return a === -1 ? s[e === 1 ? 0 : s.length - 1] ?? null : s[Math.min(Math.max(a + e, 0), s.length - 1)] ?? null;
83
83
  });
84
84
  }, te = (e) => {
85
- const t = m === null ? void 0 : g[m];
85
+ const t = m === null ? void 0 : b[m];
86
86
  !f(t) || t.props.disabled || Z(t.props.value, t.props.children, e);
87
87
  }, Be = (e = 1) => {
88
- X(re(J.current)), b(ke(e)), K(!0);
88
+ X(re(J.current)), g(ke(e)), K(!0);
89
89
  }, Le = (e) => {
90
90
  if ((e.key === "Backspace" || e.key === "Delete") && U && i && !n && !c) {
91
91
  e.preventDefault(), ee();
@@ -96,12 +96,12 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
96
96
  e.preventDefault(), Be(e.key === "ArrowDown" ? 1 : -1);
97
97
  return;
98
98
  }
99
- r && (e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), He(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), b(s[e.key === "Home" ? 0 : s.length - 1] ?? null)) : e.key === " " ? (e.preventDefault(), te(!1)) : e.key === "Enter" ? (e.preventDefault(), te(!0)) : e.key === "Escape" ? (e.preventDefault(), h(!1)) : e.key === "Tab" && h(!1));
99
+ r && (e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), He(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), g(s[e.key === "Home" ? 0 : s.length - 1] ?? null)) : e.key === " " ? (e.preventDefault(), te(!1)) : e.key === "Enter" ? (e.preventDefault(), te(!0)) : e.key === "Escape" ? (e.preventDefault(), y(!1)) : e.key === "Tab" && y(!1));
100
100
  }
101
101
  }, H = R && (r || k), Te = n ? "text-delta-300" : H ? "text-gama-500" : "text-delta-800", Me = n ? "text-delta-300" : "text-delta-700";
102
102
  return /* @__PURE__ */ L("div", {
103
103
  ref: we,
104
- className: y("group relative inline-flex flex-col", ue && "w-full", fe),
104
+ className: h("group relative inline-flex flex-col", ue && "w-full", fe),
105
105
  style: {
106
106
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
107
107
  ...je(me),
@@ -128,17 +128,17 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
128
128
  "aria-disabled": n ? !0 : void 0,
129
129
  disabled: n,
130
130
  onFocus: (e) => {
131
- I(!0), he?.(e);
131
+ I(!0), ye?.(e);
132
132
  },
133
133
  onBlur: (e) => {
134
- I(!1), ye?.(e);
134
+ I(!1), he?.(e);
135
135
  },
136
136
  style: { minWidth: i && !R ? 105 : void 0 },
137
- className: y("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", "asma-touch-ready", H ? "bg-gama-50" : "bg-transparent", Te, R && "min-w-0", n && "cursor-not-allowed", c && "pointer-events-none"),
137
+ className: h("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", "asma-touch-ready", H ? "bg-gama-50" : "bg-transparent", Te, R && "min-w-0", n && "cursor-not-allowed", c && "pointer-events-none"),
138
138
  children: [
139
139
  /* @__PURE__ */ l("span", {
140
- className: y("min-w-0 flex-1 truncate", !i && "text-delta-500"),
141
- children: i || C ? _e : S
140
+ className: h("min-w-0 flex-1 truncate", !i && "text-delta-500"),
141
+ children: i || C ? Ne : S
142
142
  }),
143
143
  /* @__PURE__ */ L("span", {
144
144
  className: "flex items-center gap-1",
@@ -156,7 +156,7 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
156
156
  }), /* @__PURE__ */ l(ze, {
157
157
  width: 24,
158
158
  height: 24,
159
- className: y("shrink-0 transition-transform", H ? "text-gama-500" : Me, r && "flip-180")
159
+ className: h("shrink-0 transition-transform", H ? "text-gama-500" : Me, r && "flip-180")
160
160
  })]
161
161
  }),
162
162
  /* @__PURE__ */ l("div", { className: Qe({
@@ -171,21 +171,21 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
171
171
  r && /* @__PURE__ */ l(ot, {
172
172
  root: Q,
173
173
  children: /* @__PURE__ */ l("ul", {
174
- ref: Ee,
174
+ ref: _e,
175
175
  ...Oe(),
176
176
  id: A,
177
177
  role: "listbox",
178
178
  "aria-multiselectable": d ? !0 : void 0,
179
179
  "aria-labelledby": v,
180
180
  "aria-label": v ? void 0 : w,
181
- ..._ ? Ue : {},
181
+ ...N ? Ue : {},
182
182
  style: {
183
- ..._ ? Ve : {},
183
+ ...N ? Ve : {},
184
184
  ...Fe,
185
185
  fontFamily: "Roboto, Helvetica, Arial, sans-serif"
186
186
  },
187
- className: y("z-[1300] m-0 max-h-72 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", "[&>li:not(:last-child)]:border-0 [&>li:not(:last-child)]:border-b", "[&>li:not(:last-child)]:border-solid [&>li:not(:last-child)]:border-delta-200", ge?.className),
188
- children: Pe
187
+ className: h("z-[1300] m-0 max-h-72 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", be?.className),
188
+ children: Ee
189
189
  })
190
190
  }),
191
191
  F && /* @__PURE__ */ l(We, {