asma-ui-core 3.24.0 → 3.25.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 (22) hide show
  1. package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +9 -9
  2. package/dist/components/data-display/tooltip/StyledTooltip.js +27 -28
  3. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +1 -1
  4. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +89 -89
  5. package/dist/components/inputs/input-field/StyledInputField.js +80 -74
  6. package/dist/components/inputs/search-field/StyledSearchField.js +33 -31
  7. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +114 -106
  8. package/dist/components/navigation/tabs/StyledTabs.js +15 -9
  9. package/dist/components/utils/accordion/base-ui/StyledAccordion.js +1 -1
  10. package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +20 -18
  11. package/dist/datetime/components/time-picker/TimePickerInput.js +7 -7
  12. package/dist/datetime/shared-components/StyledTooltip.js +27 -31
  13. package/dist/src/components/inputs/checkbox/base-ui/StyledCheckbox.d.ts +1 -1
  14. package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +1 -1
  15. package/dist/src/components/utils/accordion/base-ui/StyledAccordion.d.ts +1 -1
  16. package/dist/src/table/shared-components/StyledCheckbox.d.ts +1 -1
  17. package/dist/table/components/columns/action-column/components/RowActionMenu.js +40 -37
  18. package/dist/table/components/table-footer/TablePagination.js +18 -18
  19. package/dist/table/components/table-footer/TableRowCountSelect.js +17 -17
  20. package/dist/table/shared-components/StyledCheckbox.js +1 -1
  21. package/dist/table/shared-components/tooltip/index.js +21 -19
  22. package/package.json +5 -11
@@ -2,23 +2,23 @@ import { StyledChip as v } from "../chip/StyledChip.js";
2
2
  import { StyledCheckbox as b } from "../../inputs/checkbox/StyledCheckbox.js";
3
3
  import { StyledRadio as m } from "../../inputs/radio-button/StyledRadio.js";
4
4
  import { forwardRef as u } from "react";
