asma-ui-core 3.108.3 → 3.109.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 (24) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +18 -18
  3. package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +52 -51
  4. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +66 -65
  5. package/dist/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.js +13 -12
  6. package/dist/components/inputs/dynamic-select/components/DynamicSelectTitle.js +9 -0
  7. package/dist/components/inputs/select/StyledSelect.js +56 -50
  8. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +102 -96
  9. package/dist/components/navigation/drawer/StyledDrawer.js +55 -51
  10. package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +158 -118
  11. package/dist/components/utils/popover/PopoverSheet.js +95 -85
  12. package/dist/components/utils/popover/StyledPopover.js +81 -71
  13. package/dist/datetime/components/date-picker/StyledDatePicker.js +36 -27
  14. package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +9 -8
  15. package/dist/datetime/components/time-picker/StyledTimePicker.js +75 -64
  16. package/dist/datetime/hooks/useBackNavigationClose.hook.js +19 -0
  17. package/dist/src/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.d.ts +2 -2
  18. package/dist/src/components/inputs/dynamic-select/components/DynamicSelectTitle.d.ts +14 -0
  19. package/dist/src/components/inputs/dynamic-select/types.d.ts +8 -2
  20. package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +2 -0
  21. package/dist/src/components/utils/bottom-sheet/StyledBottomSheet.d.ts +6 -2
  22. package/dist/src/components/utils/popover/StyledPopover.d.ts +3 -1
  23. package/dist/src/datetime/hooks/useBackNavigationClose.hook.d.ts +5 -0
  24. package/package.json +1 -1
@@ -1,43 +1,43 @@
1
1
  import { cn as o } from "../../../helpers/cn.js";
2
- import { StyledChip as f } from "../chip/StyledChip.js";
3
- import { StyledCheckbox as v } from "../../inputs/checkbox/base-ui/StyledCheckbox.js";
2
+ import { StyledChip as v } from "../chip/StyledChip.js";
3
+ import { StyledCheckbox as f } from "../../inputs/checkbox/base-ui/StyledCheckbox.js";
4
4
  import { StyledRadio as x } from "../../inputs/radio-button/base-ui/StyledRadio.js";
5
5
  import i from "./StyledInteractiveChip.module.js";
6
- import { forwardRef as y } from "react";
6
+ import { forwardRef as _ } from "react";
7
7
  import { jsx as r } from "react/jsx-runtime";
