asma-ui-core 3.109.0 → 3.111.0

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 (59) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +41 -39
  3. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +62 -60
  4. package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +61 -58
  5. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +74 -71
  6. package/dist/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.js +13 -10
  7. package/dist/components/inputs/field-styles.js +16 -6
  8. package/dist/components/inputs/form-layout/StyledFieldPair.js +22 -0
  9. package/dist/components/inputs/form-layout/StyledFieldPair.module.js +8 -0
  10. package/dist/components/inputs/form-layout/StyledFormColumn.js +13 -0
  11. package/dist/components/inputs/input-field/StyledInputField.js +235 -198
  12. package/dist/components/inputs/phone-field/StyledPhoneField.js +41 -39
  13. package/dist/components/inputs/search-field/StyledSearchField.js +22 -20
  14. package/dist/components/inputs/select/StyledSelect.js +110 -108
  15. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +111 -108
  16. package/dist/components/inputs/slider/StyledSlider.js +2 -2
  17. package/dist/components/inputs/textarea/StyledTextarea.js +50 -52
  18. package/dist/components/inputs/textarea/StyledTextarea.module.js +3 -3
  19. package/dist/components/miscellaneous/StyledFormControl.js +29 -25
  20. package/dist/components/miscellaneous/StyledInputLabel.js +28 -18
  21. package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +137 -122
  22. package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.js +17 -15
  23. package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.module.js +2 -2
  24. package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +9 -8
  25. package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +17 -14
  26. package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +14 -9
  27. package/dist/datetime/components/time-picker/StyledTimePicker.js +78 -74
  28. package/dist/datetime/components/time-picker/TimePickerInput.js +43 -41
  29. package/dist/datetime/components/time-picker/helpers/timePickerWidth.js +12 -0
  30. package/dist/helpers/CharacterCounter.js +21 -0
  31. package/dist/hooks/useBackCloses.hook.js +67 -38
  32. package/dist/hooks/useTopLayer.hook.js +30 -26
  33. package/dist/index.js +284 -273
  34. package/dist/src/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.d.ts +2 -2
  35. package/dist/src/components/inputs/dynamic-select/types.d.ts +3 -0
  36. package/dist/src/components/inputs/field-styles.d.ts +22 -0
  37. package/dist/src/components/inputs/form-layout/StyledFieldPair.d.ts +18 -0
  38. package/dist/src/components/inputs/form-layout/StyledFormColumn.d.ts +12 -0
  39. package/dist/src/components/inputs/form-layout/index.d.ts +4 -0
  40. package/dist/src/components/inputs/input-field/StyledInputField.d.ts +19 -4
  41. package/dist/src/components/inputs/select/StyledSelect.d.ts +7 -2
  42. package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +5 -1
  43. package/dist/src/components/inputs/textarea/StyledTextarea.d.ts +6 -0
  44. package/dist/src/components/miscellaneous/StyledFormControl.d.ts +5 -2
  45. package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +7 -5
  46. package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
  47. package/dist/src/datetime/components/date-picker/types.d.ts +3 -0
  48. package/dist/src/datetime/components/time-picker/helpers/timePickerWidth.d.ts +7 -0
  49. package/dist/src/datetime/components/time-picker/types.d.ts +3 -1
  50. package/dist/src/helpers/CharacterCounter.d.ts +16 -0
  51. package/dist/src/helpers/CharacterCounter.test.d.ts +1 -0
  52. package/dist/src/hooks/useBackCloses.hook.d.ts +47 -2
  53. package/dist/src/hooks/useTopLayer.hook.d.ts +6 -0
  54. package/dist/src/index.d.ts +2 -0
  55. package/dist/tailwind.config.d.ts +14 -0
  56. package/package.json +1 -1
  57. package/src/styles/fieldWidthTokens.css +8 -0
  58. package/src/styles/index.css +1 -0
  59. package/tw-configs/twConfigs.json +14 -0
@@ -2,44 +2,45 @@ import { cn as p } from "../../../helpers/cn.js";
2
2
  import { SearchIcon as u } from "../../icons/search-icon/SearchIcon.js";