5
- import { jsx as t } from "react/jsx-runtime";
5
+ import { jsx as e } from "react/jsx-runtime";
6
6
  var S = u(({ type: i = "checkbox", checked: a, size: c = "small", ...o }, n) => {
7
- const r = i === "checkbox", s = r ? b : m, d = !o.readOnly && !r && a, e = {
7
+ const r = i === "checkbox", s = r ? b : m, d = !o.readOnly && !r && a, l = {
8
8
  borderColor: "var(--colors-gama-300)",
9
9
  backgroundColor: "var(--colors-gama-25)",
10
10
  boxShadow: "0 0 0 1px inset var(--colors-gama-300)"
11
- }, l = o.ariaLabel ?? (typeof o.label == "string" ? o.label : void 0);
12
- return /* @__PURE__ */ t(v, {
11
+ }, t = o.ariaLabel ?? (typeof o.label == "string" ? o.label : void 0);
12
+ return /* @__PURE__ */ e(v, {
13
13
  ref: n,
14
- "aria-label": l,
15
- avatar: /* @__PURE__ */ t(s, {
14
+ "aria-label": t,
15
+ avatar: /* @__PURE__ */ e(s, {
16
16
  dataTest: o.dataTest,
17
17
  disableRipple: !0,
18
18
  checked: a,
19
19
  size: c,
20
20
  sx: { pointerEvents: "none" },
21
- inputProps: { "aria-label": l }
21
+ slotProps: { input: { "aria-label": t } }
22
22
  }),
23
23
  clickable: !0,
24
24
  tabIndex: 0,
@@ -29,7 +29,7 @@ var S = u(({ type: i = "checkbox", checked: a, size: c = "small", ...o }, n) =>
29
29
  borderColor: "var(--colors-gama-400)",
30
30
  boxShadow: "0 0 0 1px inset var(--colors-gama-400)",
31
31
  backgroundColor: "var(--colors-gama-50)",
32
- "&:hover": e
32
+ "&:hover": l
33
33
  },
34
34
  ...a && { "& .MuiChip-avatar": { "& .MuiSvgIcon-root": { color: "var(--colors-gama-500)" } } },
35
35
  ...o.readOnly && { "& .MuiChip-avatar": {
@@ -37,7 +37,7 @@ var S = u(({ type: i = "checkbox", checked: a, size: c = "small", ...o }, n) =>
37
37
  "& .MuiCheckbox-root, & .MuiRadio-root": { color: "var(--colors-delta-500)" },
38
38
  "& .Mui-checked": { color: "var(--colors-delta-500)" }
39
39
  } },
40
- "&:focus:hover": e,
40
+ "&:focus:hover": l,
41
41
  ...o.sx
42
42
  }
43
43
  });
@@ -1,38 +1,37 @@
1
1
  import { Tooltip as e } from "@mui/material";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
- import n from "@mui/material/Fade";
4
- var x = (r) => {
5
- const { componentsProps: t, ...p } = r, o = t?.tooltip;
3
+ import { mergeSlotProps as r } from "@mui/material/utils";
4
+ import l from "@mui/material/Fade";
5
+ var a = {
6
+ borderRadius: "3px",
7
+ "& .MuiTooltip-arrow": { color: "#363E4A" },
8
+ color: "white",
9
+ boxShadow: "0px 1px 4px 0px rgba(0, 0, 0, 0.25)",
10
+ display: "flex",
11
+ padding: "4px 8px",
12
+ alignItems: "center",
13
+ fontSize: "12px",
14
+ lineHeight: "16px",
15
+ letterSpacing: "0.24px",
16
+ bgcolor: "#363E4A",
17
+ wordBreak: "break-word"
18
+ }, d = (p) => {
19
+ const { slotProps: o, ...t } = p;
6
20
  return /* @__PURE__ */ i(e, {
7
- TransitionComponent: n,
8
- TransitionProps: { timeout: 300 },
9
21
  enterDelay: 500,
10
22
  placement: "top",
11
- componentsProps: {
12
- ...t,
13
- tooltip: {
14
- ...o ?? {},
15
- style: { ...o?.style ?? {} },
16
- sx: {
17
- borderRadius: "3px",
18
- "& .MuiTooltip-arrow": { color: "#363E4A" },
19
- color: "white",
20
- boxShadow: "0px 1px 4px 0px rgba(0, 0, 0, 0.25)",
21
- display: "flex",
22
- padding: "4px 8px",
23
- alignItems: "center",
24
- fontSize: "12px",
25
- lineHeight: "16px",
26
- letterSpacing: "0.24px",
27
- bgcolor: "#363E4A",
28
- wordBreak: "break-word",
29
- ...o?.sx
30
- }
31
- }
23
+ ...t,
24
+ slots: {
25
+ transition: l,
26
+ ...t.slots
32
27
  },
33
- ...p
28
+ slotProps: {
29
+ ...o,
30
+ transition: r(o?.transition, { timeout: 300 }),
31
+ tooltip: r(o?.tooltip, { sx: a })
32
+ }
34
33
  });
35
34
  };
36
35
  export {
37
- x as StyledTooltip
36
+ d as StyledTooltip
38
37
  };
@@ -2,7 +2,7 @@ import { cn as C } from "../../../../helpers/cn.js";
2
2
  import e from "./StyledCheckbox.module.js";
3
3
  import p, { useEffect as E } from "react";
4
4
  import { jsx as t, jsxs as k } from "react/jsx-runtime";
5
- import { Checkbox as f } from "@base-ui/react";
5
+ import { Checkbox as f } from "@base-ui/react/checkbox";
6
6
  var L = (n) => /* @__PURE__ */ k("svg", {
7
7
  viewBox: "0 0 24 24",
8
8
  width: "100%",
@@ -1,160 +1,160 @@
1
- import { cn as D } from "../../../../helpers/cn.js";
1
+ import { cn as V } from "../../../../helpers/cn.js";
2
2
  import { LoadingIcon as Q } from "../../../icons/loading-icon/LoadingIcon.js";
3
3
  import { CheckIcon as U } from "../../../icons/check-icon/CheckIcon.js";
4
4
  import { PlusIconCircle as X } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
5
- import { StyledChip as j } from "../../../data-display/chip/StyledChip.js";
6
- import { StyledTooltip as A } from "../../../data-display/tooltip/StyledTooltip.js";
5
+ import { StyledChip as D } from "../../../data-display/chip/StyledChip.js";
6
+ import { StyledTooltip as j } from "../../../data-display/tooltip/StyledTooltip.js";
7
7
  import { StyledCheckbox as Y } from "../../checkbox/base-ui/StyledCheckbox.js";
8
8
  import { StyledInputField as Z } from "../../input-field/StyledInputField.js";
9
9
  import { StyledSelectAutocomplete as ee } from "../../select-autocomplete/StyledSelectAutocomplete.js";
10
10
  import { DynamicInteractiveChipGroup as te } from "./DynamicInteractiveChipGroup.js";
11
- import { createElement as L, forwardRef as le, useCallback as b, useState as ae } from "react";
12
- import { Fragment as V, jsx as l, jsxs as x } from "react/jsx-runtime";
13
- var ge = le((v, $) => {
14
- const [q, w] = ae(!1), { options: y, dataTest: O, value: d, readOnly: u, multiple: n, required: B, onChange: m, size: E, title: S, noOptionsText: z, placeholder: F, disabled: k, helperText: K, disableHelperText: H, error: R, valueKey: I = "value", labelKey: G = "label", renderLabel: i, getOptionTooltip: N, startAdornment: W, autocompleteProps: r, loading: p, maxTags: _ } = v, f = y.length < 11, s = (e) => typeof e == "object" ? e?.[G]?.toString() ?? "" : e?.toString() ?? "", h = b((e) => typeof e == "object" ? e?.[I] : e, [I]), g = b((e, t) => h(e) === h(t), [h]), C = (e) => {
15
- const t = h(e);
16
- return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : s(e);
11
+ import { createElement as L, forwardRef as le, useCallback as b, useState as re } from "react";
12
+ import { Fragment as $, jsx as l, jsxs as x } from "react/jsx-runtime";
13
+ var ge = le((O, q) => {
14
+ const [B, T] = re(!1), { options: y, dataTest: S, value: i, readOnly: d, multiple: a, required: E, onChange: C, size: z, title: k, noOptionsText: F, placeholder: K, disabled: N, helperText: H, disableHelperText: R, error: G, valueKey: A = "value", labelKey: W = "label", renderLabel: s, getOptionTooltip: I, startAdornment: _, autocompleteProps: n, loading: u, maxTags: J } = O, m = y.length < 11, c = (e) => typeof e == "object" ? e?.[W]?.toString() ?? "" : e?.toString() ?? "", p = b((e) => typeof e == "object" ? e?.[A] : e, [A]), f = b((e, t) => typeof t == "string" ? !1 : p(e) === p(t), [p]), v = (e) => {
15
+ const t = p(e);
16
+ return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : c(e);
17
17
  }, P = b((e) => {
18
- w(!0), r?.onOpen?.(e);
19
- }, [r]), J = b((e, t) => {
20
- w(!1), r?.onClose?.(e, t);
21
- }, [r]);
22
- return n && u ? /* @__PURE__ */ l(te, { ...v }) : /* @__PURE__ */ x("div", {
18
+ T(!0), n?.onOpen?.(e);
19
+ }, [n]), M = b((e, t) => {
20
+ T(!1), n?.onClose?.(e, t);
21
+ }, [n]);
22
+ return a && d ? /* @__PURE__ */ l(te, { ...O }) : /* @__PURE__ */ x("div", {
23
23
  className: "flex w-full flex-col gap-y-1",
24
- children: [S && /* @__PURE__ */ l("span", {
24
+ children: [k && /* @__PURE__ */ l("span", {
25
25
  className: "text-base font-semibold text-delta-800",
26
- children: S
26
+ children: k
27
27
  }), /* @__PURE__ */ l(ee, {
28
- open: q,
28
+ open: B,
29
29
  onOpen: P,
30
- onClose: J,
31
- disableCloseOnSelect: n,
32
- dataTest: O,
33
- disabled: !!k || !!p,
34
- noOptionsText: z,
35
- loading: p,
36
- readOnly: u,
37
- value: d,
38
- size: E,
39
- disableClearable: B,
30
+ onClose: M,
31
+ disableCloseOnSelect: a,
32
+ dataTest: S,
33
+ disabled: !!N || !!u,
34
+ noOptionsText: F,
35
+ loading: u,
36
+ readOnly: d,
37
+ value: i,
38
+ size: z,
39
+ disableClearable: E,
40
40
  options: y,
41
41
  fullWidth: !0,
42
42
  classes: { listbox: "h-full max-h-[300px]" },
43
- getOptionLabel: r?.getOptionLabel ?? s,
43
+ getOptionLabel: n?.getOptionLabel ?? c,
44
44
  onChange: (e, t) => {
45
- m(t);
45
+ C(t);
46
46
  },
47
47
  filterSelectedOptions: !1,
48
- isOptionEqualToValue: r?.isOptionEqualToValue ?? g,
48
+ isOptionEqualToValue: n?.isOptionEqualToValue ?? f,
49
49
  autoHeight: !0,
50
- multiple: n,
51
- renderTags: (e) => {
52
- const t = _ ?? y.length, a = e.slice(0, t), c = e.length - t;
50
+ multiple: a,
51
+ renderValue: a ? (e) => {
52
+ if (!Array.isArray(e)) return null;
53
+ const t = e, r = J ?? y.length, h = t.slice(0, r), g = t.length - r;
53
54
  return /* @__PURE__ */ x("div", {
54
55
  className: "flex flex-wrap gap-2",
55
- children: [a.map((o) => /* @__PURE__ */ l(j, {
56
- dataTest: `${C(o)}-chip`,
57
- readOnly: u,
56
+ children: [h.map((o) => /* @__PURE__ */ l(D, {
57
+ dataTest: `${v(o)}-chip`,
58
+ readOnly: d,
58
59
  variant: "outlined",
59
- label: i ? i(o) : s(o),
60
+ label: s ? s(o) : c(o),
60
61
  classes: {
61
62
  root: "h-fit w-fit min-h-[32px]",
62
63
  label: "block whitespace-normal"
63
64
  },
64
- disabled: !!k || !!p,
65
+ disabled: !!N || !!u,
65
66
  onDelete: () => {
66
- if (!n) {
67
- m(null);
68
- return;
69
- }
70
- m(d.filter((T) => !g(T, o)));
67
+ Array.isArray(i) && C(i.filter((w) => !f(w, o)));
71
68
  }
72
- }, C(o))), c > 0 && /* @__PURE__ */ l(j, {
69
+ }, v(o))), g > 0 && /* @__PURE__ */ l(D, {
73
70
  dataTest: "remaining-count-tag-chip",
74
- label: `+${c}`,
71
+ label: `+${g}`,
75
72
  variant: "outlined",
76
73
  onClick: P
77
74
  })]
78
75
  });
79
- },
80
- popupIcon: p ? /* @__PURE__ */ l(Q, {
76
+ } : void 0,
77
+ popupIcon: u ? /* @__PURE__ */ l(Q, {
81
78
  height: 24,
82
79
  width: 24
83
- }) : n ? /* @__PURE__ */ l(X, {
80
+ }) : a ? /* @__PURE__ */ l(X, {
84
81
  height: 24,
85
82
  width: 24
86
83
  }) : void 0,
87
84
  renderOption: (e, t) => {
88
- const a = typeof t == "object" ? !!t?.disabled : !1, c = N ? N(t) : null;
89
- if (n) {
90
- const T = !!d?.find((M) => g(M, t));
85
+ const r = typeof t == "object" ? !!t?.disabled : !1, h = I ? I(t) : null;
86
+ if (a) {
87
+ const o = !!i?.find((w) => f(w, t));
91
88
  return /* @__PURE__ */ L("li", {
92
89
  ...e,
93
90
  key: e.id,
94
- onClick: a ? void 0 : e.onClick,
95
- className: D("flex h-full cursor-pointer gap-x-1 bg-white text-sm/5 hover:bg-gama-50", a && "cursor-not-allowed bg-delta-50 hover:bg-delta-50"),
96
- "aria-disabled": a
97
- }, /* @__PURE__ */ l(A, {
91
+ onClick: r ? void 0 : e.onClick,
92
+ className: V("flex h-full cursor-pointer gap-x-1 bg-white text-sm/5 hover:bg-gama-50", r && "cursor-not-allowed bg-delta-50 hover:bg-delta-50"),
93
+ "aria-disabled": r
94
+ }, /* @__PURE__ */ l(j, {
98
95
  arrow: !0,
99
- title: c,
100
- children: /* @__PURE__ */ x(V, { children: [/* @__PURE__ */ l(Y, {
101
- disabled: a,
102
- dataTest: `${C(t)}-checkbox`,
96
+ title: h,
97
+ children: /* @__PURE__ */ x($, { children: [/* @__PURE__ */ l(Y, {
98
+ disabled: r,
99
+ dataTest: `${v(t)}-checkbox`,
103
100
  size: "small",
104
101
  className: "min-w-[36px]",
105
- checked: T
106
- }), i ? i(t) : /* @__PURE__ */ l("span", {
102
+ checked: o
103
+ }), s ? s(t) : /* @__PURE__ */ l("span", {
107
104
  className: "h-fit py-[10px] text-sm text-delta-700",
108
- children: s(t)
105
+ children: c(t)
109
106
  })] })
110
107
  }));
111
108
  }
112
- const o = g(d, t);
109
+ const g = i != null && f(i, t);
113
110
  return /* @__PURE__ */ L("li", {
114
111
  ...e,
115
112
  key: e.id,
116
- className: D("flex h-full cursor-pointer gap-x-1 px-2 text-sm/5 hover:bg-gama-50", a && "cursor-not-allowed bg-delta-50 hover:bg-delta-50"),
117
- onClick: a ? void 0 : e.onClick,
118
- "aria-disabled": a
119
- }, /* @__PURE__ */ l(A, {
113
+ className: V("flex h-full cursor-pointer gap-x-1 px-2 text-sm/5 hover:bg-gama-50", r && "cursor-not-allowed bg-delta-50 hover:bg-delta-50"),
114
+ onClick: r ? void 0 : e.onClick,
115
+ "aria-disabled": r
116
+ }, /* @__PURE__ */ l(j, {
120
117
  arrow: !0,
121
- title: c,
122
- children: /* @__PURE__ */ x(V, { children: [/* @__PURE__ */ l("span", {
118
+ title: h,
119
+ children: /* @__PURE__ */ x($, { children: [/* @__PURE__ */ l("span", {
123
120
  className: "h-full w-5 min-w-5 py-[10px]",
124
- children: o && /* @__PURE__ */ l(U, {
121
+ children: g && /* @__PURE__ */ l(U, {
125
122
  className: "size-5 min-h-5 min-w-5 text-gama-500",
126
123
  height: 20,
127
124
  width: 20
128
125
  })
129
- }), i ? i(t) : /* @__PURE__ */ l("span", {
126
+ }), s ? s(t) : /* @__PURE__ */ l("span", {
130
127
  className: "py-[10px] text-sm text-delta-700",
131
- children: s(t)
128
+ children: c(t)
132
129
  })] })
133
130
  }));
134
131
  },
135
132
  renderInput: (e) => /* @__PURE__ */ l(Z, {
136
- dataTest: `${O}-input-field`,
133
+ dataTest: `${S}-input-field`,
137
134
  ...e,
138
- inputRef: $,
139
- error: R,
140
- helperText: H ? "" : K ?? " ",
135
+ inputRef: q,
136
+ error: G,
137
+ helperText: R ? "" : H ?? " ",
141
138
  variant: "outlined",
142
139
  label: "",
143
- placeholder: F,
144
- readOnly: u,
145
- onKeyDown: f ? (t) => t.preventDefault() : void 0,
146
- autoComplete: f ? "off" : "on",
147
- InputProps: {
148
- ...e.InputProps,
149
- startAdornment: W ?? e.InputProps.startAdornment,
150
- style: f ? { caretColor: "transparent" } : {}
151
- },
152
- inputProps: {
153
- ...e.inputProps,
154
- style: f ? { caretColor: "transparent" } : {}
140
+ placeholder: K,
141
+ readOnly: d,
142
+ onKeyDown: m ? (t) => t.preventDefault() : void 0,
143
+ autoComplete: m ? "off" : "on",
144
+ slotProps: {
145
+ ...e.slotProps,
146
+ input: {
147
+ ...e.slotProps?.input ?? {},
148
+ startAdornment: _ ?? e.slotProps?.input?.startAdornment,
149
+ style: m ? { caretColor: "transparent" } : {}
150
+ },
151
+ htmlInput: {
152
+ ...e.slotProps?.htmlInput ?? {},
153
+ style: m ? { caretColor: "transparent" } : {}
154
+ }
155
155
  }
156
156
  }),
157
- ...r
157
+ ...n
158
158
  })]
159
159
  });
160
160
  });
@@ -1,77 +1,83 @@
1
- import { CloseIcon as d } from "../../icons/close-icon/CloseIcon.js";
2
- import { ErrorOutlineIcon as p } from "../../icons/error-outline-icon/ErrorOutlineIcon.js";
3
- import { TextField as c } from "@mui/material";
4
- import { jsx as o, jsxs as m } from "react/jsx-runtime";
5
- var h = ({ allowClear: l, onClear: n, readOnly: t, disabled: u, error: e, helperText: a, dataTest: s, ...r }) => /* @__PURE__ */ o(c, {
6
- ...r,
7
- "data-testid": s,
8
- disabled: (u ?? !1) || (t ?? !1),
9
- error: e,
10
- helperText: t ? null : e ? /* @__PURE__ */ m("span", {
11
- className: "inline-flex items-center gap-1",
12
- children: [/* @__PURE__ */ o(p, {
13
- width: 20,
14
- height: 20,
15
- className: "min-w-5"
16
- }), a ?? "Required"]
17
- }) : a,
18
- type: r.type ?? "mui-input",
19
- InputProps: {
20
- ...r.InputProps,
21
- endAdornment: l && r.value ? /* @__PURE__ */ o("div", {
22
- role: "button",
23
- className: "absolute right-4 z-40 flex items-center justify-center rounded-full p-[2px] duration-300 hover:bg-gama-100",
24
- onClick: (i) => {
25
- i.stopPropagation(), i.preventDefault(), n?.();
26
- },
27
- children: /* @__PURE__ */ o(d, {
28
- width: 18,
29
- height: 18
30
- })
31
- }) : r.InputProps?.endAdornment
32
- },
33
- sx: {
34
- "& input:-webkit-autofill, & .MuiInputBase-root:has(> input:-webkit-autofill)": { backgroundColor: "#e8f0fe !important" },
35
- "& input": { backgroundColor: "transparent" },
36
- "& .MuiInputBase-root": { backgroundColor: "transparent" },
37
- "& .MuiInputBase-colorPrimary fieldset": { borderColor: "var(--colors-delta-500) !important" },
38
- "& .MuiInputBase-colorPrimary.Mui-focused fieldset": { borderColor: "var(--colors-gama-400) !important" },
39
- "& .MuiInputBase-colorPrimary.Mui-focused::after": { borderColor: "var(--colors-gama-400) !important" },
40
- "& .MuiInputBase-colorPrimary.Mui-focused:hover fieldset": { borderColor: "var(--colors-gama-400) !important" },
41
- "& .MuiInputBase-colorPrimary:hover fieldset": {
42
- borderColor: "var(--colors-gama-300) !important",
43
- borderWidth: "2px !important"
44
- },
45
- "& .MuiInputBase-colorPrimary.Mui-disabled:hover fieldset": { borderWidth: "1px !important" },
46
- "& .MuiInputBase-colorPrimary.Mui-error fieldset": { borderColor: "var(--colors-error-500) !important" },
47
- "& .MuiInputBase-colorPrimary.Mui-error:hover fieldset": { borderColor: "var(--colors-error-500) !important" },
48
- "& .MuiFormHelperText-root": {
49
- fontSize: "14px",
50
- marginLeft: 0
51
- },
52
- "& .MuiFormHelperText-root.Mui-error": { color: "var(--colors-error-500) !important" },
53
- "& .MuiInputBase-colorPrimary.Mui-disabled fieldset": { borderColor: "var(--colors-delta-300) !important" },
54
- "& label.Mui-focused": { color: "var(--colors-gama-500) !important" },
55
- "& label.Mui-error": { color: "var(--colors-error-500) !important" },
56
- "& label.Mui-focused.MuiInputLabel-shrink": { color: "var(--colors-gama-500) !important" },
57
- "& label.Mui-error.MuiInputLabel-shrink": { color: "var(--colors-error-500) !important" },
58
- "& label": { color: "var(--colors-delta-500) !important" },
59
- "& label.MuiInputLabel-shrink": { color: "var(--colors-delta-800) !important" },
60
- "& label.Mui-disabled": { color: "var(--colors-gray-300) !important" },
61
- "& .MuiOutlinedInput-input::placeholder": {
62
- color: "var(--colors-delta-500) !important",
63
- opacity: "1 !important"
1
+ import { CloseIcon as m } from "../../icons/close-icon/CloseIcon.js";
2
+ import { ErrorOutlineIcon as b } from "../../icons/error-outline-icon/ErrorOutlineIcon.js";
3
+ import { TextField as M } from "@mui/material";
4
+ import { jsx as o, jsxs as f } from "react/jsx-runtime";
5
+ var y = ({ allowClear: u, onClear: s, readOnly: t, disabled: d, error: e, helperText: a, dataTest: p, slotProps: i, ...r }) => {
6
+ const c = (d ?? !1) || (t ?? !1), l = i?.input;
7
+ return /* @__PURE__ */ o(M, {
8
+ ...r,
9
+ "data-testid": p,
10
+ disabled: c,
11
+ error: e,
12
+ helperText: t ? null : e ? /* @__PURE__ */ f("span", {
13
+ className: "inline-flex items-center gap-1",
14
+ children: [/* @__PURE__ */ o(b, {
15
+ width: 20,
16
+ height: 20,
17
+ className: "min-w-5"
18
+ }), a ?? "Required"]
19
+ }) : a,
20
+ type: r.type ?? "mui-input",
21
+ slotProps: {
22
+ ...i,
23
+ input: {
24
+ ...l,
25
+ endAdornment: u && r.value ? /* @__PURE__ */ o("div", {
26
+ role: "button",
27
+ className: "absolute right-4 z-40 flex items-center justify-center rounded-full p-[2px] duration-300 hover:bg-gama-100",
28
+ onClick: (n) => {
29
+ n.stopPropagation(), n.preventDefault(), s?.();
30
+ },
31
+ children: /* @__PURE__ */ o(m, {
32
+ width: 18,
33
+ height: 18
34
+ })
35
+ }) : l?.endAdornment
36
+ }
64
37
  },
65
- "& .MuiOutlinedInput-input.Mui-disabled": { WebkitTextFillColor: "var(--colors-delta-300) !important" },
66
- ...t && {
67
- "& .MuiOutlinedInput-input.Mui-disabled": { WebkitTextFillColor: "var(--colors-delta-800) !important" },
68
- "& .MuiInputBase-colorPrimary.Mui-disabled": { backgroundColor: "var(--colors-delta-10) !important" },
69
- "& .MuiInputBase-colorPrimary.Mui-disabled fieldset": { borderColor: "var(--colors-delta-200) !important" },
70
- "& label.Mui-disabled": { color: "var(--colors-gray-800) !important" }
71
- },
72
- ...r.sx
73
- }
74
- });
38
+ sx: {
39
+ "& input:-webkit-autofill, & .MuiInputBase-root:has(> input:-webkit-autofill)": { backgroundColor: "#e8f0fe !important" },
40
+ "& input": { backgroundColor: "transparent" },
41
+ "& .MuiInputBase-root": { backgroundColor: "transparent" },
42
+ "& .MuiInputBase-colorPrimary fieldset": { borderColor: "var(--colors-delta-500) !important" },
43
+ "& .MuiInputBase-colorPrimary.Mui-focused fieldset": { borderColor: "var(--colors-gama-400) !important" },
44
+ "& .MuiInputBase-colorPrimary.Mui-focused::after": { borderColor: "var(--colors-gama-400) !important" },
45
+ "& .MuiInputBase-colorPrimary.Mui-focused:hover fieldset": { borderColor: "var(--colors-gama-400) !important" },
46
+ "& .MuiInputBase-colorPrimary:hover fieldset": {
47
+ borderColor: "var(--colors-gama-300) !important",
48
+ borderWidth: "2px !important"
49
+ },
50
+ "& .MuiInputBase-colorPrimary.Mui-disabled:hover fieldset": { borderWidth: "1px !important" },
51
+ "& .MuiInputBase-colorPrimary.Mui-error fieldset": { borderColor: "var(--colors-error-500) !important" },
52
+ "& .MuiInputBase-colorPrimary.Mui-error:hover fieldset": { borderColor: "var(--colors-error-500) !important" },
53
+ "& .MuiFormHelperText-root": {
54
+ fontSize: "14px",
55
+ marginLeft: 0
56
+ },
57
+ "& .MuiFormHelperText-root.Mui-error": { color: "var(--colors-error-500) !important" },
58
+ "& .MuiInputBase-colorPrimary.Mui-disabled fieldset": { borderColor: "var(--colors-delta-300) !important" },
59
+ "& label.Mui-focused": { color: "var(--colors-gama-500) !important" },
60
+ "& label.Mui-error": { color: "var(--colors-error-500) !important" },
61
+ "& label.Mui-focused.MuiInputLabel-shrink": { color: "var(--colors-gama-500) !important" },
62
+ "& label.Mui-error.MuiInputLabel-shrink": { color: "var(--colors-error-500) !important" },
63
+ "& label": { color: "var(--colors-delta-500) !important" },
64
+ "& label.MuiInputLabel-shrink": { color: "var(--colors-delta-800) !important" },
65
+ "& label.Mui-disabled": { color: "var(--colors-gray-300) !important" },
66
+ "& .MuiOutlinedInput-input::placeholder": {
67
+ color: "var(--colors-delta-500) !important",
68
+ opacity: "1 !important"
69
+ },
70
+ "& .MuiOutlinedInput-input.Mui-disabled": { WebkitTextFillColor: "var(--colors-delta-300) !important" },
71
+ ...t && {
72
+ "& .MuiOutlinedInput-input.Mui-disabled": { WebkitTextFillColor: "var(--colors-delta-800) !important" },
73
+ "& .MuiInputBase-colorPrimary.Mui-disabled": { backgroundColor: "var(--colors-delta-10) !important" },
74
+ "& .MuiInputBase-colorPrimary.Mui-disabled fieldset": { borderColor: "var(--colors-delta-200) !important" },
75
+ "& label.Mui-disabled": { color: "var(--colors-gray-800) !important" }
76
+ },
77
+ ...r.sx
78
+ }
79
+ });
80
+ };
75
81
  export {
76
- h as StyledInputField
82
+ y as StyledInputField
77
83
  };
@@ -4,7 +4,7 @@ import { CloseIcon as d } from "../../icons/close-icon/CloseIcon.js";
4
4
  import { StyledInputField as p } from "../input-field/StyledInputField.js";
5
5
  import { useState as u } from "react";
6
6
  import { jsx as o, jsxs as h } from "react/jsx-runtime";
7
- var g = ({ value: t, onClear: i, ...e }) => {
7
+ var g = ({ value: t, onClear: n, ...e }) => {
8
8
  const [l, s] = u(!1), a = l || t;
9
9
  return /* @__PURE__ */ h("div", {
10
10
  className: "relative w-full",
@@ -18,37 +18,39 @@ var g = ({ value: t, onClear: i, ...e }) => {
18
18
  onBlur: () => {
19
19
  s(!1);
20
20
  },
21
- InputProps: {
22
- className: r("transition-[padding] duration-300", a ? "pl-0" : "pl-5"),
23
- sx: { "& input": {
24
- textOverflow: "ellipsis",
25
- whiteSpace: "nowrap",
26
- overflow: "hidden"
27
- } },
28
- endAdornment: t ? /* @__PURE__ */ o("div", {
29
- "data-testid": "styled-search-clear-icon",
30
- className: r("cursor-pointer rounded-full bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", t ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0"),
31
- style: {
32
- width: 24,
33
- height: 24,
34
- flexShrink: 0
35
- },
36
- onClick: (n) => {
37
- n.preventDefault(), n.stopPropagation(), i?.();
38
- },
39
- children: /* @__PURE__ */ o(d, {
40
- width: 20,
41
- height: 20,
42
- color: "var(--colors-delta-700)",
43
- className: "pointer-events-none"
44
- })
45
- }) : null
21
+ slotProps: {
22
+ input: {
23
+ className: r("transition-[padding] duration-300", a ? "pl-0" : "pl-5"),
24
+ sx: { "& input": {
25
+ textOverflow: "ellipsis",
26
+ whiteSpace: "nowrap",
27
+ overflow: "hidden"
28
+ } },
29
+ endAdornment: t ? /* @__PURE__ */ o("div", {
30
+ "data-testid": "styled-search-clear-icon",
31
+ className: r("cursor-pointer rounded-full bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", t ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0"),
32
+ style: {
33
+ width: 24,
34
+ height: 24,
35
+ flexShrink: 0
36
+ },
37
+ onClick: (i) => {
38
+ i.preventDefault(), i.stopPropagation(), n?.();
39
+ },
40
+ children: /* @__PURE__ */ o(d, {
41
+ width: 20,
42
+ height: 20,
43
+ color: "var(--colors-delta-700)",
44
+ className: "pointer-events-none"
45
+ })
46
+ }) : null
47
+ },
48
+ inputLabel: { sx: {
49
+ transform: "translate(34px, 9px) scale(1)",
50
+ width: a ? void 0 : "calc(100% - 42px)",
51
+ "&.MuiInputLabel-shrink": { transform: "translate(16px, -9px) scale(0.75)" }
52
+ } }
46
53
  },
47
- InputLabelProps: { sx: {
48
- transform: "translate(34px, 9px) scale(1)",
49
- width: a ? void 0 : "calc(100% - 42px)",
50
- "&.MuiInputLabel-shrink": { transform: "translate(16px, -9px) scale(0.75)" }
51
- } },
52
54
  ...e,
53
55
  sx: {
54
56
  ...e.fullWidth ? { width: "100%" } : { width: 160 },