@hitachivantara/uikit-react-core 5.85.1 → 5.86.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/Banner/BannerContent/BannerContent.cjs +60 -28
- package/dist/cjs/Banner/BannerContent/BannerContent.styles.cjs +30 -1
- package/dist/cjs/{ScrollTo/Horizontal → ScrollToHorizontal}/HorizontalScrollListItem/HorizontalScrollListItem.cjs +2 -2
- package/dist/cjs/{ScrollTo/Horizontal → ScrollToHorizontal}/HorizontalScrollListItem/HorizontalScrollListItem.styles.cjs +1 -1
- package/dist/cjs/{ScrollTo/Horizontal → ScrollToHorizontal}/ScrollToHorizontal.cjs +3 -3
- package/dist/cjs/{ScrollTo/Vertical → ScrollToVertical}/ScrollToVertical.cjs +3 -3
- package/dist/cjs/{ScrollTo/Vertical → ScrollToVertical}/VerticalScrollListItem/VerticalScrollListItem.cjs +1 -1
- package/dist/cjs/{ScrollTo/Vertical → ScrollToVertical}/VerticalScrollListItem/VerticalScrollListItem.styles.cjs +1 -1
- package/dist/cjs/{ScrollTo → hooks}/useScrollTo.cjs +14 -10
- package/dist/cjs/index.cjs +9 -9
- package/dist/cjs/{ScrollTo/utils.cjs → utils/scroll.cjs} +12 -0
- package/dist/esm/Banner/BannerContent/BannerContent.js +61 -29
- package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.styles.js +30 -1
- package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
- package/dist/esm/Box/Box.js.map +1 -1
- package/dist/esm/Focus/Focus.js.map +1 -1
- package/dist/esm/Kpi/Kpi.js.map +1 -1
- package/dist/esm/Link/Link.js.map +1 -1
- package/dist/esm/List/List.js.map +1 -1
- package/dist/esm/{ScrollTo/Horizontal → ScrollToHorizontal}/HorizontalScrollListItem/HorizontalScrollListItem.js +2 -2
- package/dist/esm/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -0
- package/dist/esm/{ScrollTo/Horizontal → ScrollToHorizontal}/HorizontalScrollListItem/HorizontalScrollListItem.styles.js +1 -1
- package/dist/esm/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js.map +1 -0
- package/dist/esm/{ScrollTo/Horizontal → ScrollToHorizontal}/ScrollToHorizontal.js +3 -3
- package/dist/esm/{ScrollTo/Horizontal → ScrollToHorizontal}/ScrollToHorizontal.js.map +1 -1
- package/dist/esm/ScrollToHorizontal/ScrollToHorizontal.styles.js.map +1 -0
- package/dist/esm/{ScrollTo/Vertical → ScrollToVertical}/ScrollToVertical.js +3 -3
- package/dist/esm/{ScrollTo/Vertical → ScrollToVertical}/ScrollToVertical.js.map +1 -1
- package/dist/esm/ScrollToVertical/ScrollToVertical.styles.js.map +1 -0
- package/dist/esm/{ScrollTo/Vertical → ScrollToVertical}/VerticalScrollListItem/VerticalScrollListItem.js +1 -1
- package/dist/esm/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -0
- package/dist/esm/{ScrollTo/Vertical → ScrollToVertical}/VerticalScrollListItem/VerticalScrollListItem.styles.js +1 -1
- package/dist/esm/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +1 -0
- package/dist/esm/hocs/withTooltip.js.map +1 -1
- package/dist/esm/{ScrollTo → hooks}/useScrollTo.js +9 -5
- package/dist/esm/hooks/useScrollTo.js.map +1 -0
- package/dist/esm/index.js +10 -10
- package/dist/esm/{ScrollTo/utils.js → utils/scroll.js} +12 -0
- package/dist/esm/utils/scroll.js.map +1 -0
- package/dist/types/index.d.ts +337 -351
- package/package.json +2 -2
- package/dist/cjs/Banner/BannerContent/ActionContainer/ActionContainer.cjs +0 -46
- package/dist/cjs/Banner/BannerContent/ActionContainer/ActionContainer.styles.cjs +0 -31
- package/dist/cjs/Banner/BannerContent/MessageContainer/MessageContainer.cjs +0 -44
- package/dist/cjs/Banner/BannerContent/MessageContainer/MessageContainer.styles.cjs +0 -23
- package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js +0 -47
- package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js.map +0 -1
- package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.styles.js +0 -31
- package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.styles.js.map +0 -1
- package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.js +0 -45
- package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.js.map +0 -1
- package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.styles.js +0 -23
- package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.styles.js.map +0 -1
- package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +0 -1
- package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js.map +0 -1
- package/dist/esm/ScrollTo/Horizontal/ScrollToHorizontal.styles.js.map +0 -1
- package/dist/esm/ScrollTo/Vertical/ScrollToVertical.styles.js.map +0 -1
- package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +0 -1
- package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +0 -1
- package/dist/esm/ScrollTo/useScrollTo.js.map +0 -1
- package/dist/esm/ScrollTo/utils.js.map +0 -1
- /package/dist/cjs/{ScrollTo/Horizontal → ScrollToHorizontal}/ScrollToHorizontal.styles.cjs +0 -0
- /package/dist/cjs/{ScrollTo/Vertical → ScrollToVertical}/ScrollToVertical.styles.cjs +0 -0
- /package/dist/esm/{ScrollTo/Horizontal → ScrollToHorizontal}/ScrollToHorizontal.styles.js +0 -0
- /package/dist/esm/{ScrollTo/Vertical → ScrollToVertical}/ScrollToVertical.styles.js +0 -0
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const SnackbarContent = require("@mui/material/SnackbarContent");
|
|
6
|
+
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
6
7
|
const iconVariant = require("../../utils/iconVariant.cjs");
|
|
8
|
+
const setId = require("../../utils/setId.cjs");
|
|
7
9
|
const BannerContent_styles = require("./BannerContent.styles.cjs");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
+
const ActionsGeneric = require("../../ActionsGeneric/ActionsGeneric.cjs");
|
|
11
|
+
const Button = require("../../Button/Button.cjs");
|
|
10
12
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
11
13
|
const SnackbarContent__default = /* @__PURE__ */ _interopDefault(SnackbarContent);
|
|
12
14
|
const HvBannerContent = React.forwardRef(
|
|
@@ -14,6 +16,7 @@ const HvBannerContent = React.forwardRef(
|
|
|
14
16
|
const {
|
|
15
17
|
id,
|
|
16
18
|
classes: classesProp,
|
|
19
|
+
className,
|
|
17
20
|
showIcon = false,
|
|
18
21
|
customIcon,
|
|
19
22
|
variant = "default",
|
|
@@ -24,12 +27,17 @@ const HvBannerContent = React.forwardRef(
|
|
|
24
27
|
onAction,
|
|
25
28
|
actionsPosition = "auto",
|
|
26
29
|
content,
|
|
30
|
+
children,
|
|
27
31
|
actionProps,
|
|
28
32
|
...others
|
|
29
33
|
} = props;
|
|
30
34
|
const { classes, cx } = BannerContent_styles.useClasses(classesProp);
|
|
31
35
|
const icon = customIcon || showIcon && iconVariant.iconVariant(variant, "base_dark");
|
|
32
36
|
const effectiveActionsPosition = actionsPosition === "auto" ? "inline" : actionsPosition;
|
|
37
|
+
const handleAction = (evt, action) => {
|
|
38
|
+
onAction?.(evt, action);
|
|
39
|
+
actionsCallback?.(evt, id, action);
|
|
40
|
+
};
|
|
33
41
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.outContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
42
|
SnackbarContent__default.default,
|
|
35
43
|
{
|
|
@@ -40,33 +48,57 @@ const HvBannerContent = React.forwardRef(
|
|
|
40
48
|
message: classes.message,
|
|
41
49
|
action: classes.action
|
|
42
50
|
},
|
|
43
|
-
className: cx(classes
|
|
44
|
-
message: /* @__PURE__ */ jsxRuntime.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
className: cx(classes.baseVariant, classes[variant], className),
|
|
52
|
+
message: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
53
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.iconContainer, children: icon }),
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
id: setId.setId(id, "message-text"),
|
|
58
|
+
className: classes.messageContainer,
|
|
59
|
+
children: children ?? content
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
actions && effectiveActionsPosition === "inline" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
id: setId.setId(id, "message-actions"),
|
|
66
|
+
className: classes.messageActions,
|
|
67
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
|
+
ActionsGeneric.HvActionsGeneric,
|
|
69
|
+
{
|
|
70
|
+
id,
|
|
71
|
+
variant: "semantic",
|
|
72
|
+
actions,
|
|
73
|
+
onAction: handleAction
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] }),
|
|
79
|
+
action: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.actionContainer, children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
81
|
+
Button.HvButton,
|
|
82
|
+
{
|
|
83
|
+
icon: true,
|
|
84
|
+
className: classes.closeAction,
|
|
85
|
+
variant: "semantic",
|
|
86
|
+
"aria-label": "Close",
|
|
87
|
+
onClick: onClose,
|
|
88
|
+
...actionProps,
|
|
89
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Close, { size: "XS" })
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
actions && effectiveActionsPosition === "bottom-right" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.actionsInnerContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
+
ActionsGeneric.HvActionsGeneric,
|
|
94
|
+
{
|
|
95
|
+
id,
|
|
96
|
+
variant: "semantic",
|
|
50
97
|
actions,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
-
ActionContainer.HvActionContainer,
|
|
59
|
-
{
|
|
60
|
-
id,
|
|
61
|
-
onClose,
|
|
62
|
-
...effectiveActionsPosition === "bottom-right" && {
|
|
63
|
-
action: actions,
|
|
64
|
-
actionCallback: actionsCallback,
|
|
65
|
-
onAction
|
|
66
|
-
},
|
|
67
|
-
...actionProps
|
|
68
|
-
}
|
|
69
|
-
),
|
|
98
|
+
onAction: handleAction
|
|
99
|
+
}
|
|
100
|
+
) })
|
|
101
|
+
] }),
|
|
70
102
|
...others
|
|
71
103
|
}
|
|
72
104
|
) });
|
|
@@ -15,7 +15,9 @@ const { useClasses, staticClasses } = uikitReactUtils.createClasses("HvBannerCon
|
|
|
15
15
|
display: "flex",
|
|
16
16
|
alignItems: "center",
|
|
17
17
|
padding: uikitStyles.theme.spacing("xs", 0),
|
|
18
|
-
paddingLeft: uikitStyles.theme.space.sm
|
|
18
|
+
paddingLeft: uikitStyles.theme.space.sm,
|
|
19
|
+
...uikitStyles.theme.typography.body,
|
|
20
|
+
color: uikitStyles.theme.colors.base_dark
|
|
19
21
|
},
|
|
20
22
|
action: {
|
|
21
23
|
padding: uikitStyles.theme.spacing("xs"),
|
|
@@ -41,6 +43,33 @@ const { useClasses, staticClasses } = uikitReactUtils.createClasses("HvBannerCon
|
|
|
41
43
|
outContainer: {
|
|
42
44
|
width: "100%",
|
|
43
45
|
position: "relative"
|
|
46
|
+
},
|
|
47
|
+
messageContainer: {
|
|
48
|
+
wordBreak: "break-word",
|
|
49
|
+
maxWidth: 700,
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
marginRight: 10
|
|
52
|
+
},
|
|
53
|
+
iconContainer: {
|
|
54
|
+
marginRight: uikitStyles.theme.space.xs,
|
|
55
|
+
marginLeft: -uikitStyles.theme.space.xs
|
|
56
|
+
},
|
|
57
|
+
messageActions: {
|
|
58
|
+
flex: "0 0 auto"
|
|
59
|
+
},
|
|
60
|
+
actionContainer: {
|
|
61
|
+
display: "flex",
|
|
62
|
+
flexDirection: "column",
|
|
63
|
+
height: "100%",
|
|
64
|
+
justifyContent: "space-between"
|
|
65
|
+
},
|
|
66
|
+
actionsInnerContainer: {
|
|
67
|
+
flexDirection: "row",
|
|
68
|
+
marginTop: "8px"
|
|
69
|
+
// avoid overlap with close button outline focus ring
|
|
70
|
+
},
|
|
71
|
+
closeAction: {
|
|
72
|
+
alignSelf: "flex-end"
|
|
44
73
|
}
|
|
45
74
|
});
|
|
46
75
|
exports.staticClasses = staticClasses;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
|
-
const setId = require("
|
|
5
|
+
const setId = require("../../utils/setId.cjs");
|
|
6
6
|
const HorizontalScrollListItem_styles = require("./HorizontalScrollListItem.styles.cjs");
|
|
7
|
-
const OverflowTooltip = require("
|
|
7
|
+
const OverflowTooltip = require("../../OverflowTooltip/OverflowTooltip.cjs");
|
|
8
8
|
const HvHorizontalScrollListItem = (props) => {
|
|
9
9
|
const {
|
|
10
10
|
id,
|
|
@@ -2,7 +2,7 @@
|
|
|
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("
|
|
5
|
+
const focusUtils = require("../../utils/focusUtils.cjs");
|
|
6
6
|
const name = "HvHorizontalScrollListItem";
|
|
7
7
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(name, {
|
|
8
8
|
root: {
|
|
@@ -5,9 +5,9 @@ const styles = require("@mui/material/styles");
|
|
|
5
5
|
const useMediaQuery = require("@mui/material/useMediaQuery");
|
|
6
6
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
7
7
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const useScrollTo = require("../hooks/useScrollTo.cjs");
|
|
9
|
+
const keyboardUtils = require("../utils/keyboardUtils.cjs");
|
|
10
|
+
const setId = require("../utils/setId.cjs");
|
|
11
11
|
const ScrollToHorizontal_styles = require("./ScrollToHorizontal.styles.cjs");
|
|
12
12
|
const HorizontalScrollListItem = require("./HorizontalScrollListItem/HorizontalScrollListItem.cjs");
|
|
13
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const useScrollTo = require("../hooks/useScrollTo.cjs");
|
|
6
|
+
const keyboardUtils = require("../utils/keyboardUtils.cjs");
|
|
7
|
+
const setId = require("../utils/setId.cjs");
|
|
8
8
|
const ScrollToVertical_styles = require("./ScrollToVertical.styles.cjs");
|
|
9
9
|
const VerticalScrollListItem = require("./VerticalScrollListItem/VerticalScrollListItem.cjs");
|
|
10
10
|
const HvScrollToVertical = (props) => {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
5
|
const VerticalScrollListItem_styles = require("./VerticalScrollListItem.styles.cjs");
|
|
6
|
-
const Tooltip = require("
|
|
6
|
+
const Tooltip = require("../../Tooltip/Tooltip.cjs");
|
|
7
7
|
const HvVerticalScrollListItem = (props) => {
|
|
8
8
|
const {
|
|
9
9
|
id,
|
|
@@ -2,7 +2,7 @@
|
|
|
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("
|
|
5
|
+
const focusUtils = require("../../utils/focusUtils.cjs");
|
|
6
6
|
const name = "HvVerticalScrollListItem";
|
|
7
7
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(name, {
|
|
8
8
|
root: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const scroll = require("../utils/scroll.cjs");
|
|
5
5
|
const useScrollTo = (selectedIndexProp = 0, scrollElementId = void 0, navigationMode = "push", relativeLinks = false, offset = 0, options = [], onChange = void 0, direction = "column") => {
|
|
6
6
|
const RETRY_MAX = 5;
|
|
7
7
|
const [selectedIndex, setSelectedIndex] = React.useState(selectedIndexProp);
|
|
8
|
-
const scrollEle = React.useRef(
|
|
8
|
+
const scrollEle = React.useRef(
|
|
9
|
+
typeof window !== "undefined" ? window : null
|
|
10
|
+
);
|
|
9
11
|
const requestedAnimationFrame = React.useRef(0);
|
|
10
12
|
const lastContainerScrollTop = React.useRef(0);
|
|
11
13
|
const selectedIndexRef = React.useRef(selectedIndex);
|
|
@@ -13,15 +15,17 @@ const useScrollTo = (selectedIndexProp = 0, scrollElementId = void 0, navigation
|
|
|
13
15
|
selectedIndexRef.current = selectedIndex;
|
|
14
16
|
}, [selectedIndex]);
|
|
15
17
|
React.useEffect(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
if (typeof window !== "undefined") {
|
|
19
|
+
scrollEle.current = scrollElementId && document.getElementById(scrollElementId) || window;
|
|
20
|
+
lastContainerScrollTop.current = scroll.verticalScrollOffset(scrollEle.current);
|
|
21
|
+
}
|
|
18
22
|
}, [scrollElementId]);
|
|
19
23
|
const checkScroll = React.useCallback(
|
|
20
24
|
(event) => {
|
|
21
25
|
if (requestedAnimationFrame.current === 0 && window?.requestAnimationFrame) {
|
|
22
26
|
requestedAnimationFrame.current = window.requestAnimationFrame(() => {
|
|
23
27
|
requestedAnimationFrame.current = 0;
|
|
24
|
-
const firstVisibleElementIndex =
|
|
28
|
+
const firstVisibleElementIndex = scroll.findFirstVisibleElement(
|
|
25
29
|
scrollEle.current,
|
|
26
30
|
options,
|
|
27
31
|
offset
|
|
@@ -30,10 +34,10 @@ const useScrollTo = (selectedIndexProp = 0, scrollElementId = void 0, navigation
|
|
|
30
34
|
if (firstVisibleElementIndex < 0) {
|
|
31
35
|
newSelectedIndex = 0;
|
|
32
36
|
}
|
|
33
|
-
if (newSelectedIndex < options.length - 1 &&
|
|
37
|
+
if (newSelectedIndex < options.length - 1 && scroll.isScrolledToTheBottom(scrollEle.current)) {
|
|
34
38
|
newSelectedIndex += 1;
|
|
35
39
|
}
|
|
36
|
-
const containerScrollTop =
|
|
40
|
+
const containerScrollTop = scroll.getScrollTop(scrollEle.current);
|
|
37
41
|
const isScrollingDown = containerScrollTop > lastContainerScrollTop.current;
|
|
38
42
|
lastContainerScrollTop.current = containerScrollTop;
|
|
39
43
|
if (isScrollingDown) {
|
|
@@ -74,7 +78,7 @@ const useScrollTo = (selectedIndexProp = 0, scrollElementId = void 0, navigation
|
|
|
74
78
|
checkRenderedInterval = setInterval(() => {
|
|
75
79
|
const ele = document.getElementById(option.value);
|
|
76
80
|
if (ele) {
|
|
77
|
-
|
|
81
|
+
scroll.scrollElement(ele, scrollEle.current, option.offset || offset);
|
|
78
82
|
clearInterval(checkRenderedInterval);
|
|
79
83
|
} else {
|
|
80
84
|
retry += 1;
|
|
@@ -89,7 +93,7 @@ const useScrollTo = (selectedIndexProp = 0, scrollElementId = void 0, navigation
|
|
|
89
93
|
clearInterval(checkRenderedInterval);
|
|
90
94
|
};
|
|
91
95
|
}, []);
|
|
92
|
-
const baseUrl = relativeLinks || window == null ? "" : window.location.href.split("#")[0];
|
|
96
|
+
const baseUrl = relativeLinks || typeof window === "undefined" || window == null ? "" : window.location.href.split("#")[0];
|
|
93
97
|
const elements = React.useMemo(
|
|
94
98
|
() => options.map((o) => ({
|
|
95
99
|
...o,
|
|
@@ -103,7 +107,7 @@ const useScrollTo = (selectedIndexProp = 0, scrollElementId = void 0, navigation
|
|
|
103
107
|
if (option) {
|
|
104
108
|
const ele = document.getElementById(id);
|
|
105
109
|
if (ele) {
|
|
106
|
-
|
|
110
|
+
scroll.scrollElement(
|
|
107
111
|
ele,
|
|
108
112
|
scrollEle.current,
|
|
109
113
|
option.offset || offset,
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -209,12 +209,12 @@ const Radio_styles = require("./Radio/Radio.styles.cjs");
|
|
|
209
209
|
const Radio = require("./Radio/Radio.cjs");
|
|
210
210
|
const RadioGroup_styles = require("./RadioGroup/RadioGroup.styles.cjs");
|
|
211
211
|
const RadioGroup = require("./RadioGroup/RadioGroup.cjs");
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
const
|
|
212
|
+
const HorizontalScrollListItem_styles = require("./ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.cjs");
|
|
213
|
+
const ScrollToHorizontal_styles = require("./ScrollToHorizontal/ScrollToHorizontal.styles.cjs");
|
|
214
|
+
const ScrollToHorizontal = require("./ScrollToHorizontal/ScrollToHorizontal.cjs");
|
|
215
|
+
const VerticalScrollListItem_styles = require("./ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.cjs");
|
|
216
|
+
const ScrollToVertical_styles = require("./ScrollToVertical/ScrollToVertical.styles.cjs");
|
|
217
|
+
const ScrollToVertical = require("./ScrollToVertical/ScrollToVertical.cjs");
|
|
218
218
|
const Section_styles = require("./Section/Section.styles.cjs");
|
|
219
219
|
const Section = require("./Section/Section.cjs");
|
|
220
220
|
const SimpleGrid_styles = require("./SimpleGrid/SimpleGrid.styles.cjs");
|
|
@@ -566,12 +566,12 @@ exports.radioClasses = Radio_styles.staticClasses;
|
|
|
566
566
|
exports.HvRadio = Radio.HvRadio;
|
|
567
567
|
exports.radioGroupClasses = RadioGroup_styles.staticClasses;
|
|
568
568
|
exports.HvRadioGroup = RadioGroup.HvRadioGroup;
|
|
569
|
-
exports.verticalScrollListItemClasses = VerticalScrollListItem_styles.staticClasses;
|
|
570
|
-
exports.scrollToVerticalClasses = ScrollToVertical_styles.staticClasses;
|
|
571
|
-
exports.HvScrollToVertical = ScrollToVertical.HvScrollToVertical;
|
|
572
569
|
exports.horizontalScrollListItemClasses = HorizontalScrollListItem_styles.staticClasses;
|
|
573
570
|
exports.scrollToHorizontalClasses = ScrollToHorizontal_styles.staticClasses;
|
|
574
571
|
exports.HvScrollToHorizontal = ScrollToHorizontal.HvScrollToHorizontal;
|
|
572
|
+
exports.verticalScrollListItemClasses = VerticalScrollListItem_styles.staticClasses;
|
|
573
|
+
exports.scrollToVerticalClasses = ScrollToVertical_styles.staticClasses;
|
|
574
|
+
exports.HvScrollToVertical = ScrollToVertical.HvScrollToVertical;
|
|
575
575
|
exports.sectionClasses = Section_styles.staticClasses;
|
|
576
576
|
exports.HvSection = Section.HvSection;
|
|
577
577
|
exports.simpleGridClasses = SimpleGrid_styles.staticClasses;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const getScrollTop = (c = window) => {
|
|
4
|
+
if (c === null) {
|
|
5
|
+
return 0;
|
|
6
|
+
}
|
|
4
7
|
if (c === window) {
|
|
5
8
|
return window.scrollY || window.pageYOffset || document.documentElement?.scrollTop || document.body.scrollTop;
|
|
6
9
|
}
|
|
@@ -25,6 +28,9 @@ const horizontalScrollOffset = (t, c = window) => {
|
|
|
25
28
|
return t.offsetLeft - c.offsetLeft;
|
|
26
29
|
};
|
|
27
30
|
const scrollElement = (element, container, offset = 0, direction) => {
|
|
31
|
+
if (container === null) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
28
34
|
if (direction === "row") {
|
|
29
35
|
const elemLeft = horizontalScrollOffset(element, container);
|
|
30
36
|
container?.scrollTo?.({
|
|
@@ -41,6 +47,9 @@ const scrollElement = (element, container, offset = 0, direction) => {
|
|
|
41
47
|
element.focus({ preventScroll: true });
|
|
42
48
|
};
|
|
43
49
|
const isScrolledToTheBottom = (container) => {
|
|
50
|
+
if (container === null) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
44
53
|
const containerScrollTop = getScrollTop(container);
|
|
45
54
|
if (container === window) {
|
|
46
55
|
const scrollHeight = document.documentElement?.scrollHeight || document.body.scrollHeight;
|
|
@@ -49,6 +58,9 @@ const isScrolledToTheBottom = (container) => {
|
|
|
49
58
|
return containerScrollTop + container.offsetHeight >= container.scrollHeight;
|
|
50
59
|
};
|
|
51
60
|
const findFirstVisibleElement = (container, options, offset) => {
|
|
61
|
+
if (container === null) {
|
|
62
|
+
return -1;
|
|
63
|
+
}
|
|
52
64
|
const boundsTop = verticalScrollOffset(container);
|
|
53
65
|
let i = 0;
|
|
54
66
|
for (; i < options.length; i += 1) {
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import SnackbarContent from "@mui/material/SnackbarContent";
|
|
4
|
+
import { Close } from "@hitachivantara/uikit-react-icons";
|
|
4
5
|
import { iconVariant } from "../../utils/iconVariant.js";
|
|
6
|
+
import { setId } from "../../utils/setId.js";
|
|
5
7
|
import { useClasses } from "./BannerContent.styles.js";
|
|
6
8
|
import { staticClasses } from "./BannerContent.styles.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
+
import { HvActionsGeneric } from "../../ActionsGeneric/ActionsGeneric.js";
|
|
10
|
+
import { HvButton } from "../../Button/Button.js";
|
|
9
11
|
const HvBannerContent = forwardRef(
|
|
10
12
|
function HvBannerContent2(props, ref) {
|
|
11
13
|
const {
|
|
12
14
|
id,
|
|
13
15
|
classes: classesProp,
|
|
16
|
+
className,
|
|
14
17
|
showIcon = false,
|
|
15
18
|
customIcon,
|
|
16
19
|
variant = "default",
|
|
@@ -21,12 +24,17 @@ const HvBannerContent = forwardRef(
|
|
|
21
24
|
onAction,
|
|
22
25
|
actionsPosition = "auto",
|
|
23
26
|
content,
|
|
27
|
+
children,
|
|
24
28
|
actionProps,
|
|
25
29
|
...others
|
|
26
30
|
} = props;
|
|
27
31
|
const { classes, cx } = useClasses(classesProp);
|
|
28
32
|
const icon = customIcon || showIcon && iconVariant(variant, "base_dark");
|
|
29
33
|
const effectiveActionsPosition = actionsPosition === "auto" ? "inline" : actionsPosition;
|
|
34
|
+
const handleAction = (evt, action) => {
|
|
35
|
+
onAction?.(evt, action);
|
|
36
|
+
actionsCallback?.(evt, id, action);
|
|
37
|
+
};
|
|
30
38
|
return /* @__PURE__ */ jsx("div", { className: classes.outContainer, children: /* @__PURE__ */ jsx(
|
|
31
39
|
SnackbarContent,
|
|
32
40
|
{
|
|
@@ -37,33 +45,57 @@ const HvBannerContent = forwardRef(
|
|
|
37
45
|
message: classes.message,
|
|
38
46
|
action: classes.action
|
|
39
47
|
},
|
|
40
|
-
className: cx(classes
|
|
41
|
-
message: /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
className: cx(classes.baseVariant, classes[variant], className),
|
|
49
|
+
message: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
icon && /* @__PURE__ */ jsx("div", { className: classes.iconContainer, children: icon }),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
id: setId(id, "message-text"),
|
|
55
|
+
className: classes.messageContainer,
|
|
56
|
+
children: children ?? content
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
actions && effectiveActionsPosition === "inline" && /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
id: setId(id, "message-actions"),
|
|
63
|
+
className: classes.messageActions,
|
|
64
|
+
children: /* @__PURE__ */ jsx(
|
|
65
|
+
HvActionsGeneric,
|
|
66
|
+
{
|
|
67
|
+
id,
|
|
68
|
+
variant: "semantic",
|
|
69
|
+
actions,
|
|
70
|
+
onAction: handleAction
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }),
|
|
76
|
+
action: /* @__PURE__ */ jsxs("div", { className: classes.actionContainer, children: [
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
HvButton,
|
|
79
|
+
{
|
|
80
|
+
icon: true,
|
|
81
|
+
className: classes.closeAction,
|
|
82
|
+
variant: "semantic",
|
|
83
|
+
"aria-label": "Close",
|
|
84
|
+
onClick: onClose,
|
|
85
|
+
...actionProps,
|
|
86
|
+
children: /* @__PURE__ */ jsx(Close, { size: "XS" })
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
actions && effectiveActionsPosition === "bottom-right" && /* @__PURE__ */ jsx("div", { className: classes.actionsInnerContainer, children: /* @__PURE__ */ jsx(
|
|
90
|
+
HvActionsGeneric,
|
|
91
|
+
{
|
|
92
|
+
id,
|
|
93
|
+
variant: "semantic",
|
|
47
94
|
actions,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
action: /* @__PURE__ */ jsx(
|
|
55
|
-
HvActionContainer,
|
|
56
|
-
{
|
|
57
|
-
id,
|
|
58
|
-
onClose,
|
|
59
|
-
...effectiveActionsPosition === "bottom-right" && {
|
|
60
|
-
action: actions,
|
|
61
|
-
actionCallback: actionsCallback,
|
|
62
|
-
onAction
|
|
63
|
-
},
|
|
64
|
-
...actionProps
|
|
65
|
-
}
|
|
66
|
-
),
|
|
95
|
+
onAction: handleAction
|
|
96
|
+
}
|
|
97
|
+
) })
|
|
98
|
+
] }),
|
|
67
99
|
...others
|
|
68
100
|
}
|
|
69
101
|
) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerContent.js","sources":["../../../../src/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport SnackbarContent, {\n SnackbarContentProps as MuiSnackbarContentProps,\n} from \"@mui/material/SnackbarContent\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGenericProps } from \"../../ActionsGeneric\";\nimport {
|
|
1
|
+
{"version":3,"file":"BannerContent.js","sources":["../../../../src/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport SnackbarContent, {\n SnackbarContentProps as MuiSnackbarContentProps,\n} from \"@mui/material/SnackbarContent\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGeneric, HvActionsGenericProps } from \"../../ActionsGeneric\";\nimport { HvButton, HvButtonProps } from \"../../Button\";\nimport { iconVariant } from \"../../utils/iconVariant\";\nimport { setId } from \"../../utils/setId\";\nimport { HvBannerActionPosition, HvBannerVariant } from \"../types\";\nimport { staticClasses, useClasses } from \"./BannerContent.styles\";\n\nexport { staticClasses as bannerContentClasses };\n\nexport type HvBannerContentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerContentProps\n extends Omit<MuiSnackbarContentProps, \"variant\" | \"classes\" | \"onClose\"> {\n /** The message to display. @deprecated use `children` instead */\n content?: string;\n /** The message to display. */\n children?: React.ReactNode;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Function called when clicking on the close button. */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Actions to display on the right side. */\n actions?: HvActionsGenericProps[\"actions\"];\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: Partial<HvButtonProps>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n}\n\nexport const HvBannerContent = forwardRef<HTMLDivElement, HvBannerContentProps>(\n function HvBannerContent(props, ref) {\n const {\n id,\n classes: classesProp,\n className,\n showIcon = false,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback, // TODO - remove in v6\n onAction,\n actionsPosition = \"auto\",\n content,\n children,\n actionProps,\n ...others\n } = props;\n const { classes, cx } = useClasses(classesProp);\n const icon = customIcon || (showIcon && iconVariant(variant, \"base_dark\"));\n\n // default to inline\n // this might try to be more intelligent in the future,\n // taking into account the content length, available space,\n // number of actions, etc..\n const effectiveActionsPosition =\n actionsPosition === \"auto\" ? \"inline\" : actionsPosition;\n\n const handleAction: HvBannerContentProps[\"onAction\"] = (evt, action) => {\n onAction?.(evt, action);\n actionsCallback?.(evt, id!, action);\n };\n\n return (\n <div className={classes.outContainer}>\n <SnackbarContent\n ref={ref}\n id={id}\n classes={{\n root: classes.root,\n message: classes.message,\n action: classes.action,\n }}\n className={cx(classes.baseVariant, classes[variant], className)}\n message={\n <>\n {icon && <div className={classes.iconContainer}>{icon}</div>}\n <div\n id={setId(id, \"message-text\")}\n className={classes.messageContainer}\n >\n {children ?? content}\n </div>\n {actions && effectiveActionsPosition === \"inline\" && (\n <div\n id={setId(id, \"message-actions\")}\n className={classes.messageActions}\n >\n <HvActionsGeneric\n id={id}\n variant=\"semantic\"\n actions={actions}\n onAction={handleAction}\n />\n </div>\n )}\n </>\n }\n action={\n <div className={classes.actionContainer}>\n <HvButton\n icon\n className={classes.closeAction}\n variant=\"semantic\"\n aria-label=\"Close\"\n onClick={onClose}\n {...actionProps}\n >\n <Close size=\"XS\" />\n </HvButton>\n {actions && effectiveActionsPosition === \"bottom-right\" && (\n <div className={classes.actionsInnerContainer}>\n <HvActionsGeneric\n id={id}\n variant=\"semantic\"\n actions={actions}\n onAction={handleAction}\n />\n </div>\n )}\n </div>\n }\n {...others}\n />\n </div>\n );\n },\n);\n"],"names":["HvBannerContent"],"mappings":";;;;;;;;;;AAkDO,MAAM,kBAAkB;AAAA,EAC7B,SAASA,iBAAgB,OAAO,KAAK;AAC7B,UAAA;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MACA;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AACJ,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAC9C,UAAM,OAAO,cAAe,YAAY,YAAY,SAAS,WAAW;AAMlE,UAAA,2BACJ,oBAAoB,SAAS,WAAW;AAEpC,UAAA,eAAiD,CAAC,KAAK,WAAW;AACtE,iBAAW,KAAK,MAAM;AACJ,wBAAA,KAAK,IAAK,MAAM;AAAA,IACpC;AAEA,WACG,oBAAA,OAAA,EAAI,WAAW,QAAQ,cACtB,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,SAAS;AAAA,UACP,MAAM,QAAQ;AAAA,UACd,SAAS,QAAQ;AAAA,UACjB,QAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,WAAW,GAAG,QAAQ,aAAa,QAAQ,OAAO,GAAG,SAAS;AAAA,QAC9D,SAEK,qBAAA,UAAA,EAAA,UAAA;AAAA,UAAA,QAAS,oBAAA,OAAA,EAAI,WAAW,QAAQ,eAAgB,UAAK,MAAA;AAAA,UACtD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,IAAI,cAAc;AAAA,cAC5B,WAAW,QAAQ;AAAA,cAElB,UAAY,YAAA;AAAA,YAAA;AAAA,UACf;AAAA,UACC,WAAW,6BAA6B,YACvC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,IAAI,iBAAiB;AAAA,cAC/B,WAAW,QAAQ;AAAA,cAEnB,UAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC;AAAA,kBACA,SAAQ;AAAA,kBACR;AAAA,kBACA,UAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,YACZ;AAAA,UAAA;AAAA,QACF,GAEJ;AAAA,QAEF,QACE,qBAAC,OAAI,EAAA,WAAW,QAAQ,iBACtB,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAI;AAAA,cACJ,WAAW,QAAQ;AAAA,cACnB,SAAQ;AAAA,cACR,cAAW;AAAA,cACX,SAAS;AAAA,cACR,GAAG;AAAA,cAEJ,UAAA,oBAAC,OAAM,EAAA,MAAK,KAAK,CAAA;AAAA,YAAA;AAAA,UACnB;AAAA,UACC,WAAW,6BAA6B,sCACtC,OAAI,EAAA,WAAW,QAAQ,uBACtB,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA,SAAQ;AAAA,cACR;AAAA,cACA,UAAU;AAAA,YAAA;AAAA,UAAA,EAEd,CAAA;AAAA,QAAA,GAEJ;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAAA;AAGN;"}
|
|
@@ -13,7 +13,9 @@ const { useClasses, staticClasses } = createClasses("HvBannerContent", {
|
|
|
13
13
|
display: "flex",
|
|
14
14
|
alignItems: "center",
|
|
15
15
|
padding: theme.spacing("xs", 0),
|
|
16
|
-
paddingLeft: theme.space.sm
|
|
16
|
+
paddingLeft: theme.space.sm,
|
|
17
|
+
...theme.typography.body,
|
|
18
|
+
color: theme.colors.base_dark
|
|
17
19
|
},
|
|
18
20
|
action: {
|
|
19
21
|
padding: theme.spacing("xs"),
|
|
@@ -39,6 +41,33 @@ const { useClasses, staticClasses } = createClasses("HvBannerContent", {
|
|
|
39
41
|
outContainer: {
|
|
40
42
|
width: "100%",
|
|
41
43
|
position: "relative"
|
|
44
|
+
},
|
|
45
|
+
messageContainer: {
|
|
46
|
+
wordBreak: "break-word",
|
|
47
|
+
maxWidth: 700,
|
|
48
|
+
overflow: "hidden",
|
|
49
|
+
marginRight: 10
|
|
50
|
+
},
|
|
51
|
+
iconContainer: {
|
|
52
|
+
marginRight: theme.space.xs,
|
|
53
|
+
marginLeft: -theme.space.xs
|
|
54
|
+
},
|
|
55
|
+
messageActions: {
|
|
56
|
+
flex: "0 0 auto"
|
|
57
|
+
},
|
|
58
|
+
actionContainer: {
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "column",
|
|
61
|
+
height: "100%",
|
|
62
|
+
justifyContent: "space-between"
|
|
63
|
+
},
|
|
64
|
+
actionsInnerContainer: {
|
|
65
|
+
flexDirection: "row",
|
|
66
|
+
marginTop: "8px"
|
|
67
|
+
// avoid overlap with close button outline focus ring
|
|
68
|
+
},
|
|
69
|
+
closeAction: {
|
|
70
|
+
alignSelf: "flex-end"
|
|
42
71
|
}
|
|
43
72
|
});
|
|
44
73
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerContent.styles.js","sources":["../../../../src/Banner/BannerContent/BannerContent.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvBannerContent\", {\n root: {\n minWidth: \"100%\",\n position: \"relative\",\n display: \"flex\",\n flexWrap: \"nowrap\",\n boxShadow: \"none\",\n borderRadius: theme.radii.none,\n },\n message: {\n display: \"flex\",\n alignItems: \"center\",\n padding: theme.spacing(\"xs\", 0),\n paddingLeft: theme.space.sm,\n },\n action: {\n padding: theme.spacing(\"xs\"),\n marginRight: 0,\n flex: \"0 0 auto\",\n placeSelf: \"stretch\",\n },\n baseVariant: {\n padding: 0,\n },\n success: {\n backgroundColor: theme.colors.positive_20,\n },\n warning: {\n backgroundColor: theme.colors.warning_20,\n },\n error: {\n backgroundColor: theme.colors.negative_20,\n },\n default: {\n backgroundColor: theme.colors.neutral_20,\n },\n outContainer: {\n width: \"100%\",\n position: \"relative\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,IACX,cAAc,MAAM,MAAM;AAAA,EAC5B;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,SAAS,MAAM,QAAQ,MAAM,CAAC;AAAA,IAC9B,aAAa,MAAM,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"BannerContent.styles.js","sources":["../../../../src/Banner/BannerContent/BannerContent.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvBannerContent\", {\n root: {\n minWidth: \"100%\",\n position: \"relative\",\n display: \"flex\",\n flexWrap: \"nowrap\",\n boxShadow: \"none\",\n borderRadius: theme.radii.none,\n },\n message: {\n display: \"flex\",\n alignItems: \"center\",\n padding: theme.spacing(\"xs\", 0),\n paddingLeft: theme.space.sm,\n ...theme.typography.body,\n color: theme.colors.base_dark,\n },\n action: {\n padding: theme.spacing(\"xs\"),\n marginRight: 0,\n flex: \"0 0 auto\",\n placeSelf: \"stretch\",\n },\n baseVariant: {\n padding: 0,\n },\n success: {\n backgroundColor: theme.colors.positive_20,\n },\n warning: {\n backgroundColor: theme.colors.warning_20,\n },\n error: {\n backgroundColor: theme.colors.negative_20,\n },\n default: {\n backgroundColor: theme.colors.neutral_20,\n },\n outContainer: {\n width: \"100%\",\n position: \"relative\",\n },\n messageContainer: {\n wordBreak: \"break-word\",\n maxWidth: 700,\n overflow: \"hidden\",\n marginRight: 10,\n },\n iconContainer: {\n marginRight: theme.space.xs,\n marginLeft: -theme.space.xs,\n },\n messageActions: {\n flex: \"0 0 auto\",\n },\n actionContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n height: \"100%\",\n justifyContent: \"space-between\",\n },\n actionsInnerContainer: {\n flexDirection: \"row\",\n marginTop: \"8px\", // avoid overlap with close button outline focus ring\n },\n closeAction: {\n alignSelf: \"flex-end\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,IACX,cAAc,MAAM,MAAM;AAAA,EAC5B;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,SAAS,MAAM,QAAQ,MAAM,CAAC;AAAA,IAC9B,aAAa,MAAM,MAAM;AAAA,IACzB,GAAG,MAAM,WAAW;AAAA,IACpB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,MAAM,QAAQ,IAAI;AAAA,IAC3B,aAAa;AAAA,IACb,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA,aAAa;AAAA,IACX,SAAS;AAAA,EACX;AAAA,EACA,SAAS;AAAA,IACP,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,SAAS;AAAA,IACP,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,OAAO;AAAA,IACL,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,SAAS;AAAA,IACP,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,kBAAkB;AAAA,IAChB,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA,eAAe;AAAA,IACb,aAAa,MAAM,MAAM;AAAA,IACzB,YAAY,CAAC,MAAM,MAAM;AAAA,EAC3B;AAAA,EACA,gBAAgB;AAAA,IACd,MAAM;AAAA,EACR;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA,uBAAuB;AAAA,IACrB,eAAe;AAAA,IACf,WAAW;AAAA;AAAA,EACb;AAAA,EACA,aAAa;AAAA,IACX,WAAW;AAAA,EAAA;AAEf,CAAC;"}
|
package/dist/esm/Box/Box.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sources":["../../../src/Box/Box.tsx"],"sourcesContent":["import { useDefaultProps } from \"@hitachivantara/uikit-react-utils\";\nimport { HvTheme, theme } from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\n\n// v6 - This shouldn't be named HvBoxProps\nexport type HvBoxProps<C extends React.ElementType = \"div\"> =\n PolymorphicComponentRef<\n C,\n {\n style?: React.CSSProperties;\n sx?: React.CSSProperties | ((theme: HvTheme) => React.CSSProperties);\n }\n >;\n\nconst sxFn = (sx: HvBoxProps[\"sx\"]) => {\n return typeof sx === \"function\" ? sx(theme) : sx;\n};\n\n/**\n * Customizable layout component that can be used to wrap other components.\n * It can be used to add styles to the wrapped components.\n * It can also be used to create a layout using the flexbox properties.\n */\nexport const HvBox = fixedForwardRef(function HvBox<\n C extends React.ElementType = \"div\",\n>(props: HvBoxProps<C>, ref?: PolymorphicRef<C>) {\n const {\n style,\n component: Component = \"div\",\n sx,\n children,\n classes, // Extracted since useDefaultProps creates this prop even if it's not part of the component's API\n ...restProps\n } = useDefaultProps(\"HvBox\", props);\n\n return (\n <Component style={sx ? sxFn(sx) : style} ref={ref} {...restProps}>\n {children}\n </Component>\n );\n});\n"],"names":["HvBox"],"mappings":";;;;AAmBA,MAAM,OAAO,CAAC,OAAyB;AACrC,SAAO,OAAO,OAAO,aAAa,GAAG,KAAK,IAAI;AAChD;
|
|
1
|
+
{"version":3,"file":"Box.js","sources":["../../../src/Box/Box.tsx"],"sourcesContent":["import { useDefaultProps } from \"@hitachivantara/uikit-react-utils\";\nimport { HvTheme, theme } from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\n\n// v6 - This shouldn't be named HvBoxProps\nexport type HvBoxProps<C extends React.ElementType = \"div\"> =\n PolymorphicComponentRef<\n C,\n {\n style?: React.CSSProperties;\n sx?: React.CSSProperties | ((theme: HvTheme) => React.CSSProperties);\n }\n >;\n\nconst sxFn = (sx: HvBoxProps[\"sx\"]) => {\n return typeof sx === \"function\" ? sx(theme) : sx;\n};\n\n/**\n * Customizable layout component that can be used to wrap other components.\n * It can be used to add styles to the wrapped components.\n * It can also be used to create a layout using the flexbox properties.\n * @deprecated use native elements instead (e.g. `div`)\n */\nexport const HvBox = fixedForwardRef(function HvBox<\n C extends React.ElementType = \"div\",\n>(props: HvBoxProps<C>, ref?: PolymorphicRef<C>) {\n const {\n style,\n component: Component = \"div\",\n sx,\n children,\n classes, // Extracted since useDefaultProps creates this prop even if it's not part of the component's API\n ...restProps\n } = useDefaultProps(\"HvBox\", props);\n\n return (\n <Component style={sx ? sxFn(sx) : style} ref={ref} {...restProps}>\n {children}\n </Component>\n );\n});\n"],"names":["HvBox"],"mappings":";;;;AAmBA,MAAM,OAAO,CAAC,OAAyB;AACrC,SAAO,OAAO,OAAO,aAAa,GAAG,KAAK,IAAI;AAChD;AAQO,MAAM,QAAQ,gBAAgB,SAASA,OAE5C,OAAsB,KAAyB;AACzC,QAAA;AAAA,IACJ;AAAA,IACA,WAAW,YAAY;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,SAAS,KAAK;AAGhC,SAAA,oBAAC,WAAU,EAAA,OAAO,KAAK,KAAK,EAAE,IAAI,OAAO,KAAW,GAAG,WACpD,SACH,CAAA;AAEJ,CAAC;"}
|