3
3
  import { CloseIcon as f } from "../../icons/close-icon/CloseIcon.js";
4
4
  import { StyledInputField as v } from "../input-field/StyledInputField.js";
5
- import { useState as y } from "react";
5
+ import { useState as x } from "react";
6
6
  import { jsx as t } from "react/jsx-runtime";
7
- var F = ({ value: r, onClear: d, label: i, onFocus: c, onBlur: h, slotProps: o, ...a }) => {
8
- const [m, l] = y(!1), n = m || r, s = typeof i == "string" ? i : void 0;
7
+ var F = ({ value: a, onClear: d, label: l, onFocus: c, onBlur: h, slotProps: n, ...r }) => {
8
+ const [m, i] = x(!1), o = m || a, s = typeof l == "string" ? l : void 0;
9
9
  return /* @__PURE__ */ t("div", {
10
10
  className: "relative w-full",
11
11
  children: /* @__PURE__ */ t(v, {
12
12
  size: "small",
13
13
  variant: "outlined",
14
- value: r,
14
+ labelPlacement: "floating",
15
+ value: a,
15
16
  reserveHelperText: !1,
16
- label: n ? i : void 0,
17
- placeholder: n ? void 0 : s,
17
+ label: o ? l : void 0,
18
+ placeholder: o ? void 0 : s,
18
19
  onFocus: (e) => {
19
- l(!0), c?.(e);
20
+ i(!0), c?.(e);
20
21
  },
21
22
  onBlur: (e) => {
22
- l(!1), h?.(e);
23
+ i(!1), h?.(e);
23
24
  },
24
25
  slotProps: {
25
- ...o,
26
+ ...n,
26
27
  htmlInput: {
27
- "aria-label": n ? void 0 : s,
28
- ...o?.htmlInput,
28
+ "aria-label": o ? void 0 : s,
29
+ ...n?.htmlInput,
29
30
  style: {
30
31
  overflow: "hidden",
31
32
  textOverflow: "ellipsis",
32
33
  whiteSpace: "nowrap",
33
- ...r ? { paddingRight: 40 } : {},
34
- ...o?.htmlInput?.style
34
+ ...a ? { paddingRight: 40 } : {},
35
+ ...n?.htmlInput?.style
35
36
  }
36
37
  },
37
38
  input: {
38
- endAdornment: r ? /* @__PURE__ */ t("button", {
39
+ endAdornment: a ? /* @__PURE__ */ t("button", {
39
40
  type: "button",
40
41
  "aria-label": "Clear",
41
42
  "data-testid": "styled-search-clear-icon",
42
- className: p("asma-pressable", "cursor-pointer rounded-full border-0 bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", r ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0", a.readOnly && "-translate-x-[6.5px]"),
43
+ className: p("asma-pressable", "cursor-pointer rounded-full border-0 bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", a ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0", r.readOnly && "-translate-x-[6.5px]"),
43
44
  style: {
44
45
  width: 24,
45
46
  height: 24,
@@ -55,7 +56,7 @@ var F = ({ value: r, onClear: d, label: i, onFocus: c, onBlur: h, slotProps: o,
55
56
  className: "pointer-events-none"
56
57
  })
57
58
  }) : null,
58
- startAdornment: n ? void 0 : /* @__PURE__ */ t("span", {
59
+ startAdornment: o ? void 0 : /* @__PURE__ */ t("span", {
59
60
  "data-testid": "styled-search-icon",
60
61
  className: "flex items-center",
61
62
  children: /* @__PURE__ */ t(u, {
@@ -65,13 +66,14 @@ var F = ({ value: r, onClear: d, label: i, onFocus: c, onBlur: h, slotProps: o,
65
66
  className: "pointer-events-none"
66
67
  })
67
68
  }),
68
- ...o?.input
69
+ ...n?.input
69
70
  }
70
71
  },
71
- ...a,
72
+ ...r,
72
73
  sx: {
73
- width: a.fullWidth ? "100%" : "var(--dynamic-toolbar-search-width, 160px)",
74
- ...a.sx
74
+ width: r.fullWidth ? "100%" : "var(--dynamic-toolbar-search-width, 160px)",
75
+ maxWidth: "none",
76
+ ...r.sx
75
77
  }
76
78
  })
77
79
  });
@@ -1,211 +1,213 @@
1
- import { cn as h } from "../../../helpers/cn.js";
1
+ import { cn as x } from "../../../helpers/cn.js";
2
2
  import { resolveSx as je } from "../../../helpers/sx.js";
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";
3
+ import { TOP_LAYER_PROPS as Ue, TOP_LAYER_RESET_STYLE as Ve, getOpenModalDialogAncestor as se, shouldUsePopoverTopLayer as We, useTopLayerRef as Ye } from "../../../hooks/useTopLayer.hook.js";
4
4
  import { ChevronDownIcon as ze } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
5
5
  import { CloseIcon as Ke } from "../../icons/close-icon/CloseIcon.js";
6
- import { useBackCloses as We } from "../../../hooks/useBackCloses.hook.js";
7
- import { HelperRow as Ge } from "../../../helpers/HelperRow.js";
8
- import { useHelperRowBudget as Je } from "../../../helpers/useHelperRowBudget.js";
9
- import { useHelperSlot as Qe } from "../../../helpers/useHelperSlot.js";
10
- import { outlineClass as Xe } from "../field-styles.js";
11
- import { useFormControlContext as Ze } from "../../miscellaneous/FormControlContext.js";
12
- import { Children as se, cloneElement as et, isValidElement as p, useEffect as H, useId as tt, useRef as ot, useState as x } from "react";
13
- import { jsx as l, jsxs as L } from "react/jsx-runtime";
14
- import { FloatingPortal as rt, autoUpdate as st, flip as nt, offset as lt, shift as it, size as at, useClick as ct, useDismiss as dt, useFloating as ut, useInteractions as ft, useMergeRefs as pt, useRole as mt } from "@floating-ui/react";
15
- var It = ({ 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 }) => {
16
- const u = Ze(), A = `${T}-listbox`, R = ge === "standard", m = le ?? u?.error ?? !1, n = de ?? u?.disabled ?? !1, Y = m ? ie ?? j : j, { show: F, role: xe } = Qe("StyledSelect", m, Y, ae, c), z = tt(), { fieldRef: we, rowRef: ve, rowStyle: Ae } = Je(ce && F), [r, K] = x(!1), [k, I] = x(!1), [g, 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, y = se.toArray(q), G = (e) => d ? Array.isArray(o) && o.includes(e) : e === o, s = y.flatMap((e, t) => p(e) && !e.props.disabled ? [t] : []), _ = y.findIndex((e) => p(e) && G(e.props.value)), ke = (e = 1) => s.includes(_) ? _ : s[e === 1 ? 0 : s.length - 1] ?? null, D = g === null ? void 0 : `${A}-option-${g}`, E = ot(null), f = (e) => {
17
- K(e), e || b(null);
18
- }, { refs: { domReference: De, reference: J, setFloating: Se, setReference: Ce }, floatingStyles: Fe, context: P } = ut({
6
+ import { useBackCloses as Ge } from "../../../hooks/useBackCloses.hook.js";
7
+ import { HelperRow as Je } from "../../../helpers/HelperRow.js";
8
+ import { useHelperRowBudget as Qe } from "../../../helpers/useHelperRowBudget.js";
9
+ import { useHelperSlot as Xe } from "../../../helpers/useHelperSlot.js";
10
+ import { fieldWidthStyle as Ze, outlineClass as et } from "../field-styles.js";
11
+ import { useFormControlContext as tt } from "../../miscellaneous/FormControlContext.js";
12
+ import { Children as le, cloneElement as ot, isValidElement as m, useEffect as H, useId as rt, useRef as st, useState as v } from "react";
13
+ import { jsx as i, jsxs as L } from "react/jsx-runtime";
14
+ import { FloatingPortal as lt, autoUpdate as nt, flip as it, offset as at, shift as ct, size as dt, useClick as ut, useDismiss as ft, useFloating as pt, useInteractions as mt, useMergeRefs as bt, useRole as gt } from "@floating-ui/react";
15
+ var Et = ({ dataTest: T, value: q, defaultValue: ne, onChange: M, error: ie, errorText: ae, helperText: $, reserveHelperText: ce, expandHelperText: de = !0, allowClear: j, disabled: ue, readOnly: c, name: w, placeholder: D, displayEmpty: C, multiple: d, renderValue: U, width: V = "full", fullWidth: ht, className: fe, style: pe, sx: me, variant: be, children: W, MenuProps: ge, onFocus: he, onBlur: ye, labelId: A, required: xe }) => {
16
+ const n = tt(), R = `${T}-listbox`, u = be === "standard", b = ie ?? n?.error ?? !1, l = ue ?? n?.disabled ?? !1, Y = b ? ae ?? $ : $, { show: F, role: ve } = Xe("StyledSelect", b, Y, ce, c), z = rt(), { fieldRef: we, rowRef: Ae, rowStyle: Re } = Qe(de && F), [r, K] = v(!1), [k, I] = v(!1), [g, h] = v(null), [ke, G] = v(ne), _ = q !== void 0, o = _ ? q : ke, f = Array.isArray(o) ? o.length > 0 : o !== void 0 && o !== "" && o !== null, y = le.toArray(W), J = (e) => d ? Array.isArray(o) && o.includes(e) : e === o, s = y.flatMap((e, t) => m(e) && !e.props.disabled ? [t] : []), O = y.findIndex((e) => m(e) && J(e.props.value)), Se = (e = 1) => s.includes(O) ? O : s[e === 1 ? 0 : s.length - 1] ?? null, S = g === null ? void 0 : `${R}-option-${g}`, E = st(null), p = (e) => {
17
+ K(e), e || h(null);
18
+ }, { refs: { domReference: De, reference: Q, setFloating: Ce, setReference: Fe }, floatingStyles: Ie, context: P } = pt({
19
19
  open: r,
20
- onOpenChange: f,
20
+ onOpenChange: p,
21
21
  placement: "bottom-start",
22
22
  strategy: "fixed",
23
- whileElementsMounted: st,
23
+ whileElementsMounted: nt,
24
24
  middleware: [
25
- lt(0),
26
- nt({ padding: 8 }),
25
+ at(0),
27
26
  it({ padding: 8 }),
28
- at({ apply({ rects: e, elements: t }) {
27
+ ct({ padding: 8 }),
28
+ dt({ apply({ rects: e, elements: t }) {
29
29
  t.floating.style.minWidth = `${e.reference.width}px`;
30
30
  } })
31
31
  ]
32
- }), { getReferenceProps: Ie, getFloatingProps: Oe } = ft([
33
- ct(P, { enabled: !n && !c }),
34
- dt(P),
35
- mt(P, { role: "listbox" })
32
+ }), { getReferenceProps: _e, getFloatingProps: Oe } = mt([
33
+ ut(P, { enabled: !l && !c }),
34
+ ft(P),
35
+ gt(P, { role: "listbox" })
36
36
  ]);
37
- We({
37
+ Ge({
38
38
  active: r,
39
- requestClose: () => f(!1)
39
+ requestClose: () => p(!1)
40
40
  });
41
- const [Q, X] = x(), N = qe(Q), _e = pt([Ye(Se, N), E]);
42
- H(() => u?.setFocused(r || k), [
41
+ const [X, Z] = v(), N = We(X), Ee = bt([Ye(Ce, N), E]);
42
+ H(() => n?.setFocused(r || k), [
43
43
  r,
44
44
  k,
45
- u
46
- ]), H(() => u?.setFilled(i || !!S || !!C), [
47
- i,
48
- S,
45
+ n
46
+ ]), H(() => n?.setFilled(f || !!D || !!C), [
47
+ f,
48
+ D,
49
49
  C,
50
- u
50
+ n
51
51
  ]), H(() => {
52
52
  if (!r) return;
53
53
  const e = requestAnimationFrame(() => {
54
- const t = D ? document.getElementById(D) : E.current?.querySelector('[role="option"][aria-selected="true"]');
54
+ const t = S ? document.getElementById(S) : E.current?.querySelector('[role="option"][aria-selected="true"]');
55
55
  t && E.current?.contains(t) && t.scrollIntoView({ block: "nearest" });
56
56
  });
57
57
  return () => cancelAnimationFrame(e);
58
- }, [D, r]);
59
- const Z = (e, t, a = !d) => {
60
- const oe = d ? Array.isArray(o) && o.includes(e) ? o.filter(($e) => $e !== e) : [...Array.isArray(o) ? o : [], e] : e;
61
- O || W(oe), $?.({ target: {
62
- value: oe,
58
+ }, [S, r]);
59
+ const ee = (e, t, a = !d) => {
60
+ const re = d ? Array.isArray(o) && o.includes(e) ? o.filter(($e) => $e !== e) : [...Array.isArray(o) ? o : [], e] : e;
61
+ _ || G(re), M?.({ target: {
62
+ value: re,
63
63
  name: w
64
- } }, t), a && (f(!1), requestAnimationFrame(() => De.current?.focus()));
65
- }, ee = () => {
64
+ } }, t), a && (p(!1), requestAnimationFrame(() => De.current?.focus()));
65
+ }, te = () => {
66
66
  const e = d ? [] : "";
67
- O || W(e), $?.({ target: {
67
+ _ || G(e), M?.({ target: {
68
68
  value: e,
69
69
  name: w
70
- } }, null), f(!1), I(!1);
71
- }, Ee = se.map(q, (e, t) => {
72
- if (!p(e)) return e;
70
+ } }, null), p(!1), I(!1);
71
+ }, Pe = le.map(W, (e, t) => {
72
+ if (!m(e)) return e;
73
73
  const a = e.props.value;
74
- return et(e, {
75
- id: `${A}-option-${t}`,
74
+ return ot(e, {
75
+ id: `${R}-option-${t}`,
76
76
  active: t === g,
77
- selected: G(a),
77
+ selected: J(a),
78
78
  onClick: () => {
79
- b(null), Z(a, e.props.children);
79
+ h(null), ee(a, e.props.children);
80
80
  }
81
81
  });
82
- }), Pe = y.find((e) => p(e) && e.props.value === o), Ne = V ? V(o) : d && Array.isArray(o) ? y.filter((e) => p(e) && o.includes(e.props.value)).map((e) => {
82
+ }), Ne = y.find((e) => m(e) && e.props.value === o), Be = U ? U(o) : d && Array.isArray(o) ? y.filter((e) => m(e) && o.includes(e.props.value)).map((e) => {
83
83
  const t = e.props.children;
84
84
  return typeof t == "string" || typeof t == "number" ? String(t) : "";
85
- }).join(", ") : Pe?.props.children, Be = (e) => {
86
- s.length !== 0 && b((t) => {
87
- const a = s.indexOf(t ?? _ ?? -1);
85
+ }).join(", ") : Ne?.props.children, He = (e) => {
86
+ s.length !== 0 && h((t) => {
87
+ const a = s.indexOf(t ?? O ?? -1);
88
88
  return a === -1 ? s[e === 1 ? 0 : s.length - 1] ?? null : s[Math.min(Math.max(a + e, 0), s.length - 1)] ?? null;
89
89
  });
90
- }, te = (e) => {
90
+ }, oe = (e) => {
91
91
  const t = g === null ? void 0 : y[g];
92
- !p(t) || t.props.disabled || Z(t.props.value, t.props.children, e);
93
- }, He = (e = 1) => {
94
- X(re(J.current)), b(ke(e)), K(!0);
95
- }, Le = (e) => {
96
- if ((e.key === "Backspace" || e.key === "Delete") && U && i && !n && !c) {
97
- e.preventDefault(), ee();
92
+ !m(t) || t.props.disabled || ee(t.props.value, t.props.children, e);
93
+ }, Le = (e = 1) => {
94
+ Z(se(Q.current)), h(Se(e)), K(!0);
95
+ }, Te = (e) => {
96
+ if ((e.key === "Backspace" || e.key === "Delete") && j && f && !l && !c) {
97
+ e.preventDefault(), te();
98
98
  return;
99
99
  }
100
- if (!(n || c)) {
100
+ if (!(l || c)) {
101
101
  if (!r && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
102
- e.preventDefault(), He(e.key === "ArrowDown" ? 1 : -1);
102
+ e.preventDefault(), Le(e.key === "ArrowDown" ? 1 : -1);
103
103
  return;
104
104
  }
105
- r && (e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), Be(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(), f(!1)) : e.key === "Tab" && f(!1));
105
+ r && (e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), He(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), h(s[e.key === "Home" ? 0 : s.length - 1] ?? null)) : e.key === " " ? (e.preventDefault(), oe(!1)) : e.key === "Enter" ? (e.preventDefault(), oe(!0)) : e.key === "Escape" ? (e.preventDefault(), p(!1)) : e.key === "Tab" && p(!1));
106
106
  }
107
- }, B = R && (r || k), Te = n ? "text-delta-300" : B ? "text-gama-500" : "text-delta-800", Me = n ? "text-delta-300" : "text-delta-700";
107
+ }, B = u && (r || k), qe = l ? "text-delta-300" : B ? "text-gama-500" : "text-delta-800", Me = l ? "text-delta-300" : "text-delta-700";
108
108
  return /* @__PURE__ */ L("div", {
109
109
  ref: we,
110
- className: h("group relative inline-flex flex-col", ue && "w-full", fe),
110
+ className: x("group relative flex-col", u ? "inline-flex" : "flex", fe),
111
+ "data-field-width": u ? void 0 : V,
111
112
  style: {
113
+ ...u ? {} : Ze(V),
112
114
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
113
115
  ...je(me),
114
116
  ...pe
115
117
  },
116
118
  children: [
117
119
  /* @__PURE__ */ L("button", {
118
- ref: Ce,
120
+ ref: Fe,
119
121
  type: "button",
120
122
  "data-testid": T,
121
- ...Ie({
122
- onClick: () => X(re(J.current)),
123
- onKeyDown: Le
123
+ ..._e({
124
+ onClick: () => Z(se(Q.current)),
125
+ onKeyDown: Te
124
126
  }),
125
127
  role: "combobox",
126
128
  "aria-haspopup": "listbox",
127
129
  "aria-expanded": r,
128
- "aria-controls": r ? A : void 0,
129
- "aria-activedescendant": r ? D : void 0,
130
- "aria-labelledby": v,
131
- "aria-label": v ? void 0 : w,
132
- "aria-invalid": m ? !0 : void 0,
130
+ "aria-controls": r ? R : void 0,
131
+ "aria-activedescendant": r ? S : void 0,
132
+ "aria-labelledby": A ?? n?.labelId,
133
+ "aria-label": A ? void 0 : w,
134
+ "aria-invalid": b ? !0 : void 0,
135
+ "aria-required": xe ?? n?.required ? !0 : void 0,
133
136
  "aria-describedby": F ? z : void 0,
134
- "aria-disabled": n ? !0 : void 0,
135
- disabled: n,
137
+ "aria-disabled": l ? !0 : void 0,
138
+ disabled: l,
136
139
  onFocus: (e) => {
137
- I(!0), ye?.(e);
140
+ I(!0), he?.(e);
138
141
  },
139
142
  onBlur: (e) => {
140
- I(!1), he?.(e);
143
+ I(!1), ye?.(e);
141
144
  },
142
- style: { minWidth: i && !R ? 105 : void 0 },
143
- 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", B ? "bg-gama-50" : "bg-transparent", Te, R && "min-w-0", n && "cursor-not-allowed", c && "pointer-events-none"),
145
+ className: x("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", B ? "bg-gama-50" : "bg-transparent", qe, u && "min-w-0", l && "cursor-not-allowed", c && "pointer-events-none"),
144
146
  children: [
145
- /* @__PURE__ */ l("span", {
146
- className: h("min-w-0 flex-1 truncate", !i && "text-delta-500"),
147
- children: i || C ? Ne : S
147
+ /* @__PURE__ */ i("span", {
148
+ className: x("min-w-0 flex-1 truncate", !f && "text-delta-500"),
149
+ children: f || C ? Be : D
148
150
  }),
149
151
  /* @__PURE__ */ L("span", {
150
152
  className: "flex items-center gap-1",
151
- children: [U && i && !n && /* @__PURE__ */ l("span", {
153
+ children: [j && f && !l && /* @__PURE__ */ i("span", {
152
154
  "aria-hidden": "true",
153
155
  "data-testid": "select-clear-button",
154
156
  className: "invisible flex items-center justify-center rounded-full p-[2px] group-focus-within:visible hover:bg-gama-100",
155
157
  onClick: (e) => {
156
- e.stopPropagation(), ee();
158
+ e.stopPropagation(), te();
157
159
  },
158
- children: /* @__PURE__ */ l(Ke, {
160
+ children: /* @__PURE__ */ i(Ke, {
159
161
  width: 18,
160
162
  height: 18
161
163
  })
162
- }), /* @__PURE__ */ l(ze, {
164
+ }), /* @__PURE__ */ i(ze, {
163
165
  width: 24,
164
166
  height: 24,
165
- className: h("shrink-0 transition-transform", B ? "text-gama-500" : Me, r && "flip-180")
167
+ className: x("shrink-0 transition-transform", B ? "text-gama-500" : Me, r && "flip-180")
166
168
  })]
167
169
  }),
168
- /* @__PURE__ */ l("div", { className: Xe({
170
+ /* @__PURE__ */ i("div", { className: et({
169
171
  focused: r || k,
170
- error: m,
171
- disabled: n,
172
+ error: b,
173
+ disabled: l,
172
174
  readOnly: c,
173
- borderless: R
175
+ borderless: u
174
176
  }) })
175
177
  ]
176
178
  }),
177
- r && /* @__PURE__ */ l(rt, {
178
- root: Q,
179
- children: /* @__PURE__ */ l("ul", {
180
- ref: _e,
179
+ r && /* @__PURE__ */ i(lt, {
180
+ root: X,
181
+ children: /* @__PURE__ */ i("ul", {
182
+ ref: Ee,
181
183
  ...Oe(),
182
- id: A,
184
+ id: R,
183
185
  role: "listbox",
184
186
  "aria-multiselectable": d ? !0 : void 0,
185
- "aria-labelledby": v,
186
- "aria-label": v ? void 0 : w,
187
+ "aria-labelledby": A ?? n?.labelId,
188
+ "aria-label": A ? void 0 : w,
187
189
  ...N ? Ue : {},
188
190
  style: {
189
191
  ...N ? Ve : {},
190
- ...Fe,
192
+ ...Ie,
191
193
  fontFamily: "Roboto, Helvetica, Arial, sans-serif"
192
194
  },
193
- 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),
194
- children: Ee
195
+ className: x("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)]", ge?.className),
196
+ children: Pe
195
197
  })
196
198
  }),
197
- F && /* @__PURE__ */ l(Ge, {
198
- ref: ve,
199
+ F && /* @__PURE__ */ i(Je, {
200
+ ref: Ae,
199
201
  id: z,
200
- role: xe,
201
- error: m,
202
+ role: ve,
203
+ error: b,
202
204
  message: Y,
203
205
  className: "m-0 mr-[14px] box-border items-center",
204
- style: Ae
206
+ style: Re
205
207
  })
206
208
  ]
207
209
  });
208
210
  };
209
211
  export {
210
- It as StyledSelect
212
+ Et as StyledSelect
211
213
  };