@hitachivantara/uikit-react-core 5.73.1 → 5.74.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/Accordion/Accordion.cjs +23 -55
- package/dist/cjs/Accordion/Accordion.styles.cjs +2 -27
- package/dist/cjs/ActionsGeneric/ActionsGeneric.styles.cjs +4 -8
- package/dist/cjs/Badge/Badge.styles.cjs +1 -1
- package/dist/cjs/Banner/BannerContent/ActionContainer/ActionContainer.cjs +0 -1
- package/dist/cjs/BaseDropdown/BaseDropdown.cjs +4 -0
- package/dist/cjs/BaseDropdown/BaseDropdownContext/BaseDropdownContext.cjs +1 -2
- package/dist/cjs/BreadCrumb/BreadCrumb.cjs +6 -10
- package/dist/cjs/ButtonBase/ButtonBase.cjs +53 -0
- package/dist/cjs/ButtonBase/ButtonBase.styles.cjs +34 -0
- package/dist/cjs/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs +6 -22
- package/dist/cjs/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.cjs +6 -38
- package/dist/cjs/Calendar/SingleCalendar/CalendarCell.cjs +4 -10
- package/dist/cjs/Calendar/SingleCalendar/CalendarCell.styles.cjs +1 -20
- package/dist/cjs/ColorPicker/SavedColors/SavedColors.cjs +0 -1
- package/dist/cjs/DatePicker/DatePicker.cjs +2 -1
- package/dist/cjs/DatePicker/DatePicker.styles.cjs +2 -1
- package/dist/cjs/InlineEditor/InlineEditor.cjs +2 -1
- package/dist/cjs/Loading/Loading.cjs +12 -7
- package/dist/cjs/Loading/Loading.styles.cjs +33 -82
- package/dist/cjs/LoadingContainer/LoadingContainer.cjs +4 -2
- package/dist/cjs/LoadingContainer/LoadingContainer.styles.cjs +1 -1
- package/dist/cjs/Section/Section.cjs +10 -14
- package/dist/cjs/Table/hooks/useBulkActions.cjs +1 -2
- package/dist/cjs/Table/hooks/useFilters.cjs +1 -2
- package/dist/cjs/Table/hooks/useGlobalFilter.cjs +1 -2
- package/dist/cjs/Table/hooks/useHeaderGroups.cjs +1 -2
- package/dist/cjs/Table/hooks/usePagination.cjs +1 -2
- package/dist/cjs/Table/hooks/useResizeColumns.cjs +1 -2
- package/dist/cjs/Table/hooks/useRowExpand.cjs +1 -2
- package/dist/cjs/Table/hooks/useRowSelection.cjs +1 -2
- package/dist/cjs/Table/hooks/useRowState.cjs +1 -2
- package/dist/cjs/Table/hooks/useSortBy.cjs +1 -2
- package/dist/cjs/Table/hooks/useSticky.cjs +1 -2
- package/dist/cjs/Table/hooks/useTableStyles.cjs +1 -2
- package/dist/cjs/TextArea/TextArea.styles.cjs +1 -1
- package/dist/cjs/hooks/useExpandable.cjs +32 -0
- package/dist/cjs/hooks/useUniqueId.cjs +2 -1
- package/dist/cjs/index.cjs +41 -37
- package/dist/esm/Accordion/Accordion.js +24 -56
- package/dist/esm/Accordion/Accordion.js.map +1 -1
- package/dist/esm/Accordion/Accordion.styles.js +2 -27
- package/dist/esm/Accordion/Accordion.styles.js.map +1 -1
- package/dist/esm/ActionsGeneric/ActionsGeneric.styles.js +4 -8
- package/dist/esm/ActionsGeneric/ActionsGeneric.styles.js.map +1 -1
- package/dist/esm/Badge/Badge.styles.js +1 -1
- package/dist/esm/Badge/Badge.styles.js.map +1 -1
- package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js +0 -1
- package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js.map +1 -1
- package/dist/esm/BaseDropdown/BaseDropdown.js +4 -0
- package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
- package/dist/esm/BaseDropdown/BaseDropdownContext/BaseDropdownContext.js +1 -2
- package/dist/esm/BaseDropdown/BaseDropdownContext/BaseDropdownContext.js.map +1 -1
- package/dist/esm/BreadCrumb/BreadCrumb.js +6 -10
- package/dist/esm/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/esm/ButtonBase/ButtonBase.js +54 -0
- package/dist/esm/ButtonBase/ButtonBase.js.map +1 -0
- package/dist/esm/ButtonBase/ButtonBase.styles.js +34 -0
- package/dist/esm/ButtonBase/ButtonBase.styles.js.map +1 -0
- package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +6 -22
- package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
- package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js +6 -38
- package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js.map +1 -1
- package/dist/esm/Calendar/SingleCalendar/CalendarCell.js +4 -10
- package/dist/esm/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
- package/dist/esm/Calendar/SingleCalendar/CalendarCell.styles.js +1 -20
- package/dist/esm/Calendar/SingleCalendar/CalendarCell.styles.js.map +1 -1
- package/dist/esm/ColorPicker/SavedColors/SavedColors.js +0 -1
- package/dist/esm/ColorPicker/SavedColors/SavedColors.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.js +2 -1
- package/dist/esm/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.styles.js +2 -1
- package/dist/esm/DatePicker/DatePicker.styles.js.map +1 -1
- package/dist/esm/InlineEditor/InlineEditor.js +3 -2
- package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/Loading/Loading.js +13 -8
- package/dist/esm/Loading/Loading.js.map +1 -1
- package/dist/esm/Loading/Loading.styles.js +33 -82
- package/dist/esm/Loading/Loading.styles.js.map +1 -1
- package/dist/esm/LoadingContainer/LoadingContainer.js +4 -2
- package/dist/esm/LoadingContainer/LoadingContainer.js.map +1 -1
- package/dist/esm/LoadingContainer/LoadingContainer.styles.js +1 -1
- package/dist/esm/LoadingContainer/LoadingContainer.styles.js.map +1 -1
- package/dist/esm/Section/Section.js +11 -15
- package/dist/esm/Section/Section.js.map +1 -1
- package/dist/esm/Table/hooks/useBulkActions.js +1 -2
- package/dist/esm/Table/hooks/useBulkActions.js.map +1 -1
- package/dist/esm/Table/hooks/useFilters.js +1 -2
- package/dist/esm/Table/hooks/useFilters.js.map +1 -1
- package/dist/esm/Table/hooks/useGlobalFilter.js +1 -2
- package/dist/esm/Table/hooks/useGlobalFilter.js.map +1 -1
- package/dist/esm/Table/hooks/useHeaderGroups.js +1 -2
- package/dist/esm/Table/hooks/useHeaderGroups.js.map +1 -1
- package/dist/esm/Table/hooks/usePagination.js +1 -2
- package/dist/esm/Table/hooks/usePagination.js.map +1 -1
- package/dist/esm/Table/hooks/useResizeColumns.js +1 -2
- package/dist/esm/Table/hooks/useResizeColumns.js.map +1 -1
- package/dist/esm/Table/hooks/useRowExpand.js +1 -2
- package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/Table/hooks/useRowSelection.js +1 -2
- package/dist/esm/Table/hooks/useRowSelection.js.map +1 -1
- package/dist/esm/Table/hooks/useRowState.js +1 -2
- package/dist/esm/Table/hooks/useRowState.js.map +1 -1
- package/dist/esm/Table/hooks/useSortBy.js +1 -2
- package/dist/esm/Table/hooks/useSortBy.js.map +1 -1
- package/dist/esm/Table/hooks/useSticky.js +1 -2
- package/dist/esm/Table/hooks/useSticky.js.map +1 -1
- package/dist/esm/Table/hooks/useTable.js +2 -2
- package/dist/esm/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/Table/hooks/useTableStyles.js +1 -2
- package/dist/esm/Table/hooks/useTableStyles.js.map +1 -1
- package/dist/esm/TextArea/TextArea.styles.js +1 -1
- package/dist/esm/TextArea/TextArea.styles.js.map +1 -1
- package/dist/esm/hooks/useExpandable.js +32 -0
- package/dist/esm/hooks/useExpandable.js.map +1 -0
- package/dist/esm/hooks/useUniqueId.js +2 -1
- package/dist/esm/hooks/useUniqueId.js.map +1 -1
- package/dist/esm/index.js +254 -250
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +2167 -2107
- package/package.json +7 -7
|
@@ -4,10 +4,9 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
6
6
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
7
|
-
const
|
|
8
|
-
const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
9
|
-
const setId = require("../utils/setId.cjs");
|
|
7
|
+
const useExpandable = require("../hooks/useExpandable.cjs");
|
|
10
8
|
const Accordion_styles = require("./Accordion.styles.cjs");
|
|
9
|
+
const ButtonBase = require("../ButtonBase/ButtonBase.cjs");
|
|
11
10
|
const Typography = require("../Typography/Typography.cjs");
|
|
12
11
|
const HvAccordion = (props) => {
|
|
13
12
|
const {
|
|
@@ -26,72 +25,44 @@ const HvAccordion = (props) => {
|
|
|
26
25
|
disableEventHandling,
|
|
27
26
|
...others
|
|
28
27
|
} = uikitReactUtils.useDefaultProps("HvAccordion", props);
|
|
29
|
-
const id = useUniqueId.useUniqueId(idProp);
|
|
30
28
|
const { classes, cx } = Accordion_styles.useClasses(classesProp);
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
const { isOpen, toggleOpen, buttonProps, regionProps } = useExpandable.useExpandable({
|
|
30
|
+
id: idProp,
|
|
31
|
+
expanded,
|
|
32
|
+
disabled,
|
|
33
|
+
defaultExpanded
|
|
34
|
+
});
|
|
35
|
+
const handleClick = React.useCallback(
|
|
33
36
|
(event) => {
|
|
34
37
|
if (!disabled) {
|
|
35
38
|
onChange?.(event, isOpen);
|
|
36
|
-
|
|
37
|
-
return true;
|
|
39
|
+
toggleOpen();
|
|
38
40
|
}
|
|
39
|
-
return false;
|
|
40
|
-
},
|
|
41
|
-
[disabled, onChange, isOpen, setIsOpen]
|
|
42
|
-
);
|
|
43
|
-
const handleClick = React.useCallback(
|
|
44
|
-
(event) => {
|
|
45
|
-
handleAction(event);
|
|
46
41
|
if (!disableEventHandling) {
|
|
47
42
|
event.preventDefault();
|
|
48
43
|
event.stopPropagation();
|
|
49
44
|
}
|
|
50
45
|
},
|
|
51
|
-
[disableEventHandling,
|
|
52
|
-
);
|
|
53
|
-
const handleKeyDown = React.useCallback(
|
|
54
|
-
(event) => {
|
|
55
|
-
let isEventHandled = false;
|
|
56
|
-
const { key } = event;
|
|
57
|
-
if (event.altKey || event.ctrlKey || event.metaKey || event.currentTarget !== event.target) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
switch (key) {
|
|
61
|
-
case "Enter":
|
|
62
|
-
case " ":
|
|
63
|
-
isEventHandled = handleAction(event);
|
|
64
|
-
break;
|
|
65
|
-
default:
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (isEventHandled && !disableEventHandling) {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
event.stopPropagation();
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
[disableEventHandling, handleAction]
|
|
46
|
+
[disableEventHandling, disabled, isOpen, onChange, toggleOpen]
|
|
74
47
|
);
|
|
75
|
-
const accordionHeaderId = setId.setId(id, "button");
|
|
76
|
-
const accordionContainer = setId.setId(id, "container");
|
|
77
48
|
const accordionHeader = React.useMemo(() => {
|
|
78
|
-
const color = disabled ? "secondary_60" : void 0;
|
|
79
49
|
const accordionButton = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
80
50
|
Typography.HvTypography,
|
|
81
51
|
{
|
|
82
|
-
|
|
83
|
-
component:
|
|
84
|
-
role: "button",
|
|
52
|
+
...buttonProps,
|
|
53
|
+
component: ButtonBase.HvButtonBase,
|
|
85
54
|
className: cx(classes.label, { [classes.disabled]: disabled }),
|
|
86
55
|
disabled,
|
|
87
|
-
tabIndex: 0,
|
|
88
|
-
onKeyDown: handleKeyDown,
|
|
89
56
|
onClick: handleClick,
|
|
90
57
|
variant: labelVariant,
|
|
91
|
-
"aria-expanded": isOpen,
|
|
92
|
-
"aria-disabled": disabled,
|
|
93
58
|
children: [
|
|
94
|
-
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
uikitReactIcons.DropUpXS,
|
|
61
|
+
{
|
|
62
|
+
color: "inherit",
|
|
63
|
+
style: { rotate: isOpen ? void 0 : "180deg" }
|
|
64
|
+
}
|
|
65
|
+
),
|
|
95
66
|
label
|
|
96
67
|
]
|
|
97
68
|
}
|
|
@@ -101,24 +72,21 @@ const HvAccordion = (props) => {
|
|
|
101
72
|
cx,
|
|
102
73
|
classes,
|
|
103
74
|
handleClick,
|
|
104
|
-
handleKeyDown,
|
|
105
75
|
label,
|
|
106
|
-
|
|
76
|
+
buttonProps,
|
|
107
77
|
disabled,
|
|
108
78
|
headingLevel,
|
|
109
79
|
isOpen,
|
|
110
80
|
labelVariant
|
|
111
81
|
]);
|
|
112
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { id, className: cx(classes.root, className), ...others, children: [
|
|
82
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { id: idProp, className: cx(classes.root, className), ...others, children: [
|
|
113
83
|
accordionHeader,
|
|
114
84
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
115
85
|
"div",
|
|
116
86
|
{
|
|
117
|
-
id: accordionContainer,
|
|
118
|
-
role: "region",
|
|
119
|
-
"aria-labelledby": accordionHeaderId,
|
|
120
87
|
className: cx(classes.container, { [classes.hidden]: !isOpen }),
|
|
121
88
|
hidden: !isOpen,
|
|
89
|
+
...regionProps,
|
|
122
90
|
...containerProps,
|
|
123
91
|
children
|
|
124
92
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
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
|
-
const focusUtils = require("../utils/focusUtils.cjs");
|
|
6
4
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvAccordion", {
|
|
7
5
|
root: {
|
|
8
6
|
"& + root": {
|
|
@@ -16,32 +14,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvAccordion
|
|
|
16
14
|
display: "flex",
|
|
17
15
|
justifyContent: "flex-start",
|
|
18
16
|
alignItems: "center",
|
|
19
|
-
height: "32px"
|
|
20
|
-
"&[disabled], &:active": {
|
|
21
|
-
outline: "none"
|
|
22
|
-
},
|
|
23
|
-
"&:focus": {
|
|
24
|
-
outline: "none",
|
|
25
|
-
background: uikitStyles.theme.colors.atmo3
|
|
26
|
-
},
|
|
27
|
-
"&:hover": {
|
|
28
|
-
background: uikitStyles.theme.colors.atmo3
|
|
29
|
-
},
|
|
30
|
-
"&:focus-visible": {
|
|
31
|
-
...focusUtils.outlineStyles
|
|
32
|
-
},
|
|
33
|
-
cursor: "pointer"
|
|
17
|
+
height: "32px"
|
|
34
18
|
},
|
|
35
|
-
disabled: {
|
|
36
|
-
cursor: "not-allowed",
|
|
37
|
-
color: uikitStyles.theme.colors.secondary_60,
|
|
38
|
-
"&:focus": {
|
|
39
|
-
background: "none"
|
|
40
|
-
},
|
|
41
|
-
"&:hover": {
|
|
42
|
-
background: "none"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
19
|
+
disabled: {}
|
|
45
20
|
});
|
|
46
21
|
exports.staticClasses = staticClasses;
|
|
47
22
|
exports.useClasses = useClasses;
|
|
@@ -3,15 +3,11 @@ 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("HvActionsGeneric", {
|
|
6
|
-
root: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
marginRight: uikitStyles.theme.space.xs
|
|
10
|
-
},
|
|
11
|
-
"&:hover": {
|
|
12
|
-
backgroundColor: uikitStyles.theme.alpha("base_light", 0.3)
|
|
13
|
-
}
|
|
6
|
+
root: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
gap: uikitStyles.theme.space.xs
|
|
14
9
|
},
|
|
10
|
+
button: {},
|
|
15
11
|
actionContainer: { display: "flex", alignItems: "center", float: "right" },
|
|
16
12
|
dropDownMenu: {},
|
|
17
13
|
dropDownMenuButton: {},
|
|
@@ -3,7 +3,7 @@ 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 labelBaseStyle = {
|
|
6
|
-
...uikitStyles.theme.typography.
|
|
6
|
+
...uikitStyles.theme.typography.caption2,
|
|
7
7
|
padding: "0 5px",
|
|
8
8
|
color: uikitStyles.theme.colors.atmo1,
|
|
9
9
|
lineHeight: "16px"
|
|
@@ -26,7 +26,6 @@ const HvActionContainer = (props) => {
|
|
|
26
26
|
variant: "semantic",
|
|
27
27
|
"aria-label": "Close",
|
|
28
28
|
onClick: onClose,
|
|
29
|
-
tabIndex: 0,
|
|
30
29
|
...others,
|
|
31
30
|
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Close, { iconSize: "XS", className: classes.iconContainer, color: "base2" })
|
|
32
31
|
}
|
|
@@ -11,6 +11,7 @@ const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
|
11
11
|
const useControlled = require("../hooks/useControlled.cjs");
|
|
12
12
|
const useForkRef = require("../hooks/useForkRef.cjs");
|
|
13
13
|
const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
14
|
+
const document$1 = require("../utils/document.cjs");
|
|
14
15
|
const focusableElementFinder = require("../utils/focusableElementFinder.cjs");
|
|
15
16
|
const keyboardUtils = require("../utils/keyboardUtils.cjs");
|
|
16
17
|
const setId = require("../utils/setId.cjs");
|
|
@@ -143,6 +144,9 @@ const BaseDropdown = React.forwardRef((props, ref) => {
|
|
|
143
144
|
...headerControlArias
|
|
144
145
|
}) : defaultHeaderElement;
|
|
145
146
|
const containerComponent = (() => {
|
|
147
|
+
if (!document$1.getDocument()) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
146
150
|
const handleContainerKeyDown = (event) => {
|
|
147
151
|
if (keyboardUtils.isKey(event, "Esc")) {
|
|
148
152
|
handleToggle(event);
|
|
@@ -7,6 +7,5 @@ const BaseDropdownContext = React.createContext({
|
|
|
7
7
|
});
|
|
8
8
|
BaseDropdownContext.displayName = "BaseDropdownContext";
|
|
9
9
|
const useBaseDropdownContext = () => React.useContext(BaseDropdownContext);
|
|
10
|
-
|
|
11
|
-
exports.default = BaseDropdownContext$1;
|
|
10
|
+
exports.default = BaseDropdownContext;
|
|
12
11
|
exports.useBaseDropdownContext = useBaseDropdownContext;
|
|
@@ -25,16 +25,12 @@ const HvBreadCrumb = (props) => {
|
|
|
25
25
|
const maxVisibleElem = maxVisible && maxVisible < 2 ? 2 : maxVisible;
|
|
26
26
|
let listPath = listRoute.slice();
|
|
27
27
|
if (url != null) {
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
label: decodeURI(elem),
|
|
35
|
-
path: `${baseUrl}/${pathNames.slice(0, index + 1).join("/")}`
|
|
36
|
-
})
|
|
37
|
-
);
|
|
28
|
+
const baseUrl = url.match(/^.*\/\/[^/]+/) ?? "";
|
|
29
|
+
const pathNames = url.replace(/^.*\/\/[^/]+/, "").split("/").filter(Boolean);
|
|
30
|
+
listPath = pathNames.map((elem, index) => ({
|
|
31
|
+
label: decodeURI(elem),
|
|
32
|
+
path: `${baseUrl}/${pathNames.slice(0, index + 1).join("/")}`
|
|
33
|
+
}));
|
|
38
34
|
}
|
|
39
35
|
const breadcrumbPath = maxVisibleElem && listPath.length > maxVisibleElem ? utils.pathWithSubMenu(
|
|
40
36
|
id,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
|
+
const generic = require("../types/generic.cjs");
|
|
6
|
+
const ButtonBase_styles = require("./ButtonBase.styles.cjs");
|
|
7
|
+
const HvButtonBase = generic.fixedForwardRef(function HvButtonBase2(props, ref) {
|
|
8
|
+
const {
|
|
9
|
+
className,
|
|
10
|
+
classes: classesProp,
|
|
11
|
+
children,
|
|
12
|
+
selected,
|
|
13
|
+
disabled,
|
|
14
|
+
focusableWhenDisabled,
|
|
15
|
+
component: Component = "button",
|
|
16
|
+
onClick: onClickProp,
|
|
17
|
+
onMouseDown: onMouseDownProp,
|
|
18
|
+
...others
|
|
19
|
+
} = uikitReactUtils.useDefaultProps("HvButtonBase", props);
|
|
20
|
+
const { classes, cx } = ButtonBase_styles.useClasses(classesProp);
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
+
Component,
|
|
23
|
+
{
|
|
24
|
+
ref,
|
|
25
|
+
className: cx(
|
|
26
|
+
classes.root,
|
|
27
|
+
{
|
|
28
|
+
[classes.disabled]: disabled
|
|
29
|
+
},
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
onClick: (e) => {
|
|
33
|
+
if (disabled) return;
|
|
34
|
+
onClickProp?.(e);
|
|
35
|
+
},
|
|
36
|
+
onMouseDown: (e) => {
|
|
37
|
+
if (disabled) return;
|
|
38
|
+
onMouseDownProp?.(e);
|
|
39
|
+
},
|
|
40
|
+
...Component === "button" && { type: "button" },
|
|
41
|
+
...disabled && {
|
|
42
|
+
disabled: !focusableWhenDisabled,
|
|
43
|
+
tabIndex: focusableWhenDisabled ? 0 : -1,
|
|
44
|
+
"aria-disabled": true
|
|
45
|
+
},
|
|
46
|
+
...selected && { "aria-pressed": selected },
|
|
47
|
+
...others,
|
|
48
|
+
children
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
exports.buttonBaseClasses = ButtonBase_styles.staticClasses;
|
|
53
|
+
exports.HvButtonBase = HvButtonBase;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
|
+
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
|
+
const focusUtils = require("../utils/focusUtils.cjs");
|
|
6
|
+
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvButtonBase", {
|
|
7
|
+
root: {
|
|
8
|
+
display: "inline-flex",
|
|
9
|
+
cursor: "pointer",
|
|
10
|
+
background: "none",
|
|
11
|
+
padding: 0,
|
|
12
|
+
// Background color common for almost all variants
|
|
13
|
+
"&:hover": {
|
|
14
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
15
|
+
},
|
|
16
|
+
"&:focus-visible": {
|
|
17
|
+
...focusUtils.outlineStyles,
|
|
18
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
19
|
+
},
|
|
20
|
+
// Default button - no size specified
|
|
21
|
+
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
22
|
+
fontSize: "inherit",
|
|
23
|
+
color: "inherit"
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
cursor: "not-allowed",
|
|
27
|
+
color: uikitStyles.theme.colors.secondary_60,
|
|
28
|
+
"&:hover, &:focus-visible": {
|
|
29
|
+
backgroundColor: "transparent"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.staticClasses = staticClasses;
|
|
34
|
+
exports.useClasses = useClasses;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const keyboardUtils = require("../../../utils/keyboardUtils.cjs");
|
|
5
4
|
const utils = require("../../utils.cjs");
|
|
6
5
|
const MonthSelector_styles = require("./MonthSelector.styles.cjs");
|
|
7
|
-
const
|
|
6
|
+
const ButtonBase = require("../../../ButtonBase/ButtonBase.cjs");
|
|
8
7
|
const HvMonthSelector = ({
|
|
9
8
|
classes: classesProp,
|
|
10
9
|
id,
|
|
@@ -17,12 +16,6 @@ const HvMonthSelector = ({
|
|
|
17
16
|
}) => {
|
|
18
17
|
const { classes, cx } = MonthSelector_styles.useClasses(classesProp);
|
|
19
18
|
const listMonthNamesShort = utils.getMonthNamesList(locale, "short");
|
|
20
|
-
const onKeyDownHandler = (event, index) => {
|
|
21
|
-
if (keyboardUtils.isKey(event, "Enter")) {
|
|
22
|
-
onChange?.(event, "month", index + 1);
|
|
23
|
-
onViewModeChange("calendar");
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
19
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
20
|
"div",
|
|
28
21
|
{
|
|
@@ -31,26 +24,17 @@ const HvMonthSelector = ({
|
|
|
31
24
|
[classes.normalWidth]: !rangeMode
|
|
32
25
|
}),
|
|
33
26
|
children: listMonthNamesShort.map((monthName, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
|
|
27
|
+
ButtonBase.HvButtonBase,
|
|
35
28
|
{
|
|
36
|
-
className: classes.
|
|
37
|
-
|
|
29
|
+
className: cx(classes.calendarMonthlyCell, {
|
|
30
|
+
[classes.calendarMonthlyCellSelected]: index + 1 === visibleMonth
|
|
31
|
+
}),
|
|
38
32
|
onClick: (event) => {
|
|
39
33
|
onChange?.(event, "month", index + 1);
|
|
40
34
|
onViewModeChange("calendar");
|
|
41
35
|
},
|
|
42
|
-
onKeyDown: (event) => onKeyDownHandler(event, index),
|
|
43
|
-
tabIndex: 0,
|
|
44
36
|
...others,
|
|
45
|
-
children:
|
|
46
|
-
Typography.HvTypography,
|
|
47
|
-
{
|
|
48
|
-
className: cx(classes.calendarMonthlyCell, {
|
|
49
|
-
[classes.calendarMonthlyCellSelected]: index + 1 === visibleMonth
|
|
50
|
-
}),
|
|
51
|
-
children: monthName
|
|
52
|
-
}
|
|
53
|
-
)
|
|
37
|
+
children: monthName
|
|
54
38
|
},
|
|
55
39
|
monthName
|
|
56
40
|
))
|
|
@@ -2,56 +2,24 @@
|
|
|
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
|
-
backgroundColor: uikitStyles.theme.colors.atmo3,
|
|
8
|
-
cursor: "pointer"
|
|
9
|
-
};
|
|
10
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvMonthSelector", {
|
|
11
6
|
calendarMonthlyGrid: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
display: "flex",
|
|
7
|
+
display: "grid",
|
|
8
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
15
9
|
zIndex: "10",
|
|
16
|
-
|
|
17
|
-
position: "absolute",
|
|
18
|
-
flexFlow: "wrap",
|
|
19
|
-
alignContent: "center",
|
|
20
|
-
justifyContent: "space-evenly",
|
|
21
|
-
backgroundColor: uikitStyles.theme.colors.atmo1
|
|
10
|
+
alignContent: "center"
|
|
22
11
|
},
|
|
23
12
|
rangeModeWidth: {},
|
|
24
13
|
normalWidth: {},
|
|
25
|
-
focusSelection: {
|
|
26
|
-
"&:hover": {
|
|
27
|
-
...hover
|
|
28
|
-
},
|
|
29
|
-
"&:focus": {
|
|
30
|
-
outline: "none"
|
|
31
|
-
},
|
|
32
|
-
"&:focus-visible": {
|
|
33
|
-
...hover,
|
|
34
|
-
...focusUtils.outlineStyles
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
14
|
calendarMonthlyCell: {
|
|
38
15
|
display: "flex",
|
|
39
16
|
justifyContent: "center",
|
|
40
|
-
|
|
41
|
-
textAlign: "center",
|
|
17
|
+
alignItems: "center",
|
|
42
18
|
height: "40px",
|
|
43
|
-
width: "92px"
|
|
44
|
-
"&:hover": {
|
|
45
|
-
...hover
|
|
46
|
-
}
|
|
19
|
+
width: "92px"
|
|
47
20
|
},
|
|
48
21
|
calendarMonthlyCellSelected: {
|
|
49
|
-
backgroundColor: uikitStyles.theme.colors.atmo3
|
|
50
|
-
color: uikitStyles.theme.colors.secondary,
|
|
51
|
-
"&:hover": {
|
|
52
|
-
backgroundColor: uikitStyles.theme.colors.atmo3,
|
|
53
|
-
color: uikitStyles.theme.colors.secondary
|
|
54
|
-
}
|
|
22
|
+
backgroundColor: uikitStyles.theme.colors.atmo3
|
|
55
23
|
}
|
|
56
24
|
});
|
|
57
25
|
exports.staticClasses = staticClasses;
|
|
@@ -5,12 +5,12 @@ const React = require("react");
|
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
6
|
const utils = require("../utils.cjs");
|
|
7
7
|
const CalendarCell_styles = require("./CalendarCell.styles.cjs");
|
|
8
|
+
const ButtonBase = require("../../ButtonBase/ButtonBase.cjs");
|
|
8
9
|
const Typography = require("../../Typography/Typography.cjs");
|
|
9
10
|
const HvCalendarCell = (props) => {
|
|
10
11
|
const {
|
|
11
12
|
classes: classesProp,
|
|
12
13
|
onChange,
|
|
13
|
-
onKeyDown,
|
|
14
14
|
calendarValue,
|
|
15
15
|
firstDayOfCurrentMonth,
|
|
16
16
|
value,
|
|
@@ -42,25 +42,19 @@ const HvCalendarCell = (props) => {
|
|
|
42
42
|
if (buttonEl.current) setTimeout(() => buttonEl?.current?.focus());
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
const handleKeyDown = (event) => {
|
|
46
|
-
onKeyDown?.(event);
|
|
47
|
-
};
|
|
48
45
|
const renderDate = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
-
|
|
46
|
+
ButtonBase.HvButtonBase,
|
|
50
47
|
{
|
|
51
48
|
ref: buttonEl,
|
|
52
|
-
|
|
53
|
-
className: cx(classes.cellContainer, {
|
|
54
|
-
[classes.focusSelection]: inMonth
|
|
55
|
-
}),
|
|
49
|
+
className: classes.cellContainer,
|
|
56
50
|
onClick: handleClick,
|
|
57
|
-
onKeyDown: handleKeyDown,
|
|
58
51
|
disabled: isDateDisabled || !inMonth,
|
|
59
52
|
"data-in-month": inMonth,
|
|
60
53
|
...others,
|
|
61
54
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
55
|
Typography.HvTypography,
|
|
63
56
|
{
|
|
57
|
+
component: "span",
|
|
64
58
|
variant: isCellToday ? "label" : "body",
|
|
65
59
|
className: cx(classes.calendarDate, {
|
|
66
60
|
[classes.calendarDateSelected]: inMonth && isCellSelected,
|
|
@@ -2,31 +2,12 @@
|
|
|
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
5
|
const hover = {
|
|
7
6
|
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover,
|
|
8
7
|
cursor: "pointer"
|
|
9
8
|
};
|
|
10
9
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvCalendarCell", {
|
|
11
|
-
cellContainer: {
|
|
12
|
-
cursor: "pointer",
|
|
13
|
-
border: 0,
|
|
14
|
-
padding: 0,
|
|
15
|
-
margin: 0,
|
|
16
|
-
backgroundColor: "transparent"
|
|
17
|
-
},
|
|
18
|
-
focusSelection: {
|
|
19
|
-
"&:hover": {
|
|
20
|
-
...hover
|
|
21
|
-
},
|
|
22
|
-
"&:focus": {
|
|
23
|
-
outline: "none"
|
|
24
|
-
},
|
|
25
|
-
"&:focus-visible": {
|
|
26
|
-
...hover,
|
|
27
|
-
...focusUtils.outlineStyles
|
|
28
|
-
}
|
|
29
|
-
},
|
|
10
|
+
cellContainer: {},
|
|
30
11
|
calendarDate: {
|
|
31
12
|
display: "flex",
|
|
32
13
|
justifyContent: "center",
|
|
@@ -56,7 +56,6 @@ const SavedColors = (props) => {
|
|
|
56
56
|
className: classes.removeButton,
|
|
57
57
|
variant: "secondarySubtle",
|
|
58
58
|
onClick: () => onRemoveColor(color, index),
|
|
59
|
-
tabIndex: 0,
|
|
60
59
|
"aria-label": deleteButtonAriaLabel,
|
|
61
60
|
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.CloseXS, { "aria-hidden": true, iconSize: "XS" })
|
|
62
61
|
}
|
|
@@ -42,7 +42,8 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvDatePicke
|
|
|
42
42
|
dateText: {
|
|
43
43
|
color: "inherit",
|
|
44
44
|
fontWeight: uikitStyles.theme.typography.label.fontWeight
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
|
+
container: {}
|
|
46
47
|
});
|
|
47
48
|
exports.staticClasses = staticClasses;
|
|
48
49
|
exports.useClasses = useClasses;
|
|
@@ -5,6 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
6
6
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
7
7
|
const useControlled = require("../hooks/useControlled.cjs");
|
|
8
|
+
const useEnhancedEffect = require("../hooks/useEnhancedEffect.cjs");
|
|
8
9
|
const generic = require("../types/generic.cjs");
|
|
9
10
|
const keyboardUtils = require("../utils/keyboardUtils.cjs");
|
|
10
11
|
const InlineEditor_styles = require("./InlineEditor.styles.cjs");
|
|
@@ -37,7 +38,7 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
37
38
|
const { activeTheme } = uikitReactUtils.useTheme();
|
|
38
39
|
const typographyStyles = activeTheme?.typography[variant] || {};
|
|
39
40
|
const { lineHeight } = typographyStyles;
|
|
40
|
-
|
|
41
|
+
useEnhancedEffect.useEnhancedEffect(() => {
|
|
41
42
|
const input = inputRef.current;
|
|
42
43
|
if (editMode && input) {
|
|
43
44
|
input.focus();
|
|
@@ -13,20 +13,21 @@ const HvLoading = (props) => {
|
|
|
13
13
|
small,
|
|
14
14
|
label,
|
|
15
15
|
classes: classesProp,
|
|
16
|
+
style,
|
|
16
17
|
className,
|
|
17
18
|
...others
|
|
18
19
|
} = uikitReactUtils.useDefaultProps("HvLoading", props);
|
|
19
20
|
const { classes, cx } = Loading_styles.useClasses(classesProp);
|
|
20
21
|
const size = small ? "small" : "regular";
|
|
21
|
-
const colorVariant = color
|
|
22
|
-
const variant = `${size}${colorVariant}`;
|
|
23
|
-
const inline = {
|
|
24
|
-
backgroundColor: uikitStyles.getColor(color, small ? "secondary" : "brand")
|
|
25
|
-
};
|
|
22
|
+
const colorVariant = color && `${size}Color`;
|
|
26
23
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27
24
|
"div",
|
|
28
25
|
{
|
|
29
26
|
hidden: !!hidden,
|
|
27
|
+
style: uikitReactUtils.mergeStyles(style, {
|
|
28
|
+
color: uikitStyles.getColor(color, small ? "secondary" : "brand"),
|
|
29
|
+
"--customColor": uikitStyles.getColor(color)
|
|
30
|
+
}),
|
|
30
31
|
className: cx(
|
|
31
32
|
classes.root,
|
|
32
33
|
{
|
|
@@ -39,8 +40,12 @@ const HvLoading = (props) => {
|
|
|
39
40
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.barContainer, children: helpers.range(3).map((e) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
41
|
"div",
|
|
41
42
|
{
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
className: cx(
|
|
44
|
+
classes.loadingBar,
|
|
45
|
+
// TODO: hoist to parent & remove unused `colorVariant` in v6
|
|
46
|
+
classes[size],
|
|
47
|
+
classes[colorVariant]
|
|
48
|
+
)
|
|
44
49
|
},
|
|
45
50
|
e
|
|
46
51
|
)) }),
|