@hitachivantara/uikit-react-core 5.87.3 → 5.89.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/ActionsGeneric/ActionsGeneric.cjs +2 -3
- package/dist/cjs/AppSwitcher/Action/Action.styles.cjs +2 -2
- package/dist/cjs/Banner/Banner.cjs +5 -5
- package/dist/cjs/Banner/BannerContent/BannerContent.cjs +59 -97
- package/dist/cjs/Banner/BannerContent/BannerContent.styles.cjs +18 -46
- package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +1 -2
- package/dist/cjs/BaseInput/BaseInput.styles.cjs +1 -1
- package/dist/cjs/BaseInput/validations.cjs +2 -1
- package/dist/cjs/Button/Button.cjs +1 -2
- package/dist/cjs/Button/Button.styles.cjs +0 -6
- package/dist/cjs/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/cjs/DatePicker/DatePicker.cjs +12 -12
- package/dist/cjs/DotPagination/DotPagination.styles.cjs +3 -0
- package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs +1 -1
- package/dist/cjs/FormElement/Adornment/Adornment.cjs +15 -36
- package/dist/cjs/FormElement/Adornment/Adornment.styles.cjs +12 -21
- package/dist/cjs/IconContainer/IconContainer.cjs +81 -0
- package/dist/cjs/Input/Input.cjs +29 -51
- package/dist/cjs/Input/Input.styles.cjs +1 -0
- package/dist/cjs/List/List.cjs +1 -1
- package/dist/cjs/ListContainer/ListItem/ListItem.styles.cjs +0 -6
- package/dist/cjs/Loading/Loading.cjs +1 -2
- package/dist/cjs/Loading/Loading.styles.cjs +3 -1
- package/dist/cjs/Pagination/Pagination.styles.cjs +2 -2
- package/dist/cjs/Pagination/Select.cjs +1 -1
- package/dist/cjs/Snackbar/Snackbar.cjs +6 -5
- package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.cjs +20 -28
- package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.styles.cjs +26 -56
- package/dist/cjs/Table/TableBody/TableBody.cjs +16 -17
- package/dist/cjs/{TableSection → Table/TableSection}/TableSection.cjs +2 -2
- package/dist/cjs/{TableSection → Table/TableSection}/TableSection.styles.cjs +12 -12
- package/dist/cjs/Table/hooks/useHvRowExpand.cjs +3 -3
- package/dist/cjs/Tabs/Tab/Tab.styles.cjs +0 -3
- package/dist/cjs/Tag/Tag.cjs +1 -1
- package/dist/cjs/TagsInput/TagsInput.cjs +103 -169
- package/dist/cjs/TagsInput/TagsInput.styles.cjs +45 -106
- package/dist/cjs/TextArea/TextArea.cjs +1 -3
- package/dist/cjs/TimePicker/TimePicker.cjs +5 -4
- package/dist/cjs/Typography/Typography.styles.cjs +2 -1
- package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +0 -3
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +0 -4
- package/dist/cjs/hooks/useFocus.cjs +38 -0
- package/dist/cjs/index.cjs +9 -4
- package/dist/cjs/utils/Callout.cjs +134 -0
- package/dist/cjs/utils/focusUtils.cjs +0 -4
- package/dist/esm/ActionsGeneric/ActionsGeneric.js +2 -3
- package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/AppSwitcher/Action/Action.styles.js +2 -2
- package/dist/esm/AppSwitcher/Action/Action.styles.js.map +1 -1
- package/dist/esm/AvatarGroup/AvatarGroupContext.js +1 -1
- package/dist/esm/Banner/Banner.js +5 -5
- package/dist/esm/Banner/Banner.js.map +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.js +60 -96
- package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.styles.js +18 -46
- package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
- package/dist/esm/BaseCheckBox/BaseCheckBox.js +1 -1
- package/dist/esm/BaseDropdown/BaseDropdown.js +3 -3
- package/dist/esm/BaseDropdown/BaseDropdown.styles.js +1 -2
- package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
- package/dist/esm/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/BaseInput/BaseInput.styles.js +1 -1
- package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
- package/dist/esm/BaseInput/validations.js +2 -1
- package/dist/esm/BaseInput/validations.js.map +1 -1
- package/dist/esm/BaseRadio/BaseRadio.js +1 -1
- package/dist/esm/Button/Button.js +3 -4
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Button/Button.styles.js +0 -6
- package/dist/esm/Button/Button.styles.js.map +1 -1
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js +1 -1
- package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/esm/ColorPicker/ColorPicker.js +1 -1
- package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/DatePicker/utils.js +1 -1
- package/dist/esm/Dialog/context.js +1 -1
- package/dist/esm/DotPagination/DotPagination.js +1 -1
- package/dist/esm/DotPagination/DotPagination.styles.js +3 -0
- package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
- package/dist/esm/FilterGroup/FilterContent/FilterContent.js +1 -1
- package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
- package/dist/esm/FilterGroup/FilterGroupContext.js +1 -1
- package/dist/esm/Focus/Focus.js +1 -1
- package/dist/esm/FormElement/Adornment/Adornment.js +15 -36
- package/dist/esm/FormElement/Adornment/Adornment.js.map +1 -1
- package/dist/esm/FormElement/Adornment/Adornment.styles.js +12 -21
- package/dist/esm/FormElement/Adornment/Adornment.styles.js.map +1 -1
- package/dist/esm/Header/Navigation/useSelectionPath.js.map +1 -1
- package/dist/esm/IconContainer/IconContainer.js +81 -0
- package/dist/esm/IconContainer/IconContainer.js.map +1 -0
- package/dist/esm/Input/Input.js +30 -52
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/Input/Input.styles.js +1 -0
- package/dist/esm/Input/Input.styles.js.map +1 -1
- package/dist/esm/List/List.js +1 -1
- package/dist/esm/ListContainer/ListItem/ListItem.styles.js +0 -6
- package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
- package/dist/esm/Loading/Loading.js +1 -2
- package/dist/esm/Loading/Loading.js.map +1 -1
- package/dist/esm/Loading/Loading.styles.js +3 -1
- package/dist/esm/Loading/Loading.styles.js.map +1 -1
- package/dist/esm/Pagination/Pagination.styles.js +5 -5
- package/dist/esm/Pagination/Select.js +1 -1
- package/dist/esm/QueryBuilder/Context.js +1 -1
- package/dist/esm/QueryBuilder/QueryBuilder.js +1 -1
- package/dist/esm/QueryBuilder/utils/index.js +1 -1
- package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/SelectionList/SelectionList.js.map +1 -1
- package/dist/esm/Slider/Slider.js +1 -1
- package/dist/esm/Slider/Slider.js.map +1 -1
- package/dist/esm/Snackbar/Snackbar.js +6 -5
- package/dist/esm/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js +23 -29
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js +26 -56
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
- package/dist/esm/SnackbarProvider/SnackbarProvider.js +2 -2
- package/dist/esm/Table/Table.js.map +1 -1
- package/dist/esm/Table/TableBody/TableBody.js +16 -17
- package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/{TableSection → Table/TableSection}/TableSection.js +2 -2
- package/dist/esm/Table/TableSection/TableSection.js.map +1 -0
- package/dist/esm/{TableSection → Table/TableSection}/TableSection.styles.js +25 -25
- package/dist/esm/Table/TableSection/TableSection.styles.js.map +1 -0
- package/dist/esm/Table/hooks/useHvRowExpand.js +3 -3
- package/dist/esm/Table/hooks/useHvRowExpand.js.map +1 -1
- package/dist/esm/Tabs/Tab/Tab.styles.js +0 -3
- package/dist/esm/Tabs/Tab/Tab.styles.js.map +1 -1
- package/dist/esm/Tag/Tag.js +1 -1
- package/dist/esm/Tag/Tag.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.js +103 -169
- package/dist/esm/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.styles.js +45 -106
- package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
- package/dist/esm/TextArea/TextArea.js +1 -3
- package/dist/esm/TextArea/TextArea.js.map +1 -1
- package/dist/esm/TimePicker/TimePicker.js +1 -0
- package/dist/esm/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/TreeView/internals/TreeViewProvider.js +1 -1
- package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js +1 -1
- package/dist/esm/Typography/Typography.styles.js +2 -1
- package/dist/esm/Typography/Typography.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +0 -3
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +0 -4
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
- package/dist/esm/hooks/useFocus.js +38 -0
- package/dist/esm/hooks/useFocus.js.map +1 -0
- package/dist/esm/hooks/useScrollTo.js.map +1 -1
- package/dist/esm/index.js +56 -51
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/Callout.js +132 -0
- package/dist/esm/utils/Callout.js.map +1 -0
- package/dist/esm/utils/document.js.map +1 -1
- package/dist/esm/utils/focusUtils.js +0 -4
- package/dist/esm/utils/focusUtils.js.map +1 -1
- package/dist/types/index.d.ts +677 -670
- package/package.json +8 -8
- package/dist/esm/TableSection/TableSection.js.map +0 -1
- package/dist/esm/TableSection/TableSection.styles.js.map +0 -1
|
@@ -2,50 +2,34 @@
|
|
|
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
|
|
6
|
-
require("../BaseInput/BaseInput.cjs");
|
|
7
|
-
const Suggestions_styles = require("../FormElement/Suggestions/Suggestions.styles.cjs");
|
|
5
|
+
const focusUtils = require("../utils/focusUtils.cjs");
|
|
8
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTagsInput", {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
listItemGutters: { padding: "0 5px" },
|
|
14
|
-
listItemRoot: {
|
|
15
|
-
marginBottom: 2,
|
|
16
|
-
height: 24,
|
|
17
|
-
lineHeight: "24px",
|
|
18
|
-
"&:not(:last-child)": {
|
|
19
|
-
marginBottom: 2
|
|
20
|
-
},
|
|
21
|
-
"&$singleLine": {
|
|
22
|
-
display: "table-cell",
|
|
23
|
-
paddingTop: "2px"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
7
|
+
/** @deprecated unused */
|
|
8
|
+
listItemGutters: {},
|
|
9
|
+
/** @deprecated use `chipRoot` */
|
|
10
|
+
listItemRoot: {},
|
|
26
11
|
root: { display: "inline-block", width: "100%" },
|
|
12
|
+
// TODO: consider renaming this
|
|
27
13
|
chipRoot: {
|
|
28
14
|
maxWidth: "none"
|
|
29
15
|
},
|
|
30
16
|
disabled: {
|
|
31
17
|
"& $tagsList": {
|
|
32
18
|
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
border: `1px solid ${uikitStyles.theme.colors.atmo4}`
|
|
19
|
+
"&,:hover": {
|
|
20
|
+
borderColor: uikitStyles.theme.colors.atmo4
|
|
36
21
|
}
|
|
37
22
|
}
|
|
38
23
|
},
|
|
39
24
|
readOnly: {
|
|
40
25
|
"& $tagsList": {
|
|
41
26
|
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary_60}`
|
|
27
|
+
"&,:hover": {
|
|
28
|
+
borderColor: uikitStyles.theme.colors.secondary_60
|
|
45
29
|
}
|
|
46
30
|
}
|
|
47
31
|
},
|
|
48
|
-
resizable: { width: "auto", resize: "both", overflow: "auto" },
|
|
32
|
+
resizable: { width: "auto", resize: "both", clear: "both", overflow: "auto" },
|
|
49
33
|
invalid: {},
|
|
50
34
|
labelContainer: { float: "left", display: "flex", alignItems: "flex-start" },
|
|
51
35
|
label: {},
|
|
@@ -58,112 +42,67 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTagsInput
|
|
|
58
42
|
},
|
|
59
43
|
tagsList: {
|
|
60
44
|
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
61
46
|
alignContent: "flex-start",
|
|
62
|
-
|
|
63
|
-
|
|
47
|
+
gap: uikitStyles.theme.spacing("xxs", "xs"),
|
|
48
|
+
cursor: "text",
|
|
64
49
|
width: "100%",
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
padding: 5,
|
|
50
|
+
minHeight: 32,
|
|
51
|
+
padding: uikitStyles.theme.spacing("xxs", "xs"),
|
|
68
52
|
overflow: "auto",
|
|
69
53
|
position: "relative",
|
|
70
54
|
flexDirection: "row",
|
|
71
55
|
flexWrap: "wrap",
|
|
72
56
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
73
|
-
|
|
57
|
+
borderWidth: 1,
|
|
58
|
+
borderColor: uikitStyles.theme.colors.secondary_80,
|
|
74
59
|
borderRadius: uikitStyles.theme.radii.base,
|
|
75
60
|
"&:hover": {
|
|
76
|
-
|
|
77
|
-
border: `1px solid ${uikitStyles.theme.colors.primary}`
|
|
78
|
-
},
|
|
79
|
-
[`& .${BaseInput_styles.staticClasses.inputRoot}`]: {
|
|
80
|
-
border: "none"
|
|
61
|
+
borderColor: uikitStyles.theme.colors.primary
|
|
81
62
|
},
|
|
82
|
-
"&:focus
|
|
83
|
-
|
|
84
|
-
outlineStyle: "solid",
|
|
85
|
-
outlineWidth: "0px",
|
|
86
|
-
outlineOffset: "-1px",
|
|
87
|
-
boxShadow: "0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)"
|
|
63
|
+
"&:focus-within, &:focus-visible": {
|
|
64
|
+
...focusUtils.outlineStyles
|
|
88
65
|
},
|
|
89
66
|
"&$singleLine": {
|
|
90
|
-
|
|
91
|
-
overflowY: "hidden",
|
|
92
|
-
height: 32,
|
|
93
|
-
display: "table-row",
|
|
94
|
-
paddingTop: 0
|
|
67
|
+
flexWrap: "nowrap"
|
|
95
68
|
},
|
|
96
69
|
"&$error": {
|
|
97
|
-
|
|
70
|
+
borderColor: uikitStyles.theme.colors.negative_120
|
|
98
71
|
},
|
|
99
72
|
"&$invalid": {
|
|
100
|
-
|
|
73
|
+
borderColor: uikitStyles.theme.colors.negative_120
|
|
101
74
|
}
|
|
102
75
|
},
|
|
103
|
-
|
|
76
|
+
/** @deprecated use `classes.input` instead */
|
|
77
|
+
tagInputContainerRoot: {},
|
|
78
|
+
/** @deprecated use `classes.input` instead */
|
|
79
|
+
tagInputRoot: {},
|
|
80
|
+
input: {
|
|
104
81
|
display: "flex",
|
|
105
|
-
|
|
106
|
-
height:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
tagInputRoot: {
|
|
117
|
-
[`& .${BaseInput_styles.staticClasses.root}`]: {
|
|
118
|
-
width: "100%",
|
|
119
|
-
border: "none"
|
|
120
|
-
},
|
|
121
|
-
[`&& .${BaseInput_styles.staticClasses.inputRoot}`]: {
|
|
122
|
-
marginLeft: 0,
|
|
123
|
-
marginRight: 0,
|
|
124
|
-
flex: "1 1 auto",
|
|
125
|
-
height: 24,
|
|
126
|
-
lineHeight: "24px",
|
|
127
|
-
padding: 0,
|
|
128
|
-
border: "none"
|
|
129
|
-
},
|
|
130
|
-
[`& .${BaseInput_styles.staticClasses.inputRootFocused}`]: {
|
|
131
|
-
outline: "none",
|
|
132
|
-
boxShadow: "none"
|
|
133
|
-
},
|
|
134
|
-
[`& .${BaseInput_styles.staticClasses.root} .${BaseInput_styles.staticClasses.inputRootReadOnly}`]: {
|
|
135
|
-
backgroundColor: "transparent",
|
|
136
|
-
border: "none",
|
|
137
|
-
"&:hover": {
|
|
138
|
-
border: "none"
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
[`&& .${BaseInput_styles.staticClasses.input}`]: {
|
|
142
|
-
marginLeft: 0
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
tagSelected: {
|
|
146
|
-
outlineColor: "#52A8EC",
|
|
147
|
-
outlineStyle: "solid",
|
|
148
|
-
outlineWidth: "0px",
|
|
149
|
-
outlineOffset: "-1px",
|
|
150
|
-
boxShadow: "0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)"
|
|
82
|
+
flex: "1 0 auto",
|
|
83
|
+
height: "auto",
|
|
84
|
+
width: 0,
|
|
85
|
+
minWidth: 60,
|
|
86
|
+
border: "none",
|
|
87
|
+
margin: 0,
|
|
88
|
+
padding: 0,
|
|
89
|
+
...uikitStyles.theme.typography.caption1,
|
|
90
|
+
backgroundColor: "transparent",
|
|
91
|
+
outline: "none",
|
|
92
|
+
boxShadow: "none"
|
|
151
93
|
},
|
|
94
|
+
/** @deprecated unused. use `:focus` or `:focus-visible` instead */
|
|
95
|
+
tagSelected: {},
|
|
152
96
|
/** @deprecated unused. use `::after` instead */
|
|
153
97
|
tagInputBorderContainer: {},
|
|
98
|
+
/** @deprecated unused. use `:focus` or `:focus-visible` instead */
|
|
154
99
|
tagInputRootFocused: {},
|
|
100
|
+
/** @deprecated unused */
|
|
155
101
|
tagInputRootEmpty: {},
|
|
156
102
|
singleLine: {},
|
|
157
103
|
error: { float: "left" },
|
|
158
104
|
inputExtension: {},
|
|
159
|
-
suggestionsContainer: {
|
|
160
|
-
width: "100%",
|
|
161
|
-
position: "relative",
|
|
162
|
-
top: 59,
|
|
163
|
-
[`& .${Suggestions_styles.staticClasses.root} .${Suggestions_styles.staticClasses.list} &`]: {
|
|
164
|
-
width: "100%"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
105
|
+
suggestionsContainer: {},
|
|
167
106
|
suggestionList: {}
|
|
168
107
|
});
|
|
169
108
|
exports.staticClasses = staticClasses;
|
|
@@ -83,7 +83,6 @@ const HvTextArea = React.forwardRef(function HvTextArea2(props, ref) {
|
|
|
83
83
|
const performValidation = React.useCallback(() => {
|
|
84
84
|
const inputValidity = validations.validateInput(
|
|
85
85
|
inputRef.current,
|
|
86
|
-
String(value),
|
|
87
86
|
required,
|
|
88
87
|
minCharQuantity,
|
|
89
88
|
maxCharQuantity,
|
|
@@ -104,8 +103,7 @@ const HvTextArea = React.forwardRef(function HvTextArea2(props, ref) {
|
|
|
104
103
|
required,
|
|
105
104
|
setValidationMessage,
|
|
106
105
|
setValidationState,
|
|
107
|
-
validation
|
|
108
|
-
value
|
|
106
|
+
validation
|
|
109
107
|
]);
|
|
110
108
|
const limitValue = (currentValue) => {
|
|
111
109
|
if (currentValue === void 0 || !blockMax) return currentValue;
|
|
@@ -3,12 +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 date = require("@internationalized/date");
|
|
6
|
-
const utils = require("@mui/material/utils");
|
|
6
|
+
const utils$1 = require("@mui/material/utils");
|
|
7
7
|
const datepicker$1 = require("@react-aria/datepicker");
|
|
8
8
|
const datepicker = require("@react-stately/datepicker");
|
|
9
9
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
10
10
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
11
|
-
const utils
|
|
11
|
+
const utils = require("../Calendar/utils.cjs");
|
|
12
12
|
const useControlled = require("../hooks/useControlled.cjs");
|
|
13
13
|
const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
14
14
|
const setId = require("../utils/setId.cjs");
|
|
@@ -52,7 +52,7 @@ const HvTimePicker = React.forwardRef(
|
|
|
52
52
|
timeFormat,
|
|
53
53
|
showSeconds,
|
|
54
54
|
disableExpand,
|
|
55
|
-
locale = utils
|
|
55
|
+
locale = utils.DEFAULT_LOCALE,
|
|
56
56
|
onToggle,
|
|
57
57
|
onChange,
|
|
58
58
|
// misc properties:
|
|
@@ -65,7 +65,7 @@ const HvTimePicker = React.forwardRef(
|
|
|
65
65
|
const { classes, cx } = TimePicker_styles.useClasses(classesProp);
|
|
66
66
|
const timeFieldRef = React.useRef(null);
|
|
67
67
|
const { ref: refProp, ...otherDropdownProps } = dropdownProps;
|
|
68
|
-
const dropdownForkedRef = utils.useForkRef(ref, refProp);
|
|
68
|
+
const dropdownForkedRef = utils$1.useForkRef(ref, refProp);
|
|
69
69
|
const stateProps = {
|
|
70
70
|
value: toTime(valueProp),
|
|
71
71
|
defaultValue: toTime(defaultValueProp),
|
|
@@ -77,6 +77,7 @@ const HvTimePicker = React.forwardRef(
|
|
|
77
77
|
granularity: showSeconds === false ? "minute" : "second",
|
|
78
78
|
hourCycle: timeFormat === "12" ? 12 : 24,
|
|
79
79
|
onChange: (value) => {
|
|
80
|
+
if (!value) return;
|
|
80
81
|
const { hour: hours, minute: minutes, second: seconds } = value;
|
|
81
82
|
onChange?.({ hours, minutes, seconds });
|
|
82
83
|
}
|
|
@@ -4,7 +4,8 @@ const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
5
|
const { useClasses, staticClasses } = uikitReactUtils.createClasses("HvTypography", {
|
|
6
6
|
root: {
|
|
7
|
-
fontFamily: uikitStyles.theme.fontFamily.body
|
|
7
|
+
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
8
|
+
color: "inherit"
|
|
8
9
|
},
|
|
9
10
|
disabled: {
|
|
10
11
|
color: uikitStyles.theme.colors.secondary_60
|
|
@@ -42,7 +42,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
42
42
|
width: "100%",
|
|
43
43
|
display: "flex",
|
|
44
44
|
justifyContent: "flex-start",
|
|
45
|
-
color: "inherit",
|
|
46
45
|
alignItems: "center",
|
|
47
46
|
height: "32px",
|
|
48
47
|
borderLeft: `4px solid transparent`,
|
|
@@ -128,9 +127,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
128
127
|
},
|
|
129
128
|
icon: {
|
|
130
129
|
display: "flex",
|
|
131
|
-
"& .color0": {
|
|
132
|
-
fill: "currentColor"
|
|
133
|
-
},
|
|
134
130
|
"> div:first-of-type": {
|
|
135
131
|
marginLeft: "var(--icon-margin-left)"
|
|
136
132
|
},
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const document = require("../utils/document.cjs");
|
|
5
|
+
const getActiveEl = () => document.getDocument()?.activeElement || null;
|
|
6
|
+
function makeFocusUtils(containerRef) {
|
|
7
|
+
function focus(el, checkFocus = true) {
|
|
8
|
+
if (!checkFocus || containerRef.current?.contains(getActiveEl())) {
|
|
9
|
+
el?.focus();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
focusPrevious() {
|
|
14
|
+
focus(getActiveEl()?.previousElementSibling);
|
|
15
|
+
},
|
|
16
|
+
focusNext() {
|
|
17
|
+
focus(getActiveEl()?.nextElementSibling);
|
|
18
|
+
},
|
|
19
|
+
focusFirst() {
|
|
20
|
+
focus(getActiveEl()?.parentElement?.firstElementChild);
|
|
21
|
+
},
|
|
22
|
+
focusLast() {
|
|
23
|
+
focus(getActiveEl()?.parentElement?.lastElementChild);
|
|
24
|
+
},
|
|
25
|
+
focusChild(index) {
|
|
26
|
+
focus(containerRef.current?.children[index], false);
|
|
27
|
+
},
|
|
28
|
+
focusSibling(index) {
|
|
29
|
+
focus(getActiveEl()?.parentElement?.children[index]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function useFocus({
|
|
34
|
+
containerRef
|
|
35
|
+
}) {
|
|
36
|
+
return React.useMemo(() => makeFocusUtils(containerRef), [containerRef]);
|
|
37
|
+
}
|
|
38
|
+
exports.useFocus = useFocus;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -236,6 +236,8 @@ const Table_styles = require("./Table/Table.styles.cjs");
|
|
|
236
236
|
const Table = require("./Table/Table.cjs");
|
|
237
237
|
const TableContainer_styles = require("./Table/TableContainer/TableContainer.styles.cjs");
|
|
238
238
|
const TableContainer = require("./Table/TableContainer/TableContainer.cjs");
|
|
239
|
+
const TableSection_styles = require("./Table/TableSection/TableSection.styles.cjs");
|
|
240
|
+
const TableSection = require("./Table/TableSection/TableSection.cjs");
|
|
239
241
|
const TableBody_styles = require("./Table/TableBody/TableBody.styles.cjs");
|
|
240
242
|
const TableBody = require("./Table/TableBody/TableBody.cjs");
|
|
241
243
|
const TableHead_styles = require("./Table/TableHead/TableHead.styles.cjs");
|
|
@@ -302,9 +304,8 @@ const TreeView$1 = require("./VerticalNavigation/TreeView/TreeView.cjs");
|
|
|
302
304
|
const TreeViewItem_styles = require("./VerticalNavigation/TreeView/TreeViewItem.styles.cjs");
|
|
303
305
|
const TreeViewItem = require("./VerticalNavigation/TreeView/TreeViewItem.cjs");
|
|
304
306
|
const VerticalNavigationContext = require("./VerticalNavigation/VerticalNavigationContext.cjs");
|
|
305
|
-
const TableSection_styles = require("./TableSection/TableSection.styles.cjs");
|
|
306
|
-
const TableSection = require("./TableSection/TableSection.cjs");
|
|
307
307
|
const IconButton = require("./IconButton/IconButton.cjs");
|
|
308
|
+
const IconContainer = require("./IconContainer/IconContainer.cjs");
|
|
308
309
|
const Skeleton_styles = require("./Skeleton/Skeleton.styles.cjs");
|
|
309
310
|
const Skeleton = require("./Skeleton/Skeleton.cjs");
|
|
310
311
|
const uikitReactShared = require("@hitachivantara/uikit-react-shared");
|
|
@@ -595,6 +596,8 @@ exports.tableClasses = Table_styles.staticClasses;
|
|
|
595
596
|
exports.HvTable = Table.HvTable;
|
|
596
597
|
exports.tableContainerClasses = TableContainer_styles.staticClasses;
|
|
597
598
|
exports.HvTableContainer = TableContainer.HvTableContainer;
|
|
599
|
+
exports.tableSectionClasses = TableSection_styles.staticClasses;
|
|
600
|
+
exports.HvTableSection = TableSection.HvTableSection;
|
|
598
601
|
exports.tableBodyClasses = TableBody_styles.staticClasses;
|
|
599
602
|
exports.HvTableBody = TableBody.HvTableBody;
|
|
600
603
|
exports.tableHeadClasses = TableHead_styles.staticClasses;
|
|
@@ -677,9 +680,11 @@ exports.HvVerticalNavigationTreeView = TreeView$1.HvVerticalNavigationTreeView;
|
|
|
677
680
|
exports.treeViewItemClasses = TreeViewItem_styles.staticClasses;
|
|
678
681
|
exports.HvVerticalNavigationTreeViewItem = TreeViewItem.HvVerticalNavigationTreeViewItem;
|
|
679
682
|
exports.VerticalNavigationContext = VerticalNavigationContext.VerticalNavigationContext;
|
|
680
|
-
exports.tableSectionClasses = TableSection_styles.staticClasses;
|
|
681
|
-
exports.HvTableSection = TableSection.HvTableSection;
|
|
682
683
|
exports.HvIconButton = IconButton.HvIconButton;
|
|
684
|
+
exports.HvIconContainer = IconContainer.HvIconContainer;
|
|
685
|
+
exports.iconContainerClasses = IconContainer.staticClasses;
|
|
686
|
+
exports.staticClasses = IconContainer.staticClasses;
|
|
687
|
+
exports.useClasses = IconContainer.useClasses;
|
|
683
688
|
exports.skeletonClasses = Skeleton_styles.staticClasses;
|
|
684
689
|
exports.HvSkeleton = Skeleton.HvSkeleton;
|
|
685
690
|
Object.defineProperty(exports, "EmotionContext", {
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const SnackbarContent = require("@mui/material/SnackbarContent");
|
|
6
|
+
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
7
|
+
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
8
|
+
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
9
|
+
const iconVariant = require("./iconVariant.cjs");
|
|
10
|
+
const ActionsGeneric = require("../ActionsGeneric/ActionsGeneric.cjs");
|
|
11
|
+
const Button = require("../Button/Button.cjs");
|
|
12
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
13
|
+
const SnackbarContent__default = /* @__PURE__ */ _interopDefault(SnackbarContent);
|
|
14
|
+
const { useClasses, staticClasses } = uikitReactUtils.createClasses("HvCallout", {
|
|
15
|
+
root: {
|
|
16
|
+
position: "relative",
|
|
17
|
+
boxShadow: "none",
|
|
18
|
+
flexWrap: "nowrap",
|
|
19
|
+
padding: 0
|
|
20
|
+
},
|
|
21
|
+
success: {
|
|
22
|
+
backgroundColor: uikitStyles.theme.colors.positive_20
|
|
23
|
+
},
|
|
24
|
+
warning: {
|
|
25
|
+
backgroundColor: uikitStyles.theme.colors.warning_20
|
|
26
|
+
},
|
|
27
|
+
error: {
|
|
28
|
+
backgroundColor: uikitStyles.theme.colors.negative_20
|
|
29
|
+
},
|
|
30
|
+
default: {
|
|
31
|
+
backgroundColor: uikitStyles.theme.colors.neutral_20
|
|
32
|
+
},
|
|
33
|
+
message: {
|
|
34
|
+
display: "flex",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
padding: 0,
|
|
37
|
+
color: uikitStyles.theme.colors.base_dark
|
|
38
|
+
},
|
|
39
|
+
messageContent: {
|
|
40
|
+
textWrap: "balance",
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
wordBreak: "break-word"
|
|
43
|
+
},
|
|
44
|
+
messageIcon: {
|
|
45
|
+
"& svg .color0": {
|
|
46
|
+
fill: "inherit"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
action: {
|
|
50
|
+
marginRight: 0
|
|
51
|
+
},
|
|
52
|
+
actionContent: {
|
|
53
|
+
display: "flex",
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
height: "100%",
|
|
56
|
+
justifyContent: "space-between",
|
|
57
|
+
gap: uikitStyles.theme.space.xs
|
|
58
|
+
},
|
|
59
|
+
actionCustom: {
|
|
60
|
+
flex: "0 0 auto"
|
|
61
|
+
},
|
|
62
|
+
actionClose: {
|
|
63
|
+
alignSelf: "flex-end"
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const HvCallout = React.forwardRef(function HvCallout2(props, ref) {
|
|
67
|
+
const {
|
|
68
|
+
id,
|
|
69
|
+
classes: classesProp,
|
|
70
|
+
className,
|
|
71
|
+
showClose,
|
|
72
|
+
showIcon,
|
|
73
|
+
customIcon,
|
|
74
|
+
variant = "default",
|
|
75
|
+
onClose,
|
|
76
|
+
actions,
|
|
77
|
+
onAction,
|
|
78
|
+
actionsPosition: actionsPositionProp = "auto",
|
|
79
|
+
children,
|
|
80
|
+
actionProps,
|
|
81
|
+
...others
|
|
82
|
+
} = uikitReactUtils.useDefaultProps("HvCallout", props);
|
|
83
|
+
const { classes, cx } = useClasses(classesProp, false);
|
|
84
|
+
const { activeTheme } = uikitReactUtils.useTheme();
|
|
85
|
+
const icon = customIcon || showIcon && iconVariant.iconVariant(variant, "inherit");
|
|
86
|
+
const actionsPosition = actionsPositionProp === "auto" ? "inline" : actionsPositionProp;
|
|
87
|
+
const actionsContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
ActionsGeneric.HvActionsGeneric,
|
|
89
|
+
{
|
|
90
|
+
id,
|
|
91
|
+
className: classes.actionCustom,
|
|
92
|
+
variant: showClose ? "semantic" : activeTheme?.snackbar.actionButtonVariant,
|
|
93
|
+
actions,
|
|
94
|
+
onAction
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
const showCustomActions = actions && actionsPosition === "bottom-right";
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
SnackbarContent__default.default,
|
|
100
|
+
{
|
|
101
|
+
ref,
|
|
102
|
+
id,
|
|
103
|
+
classes: {
|
|
104
|
+
root: cx(classes.root, classes[variant], className),
|
|
105
|
+
message: classes.message,
|
|
106
|
+
action: classes.action
|
|
107
|
+
},
|
|
108
|
+
message: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
109
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.messageIcon, children: icon }),
|
|
110
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.messageContent, children }),
|
|
111
|
+
actions && actionsPosition === "inline" && actionsContent
|
|
112
|
+
] }),
|
|
113
|
+
action: (showClose || showCustomActions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.actionContent, children: [
|
|
114
|
+
showClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
115
|
+
Button.HvButton,
|
|
116
|
+
{
|
|
117
|
+
icon: true,
|
|
118
|
+
className: classes.actionClose,
|
|
119
|
+
variant: "semantic",
|
|
120
|
+
"aria-label": "Close",
|
|
121
|
+
onClick: (evt) => onClose?.(evt, "clickaway"),
|
|
122
|
+
...actionProps,
|
|
123
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Close, { size: "XS" })
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
showCustomActions && actionsContent
|
|
127
|
+
] }),
|
|
128
|
+
...others
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
exports.HvCallout = HvCallout;
|
|
133
|
+
exports.staticClasses = staticClasses;
|
|
134
|
+
exports.useClasses = useClasses;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const outlineStyles = {
|
|
4
|
-
outlineColor: "#52A8EC",
|
|
5
|
-
outlineStyle: "solid",
|
|
6
|
-
outlineWidth: "0px",
|
|
7
|
-
outlineOffset: "-1px",
|
|
8
4
|
boxShadow: "0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)"
|
|
9
5
|
};
|
|
10
6
|
exports.outlineStyles = outlineStyles;
|
|
@@ -5,9 +5,9 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
|
5
5
|
import { setId } from "../utils/setId.js";
|
|
6
6
|
import { useClasses } from "./ActionsGeneric.styles.js";
|
|
7
7
|
import { staticClasses } from "./ActionsGeneric.styles.js";
|
|
8
|
+
import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js";
|
|
8
9
|
import { HvIconButton } from "../IconButton/IconButton.js";
|
|
9
10
|
import { HvButton } from "../Button/Button.js";
|
|
10
|
-
import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js";
|
|
11
11
|
const HvActionsGeneric = forwardRef(function HvActionsGeneric2(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
id: idProp,
|
|
@@ -63,8 +63,7 @@ const HvActionsGeneric = forwardRef(function HvActionsGeneric2(props, ref) {
|
|
|
63
63
|
const renderActionsGrid = () => {
|
|
64
64
|
const actsVisible = actions.slice(0, maxVisibleActions);
|
|
65
65
|
const actsDropdown = actions.slice(maxVisibleActions);
|
|
66
|
-
const
|
|
67
|
-
const iconColor = disabled && "secondary_60" || semantic && "base_dark" || void 0;
|
|
66
|
+
const iconColor = variant === "semantic" && "base_dark" || void 0;
|
|
68
67
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
68
|
actsVisible.map((action, idx) => renderButton(action, idx)),
|
|
70
69
|
/* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsGeneric.js","sources":["../../../src/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from \"react\";\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps, HvButtonVariant } from \"../Button\";\nimport { HvDropDownMenu, HvDropDownMenuProps } from \"../DropDownMenu\";\nimport { HvIconButton } from \"../IconButton\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./ActionsGeneric.styles\";\n\nexport { staticClasses as actionsGenericClasses };\n\nexport type HvActionsGenericClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvActionGeneric {\n /** Action id. */\n id: string;\n /** Action label. */\n label: string;\n /** Action icon. */\n icon?:\n | React.ReactNode\n | ((params: { isDisabled?: boolean }) => React.ReactNode);\n /** Whether the action is disabled or not. */\n disabled?: boolean;\n /** When set to `true`, the button will have the icon has its content and a tooltip with the label will appear when the button is visible and hovered. */\n iconOnly?: boolean;\n}\n\nexport interface HvActionsGenericProps extends HvBaseProps {\n /**\n * The button category for all actions.\n *\n * @deprecated Use `variant` instead.\n */\n category?: HvButtonVariant;\n /** The button variant for all actions. */\n variant?: HvButtonVariant;\n /** Whether the actions should be all disabled. */\n disabled?: boolean;\n /** Whether the actions should be all icon buttons when visible. */\n iconOnly?: boolean;\n /** The renderable content inside the actions slot of the footer, or an array of actions. */\n actions: React.ReactNode | HvActionGeneric[];\n /**\n * The callback function called when an action is triggered, receiving the `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric,\n ) => void;\n /** The callback function called when an action is triggered, receiving the `action` as parameter. */\n onAction?: (event: React.SyntheticEvent, action: HvActionGeneric) => void;\n /** The maximum number of visible actions before they're collapsed into a dropdown menu. */\n maxVisibleActions?: number;\n /** Props to be applied to the dropdown menu. */\n dropdownMenuProps?: Partial<HvDropDownMenuProps>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionsGenericClasses;\n}\n\nexport const HvActionsGeneric = forwardRef<\n React.ComponentRef<\"div\">,\n HvActionsGenericProps\n>(function HvActionsGeneric(props, ref) {\n const {\n id: idProp,\n classes: classesProp,\n className,\n category = \"secondaryGhost\", // TODO - remove and update variant default in v6\n variant: variantProp,\n disabled = false,\n actions = [],\n actionsCallback, // TODO - remove in v6\n onAction,\n maxVisibleActions = Infinity,\n iconOnly: iconOnlyProp,\n dropdownMenuProps: dropdownMenuPropsProp,\n ...others\n } = useDefaultProps(\"HvActionsGeneric\", props);\n\n const { onClick: onClickDropdownMenu, ...dropdownMenuProps } =\n dropdownMenuPropsProp || {};\n\n const variant = variantProp || category;\n\n const { classes, cx } = useClasses(classesProp);\n\n const handleCallback: HvActionsGenericProps[\"actionsCallback\"] = (\n event,\n id,\n action,\n ) => {\n actionsCallback?.(event, id, action);\n onAction?.(event, action);\n };\n\n if (!Array.isArray(actions)) return isValidElement(actions) ? actions : null;\n\n const renderButton = (action: HvActionGeneric, idx: number) => {\n const {\n disabled: actDisabled,\n id: actId,\n icon,\n label,\n iconOnly,\n ...other\n } = action;\n const actionId = setId(idProp, idx, \"action\", action.id);\n\n const renderedIcon = isValidElement(icon)\n ? icon\n : (icon as Function)?.({ isDisabled: disabled });\n\n const commonButtonProps: HvButtonProps = {\n id: actionId,\n variant,\n className: classes.button,\n disabled: actDisabled ?? disabled,\n onClick: (event) => handleCallback(event, idProp || \"\", action),\n ...other,\n };\n\n const key = actionId || idx;\n const isIcon = iconOnly ?? iconOnlyProp;\n\n if (isIcon) {\n return (\n <HvIconButton key={key} {...commonButtonProps} title={label}>\n {renderedIcon}\n </HvIconButton>\n );\n }\n\n return (\n <HvButton key={key} {...commonButtonProps} startIcon={renderedIcon}>\n {label}\n </HvButton>\n );\n };\n\n const renderActionsGrid = () => {\n const actsVisible = actions.slice(0, maxVisibleActions);\n const actsDropdown = actions.slice(maxVisibleActions);\n\n const
|
|
1
|
+
{"version":3,"file":"ActionsGeneric.js","sources":["../../../src/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from \"react\";\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps, HvButtonVariant } from \"../Button\";\nimport { HvDropDownMenu, HvDropDownMenuProps } from \"../DropDownMenu\";\nimport { HvIconButton } from \"../IconButton\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./ActionsGeneric.styles\";\n\nexport { staticClasses as actionsGenericClasses };\n\nexport type HvActionsGenericClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvActionGeneric {\n /** Action id. */\n id: string;\n /** Action label. */\n label: string;\n /** Action icon. */\n icon?:\n | React.ReactNode\n | ((params: { isDisabled?: boolean }) => React.ReactNode);\n /** Whether the action is disabled or not. */\n disabled?: boolean;\n /** When set to `true`, the button will have the icon has its content and a tooltip with the label will appear when the button is visible and hovered. */\n iconOnly?: boolean;\n}\n\nexport interface HvActionsGenericProps extends HvBaseProps {\n /**\n * The button category for all actions.\n *\n * @deprecated Use `variant` instead.\n */\n category?: HvButtonVariant;\n /** The button variant for all actions. */\n variant?: HvButtonVariant;\n /** Whether the actions should be all disabled. */\n disabled?: boolean;\n /** Whether the actions should be all icon buttons when visible. */\n iconOnly?: boolean;\n /** The renderable content inside the actions slot of the footer, or an array of actions. */\n actions: React.ReactNode | HvActionGeneric[];\n /**\n * The callback function called when an action is triggered, receiving the `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric,\n ) => void;\n /** The callback function called when an action is triggered, receiving the `action` as parameter. */\n onAction?: (event: React.SyntheticEvent, action: HvActionGeneric) => void;\n /** The maximum number of visible actions before they're collapsed into a dropdown menu. */\n maxVisibleActions?: number;\n /** Props to be applied to the dropdown menu. */\n dropdownMenuProps?: Partial<HvDropDownMenuProps>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionsGenericClasses;\n}\n\nexport const HvActionsGeneric = forwardRef<\n React.ComponentRef<\"div\">,\n HvActionsGenericProps\n>(function HvActionsGeneric(props, ref) {\n const {\n id: idProp,\n classes: classesProp,\n className,\n category = \"secondaryGhost\", // TODO - remove and update variant default in v6\n variant: variantProp,\n disabled = false,\n actions = [],\n actionsCallback, // TODO - remove in v6\n onAction,\n maxVisibleActions = Infinity,\n iconOnly: iconOnlyProp,\n dropdownMenuProps: dropdownMenuPropsProp,\n ...others\n } = useDefaultProps(\"HvActionsGeneric\", props);\n\n const { onClick: onClickDropdownMenu, ...dropdownMenuProps } =\n dropdownMenuPropsProp || {};\n\n const variant = variantProp || category;\n\n const { classes, cx } = useClasses(classesProp);\n\n const handleCallback: HvActionsGenericProps[\"actionsCallback\"] = (\n event,\n id,\n action,\n ) => {\n actionsCallback?.(event, id, action);\n onAction?.(event, action);\n };\n\n if (!Array.isArray(actions)) return isValidElement(actions) ? actions : null;\n\n const renderButton = (action: HvActionGeneric, idx: number) => {\n const {\n disabled: actDisabled,\n id: actId,\n icon,\n label,\n iconOnly,\n ...other\n } = action;\n const actionId = setId(idProp, idx, \"action\", action.id);\n\n const renderedIcon = isValidElement(icon)\n ? icon\n : (icon as Function)?.({ isDisabled: disabled });\n\n const commonButtonProps: HvButtonProps = {\n id: actionId,\n variant,\n className: classes.button,\n disabled: actDisabled ?? disabled,\n onClick: (event) => handleCallback(event, idProp || \"\", action),\n ...other,\n };\n\n const key = actionId || idx;\n const isIcon = iconOnly ?? iconOnlyProp;\n\n if (isIcon) {\n return (\n <HvIconButton key={key} {...commonButtonProps} title={label}>\n {renderedIcon}\n </HvIconButton>\n );\n }\n\n return (\n <HvButton key={key} {...commonButtonProps} startIcon={renderedIcon}>\n {label}\n </HvButton>\n );\n };\n\n const renderActionsGrid = () => {\n const actsVisible = actions.slice(0, maxVisibleActions);\n const actsDropdown = actions.slice(maxVisibleActions);\n\n const iconColor = (variant === \"semantic\" && \"base_dark\") || undefined;\n\n return (\n <>\n {actsVisible.map((action, idx) => renderButton(action, idx))}\n <HvDropDownMenu\n id={setId(idProp, \"menu\")}\n disabled={disabled}\n variant={variant}\n classes={{\n root: classes.dropDownMenu,\n icon: classes.dropDownMenuButton,\n iconSelected: classes.dropDownMenuButtonSelected,\n }}\n icon={<MoreOptionsVertical color={iconColor} />}\n placement=\"left\"\n onClick={(event, action) => {\n handleCallback(event, idProp || \"\", action as HvActionGeneric);\n onClickDropdownMenu?.(event, action);\n }}\n dataList={actsDropdown}\n keepOpened={false}\n disablePortal={false}\n {...dropdownMenuProps}\n />\n </>\n );\n };\n\n const actionOverflow = actions.length > maxVisibleActions;\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n { [classes.actionContainer]: actionOverflow },\n className,\n )}\n {...others}\n >\n {actionOverflow\n ? renderActionsGrid()\n : actions.map((action, idx) => renderButton(action, idx))}\n </div>\n );\n});\n"],"names":["HvActionsGeneric"],"mappings":";;;;;;;;;;AAoEO,MAAM,mBAAmB,WAG9B,SAASA,kBAAiB,OAAO,KAAK;AAChC,QAAA;AAAA,IACJ,IAAI;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,WAAW;AAAA;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU,CAAC;AAAA,IACX;AAAA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB,UAAU;AAAA,IACV,mBAAmB;AAAA,IACnB,GAAG;AAAA,EAAA,IACD,gBAAgB,oBAAoB,KAAK;AAE7C,QAAM,EAAE,SAAS,qBAAqB,GAAG,kBAAkB,IACzD,yBAAyB,CAAC;AAE5B,QAAM,UAAU,eAAe;AAE/B,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,iBAA2D,CAC/D,OACA,IACA,WACG;AACe,sBAAA,OAAO,IAAI,MAAM;AACnC,eAAW,OAAO,MAAM;AAAA,EAC1B;AAEI,MAAA,CAAC,MAAM,QAAQ,OAAO,EAAU,QAAA,eAAe,OAAO,IAAI,UAAU;AAElE,QAAA,eAAe,CAAC,QAAyB,QAAgB;AACvD,UAAA;AAAA,MACJ,UAAU;AAAA,MACV,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AACJ,UAAM,WAAW,MAAM,QAAQ,KAAK,UAAU,OAAO,EAAE;AAEjD,UAAA,eAAe,eAAe,IAAI,IACpC,OACC,OAAoB,EAAE,YAAY,UAAU;AAEjD,UAAM,oBAAmC;AAAA,MACvC,IAAI;AAAA,MACJ;AAAA,MACA,WAAW,QAAQ;AAAA,MACnB,UAAU,eAAe;AAAA,MACzB,SAAS,CAAC,UAAU,eAAe,OAAO,UAAU,IAAI,MAAM;AAAA,MAC9D,GAAG;AAAA,IACL;AAEA,UAAM,MAAM,YAAY;AACxB,UAAM,SAAS,YAAY;AAE3B,QAAI,QAAQ;AACV,iCACG,cAAwB,EAAA,GAAG,mBAAmB,OAAO,OACnD,0BADgB,GAEnB;AAAA,IAAA;AAIJ,+BACG,UAAoB,EAAA,GAAG,mBAAmB,WAAW,cACnD,mBADY,GAEf;AAAA,EAEJ;AAEA,QAAM,oBAAoB,MAAM;AAC9B,UAAM,cAAc,QAAQ,MAAM,GAAG,iBAAiB;AAChD,UAAA,eAAe,QAAQ,MAAM,iBAAiB;AAE9C,UAAA,YAAa,YAAY,cAAc,eAAgB;AAE7D,WAEK,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,YAAY,IAAI,CAAC,QAAQ,QAAQ,aAAa,QAAQ,GAAG,CAAC;AAAA,MAC3D;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI,MAAM,QAAQ,MAAM;AAAA,UACxB;AAAA,UACA;AAAA,UACA,SAAS;AAAA,YACP,MAAM,QAAQ;AAAA,YACd,MAAM,QAAQ;AAAA,YACd,cAAc,QAAQ;AAAA,UACxB;AAAA,UACA,MAAM,oBAAC,qBAAoB,EAAA,OAAO,UAAW,CAAA;AAAA,UAC7C,WAAU;AAAA,UACV,SAAS,CAAC,OAAO,WAAW;AACX,2BAAA,OAAO,UAAU,IAAI,MAAyB;AAC7D,kCAAsB,OAAO,MAAM;AAAA,UACrC;AAAA,UACA,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,eAAe;AAAA,UACd,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN,GACF;AAAA,EAEJ;AAEM,QAAA,iBAAiB,QAAQ,SAAS;AAGtC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,EAAE,CAAC,QAAQ,eAAe,GAAG,eAAe;AAAA,QAC5C;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,UAAA,iBACG,kBAAkB,IAClB,QAAQ,IAAI,CAAC,QAAQ,QAAQ,aAAa,QAAQ,GAAG,CAAC;AAAA,IAAA;AAAA,EAC5D;AAEJ,CAAC;"}
|
|
@@ -24,7 +24,6 @@ const { staticClasses, useClasses } = createClasses(
|
|
|
24
24
|
borderLeft: `solid 2px ${theme.colors.secondary}`,
|
|
25
25
|
cursor: "pointer",
|
|
26
26
|
textDecoration: "inherit",
|
|
27
|
-
color: "inherit",
|
|
28
27
|
backgroundColor: "inherit",
|
|
29
28
|
"$disabled &": {
|
|
30
29
|
cursor: "not-allowed"
|
|
@@ -36,7 +35,8 @@ const { staticClasses, useClasses } = createClasses(
|
|
|
36
35
|
textAlign: "left",
|
|
37
36
|
margin: `0 ${theme.space.xs}`,
|
|
38
37
|
textWrap: "balance",
|
|
39
|
-
...theme.typography.label
|
|
38
|
+
...theme.typography.label,
|
|
39
|
+
color: "inherit"
|
|
40
40
|
},
|
|
41
41
|
titleAnchor: {
|
|
42
42
|
WebkitLineClamp: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.styles.js","sources":["../../../../src/AppSwitcher/Action/Action.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvAppSwitcher-Action\",\n {\n root: {\n width: \"100%\",\n maxWidth: 280,\n minHeight: 52,\n },\n icon: { display: \"flex\", minWidth: 40, justifyContent: \"center\" },\n iconUrl: { width: 32 },\n iconInfo: { minWidth: 32 },\n disabled: {},\n selected: {},\n typography: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n\n width: \"100%\",\n minHeight: 52,\n\n padding: `6px ${theme.space.xs}`,\n\n border: \"none\",\n borderLeft: `solid 2px ${theme.colors.secondary}`,\n\n cursor: \"pointer\",\n\n textDecoration: \"inherit\",\n
|
|
1
|
+
{"version":3,"file":"Action.styles.js","sources":["../../../../src/AppSwitcher/Action/Action.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvAppSwitcher-Action\",\n {\n root: {\n width: \"100%\",\n maxWidth: 280,\n minHeight: 52,\n },\n icon: { display: \"flex\", minWidth: 40, justifyContent: \"center\" },\n iconUrl: { width: 32 },\n iconInfo: { minWidth: 32 },\n disabled: {},\n selected: {},\n typography: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n\n width: \"100%\",\n minHeight: 52,\n\n padding: `6px ${theme.space.xs}`,\n\n border: \"none\",\n borderLeft: `solid 2px ${theme.colors.secondary}`,\n\n cursor: \"pointer\",\n\n textDecoration: \"inherit\",\n backgroundColor: \"inherit\",\n\n \"$disabled &\": {\n cursor: \"not-allowed\",\n },\n },\n title: {\n flexGrow: 1,\n whiteSpace: \"normal\",\n textAlign: \"left\",\n margin: `0 ${theme.space.xs}`,\n textWrap: \"balance\",\n ...theme.typography.label,\n color: \"inherit\",\n },\n titleAnchor: {\n WebkitLineClamp: 2,\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,eAAe,WAAA,IAAe;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,MAAM,EAAE,SAAS,QAAQ,UAAU,IAAI,gBAAgB,SAAS;AAAA,IAChE,SAAS,EAAE,OAAO,GAAG;AAAA,IACrB,UAAU,EAAE,UAAU,GAAG;AAAA,IACzB,UAAU,CAAC;AAAA,IACX,UAAU,CAAC;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MAEZ,OAAO;AAAA,MACP,WAAW;AAAA,MAEX,SAAS,OAAO,MAAM,MAAM,EAAE;AAAA,MAE9B,QAAQ;AAAA,MACR,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,MAE/C,QAAQ;AAAA,MAER,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MAEjB,eAAe;AAAA,QACb,QAAQ;AAAA,MAAA;AAAA,IAEZ;AAAA,IACA,OAAO;AAAA,MACL,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,QAAQ,KAAK,MAAM,MAAM,EAAE;AAAA,MAC3B,UAAU;AAAA,MACV,GAAG,MAAM,WAAW;AAAA,MACpB,OAAO;AAAA,IACT;AAAA,IACA,aAAa;AAAA,MACX,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ;"}
|