8
- var S = "[&[data-testid][role]]:border-2 [&[data-testid][role]]:border-gama-400 [&[data-testid][role]]:bg-gama-25", C = { paddingLeft: "6px" }, h = y(({ type: l = "checkbox", checked: a, size: d = "small", ariaLabel: n, ...e }, c) => {
9
- const t = l === "checkbox", m = n ?? (typeof e.label == "string" ? e.label : void 0), s = !e.readOnly && !t && !!a, b = t ? /* @__PURE__ */ r(v, {
10
- dataTest: e.dataTest,
8
+ var y = "[&[data-testid][role]]:border-gama-400 [&[data-testid][role]]:shadow-[inset_0_0_0_1px_var(--colors-gama-400)] [&[data-testid][role]]:bg-gama-25", S = { paddingLeft: "6px" }, R = _(({ type: l = "checkbox", checked: e, size: d = "small", ariaLabel: n, ...a }, c) => {
9
+ const t = l === "checkbox", m = n ?? (typeof a.label == "string" ? a.label : void 0), s = !a.readOnly && !t && !!e, b = t ? /* @__PURE__ */ r(f, {
10
+ dataTest: a.dataTest,
11
11
  disableRipple: !0,
12
- checked: a,
12
+ checked: e,
13
13
  size: d,
14
- readOnly: e.readOnly,
14
+ readOnly: a.readOnly,
15
15
  decorative: !0,
16
16
  className: o("pointer-events-none", i.control)
17
17
  }) : /* @__PURE__ */ r(x, {
18
- dataTest: e.dataTest,
19
- checked: a,
18
+ dataTest: a.dataTest,
19
+ checked: e,
20
20
  size: d,
21
21
  decorative: !0,
22
22
  className: o("pointer-events-none", i.control)
23
23
  });
24
- return /* @__PURE__ */ r(f, {
24
+ return /* @__PURE__ */ r(v, {
25
25
  ref: c,
26
26
  "aria-label": m,
27
27
  role: l,
28
- "aria-checked": !!a,
29
- "aria-readonly": t ? e.readOnly : void 0,
28
+ "aria-checked": !!e,
29
+ "aria-readonly": t ? a.readOnly : void 0,
30
30
  avatar: b,
31
31
  clickable: !0,
32
32
  tabIndex: 0,
33
- ...e,
34
- className: o(s && S, e.className),
33
+ ...a,
34
+ className: o(s && y, a.className),
35
35
  sx: {
36
- ...C,
37
- ...e.sx
36
+ ...S,
37
+ ...a.sx
38
38
  }
39
39
  });
40
40
  });
41
41
  export {
42
- h as StyledInteractiveChip
42
+ R as StyledInteractiveChip
43
43
  };
@@ -1,28 +1,29 @@
1
1
  import { cn as v } from "../../../../helpers/cn.js";
2
- import { StyledTooltip as J } from "../../../data-display/tooltip/StyledTooltip.js";
3
- import { CloseIcon as j } from "../../../icons/close-icon/CloseIcon.js";
4
- import { ErrorOutlineIcon as P } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
5
- import { StyledChip as Q } from "../../../data-display/chip/StyledChip.js";
6
- import { StyledInteractiveChip as O } from "../../../data-display/interactive-chip/StyledInteractiveChip.js";
7
- import { StyledButton as U } from "../../button/StyledButton.js";
8
- import { useHelperAlertRole as X } from "../../../../helpers/useHelperAlertRole.js";
9
- import { warnMissingErrorMessage as Y } from "../../../../helpers/warnMissingErrorMessage.js";
10
- import { useWrap as Z } from "../helpers/useWrap.js";
2
+ import { StyledTooltip as P } from "../../../data-display/tooltip/StyledTooltip.js";
3
+ import { CloseIcon as k } from "../../../icons/close-icon/CloseIcon.js";
4
+ import { ErrorOutlineIcon as Q } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
5
+ import { StyledChip as U } from "../../../data-display/chip/StyledChip.js";
6
+ import { StyledInteractiveChip as j } from "../../../data-display/interactive-chip/StyledInteractiveChip.js";
7
+ import { StyledButton as X } from "../../button/StyledButton.js";
8
+ import { useHelperAlertRole as Y } from "../../../../helpers/useHelperAlertRole.js";
9
+ import { warnMissingErrorMessage as Z } from "../../../../helpers/warnMissingErrorMessage.js";
10
+ import { useWrap as _ } from "../helpers/useWrap.js";
11
+ import { DynamicSelectTitle as ee } from "./DynamicSelectTitle.js";
11
12
  import { Skeleton as N } from "../../../mui-compat/Skeleton.js";
12
- import { forwardRef as _, useEffect as ee, useId as te } from "react";
13
+ import { forwardRef as te, useEffect as le, useId as re } from "react";
13
14
  import { jsx as t, jsxs as T } from "react/jsx-runtime";
14
- var he = _((V, A) => {
15
- const { options: d, dataTest: R, value: r, readOnly: n, multiple: i, title: C, disabled: b, onChange: p, required: D, error: f, helperText: I, valueKey: E = "value", labelKey: L = "label", renderLabel: o, getOptionTooltip: k, loading: $, size: g, locale: z = "en", clearSelectionLabel: B } = V, q = te();
16
- Y("DynamicInteractiveChipGroup", f, I);
17
- const G = X(f), { containerRef: m, wrapDisabled: w } = Z({ dependencyList: [d, d.length] });
18
- ee(() => {
15
+ var ge = te((O, V) => {
16
+ const { options: d, dataTest: A, value: r, readOnly: i, multiple: n, title: D, titleSize: R, disabled: b, onChange: p, required: z, error: f, helperText: S, valueKey: E = "value", labelKey: L = "label", renderLabel: o, getOptionTooltip: C, loading: $, size: g, locale: B = "en", clearSelectionLabel: q } = O, G = re();
17
+ Z("DynamicInteractiveChipGroup", f, S);
18
+ const K = Y(f), { containerRef: m, wrapDisabled: y } = _({ dependencyList: [d, d.length] });
19
+ le(() => {
19
20
  m.current && (m.current.inert = !0);
20
21
  }, [m]);
21
- const u = (e) => typeof e == "object" ? e?.[L]?.toString() ?? "" : e?.toString() ?? "", y = (e) => typeof e == "object" ? e?.[E] : e, c = (e) => {
22
- const l = y(e);
22
+ const u = (e) => typeof e == "object" ? e?.[L]?.toString() ?? "" : e?.toString() ?? "", w = (e) => typeof e == "object" ? e?.[E] : e, c = (e) => {
23
+ const l = w(e);
23
24
  return l == null ? "" : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : e == null ? "" : u(e);
24
- }, s = (e, l) => y(e) === y(l), K = i ? Array.isArray(r) && r.length > 0 : r != null, M = (e) => {
25
- if (!i) {
25
+ }, s = (e, l) => w(e) === w(l), M = n ? Array.isArray(r) && r.length > 0 : r != null, F = (e) => {
26
+ if (!n) {
26
27
  const a = s(e, r) ? null : e;
27
28
  if (a === null) return;
28
29
  p(a);
@@ -30,30 +31,30 @@ var he = _((V, A) => {
30
31
  }
31
32
  const l = r ?? [];
32
33
  p(l.find((a) => s(a, e)) ? l.filter((a) => !s(a, e)) : [...l, e]);
33
- }, h = n ? d.filter((e) => !!(i ? r?.find((l) => s(l, e)) : s(r, e))) : d, F = h.findIndex((e) => !(typeof e == "object" && e?.disabled) && !n);
34
+ }, h = i ? d.filter((e) => !!(n ? r?.find((l) => s(l, e)) : s(r, e))) : d, H = h.findIndex((e) => !(typeof e == "object" && e?.disabled) && !i);
34
35
  return /* @__PURE__ */ T("div", {
35
- "data-testid": `${R}-dynamic-radio-group`,
36
+ "data-testid": `${A}-dynamic-radio-group`,
36
37
  className: "relative flex flex-col gap-y-1",
37
38
  children: [
38
- C && /* @__PURE__ */ t("span", {
39
- className: "text-base font-semibold text-delta-800",
40
- children: C
39
+ /* @__PURE__ */ t(ee, {
40
+ title: D,
41
+ titleSize: R
41
42
  }),
42
43
  /* @__PURE__ */ t("div", {
43
44
  "aria-hidden": !0,
44
45
  ref: m,
45
46
  className: "pointer-events-none absolute left-0 top-0 flex flex-wrap gap-2 opacity-0",
46
47
  style: { width: "100%" },
47
- children: h.map((e) => /* @__PURE__ */ t(O, {
48
+ children: h.map((e) => /* @__PURE__ */ t(j, {
48
49
  className: "w-fit",
49
- readOnly: n,
50
- type: i ? "checkbox" : "radio",
50
+ readOnly: i,
51
+ type: n ? "checkbox" : "radio",
51
52
  dataTest: `ic-${c(e)}-hidden`,
52
53
  label: o ? o(e) : u(e)
53
54
  }, c(e)))
54
55
  }),
55
56
  /* @__PURE__ */ t("div", {
56
- className: v("flex flex-wrap gap-2", w && "flex-col gap-1"),
57
+ className: v("flex flex-wrap gap-2", y && "flex-col gap-1"),
57
58
  children: $ ? /* @__PURE__ */ T("div", {
58
59
  className: "flex flex-wrap gap-2",
59
60
  children: [
@@ -62,74 +63,74 @@ var he = _((V, A) => {
62
63
  /* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" })
63
64
  ]
64
65
  }) : h?.length ? h.map((e, l) => {
65
- const a = !!(i ? r?.find((W) => s(W, e)) : s(r, e)), H = k ? k(e) : null;
66
- if (n && !a) return null;
67
- const x = typeof e == "object" ? !!e?.disabled : !1, S = !x && !n && l === F ? A : void 0;
68
- return /* @__PURE__ */ t(J, {
69
- title: H,
66
+ const a = !!(n ? r?.find((J) => s(J, e)) : s(r, e)), W = C ? C(e) : null;
67
+ if (i && !a) return null;
68
+ const x = typeof e == "object" ? !!e?.disabled : !1, I = !x && !i && l === H ? V : void 0;
69
+ return /* @__PURE__ */ t(P, {
70
+ title: W,
70
71
  arrow: !0,
71
72
  children: /* @__PURE__ */ t("span", {
72
73
  className: v(x && "cursor-not-allowed"),
73
- children: n && !w ? /* @__PURE__ */ t(Q, {
74
- ref: S,
74
+ children: i && !y ? /* @__PURE__ */ t(U, {
75
+ ref: I,
75
76
  disabled: !!b || x,
76
77
  classes: { root: "min-h-[32px] h-full" },
77
78
  className: "w-fit",
78
79
  dataTest: `ic-${c(e)}`,
79
80
  label: o ? o(e) : u(e)
80
- }) : /* @__PURE__ */ t(O, {
81
- ref: S,
81
+ }) : /* @__PURE__ */ t(j, {
82
+ ref: I,
82
83
  disabled: !!b || x,
83
- classes: w ? {
84
+ classes: y ? {
84
85
  root: "border-none outline-none bg-transparent w-full flex justify-start h-full min-h-[40px] shadow-none",
85
86
  label: "block whitespace-normal break-words overflow-visible"
86
87
  } : { root: "min-h-[32px] h-full" },
87
88
  className: "w-fit",
88
- readOnly: n,
89
- type: i ? "checkbox" : "radio",
89
+ readOnly: i,
90
+ type: n ? "checkbox" : "radio",
90
91
  dataTest: `ic-${c(e)}`,
91
92
  checked: a,
92
93
  size: g,
93
- onClick: () => M(e),
94
+ onClick: () => F(e),
94
95
  label: o ? o(e) : u(e)
95
96
  })
96
97
  })
97
98
  }, c(e));
98
99
  }) : /* @__PURE__ */ t("span", { children: "-" })
99
100
  }),
100
- !D && K && !n && !b && /* @__PURE__ */ t(U, {
101
+ !z && M && !i && !b && /* @__PURE__ */ t(X, {
101
102
  dataTest: "clear-selection-btn",
102
103
  variant: "text",
103
- startIcon: g === "medium" ? /* @__PURE__ */ t(j, {
104
+ startIcon: g === "medium" ? /* @__PURE__ */ t(k, {
104
105
  height: 24,
105
106
  width: 24,
106
107
  className: "size-6"
107
- }) : /* @__PURE__ */ t(j, {
108
+ }) : /* @__PURE__ */ t(k, {
108
109
  height: 20,
109
110
  width: 20,
110
111
  className: "size-5"
111
112
  }),
112
113
  className: "w-fit",
113
114
  size: g,
114
- onClick: () => p(i ? [] : null),
115
- children: B ?? (z === "en" ? "Clear selection" : "Fjern valget")
115
+ onClick: () => p(n ? [] : null),
116
+ children: q ?? (B === "en" ? "Clear selection" : "Fjern valget")
116
117
  }),
117
118
  /* @__PURE__ */ T("div", {
118
- id: q,
119
- role: G,
119
+ id: G,
120
+ role: K,
120
121
  className: v("flex min-h-[24px] items-center gap-1 pt-1 text-sm/5 text-delta-600", f && "text-error-500"),
121
- children: [f && /* @__PURE__ */ t(P, {
122
+ children: [f && /* @__PURE__ */ t(Q, {
122
123
  width: 20,
123
124
  height: 20,
124
125
  className: "min-w-5"
125
126
  }), /* @__PURE__ */ t("span", {
126
127
  className: "line-clamp-1",
127
- children: I
128
+ children: S
128
129
  })]
129
130
  })
130
131
  ]
131
132
  });
132
133
  });
133
134
  export {
134
- he as DynamicInteractiveChipGroup
135
+ ge as DynamicInteractiveChipGroup
135
136
  };
@@ -1,47 +1,48 @@
1
- import { cn as q } from "../../../../helpers/cn.js";
2
- import { StyledTooltip as z } from "../../../data-display/tooltip/StyledTooltip.js";
3
- import { LoadingIcon as te } from "../../../icons/loading-icon/LoadingIcon.js";
4
- import { CheckIcon as le } from "../../../icons/check-icon/CheckIcon.js";
1
+ import { cn as L } from "../../../../helpers/cn.js";
2
+ import { StyledTooltip as q } from "../../../data-display/tooltip/StyledTooltip.js";
3
+ import { LoadingIcon as le } from "../../../icons/loading-icon/LoadingIcon.js";
4
+ import { CheckIcon as re } from "../../../icons/check-icon/CheckIcon.js";
5
5
  import { PlusIconCircle as ae } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
6
6
  import { StyledChip as E } from "../../../data-display/chip/StyledChip.js";
7
- import { StyledCheckbox as re } from "../../checkbox/base-ui/StyledCheckbox.js";
8
- import { StyledInputField as oe } from "../../input-field/StyledInputField.js";
9
- import { StyledSelectAutocomplete as ie } from "../../select-autocomplete/StyledSelectAutocomplete.js";
10
- import { DynamicInteractiveChipGroup as ne } from "./DynamicInteractiveChipGroup.js";
11
- import { createElement as F, forwardRef as se, useCallback as h, useState as de } from "react";
7
+ import { StyledCheckbox as oe } from "../../checkbox/base-ui/StyledCheckbox.js";
8
+ import { StyledInputField as ie } from "../../input-field/StyledInputField.js";
9
+ import { StyledSelectAutocomplete as ne } from "../../select-autocomplete/StyledSelectAutocomplete.js";
10
+ import { DynamicSelectTitle as se } from "./DynamicSelectTitle.js";
11
+ import { DynamicInteractiveChipGroup as de } from "./DynamicInteractiveChipGroup.js";
12
+ import { createElement as F, forwardRef as ce, useCallback as h, useState as ue } from "react";
12
13
  import { Fragment as K, jsx as l, jsxs as T } from "react/jsx-runtime";
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: 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
- const t = b(e);
14
+ var Se = ce((C, H) => {
15
+ const [_, O] = ue(!1), { options: S, dataTest: f, value: g, readOnly: u, multiple: o, required: R, onChange: x, size: W, rowSize: y = "compact", title: k, titleSize: G, noOptionsText: J, placeholder: M, disabled: I, helperText: Q, disableHelperText: N, error: A, valueKey: P = "value", labelKey: U = "label", renderLabel: s, getOptionTooltip: V, startAdornment: X, autocompleteProps: i, loading: m, maxTags: Y, onFocus: Z, onBlur: ee } = C, d = (e) => typeof e == "object" ? e?.[U]?.toString() ?? "" : e?.toString() ?? "", p = h((e) => typeof e == "object" ? e?.[P] : e, [P]), $ = h((e, t) => p(e) === p(t), [p]), v = (e) => {
16
+ const t = p(e);
16
17
  return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : d(e);
17
18
  }, B = h((e) => {
18
- S(!0), i?.onOpen?.(e);
19
- }, [i]), ee = h((e, t) => {
20
- S(!1), i?.onClose?.(e, t);
19
+ O(!0), i?.onOpen?.(e);
20
+ }, [i]), te = h((e, t) => {
21
+ O(!1), i?.onClose?.(e, t);
21
22
  }, [i]);
22
- if (o && u) return /* @__PURE__ */ l(ne, { ...O });
23
- const C = v ? `${f}-title` : void 0;
23
+ if (o && u) return /* @__PURE__ */ l(de, { ...C });
24
+ const w = k ? `${f}-title` : void 0;
24
25
  return /* @__PURE__ */ T("div", {
25
26
  className: "flex w-full flex-col gap-y-1",
26
- children: [v && /* @__PURE__ */ l("span", {
27
- id: C,
28
- className: "text-base font-semibold text-delta-800",
29
- children: v
30
- }), /* @__PURE__ */ l(ie, {
27
+ children: [/* @__PURE__ */ l(se, {
28
+ id: w,
29
+ title: k,
30
+ titleSize: G
31
+ }), /* @__PURE__ */ l(ne, {
31
32
  open: _,
32
33
  onOpen: B,
33
- onClose: ee,
34
+ onClose: te,
34
35
  disableCloseOnSelect: o,
35
36
  dataTest: f,
36
37
  disabled: !!I || !!m,
37
- noOptionsText: G,
38
+ noOptionsText: J,
38
39
  loading: m,
39
40
  readOnly: u,
40
41
  value: g,
41
42
  size: W,
42
43
  rowSize: y,
43
44
  disableClearable: R,
44
- options: k,
45
+ options: S,
45
46
  fullWidth: !0,
46
47
  classes: { listbox: "max-h-[300px]" },
47
48
  getOptionLabel: i?.getOptionLabel ?? d,
@@ -54,12 +55,12 @@ var Ce = se((O, H) => {
54
55
  multiple: o,
55
56
  renderValue: o ? (e) => {
56
57
  if (!Array.isArray(e)) return null;
57
- const t = e, c = X ?? k.length, r = t.slice(0, c), n = t.length - c;
58
- return [...r.map((a) => /* @__PURE__ */ l(E, {
59
- dataTest: `${w(a)}-chip`,
58
+ const t = e, c = Y ?? S.length, a = t.slice(0, c), n = t.length - c;
59
+ return [...a.map((r) => /* @__PURE__ */ l(E, {
60
+ dataTest: `${v(r)}-chip`,
60
61
  readOnly: u,
61
62
  variant: "outlined",
62
- label: s ? s(a) : d(a),
63
+ label: s ? s(r) : d(r),
63
64
  classes: {
64
65
  root: "h-fit w-fit min-h-[32px]",
65
66
  label: "block whitespace-normal"
@@ -67,9 +68,9 @@ var Ce = se((O, H) => {
67
68
  disabled: !!I || !!m,
68
69
  deleteButtonTabIndex: -1,
69
70
  onDelete: () => {
70
- Array.isArray(g) && x(g.filter((p) => !$(p, a)));
71
+ Array.isArray(g) && x(g.filter((b) => !$(b, r)));
71
72
  }
72
- }, w(a))), n > 0 ? /* @__PURE__ */ l(E, {
73
+ }, v(r))), n > 0 ? /* @__PURE__ */ l(E, {
73
74
  dataTest: "remaining-count-tag-chip",
74
75
  label: `+${n}`,
75
76
  variant: "outlined",
@@ -77,7 +78,7 @@ var Ce = se((O, H) => {
77
78
  onClick: B
78
79
  }, "remaining-count") : null];
79
80
  } : void 0,
80
- popupIcon: m ? /* @__PURE__ */ l(te, {
81
+ popupIcon: m ? /* @__PURE__ */ l(le, {
81
82
  height: 24,
82
83
  width: 24
83
84
  }) : o ? /* @__PURE__ */ l(ae, {
@@ -85,64 +86,64 @@ var Ce = se((O, H) => {
85
86
  width: 24
86
87
  }) : void 0,
87
88
  renderOption: (e, t, c) => {
88
- const r = typeof t == "object" ? !!t?.disabled : !1, n = V ? V(t) : null, a = r && n ? `${e.id}-reason` : void 0, p = a && e["data-active"] !== void 0 ? !0 : void 0, j = a && /* @__PURE__ */ l("span", {
89
- id: a,
89
+ const a = typeof t == "object" ? !!t?.disabled : !1, n = V ? V(t) : null, r = a && n ? `${e.id}-reason` : void 0, b = r && e["data-active"] !== void 0 ? !0 : void 0, D = r && /* @__PURE__ */ l("span", {
90
+ id: r,
90
91
  className: "sr-only",
91
92
  "aria-hidden": "true",
92
93
  children: n
93
94
  });
94
95
  if (o) {
95
- const L = c.selected;
96
+ const z = c.selected;
96
97
  return /* @__PURE__ */ F("li", {
97
98
  ...e,
98
99
  role: "option",
99
- "aria-selected": L,
100
+ "aria-selected": z,
100
101
  key: e.id,
101
- onClick: r ? void 0 : e.onClick,
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
- "aria-disabled": r,
104
- "aria-describedby": a
105
- }, j, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
102
+ onClick: a ? void 0 : e.onClick,
103
+ className: L("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", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
104
+ "aria-disabled": a,
105
+ "aria-describedby": r
106
+ }, D, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
106
107
  "aria-hidden": "true",
107
108
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
108
- }), /* @__PURE__ */ l(z, {
109
+ }), /* @__PURE__ */ l(q, {
109
110
  arrow: !0,
110
111
  title: n,
111
- open: p,
112
- children: /* @__PURE__ */ T(K, { children: [/* @__PURE__ */ l(re, {
113
- disabled: r,
114
- dataTest: `${w(t)}-checkbox`,
112
+ open: b,
113
+ children: /* @__PURE__ */ T(K, { children: [/* @__PURE__ */ l(oe, {
114
+ disabled: a,
115
+ dataTest: `${v(t)}-checkbox`,
115
116
  size: "small",
116
117
  decorative: !0,
117
118
  hideWrapper: !0,
118
119
  className: "min-w-[36px]",
119
- checked: L
120
+ checked: z
120
121
  }), s ? s(t) : /* @__PURE__ */ l("span", {
121
122
  className: "line-clamp-2 h-fit min-w-0 flex-1 break-words text-base text-delta-800",
122
123
  children: d(t)
123
124
  })] })
124
125
  }));
125
126
  }
126
- const D = c.selected;
127
+ const j = c.selected;
127
128
  return /* @__PURE__ */ F("li", {
128
129
  ...e,
129
130
  role: "option",
130
- "aria-selected": D,
131
+ "aria-selected": j,
131
132
  key: e.id,
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"),
133
- onClick: r ? void 0 : e.onClick,
134
- "aria-disabled": r,
135
- "aria-describedby": a
136
- }, j, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
133
+ className: L("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", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
134
+ onClick: a ? void 0 : e.onClick,
135
+ "aria-disabled": a,
136
+ "aria-describedby": r
137
+ }, D, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
137
138
  "aria-hidden": "true",
138
139
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
139
- }), /* @__PURE__ */ l(z, {
140
+ }), /* @__PURE__ */ l(q, {
140
141
  arrow: !0,
141
142
  title: n,
142
- open: p,
143
+ open: b,
143
144
  children: /* @__PURE__ */ T(K, { children: [/* @__PURE__ */ l("span", {
144
145
  className: "w-5 min-w-5",
145
- children: D && /* @__PURE__ */ l(le, {
146
+ children: j && /* @__PURE__ */ l(re, {
146
147
  className: "size-5 min-h-5 min-w-5 text-gama-500",
147
148
  height: 20,
148
149
  width: 20
@@ -153,30 +154,30 @@ var Ce = se((O, H) => {
153
154
  })] })
154
155
  }));
155
156
  },
156
- renderInput: (e) => /* @__PURE__ */ l(oe, {
157
+ renderInput: (e) => /* @__PURE__ */ l(ie, {
157
158
  dataTest: `${f}-input-field`,
158
159
  ...e,
159
160
  inputRef: H,
160
161
  error: A,
161
- helperText: N ? void 0 : M,
162
+ helperText: N ? void 0 : Q,
162
163
  reserveHelperText: N ? !1 : A !== void 0,
163
164
  variant: "outlined",
164
165
  label: "",
165
- placeholder: J,
166
+ placeholder: M,
166
167
  readOnly: u,
167
- onFocus: Y,
168
- onBlur: Z,
168
+ onFocus: Z,
169
+ onBlur: ee,
169
170
  onKeyDown: e.onKeyDown,
170
171
  autoComplete: "off",
171
172
  slotProps: {
172
173
  ...e.slotProps,
173
174
  input: {
174
175
  ...e.slotProps?.input ?? {},
175
- startAdornment: U ?? e.slotProps?.input?.startAdornment
176
+ startAdornment: X ?? e.slotProps?.input?.startAdornment
176
177
  },
177
178
  htmlInput: {
178
179
  ...e.slotProps?.htmlInput ?? {},
179
- ...C ? { "aria-labelledby": C } : {}
180
+ ...w ? { "aria-labelledby": w } : {}
180
181
  }
181
182
  }
182
183
  }),
@@ -185,5 +186,5 @@ var Ce = se((O, H) => {
185
186
  });
186
187
  });
187
188
  export {
188
- Ce as DynamicSelectAutocomplete
189
+ Se as DynamicSelectAutocomplete
189
190
  };
@@ -1,19 +1,20 @@
1
- import { jsx as d, jsxs as u } from "react/jsx-runtime";
2
- var m = ({ dataTest: a, options: c, value: t, title: n, valueKey: i = "value", labelKey: o = "label", renderLabel: r }) => {
3
- const s = (e) => typeof e == "object" ? e?.[i] : e, f = (e) => typeof e == "object" ? e?.[o]?.toString() ?? "" : e?.toString() ?? "", l = t == null ? null : c.find((e) => s(e) === s(t)) ?? t;
4
- return /* @__PURE__ */ u("div", {
5
- "data-testid": `${a}-read-only`,
1
+ import { DynamicSelectTitle as m } from "./DynamicSelectTitle.js";
2
+ import { jsx as c, jsxs as y } from "react/jsx-runtime";
3
+ var b = ({ dataTest: r, options: i, value: t, title: d, titleSize: s, valueKey: o = "value", labelKey: f = "label", renderLabel: n }) => {
4
+ const a = (e) => typeof e == "object" ? e?.[o] : e, u = (e) => typeof e == "object" ? e?.[f]?.toString() ?? "" : e?.toString() ?? "", l = t == null ? null : i.find((e) => a(e) === a(t)) ?? t;
5
+ return /* @__PURE__ */ y("div", {
6
+ "data-testid": `${r}-read-only`,
6
7
  className: "flex flex-col gap-y-1",
7
- children: [n && /* @__PURE__ */ d("span", {
8
- className: "text-base font-semibold text-delta-800",
9
- children: n
10
- }), /* @__PURE__ */ d("div", {
11
- "data-testid": `${a}-read-only-value`,
8
+ children: [/* @__PURE__ */ c(m, {
9
+ title: d,
10
+ titleSize: s
11
+ }), /* @__PURE__ */ c("div", {
12
+ "data-testid": `${r}-read-only-value`,
12
13
  className: "text-base/6 text-delta-700",
13
- children: l === null ? "-" : r ? r(l) : f(l)
14
+ children: l === null ? "-" : n ? n(l) : u(l)
14
15
  })]
15
16
  });
16
17
  };
17
18
  export {
18
- m as DynamicSelectReadOnlyValue
19
+ b as DynamicSelectReadOnlyValue
19
20
  };
@@ -0,0 +1,9 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ var r = ({ title: e, titleSize: l = "base", id: a }) => e == null || e === !1 || e === "" ? null : /* @__PURE__ */ t("span", {
3
+ id: a,
4
+ className: l === "lg" ? "text-lg/7 font-semibold text-delta-800" : "text-base font-semibold text-delta-800",
5
+ children: e
6
+ });
7
+ export {
8
+ r as DynamicSelectTitle
9
+ };