@hitachivantara/uikit-react-core 5.77.0 → 5.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/cjs/Button/Button.cjs +24 -31
- package/dist/cjs/Button/Button.styles.cjs +38 -59
- package/dist/cjs/Footer/Footer.cjs +1 -1
- package/dist/cjs/Loading/Loading.styles.cjs +4 -2
- package/dist/cjs/MultiButton/MultiButton.cjs +12 -39
- package/dist/cjs/MultiButton/MultiButton.styles.cjs +25 -56
- package/dist/cjs/Select/Select.styles.cjs +1 -0
- package/dist/cjs/Switch/Switch.cjs +14 -1
- package/dist/cjs/Table/TableCell/TableCell.styles.cjs +3 -0
- package/dist/cjs/Table/TableHeader/TableHeader.styles.cjs +3 -0
- package/dist/cjs/Table/TableRow/TableRow.styles.cjs +1 -0
- package/dist/cjs/Table/hooks/useRowExpand.cjs +3 -3
- package/dist/cjs/Tooltip/Tooltip.styles.cjs +12 -6
- package/dist/cjs/index.cjs +0 -4
- package/dist/esm/Button/Button.js +26 -33
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Button/Button.styles.js +38 -59
- package/dist/esm/Button/Button.styles.js.map +1 -1
- package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/Footer/Footer.js +1 -1
- package/dist/esm/Footer/Footer.js.map +1 -1
- package/dist/esm/Loading/Loading.styles.js +4 -2
- package/dist/esm/Loading/Loading.styles.js.map +1 -1
- package/dist/esm/MultiButton/MultiButton.js +15 -42
- package/dist/esm/MultiButton/MultiButton.js.map +1 -1
- package/dist/esm/MultiButton/MultiButton.styles.js +25 -56
- package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
- package/dist/esm/Select/Select.styles.js +1 -0
- package/dist/esm/Select/Select.styles.js.map +1 -1
- package/dist/esm/Switch/Switch.js +14 -1
- package/dist/esm/Switch/Switch.js.map +1 -1
- package/dist/esm/Table/TableCell/TableCell.styles.js +3 -0
- package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
- package/dist/esm/Table/TableHeader/TableHeader.styles.js +3 -0
- package/dist/esm/Table/TableHeader/TableHeader.styles.js.map +1 -1
- package/dist/esm/Table/TableRow/TableRow.styles.js +1 -0
- package/dist/esm/Table/TableRow/TableRow.styles.js.map +1 -1
- package/dist/esm/Table/hooks/useRowExpand.js +4 -4
- package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/Tooltip/Tooltip.styles.js +12 -6
- package/dist/esm/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +39 -34
- package/package.json +6 -6
- package/dist/cjs/Button/types.cjs +0 -33
- package/dist/esm/Button/types.js +0 -33
- package/dist/esm/Button/types.js.map +0 -1
|
@@ -3,28 +3,31 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
|
+
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
6
7
|
const generic = require("../types/generic.cjs");
|
|
7
8
|
const Button_styles = require("./Button.styles.cjs");
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
function parseVariant(variant) {
|
|
10
|
+
if (variant === "semantic") return ["inherit", "ghost"];
|
|
11
|
+
if (variant === "secondary") return ["secondary", "subtle"];
|
|
12
|
+
if (variant === "ghost") return ["primary", "ghost"];
|
|
13
|
+
if (variant === "contained" || variant === "subtle") {
|
|
14
|
+
return ["secondary", variant];
|
|
15
|
+
}
|
|
16
|
+
const result = variant.split(/(?=[A-Z])/);
|
|
17
|
+
if (!result[1]) return [result[0], "contained"];
|
|
18
|
+
return result.map((x) => x.toLowerCase());
|
|
19
|
+
}
|
|
17
20
|
const HvButton = generic.fixedForwardRef(function HvButton2(props, ref) {
|
|
18
21
|
const {
|
|
19
22
|
classes: classesProp,
|
|
20
23
|
children,
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
icon = false,
|
|
25
|
+
variant: variantProp = icon ? "secondaryGhost" : "primary",
|
|
26
|
+
color: colorProp,
|
|
23
27
|
disabled = false,
|
|
24
28
|
className,
|
|
25
29
|
startIcon,
|
|
26
30
|
endIcon,
|
|
27
|
-
icon = false,
|
|
28
31
|
size,
|
|
29
32
|
radius,
|
|
30
33
|
overrideIconColors = true,
|
|
@@ -37,11 +40,8 @@ const HvButton = generic.fixedForwardRef(function HvButton2(props, ref) {
|
|
|
37
40
|
...others
|
|
38
41
|
} = uikitReactUtils.useDefaultProps("HvButton", props);
|
|
39
42
|
const { classes, css, cx } = Button_styles.useClasses(classesProp);
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
variantProp ?? (icon ? "secondaryGhost" : "primary"),
|
|
43
|
-
activeTheme?.base
|
|
44
|
-
);
|
|
43
|
+
const [parsedColor, variant] = parseVariant(variantProp);
|
|
44
|
+
const color = colorProp ?? parsedColor;
|
|
45
45
|
const handleClick = (e) => {
|
|
46
46
|
if (disabled) return;
|
|
47
47
|
onClickProp?.(e);
|
|
@@ -50,31 +50,24 @@ const HvButton = generic.fixedForwardRef(function HvButton2(props, ref) {
|
|
|
50
50
|
if (disabled) return;
|
|
51
51
|
onMouseDownProp?.(e);
|
|
52
52
|
};
|
|
53
|
-
const [color, type] = React.useMemo(() => {
|
|
54
|
-
const result = variant.split(/(?=[A-Z])/);
|
|
55
|
-
if (result[0] === "ghost" || result[0] === "semantic" || result[0] === "secondary" && !result[1])
|
|
56
|
-
return [];
|
|
57
|
-
return result.map((x) => x.toLowerCase());
|
|
58
|
-
}, [variant]);
|
|
59
53
|
const sizeStyles = React.useMemo(
|
|
60
|
-
() => size
|
|
54
|
+
() => size && (icon ? Button_styles.getIconSizeStyles(size) : Button_styles.getSizeStyles(size)),
|
|
61
55
|
[size, icon]
|
|
62
56
|
);
|
|
63
57
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
64
58
|
Component,
|
|
65
59
|
{
|
|
66
60
|
ref,
|
|
67
|
-
style: {
|
|
68
|
-
|
|
69
|
-
"--
|
|
70
|
-
|
|
61
|
+
style: uikitReactUtils.mergeStyles(style, {
|
|
62
|
+
"--color": color && uikitStyles.getColor(color),
|
|
63
|
+
"--radius": radius && uikitStyles.theme.radii[radius],
|
|
64
|
+
"--HvButton-height": sizeStyles?.height ?? "32px"
|
|
65
|
+
}),
|
|
71
66
|
className: cx(
|
|
72
67
|
classes.root,
|
|
73
|
-
type && classes[type],
|
|
74
|
-
color && css(Button_styles.getColoringStyle(color, type)),
|
|
75
68
|
classes[variant],
|
|
69
|
+
classes[variantProp],
|
|
76
70
|
// Placed after type and color CSS for DS3 override
|
|
77
|
-
radius && css(Button_styles.getRadiusStyles(radius)),
|
|
78
71
|
overrideIconColors && css(Button_styles.getOverrideColors()),
|
|
79
72
|
{
|
|
80
73
|
[classes.icon]: icon,
|
|
@@ -4,6 +4,9 @@ const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
5
|
const focusUtils = require("../utils/focusUtils.cjs");
|
|
6
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvButton", {
|
|
7
|
+
/**
|
|
8
|
+
* Classes applied to the root element
|
|
9
|
+
*/
|
|
7
10
|
root: {
|
|
8
11
|
display: "inline-flex",
|
|
9
12
|
alignItems: "center",
|
|
@@ -12,19 +15,22 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvButton",
|
|
|
12
15
|
cursor: "pointer",
|
|
13
16
|
whiteSpace: "nowrap",
|
|
14
17
|
// Background color common for almost all variants
|
|
15
|
-
"
|
|
16
|
-
|
|
18
|
+
":where(:not($disabled))": {
|
|
19
|
+
":hover, :focus-visible": {
|
|
20
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
21
|
+
}
|
|
17
22
|
},
|
|
18
|
-
"
|
|
19
|
-
...focusUtils.outlineStyles
|
|
20
|
-
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
23
|
+
":focus-visible": {
|
|
24
|
+
...focusUtils.outlineStyles
|
|
21
25
|
},
|
|
22
26
|
// Default button - no size specified
|
|
23
27
|
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
24
28
|
...uikitStyles.theme.typography.label,
|
|
29
|
+
color: "var(--color, currentcolor)",
|
|
30
|
+
backgroundColor: "transparent",
|
|
25
31
|
height: "var(--HvButton-height)",
|
|
26
|
-
border: "1px solid
|
|
27
|
-
borderRadius: uikitStyles.theme.radii.base
|
|
32
|
+
border: "1px solid transparent",
|
|
33
|
+
borderRadius: `var(--radius, ${uikitStyles.theme.radii.base})`,
|
|
28
34
|
padding: uikitStyles.theme.spacing(0, "sm")
|
|
29
35
|
},
|
|
30
36
|
startIcon: {
|
|
@@ -37,11 +43,11 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvButton",
|
|
|
37
43
|
disabled: {
|
|
38
44
|
cursor: "not-allowed",
|
|
39
45
|
color: uikitStyles.theme.colors.secondary_60,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
backgroundColor:
|
|
44
|
-
borderColor:
|
|
46
|
+
backgroundColor: "transparent",
|
|
47
|
+
borderColor: "transparent",
|
|
48
|
+
":hover, :focus-visible": {
|
|
49
|
+
backgroundColor: "transparent",
|
|
50
|
+
borderColor: "transparent"
|
|
45
51
|
}
|
|
46
52
|
},
|
|
47
53
|
icon: {
|
|
@@ -52,27 +58,23 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvButton",
|
|
|
52
58
|
margin: -1
|
|
53
59
|
}
|
|
54
60
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
contained: {
|
|
62
|
+
color: uikitStyles.theme.colors.atmo1,
|
|
63
|
+
// `color-contrast(var(--color) vs ${colors.atmo1}, ${colors.base_light}, ${colors.base_dark})`,
|
|
64
|
+
backgroundColor: "var(--color)",
|
|
65
|
+
":where(:not($disabled))": {
|
|
66
|
+
":hover, :focus-visible": {
|
|
67
|
+
backgroundColor: "color-mix(in srgb, var(--color), black 20%)"
|
|
68
|
+
},
|
|
69
|
+
":active": {
|
|
70
|
+
backgroundColor: "color-mix(in srgb, var(--color), black 30%)"
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
73
|
},
|
|
64
|
-
|
|
65
|
-
borderColor: "
|
|
66
|
-
backgroundColor: "transparent",
|
|
67
|
-
"&$disabled": {
|
|
68
|
-
borderColor: "transparent",
|
|
69
|
-
backgroundColor: "transparent",
|
|
70
|
-
"&:hover, &:focus-visible": {
|
|
71
|
-
borderColor: "transparent",
|
|
72
|
-
backgroundColor: "transparent"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
74
|
+
subtle: {
|
|
75
|
+
borderColor: "currentcolor"
|
|
75
76
|
},
|
|
77
|
+
ghost: {},
|
|
76
78
|
semantic: {
|
|
77
79
|
color: uikitStyles.theme.colors.base_dark,
|
|
78
80
|
backgroundColor: "transparent",
|
|
@@ -93,40 +95,19 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvButton",
|
|
|
93
95
|
// Deprecated (DS3)
|
|
94
96
|
secondary: {}
|
|
95
97
|
});
|
|
96
|
-
const getColoringStyle = (color, type) => {
|
|
97
|
-
if (type)
|
|
98
|
-
return {
|
|
99
|
-
color: uikitStyles.theme.colors[color !== "warning" ? color : `${color}_140`]
|
|
100
|
-
};
|
|
101
|
-
const bg = uikitStyles.theme.colors[color !== "warning" ? color : `${color}_120`];
|
|
102
|
-
const hoverBg = uikitStyles.theme.colors[color !== "warning" ? `${color}_80` : `${color}_140`];
|
|
103
|
-
return {
|
|
104
|
-
color: uikitStyles.theme.colors.atmo1,
|
|
105
|
-
backgroundColor: bg,
|
|
106
|
-
borderColor: bg,
|
|
107
|
-
"&:hover, &:focus-visible": {
|
|
108
|
-
backgroundColor: hoverBg,
|
|
109
|
-
borderColor: hoverBg
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
const getRadiusStyles = (radius) => ({
|
|
114
|
-
borderRadius: uikitStyles.theme.radii[radius]
|
|
115
|
-
});
|
|
116
98
|
const sizes = {
|
|
117
|
-
xs: { height: "24px",
|
|
118
|
-
sm: { height: "24px",
|
|
119
|
-
md: { height: "32px"
|
|
120
|
-
lg: { height: "48px", space: "md"
|
|
121
|
-
xl: { height: "48px", space: "md"
|
|
99
|
+
xs: { height: "24px", fontSize: "sm" },
|
|
100
|
+
sm: { height: "24px", fontSize: "sm" },
|
|
101
|
+
md: { height: "32px" },
|
|
102
|
+
lg: { height: "48px", space: "md" },
|
|
103
|
+
xl: { height: "48px", space: "md" }
|
|
122
104
|
};
|
|
123
105
|
const getSizeStyles = (size) => {
|
|
124
|
-
const { height, space,
|
|
125
|
-
const { color, ...typoProps } = uikitStyles.theme.typography[typography];
|
|
106
|
+
const { height, space = "sm", fontSize } = sizes[size];
|
|
126
107
|
return {
|
|
127
108
|
height,
|
|
128
109
|
padding: uikitStyles.theme.spacing(0, space),
|
|
129
|
-
|
|
110
|
+
fontSize: fontSize && uikitStyles.theme.fontSizes[fontSize]
|
|
130
111
|
};
|
|
131
112
|
};
|
|
132
113
|
const getIconSizeStyles = (size) => {
|
|
@@ -141,10 +122,8 @@ const getOverrideColors = () => ({
|
|
|
141
122
|
fill: "currentcolor"
|
|
142
123
|
}
|
|
143
124
|
});
|
|
144
|
-
exports.getColoringStyle = getColoringStyle;
|
|
145
125
|
exports.getIconSizeStyles = getIconSizeStyles;
|
|
146
126
|
exports.getOverrideColors = getOverrideColors;
|
|
147
|
-
exports.getRadiusStyles = getRadiusStyles;
|
|
148
127
|
exports.getSizeStyles = getSizeStyles;
|
|
149
128
|
exports.staticClasses = staticClasses;
|
|
150
129
|
exports.useClasses = useClasses;
|
|
@@ -11,7 +11,7 @@ const useMediaQuery__default = /* @__PURE__ */ _interopDefault(useMediaQuery);
|
|
|
11
11
|
const HvFooter = (props) => {
|
|
12
12
|
const {
|
|
13
13
|
name = "Hitachi Vantara",
|
|
14
|
-
copyright = `© Hitachi Vantara
|
|
14
|
+
copyright = `© Hitachi Vantara LLC ${(/* @__PURE__ */ new Date()).getFullYear()}. All Rights Reserved.`,
|
|
15
15
|
links,
|
|
16
16
|
classes: classesProp,
|
|
17
17
|
className,
|
|
@@ -12,13 +12,14 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvLoading",
|
|
|
12
12
|
},
|
|
13
13
|
barContainer: {
|
|
14
14
|
display: "flex",
|
|
15
|
+
alignItems: "center",
|
|
15
16
|
justifyContent: "space-around",
|
|
16
17
|
":has($regular)": {
|
|
17
18
|
width: 30,
|
|
18
19
|
height: 30
|
|
19
20
|
},
|
|
20
21
|
":has($small)": {
|
|
21
|
-
"--
|
|
22
|
+
"--height": "40%",
|
|
22
23
|
width: 18,
|
|
23
24
|
height: 18
|
|
24
25
|
}
|
|
@@ -29,9 +30,10 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvLoading",
|
|
|
29
30
|
animation: "loading 1s ease-in-out infinite",
|
|
30
31
|
// TODO: make this the default when it has better support
|
|
31
32
|
width: "round(up, 0.11em, 2px)",
|
|
33
|
+
height: "100%",
|
|
32
34
|
"@keyframes loading": {
|
|
33
35
|
"50%": {
|
|
34
|
-
|
|
36
|
+
height: "var(--height, 60%)",
|
|
35
37
|
backgroundColor: `var(--customColor, ${uikitStyles.theme.colors.secondary})`
|
|
36
38
|
}
|
|
37
39
|
},
|
|
@@ -3,11 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
|
-
const setId = require("../utils/setId.cjs");
|
|
7
6
|
const MultiButton_styles = require("./MultiButton.styles.cjs");
|
|
8
7
|
const HvMultiButton = (props) => {
|
|
9
8
|
const {
|
|
10
|
-
id,
|
|
11
9
|
className,
|
|
12
10
|
children,
|
|
13
11
|
classes: classesProp,
|
|
@@ -18,13 +16,7 @@ const HvMultiButton = (props) => {
|
|
|
18
16
|
split,
|
|
19
17
|
...others
|
|
20
18
|
} = uikitReactUtils.useDefaultProps("HvMultiButton", props);
|
|
21
|
-
const { classes, cx
|
|
22
|
-
const [color, type] = React.useMemo(() => {
|
|
23
|
-
const result = variant.split(/(?=[A-Z])/);
|
|
24
|
-
if (result[0] === "ghost" || result[0] === "semantic" || result[0] === "secondary" && !result[1])
|
|
25
|
-
return [];
|
|
26
|
-
return result.map((x) => x.toLowerCase());
|
|
27
|
-
}, [variant]);
|
|
19
|
+
const { classes, cx } = MultiButton_styles.useClasses(classesProp);
|
|
28
20
|
const buttons = React.useMemo(() => {
|
|
29
21
|
const btns = [];
|
|
30
22
|
React.Children.forEach(children, (child) => {
|
|
@@ -37,7 +29,6 @@ const HvMultiButton = (props) => {
|
|
|
37
29
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
30
|
"div",
|
|
39
31
|
{
|
|
40
|
-
id,
|
|
41
32
|
className: cx(
|
|
42
33
|
classes.root,
|
|
43
34
|
{
|
|
@@ -53,35 +44,17 @@ const HvMultiButton = (props) => {
|
|
|
53
44
|
...others,
|
|
54
45
|
children: buttons.map((child, index) => {
|
|
55
46
|
const childIsSelected = !!child.props.selected;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}),
|
|
68
|
-
split && index < buttons.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
-
"div",
|
|
70
|
-
{
|
|
71
|
-
className: cx(
|
|
72
|
-
classes.splitContainer,
|
|
73
|
-
color && css(MultiButton_styles.getSplitContainerColor(color, type, disabled)),
|
|
74
|
-
size && css(MultiButton_styles.getSplitContainerHeight(size)),
|
|
75
|
-
{
|
|
76
|
-
[classes.splitDisabled]: disabled
|
|
77
|
-
},
|
|
78
|
-
classes[variant]
|
|
79
|
-
// TODO - remove in v6
|
|
80
|
-
),
|
|
81
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.split })
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
] }, btnKey);
|
|
47
|
+
return React.cloneElement(child, {
|
|
48
|
+
key: index,
|
|
49
|
+
variant,
|
|
50
|
+
disabled: disabled || child.props.disabled,
|
|
51
|
+
size,
|
|
52
|
+
className: cx(child.props.className, classes.button, {
|
|
53
|
+
[classes.firstButton]: index === 0,
|
|
54
|
+
[classes.lastButton]: index === buttons.length - 1,
|
|
55
|
+
[classes.selected]: childIsSelected
|
|
56
|
+
})
|
|
57
|
+
});
|
|
85
58
|
})
|
|
86
59
|
}
|
|
87
60
|
);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
|
-
const Button_styles = require("../Button/Button.styles.cjs");
|
|
6
5
|
const DropDownMenu_styles = require("../DropDownMenu/DropDownMenu.styles.cjs");
|
|
7
6
|
require("../DropDownMenu/DropDownMenu.cjs");
|
|
8
7
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvMultiButton", {
|
|
@@ -98,44 +97,40 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvMultiButt
|
|
|
98
97
|
splitGroup: {
|
|
99
98
|
width: "fit-content",
|
|
100
99
|
background: uikitStyles.theme.colors.atmo1,
|
|
101
|
-
//
|
|
102
|
-
"& button$button": {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
marginLeft: -1
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
"&$lastButton": {
|
|
111
|
-
borderTopLeftRadius: 0,
|
|
112
|
-
borderBottomLeftRadius: 0
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
// Dropdown Menu
|
|
116
|
-
[`& .${DropDownMenu_styles.staticClasses.root}`]: {
|
|
117
|
-
"&:has($firstButton)": {
|
|
118
|
-
"& + div$splitContainer": {
|
|
119
|
-
marginRight: -1
|
|
120
|
-
}
|
|
100
|
+
// HvButton, HvDropDownMenu
|
|
101
|
+
"& button$button:not($firstButton), & $button:not($firstButton) button": {
|
|
102
|
+
borderTopLeftRadius: 0,
|
|
103
|
+
borderBottomLeftRadius: 0,
|
|
104
|
+
"&:not([aria-controls])": {
|
|
105
|
+
borderLeftWidth: 0
|
|
121
106
|
}
|
|
122
107
|
},
|
|
123
|
-
|
|
124
|
-
|
|
108
|
+
// HvButton, HvDropDownMenu
|
|
109
|
+
"& button$button:not($lastButton), & $button:not($lastButton) button": {
|
|
125
110
|
borderTopRightRadius: 0,
|
|
126
|
-
borderBottomRightRadius: 0
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
111
|
+
borderBottomRightRadius: 0,
|
|
112
|
+
"&:not([aria-controls])": {
|
|
113
|
+
borderRightWidth: 0
|
|
114
|
+
},
|
|
115
|
+
"&::after": {
|
|
116
|
+
content: "''",
|
|
117
|
+
position: "absolute",
|
|
118
|
+
inset: "4px -1px 4px auto",
|
|
119
|
+
width: 1,
|
|
120
|
+
zIndex: 1,
|
|
121
|
+
height: "auto",
|
|
122
|
+
backgroundColor: "currentcolor"
|
|
123
|
+
}
|
|
132
124
|
},
|
|
125
|
+
// HvDropDownMenu
|
|
133
126
|
[`& .${DropDownMenu_styles.staticClasses.iconSelected}`]: {
|
|
134
127
|
zIndex: 2
|
|
135
128
|
}
|
|
136
129
|
},
|
|
137
130
|
splitGroupDisabled: { background: uikitStyles.theme.colors.atmo3 },
|
|
138
|
-
button: {
|
|
131
|
+
button: {
|
|
132
|
+
position: "relative"
|
|
133
|
+
},
|
|
139
134
|
selected: {},
|
|
140
135
|
vertical: {
|
|
141
136
|
flexDirection: "column",
|
|
@@ -197,23 +192,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvMultiButt
|
|
|
197
192
|
}
|
|
198
193
|
}
|
|
199
194
|
},
|
|
200
|
-
split: {
|
|
201
|
-
width: 1,
|
|
202
|
-
height: "100%",
|
|
203
|
-
background: "currentColor"
|
|
204
|
-
},
|
|
205
|
-
splitContainer: {
|
|
206
|
-
display: "flex",
|
|
207
|
-
justifyContent: "center",
|
|
208
|
-
zIndex: 1,
|
|
209
|
-
width: 2,
|
|
210
|
-
paddingTop: 4,
|
|
211
|
-
paddingBottom: 4,
|
|
212
|
-
height: "calc(32px - 2px)"
|
|
213
|
-
},
|
|
214
|
-
splitDisabled: {
|
|
215
|
-
color: uikitStyles.theme.colors.secondary_60
|
|
216
|
-
},
|
|
217
195
|
firstButton: {},
|
|
218
196
|
lastButton: {},
|
|
219
197
|
// TODO - review the need for these classes in v6
|
|
@@ -224,14 +202,5 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvMultiButt
|
|
|
224
202
|
secondarySubtle: {},
|
|
225
203
|
secondaryGhost: {}
|
|
226
204
|
});
|
|
227
|
-
const getSplitContainerColor = (color, type, disabled) => ({
|
|
228
|
-
color: Button_styles.getColoringStyle(color, type).color,
|
|
229
|
-
backgroundColor: disabled ? uikitStyles.theme.colors.atmo3 : type === "subtle" ? uikitStyles.theme.colors.atmo1 : "transparent"
|
|
230
|
-
});
|
|
231
|
-
const getSplitContainerHeight = (size) => ({
|
|
232
|
-
height: `calc(${Button_styles.getSizeStyles(size).height} - 2px)`
|
|
233
|
-
});
|
|
234
|
-
exports.getSplitContainerColor = getSplitContainerColor;
|
|
235
|
-
exports.getSplitContainerHeight = getSplitContainerHeight;
|
|
236
205
|
exports.staticClasses = staticClasses;
|
|
237
206
|
exports.useClasses = useClasses;
|
|
@@ -28,6 +28,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvSelect",
|
|
|
28
28
|
zIndex: uikitStyles.theme.zIndices.popover
|
|
29
29
|
},
|
|
30
30
|
panel: {
|
|
31
|
+
maxHeight: 400,
|
|
31
32
|
border: `1px solid ${uikitStyles.theme.colors.secondary}`,
|
|
32
33
|
marginTop: -1,
|
|
33
34
|
marginBottom: -1
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
|
+
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
6
7
|
const validationStates = require("../Forms/FormElement/validationStates.cjs");
|
|
7
8
|
const useControlled = require("../hooks/useControlled.cjs");
|
|
8
9
|
const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
@@ -12,6 +13,7 @@ const BaseSwitch = require("../BaseSwitch/BaseSwitch.cjs");
|
|
|
12
13
|
const FormElement = require("../Forms/FormElement/FormElement.cjs");
|
|
13
14
|
const Label = require("../Forms/Label/Label.cjs");
|
|
14
15
|
const WarningText = require("../Forms/WarningText/WarningText.cjs");
|
|
16
|
+
const isSemantical = (color) => ["positive", "negative", "warning"].includes(color);
|
|
15
17
|
const HvSwitch = React.forwardRef(
|
|
16
18
|
(props, ref) => {
|
|
17
19
|
const {
|
|
@@ -35,9 +37,10 @@ const HvSwitch = React.forwardRef(
|
|
|
35
37
|
statusMessage,
|
|
36
38
|
"aria-errormessage": ariaErrorMessage,
|
|
37
39
|
inputProps,
|
|
40
|
+
color,
|
|
38
41
|
...others
|
|
39
42
|
} = uikitReactUtils.useDefaultProps("HvSwitch", props);
|
|
40
|
-
const { classes, cx } = Switch_styles.useClasses(classesProp);
|
|
43
|
+
const { classes, cx, css } = Switch_styles.useClasses(classesProp);
|
|
41
44
|
const elementId = useUniqueId.useUniqueId(id);
|
|
42
45
|
const [isChecked, setIsChecked] = useControlled.useControlled(
|
|
43
46
|
checked,
|
|
@@ -115,6 +118,16 @@ const HvSwitch = React.forwardRef(
|
|
|
115
118
|
"aria-describedby": ariaDescribedBy,
|
|
116
119
|
...inputProps
|
|
117
120
|
},
|
|
121
|
+
...color && {
|
|
122
|
+
classes: {
|
|
123
|
+
switchBase: css({
|
|
124
|
+
"&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track": {
|
|
125
|
+
backgroundColor: uikitStyles.getColor(color),
|
|
126
|
+
borderColor: isSemantical(color) ? uikitStyles.getColor(`${color}_120`) : "#00000032"
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
},
|
|
118
131
|
...others
|
|
119
132
|
}
|
|
120
133
|
)
|
|
@@ -7,6 +7,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
|
|
|
7
7
|
/** Styles applied to the component root class. */
|
|
8
8
|
root: {
|
|
9
9
|
verticalAlign: "inherit",
|
|
10
|
+
alignContent: "inherit",
|
|
10
11
|
textAlign: "left",
|
|
11
12
|
padding: `calc(${uikitStyles.theme.space.xs} - 2px ) ${uikitStyles.theme.space.xs} calc(${uikitStyles.theme.space.xs} - 3px ) ${uikitStyles.theme.spacing(4)}`,
|
|
12
13
|
borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`
|
|
@@ -15,6 +16,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
|
|
|
15
16
|
head: {
|
|
16
17
|
height: 52,
|
|
17
18
|
verticalAlign: "top",
|
|
19
|
+
alignContent: "start",
|
|
18
20
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
19
21
|
borderTop: "1px solid transparent",
|
|
20
22
|
borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`,
|
|
@@ -99,6 +101,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
|
|
|
99
101
|
/** Styles applied to the cell when its variant is list and actions. */
|
|
100
102
|
variantListactions: {
|
|
101
103
|
verticalAlign: "middle",
|
|
104
|
+
alignContent: "center",
|
|
102
105
|
borderLeft: "none",
|
|
103
106
|
paddingLeft: "0",
|
|
104
107
|
textAlign: "center",
|
|
@@ -8,6 +8,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
|
|
|
8
8
|
"--cell-height": "32px",
|
|
9
9
|
height: "var(--cell-height)",
|
|
10
10
|
verticalAlign: "inherit",
|
|
11
|
+
alignContent: "inherit",
|
|
11
12
|
textAlign: "left",
|
|
12
13
|
padding: uikitStyles.theme.spacing(0, 1, 0, 4),
|
|
13
14
|
borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`
|
|
@@ -15,6 +16,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
|
|
|
15
16
|
head: {
|
|
16
17
|
paddingTop: 8,
|
|
17
18
|
verticalAlign: "top",
|
|
19
|
+
alignContent: "start",
|
|
18
20
|
...uikitStyles.theme.typography.label,
|
|
19
21
|
transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
20
22
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
@@ -32,6 +34,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
|
|
|
32
34
|
},
|
|
33
35
|
"&$sortable": {
|
|
34
36
|
verticalAlign: "initial",
|
|
37
|
+
alignContent: "initial",
|
|
35
38
|
paddingTop: 0,
|
|
36
39
|
paddingLeft: 0,
|
|
37
40
|
cursor: "pointer",
|
|
@@ -9,6 +9,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableRow"
|
|
|
9
9
|
color: "inherit",
|
|
10
10
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
11
11
|
verticalAlign: "middle",
|
|
12
|
+
alignContent: "center",
|
|
12
13
|
outline: 0
|
|
13
14
|
},
|
|
14
15
|
/** Styles applied to the component root when inside a `HvTableHead`. */
|
|
@@ -15,7 +15,7 @@ const CellWithExpandButton = ({
|
|
|
15
15
|
labels: labelsProp
|
|
16
16
|
}) => {
|
|
17
17
|
const labels = useLabels.useLabels(DEFAULT_LABELS, labelsProp);
|
|
18
|
-
const
|
|
18
|
+
const rowProps = row.getToggleRowExpandedProps?.();
|
|
19
19
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20
20
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21
21
|
Button.HvButton,
|
|
@@ -23,8 +23,8 @@ const CellWithExpandButton = ({
|
|
|
23
23
|
icon: true,
|
|
24
24
|
"aria-label": row.isExpanded ? labels.collapseRowButtonAriaLabel : labels.expandRowButtonAriaLabel,
|
|
25
25
|
"aria-expanded": row.isExpanded,
|
|
26
|
-
onClick,
|
|
27
|
-
children:
|
|
26
|
+
onClick: rowProps?.onClick,
|
|
27
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropDownXS, { style: { rotate: row.isExpanded ? "180deg" : void 0 } })
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
30
|
cell?.value && /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, { variant: "label", component: "span", children: cell.value })
|
|
@@ -6,13 +6,9 @@ const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
|
6
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTooltip", {
|
|
7
7
|
root: {},
|
|
8
8
|
tooltip: {},
|
|
9
|
-
tooltipMulti: {},
|
|
10
9
|
popper: {
|
|
11
|
-
|
|
12
|
-
opacity: 1
|
|
13
|
-
},
|
|
10
|
+
// TODO: move this to `tooltip` in v6 and make class always be applied
|
|
14
11
|
[`& .${Tooltip.tooltipClasses.tooltip}`]: {
|
|
15
|
-
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
16
12
|
...uikitStyles.theme.typography.body,
|
|
17
13
|
display: "flex",
|
|
18
14
|
width: "fit-content",
|
|
@@ -56,19 +52,29 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTooltip",
|
|
|
56
52
|
padding: uikitStyles.theme.space.sm
|
|
57
53
|
},
|
|
58
54
|
"& $tooltip": {
|
|
59
|
-
padding:
|
|
55
|
+
padding: uikitStyles.theme.space.sm,
|
|
60
56
|
borderRadius: uikitStyles.theme.radii.round,
|
|
61
57
|
"& p": {
|
|
62
58
|
wordBreak: "break-word"
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
},
|
|
62
|
+
// TODO: remove in v6
|
|
63
|
+
/** @deprecated */
|
|
64
|
+
tooltipMulti: {},
|
|
65
|
+
/** @deprecated */
|
|
66
66
|
title: {},
|
|
67
|
+
/** @deprecated */
|
|
67
68
|
valuesContainer: {},
|
|
69
|
+
/** @deprecated */
|
|
68
70
|
values: {},
|
|
71
|
+
/** @deprecated */
|
|
69
72
|
color: {},
|
|
73
|
+
/** @deprecated */
|
|
70
74
|
separatorColor: {},
|
|
75
|
+
/** @deprecated */
|
|
71
76
|
separator: {},
|
|
77
|
+
/** @deprecated */
|
|
72
78
|
valueWrapper: {}
|
|
73
79
|
});
|
|
74
80
|
exports.staticClasses = staticClasses;
|