asma-ui-core 3.78.11 → 3.79.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/asma-ui-core.css +1 -1
- package/dist/components/data-display/chip/StyledChip.js +41 -41
- package/dist/components/inputs/button/StyledButton.module.js +8 -8
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +45 -42
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +25 -17
- package/dist/components/inputs/field-styles.js +3 -3
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +34 -31
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
- package/dist/components/inputs/select/StyledSelect.js +147 -135
- package/dist/components/inputs/select/StyledSelectItem.js +29 -19
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +195 -162
- package/dist/components/inputs/switch/base-ui/StyledSwitch.module.js +4 -4
- package/dist/components/inputs/textarea/StyledTextarea.module.js +4 -4
- package/dist/components/navigation/link/StyledLink.js +11 -10
- package/dist/components/navigation/link/StyledLink.module.js +5 -5
- package/dist/components/navigation/menu/StyledMenuList.js +27 -19
- package/dist/components/navigation/tabs/StyledTab.js +7 -7
- package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +3 -3
- package/dist/datetime/shared-components/button/StyledButton.module.js +12 -12
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +3 -1
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +3 -1
- package/dist/src/table/components/TableRow.d.ts +2 -1
- package/dist/src/table/custom-features/focus-rows/types.d.ts +2 -2
- package/dist/src/table/hooks/useToggleMenuVisibility.hook.d.ts +14 -1
- package/dist/table/components/StyledTable.module.js +52 -52
- package/dist/table/components/TableRow.js +92 -80
- package/dist/table/components/TableRows.js +10 -8
- package/dist/table/components/table-footer/TablePagination.js +77 -64
- package/dist/table/components/table-footer/TableRowCountSelect.js +63 -44
- package/dist/table/components/table-header/TableHeader.js +72 -64
- package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +4 -4
- package/dist/table/hooks/useToggleMenuVisibility.hook.js +77 -11
- package/dist/table/shared-components/button/StyledButton.module.js +9 -9
- package/dist/tailwind.config.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/_focus.scss +23 -0
- package/src/styles/color-variables/defaultTokens.css +2 -4
- package/src/styles/color-variables/fretexTokens.css +6 -7
- package/src/styles/color-variables/jadeTokens.css +2 -4
- package/src/styles/components-colors/inputVariables.css +2 -2
- package/tw-configs/twConfigs.json +1 -0
- package/dist/table/shared-components/CheckIcon.js +0 -12
- package/dist/table/shared-components/menu-item/index.js +0 -22
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import { cn as i } from "../../../helpers/cn.js";
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { consumerOverrides as
|
|
5
|
-
import { getChipPadding as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { jsx as
|
|
8
|
-
var
|
|
9
|
-
const n = !o && !t && (!!
|
|
2
|
+
import { resolveSx as E } from "../../../helpers/sx.js";
|
|
3
|
+
import { CloseIcon as L } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { consumerOverrides as w } from "../../../helpers/classOverride.js";
|
|
5
|
+
import { getChipPadding as U } from "./chipPadding.js";
|
|
6
|
+
import { forwardRef as q } from "react";
|
|
7
|
+
import { jsx as s, jsxs as A } from "react/jsx-runtime";
|
|
8
|
+
var Z = q(({ dataTest: u, label: c, size: r = "medium", disabled: t, readOnly: o, clickable: x, icon: _, avatar: g, deleteIcon: k, onDelete: m, onClick: l, onMouseDown: y, onMouseUp: S, className: h, classes: a, sx: j, tabIndex: v, "aria-label": D, role: p, "aria-checked": R, "aria-readonly": B, "data-hovered": C, "data-focus": M, variant: F, color: G }, N) => {
|
|
9
|
+
const n = !o && !t && (!!x || !!l), f = g ?? _, b = !!(m && !o), d = U(r, !!f, b), I = {
|
|
10
10
|
paddingTop: d.top,
|
|
11
11
|
paddingRight: d.right,
|
|
12
12
|
paddingBottom: d.bottom,
|
|
13
13
|
paddingLeft: d.left
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
n && (
|
|
18
|
-
},
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
ref:
|
|
21
|
-
"data-testid":
|
|
22
|
-
"aria-label":
|
|
14
|
+
}, K = (e) => {
|
|
15
|
+
e.stopPropagation(), m?.(e);
|
|
16
|
+
}, P = (e) => {
|
|
17
|
+
n && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l?.(e));
|
|
18
|
+
}, W = w(h, "width"), $ = w(h, "max-width");
|
|
19
|
+
return /* @__PURE__ */ A("div", {
|
|
20
|
+
ref: N,
|
|
21
|
+
"data-testid": u,
|
|
22
|
+
"aria-label": D,
|
|
23
23
|
"data-hovered": C,
|
|
24
|
-
"data-focus":
|
|
25
|
-
role:
|
|
26
|
-
"aria-checked":
|
|
27
|
-
"aria-readonly":
|
|
28
|
-
tabIndex: n ? v ?? 0 : v,
|
|
24
|
+
"data-focus": M,
|
|
25
|
+
role: p ?? (n ? "button" : void 0),
|
|
26
|
+
"aria-checked": p ? R : void 0,
|
|
27
|
+
"aria-readonly": p ? B : void 0,
|
|
28
|
+
tabIndex: o ? void 0 : n ? v ?? 0 : v,
|
|
29
29
|
onClick: t || o ? void 0 : l,
|
|
30
|
-
onKeyDown: t || o ? void 0 :
|
|
31
|
-
onMouseDown: t || o ? void 0 :
|
|
32
|
-
onMouseUp: t || o ? void 0 :
|
|
33
|
-
className: i("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !
|
|
30
|
+
onKeyDown: t || o ? void 0 : P,
|
|
31
|
+
onMouseDown: t || o ? void 0 : y,
|
|
32
|
+
onMouseUp: t || o ? void 0 : S,
|
|
33
|
+
className: i("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !W && "w-fit", !$ && "max-w-full", r === "small" ? "h-6" : "h-8", o && "pointer-events-none", t && "pointer-events-none opacity-[0.38]", "data-[focus]:!border-focus-ring data-[focus]:bg-gama-25 data-[focus]:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", b && "focus-within:!border-focus-ring focus-within:bg-gama-25 focus-within:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", n && i("cursor-pointer outline-none", "data-[hovered]:border-gama-200 data-[hovered]:bg-gama-25 hover:border-gama-200 hover:bg-gama-25", "focus-visible:!border-focus-ring focus-visible:bg-gama-25 focus-visible:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", "active:!border-gama-400 active:bg-gama-25 active:shadow-[0_0_0_2px_var(--colors-gama-400)]"), a?.root, h),
|
|
34
34
|
style: {
|
|
35
|
-
...
|
|
36
|
-
|
|
35
|
+
...I,
|
|
36
|
+
...E(j)
|
|
37
37
|
},
|
|
38
38
|
children: [
|
|
39
|
-
|
|
40
|
-
className: i("flex shrink-0 items-center justify-center",
|
|
41
|
-
children:
|
|
39
|
+
f && /* @__PURE__ */ s("span", {
|
|
40
|
+
className: i("flex shrink-0 items-center justify-center", r === "small" ? "h-[18px] w-[18px]" : "h-6 w-6", g ? a?.avatar : a?.icon),
|
|
41
|
+
children: f
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
className: i("min-w-0 truncate",
|
|
43
|
+
/* @__PURE__ */ s("span", {
|
|
44
|
+
className: i("min-w-0 truncate", a?.label),
|
|
45
45
|
children: c
|
|
46
46
|
}),
|
|
47
|
-
|
|
47
|
+
m && !o && /* @__PURE__ */ s("button", {
|
|
48
48
|
type: "button",
|
|
49
|
-
"data-testid": `${
|
|
49
|
+
"data-testid": `${u}-delete`,
|
|
50
50
|
"aria-label": typeof c == "string" ? `Remove ${c}` : "Remove",
|
|
51
|
-
onClick:
|
|
51
|
+
onClick: K,
|
|
52
52
|
disabled: t,
|
|
53
|
-
className: i("flex shrink-0 items-center justify-center rounded-full border border-solid border-delta-100 bg-delta-50 p-0 text-delta-700",
|
|
54
|
-
children:
|
|
55
|
-
height:
|
|
56
|
-
width:
|
|
53
|
+
className: i("flex shrink-0 items-center justify-center rounded-full border border-solid border-delta-100 bg-delta-50 p-0 text-delta-700 [outline:none]", r === "small" ? "h-[18px] w-[18px]" : "h-5 w-5", a?.deleteIcon),
|
|
54
|
+
children: k ?? /* @__PURE__ */ s(L, {
|
|
55
|
+
height: r === "small" ? 14 : 16,
|
|
56
|
+
width: r === "small" ? 14 : 16,
|
|
57
57
|
className: "min-w-0 shrink-0"
|
|
58
58
|
})
|
|
59
59
|
})
|
|
@@ -61,5 +61,5 @@ var Y = U(({ dataTest: f, label: c, size: e = "medium", disabled: t, readOnly: o
|
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
Z as StyledChip
|
|
65
65
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var _ = "
|
|
2
|
-
"asma-ui-core-button": "_asma-ui-core-
|
|
1
|
+
var _ = "_contained_lpch6_6", t = "_common_lpch6_6", a = "_medium_lpch6_55", e = "_small_lpch6_62", r = "_large_lpch6_69", l = "_error_lpch6_81", c = "_outlined_lpch6_156", o = "_text_lpch6_306", h = "_textGray_lpch6_456", m = "_textWhite_lpch6_531", p = {
|
|
2
|
+
"asma-ui-core-button": "_asma-ui-core-button_lpch6_1",
|
|
3
3
|
contained: _,
|
|
4
4
|
common: t,
|
|
5
5
|
medium: a,
|
|
6
6
|
small: e,
|
|
7
7
|
large: r,
|
|
8
|
-
error:
|
|
9
|
-
outlined:
|
|
10
|
-
text:
|
|
11
|
-
textGray:
|
|
12
|
-
textWhite:
|
|
8
|
+
error: l,
|
|
9
|
+
outlined: c,
|
|
10
|
+
text: o,
|
|
11
|
+
textGray: h,
|
|
12
|
+
textWhite: m
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
p as default
|
|
16
16
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { cn as C } from "../../../../helpers/cn.js";
|
|
2
2
|
import e from "./StyledCheckbox.module.js";
|
|
3
|
-
import
|
|
4
|
-
import { Fragment as
|
|
5
|
-
var
|
|
3
|
+
import F, { useEffect as x, useRef as b } from "react";
|
|
4
|
+
import { Fragment as K, jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
5
|
+
var M = (o) => /* @__PURE__ */ t("svg", {
|
|
6
6
|
"aria-hidden": "true",
|
|
7
7
|
viewBox: "0 0 24 24",
|
|
8
8
|
width: "100%",
|
|
9
9
|
height: "100%",
|
|
10
10
|
fill: "none",
|
|
11
|
-
...
|
|
12
|
-
children: /* @__PURE__ */
|
|
11
|
+
...o,
|
|
12
|
+
children: /* @__PURE__ */ t("path", {
|
|
13
13
|
d: "M6 12H18",
|
|
14
14
|
stroke: "currentColor",
|
|
15
|
-
strokeWidth:
|
|
15
|
+
strokeWidth: o.strokeWidth ?? 3,
|
|
16
16
|
strokeLinecap: "round"
|
|
17
17
|
})
|
|
18
|
-
}),
|
|
18
|
+
}), S = (o) => /* @__PURE__ */ t("svg", {
|
|
19
19
|
"aria-hidden": "true",
|
|
20
20
|
viewBox: "0 0 24 24",
|
|
21
21
|
width: "100%",
|
|
@@ -25,63 +25,66 @@ var F = (n) => /* @__PURE__ */ r("svg", {
|
|
|
25
25
|
strokeWidth: 2,
|
|
26
26
|
strokeLinecap: "round",
|
|
27
27
|
strokeLinejoin: "round",
|
|
28
|
-
...
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
}),
|
|
31
|
-
const
|
|
28
|
+
...o,
|
|
29
|
+
children: /* @__PURE__ */ t("path", { d: "M4 12l5 5L20 6" })
|
|
30
|
+
}), G = ({ dataTest: o, size: l = "small", disabled: d, readOnly: a, error: g, indeterminate: n = !1, checked: p, disableRipple: w, hideWrapper: R, className: N, checkboxClassName: I, onChange: W, onClick: E, onKeyDown: D, decorative: L, ...y }) => {
|
|
31
|
+
const c = !!R, s = !w && !c && !d && !a, h = b(null), u = b(null);
|
|
32
32
|
x(() => {
|
|
33
|
-
h.current && (h.current.indeterminate =
|
|
34
|
-
}, [
|
|
35
|
-
const k = C(e.CheckboxWrapper, !
|
|
36
|
-
if (
|
|
33
|
+
h.current && (h.current.indeterminate = n);
|
|
34
|
+
}, [n]);
|
|
35
|
+
const k = C(e.CheckboxWrapper, !c && e[`size-${l}`], c && e.HideWrapper, n && e.Indeterminate, a && e.ReadOnly, g && e.Error, s && e.CheckboxHover, N), H = C(e.Checkbox, e[`size-${l}`], n && e.Indeterminate, I), P = n ? M : S, j = F.useCallback((r) => {
|
|
36
|
+
if (r.stopPropagation(), !s) return;
|
|
37
37
|
const i = document.createElement("span");
|
|
38
38
|
e.CheckboxRipple && (i.className = e.CheckboxRipple), i.addEventListener("animationend", () => i.remove(), { once: !0 }), u.current?.appendChild(i);
|
|
39
|
-
}, [
|
|
39
|
+
}, [s]);
|
|
40
40
|
x(() => {
|
|
41
|
-
const
|
|
42
|
-
return () =>
|
|
41
|
+
const r = u.current;
|
|
42
|
+
return () => r?.replaceChildren();
|
|
43
43
|
}, []);
|
|
44
|
-
const
|
|
45
|
-
a || W?.(
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"data-
|
|
44
|
+
const $ = (r) => {
|
|
45
|
+
a || W?.(r, r.target.checked);
|
|
46
|
+
}, B = (r) => {
|
|
47
|
+
D?.(r), !(r.defaultPrevented || r.key !== "Enter" || a) && (r.preventDefault(), r.currentTarget.click());
|
|
48
|
+
}, f = {
|
|
49
|
+
"data-checked": p && !n ? "" : void 0,
|
|
50
|
+
"data-unchecked": !p && !n ? "" : void 0,
|
|
51
|
+
"data-indeterminate": n ? "" : void 0,
|
|
50
52
|
"data-disabled": d ? "" : void 0
|
|
51
|
-
},
|
|
53
|
+
}, m = /* @__PURE__ */ v(K, { children: [!c && s && /* @__PURE__ */ t("span", {
|
|
52
54
|
ref: u,
|
|
53
55
|
className: e.CheckboxRippleContainer
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
-
className:
|
|
56
|
-
children: /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ t("span", {
|
|
57
|
+
className: H,
|
|
58
|
+
children: /* @__PURE__ */ t("span", {
|
|
57
59
|
className: e.Indicator,
|
|
58
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ t(P, { strokeWidth: l === "small" ? 3 : 2 })
|
|
59
61
|
})
|
|
60
62
|
})] });
|
|
61
|
-
return L ? /* @__PURE__ */
|
|
63
|
+
return L ? /* @__PURE__ */ t("span", {
|
|
62
64
|
"aria-hidden": "true",
|
|
63
65
|
className: k,
|
|
64
|
-
"data-testid":
|
|
65
|
-
...
|
|
66
|
-
children:
|
|
67
|
-
}) : /* @__PURE__ */
|
|
66
|
+
"data-testid": o,
|
|
67
|
+
...f,
|
|
68
|
+
children: m
|
|
69
|
+
}) : /* @__PURE__ */ v("label", {
|
|
68
70
|
className: k,
|
|
69
|
-
"data-testid":
|
|
70
|
-
onPointerDown:
|
|
71
|
+
"data-testid": o,
|
|
72
|
+
onPointerDown: j,
|
|
71
73
|
onClick: E,
|
|
72
|
-
...
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
...f,
|
|
75
|
+
children: [/* @__PURE__ */ t("input", {
|
|
74
76
|
ref: h,
|
|
75
77
|
type: "checkbox",
|
|
76
78
|
className: "sr-only",
|
|
77
79
|
checked: p,
|
|
78
80
|
disabled: d,
|
|
79
81
|
readOnly: a,
|
|
80
|
-
onChange:
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
onChange: $,
|
|
83
|
+
onKeyDown: B,
|
|
84
|
+
...y
|
|
85
|
+
}), m]
|
|
83
86
|
});
|
|
84
87
|
};
|
|
85
88
|
export {
|
|
86
|
-
|
|
89
|
+
G as StyledCheckbox
|
|
87
90
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var e = "
|
|
1
|
+
var e = "_CheckboxWrapper_b3bys_1", _ = "_Checkbox_b3bys_1", b = "_Indeterminate_b3bys_34", r = "_ReadOnly_b3bys_114", a = "_Indicator_b3bys_123", o = "_HideWrapper_b3bys_127", p = "_CheckboxHover_b3bys_134", i = "_CheckboxRippleContainer_b3bys_134", s = "_CheckboxRipple_b3bys_134", l = "_ripple_b3bys_1", y = {
|
|
2
2
|
CheckboxWrapper: e,
|
|
3
|
-
"size-small": "_size-
|
|
4
|
-
"size-medium": "_size-
|
|
3
|
+
"size-small": "_size-small_b3bys_15",
|
|
4
|
+
"size-medium": "_size-medium_b3bys_21",
|
|
5
5
|
Checkbox: _,
|
|
6
|
-
Indeterminate:
|
|
7
|
-
Error: "
|
|
6
|
+
Indeterminate: b,
|
|
7
|
+
Error: "_Error_b3bys_61",
|
|
8
8
|
ReadOnly: r,
|
|
9
9
|
Indicator: a,
|
|
10
10
|
HideWrapper: o,
|
|
11
11
|
CheckboxHover: p,
|
|
12
12
|
CheckboxRippleContainer: i,
|
|
13
|
-
CheckboxRipple:
|
|
14
|
-
ripple:
|
|
13
|
+
CheckboxRipple: s,
|
|
14
|
+
ripple: l
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
y as default
|
|
18
18
|
};
|
|
@@ -11,7 +11,7 @@ import { DynamicInteractiveChipGroup as re } from "./DynamicInteractiveChipGroup
|
|
|
11
11
|
import { createElement as q, forwardRef as oe, useCallback as f, useState as ne } from "react";
|
|
12
12
|
import { Fragment as E, jsx as l, jsxs as O } from "react/jsx-runtime";
|
|
13
13
|
var ye = oe((k, F) => {
|
|
14
|
-
const [
|
|
14
|
+
const [K, S] = ne(!1), { options: h, dataTest: g, value: x, readOnly: u, multiple: o, required: z, onChange: y, size: H, title: v, noOptionsText: _, placeholder: R, disabled: N, helperText: G, disableHelperText: I, error: A, valueKey: P = "value", labelKey: W = "label", renderLabel: i, getOptionTooltip: D, startAdornment: J, autocompleteProps: n, loading: m, maxTags: M, onFocus: Q, onBlur: U } = k, w = h.length < 11, s = (e) => typeof e == "object" ? e?.[W]?.toString() ?? "" : e?.toString() ?? "", p = f((e) => typeof e == "object" ? e?.[P] : e, [P]), V = f((e, t) => p(e) === p(t), [p]), C = (e) => {
|
|
15
15
|
const t = p(e);
|
|
16
16
|
return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : s(e);
|
|
17
17
|
}, $ = f((e) => {
|
|
@@ -28,18 +28,18 @@ var ye = oe((k, F) => {
|
|
|
28
28
|
className: "text-base font-semibold text-delta-800",
|
|
29
29
|
children: v
|
|
30
30
|
}), /* @__PURE__ */ l(ae, {
|
|
31
|
-
open:
|
|
31
|
+
open: K,
|
|
32
32
|
onOpen: $,
|
|
33
33
|
onClose: X,
|
|
34
34
|
disableCloseOnSelect: o,
|
|
35
35
|
dataTest: g,
|
|
36
|
-
disabled: !!
|
|
36
|
+
disabled: !!N || !!m,
|
|
37
37
|
noOptionsText: _,
|
|
38
38
|
loading: m,
|
|
39
39
|
readOnly: u,
|
|
40
40
|
value: x,
|
|
41
|
-
size:
|
|
42
|
-
disableClearable:
|
|
41
|
+
size: H,
|
|
42
|
+
disableClearable: z,
|
|
43
43
|
options: h,
|
|
44
44
|
fullWidth: !0,
|
|
45
45
|
classes: { listbox: "max-h-[300px]" },
|
|
@@ -48,7 +48,7 @@ var ye = oe((k, F) => {
|
|
|
48
48
|
y(t);
|
|
49
49
|
},
|
|
50
50
|
filterSelectedOptions: !1,
|
|
51
|
-
isOptionEqualToValue: n?.isOptionEqualToValue ??
|
|
51
|
+
isOptionEqualToValue: n?.isOptionEqualToValue ?? V,
|
|
52
52
|
autoHeight: !0,
|
|
53
53
|
multiple: o,
|
|
54
54
|
renderValue: o ? (e) => {
|
|
@@ -63,9 +63,9 @@ var ye = oe((k, F) => {
|
|
|
63
63
|
root: "h-fit w-fit min-h-[32px]",
|
|
64
64
|
label: "block whitespace-normal"
|
|
65
65
|
},
|
|
66
|
-
disabled: !!
|
|
66
|
+
disabled: !!N || !!m,
|
|
67
67
|
onDelete: () => {
|
|
68
|
-
Array.isArray(x) && y(x.filter((b) => !
|
|
68
|
+
Array.isArray(x) && y(x.filter((b) => !V(b, r)));
|
|
69
69
|
}
|
|
70
70
|
}, C(r))), c > 0 ? /* @__PURE__ */ l(B, {
|
|
71
71
|
dataTest: "remaining-count-tag-chip",
|
|
@@ -82,7 +82,7 @@ var ye = oe((k, F) => {
|
|
|
82
82
|
width: 24
|
|
83
83
|
}) : void 0,
|
|
84
84
|
renderOption: (e, t, d) => {
|
|
85
|
-
const a = typeof t == "object" ? !!t?.disabled : !1, c =
|
|
85
|
+
const a = typeof t == "object" ? !!t?.disabled : !1, c = D ? D(t) : null;
|
|
86
86
|
if (o) {
|
|
87
87
|
const b = d.selected;
|
|
88
88
|
return /* @__PURE__ */ q("li", {
|
|
@@ -91,9 +91,12 @@ var ye = oe((k, F) => {
|
|
|
91
91
|
"aria-selected": b,
|
|
92
92
|
key: e.id,
|
|
93
93
|
onClick: a ? void 0 : e.onClick,
|
|
94
|
-
className: j("flex min-h-10 cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-
|
|
94
|
+
className: j("relative flex min-h-10 cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
|
|
95
95
|
"aria-disabled": a
|
|
96
|
-
}, /* @__PURE__ */ l(
|
|
96
|
+
}, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
className: "pointer-events-none absolute inset-y-0 left-0 border-l border-solid border-focus-ring"
|
|
99
|
+
}), /* @__PURE__ */ l(L, {
|
|
97
100
|
arrow: !0,
|
|
98
101
|
title: c,
|
|
99
102
|
children: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ l(te, {
|
|
@@ -115,10 +118,13 @@ var ye = oe((k, F) => {
|
|
|
115
118
|
role: "option",
|
|
116
119
|
"aria-selected": r,
|
|
117
120
|
key: e.id,
|
|
118
|
-
className: j("flex min-h-10 cursor-pointer items-center gap-x-1 px-2 text-base aria-selected:bg-gama-50 hover:bg-
|
|
121
|
+
className: j("relative flex min-h-10 cursor-pointer items-center gap-x-1 px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
|
|
119
122
|
onClick: a ? void 0 : e.onClick,
|
|
120
123
|
"aria-disabled": a
|
|
121
|
-
}, /* @__PURE__ */ l(
|
|
124
|
+
}, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
className: "pointer-events-none absolute inset-y-0 left-0 border-l border-solid border-focus-ring"
|
|
127
|
+
}), /* @__PURE__ */ l(L, {
|
|
122
128
|
arrow: !0,
|
|
123
129
|
title: c,
|
|
124
130
|
children: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ l("span", {
|
|
@@ -138,16 +144,18 @@ var ye = oe((k, F) => {
|
|
|
138
144
|
dataTest: `${g}-input-field`,
|
|
139
145
|
...e,
|
|
140
146
|
inputRef: F,
|
|
141
|
-
error:
|
|
142
|
-
helperText:
|
|
143
|
-
reserveHelperText:
|
|
147
|
+
error: A,
|
|
148
|
+
helperText: I ? void 0 : G,
|
|
149
|
+
reserveHelperText: I ? !1 : A !== void 0,
|
|
144
150
|
variant: "outlined",
|
|
145
151
|
label: "",
|
|
146
152
|
placeholder: R,
|
|
147
153
|
readOnly: u,
|
|
148
154
|
onFocus: Q,
|
|
149
155
|
onBlur: U,
|
|
150
|
-
onKeyDown:
|
|
156
|
+
onKeyDown: (t) => {
|
|
157
|
+
e.onKeyDown(t), w && !t.defaultPrevented && t.key.length === 1 && t.preventDefault();
|
|
158
|
+
},
|
|
151
159
|
autoComplete: "off",
|
|
152
160
|
slotProps: {
|
|
153
161
|
...e.slotProps,
|
|
@@ -22,13 +22,13 @@ var d = () => ({
|
|
|
22
22
|
} : {
|
|
23
23
|
top: "50%",
|
|
24
24
|
transform: "translateY(-50%)"
|
|
25
|
-
},
|
|
25
|
+
}, s = ({ focused: e, error: r, disabled: t, readOnly: o, borderless: a }) => n("pointer-events-none absolute inset-0 rounded border border-solid transition-colors", a && !e ? "border-transparent" : t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : e ? "border-[3px] border-focus-ring" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), x = ({ focused: e, error: r, disabled: t, readOnly: o, notched: a = !0 }) => n("pointer-events-none absolute z-0 m-0 box-border min-w-0 overflow-hidden rounded border border-solid transition-colors", a ? "inset-x-0 bottom-0 top-[-5px] px-2 py-0" : "inset-0", t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : e ? "border-[3px] border-focus-ring" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), g = (e) => n("invisible block h-[11px] overflow-hidden p-0 text-xs leading-[23px] transition-[max-width] duration-150", e ? "max-w-full" : "max-w-[0.01px]"), p = ({ shrink: e, focused: r, error: t, disabled: o, readOnly: a }) => n("pointer-events-none absolute left-[14px] z-10 max-w-[calc(100%-1.75rem)] truncate transition-colors duration-150", o ? "text-delta-300" : a ? "text-delta-800" : t ? "text-error-500" : r ? "text-gama-500" : e ? "text-delta-800" : "text-delta-500", e ? "bg-white px-1 text-xs leading-[16px] tracking-[0.24px]" : "text-base leading-[23px] tracking-[0.00938em]");
|
|
26
26
|
export {
|
|
27
27
|
p as floatingLabelClass,
|
|
28
28
|
b as floatingLabelLayoutStyle,
|
|
29
29
|
g as notchedLegendClass,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
x as notchedOutlineClass,
|
|
31
|
+
s as outlineClass,
|
|
32
32
|
l as singleLineInputLayoutStyle,
|
|
33
33
|
d as singleLineShellLayoutStyle
|
|
34
34
|
};
|
|
@@ -1,50 +1,53 @@
|
|
|
1
1
|
import { cn as h } from "../../../../helpers/cn.js";
|
|
2
2
|
import e from "./StyledRadio.module.js";
|
|
3
|
-
import { useRadioGroupContext as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
10
|
-
e.RadioRipple && (
|
|
11
|
-
}, []),
|
|
12
|
-
|
|
13
|
-
},
|
|
3
|
+
import { useRadioGroupContext as S } from "./RadioGroupContext.js";
|
|
4
|
+
import { forwardRef as j, useCallback as F, useRef as K } from "react";
|
|
5
|
+
import { Fragment as _, jsx as r, jsxs as R } from "react/jsx-runtime";
|
|
6
|
+
var $ = j(({ value: o, dataTest: c, className: k, size: p = "medium", error: g, disabled: C, readOnly: t, checked: v, onChange: b, onKeyDown: N, decorative: w, ...m }, y) => {
|
|
7
|
+
const n = S(), d = n ? n.value === o : !!v, s = C ?? n?.disabled ?? !1, u = h(e.RadioWrapper, e.RadioHover, p === "small" && e["size-small"], k, g && e.Error, t && e.ReadOnly), D = h(e.Radio, p === "small" && e["size-small"]), l = K(null), x = F((a) => {
|
|
8
|
+
if (a.stopPropagation(), !l.current) return;
|
|
9
|
+
const i = document.createElement("span");
|
|
10
|
+
e.RadioRipple && (i.className = e.RadioRipple), i.addEventListener("animationend", () => i.remove(), { once: !0 }), l.current.appendChild(i);
|
|
11
|
+
}, []), E = (a) => {
|
|
12
|
+
t || (n && n.onSelect(o ?? null), b?.(a, a.target.checked));
|
|
13
|
+
}, P = (a) => {
|
|
14
|
+
N?.(a), !(a.defaultPrevented || a.key !== "Enter" || t) && (a.preventDefault(), a.currentTarget.click());
|
|
15
|
+
}, f = /* @__PURE__ */ R(_, { children: [/* @__PURE__ */ r("span", {
|
|
14
16
|
className: e.RadioRippleContainer,
|
|
15
|
-
ref:
|
|
16
|
-
}), /* @__PURE__ */
|
|
17
|
-
className:
|
|
18
|
-
children: /* @__PURE__ */
|
|
17
|
+
ref: l
|
|
18
|
+
}), /* @__PURE__ */ r("span", {
|
|
19
|
+
className: D,
|
|
20
|
+
children: /* @__PURE__ */ r("span", { className: e.Indicator })
|
|
19
21
|
})] });
|
|
20
|
-
return
|
|
22
|
+
return w ? /* @__PURE__ */ r("span", {
|
|
21
23
|
"aria-hidden": "true",
|
|
22
24
|
className: u,
|
|
23
|
-
"data-testid":
|
|
24
|
-
"data-checked":
|
|
25
|
-
"data-unchecked":
|
|
25
|
+
"data-testid": c,
|
|
26
|
+
"data-checked": d ? "" : void 0,
|
|
27
|
+
"data-unchecked": d ? void 0 : "",
|
|
26
28
|
"data-disabled": s ? "" : void 0,
|
|
27
29
|
children: f
|
|
28
30
|
}) : /* @__PURE__ */ R("label", {
|
|
29
31
|
className: u,
|
|
30
|
-
"data-testid":
|
|
31
|
-
onPointerDown:
|
|
32
|
-
"data-checked":
|
|
33
|
-
"data-unchecked":
|
|
32
|
+
"data-testid": c,
|
|
33
|
+
onPointerDown: x,
|
|
34
|
+
"data-checked": d ? "" : void 0,
|
|
35
|
+
"data-unchecked": d ? void 0 : "",
|
|
34
36
|
"data-disabled": s ? "" : void 0,
|
|
35
|
-
children: [/* @__PURE__ */
|
|
36
|
-
...
|
|
37
|
-
ref:
|
|
37
|
+
children: [/* @__PURE__ */ r("input", {
|
|
38
|
+
...m,
|
|
39
|
+
ref: y,
|
|
38
40
|
type: "radio",
|
|
39
41
|
className: "sr-only",
|
|
40
|
-
name:
|
|
41
|
-
value:
|
|
42
|
-
checked:
|
|
42
|
+
name: n?.name ?? m.name,
|
|
43
|
+
value: o == null ? void 0 : String(o),
|
|
44
|
+
checked: d,
|
|
43
45
|
disabled: s,
|
|
44
|
-
onChange:
|
|
46
|
+
onChange: E,
|
|
47
|
+
onKeyDown: P
|
|
45
48
|
}), f]
|
|
46
49
|
});
|
|
47
50
|
});
|
|
48
51
|
export {
|
|
49
|
-
|
|
52
|
+
$ as StyledRadio
|
|
50
53
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var a = "
|
|
1
|
+
var a = "_RadioWrapper_1fno0_1", _ = "_RadioRippleContainer_1fno0_27", o = "_RadioRipple_1fno0_27", r = "_ripple_1fno0_1", i = "_RadioHover_1fno0_61", e = "_Radio_1fno0_1", d = "_Indicator_1fno0_113", n = "_ReadOnly_1fno0_154", p = {
|
|
2
2
|
RadioWrapper: a,
|
|
3
|
-
"size-small": "_size-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
"size-small": "_size-small_1fno0_14",
|
|
4
|
+
RadioRippleContainer: _,
|
|
5
|
+
RadioRipple: o,
|
|
6
|
+
ripple: r,
|
|
7
|
+
RadioHover: i,
|
|
8
|
+
Radio: e,
|
|
9
9
|
Indicator: d,
|
|
10
|
-
Error: "
|
|
11
|
-
ReadOnly:
|
|
10
|
+
Error: "_Error_1fno0_134",
|
|
11
|
+
ReadOnly: n
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
p as default
|
|
15
15
|
};
|