@hitachivantara/uikit-react-core 5.71.0 → 5.72.1
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/DropdownButton/DropdownButton.cjs +1 -8
- package/dist/cjs/DropdownButton/DropdownButton.styles.cjs +0 -3
- package/dist/cjs/Header/Actions/Actions.cjs +4 -3
- package/dist/cjs/Header/Brand/Brand.cjs +4 -3
- package/dist/cjs/Header/Navigation/MenuItem/MenuItem.cjs +13 -28
- package/dist/cjs/Header/Navigation/MenuItem/MenuItem.styles.cjs +11 -43
- package/dist/cjs/Header/Navigation/Navigation.cjs +4 -3
- package/dist/cjs/SimpleGrid/SimpleGrid.cjs +2 -2
- package/dist/cjs/SimpleGrid/SimpleGrid.styles.cjs +17 -22
- package/dist/cjs/Typography/Typography.cjs +2 -1
- package/dist/cjs/Typography/Typography.styles.cjs +23 -24
- package/dist/cjs/VerticalNavigation/Actions/Action.cjs +4 -18
- package/dist/cjs/VerticalNavigation/Actions/Action.styles.cjs +4 -17
- package/dist/cjs/VerticalNavigation/Actions/Actions.styles.cjs +3 -5
- package/dist/cjs/VerticalNavigation/Header/Header.styles.cjs +7 -2
- package/dist/cjs/VerticalNavigation/Navigation/Navigation.cjs +3 -3
- package/dist/cjs/VerticalNavigation/Navigation/Navigation.styles.cjs +0 -2
- package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +1 -1
- package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +7 -1
- package/dist/cjs/VerticalNavigation/TreeView/TreeView.styles.cjs +0 -2
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +32 -21
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +4 -0
- package/dist/cjs/VerticalNavigation/VerticalNavigation.cjs +12 -18
- package/dist/cjs/VerticalNavigation/VerticalNavigation.styles.cjs +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js +1 -8
- package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
- package/dist/esm/DropdownButton/DropdownButton.styles.js +0 -3
- package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -1
- package/dist/esm/Header/Actions/Actions.js +4 -3
- package/dist/esm/Header/Actions/Actions.js.map +1 -1
- package/dist/esm/Header/Brand/Brand.js +4 -3
- package/dist/esm/Header/Brand/Brand.js.map +1 -1
- package/dist/esm/Header/Navigation/MenuItem/MenuItem.js +13 -28
- package/dist/esm/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
- package/dist/esm/Header/Navigation/MenuItem/MenuItem.styles.js +11 -43
- package/dist/esm/Header/Navigation/MenuItem/MenuItem.styles.js.map +1 -1
- package/dist/esm/Header/Navigation/Navigation.js +4 -3
- package/dist/esm/Header/Navigation/Navigation.js.map +1 -1
- package/dist/esm/SimpleGrid/SimpleGrid.js +2 -2
- package/dist/esm/SimpleGrid/SimpleGrid.js.map +1 -1
- package/dist/esm/SimpleGrid/SimpleGrid.styles.js +17 -22
- package/dist/esm/SimpleGrid/SimpleGrid.styles.js.map +1 -1
- package/dist/esm/Typography/Typography.js +2 -1
- package/dist/esm/Typography/Typography.js.map +1 -1
- package/dist/esm/Typography/Typography.styles.js +23 -24
- package/dist/esm/Typography/Typography.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Actions/Action.js +5 -19
- package/dist/esm/VerticalNavigation/Actions/Action.js.map +1 -1
- package/dist/esm/VerticalNavigation/Actions/Action.styles.js +4 -17
- package/dist/esm/VerticalNavigation/Actions/Action.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Actions/Actions.styles.js +3 -5
- package/dist/esm/VerticalNavigation/Actions/Actions.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Header/Header.styles.js +7 -2
- package/dist/esm/VerticalNavigation/Header/Header.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Navigation/Navigation.js +1 -1
- package/dist/esm/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/VerticalNavigation/Navigation/Navigation.styles.js +0 -2
- package/dist/esm/VerticalNavigation/Navigation/Navigation.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +7 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/utils.js.map +1 -0
- package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js +0 -2
- package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +33 -22
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +4 -0
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.js +9 -15
- package/dist/esm/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
- package/dist/types/index.d.ts +31 -40
- package/package.json +6 -6
- package/dist/cjs/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs +0 -20
- package/dist/esm/VerticalNavigation/NavigationSlider/utils/NavigationSlider.utils.js.map +0 -1
- package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js +0 -20
- package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js.map +0 -1
- /package/dist/cjs/VerticalNavigation/NavigationSlider/{utils/NavigationSlider.utils.cjs → utils.cjs} +0 -0
- /package/dist/esm/VerticalNavigation/NavigationSlider/{utils/NavigationSlider.utils.js → utils.js} +0 -0
|
@@ -20,14 +20,7 @@ const HvDropdownButton = React.forwardRef((props, ref) => {
|
|
|
20
20
|
...others
|
|
21
21
|
} = uikitReactUtils.useDefaultProps("HvDropdownButton", props);
|
|
22
22
|
const { classes, cx } = DropdownButton_styles.useClasses(classesProp);
|
|
23
|
-
const endIcon = icon ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
-
uikitReactIcons.DropDownXS,
|
|
25
|
-
{
|
|
26
|
-
iconSize: "XS",
|
|
27
|
-
style: { rotate: open ? "180deg" : void 0 },
|
|
28
|
-
className: classes.arrow
|
|
29
|
-
}
|
|
30
|
-
);
|
|
23
|
+
const endIcon = icon ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropDownXS, { iconSize: "XS", style: { rotate: open ? "180deg" : void 0 } });
|
|
31
24
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
25
|
Button.HvButton,
|
|
33
26
|
{
|
|
@@ -56,9 +56,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvDropdownB
|
|
|
56
56
|
placeholder: {},
|
|
57
57
|
arrowContainer: {
|
|
58
58
|
marginRight: uikitStyles.theme.spacing(-2)
|
|
59
|
-
},
|
|
60
|
-
arrow: {
|
|
61
|
-
transition: "rotate 0.2s ease"
|
|
62
59
|
}
|
|
63
60
|
});
|
|
64
61
|
exports.staticClasses = staticClasses;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
4
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
6
|
const Actions_styles = require("./Actions.styles.cjs");
|
|
6
|
-
const HvHeaderActions = (props) => {
|
|
7
|
+
const HvHeaderActions = React.forwardRef((props, ref) => {
|
|
7
8
|
const {
|
|
8
9
|
classes: classesProp,
|
|
9
10
|
className,
|
|
@@ -11,7 +12,7 @@ const HvHeaderActions = (props) => {
|
|
|
11
12
|
...others
|
|
12
13
|
} = uikitReactUtils.useDefaultProps("HvHeaderActions", props);
|
|
13
14
|
const { classes, cx } = Actions_styles.useClasses(classesProp);
|
|
14
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(classes.root, className), ...others, children });
|
|
15
|
-
};
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cx(classes.root, className), ...others, children });
|
|
16
|
+
});
|
|
16
17
|
exports.headerActionsClasses = Actions_styles.staticClasses;
|
|
17
18
|
exports.HvHeaderActions = HvHeaderActions;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
4
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
6
|
const Brand_styles = require("./Brand.styles.cjs");
|
|
6
7
|
const Typography = require("../../Typography/Typography.cjs");
|
|
7
|
-
const HvHeaderBrand = (props) => {
|
|
8
|
+
const HvHeaderBrand = React.forwardRef((props, ref) => {
|
|
8
9
|
const {
|
|
9
10
|
classes: classesProp,
|
|
10
11
|
logo,
|
|
@@ -13,11 +14,11 @@ const HvHeaderBrand = (props) => {
|
|
|
13
14
|
...others
|
|
14
15
|
} = uikitReactUtils.useDefaultProps("HvHeaderBrand", props);
|
|
15
16
|
const { classes, cx } = Brand_styles.useClasses(classesProp);
|
|
16
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(classes.root, className), ...others, children: [
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cx(classes.root, className), ...others, children: [
|
|
17
18
|
logo,
|
|
18
19
|
logo && name && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.separator }),
|
|
19
20
|
name && /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, { className: classes.brandName, variant: "label", children: name })
|
|
20
21
|
] });
|
|
21
|
-
};
|
|
22
|
+
});
|
|
22
23
|
exports.headerBrandClasses = Brand_styles.staticClasses;
|
|
23
24
|
exports.HvHeaderBrand = HvHeaderBrand;
|
|
@@ -59,11 +59,6 @@ const HvHeaderMenuItem = (props) => {
|
|
|
59
59
|
const handleFocus = (event) => {
|
|
60
60
|
dispatch?.({ type: "setItemFocused", itemFocused: event.currentTarget });
|
|
61
61
|
};
|
|
62
|
-
const itemProps = {
|
|
63
|
-
onClick: actionHandler,
|
|
64
|
-
onKeyDown: actionHandler,
|
|
65
|
-
onFocus: handleFocus
|
|
66
|
-
};
|
|
67
62
|
const label = /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
63
|
Typography.HvTypography,
|
|
69
64
|
{
|
|
@@ -80,6 +75,8 @@ const HvHeaderMenuItem = (props) => {
|
|
|
80
75
|
itemHref = href;
|
|
81
76
|
itemTarget = target;
|
|
82
77
|
}
|
|
78
|
+
const ItemComponent = itemHref ? "a" : "div";
|
|
79
|
+
const itemProps = itemHref ? { href: itemHref, target: itemTarget, "aria-label": item.label } : { role: "button", tabIndex: 0 };
|
|
83
80
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
84
81
|
"li",
|
|
85
82
|
{
|
|
@@ -94,31 +91,20 @@ const HvHeaderMenuItem = (props) => {
|
|
|
94
91
|
className
|
|
95
92
|
),
|
|
96
93
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
ItemComponent,
|
|
99
96
|
{
|
|
100
|
-
className: classes.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
className: cx(classes.item, {
|
|
98
|
+
[classes.link]: itemHref,
|
|
99
|
+
[classes.button]: !itemHref
|
|
100
|
+
}),
|
|
101
|
+
onFocus: handleFocus,
|
|
102
|
+
onClick: actionHandler,
|
|
103
|
+
onKeyDown: actionHandler,
|
|
104
104
|
"aria-current": isCurrent,
|
|
105
|
-
|
|
105
|
+
...itemProps,
|
|
106
106
|
children: label
|
|
107
107
|
}
|
|
108
|
-
) : (
|
|
109
|
-
// keeping this code path for backwards compatibility, but
|
|
110
|
-
// shouldn't really be used as it's not accessible
|
|
111
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
className: classes.button,
|
|
115
|
-
role: "button",
|
|
116
|
-
...itemProps,
|
|
117
|
-
tabIndex: 0,
|
|
118
|
-
"aria-current": isCurrent,
|
|
119
|
-
children: label
|
|
120
|
-
}
|
|
121
|
-
)
|
|
122
108
|
),
|
|
123
109
|
hasSubLevel && currentLevel < levels && currentLevel < 2 && /* @__PURE__ */ jsxRuntime.jsx(Bar.Bar, { data, type: "menu", children: data.map((itm) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
110
|
HvHeaderMenuItem,
|
|
@@ -132,8 +118,7 @@ const HvHeaderMenuItem = (props) => {
|
|
|
132
118
|
itm.id
|
|
133
119
|
)) })
|
|
134
120
|
]
|
|
135
|
-
}
|
|
136
|
-
item.label
|
|
121
|
+
}
|
|
137
122
|
);
|
|
138
123
|
};
|
|
139
124
|
exports.headerMenuItemClasses = MenuItem_styles.staticClasses;
|
|
@@ -21,6 +21,7 @@ const item = {
|
|
|
21
21
|
},
|
|
22
22
|
"& span": {
|
|
23
23
|
display: "inline-flex",
|
|
24
|
+
color: "inherit",
|
|
24
25
|
flexDirection: "column",
|
|
25
26
|
alignItems: "center",
|
|
26
27
|
justifyContent: "space-between"
|
|
@@ -43,57 +44,24 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
43
44
|
{
|
|
44
45
|
root: {
|
|
45
46
|
display: "inline",
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"&:focus-within": {
|
|
47
|
+
height: "100%",
|
|
48
|
+
borderBottom: "4px solid transparent",
|
|
49
|
+
":hover, :focus-within": {
|
|
50
50
|
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
menu: {
|
|
54
|
-
|
|
55
|
-
paddingBottom: "4px",
|
|
56
|
-
paddingTop: "4px",
|
|
57
|
-
height: "100%",
|
|
58
|
-
borderTop: "none",
|
|
59
|
-
borderBottom: `4px solid ${uikitStyles.theme.colors.atmo2}`
|
|
60
|
-
},
|
|
61
|
-
menubar: {
|
|
62
|
-
marginTop: "0px",
|
|
63
|
-
paddingBottom: "4px",
|
|
64
|
-
paddingTop: "4px",
|
|
65
|
-
height: "100%",
|
|
66
|
-
borderTop: `0px solid ${uikitStyles.theme.colors.atmo1}`,
|
|
67
|
-
borderBottom: `${"4px"} solid ${uikitStyles.theme.colors.atmo1}`
|
|
68
|
-
},
|
|
53
|
+
menu: {},
|
|
54
|
+
menubar: {},
|
|
69
55
|
selected: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
paddingBottom: 0,
|
|
73
|
-
borderTop: "none",
|
|
74
|
-
borderBottom: `4px solid ${uikitStyles.theme.colors.secondary}`,
|
|
75
|
-
paddingTop: "4px",
|
|
76
|
-
height: "100%",
|
|
77
|
-
"& > * > span": {
|
|
78
|
-
color: uikitStyles.theme.colors.secondary
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"&$menubar": {
|
|
82
|
-
marginTop: 0,
|
|
83
|
-
paddingBottom: 0,
|
|
84
|
-
borderTop: "none",
|
|
85
|
-
borderBottom: `4px solid ${uikitStyles.theme.colors.secondary}`,
|
|
86
|
-
paddingTop: "4px",
|
|
87
|
-
height: "100%"
|
|
88
|
-
}
|
|
56
|
+
borderColor: uikitStyles.theme.colors.secondary,
|
|
57
|
+
color: uikitStyles.theme.colors.secondary
|
|
89
58
|
},
|
|
59
|
+
item,
|
|
90
60
|
link: {
|
|
91
|
-
textDecoration: "none"
|
|
92
|
-
...item
|
|
61
|
+
textDecoration: "none"
|
|
93
62
|
},
|
|
94
63
|
button: {
|
|
95
|
-
color: "inherit"
|
|
96
|
-
...item
|
|
64
|
+
color: "inherit"
|
|
97
65
|
}
|
|
98
66
|
}
|
|
99
67
|
);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
4
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
6
|
const Navigation_styles = require("./Navigation.styles.cjs");
|
|
6
7
|
const useSelectionPath = require("./useSelectionPath.cjs");
|
|
7
8
|
const FocusContext = require("./utils/FocusContext.cjs");
|
|
8
9
|
const SelectionContext = require("./utils/SelectionContext.cjs");
|
|
9
10
|
const MenuBar = require("./MenuBar/MenuBar.cjs");
|
|
10
|
-
const HvHeaderNavigation = (props) => {
|
|
11
|
+
const HvHeaderNavigation = React.forwardRef((props, ref) => {
|
|
11
12
|
const {
|
|
12
13
|
data,
|
|
13
14
|
selected,
|
|
@@ -23,7 +24,7 @@ const HvHeaderNavigation = (props) => {
|
|
|
23
24
|
event.preventDefault();
|
|
24
25
|
onClick?.(event, selection);
|
|
25
26
|
};
|
|
26
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.SelectionContext.Provider, { value: selectionPath, children: /* @__PURE__ */ jsxRuntime.jsx(FocusContext.FocusProvider, { children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: cx(classes.root, className), ...others, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.SelectionContext.Provider, { value: selectionPath, children: /* @__PURE__ */ jsxRuntime.jsx(FocusContext.FocusProvider, { children: /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, className: cx(classes.root, className), ...others, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
28
|
MenuBar.HvHeaderMenuBar,
|
|
28
29
|
{
|
|
29
30
|
data,
|
|
@@ -33,6 +34,6 @@ const HvHeaderNavigation = (props) => {
|
|
|
33
34
|
currentLevel: 1
|
|
34
35
|
}
|
|
35
36
|
) }) }) });
|
|
36
|
-
};
|
|
37
|
+
});
|
|
37
38
|
exports.headerNavigationClasses = Navigation_styles.staticClasses;
|
|
38
39
|
exports.HvHeaderNavigation = HvHeaderNavigation;
|
|
@@ -7,14 +7,14 @@ const HvSimpleGrid = (props) => {
|
|
|
7
7
|
const {
|
|
8
8
|
children,
|
|
9
9
|
breakpoints,
|
|
10
|
-
spacing
|
|
10
|
+
spacing,
|
|
11
11
|
cols,
|
|
12
12
|
className,
|
|
13
13
|
classes: classesProp,
|
|
14
14
|
...others
|
|
15
15
|
} = uikitReactUtils.useDefaultProps("HvSimpleGrid", props);
|
|
16
16
|
const { classes, cx, css } = SimpleGrid_styles.useClasses(classesProp);
|
|
17
|
-
const containerStyle = SimpleGrid_styles.getContainerStyle(
|
|
17
|
+
const containerStyle = SimpleGrid_styles.getContainerStyle(breakpoints, spacing, cols);
|
|
18
18
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
@@ -3,13 +3,14 @@ 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
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvSimpleGrid", {
|
|
6
|
-
root: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return props.size;
|
|
6
|
+
root: {
|
|
7
|
+
display: "grid",
|
|
8
|
+
boxSizing: "border-box",
|
|
9
|
+
gridTemplateColumns: `repeat(var(--cols, 1), minmax(0, 1fr))`
|
|
11
10
|
}
|
|
12
|
-
|
|
11
|
+
});
|
|
12
|
+
function getSize(size) {
|
|
13
|
+
return size || Number(uikitStyles.theme.breakpoints.values.md);
|
|
13
14
|
}
|
|
14
15
|
function getSortedBreakpoints(breakpoints) {
|
|
15
16
|
if (breakpoints.length === 0) {
|
|
@@ -17,29 +18,23 @@ function getSortedBreakpoints(breakpoints) {
|
|
|
17
18
|
}
|
|
18
19
|
const property = "maxWidth" in breakpoints[0] ? "maxWidth" : "minWidth";
|
|
19
20
|
const sorted = [...breakpoints].sort(
|
|
20
|
-
(a, b) =>
|
|
21
|
+
(a, b) => getSize(b[property]) - getSize(a[property])
|
|
21
22
|
);
|
|
22
23
|
return property === "minWidth" ? sorted.reverse() : sorted;
|
|
23
24
|
}
|
|
24
|
-
const getContainerStyle = ({
|
|
25
|
-
breakpoints,
|
|
26
|
-
spacing,
|
|
27
|
-
cols
|
|
28
|
-
}) => {
|
|
25
|
+
const getContainerStyle = (breakpoints, spacing = "sm", cols = 1) => {
|
|
29
26
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
|
27
|
+
// TODO: review/document precedence of cols/spacing vs breakpoints[cols/spacing]
|
|
28
|
+
"--cols": cols,
|
|
33
29
|
gap: uikitStyles.theme.space[spacing],
|
|
34
30
|
...breakpoints && getSortedBreakpoints(breakpoints).reduce((acc, breakpoint) => {
|
|
35
31
|
const property = "maxWidth" in breakpoint ? "max-width" : "min-width";
|
|
36
|
-
const breakpointSize =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
gap: uikitStyles.theme.space[spacing]
|
|
32
|
+
const breakpointSize = getSize(
|
|
33
|
+
property === "max-width" ? breakpoint.maxWidth : breakpoint.minWidth
|
|
34
|
+
);
|
|
35
|
+
acc[`@media (${property}: ${breakpointSize}px)`] = {
|
|
36
|
+
["--cols"]: breakpoint.cols,
|
|
37
|
+
gap: uikitStyles.theme.space[breakpoint.spacing || spacing]
|
|
43
38
|
};
|
|
44
39
|
return acc;
|
|
45
40
|
}, {})
|
|
@@ -50,7 +50,7 @@ const HvTypography = generic.fixedForwardRef(function HvTypography2(props, ref)
|
|
|
50
50
|
disabled = false,
|
|
51
51
|
...others
|
|
52
52
|
} = uikitReactUtils.useDefaultProps("HvTypography", props);
|
|
53
|
-
const { classes, cx } = Typography_styles.useClasses(classesProp);
|
|
53
|
+
const { classes, css, cx } = Typography_styles.useClasses(classesProp);
|
|
54
54
|
const { activeTheme } = uikitReactUtils.useTheme();
|
|
55
55
|
const variant = utils.mapVariant(variantProp, activeTheme?.base);
|
|
56
56
|
const Component = ComponentProp || paragraph && "p" || HvTypographyMap[variant] || "span";
|
|
@@ -59,6 +59,7 @@ const HvTypography = generic.fixedForwardRef(function HvTypography2(props, ref)
|
|
|
59
59
|
{
|
|
60
60
|
ref,
|
|
61
61
|
className: cx(
|
|
62
|
+
css({ ...activeTheme?.typography[variant] }),
|
|
62
63
|
classes.root,
|
|
63
64
|
classes[variant],
|
|
64
65
|
{
|
|
@@ -20,45 +20,44 @@ const { useClasses, staticClasses } = uikitReactUtils.createClasses("HvTypograph
|
|
|
20
20
|
whiteSpace: "nowrap"
|
|
21
21
|
},
|
|
22
22
|
// variants
|
|
23
|
-
display: {
|
|
24
|
-
title1: {
|
|
25
|
-
title2: {
|
|
26
|
-
title3: {
|
|
27
|
-
title4: {
|
|
28
|
-
body: {
|
|
29
|
-
label: {
|
|
30
|
-
captionLabel: {
|
|
31
|
-
caption1: {
|
|
32
|
-
caption2: {
|
|
23
|
+
display: {},
|
|
24
|
+
title1: {},
|
|
25
|
+
title2: {},
|
|
26
|
+
title3: {},
|
|
27
|
+
title4: {},
|
|
28
|
+
body: {},
|
|
29
|
+
label: {},
|
|
30
|
+
captionLabel: {},
|
|
31
|
+
caption1: {},
|
|
32
|
+
caption2: {},
|
|
33
33
|
// legacy variants
|
|
34
|
-
|
|
35
|
-
"
|
|
34
|
+
// TODO: remove (legacy or all variants) in v6 in favour of dynamic variants
|
|
35
|
+
"5xlTitle": {},
|
|
36
|
+
"4xlTitle": {},
|
|
36
37
|
// @ts-ignore non-existent variant
|
|
37
|
-
"3xlTitle": {
|
|
38
|
-
xxlTitle: {
|
|
38
|
+
"3xlTitle": {},
|
|
39
|
+
xxlTitle: {},
|
|
39
40
|
xlTitle: {},
|
|
40
|
-
lTitle: {
|
|
41
|
+
lTitle: {},
|
|
41
42
|
mTitle: {},
|
|
42
|
-
sTitle: {
|
|
43
|
+
sTitle: {},
|
|
43
44
|
xsTitle: {},
|
|
44
|
-
xxsTitle: {
|
|
45
|
+
xxsTitle: {},
|
|
45
46
|
sectionTitle: {
|
|
46
|
-
...uikitStyles.theme.typography.sectionTitle,
|
|
47
47
|
textTransform: "uppercase"
|
|
48
48
|
},
|
|
49
49
|
highlightText: {},
|
|
50
50
|
normalText: {},
|
|
51
|
-
placeholderText: {
|
|
51
|
+
placeholderText: {},
|
|
52
52
|
link: {
|
|
53
|
-
...uikitStyles.theme.typography.link,
|
|
54
53
|
cursor: "pointer",
|
|
55
54
|
textDecoration: "underline"
|
|
56
55
|
},
|
|
57
|
-
disabledText: {
|
|
58
|
-
selectedNavText: {
|
|
56
|
+
disabledText: {},
|
|
57
|
+
selectedNavText: {},
|
|
59
58
|
vizText: {},
|
|
60
|
-
vizTextDisabled: {
|
|
61
|
-
xsInlineLink: {
|
|
59
|
+
vizTextDisabled: {},
|
|
60
|
+
xsInlineLink: {}
|
|
62
61
|
});
|
|
63
62
|
exports.staticClasses = staticClasses;
|
|
64
63
|
exports.useClasses = useClasses;
|
|
@@ -3,11 +3,10 @@ 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 keyboardUtils = require("../../utils/keyboardUtils.cjs");
|
|
7
6
|
const setId = require("../../utils/setId.cjs");
|
|
8
7
|
const VerticalNavigationContext = require("../VerticalNavigationContext.cjs");
|
|
9
8
|
const Action_styles = require("./Action.styles.cjs");
|
|
10
|
-
const
|
|
9
|
+
const Button = require("../../Button/Button.cjs");
|
|
11
10
|
const HvVerticalNavigationAction = (props) => {
|
|
12
11
|
const {
|
|
13
12
|
className,
|
|
@@ -15,26 +14,16 @@ const HvVerticalNavigationAction = (props) => {
|
|
|
15
14
|
id,
|
|
16
15
|
label = "",
|
|
17
16
|
icon,
|
|
18
|
-
onClick,
|
|
19
17
|
...others
|
|
20
18
|
} = uikitReactUtils.useDefaultProps("HvVerticalNavigationAction", props);
|
|
21
19
|
const { isOpen } = React.useContext(VerticalNavigationContext.VerticalNavigationContext);
|
|
22
20
|
const { classes, cx } = Action_styles.useClasses(classesProp);
|
|
23
|
-
const handleKeyDown = React.useCallback(
|
|
24
|
-
(event) => {
|
|
25
|
-
if (!onClick || !keyboardUtils.isKey(event, "Enter") && !keyboardUtils.isKey(event, "Space")) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
onClick(event);
|
|
29
|
-
},
|
|
30
|
-
[onClick]
|
|
31
|
-
);
|
|
32
21
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33
|
-
|
|
22
|
+
Button.HvButton,
|
|
34
23
|
{
|
|
35
24
|
id: setId.setId(id, "button"),
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
variant: "secondaryGhost",
|
|
26
|
+
icon: !isOpen,
|
|
38
27
|
className: cx(
|
|
39
28
|
classes.action,
|
|
40
29
|
{
|
|
@@ -43,10 +32,7 @@ const HvVerticalNavigationAction = (props) => {
|
|
|
43
32
|
},
|
|
44
33
|
className
|
|
45
34
|
),
|
|
46
|
-
tabIndex: 0,
|
|
47
35
|
...!isOpen && { "aria-label": label },
|
|
48
|
-
onKeyDown: handleKeyDown,
|
|
49
|
-
onClick,
|
|
50
36
|
...others,
|
|
51
37
|
children: [
|
|
52
38
|
icon,
|
|
@@ -2,31 +2,18 @@
|
|
|
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 focusUtils = require("../../utils/focusUtils.cjs");
|
|
6
|
-
const hover = {
|
|
7
|
-
background: uikitStyles.theme.colors.containerBackgroundHover
|
|
8
|
-
};
|
|
9
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
10
6
|
"HvVerticalNavigationAction",
|
|
11
7
|
{
|
|
12
8
|
action: {
|
|
13
9
|
width: "100%",
|
|
14
|
-
display: "flex",
|
|
15
10
|
justifyContent: "flex-start",
|
|
16
|
-
alignItems: "center",
|
|
17
11
|
height: "32px",
|
|
18
|
-
color:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
outline: "none",
|
|
23
|
-
...hover
|
|
24
|
-
},
|
|
25
|
-
"&:focus-visible": {
|
|
26
|
-
...focusUtils.outlineStyles
|
|
27
|
-
},
|
|
12
|
+
color: "inherit",
|
|
13
|
+
fontWeight: "inherit",
|
|
14
|
+
padding: 0,
|
|
15
|
+
border: "none",
|
|
28
16
|
// cursor
|
|
29
|
-
cursor: "pointer",
|
|
30
17
|
"& *": {
|
|
31
18
|
cursor: "pointer"
|
|
32
19
|
}
|
|
@@ -6,12 +6,10 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
6
6
|
"HvVerticalNavigationActions",
|
|
7
7
|
{
|
|
8
8
|
root: {
|
|
9
|
-
display: "
|
|
10
|
-
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
11
|
marginTop: "auto",
|
|
12
|
-
|
|
13
|
-
marginBottom: "8px"
|
|
14
|
-
}
|
|
12
|
+
gap: uikitStyles.theme.space.xs
|
|
15
13
|
},
|
|
16
14
|
hide: {
|
|
17
15
|
display: "none"
|
|
@@ -16,12 +16,17 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
16
16
|
},
|
|
17
17
|
collapseButton: {
|
|
18
18
|
marginLeft: "auto",
|
|
19
|
+
color: "inherit",
|
|
19
20
|
"&$minimized": {
|
|
20
21
|
marginLeft: 0
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
|
-
backButton: {
|
|
24
|
-
|
|
24
|
+
backButton: {
|
|
25
|
+
color: "inherit"
|
|
26
|
+
},
|
|
27
|
+
title: {
|
|
28
|
+
color: "inherit"
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
);
|
|
27
32
|
exports.staticClasses = staticClasses;
|
|
@@ -7,7 +7,7 @@ const useControlled = require("../../hooks/useControlled.cjs");
|
|
|
7
7
|
const helpers = require("../../utils/helpers.cjs");
|
|
8
8
|
const setId = require("../../utils/setId.cjs");
|
|
9
9
|
const NavigationPopupContainer = require("../NavigationPopup/NavigationPopupContainer.cjs");
|
|
10
|
-
const
|
|
10
|
+
const utils = require("../NavigationSlider/utils.cjs");
|
|
11
11
|
const VerticalNavigationContext = require("../VerticalNavigationContext.cjs");
|
|
12
12
|
const Navigation_styles = require("./Navigation.styles.cjs");
|
|
13
13
|
const NavigationSlider = require("../NavigationSlider/NavigationSlider.cjs");
|
|
@@ -199,8 +199,8 @@ const HvVerticalNavigationTree = (props) => {
|
|
|
199
199
|
if (setParentData) setParentData(data);
|
|
200
200
|
}, [data, setParentData]);
|
|
201
201
|
React.useEffect(() => {
|
|
202
|
-
if (withParentData && selected && setParentItem &&
|
|
203
|
-
setParentItem(
|
|
202
|
+
if (withParentData && selected && setParentItem && utils.getParentItemById(withParentData, selected)) {
|
|
203
|
+
setParentItem(utils.getParentItemById(withParentData, selected));
|
|
204
204
|
}
|
|
205
205
|
}, [withParentData, selected, setParentItem]);
|
|
206
206
|
const navigateToTargetHandler = (event, selectedItem) => handleChange(event, selectedItem.id, selectedItem);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
4
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
6
5
|
"HvVerticalNavigationTree",
|
|
7
6
|
{
|
|
8
7
|
root: {
|
|
9
8
|
display: "block",
|
|
10
|
-
background: uikitStyles.theme.colors.atmo1,
|
|
11
9
|
overflowY: "auto"
|
|
12
10
|
},
|
|
13
11
|
list: {},
|
|
@@ -51,7 +51,7 @@ const HvVerticalNavigationSlider = (props) => {
|
|
|
51
51
|
},
|
|
52
52
|
className: classes.forwardButton,
|
|
53
53
|
"aria-label": forwardButtonAriaLabel,
|
|
54
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropRightXS, {})
|
|
54
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropRightXS, { color: "currentcolor" })
|
|
55
55
|
}
|
|
56
56
|
) : void 0,
|
|
57
57
|
children: /* @__PURE__ */ jsxRuntime.jsx(OverflowTooltip.HvOverflowTooltip, { data: item.label })
|
|
@@ -10,9 +10,13 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
10
10
|
alignItems: "center",
|
|
11
11
|
borderLeft: `4px solid transparent`,
|
|
12
12
|
minHeight: "48px",
|
|
13
|
+
color: "inherit",
|
|
13
14
|
marginBottom: "8px",
|
|
14
15
|
"& > button": {
|
|
15
16
|
marginLeft: "auto"
|
|
17
|
+
},
|
|
18
|
+
"& .HvListItem-startAdornment .color0": {
|
|
19
|
+
fill: "currentColor"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
listItemSelected: {
|
|
@@ -22,7 +26,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
22
26
|
listItemFocus: {
|
|
23
27
|
background: uikitStyles.theme.colors.atmo3
|
|
24
28
|
},
|
|
25
|
-
forwardButton: {
|
|
29
|
+
forwardButton: {
|
|
30
|
+
color: "inherit"
|
|
31
|
+
},
|
|
26
32
|
listContainer: {},
|
|
27
33
|
listItemDisabled: {}
|
|
28
34
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
4
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
6
5
|
"HvVerticalNavigationTreeView",
|
|
7
6
|
{
|
|
8
7
|
root: {
|
|
9
8
|
display: "block",
|
|
10
|
-
background: uikitStyles.theme.colors.atmo1,
|
|
11
9
|
padding: `0px`,
|
|
12
10
|
margin: "0",
|
|
13
11
|
listStyle: "none",
|