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.
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +9 -9
- package/dist/components/data-display/tooltip/StyledTooltip.js +27 -28
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +1 -1
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +89 -89
- package/dist/components/inputs/input-field/StyledInputField.js +80 -74
- package/dist/components/inputs/search-field/StyledSearchField.js +33 -31
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +114 -106
- package/dist/components/navigation/tabs/StyledTabs.js +15 -9
- package/dist/components/utils/accordion/base-ui/StyledAccordion.js +1 -1
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +20 -18
- package/dist/datetime/components/time-picker/TimePickerInput.js +7 -7
- package/dist/datetime/shared-components/StyledTooltip.js +27 -31
- package/dist/src/components/inputs/checkbox/base-ui/StyledCheckbox.d.ts +1 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +1 -1
- package/dist/src/components/utils/accordion/base-ui/StyledAccordion.d.ts +1 -1
- package/dist/src/table/shared-components/StyledCheckbox.d.ts +1 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +40 -37
- package/dist/table/components/table-footer/TablePagination.js +18 -18
- package/dist/table/components/table-footer/TableRowCountSelect.js +17 -17
- package/dist/table/shared-components/StyledCheckbox.js +1 -1
- package/dist/table/shared-components/tooltip/index.js +21 -19
- 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
|
|
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,
|
|
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
|
-
},
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
}, t = o.ariaLabel ?? (typeof o.label == "string" ? o.label : void 0);
|
|
12
|
+
return /* @__PURE__ */ e(v, {
|
|
13
13
|
ref: n,
|
|
14
|
-
"aria-label":
|
|
15
|
-
avatar: /* @__PURE__ */
|
|
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
|
-
|
|
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":
|
|
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":
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
6
|
-
import { StyledTooltip as
|
|
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
|
|
12
|
-
import { Fragment as
|
|
13
|
-
var ge = le((
|
|
14
|
-
const [
|
|
15
|
-
const t =
|
|
16
|
-
return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" :
|
|
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
|
-
|
|
19
|
-
}, [
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
return
|
|
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: [
|
|
24
|
+
children: [k && /* @__PURE__ */ l("span", {
|
|
25
25
|
className: "text-base font-semibold text-delta-800",
|
|
26
|
-
children:
|
|
26
|
+
children: k
|
|
27
27
|
}), /* @__PURE__ */ l(ee, {
|
|
28
|
-
open:
|
|
28
|
+
open: B,
|
|
29
29
|
onOpen: P,
|
|
30
|
-
onClose:
|
|
31
|
-
disableCloseOnSelect:
|
|
32
|
-
dataTest:
|
|
33
|
-
disabled: !!
|
|
34
|
-
noOptionsText:
|
|
35
|
-
loading:
|
|
36
|
-
readOnly:
|
|
37
|
-
value:
|
|
38
|
-
size:
|
|
39
|
-
disableClearable:
|
|
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:
|
|
43
|
+
getOptionLabel: n?.getOptionLabel ?? c,
|
|
44
44
|
onChange: (e, t) => {
|
|
45
|
-
|
|
45
|
+
C(t);
|
|
46
46
|
},
|
|
47
47
|
filterSelectedOptions: !1,
|
|
48
|
-
isOptionEqualToValue:
|
|
48
|
+
isOptionEqualToValue: n?.isOptionEqualToValue ?? f,
|
|
49
49
|
autoHeight: !0,
|
|
50
|
-
multiple:
|
|
51
|
-
|
|
52
|
-
|
|
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: [
|
|
56
|
-
dataTest: `${
|
|
57
|
-
readOnly:
|
|
56
|
+
children: [h.map((o) => /* @__PURE__ */ l(D, {
|
|
57
|
+
dataTest: `${v(o)}-chip`,
|
|
58
|
+
readOnly: d,
|
|
58
59
|
variant: "outlined",
|
|
59
|
-
label:
|
|
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: !!
|
|
65
|
+
disabled: !!N || !!u,
|
|
65
66
|
onDelete: () => {
|
|
66
|
-
|
|
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
|
-
},
|
|
69
|
+
}, v(o))), g > 0 && /* @__PURE__ */ l(D, {
|
|
73
70
|
dataTest: "remaining-count-tag-chip",
|
|
74
|
-
label: `+${
|
|
71
|
+
label: `+${g}`,
|
|
75
72
|
variant: "outlined",
|
|
76
73
|
onClick: P
|
|
77
74
|
})]
|
|
78
75
|
});
|
|
79
|
-
},
|
|
80
|
-
popupIcon:
|
|
76
|
+
} : void 0,
|
|
77
|
+
popupIcon: u ? /* @__PURE__ */ l(Q, {
|
|
81
78
|
height: 24,
|
|
82
79
|
width: 24
|
|
83
|
-
}) :
|
|
80
|
+
}) : a ? /* @__PURE__ */ l(X, {
|
|
84
81
|
height: 24,
|
|
85
82
|
width: 24
|
|
86
83
|
}) : void 0,
|
|
87
84
|
renderOption: (e, t) => {
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
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:
|
|
95
|
-
className:
|
|
96
|
-
"aria-disabled":
|
|
97
|
-
}, /* @__PURE__ */ l(
|
|
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:
|
|
100
|
-
children: /* @__PURE__ */ x(
|
|
101
|
-
disabled:
|
|
102
|
-
dataTest: `${
|
|
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:
|
|
106
|
-
}),
|
|
102
|
+
checked: o
|
|
103
|
+
}), s ? s(t) : /* @__PURE__ */ l("span", {
|
|
107
104
|
className: "h-fit py-[10px] text-sm text-delta-700",
|
|
108
|
-
children:
|
|
105
|
+
children: c(t)
|
|
109
106
|
})] })
|
|
110
107
|
}));
|
|
111
108
|
}
|
|
112
|
-
const
|
|
109
|
+
const g = i != null && f(i, t);
|
|
113
110
|
return /* @__PURE__ */ L("li", {
|
|
114
111
|
...e,
|
|
115
112
|
key: e.id,
|
|
116
|
-
className:
|
|
117
|
-
onClick:
|
|
118
|
-
"aria-disabled":
|
|
119
|
-
}, /* @__PURE__ */ l(
|
|
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:
|
|
122
|
-
children: /* @__PURE__ */ x(
|
|
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:
|
|
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
|
-
}),
|
|
126
|
+
}), s ? s(t) : /* @__PURE__ */ l("span", {
|
|
130
127
|
className: "py-[10px] text-sm text-delta-700",
|
|
131
|
-
children:
|
|
128
|
+
children: c(t)
|
|
132
129
|
})] })
|
|
133
130
|
}));
|
|
134
131
|
},
|
|
135
132
|
renderInput: (e) => /* @__PURE__ */ l(Z, {
|
|
136
|
-
dataTest: `${
|
|
133
|
+
dataTest: `${S}-input-field`,
|
|
137
134
|
...e,
|
|
138
|
-
inputRef:
|
|
139
|
-
error:
|
|
140
|
-
helperText:
|
|
135
|
+
inputRef: q,
|
|
136
|
+
error: G,
|
|
137
|
+
helperText: R ? "" : H ?? " ",
|
|
141
138
|
variant: "outlined",
|
|
142
139
|
label: "",
|
|
143
|
-
placeholder:
|
|
144
|
-
readOnly:
|
|
145
|
-
onKeyDown:
|
|
146
|
-
autoComplete:
|
|
147
|
-
|
|
148
|
-
...e.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
...
|
|
157
|
+
...n
|
|
158
158
|
})]
|
|
159
159
|
});
|
|
160
160
|
});
|
|
@@ -1,77 +1,83 @@
|
|
|
1
|
-
import { CloseIcon as
|
|
2
|
-
import { ErrorOutlineIcon as
|
|
3
|
-
import { TextField as
|
|
4
|
-
import { jsx as o, jsxs as
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
"&
|
|
68
|
-
"& .MuiInputBase-
|
|
69
|
-
"& .MuiInputBase-colorPrimary
|
|
70
|
-
"&
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 },
|