asma-ui-core 3.34.0 → 3.36.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/badge/StyledBadge.js +29 -24
- package/dist/components/data-display/chip/StyledChip.js +45 -60
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +32 -38
- package/dist/components/data-display/tooltip/StyledTooltip.js +50 -33
- package/dist/components/data-display/typography/StyledTypography.js +62 -4
- package/dist/components/feedback/dialog/StyledDialog.js +70 -50
- package/dist/components/feedback/dialog/StyledDialog.module.js +2 -9
- package/dist/components/feedback/dialog/StyledDialogActions.js +16 -16
- package/dist/components/feedback/dialog/StyledDialogContent.js +17 -14
- package/dist/components/feedback/dialog/StyledDialogTitle.js +18 -13
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +56 -57
- package/dist/components/feedback/snack-bar/StyledAlert.js +72 -14
- package/dist/components/feedback/snack-bar/StyledSnackbar.js +34 -8
- package/dist/components/feedback/snack-bar/components/StyledDefaultSnackbar.js +33 -34
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +55 -58
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -12
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +1 -1
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +1 -1
- package/dist/components/inputs/field-styles.js +6 -0
- package/dist/components/inputs/input-field/StyledInputField.js +104 -81
- package/dist/components/inputs/input-field/StyledInputField.module.js +4 -0
- package/dist/components/inputs/radio-button/base-ui/RadioGroupContext.js +6 -0
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +40 -29
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
- package/dist/components/inputs/radio-button/base-ui/StyledRadioGroup.js +35 -23
- package/dist/components/inputs/select/StyledSelect.js +124 -45
- package/dist/components/inputs/select/StyledSelectItem.js +19 -23
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +181 -151
- package/dist/components/inputs/slider/StyledSlider.js +78 -52
- package/dist/components/inputs/slider/StyledSlider.module.js +10 -0
- package/dist/components/inputs/switch/base-ui/StyledSwitch.js +44 -39
- package/dist/components/miscellaneous/FormControlContext.js +6 -0
- package/dist/components/miscellaneous/StyledFormControl.js +39 -21
- package/dist/components/miscellaneous/StyledFormControlLabel.js +27 -16
- package/dist/components/miscellaneous/StyledFormGroup.js +16 -4
- package/dist/components/miscellaneous/StyledFormHelperText.js +12 -4
- package/dist/components/miscellaneous/StyledInputLabel.js +20 -4
- package/dist/components/mui-compat/Avatar.js +29 -0
- package/dist/components/mui-compat/ClickAwayListener.js +29 -0
- package/dist/components/mui-compat/Container.js +24 -0
- package/dist/components/mui-compat/Fade.js +29 -0
- package/dist/components/mui-compat/Fade.module.js +9 -0
- package/dist/components/mui-compat/FormLabel.js +22 -0
- package/dist/components/mui-compat/Paper.js +44 -0
- package/dist/components/mui-compat/Popper.js +35 -0
- package/dist/components/mui-compat/Skeleton.js +26 -0
- package/dist/components/mui-compat/Stack.js +24 -0
- package/dist/components/navigation/drawer/StyledDrawer.js +42 -4
- package/dist/components/navigation/listbox/Listbox.js +7 -7
- package/dist/components/navigation/menu/StyledMenu.js +28 -11
- package/dist/components/navigation/menu/StyledMenuItem.js +16 -18
- package/dist/components/navigation/menu/StyledMenuList.js +32 -4
- package/dist/components/navigation/tabs/StyledTab.js +25 -13
- package/dist/components/navigation/tabs/StyledTabs.js +112 -64
- package/dist/components/navigation/tabs/TabsContext.js +6 -0
- package/dist/components/utils/accordion/base-ui/AccordionContext.js +10 -0
- package/dist/components/utils/accordion/base-ui/StyledAccordion.js +28 -21
- package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +7 -7
- package/dist/components/utils/accordion/base-ui/StyledAccordionDetails.js +28 -14
- package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +31 -27
- package/dist/components/utils/popover/StyledPopover.js +44 -15
- package/dist/datetime/components/date-picker/StyledDatePicker.js +6 -6
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +1 -1
- package/dist/datetime/components/date-picker/components/HelperTextWithTooltip.js +6 -6
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +11 -11
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerFooter.js +13 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +14 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +6 -6
- package/dist/datetime/components/date-picker/components/StyledDayPicker.js +4 -5
- package/dist/datetime/components/date-picker/hooks/useDatePickerMask.js +4 -4
- package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
- package/dist/datetime/components/time-picker/TimePickerInput.js +15 -16
- package/dist/datetime/components/time-picker/TimePickerPopper.js +21 -19
- package/dist/datetime/helpers/cn.js +4 -5
- package/dist/helpers/arrays.js +4 -0
- package/dist/helpers/cn.js +4 -5
- package/dist/helpers/inputMask.js +45 -0
- package/dist/helpers/sx.js +46 -0
- package/dist/index.js +183 -175
- package/dist/src/api-surface.test.d.ts +1 -0
- package/dist/src/components/data-display/badge/StyledBadge.d.ts +26 -2
- package/dist/src/components/data-display/chip/StyledChip.d.ts +39 -5
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +11 -4
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +36 -2
- package/dist/src/components/data-display/typography/StyledTypography.d.ts +19 -1
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +50 -4
- package/dist/src/components/feedback/dialog/StyledDialogActions.d.ts +12 -2
- package/dist/src/components/feedback/dialog/StyledDialogContent.d.ts +12 -2
- package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +10 -2
- package/dist/src/components/feedback/snack-bar/SnackbarProvider.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/StyledAlert.d.ts +24 -2
- package/dist/src/components/feedback/snack-bar/StyledAlertSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/StyledSnackbar.d.ts +21 -2
- package/dist/src/components/feedback/snack-bar/components/StyledDefaultSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/components/StyledInfoSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/components/types.d.ts +1 -1
- package/dist/src/components/inputs/checkbox/base-ui/StyledCheckbox.d.ts +9 -4
- package/dist/src/components/inputs/dynamic-select/types.d.ts +2 -2
- package/dist/src/components/inputs/field-styles.d.ts +22 -0
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +67 -11
- package/dist/src/components/inputs/input-field/index.d.ts +1 -1
- package/dist/src/components/inputs/radio-button/base-ui/RadioGroupContext.d.ts +10 -0
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadio.d.ts +20 -5
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadioGroup.d.ts +24 -7
- package/dist/src/components/inputs/select/StyledSelect.d.ts +39 -16
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +14 -2
- package/dist/src/components/inputs/select/index.d.ts +0 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +88 -17
- package/dist/src/components/inputs/slider/StyledSlider.d.ts +55 -3
- package/dist/src/components/inputs/switch/base-ui/StyledSwitch.d.ts +20 -4
- package/dist/src/components/miscellaneous/FormControlContext.d.ts +14 -0
- package/dist/src/components/miscellaneous/StyledFormControl.d.ts +22 -2
- package/dist/src/components/miscellaneous/StyledFormControlLabel.d.ts +21 -2
- package/dist/src/components/miscellaneous/StyledFormGroup.d.ts +11 -2
- package/dist/src/components/miscellaneous/StyledFormHelperText.d.ts +12 -2
- package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +20 -2
- package/dist/src/components/mui-compat/Avatar.d.ts +6 -0
- package/dist/src/components/mui-compat/ClickAwayListener.d.ts +19 -0
- package/dist/src/components/mui-compat/Container.d.ts +6 -0
- package/dist/src/components/mui-compat/Fade.d.ts +21 -0
- package/dist/src/components/mui-compat/FormLabel.d.ts +6 -0
- package/dist/src/components/mui-compat/Paper.d.ts +6 -0
- package/dist/src/components/mui-compat/Popper.d.ts +29 -0
- package/dist/src/components/mui-compat/Skeleton.d.ts +7 -0
- package/dist/src/components/mui-compat/Stack.d.ts +7 -0
- package/dist/src/components/mui-compat/index.d.ts +9 -0
- package/dist/src/components/mui-compat/types.d.ts +46 -0
- package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +28 -2
- package/dist/src/components/navigation/menu/StyledMenu.d.ts +33 -2
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +23 -2
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +16 -2
- package/dist/src/components/navigation/menu/index.d.ts +0 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -3
- package/dist/src/components/navigation/tabs/StyledTabs.d.ts +16 -7
- package/dist/src/components/navigation/tabs/TabsContext.d.ts +11 -0
- package/dist/src/components/utils/accordion/base-ui/AccordionContext.d.ts +10 -0
- package/dist/src/components/utils/accordion/base-ui/StyledAccordion.d.ts +9 -3
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionDetails.d.ts +5 -0
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionSummary.d.ts +8 -4
- package/dist/src/components/utils/copy-wrapper/CopyWrapper.d.ts +1 -1
- package/dist/src/components/utils/filter-menu/StyledFilterMenu.d.ts +2 -2
- package/dist/src/components/utils/popover/StyledPopover.d.ts +32 -2
- package/dist/src/datetime/components/date-picker/components/StyledCalendarPicker.d.ts +1 -1
- package/dist/src/datetime/components/date-picker/components/StyledDayPicker.d.ts +1 -1
- package/dist/src/datetime/components/date-picker/hooks/useDatePickerMask.d.ts +1 -2
- package/dist/src/datetime/components/time-picker/TimePickerInput.d.ts +1 -1
- package/dist/src/datetime/components/time-picker/TimePickerPopper.d.ts +1 -1
- package/dist/src/datetime/components/time-picker/types.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledFormControl.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledInputField.d.ts +1 -12
- package/dist/src/datetime/shared-components/StyledSelect.d.ts +1 -16
- package/dist/src/datetime/shared-components/StyledSelectItem.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledTooltip.d.ts +1 -2
- package/dist/src/helpers/arrays.d.ts +2 -0
- package/dist/src/helpers/arrays.test.d.ts +1 -0
- package/dist/src/helpers/inputMask.d.ts +29 -0
- package/dist/src/helpers/inputMask.test.d.ts +1 -0
- package/dist/src/helpers/sx.d.ts +2 -0
- package/dist/src/helpers/sx.test.d.ts +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/table/shared-components/StyledCheckbox.d.ts +7 -4
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +18 -2
- package/dist/src/table/shared-components/menu-item/index.d.ts +13 -2
- package/dist/src/table/shared-components/tooltip/index.d.ts +5 -1
- package/dist/src/table/types.d.ts +1 -1
- package/dist/table/components/Fetching.js +4 -4
- package/dist/table/components/TableRow.js +7 -7
- package/dist/table/components/TableSkeleton.js +6 -6
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +24 -24
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +26 -25
- package/dist/table/components/table-footer/TablePagination.js +27 -24
- package/dist/table/components/table-footer/TableRowCountSelect.js +30 -27
- package/dist/table/helpers/cn.js +4 -5
- package/dist/table/shared-components/StyledCheckbox.js +54 -55
- package/dist/table/shared-components/StyledCheckbox.module.js +10 -10
- package/dist/table/shared-components/StyledMenuItem.js +12 -18
- package/dist/table/shared-components/menu-item/index.js +13 -17
- package/dist/table/shared-components/tooltip/index.js +4 -23
- package/package.json +9 -16
- package/dist/components/feedback/dialog/StyledDialogActions.module.js +0 -8
- package/dist/components/feedback/dialog/StyledDialogContent.module.js +0 -4
- package/dist/components/feedback/dialog/StyledDialogTitle.module.js +0 -4
- package/dist/components/inputs/checkbox/StyledCheckbox.js +0 -20
- package/dist/components/inputs/radio-button/StyledRadio.js +0 -17
- package/dist/datetime/shared-components/ExpandIcon.js +0 -18
- package/dist/datetime/shared-components/StyledFormControl.js +0 -23
- package/dist/datetime/shared-components/StyledInputField.js +0 -47
- package/dist/datetime/shared-components/StyledSelect.js +0 -47
- package/dist/datetime/shared-components/StyledSelectItem.js +0 -13
- package/dist/datetime/shared-components/StyledTooltip.js +0 -32
- package/dist/src/components/inputs/checkbox/StyledCheckbox.d.ts +0 -4
- package/dist/src/components/inputs/radio-button/StyledRadio.d.ts +0 -4
- package/dist/src/components/inputs/radio-button/StyledRadioGroup.d.ts +0 -4
- package/dist/src/components/inputs/switch/StyledSwitch.d.ts +0 -5
- package/dist/src/components/utils/accordion/StyledAccordion.d.ts +0 -2
- package/dist/src/components/utils/accordion/StyledAccordionDetails.d.ts +0 -2
- package/dist/src/components/utils/accordion/StyledAccordionSummary.d.ts +0 -8
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { cn as C } from "../../../../helpers/cn.js";
|
|
2
2
|
import e from "./StyledCheckbox.module.js";
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
|
|
6
|
-
var H = (n) => /* @__PURE__ */ k("svg", {
|
|
3
|
+
import E, { useEffect as m, useRef as f } from "react";
|
|
4
|
+
import { jsx as o, jsxs as k } from "react/jsx-runtime";
|
|
5
|
+
var H = (t) => /* @__PURE__ */ k("svg", {
|
|
7
6
|
viewBox: "0 0 24 24",
|
|
8
7
|
width: "100%",
|
|
9
8
|
height: "100%",
|
|
10
9
|
fill: "none",
|
|
11
|
-
...
|
|
12
|
-
children: [/* @__PURE__ */
|
|
10
|
+
...t,
|
|
11
|
+
children: [/* @__PURE__ */ o("title", { children: "Indeterminate icon" }), /* @__PURE__ */ o("path", {
|
|
13
12
|
d: "M6 12H18",
|
|
14
13
|
stroke: "currentColor",
|
|
15
|
-
strokeWidth:
|
|
14
|
+
strokeWidth: t.strokeWidth ?? 3,
|
|
16
15
|
strokeLinecap: "round"
|
|
17
16
|
})]
|
|
18
|
-
}), j = (
|
|
17
|
+
}), j = (t) => /* @__PURE__ */ k("svg", {
|
|
19
18
|
viewBox: "0 0 24 24",
|
|
20
19
|
width: "100%",
|
|
21
20
|
height: "100%",
|
|
@@ -24,58 +23,56 @@ var H = (n) => /* @__PURE__ */ k("svg", {
|
|
|
24
23
|
strokeWidth: 2,
|
|
25
24
|
strokeLinecap: "round",
|
|
26
25
|
strokeLinejoin: "round",
|
|
27
|
-
...
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
}),
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, [])
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
className: e.Indicator,
|
|
74
|
-
children: /* @__PURE__ */ t(W, { strokeWidth: h === "small" ? 3 : 2 })
|
|
26
|
+
...t,
|
|
27
|
+
children: [/* @__PURE__ */ o("title", { children: "Check icon" }), /* @__PURE__ */ o("path", { d: "M4 12l5 5L20 6" })]
|
|
28
|
+
}), S = ({ dataTest: t, size: l = "medium", disabled: d, readOnly: c, indeterminate: n = !1, checked: h, disableRipple: x, hideWrapper: b, className: v, checkboxClassName: g, onChange: R, ...I }) => {
|
|
29
|
+
const a = !!b, i = !x && !a && !d && !c, p = f(null), u = f(null);
|
|
30
|
+
m(() => {
|
|
31
|
+
p.current && (p.current.indeterminate = n);
|
|
32
|
+
}, [n]);
|
|
33
|
+
const w = C(e.CheckboxWrapper, !a && e[`size-${l}`], a && e.HideWrapper, n && e.Indeterminate, c && e.ReadOnly, i && e.CheckboxHover, v), N = C(e.Checkbox, e[`size-${l}`], n && e.Indeterminate, g), W = n ? H : j, L = E.useCallback((r) => {
|
|
34
|
+
if (r.stopPropagation(), !i) return;
|
|
35
|
+
const s = document.createElement("span");
|
|
36
|
+
e.CheckboxRipple && (s.className = e.CheckboxRipple), s.addEventListener("animationend", () => s.remove(), { once: !0 }), u.current?.appendChild(s);
|
|
37
|
+
}, [i]);
|
|
38
|
+
return m(() => {
|
|
39
|
+
const r = u.current;
|
|
40
|
+
return () => r?.replaceChildren();
|
|
41
|
+
}, []), /* @__PURE__ */ k("label", {
|
|
42
|
+
className: w,
|
|
43
|
+
"data-testid": t,
|
|
44
|
+
onPointerDown: L,
|
|
45
|
+
"data-checked": h && !n ? "" : void 0,
|
|
46
|
+
"data-unchecked": !h && !n ? "" : void 0,
|
|
47
|
+
"data-indeterminate": n ? "" : void 0,
|
|
48
|
+
"data-disabled": d ? "" : void 0,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ o("input", {
|
|
51
|
+
ref: p,
|
|
52
|
+
type: "checkbox",
|
|
53
|
+
className: "sr-only",
|
|
54
|
+
checked: h,
|
|
55
|
+
disabled: d,
|
|
56
|
+
readOnly: c,
|
|
57
|
+
onChange: (r) => {
|
|
58
|
+
c || R?.(r, r.target.checked);
|
|
59
|
+
},
|
|
60
|
+
...I
|
|
61
|
+
}),
|
|
62
|
+
!a && i && /* @__PURE__ */ o("span", {
|
|
63
|
+
ref: u,
|
|
64
|
+
className: e.CheckboxRippleContainer
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ o("span", {
|
|
67
|
+
className: N,
|
|
68
|
+
children: /* @__PURE__ */ o("span", {
|
|
69
|
+
className: e.Indicator,
|
|
70
|
+
children: /* @__PURE__ */ o(W, { strokeWidth: l === "small" ? 3 : 2 })
|
|
71
|
+
})
|
|
75
72
|
})
|
|
76
|
-
|
|
73
|
+
]
|
|
77
74
|
});
|
|
78
75
|
};
|
|
79
76
|
export {
|
|
80
|
-
|
|
77
|
+
S as StyledCheckbox
|
|
81
78
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var e = "
|
|
1
|
+
var e = "_CheckboxWrapper_18wnv_1", _ = "_Checkbox_18wnv_1", r = "_Indeterminate_18wnv_28", a = "_ReadOnly_18wnv_55", v = "_Indicator_18wnv_64", n = "_HideWrapper_18wnv_68", p = "_CheckboxHover_18wnv_75", i = "_CheckboxRippleContainer_18wnv_75", o = "_CheckboxRipple_18wnv_75", l = "_ripple_18wnv_1", d = {
|
|
2
2
|
CheckboxWrapper: e,
|
|
3
|
-
"size-small": "_size-
|
|
4
|
-
"size-medium": "_size-
|
|
5
|
-
Checkbox:
|
|
6
|
-
Indeterminate:
|
|
3
|
+
"size-small": "_size-small_18wnv_11",
|
|
4
|
+
"size-medium": "_size-medium_18wnv_15",
|
|
5
|
+
Checkbox: _,
|
|
6
|
+
Indeterminate: r,
|
|
7
7
|
ReadOnly: a,
|
|
8
|
-
Indicator:
|
|
9
|
-
HideWrapper:
|
|
10
|
-
CheckboxHover:
|
|
11
|
-
CheckboxRippleContainer:
|
|
12
|
-
CheckboxRipple:
|
|
13
|
-
ripple:
|
|
8
|
+
Indicator: v,
|
|
9
|
+
HideWrapper: n,
|
|
10
|
+
CheckboxHover: p,
|
|
11
|
+
CheckboxRippleContainer: i,
|
|
12
|
+
CheckboxRipple: o,
|
|
13
|
+
ripple: l
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
d as default
|
|
17
17
|
};
|
|
@@ -6,7 +6,7 @@ import { StyledInteractiveChip as O } from "../../../data-display/interactive-ch
|
|
|
6
6
|
import { StyledTooltip as J } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
7
7
|
import { StyledButton as M } from "../../button/StyledButton.js";
|
|
8
8
|
import { useWrap as P } from "../helpers/useWrap.js";
|
|
9
|
-
import { Skeleton as y } from "
|
|
9
|
+
import { Skeleton as y } from "../../../mui-compat/Skeleton.js";
|
|
10
10
|
import { forwardRef as Q } from "react";
|
|
11
11
|
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
12
12
|
var ie = Q((S, I) => {
|
|
@@ -3,8 +3,8 @@ 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
5
|
import { StyledChip as D } from "../../../data-display/chip/StyledChip.js";
|
|
6
|
-
import { StyledTooltip as j } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
7
6
|
import { StyledCheckbox as Y } from "../../checkbox/base-ui/StyledCheckbox.js";
|
|
7
|
+
import { StyledTooltip as j } from "../../../data-display/tooltip/StyledTooltip.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";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { cn as a } from "../../helpers/cn.js";
|
|
2
|
+
var n = ({ focused: e, error: t, disabled: r, readOnly: o }) => a("pointer-events-none absolute inset-0 rounded-lg border transition-colors", r ? "border-delta-300" : o ? "border-delta-200" : t ? "border-2 border-error-500" : e ? "border-2 border-gama-400" : "border-delta-500 group-hover:border-2 group-hover:border-delta-300"), s = ({ shrink: e, focused: t, error: r, disabled: o, size: l = "medium" }) => a("pointer-events-none absolute left-3 z-10 max-w-[calc(100%-1.5rem)] truncate transition-all duration-150", o ? "text-gray-300" : r ? "text-error-500" : t ? "text-gama-500" : e ? "text-delta-800" : "text-delta-500", e ? "top-0 -translate-y-1/2 bg-white px-1 text-xs" : a("top-1/2 -translate-y-1/2", l === "small" ? "text-sm" : "text-base"));
|
|
3
|
+
export {
|
|
4
|
+
s as floatingLabelClass,
|
|
5
|
+
n as outlineClass
|
|
6
|
+
};
|
|
@@ -1,90 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { cn as i } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as g } from "../../../helpers/sx.js";
|
|
3
|
+
import { CloseIcon as se } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { ErrorOutlineIcon as oe } from "../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
5
|
+
import { floatingLabelClass as ie, outlineClass as re } from "../field-styles.js";
|
|
6
|
+
import de from "./StyledInputField.module.js";
|
|
7
|
+
import { useId as ce, useState as L } from "react";
|
|
8
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
9
|
+
var ye = ({ dataTest: d, label: N, value: s, defaultValue: c, onChange: E, onBlur: U, onFocus: D, error: l, helperText: m, disabled: u, readOnly: a, required: v, allowClear: V, onClear: $, type: q = "text", placeholder: b, name: z, id: G, autoComplete: J, autoFocus: K, multiline: C, rows: M, minRows: Q, maxRows: me, size: f = "medium", fullWidth: W, className: X, style: Y, sx: Z, inputRef: T, slotProps: n, InputProps: w, onKeyDown: O, variant: ue }) => {
|
|
10
|
+
const P = ce(), I = G ?? P, [h, y] = L(!1), [ee, B] = L(c != null && c !== ""), p = s !== void 0, R = p ? s !== "" && s != null : ee, S = !!u || !!a, o = n?.input?.startAdornment ?? w?.startAdornment, x = n?.input?.endAdornment ?? w?.endAdornment, F = !!(V && R && !S), { ref: te, ...ne } = n?.htmlInput ?? {}, A = T ?? te, { className: le, style: _, ref: ae } = n?.input ?? {}, j = h || R || !!b || !!o, k = {
|
|
11
|
+
...ne,
|
|
12
|
+
id: I,
|
|
13
|
+
name: z,
|
|
14
|
+
placeholder: j ? b : void 0,
|
|
15
|
+
disabled: S,
|
|
16
|
+
readOnly: a,
|
|
17
|
+
required: v,
|
|
18
|
+
autoComplete: J,
|
|
19
|
+
autoFocus: K,
|
|
20
|
+
value: s,
|
|
21
|
+
defaultValue: c,
|
|
22
|
+
"aria-invalid": l ? !0 : void 0,
|
|
23
|
+
onChange: (e) => {
|
|
24
|
+
a || (p || B(e.target.value !== ""), E?.(e));
|
|
25
|
+
},
|
|
26
|
+
onFocus: (e) => {
|
|
27
|
+
y(!0), D?.(e);
|
|
28
|
+
},
|
|
29
|
+
onBlur: (e) => {
|
|
30
|
+
y(!1), U?.(e);
|
|
31
|
+
},
|
|
32
|
+
onKeyDown: O
|
|
33
|
+
}, H = i(de.Input, "peer w-full rounded-lg bg-transparent text-delta-800 outline-none placeholder:text-delta-500", "disabled:text-delta-300", a && "bg-delta-10 text-delta-800", f === "small" ? "text-sm" : "text-base", C ? "resize-none px-3 py-2" : f === "small" ? "h-9 px-3" : "h-12 px-3", o && "pl-10", (F || !!x) && "pr-10", le);
|
|
34
|
+
return /* @__PURE__ */ r("div", {
|
|
35
|
+
className: i("group relative inline-flex flex-col", W && "w-full", X),
|
|
36
|
+
style: {
|
|
37
|
+
...g(Z),
|
|
38
|
+
...Y
|
|
39
|
+
},
|
|
40
|
+
children: [/* @__PURE__ */ r("div", {
|
|
41
|
+
className: "relative flex items-center",
|
|
42
|
+
ref: ae,
|
|
43
|
+
children: [
|
|
44
|
+
C ? /* @__PURE__ */ t("textarea", {
|
|
45
|
+
...k,
|
|
46
|
+
ref: A,
|
|
47
|
+
"data-testid": d,
|
|
48
|
+
rows: M ?? Q ?? 3,
|
|
49
|
+
className: H,
|
|
50
|
+
style: _
|
|
51
|
+
}) : /* @__PURE__ */ t("input", {
|
|
52
|
+
...k,
|
|
53
|
+
ref: A,
|
|
54
|
+
"data-testid": d,
|
|
55
|
+
type: q,
|
|
56
|
+
className: H,
|
|
57
|
+
style: _
|
|
58
|
+
}),
|
|
59
|
+
N && /* @__PURE__ */ r("label", {
|
|
60
|
+
htmlFor: I,
|
|
61
|
+
className: i(ie({
|
|
62
|
+
shrink: j,
|
|
63
|
+
focused: h,
|
|
64
|
+
error: l,
|
|
65
|
+
disabled: u,
|
|
66
|
+
size: f
|
|
67
|
+
}), n?.inputLabel?.className),
|
|
68
|
+
style: g(n?.inputLabel?.sx),
|
|
69
|
+
children: [N, v && " *"]
|
|
70
|
+
}),
|
|
71
|
+
o && /* @__PURE__ */ t("span", {
|
|
72
|
+
className: "absolute left-3 flex items-center text-delta-500",
|
|
73
|
+
children: o
|
|
74
|
+
}),
|
|
75
|
+
F ? /* @__PURE__ */ t("div", {
|
|
29
76
|
role: "button",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
77
|
+
"data-testid": `${d}-clear`,
|
|
78
|
+
className: "absolute right-3 z-40 flex items-center justify-center rounded-full p-[2px] duration-300 hover:bg-gama-100",
|
|
79
|
+
onClick: (e) => {
|
|
80
|
+
e.stopPropagation(), e.preventDefault(), p || B(!1), $?.();
|
|
33
81
|
},
|
|
34
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ t(se, {
|
|
35
83
|
width: 18,
|
|
36
84
|
height: 18
|
|
37
85
|
})
|
|
38
|
-
}) :
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
whiteSpace: "normal",
|
|
62
|
-
wordBreak: "break-word"
|
|
63
|
-
},
|
|
64
|
-
"& .MuiFormHelperText-root.Mui-error": { color: "var(--colors-error-500) !important" },
|
|
65
|
-
"& .MuiInputBase-colorPrimary.Mui-disabled fieldset": { borderColor: "var(--colors-delta-300) !important" },
|
|
66
|
-
"& label.Mui-focused": { color: "var(--colors-gama-500) !important" },
|
|
67
|
-
"& label.Mui-error": { color: "var(--colors-error-500) !important" },
|
|
68
|
-
"& label.Mui-focused.MuiInputLabel-shrink": { color: "var(--colors-gama-500) !important" },
|
|
69
|
-
"& label.Mui-error.MuiInputLabel-shrink": { color: "var(--colors-error-500) !important" },
|
|
70
|
-
"& label": { color: "var(--colors-delta-500) !important" },
|
|
71
|
-
"& label.MuiInputLabel-shrink": { color: "var(--colors-delta-800) !important" },
|
|
72
|
-
"& label.Mui-disabled": { color: "var(--colors-gray-300) !important" },
|
|
73
|
-
"& .MuiOutlinedInput-input::placeholder": {
|
|
74
|
-
color: "var(--colors-delta-500) !important",
|
|
75
|
-
opacity: "1 !important"
|
|
76
|
-
},
|
|
77
|
-
"& .MuiOutlinedInput-input.Mui-disabled": { WebkitTextFillColor: "var(--colors-delta-300) !important" },
|
|
78
|
-
...t && {
|
|
79
|
-
"& .MuiOutlinedInput-input.Mui-disabled": { WebkitTextFillColor: "var(--colors-delta-800) !important" },
|
|
80
|
-
"& .MuiInputBase-colorPrimary.Mui-disabled": { backgroundColor: "var(--colors-delta-10) !important" },
|
|
81
|
-
"& .MuiInputBase-colorPrimary.Mui-disabled fieldset": { borderColor: "var(--colors-delta-200) !important" },
|
|
82
|
-
"& label.Mui-disabled": { color: "var(--colors-gray-800) !important" }
|
|
83
|
-
},
|
|
84
|
-
...o.sx
|
|
85
|
-
}
|
|
86
|
+
}) : x && /* @__PURE__ */ t("span", {
|
|
87
|
+
className: "absolute right-3 flex items-center",
|
|
88
|
+
children: x
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ t("div", { className: re({
|
|
91
|
+
focused: h,
|
|
92
|
+
error: l,
|
|
93
|
+
disabled: u,
|
|
94
|
+
readOnly: a
|
|
95
|
+
}) })
|
|
96
|
+
]
|
|
97
|
+
}), !a && m != null && /* @__PURE__ */ r("p", {
|
|
98
|
+
className: i("m-0 min-h-6 text-sm leading-6", l ? "flex items-start gap-1 text-error-500" : "text-delta-600", n?.formHelperText?.className),
|
|
99
|
+
style: g(n?.formHelperText?.sx),
|
|
100
|
+
children: [l && /* @__PURE__ */ t(oe, {
|
|
101
|
+
width: 20,
|
|
102
|
+
height: 20,
|
|
103
|
+
className: "min-w-5 shrink-0 translate-y-[2px]"
|
|
104
|
+
}), /* @__PURE__ */ t("span", {
|
|
105
|
+
className: "min-w-0 flex-1",
|
|
106
|
+
children: l ? m || "Required" : m
|
|
107
|
+
})]
|
|
108
|
+
})]
|
|
86
109
|
});
|
|
87
110
|
};
|
|
88
111
|
export {
|
|
89
|
-
|
|
112
|
+
ye as StyledInputField
|
|
90
113
|
};
|
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as p } from "../../../../helpers/cn.js";
|
|
2
2
|
import e from "./StyledRadio.module.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
10
|
-
e.RadioRipple && (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
render: /* @__PURE__ */ o("button", {}),
|
|
18
|
-
ref: R,
|
|
19
|
-
value: s,
|
|
20
|
-
"data-testid": l,
|
|
21
|
-
className: u,
|
|
22
|
-
disabled: m,
|
|
3
|
+
import { useRadioGroupContext as w } from "./RadioGroupContext.js";
|
|
4
|
+
import { forwardRef as x, useCallback as y, useRef as S } from "react";
|
|
5
|
+
import { jsx as i, jsxs as D } from "react/jsx-runtime";
|
|
6
|
+
var H = x(({ value: o, dataTest: m, className: u, size: t = "medium", error: R, disabled: f, checked: h, onChange: C, ...l }, b) => {
|
|
7
|
+
const a = w(), d = a ? a.value === o : !!h, c = f ?? a?.disabled ?? !1, g = p(e.RadioWrapper, e.RadioHover, t === "small" && e["size-small"], u, R && e.Error), k = p(e.Radio, t === "small" && e["size-small"]), r = S(null), v = y((n) => {
|
|
8
|
+
if (n.stopPropagation(), !r.current) return;
|
|
9
|
+
const s = document.createElement("span");
|
|
10
|
+
e.RadioRipple && (s.className = e.RadioRipple), s.addEventListener("animationend", () => s.remove(), { once: !0 }), r.current.appendChild(s);
|
|
11
|
+
}, []), N = (n) => {
|
|
12
|
+
a && a.onSelect(o ?? null), C?.(n, n.target.checked);
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ D("label", {
|
|
15
|
+
className: g,
|
|
16
|
+
"data-testid": m,
|
|
23
17
|
onPointerDown: v,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
"data-checked": d ? "" : void 0,
|
|
19
|
+
"data-unchecked": d ? void 0 : "",
|
|
20
|
+
"data-disabled": c ? "" : void 0,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ i("input", {
|
|
23
|
+
...l,
|
|
24
|
+
ref: b,
|
|
25
|
+
type: "radio",
|
|
26
|
+
className: "sr-only",
|
|
27
|
+
name: a?.name ?? l.name,
|
|
28
|
+
value: o == null ? void 0 : String(o),
|
|
29
|
+
checked: d,
|
|
30
|
+
disabled: c,
|
|
31
|
+
onChange: N
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ i("span", {
|
|
34
|
+
className: e.RadioRippleContainer,
|
|
35
|
+
ref: r
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ i("span", {
|
|
38
|
+
className: k,
|
|
39
|
+
children: /* @__PURE__ */ i("span", { className: e.Indicator })
|
|
40
|
+
})
|
|
41
|
+
]
|
|
31
42
|
});
|
|
32
43
|
});
|
|
33
44
|
export {
|
|
34
|
-
|
|
45
|
+
H as StyledRadio
|
|
35
46
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
RadioWrapper:
|
|
3
|
-
"size-small": "_size-
|
|
4
|
-
Radio:
|
|
5
|
-
RadioRippleContainer:
|
|
6
|
-
RadioRipple:
|
|
7
|
-
ripple:
|
|
8
|
-
RadioHover:
|
|
9
|
-
Indicator:
|
|
10
|
-
Error: "
|
|
1
|
+
var r = "_RadioWrapper_17rdx_1", a = "_Radio_17rdx_1", _ = "_RadioRippleContainer_17rdx_34", d = "_RadioRipple_17rdx_34", i = "_ripple_17rdx_1", o = "_RadioHover_17rdx_68", e = "_Indicator_17rdx_120", p = {
|
|
2
|
+
RadioWrapper: r,
|
|
3
|
+
"size-small": "_size-small_17rdx_14",
|
|
4
|
+
Radio: a,
|
|
5
|
+
RadioRippleContainer: _,
|
|
6
|
+
RadioRipple: d,
|
|
7
|
+
ripple: i,
|
|
8
|
+
RadioHover: o,
|
|
9
|
+
Indicator: e,
|
|
10
|
+
Error: "_Error_17rdx_141"
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
13
|
p as default
|
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
import { ErrorOutlineIcon as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"aria-describedby": o ? t ? i : d : void 0,
|
|
13
|
-
"aria-invalid": t,
|
|
14
|
-
ref: x,
|
|
1
|
+
import { ErrorOutlineIcon as B } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
2
|
+
import { RadioGroupContext as C } from "./RadioGroupContext.js";
|
|
3
|
+
import { StyledFormHelperText as G } from "../../../miscellaneous/StyledFormHelperText.js";
|
|
4
|
+
import H from "clsx";
|
|
5
|
+
import { forwardRef as q, useId as t, useMemo as D, useState as E } from "react";
|
|
6
|
+
import { jsx as p, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
var z = q(({ value: o, defaultValue: f, onValueChange: x, disabled: s, dataTest: h, error: e, errorText: v, helperText: d, children: y, name: I, ...g }, R) => {
|
|
8
|
+
const r = t(), i = t(), S = t(), l = I ?? S, n = o !== void 0, [b, w] = E(f ?? null), a = n ? o : b, N = (m) => {
|
|
9
|
+
n || w(m), x?.(m);
|
|
10
|
+
}, T = D(() => ({
|
|
11
|
+
name: l,
|
|
15
12
|
value: a,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
disabled: s,
|
|
14
|
+
onSelect: N
|
|
15
|
+
}), [
|
|
16
|
+
l,
|
|
17
|
+
a,
|
|
18
|
+
s
|
|
19
|
+
]), c = (e ?? !1) || (d ?? !1), j = e ? v ?? "Required" : d;
|
|
20
|
+
return /* @__PURE__ */ u("div", {
|
|
21
|
+
...g,
|
|
22
|
+
ref: R,
|
|
23
|
+
role: "radiogroup",
|
|
24
|
+
"data-testid": h,
|
|
25
|
+
"aria-describedby": c ? e ? i : r : void 0,
|
|
26
|
+
"aria-invalid": e,
|
|
27
|
+
children: [/* @__PURE__ */ p(C.Provider, {
|
|
28
|
+
value: T,
|
|
29
|
+
children: y
|
|
30
|
+
}), c && /* @__PURE__ */ u(G, {
|
|
31
|
+
id: e ? i : r,
|
|
32
|
+
role: e ? "alert" : "status",
|
|
33
|
+
className: H("m-0 flex items-center gap-1 pt-1 text-sm", e ? "text-error-500" : "text-delta-600"),
|
|
34
|
+
children: [e && /* @__PURE__ */ p(B, {
|
|
23
35
|
width: 20,
|
|
24
36
|
height: 20
|
|
25
|
-
}),
|
|
37
|
+
}), j]
|
|
26
38
|
})]
|
|
27
39
|
});
|
|
28
40
|
});
|
|
29
41
|
export {
|
|
30
|
-
|
|
42
|
+
z as StyledRadioGroup
|
|
31
43
|
};
|