@hitachivantara/uikit-react-core 5.91.1 → 5.91.3
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/cjs/BaseCheckBox/BaseCheckBox.cjs +7 -15
- package/dist/cjs/BaseCheckBox/BaseCheckBox.styles.cjs +8 -55
- package/dist/cjs/BaseCheckBox/CheckBoxIcon.cjs +74 -0
- package/dist/cjs/BaseInput/BaseInput.styles.cjs +3 -4
- package/dist/cjs/BaseRadio/BaseRadio.cjs +7 -17
- package/dist/cjs/BaseRadio/BaseRadio.styles.cjs +2 -26
- package/dist/cjs/BaseRadio/RadioIcon.cjs +49 -0
- package/dist/cjs/CheckBox/CheckBox.cjs +1 -1
- package/dist/cjs/CheckBox/CheckBox.styles.cjs +13 -39
- package/dist/cjs/Dropdown/Dropdown.cjs +1 -1
- package/dist/cjs/Dropdown/List/List.cjs +12 -18
- package/dist/cjs/Dropdown/List/List.styles.cjs +0 -2
- package/dist/cjs/InlineEditor/InlineEditor.cjs +1 -1
- package/dist/cjs/Input/Input.cjs +2 -1
- package/dist/cjs/Input/Input.styles.cjs +7 -1
- package/dist/cjs/Input/icons.cjs +19 -0
- package/dist/cjs/Radio/Radio.styles.cjs +8 -5
- package/dist/cjs/Tag/Tag.cjs +4 -4
- package/dist/cjs/Tag/Tag.styles.cjs +1 -2
- package/dist/cjs/TagsInput/TagsInput.cjs +1 -1
- package/dist/cjs/TimePicker/Unit/Unit.cjs +1 -2
- package/dist/cjs/TimePicker/Unit/Unit.styles.cjs +0 -6
- package/dist/cjs/TreeView/internals/hooks/useInstanceEventHandler.cjs +1 -1
- package/dist/cjs/VerticalNavigation/VerticalNavigation.styles.cjs +1 -4
- package/dist/cjs/icons.cjs +15 -0
- package/dist/esm/AppSwitcher/Action/Action.js.map +1 -1
- package/dist/esm/BaseCheckBox/BaseCheckBox.js +7 -15
- package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
- package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js +8 -55
- package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js.map +1 -1
- package/dist/esm/BaseCheckBox/CheckBoxIcon.js +74 -0
- package/dist/esm/BaseCheckBox/CheckBoxIcon.js.map +1 -0
- package/dist/esm/BaseInput/BaseInput.styles.js +3 -4
- package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
- package/dist/esm/BaseRadio/BaseRadio.js +7 -17
- package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
- package/dist/esm/BaseRadio/BaseRadio.styles.js +2 -26
- package/dist/esm/BaseRadio/BaseRadio.styles.js.map +1 -1
- package/dist/esm/BaseRadio/RadioIcon.js +49 -0
- package/dist/esm/BaseRadio/RadioIcon.js.map +1 -0
- package/dist/esm/BreadCrumb/PathElement/PathElement.js.map +1 -1
- package/dist/esm/CheckBox/CheckBox.js +1 -1
- package/dist/esm/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/CheckBox/CheckBox.styles.js +13 -39
- package/dist/esm/CheckBox/CheckBox.styles.js.map +1 -1
- package/dist/esm/DotPagination/DotPagination.js.map +1 -1
- package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/Dropdown/Dropdown.js +1 -1
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/Dropdown/List/List.js +13 -19
- package/dist/esm/Dropdown/List/List.js.map +1 -1
- package/dist/esm/Dropdown/List/List.styles.js +0 -2
- package/dist/esm/Dropdown/List/List.styles.js.map +1 -1
- package/dist/esm/Dropdown/utils.js.map +1 -1
- package/dist/esm/FileUploader/Preview/Preview.js.map +1 -1
- package/dist/esm/Focus/Focus.js.map +1 -1
- package/dist/esm/InlineEditor/InlineEditor.js +1 -1
- package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/Input/Input.js +3 -2
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/Input/Input.styles.js +7 -1
- package/dist/esm/Input/Input.styles.js.map +1 -1
- package/dist/esm/Input/icons.js +19 -0
- package/dist/esm/Input/icons.js.map +1 -0
- package/dist/esm/MultiButton/MultiButton.js.map +1 -1
- package/dist/esm/Radio/Radio.styles.js +8 -5
- package/dist/esm/Radio/Radio.styles.js.map +1 -1
- package/dist/esm/Table/renderers/DateColumnCell.js.map +1 -1
- package/dist/esm/Table/renderers/ProgressColumnCell.js.map +1 -1
- package/dist/esm/Table/renderers/SwitchColumnCell.js.map +1 -1
- package/dist/esm/Tabs/Tab/Tab.js.map +1 -1
- package/dist/esm/Tag/Tag.js +5 -5
- package/dist/esm/Tag/Tag.js.map +1 -1
- package/dist/esm/Tag/Tag.styles.js +1 -2
- package/dist/esm/Tag/Tag.styles.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.js +1 -1
- package/dist/esm/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/TimePicker/Unit/Unit.js +1 -2
- package/dist/esm/TimePicker/Unit/Unit.js.map +1 -1
- package/dist/esm/TimePicker/Unit/Unit.styles.js +0 -6
- package/dist/esm/TimePicker/Unit/Unit.styles.js.map +1 -1
- package/dist/esm/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/TreeView/internals/hooks/useInstanceEventHandler.js +1 -1
- package/dist/esm/TreeView/internals/hooks/useInstanceEventHandler.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js +1 -4
- package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
- package/dist/esm/hooks/useClickOutside.js.map +1 -1
- package/dist/esm/icons.js +13 -0
- package/dist/esm/icons.js.map +1 -0
- package/dist/esm/types/generic.js.map +1 -1
- package/dist/types/index.d.ts +34 -36
- package/package.json +9 -9
- package/dist/cjs/BaseCheckBox/icons.cjs +0 -15
- package/dist/cjs/BaseRadio/icons.cjs +0 -17
- package/dist/esm/BaseCheckBox/icons.js +0 -15
- package/dist/esm/BaseCheckBox/icons.js.map +0 -1
- package/dist/esm/BaseRadio/icons.js +0 -17
- package/dist/esm/BaseRadio/icons.js.map +0 -1
|
@@ -5,20 +5,13 @@ const React = require("react");
|
|
|
5
5
|
const MuiCheckbox = require("@mui/material/Checkbox");
|
|
6
6
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
7
7
|
const BaseCheckBox_styles = require("./BaseCheckBox.styles.cjs");
|
|
8
|
-
const
|
|
8
|
+
const CheckBoxIcon = require("./CheckBoxIcon.cjs");
|
|
9
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
10
|
const MuiCheckbox__default = /* @__PURE__ */ _interopDefault(MuiCheckbox);
|
|
11
|
-
const icons = {
|
|
12
|
-
checkbox: /* @__PURE__ */ jsxRuntime.jsx(icons$1.Box, {}),
|
|
13
|
-
checkboxPartial: /* @__PURE__ */ jsxRuntime.jsx(icons$1.Partial, {}),
|
|
14
|
-
checkboxChecked: /* @__PURE__ */ jsxRuntime.jsx(icons$1.Check, {})
|
|
15
|
-
};
|
|
16
11
|
const HvBaseCheckBox = React.forwardRef(function HvBaseCheckBox2(props, ref) {
|
|
17
12
|
const {
|
|
18
|
-
id,
|
|
19
13
|
classes: classesProp,
|
|
20
14
|
className,
|
|
21
|
-
name,
|
|
22
15
|
inputProps,
|
|
23
16
|
onChange,
|
|
24
17
|
onFocusVisible,
|
|
@@ -58,27 +51,26 @@ const HvBaseCheckBox = React.forwardRef(function HvBaseCheckBox2(props, ref) {
|
|
|
58
51
|
},
|
|
59
52
|
[onFocusVisible]
|
|
60
53
|
);
|
|
54
|
+
const params = { indeterminate, disabled, semantic };
|
|
61
55
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
56
|
MuiCheckbox__default.default,
|
|
63
57
|
{
|
|
64
58
|
ref,
|
|
65
|
-
id,
|
|
66
|
-
name,
|
|
67
59
|
value,
|
|
68
60
|
className: cx(
|
|
69
61
|
classes.root,
|
|
70
62
|
{
|
|
71
|
-
[classes.disabled]: disabled,
|
|
72
63
|
[classes.focusVisible]: focusVisible,
|
|
73
64
|
[classes.checked]: checked,
|
|
74
65
|
[classes.indeterminate]: indeterminate,
|
|
75
|
-
[classes.semantic]: semantic
|
|
66
|
+
[classes.semantic]: semantic,
|
|
67
|
+
[classes.disabled]: disabled
|
|
76
68
|
},
|
|
77
69
|
className
|
|
78
70
|
),
|
|
79
|
-
icon:
|
|
80
|
-
indeterminateIcon:
|
|
81
|
-
checkedIcon:
|
|
71
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(CheckBoxIcon.HvCheckBoxIcon, { ...params }),
|
|
72
|
+
indeterminateIcon: /* @__PURE__ */ jsxRuntime.jsx(CheckBoxIcon.HvCheckBoxIcon, { variant: "indeterminate", ...params }),
|
|
73
|
+
checkedIcon: /* @__PURE__ */ jsxRuntime.jsx(CheckBoxIcon.HvCheckBoxIcon, { variant: "checked", ...params }),
|
|
82
74
|
disabled,
|
|
83
75
|
required,
|
|
84
76
|
readOnly,
|
|
@@ -9,33 +9,15 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseCheck
|
|
|
9
9
|
width: 32,
|
|
10
10
|
minWidth: 32,
|
|
11
11
|
height: 32,
|
|
12
|
-
borderRadius: uikitStyles.theme.radii.
|
|
12
|
+
borderRadius: uikitStyles.theme.radii.round,
|
|
13
13
|
cursor: "pointer",
|
|
14
|
-
"
|
|
15
|
-
backgroundColor: uikitStyles.theme.colors.bgHover
|
|
16
|
-
borderRadius: uikitStyles.theme.radii.round
|
|
17
|
-
},
|
|
18
|
-
"& svg": {
|
|
19
|
-
width: 16,
|
|
20
|
-
height: 16,
|
|
21
|
-
color: uikitStyles.theme.colors.bgContainer,
|
|
22
|
-
borderRadius: uikitStyles.theme.radii.base,
|
|
23
|
-
border: `1px solid ${uikitStyles.theme.colors.borderStrong}`
|
|
14
|
+
":hover": {
|
|
15
|
+
backgroundColor: uikitStyles.theme.colors.bgHover
|
|
24
16
|
}
|
|
25
17
|
},
|
|
26
18
|
disabled: {
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
pointerEvents: "initial",
|
|
30
|
-
"& svg": {
|
|
31
|
-
color: uikitStyles.theme.colors.bgDisabled,
|
|
32
|
-
borderColor: uikitStyles.theme.colors.borderDisabled,
|
|
33
|
-
backgroundColor: uikitStyles.theme.colors.bgDisabled
|
|
34
|
-
},
|
|
35
|
-
"&:hover": {
|
|
36
|
-
backgroundColor: "transparent"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
19
|
+
cursor: "not-allowed",
|
|
20
|
+
pointerEvents: "initial"
|
|
39
21
|
},
|
|
40
22
|
focusVisible: {
|
|
41
23
|
"& svg": {
|
|
@@ -43,38 +25,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseCheck
|
|
|
43
25
|
}
|
|
44
26
|
},
|
|
45
27
|
icon: {},
|
|
46
|
-
checked: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
backgroundColor: uikitStyles.theme.colors.primaryStrong,
|
|
50
|
-
color: uikitStyles.theme.colors.bgContainer
|
|
51
|
-
},
|
|
52
|
-
"&$disabled": {
|
|
53
|
-
"& svg": {
|
|
54
|
-
color: uikitStyles.theme.colors.textDisabled,
|
|
55
|
-
borderColor: "currentcolor"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
indeterminate: {
|
|
60
|
-
"& svg": {
|
|
61
|
-
color: uikitStyles.theme.colors.textSubtle
|
|
62
|
-
},
|
|
63
|
-
"&$disabled": {
|
|
64
|
-
"& svg": {
|
|
65
|
-
color: uikitStyles.theme.colors.textDisabled,
|
|
66
|
-
borderColor: "currentcolor"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
semantic: {
|
|
71
|
-
"&$indeterminate": {
|
|
72
|
-
"& svg": {
|
|
73
|
-
backgroundColor: uikitStyles.theme.colors.bgContainer,
|
|
74
|
-
border: `1px solid ${uikitStyles.theme.colors.borderStrong}`
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
28
|
+
checked: {},
|
|
29
|
+
indeterminate: {},
|
|
30
|
+
semantic: {}
|
|
78
31
|
});
|
|
79
32
|
exports.staticClasses = staticClasses;
|
|
80
33
|
exports.useClasses = useClasses;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
|
+
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
7
|
+
const icons = require("../icons.cjs");
|
|
8
|
+
const { useClasses } = uikitReactUtils.createClasses("HvCheckBoxIcon", {
|
|
9
|
+
root: {
|
|
10
|
+
color: uikitStyles.theme.colors.bgContainer,
|
|
11
|
+
borderRadius: uikitStyles.theme.radii.base,
|
|
12
|
+
border: `1px solid ${uikitStyles.theme.colors.borderStrong}`
|
|
13
|
+
},
|
|
14
|
+
checked: {
|
|
15
|
+
borderColor: "transparent",
|
|
16
|
+
backgroundColor: uikitStyles.theme.colors.primaryStrong,
|
|
17
|
+
color: uikitStyles.theme.colors.bgContainer
|
|
18
|
+
},
|
|
19
|
+
indeterminate: {
|
|
20
|
+
color: uikitStyles.theme.colors.textSubtle,
|
|
21
|
+
backgroundColor: uikitStyles.theme.colors.bgContainer
|
|
22
|
+
},
|
|
23
|
+
semantic: {
|
|
24
|
+
"&[data-variant=indeterminate]": {
|
|
25
|
+
backgroundColor: uikitStyles.theme.colors.bgContainer,
|
|
26
|
+
borderColor: uikitStyles.theme.colors.borderStrong
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
color: uikitStyles.theme.colors.bgDisabled,
|
|
31
|
+
borderColor: uikitStyles.theme.colors.borderDisabled,
|
|
32
|
+
backgroundColor: uikitStyles.theme.colors.bgDisabled,
|
|
33
|
+
"&[data-variant=checked],&[data-variant=indeterminate]": {
|
|
34
|
+
color: uikitStyles.theme.colors.textDisabled,
|
|
35
|
+
borderColor: "currentcolor"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const HvCheckBoxIcon = (props) => {
|
|
40
|
+
const {
|
|
41
|
+
className,
|
|
42
|
+
classes: classesProp,
|
|
43
|
+
variant,
|
|
44
|
+
disabled,
|
|
45
|
+
semantic
|
|
46
|
+
} = uikitReactUtils.useDefaultProps("HvCheckBoxIcon", props);
|
|
47
|
+
const { classes, cx } = useClasses(classesProp, false);
|
|
48
|
+
const d = React.useMemo(() => {
|
|
49
|
+
switch (variant) {
|
|
50
|
+
case "checked":
|
|
51
|
+
return "m5.03,12.06l-3.76,-3.75l1.42,-1.42l2.24,2.25l6.3,-7.2l1.5,1.31l-7.7,8.81z";
|
|
52
|
+
case "indeterminate":
|
|
53
|
+
return "m3,8l8,0l0,-2l-8,0l0,2z";
|
|
54
|
+
case "default":
|
|
55
|
+
default:
|
|
56
|
+
return "m0,0l16,0l0,16l-16,0l0,-16z";
|
|
57
|
+
}
|
|
58
|
+
}, [variant]);
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
icons.SvgBase,
|
|
61
|
+
{
|
|
62
|
+
viewBox: "0 0 14 14",
|
|
63
|
+
"data-variant": variant,
|
|
64
|
+
className: cx(classes.root, className, {
|
|
65
|
+
[classes.checked]: variant === "checked",
|
|
66
|
+
[classes.indeterminate]: variant === "indeterminate",
|
|
67
|
+
[classes.semantic]: semantic,
|
|
68
|
+
[classes.disabled]: disabled
|
|
69
|
+
}),
|
|
70
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
exports.HvCheckBoxIcon = HvCheckBoxIcon;
|
|
@@ -6,10 +6,6 @@ const focusUtils = require("../utils/focusUtils.cjs");
|
|
|
6
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseInput", {
|
|
7
7
|
root: {
|
|
8
8
|
// #region `input` style reset
|
|
9
|
-
"input:-webkit-autofill": {
|
|
10
|
-
WebkitBoxShadow: `0 0 0px 1000px ${uikitStyles.theme.colors.textDimmed} inset`,
|
|
11
|
-
WebkitTextFillColor: uikitStyles.theme.colors.text
|
|
12
|
-
},
|
|
13
9
|
// Clears number input up/down arrows in Chrome and Firefox
|
|
14
10
|
"input[type=number]": {
|
|
15
11
|
MozAppearance: "textfield",
|
|
@@ -30,6 +26,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseInput
|
|
|
30
26
|
display: "inline-flex",
|
|
31
27
|
width: "100%",
|
|
32
28
|
position: "relative",
|
|
29
|
+
overflow: "hidden",
|
|
33
30
|
margin: 0,
|
|
34
31
|
borderRadius: uikitStyles.theme.radii.base,
|
|
35
32
|
height: "32px",
|
|
@@ -38,6 +35,8 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseInput
|
|
|
38
35
|
boxSizing: "border-box",
|
|
39
36
|
backgroundColor: uikitStyles.theme.colors.bgContainer,
|
|
40
37
|
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
38
|
+
alignItems: "stretch",
|
|
39
|
+
...uikitStyles.theme.typography.body,
|
|
41
40
|
":hover:not($disabled,$invalid,$readOnly)": {
|
|
42
41
|
borderColor: uikitStyles.theme.colors.primary
|
|
43
42
|
},
|
|
@@ -5,33 +5,25 @@ const React = require("react");
|
|
|
5
5
|
const MuiRadio = require("@mui/material/Radio");
|
|
6
6
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
7
7
|
const BaseRadio_styles = require("./BaseRadio.styles.cjs");
|
|
8
|
-
const
|
|
8
|
+
const RadioIcon = require("./RadioIcon.cjs");
|
|
9
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
10
|
const MuiRadio__default = /* @__PURE__ */ _interopDefault(MuiRadio);
|
|
11
|
-
const icons = {
|
|
12
|
-
radio: /* @__PURE__ */ jsxRuntime.jsx(icons$1.Unselected, {}),
|
|
13
|
-
radioChecked: /* @__PURE__ */ jsxRuntime.jsx(icons$1.Selected, {})
|
|
14
|
-
};
|
|
15
11
|
const HvBaseRadio = React.forwardRef(
|
|
16
12
|
function HvBaseRadio2(props, ref) {
|
|
17
13
|
const {
|
|
18
14
|
classes: classesProp,
|
|
19
15
|
className,
|
|
20
|
-
id,
|
|
21
|
-
name,
|
|
22
16
|
value = "on",
|
|
23
|
-
required
|
|
24
|
-
readOnly
|
|
25
|
-
disabled
|
|
17
|
+
required,
|
|
18
|
+
readOnly,
|
|
19
|
+
disabled,
|
|
26
20
|
checked,
|
|
27
21
|
defaultChecked,
|
|
28
22
|
onChange,
|
|
29
|
-
semantic
|
|
23
|
+
semantic,
|
|
30
24
|
inputProps,
|
|
31
25
|
onFocusVisible,
|
|
32
26
|
onBlur,
|
|
33
|
-
icon,
|
|
34
|
-
checkedIcon,
|
|
35
27
|
...others
|
|
36
28
|
} = uikitReactUtils.useDefaultProps("HvBaseRadio", props);
|
|
37
29
|
const { classes, cx } = BaseRadio_styles.useClasses(classesProp);
|
|
@@ -63,8 +55,6 @@ const HvBaseRadio = React.forwardRef(
|
|
|
63
55
|
MuiRadio__default.default,
|
|
64
56
|
{
|
|
65
57
|
ref,
|
|
66
|
-
id,
|
|
67
|
-
name,
|
|
68
58
|
className: cx(
|
|
69
59
|
classes.root,
|
|
70
60
|
{
|
|
@@ -75,8 +65,8 @@ const HvBaseRadio = React.forwardRef(
|
|
|
75
65
|
},
|
|
76
66
|
className
|
|
77
67
|
),
|
|
78
|
-
icon:
|
|
79
|
-
checkedIcon:
|
|
68
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(RadioIcon.HvRadioIcon, { disabled }),
|
|
69
|
+
checkedIcon: /* @__PURE__ */ jsxRuntime.jsx(RadioIcon.HvRadioIcon, { checked: true, disabled }),
|
|
80
70
|
color: "default",
|
|
81
71
|
disabled,
|
|
82
72
|
required,
|
|
@@ -11,24 +11,13 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseRadio
|
|
|
11
11
|
height: 32,
|
|
12
12
|
cursor: "pointer",
|
|
13
13
|
borderRadius: "inherit",
|
|
14
|
-
"& svg": {
|
|
15
|
-
width: 16,
|
|
16
|
-
height: 16,
|
|
17
|
-
borderRadius: uikitStyles.theme.radii.full,
|
|
18
|
-
border: `1px solid ${uikitStyles.theme.colors.borderStrong}`,
|
|
19
|
-
backgroundColor: uikitStyles.theme.colors.bgContainer
|
|
20
|
-
},
|
|
21
14
|
":hover": {
|
|
22
15
|
backgroundColor: uikitStyles.theme.colors.bgHover
|
|
23
16
|
}
|
|
24
17
|
},
|
|
25
18
|
disabled: {
|
|
26
19
|
cursor: "not-allowed",
|
|
27
|
-
pointerEvents: "initial"
|
|
28
|
-
"& svg": {
|
|
29
|
-
borderColor: uikitStyles.theme.colors.textDisabled,
|
|
30
|
-
backgroundColor: uikitStyles.theme.colors.bgDisabled
|
|
31
|
-
}
|
|
20
|
+
pointerEvents: "initial"
|
|
32
21
|
},
|
|
33
22
|
focusVisible: {
|
|
34
23
|
"& svg": {
|
|
@@ -37,20 +26,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseRadio
|
|
|
37
26
|
}
|
|
38
27
|
},
|
|
39
28
|
icon: {},
|
|
40
|
-
checked: {
|
|
41
|
-
"& svg": {
|
|
42
|
-
borderColor: "transparent",
|
|
43
|
-
backgroundColor: uikitStyles.theme.colors.primaryStrong,
|
|
44
|
-
color: uikitStyles.theme.colors.bgContainer
|
|
45
|
-
},
|
|
46
|
-
"&$disabled": {
|
|
47
|
-
"& svg": {
|
|
48
|
-
borderColor: "transparent",
|
|
49
|
-
backgroundColor: uikitStyles.theme.colors.borderDisabled,
|
|
50
|
-
color: uikitStyles.theme.colors.bgDisabled
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
29
|
+
checked: {},
|
|
54
30
|
semantic: {}
|
|
55
31
|
});
|
|
56
32
|
exports.staticClasses = staticClasses;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
|
+
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
6
|
+
const icons = require("../icons.cjs");
|
|
7
|
+
const { useClasses } = uikitReactUtils.createClasses("HvRadioIcon", {
|
|
8
|
+
root: {
|
|
9
|
+
borderRadius: uikitStyles.theme.radii.full,
|
|
10
|
+
border: `1px solid ${uikitStyles.theme.colors.borderStrong}`,
|
|
11
|
+
backgroundColor: uikitStyles.theme.colors.bgContainer
|
|
12
|
+
},
|
|
13
|
+
checked: {
|
|
14
|
+
borderColor: "transparent",
|
|
15
|
+
backgroundColor: uikitStyles.theme.colors.primaryStrong,
|
|
16
|
+
color: uikitStyles.theme.colors.bgContainer
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
borderColor: uikitStyles.theme.colors.textDisabled,
|
|
20
|
+
backgroundColor: uikitStyles.theme.colors.bgDisabled
|
|
21
|
+
},
|
|
22
|
+
checkedDisabled: {
|
|
23
|
+
borderColor: "transparent",
|
|
24
|
+
backgroundColor: uikitStyles.theme.colors.borderDisabled,
|
|
25
|
+
color: uikitStyles.theme.colors.bgDisabled
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const HvRadioIcon = (props) => {
|
|
29
|
+
const {
|
|
30
|
+
className,
|
|
31
|
+
classes: classesProp,
|
|
32
|
+
checked,
|
|
33
|
+
disabled
|
|
34
|
+
} = uikitReactUtils.useDefaultProps("HvRadioIcon", props);
|
|
35
|
+
const { classes, cx } = useClasses(classesProp, false);
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
icons.SvgBase,
|
|
38
|
+
{
|
|
39
|
+
viewBox: "0 0 16 16",
|
|
40
|
+
className: cx(classes.root, className, {
|
|
41
|
+
[classes.checked]: checked,
|
|
42
|
+
[classes.disabled]: disabled,
|
|
43
|
+
[classes.checkedDisabled]: checked && disabled
|
|
44
|
+
}),
|
|
45
|
+
children: checked && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "4.5" })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
exports.HvRadioIcon = HvRadioIcon;
|
|
@@ -154,6 +154,7 @@ const HvCheckBox = React.forwardRef(
|
|
|
154
154
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
155
155
|
Label.HvLabel,
|
|
156
156
|
{
|
|
157
|
+
noWrap: true,
|
|
157
158
|
id: setId.setId(elementId, "label"),
|
|
158
159
|
htmlFor: setId.setId(elementId, "input"),
|
|
159
160
|
label,
|
|
@@ -170,7 +171,6 @@ const HvCheckBox = React.forwardRef(
|
|
|
170
171
|
id: setId.setId(elementId, "error"),
|
|
171
172
|
disableAdornment: !hasLabel,
|
|
172
173
|
hideText: !hasLabel,
|
|
173
|
-
disableBorder: true,
|
|
174
174
|
children: validationMessage
|
|
175
175
|
}
|
|
176
176
|
)
|
|
@@ -8,58 +8,32 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvCheckBox"
|
|
|
8
8
|
container: {
|
|
9
9
|
cursor: "pointer",
|
|
10
10
|
display: "flex",
|
|
11
|
-
|
|
11
|
+
alignItems: "center",
|
|
12
12
|
transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
borderRadius: uikitStyles.theme.radii.base,
|
|
14
|
+
"&:hover:not($disabled)": {
|
|
15
|
+
backgroundColor: uikitStyles.theme.colors.bgHover
|
|
16
|
+
},
|
|
17
|
+
":where(:has($label)) $checkbox": {
|
|
18
|
+
borderRadius: "inherit"
|
|
16
19
|
}
|
|
17
20
|
},
|
|
21
|
+
invalidContainer: {},
|
|
18
22
|
disabled: {
|
|
19
23
|
cursor: "not-allowed",
|
|
20
|
-
"& $label": { color: uikitStyles.theme.colors.textDisabled, cursor: "not-allowed" }
|
|
21
|
-
"&:hover": {
|
|
22
|
-
backgroundColor: "transparent"
|
|
23
|
-
}
|
|
24
|
+
"& $label": { color: uikitStyles.theme.colors.textDisabled, cursor: "not-allowed" }
|
|
24
25
|
},
|
|
25
26
|
focusVisible: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
backgroundColor: uikitStyles.theme.colors.bgPageSecondary
|
|
29
|
-
},
|
|
30
|
-
[`& $checkbox div > svg`]: {
|
|
31
|
-
outline: "none",
|
|
32
|
-
boxShadow: "none"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
invalidContainer: {
|
|
36
|
-
borderBottom: `1px solid ${uikitStyles.theme.form.errorColor}`,
|
|
37
|
-
"&:hover": {
|
|
38
|
-
borderBottomLeftRadius: "0px",
|
|
39
|
-
borderBottomRightRadius: "0px"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
checkbox: { height: "32px" },
|
|
43
|
-
invalidCheckbox: {
|
|
44
|
-
"::after": {
|
|
45
|
-
content: '""',
|
|
46
|
-
position: "absolute",
|
|
47
|
-
bottom: 0,
|
|
48
|
-
left: 0,
|
|
49
|
-
width: "100%",
|
|
50
|
-
height: 1,
|
|
51
|
-
backgroundColor: uikitStyles.theme.form.errorColor
|
|
52
|
-
}
|
|
27
|
+
backgroundColor: uikitStyles.theme.colors.bgPageSecondary,
|
|
28
|
+
...focusUtils.outlineStyles
|
|
53
29
|
},
|
|
30
|
+
checkbox: {},
|
|
31
|
+
invalidCheckbox: {},
|
|
54
32
|
label: {
|
|
55
|
-
overflow: "hidden",
|
|
56
|
-
textOverflow: "ellipsis",
|
|
57
33
|
verticalAlign: "middle",
|
|
58
34
|
paddingRight: uikitStyles.theme.space.xs,
|
|
59
|
-
whiteSpace: "nowrap",
|
|
60
35
|
...uikitStyles.theme.typography.body,
|
|
61
36
|
cursor: "pointer",
|
|
62
|
-
height: "32px",
|
|
63
37
|
lineHeight: "32px",
|
|
64
38
|
width: "100%"
|
|
65
39
|
},
|
|
@@ -101,7 +101,7 @@ const HvDropdown = generic.fixedForwardRef(function HvDropdown2(props, ref) {
|
|
|
101
101
|
utils.getSelectionLabel(labels, placeholder, multiSelect, values)
|
|
102
102
|
);
|
|
103
103
|
}, [labels, multiSelect, placeholder, values]);
|
|
104
|
-
const dropdownHeaderRef = React.useRef();
|
|
104
|
+
const dropdownHeaderRef = React.useRef(void 0);
|
|
105
105
|
const {
|
|
106
106
|
ref: refProp,
|
|
107
107
|
dropdownHeaderRef: dropdownHeaderRefProp,
|
|
@@ -5,6 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
6
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
7
7
|
const context = require("../../BaseDropdown/context.cjs");
|
|
8
|
+
const CounterLabel = require("../../utils/CounterLabel.cjs");
|
|
8
9
|
const setId = require("../../utils/setId.cjs");
|
|
9
10
|
const utils = require("../utils.cjs");
|
|
10
11
|
const List_styles = require("./List.styles.cjs");
|
|
@@ -12,7 +13,6 @@ const ActionBar = require("../../ActionBar/ActionBar.cjs");
|
|
|
12
13
|
const Button = require("../../Button/Button.cjs");
|
|
13
14
|
const List = require("../../List/List.cjs");
|
|
14
15
|
const Input = require("../../Input/Input.cjs");
|
|
15
|
-
const Typography = require("../../Typography/Typography.cjs");
|
|
16
16
|
const CheckBox = require("../../CheckBox/CheckBox.cjs");
|
|
17
17
|
const clone = (values) => values.map((value) => ({ ...value }));
|
|
18
18
|
const cleanHidden = (lst) => lst.map((item) => ({ ...item, isHidden: false }));
|
|
@@ -111,30 +111,24 @@ const HvDropdownList = (props) => {
|
|
|
111
111
|
updateSelectAll(newList);
|
|
112
112
|
};
|
|
113
113
|
const renderSelectAll = () => {
|
|
114
|
-
|
|
115
|
-
const multiSelectionConjunction = labels?.multiSelectionConjunction;
|
|
116
|
-
const nbrSelected = utils.getSelected(list).length;
|
|
117
|
-
const defaultLabel = /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, { component: "span", children: nbrSelected > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx("b", { children: nbrSelected }),
|
|
119
|
-
` ${multiSelectionConjunction} ${list.length}`
|
|
120
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx("b", { children: selectAll }),
|
|
122
|
-
` (${list.length})`
|
|
123
|
-
] }) });
|
|
124
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.selectAllContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
114
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
115
|
CheckBox.HvCheckBox,
|
|
126
116
|
{
|
|
127
117
|
id: setId.setId(id, "select-all"),
|
|
128
|
-
label:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
118
|
+
label: /* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
CounterLabel.CounterLabel,
|
|
120
|
+
{
|
|
121
|
+
selected: utils.getSelected(list).length,
|
|
122
|
+
total: list.length,
|
|
123
|
+
conjunctionLabel: labels?.multiSelectionConjunction
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
onChange: handleSelectAll,
|
|
133
127
|
className: classes.selectAll,
|
|
134
128
|
indeterminate: anySelected && !allSelected,
|
|
135
129
|
checked: allSelected
|
|
136
130
|
}
|
|
137
|
-
)
|
|
131
|
+
);
|
|
138
132
|
};
|
|
139
133
|
const onSelection = (listValues) => {
|
|
140
134
|
if (!multiSelect) {
|
|
@@ -20,8 +20,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvDropdownL
|
|
|
20
20
|
searchContainer: { marginBottom: uikitStyles.theme.space.xs },
|
|
21
21
|
listBorderDown: {},
|
|
22
22
|
listContainer: { padding: uikitStyles.theme.space.sm },
|
|
23
|
-
selectAllContainer: {},
|
|
24
|
-
selection: {},
|
|
25
23
|
selectAll: {}
|
|
26
24
|
});
|
|
27
25
|
exports.staticClasses = staticClasses;
|
|
@@ -35,7 +35,7 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
35
35
|
const [value, setValue] = useControlled.useControlled(valueProp, defaultValue);
|
|
36
36
|
const [editMode, setEditMode] = React.useState(false);
|
|
37
37
|
const [cachedValue, setCachedValue] = React.useState(value);
|
|
38
|
-
const inputRef = React.useRef();
|
|
38
|
+
const inputRef = React.useRef(void 0);
|
|
39
39
|
const { activeTheme } = uikitReactUtils.useTheme();
|
|
40
40
|
const [isOverflowing, setIsOverflowing] = React.useState(false);
|
|
41
41
|
const typographyStyles = activeTheme?.typography[variant] || {};
|
package/dist/cjs/Input/Input.cjs
CHANGED
|
@@ -14,6 +14,7 @@ const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
|
14
14
|
const generic = require("../types/generic.cjs");
|
|
15
15
|
const keyboardUtils = require("../utils/keyboardUtils.cjs");
|
|
16
16
|
const setId = require("../utils/setId.cjs");
|
|
17
|
+
const icons = require("./icons.cjs");
|
|
17
18
|
const Input_styles = require("./Input.styles.cjs");
|
|
18
19
|
const Adornment = require("../FormElement/Adornment/Adornment.cjs");
|
|
19
20
|
const utils$1 = require("../FormElement/utils.cjs");
|
|
@@ -319,7 +320,7 @@ const HvInput = generic.fixedForwardRef(function HvInput2(props, ref) {
|
|
|
319
320
|
onClick: () => setRevealPassword((s) => !s),
|
|
320
321
|
"aria-label": labels?.revealPasswordButtonLabel,
|
|
321
322
|
"aria-controls": setId.setId(elementId, "input"),
|
|
322
|
-
icon:
|
|
323
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EyeIcon, { selected: revealPassword }),
|
|
323
324
|
tabIndex: 0,
|
|
324
325
|
...{ selected: revealPassword }
|
|
325
326
|
}
|
|
@@ -17,7 +17,13 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvInput", {
|
|
|
17
17
|
justifyContent: "center",
|
|
18
18
|
marginRight: 1
|
|
19
19
|
},
|
|
20
|
-
icon: {
|
|
20
|
+
icon: {
|
|
21
|
+
// TODO: review in v6 - don't assume/force size
|
|
22
|
+
":has(svg)": {
|
|
23
|
+
width: "30px",
|
|
24
|
+
height: "30px"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
21
27
|
adornmentButton: {
|
|
22
28
|
":focus-visible,:hover": {
|
|
23
29
|
backgroundColor: "transparent"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const icons = require("../icons.cjs");
|
|
5
|
+
const EyeIcon = ({ selected }) => /* @__PURE__ */ jsxRuntime.jsxs(icons.SvgBase, { viewBox: "0 0 16 16", style: { margin: 8 }, children: [
|
|
6
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 8a3 3 0 1 1-3-3 3 3 0 0 1 3 3m5 0s-3.58 6-8 6-8-6-8-6 4-6 8-6 8 6 8 6m-1.2.03a22 22 0 0 0-2-2.32C11.01 3.94 9.35 3 8 3s-3 .93-4.77 2.68a22 22 0 0 0-2.02 2.35 18 18 0 0 0 1.85 2.28C4.25 11.53 6.08 13 8 13s3.73-1.45 4.91-2.67a18 18 0 0 0 1.88-2.3z" }),
|
|
7
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8
|
+
"rect",
|
|
9
|
+
{
|
|
10
|
+
style: { transition: "width 0.2s ease" },
|
|
11
|
+
width: selected ? 20 : 0,
|
|
12
|
+
height: 1,
|
|
13
|
+
x: -2,
|
|
14
|
+
y: 8,
|
|
15
|
+
transform: "translate(-4 8) rotate(-45)"
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
] });
|
|
19
|
+
exports.EyeIcon = EyeIcon;
|
|
@@ -11,8 +11,11 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvRadio", {
|
|
|
11
11
|
alignItems: "center",
|
|
12
12
|
transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
13
13
|
borderRadius: uikitStyles.theme.radii.base,
|
|
14
|
-
"
|
|
14
|
+
"&:hover:not($disabled)": {
|
|
15
15
|
backgroundColor: uikitStyles.theme.colors.bgHover
|
|
16
|
+
},
|
|
17
|
+
":where(:has($label)) $radio": {
|
|
18
|
+
borderRadius: "inherit"
|
|
16
19
|
}
|
|
17
20
|
},
|
|
18
21
|
invalidContainer: {},
|
|
@@ -20,6 +23,10 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvRadio", {
|
|
|
20
23
|
cursor: "not-allowed",
|
|
21
24
|
"& $label": { color: uikitStyles.theme.colors.textDisabled, cursor: "not-allowed" }
|
|
22
25
|
},
|
|
26
|
+
focusVisible: {
|
|
27
|
+
backgroundColor: uikitStyles.theme.colors.bgPageSecondary,
|
|
28
|
+
...focusUtils.outlineStyles
|
|
29
|
+
},
|
|
23
30
|
radio: {},
|
|
24
31
|
invalidRadio: {},
|
|
25
32
|
label: {
|
|
@@ -30,10 +37,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvRadio", {
|
|
|
30
37
|
lineHeight: "32px",
|
|
31
38
|
width: "100%"
|
|
32
39
|
},
|
|
33
|
-
focusVisible: {
|
|
34
|
-
backgroundColor: uikitStyles.theme.colors.bgPageSecondary,
|
|
35
|
-
...focusUtils.outlineStyles
|
|
36
|
-
},
|
|
37
40
|
checked: {},
|
|
38
41
|
semantic: {}
|
|
39
42
|
});
|