@hitachivantara/uikit-react-core 5.80.0 → 5.80.2
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 +5 -5
- package/dist/cjs/ActionBar/ActionBar.cjs +4 -3
- package/dist/cjs/ActionsGeneric/ActionsGeneric.cjs +3 -2
- package/dist/cjs/AppSwitcher/AppSwitcher.cjs +3 -2
- package/dist/cjs/Avatar/Avatar.cjs +1 -1
- package/dist/cjs/AvatarGroup/AvatarGroup.cjs +1 -1
- package/dist/cjs/Badge/Badge.cjs +1 -1
- package/dist/cjs/Banner/Banner.cjs +3 -2
- package/dist/cjs/Banner/BannerContent/BannerContent.cjs +1 -1
- package/dist/cjs/BaseCheckBox/BaseCheckBox.cjs +1 -2
- package/dist/cjs/BaseDropdown/BaseDropdown.cjs +1 -1
- package/dist/cjs/BaseInput/BaseInput.cjs +5 -3
- package/dist/cjs/BaseRadio/BaseRadio.cjs +1 -2
- package/dist/cjs/BaseSwitch/BaseSwitch.cjs +1 -2
- package/dist/cjs/BreadCrumb/BreadCrumb.cjs +3 -3
- package/dist/cjs/BulkActions/BulkActions.cjs +4 -2
- package/dist/cjs/BulkActions/BulkActions.styles.cjs +1 -3
- package/dist/cjs/Button/Button.styles.cjs +5 -2
- package/dist/cjs/Card/Card.cjs +3 -2
- package/dist/cjs/Carousel/Carousel.cjs +3 -2
- package/dist/cjs/Carousel/CarouselThumbnails.cjs +1 -1
- package/dist/cjs/CheckBox/CheckBox.cjs +1 -1
- package/dist/cjs/CheckBoxGroup/CheckBoxGroup.cjs +1 -1
- package/dist/cjs/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/cjs/Container/Container.cjs +1 -1
- package/dist/cjs/DatePicker/DatePicker.cjs +1 -1
- package/dist/cjs/Drawer/Drawer.cjs +4 -2
- package/dist/cjs/DropDownMenu/DropDownMenu.cjs +3 -2
- package/dist/cjs/DropdownButton/DropdownButton.cjs +1 -1
- package/dist/cjs/EmptyState/EmptyState.cjs +4 -3
- package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs +1 -1
- package/dist/cjs/FilterGroup/FilterGroup.cjs +1 -1
- package/dist/cjs/Footer/Footer.cjs +4 -2
- package/dist/cjs/GlobalActions/GlobalActions.cjs +4 -2
- package/dist/cjs/Grid/Grid.cjs +1 -1
- package/dist/cjs/Header/Actions/Actions.cjs +1 -1
- package/dist/cjs/Header/Brand/Brand.cjs +1 -1
- package/dist/cjs/Header/Header.cjs +4 -2
- package/dist/cjs/Header/Navigation/Navigation.cjs +1 -1
- package/dist/cjs/Input/Input.cjs +1 -1
- package/dist/cjs/ListContainer/ListContainer.cjs +1 -1
- package/dist/cjs/ListContainer/ListItem/ListItem.cjs +1 -1
- package/dist/cjs/Loading/Loading.cjs +4 -2
- package/dist/cjs/LoadingContainer/LoadingContainer.cjs +4 -3
- package/dist/cjs/Login/Login.cjs +4 -4
- package/dist/cjs/Pagination/Pagination.cjs +3 -3
- package/dist/cjs/Panel/Panel.cjs +1 -1
- package/dist/cjs/Panel/Panel.styles.cjs +2 -1
- package/dist/cjs/Radio/Radio.cjs +1 -1
- package/dist/cjs/RadioGroup/RadioGroup.cjs +1 -1
- package/dist/cjs/Section/Section.cjs +26 -31
- package/dist/cjs/Section/Section.styles.cjs +12 -8
- package/dist/cjs/Select/OptionGroup.cjs +1 -1
- package/dist/cjs/SelectionList/SelectionList.cjs +1 -1
- package/dist/cjs/Skeleton/Skeleton.styles.cjs +27 -32
- package/dist/cjs/Snackbar/Snackbar.cjs +27 -24
- package/dist/cjs/Switch/Switch.cjs +1 -1
- package/dist/cjs/Tab/Tab.cjs +4 -4
- package/dist/cjs/Tab/Tab.styles.cjs +5 -6
- package/dist/cjs/Table/Table.cjs +1 -1
- package/dist/cjs/Table/TableCell/TableCell.cjs +2 -2
- package/dist/cjs/Table/TableHeader/TableHeader.cjs +7 -6
- package/dist/cjs/TableSection/TableSection.cjs +1 -1
- package/dist/cjs/TableSection/TableSection.styles.cjs +16 -14
- package/dist/cjs/Tabs/Tabs.cjs +6 -6
- package/dist/cjs/Tabs/Tabs.styles.cjs +2 -14
- package/dist/cjs/Tag/Tag.cjs +1 -1
- package/dist/cjs/TagsInput/TagsInput.cjs +1 -1
- package/dist/cjs/TextArea/TextArea.cjs +1 -1
- package/dist/cjs/TimePicker/Placeholder.cjs +1 -1
- package/dist/cjs/TimePicker/TimePicker.cjs +1 -1
- package/dist/cjs/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/cjs/Tooltip/Tooltip.cjs +1 -1
- package/dist/cjs/TreeView/TreeItem/DefaultContent.cjs +1 -1
- package/dist/cjs/TreeView/TreeItem/TreeItem.cjs +1 -1
- package/dist/cjs/VerticalNavigation/TreeView/TreeView.cjs +1 -1
- package/dist/cjs/VerticalNavigation/VerticalNavigation.cjs +1 -1
- package/dist/cjs/providers/ThemeProvider.cjs +2 -1
- package/dist/cjs/utils/helpers.cjs +2 -2
- package/dist/esm/Accordion/Accordion.js +6 -6
- package/dist/esm/Accordion/Accordion.js.map +1 -1
- package/dist/esm/ActionBar/ActionBar.js +4 -3
- package/dist/esm/ActionBar/ActionBar.js.map +1 -1
- package/dist/esm/ActionsGeneric/ActionsGeneric.js +4 -3
- package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/AppSwitcher/AppSwitcher.js +4 -3
- package/dist/esm/AppSwitcher/AppSwitcher.js.map +1 -1
- package/dist/esm/Avatar/Avatar.js +1 -1
- package/dist/esm/Avatar/Avatar.js.map +1 -1
- package/dist/esm/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/esm/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/esm/Badge/Badge.js +1 -1
- package/dist/esm/Badge/Badge.js.map +1 -1
- package/dist/esm/Banner/Banner.js +4 -3
- package/dist/esm/Banner/Banner.js.map +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.js +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/BaseCheckBox/BaseCheckBox.js +1 -2
- package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
- package/dist/esm/BaseDropdown/BaseDropdown.js +1 -1
- package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
- package/dist/esm/BaseInput/BaseInput.js +6 -4
- package/dist/esm/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/BaseRadio/BaseRadio.js +1 -2
- package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
- package/dist/esm/BaseSwitch/BaseSwitch.js +1 -2
- package/dist/esm/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/esm/BreadCrumb/BreadCrumb.js +4 -4
- package/dist/esm/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/esm/BulkActions/BulkActions.js +4 -2
- package/dist/esm/BulkActions/BulkActions.js.map +1 -1
- package/dist/esm/BulkActions/BulkActions.styles.js +1 -3
- package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
- package/dist/esm/Button/Button.styles.js +5 -2
- package/dist/esm/Button/Button.styles.js.map +1 -1
- package/dist/esm/Card/Card.js +3 -2
- package/dist/esm/Card/Card.js.map +1 -1
- package/dist/esm/Carousel/Carousel.js +4 -3
- package/dist/esm/Carousel/Carousel.js.map +1 -1
- package/dist/esm/Carousel/CarouselThumbnails.js +1 -1
- package/dist/esm/Carousel/CarouselThumbnails.js.map +1 -1
- package/dist/esm/CheckBox/CheckBox.js +1 -1
- package/dist/esm/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/CheckBoxGroup/CheckBoxGroup.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/Container/Container.js +1 -1
- package/dist/esm/Container/Container.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.js +1 -1
- package/dist/esm/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/Drawer/Drawer.js +4 -2
- package/dist/esm/Drawer/Drawer.js.map +1 -1
- package/dist/esm/DropDownMenu/DropDownMenu.js +3 -2
- package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
- package/dist/esm/EmptyState/EmptyState.js +4 -3
- package/dist/esm/EmptyState/EmptyState.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/FilterGroup.js +1 -1
- package/dist/esm/FilterGroup/FilterGroup.js.map +1 -1
- package/dist/esm/Footer/Footer.js +4 -2
- package/dist/esm/Footer/Footer.js.map +1 -1
- package/dist/esm/Forms/Suggestions/Suggestions.js.map +1 -1
- package/dist/esm/GlobalActions/GlobalActions.js +4 -2
- package/dist/esm/GlobalActions/GlobalActions.js.map +1 -1
- package/dist/esm/Grid/Grid.js +1 -1
- package/dist/esm/Grid/Grid.js.map +1 -1
- package/dist/esm/Header/Actions/Actions.js +1 -1
- package/dist/esm/Header/Actions/Actions.js.map +1 -1
- package/dist/esm/Header/Brand/Brand.js +1 -1
- package/dist/esm/Header/Brand/Brand.js.map +1 -1
- package/dist/esm/Header/Header.js +4 -2
- package/dist/esm/Header/Header.js.map +1 -1
- package/dist/esm/Header/Navigation/Navigation.js +1 -1
- package/dist/esm/Header/Navigation/Navigation.js.map +1 -1
- package/dist/esm/Input/Input.js +1 -1
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/ListContainer/ListContainer.js +1 -1
- package/dist/esm/ListContainer/ListContainer.js.map +1 -1
- package/dist/esm/ListContainer/ListItem/ListItem.js +1 -1
- package/dist/esm/ListContainer/ListItem/ListItem.js.map +1 -1
- package/dist/esm/Loading/Loading.js +4 -2
- package/dist/esm/Loading/Loading.js.map +1 -1
- package/dist/esm/LoadingContainer/LoadingContainer.js +4 -3
- package/dist/esm/LoadingContainer/LoadingContainer.js.map +1 -1
- package/dist/esm/Login/Login.js +4 -4
- package/dist/esm/Login/Login.js.map +1 -1
- package/dist/esm/Pagination/Pagination.js +4 -4
- package/dist/esm/Pagination/Pagination.js.map +1 -1
- package/dist/esm/Panel/Panel.js +1 -1
- package/dist/esm/Panel/Panel.js.map +1 -1
- package/dist/esm/Panel/Panel.styles.js +2 -1
- package/dist/esm/Panel/Panel.styles.js.map +1 -1
- package/dist/esm/Radio/Radio.js +1 -1
- package/dist/esm/Radio/Radio.js.map +1 -1
- package/dist/esm/RadioGroup/RadioGroup.js +1 -1
- package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/Section/Section.js +26 -31
- package/dist/esm/Section/Section.js.map +1 -1
- package/dist/esm/Section/Section.styles.js +12 -8
- package/dist/esm/Section/Section.styles.js.map +1 -1
- package/dist/esm/Select/OptionGroup.js +1 -1
- package/dist/esm/Select/OptionGroup.js.map +1 -1
- package/dist/esm/SelectionList/SelectionList.js +1 -1
- package/dist/esm/SelectionList/SelectionList.js.map +1 -1
- package/dist/esm/Skeleton/Skeleton.styles.js +27 -32
- package/dist/esm/Skeleton/Skeleton.styles.js.map +1 -1
- package/dist/esm/Snackbar/Snackbar.js +28 -25
- package/dist/esm/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/Switch/Switch.js +1 -1
- package/dist/esm/Switch/Switch.js.map +1 -1
- package/dist/esm/Tab/Tab.js +4 -4
- package/dist/esm/Tab/Tab.js.map +1 -1
- package/dist/esm/Tab/Tab.styles.js +5 -6
- package/dist/esm/Tab/Tab.styles.js.map +1 -1
- package/dist/esm/Table/Table.js +1 -1
- package/dist/esm/Table/Table.js.map +1 -1
- package/dist/esm/Table/TableCell/TableCell.js +2 -2
- package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/Table/TableHeader/TableHeader.js +7 -6
- package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/esm/TableSection/TableSection.js +1 -1
- package/dist/esm/TableSection/TableSection.js.map +1 -1
- package/dist/esm/TableSection/TableSection.styles.js +16 -14
- package/dist/esm/TableSection/TableSection.styles.js.map +1 -1
- package/dist/esm/Tabs/Tabs.js +6 -6
- package/dist/esm/Tabs/Tabs.js.map +1 -1
- package/dist/esm/Tabs/Tabs.styles.js +2 -14
- package/dist/esm/Tabs/Tabs.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 +1 -1
- package/dist/esm/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/TextArea/TextArea.js +1 -1
- package/dist/esm/TextArea/TextArea.js.map +1 -1
- package/dist/esm/TimePicker/Placeholder.js +1 -1
- package/dist/esm/TimePicker/Placeholder.js.map +1 -1
- package/dist/esm/TimePicker/TimePicker.js +1 -1
- package/dist/esm/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/ToggleButton/ToggleButton.js +1 -1
- package/dist/esm/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/esm/Tooltip/Tooltip.js +1 -1
- package/dist/esm/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/TreeView/TreeItem/DefaultContent.js +1 -1
- package/dist/esm/TreeView/TreeItem/DefaultContent.js.map +1 -1
- package/dist/esm/TreeView/TreeItem/TreeItem.js +1 -1
- package/dist/esm/TreeView/TreeItem/TreeItem.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeView.js +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeView.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.js +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/providers/ThemeProvider.js +2 -1
- package/dist/esm/providers/ThemeProvider.js.map +1 -1
- package/dist/esm/utils/helpers.js +2 -2
- package/dist/esm/utils/helpers.js.map +1 -1
- package/dist/types/index.d.ts +39 -40
- package/package.json +6 -6
|
@@ -6,11 +6,10 @@ const focusUtils = require("../utils/focusUtils.cjs");
|
|
|
6
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTab", {
|
|
7
7
|
root: {
|
|
8
8
|
marginTop: "3px",
|
|
9
|
-
padding:
|
|
9
|
+
padding: uikitStyles.theme.spacing(0, "sm"),
|
|
10
10
|
minWidth: 70,
|
|
11
11
|
minHeight: 32,
|
|
12
12
|
textTransform: "none",
|
|
13
|
-
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
14
13
|
...uikitStyles.theme.typography.body,
|
|
15
14
|
"&:hover": {
|
|
16
15
|
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover,
|
|
@@ -21,10 +20,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTab", {
|
|
|
21
20
|
}
|
|
22
21
|
},
|
|
23
22
|
"&$selected": {
|
|
24
|
-
|
|
25
|
-
fontWeight: uikitStyles.theme.typography.label.fontWeight,
|
|
26
|
-
lineHeight: uikitStyles.theme.typography.label.lineHeight,
|
|
27
|
-
letterSpacing: uikitStyles.theme.typography.label.letterSpacing
|
|
23
|
+
fontWeight: uikitStyles.theme.typography.label.fontWeight
|
|
28
24
|
},
|
|
29
25
|
"&$disabled": {
|
|
30
26
|
color: uikitStyles.theme.colors.secondary_60,
|
|
@@ -48,6 +44,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTab", {
|
|
|
48
44
|
// Override Mui styling: https://mui.com/material-ui/api/tab/#css
|
|
49
45
|
"& .MuiTab-iconWrapper": {
|
|
50
46
|
margin: 0
|
|
47
|
+
},
|
|
48
|
+
"& svg .color0": {
|
|
49
|
+
fill: "currentcolor"
|
|
51
50
|
}
|
|
52
51
|
},
|
|
53
52
|
focusVisible: {
|
package/dist/cjs/Table/Table.cjs
CHANGED
|
@@ -26,7 +26,7 @@ const computeTablePartComponents = (rootComponent) => {
|
|
|
26
26
|
Td: rootComponent
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
const HvTable = React.forwardRef((props, ref)
|
|
29
|
+
const HvTable = React.forwardRef(function HvTable2(props, ref) {
|
|
30
30
|
const {
|
|
31
31
|
classes: classesProp,
|
|
32
32
|
className,
|
|
@@ -43,11 +43,11 @@ const HvTableCell = React.forwardRef(
|
|
|
43
43
|
className: cx(
|
|
44
44
|
classes.root,
|
|
45
45
|
classes[type],
|
|
46
|
+
align !== "inherit" && classes[`align${helpers.capitalize(align)}`],
|
|
47
|
+
variant !== "default" && classes[`variant${helpers.capitalize(variant)}`],
|
|
46
48
|
{
|
|
47
|
-
[classes[`align${helpers.capitalize(align)}`]]: align !== "inherit",
|
|
48
49
|
[classes.variantList]: tableContext.variant === "listrow",
|
|
49
50
|
[classes.variantListHead]: tableContext.variant === "listrow" && type !== "body",
|
|
50
|
-
[classes[`variant${helpers.capitalize(variant)}`]]: variant !== "default",
|
|
51
51
|
[classes.sorted]: sorted,
|
|
52
52
|
[classes.stickyColumn]: stickyColumn,
|
|
53
53
|
[classes.stickyColumnMostLeft]: stickyColumnMostLeft,
|
|
@@ -73,6 +73,8 @@ const HvTableHeader = React.forwardRef(
|
|
|
73
73
|
)
|
|
74
74
|
}
|
|
75
75
|
}),
|
|
76
|
+
align !== "inherit" && classes[`align${helpers.capitalize(align)}`],
|
|
77
|
+
variant !== "default" && classes[`variant${helpers.capitalize(variant)}`],
|
|
76
78
|
{
|
|
77
79
|
[classes.groupColumnMostLeft]: groupColumnMostLeft,
|
|
78
80
|
[classes.groupColumnMostRight]: groupColumnMostRight,
|
|
@@ -83,9 +85,7 @@ const HvTableHeader = React.forwardRef(
|
|
|
83
85
|
[classes.stickyColumn]: stickyColumn,
|
|
84
86
|
[classes.stickyColumnMostLeft]: stickyColumnMostLeft,
|
|
85
87
|
[classes.stickyColumnLeastRight]: stickyColumnLeastRight,
|
|
86
|
-
[classes.variantList]: tableContext.variant === "listrow"
|
|
87
|
-
[classes[`align${helpers.capitalize(align)}`]]: align !== "inherit",
|
|
88
|
-
[classes[`variant${helpers.capitalize(variant)}`]]: variant !== "default"
|
|
88
|
+
[classes.variantList]: tableContext.variant === "listrow"
|
|
89
89
|
},
|
|
90
90
|
className
|
|
91
91
|
),
|
|
@@ -94,9 +94,10 @@ const HvTableHeader = React.forwardRef(
|
|
|
94
94
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
95
95
|
"div",
|
|
96
96
|
{
|
|
97
|
-
className: cx(
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
className: cx(
|
|
98
|
+
classes.headerContent,
|
|
99
|
+
align !== "inherit" && classes[`alignFlex${helpers.capitalize(align)}`]
|
|
100
|
+
),
|
|
100
101
|
children: [
|
|
101
102
|
isHeadCell && sortable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
102
103
|
Button.HvButton,
|
|
@@ -7,7 +7,7 @@ const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
|
7
7
|
const TableSection_styles = require("./TableSection.styles.cjs");
|
|
8
8
|
const Section = require("../Section/Section.cjs");
|
|
9
9
|
const HvTableSection = React.forwardRef(
|
|
10
|
-
(props, ref)
|
|
10
|
+
function HvTableSection2(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
id,
|
|
13
13
|
classes: classesProp,
|
|
@@ -11,33 +11,33 @@ require("../Table/TableRow/TableRow.cjs");
|
|
|
11
11
|
const TableCell_styles = require("../Table/TableCell/TableCell.styles.cjs");
|
|
12
12
|
require("../Table/TableCell/TableCell.cjs");
|
|
13
13
|
const BulkActions_styles = require("../BulkActions/BulkActions.styles.cjs");
|
|
14
|
-
require("
|
|
14
|
+
require("../BulkActions/BulkActions.cjs");
|
|
15
15
|
const Pagination_styles = require("../Pagination/Pagination.styles.cjs");
|
|
16
|
-
require("
|
|
17
|
-
require("@mui/material");
|
|
18
|
-
require("@hitachivantara/uikit-react-icons");
|
|
16
|
+
require("../Pagination/Pagination.cjs");
|
|
19
17
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableSection", {
|
|
20
18
|
root: {},
|
|
21
19
|
header: {
|
|
22
20
|
// Only apply the border to divide the header and content when both are displayed
|
|
23
|
-
"+ div": {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
"+ div": {
|
|
22
|
+
borderTop: `1px solid ${uikitStyles.theme.colors.atmo3}`,
|
|
23
|
+
borderTopLeftRadius: 0,
|
|
24
|
+
borderTopRightRadius: 0
|
|
25
|
+
}
|
|
27
26
|
},
|
|
27
|
+
actions: {},
|
|
28
28
|
content: {
|
|
29
29
|
marginTop: 0,
|
|
30
30
|
padding: 0,
|
|
31
31
|
// Apply border radius to the first child if there's not an header
|
|
32
32
|
"&:first-of-type": {
|
|
33
33
|
"& > :first-of-type": {
|
|
34
|
-
borderTopLeftRadius:
|
|
35
|
-
borderTopRightRadius:
|
|
34
|
+
borderTopLeftRadius: "inherit",
|
|
35
|
+
borderTopRightRadius: "inherit"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"& > :last-child": {
|
|
39
|
-
borderBottomLeftRadius:
|
|
40
|
-
borderBottomRightRadius:
|
|
39
|
+
borderBottomLeftRadius: "inherit",
|
|
40
|
+
borderBottomRightRadius: "inherit"
|
|
41
41
|
},
|
|
42
42
|
[`& .${TableContainer_styles.staticClasses.root}`]: {
|
|
43
43
|
paddingBottom: 0
|
|
@@ -91,11 +91,13 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableSect
|
|
|
91
91
|
},
|
|
92
92
|
hidden: {},
|
|
93
93
|
raisedHeader: {
|
|
94
|
-
"
|
|
94
|
+
"& $content": {
|
|
95
95
|
paddingTop: 0
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
hasHeader: {},
|
|
99
|
+
/** @deprecated use `hasHeader` instead */
|
|
100
|
+
spaceTop: {}
|
|
99
101
|
});
|
|
100
102
|
exports.staticClasses = staticClasses;
|
|
101
103
|
exports.useClasses = useClasses;
|
package/dist/cjs/Tabs/Tabs.cjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
4
5
|
const Tabs = require("@mui/material/Tabs");
|
|
5
6
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
7
|
const Tabs_styles = require("./Tabs.styles.cjs");
|
|
7
8
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
8
9
|
const Tabs__default = /* @__PURE__ */ _interopDefault(Tabs);
|
|
9
|
-
const HvTabs = (props)
|
|
10
|
+
const HvTabs = React.forwardRef(function HvTabs2(props, ref) {
|
|
10
11
|
const {
|
|
11
12
|
classes: classesProp,
|
|
12
|
-
floating
|
|
13
|
+
floating,
|
|
13
14
|
...others
|
|
14
15
|
} = uikitReactUtils.useDefaultProps("HvTabs", props);
|
|
15
16
|
const { classes, cx } = Tabs_styles.useClasses(classesProp);
|
|
16
17
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
18
|
Tabs__default.default,
|
|
18
19
|
{
|
|
20
|
+
ref,
|
|
19
21
|
classes: {
|
|
20
|
-
root: classes.root,
|
|
22
|
+
root: cx(classes.root, { [classes.floating]: floating }),
|
|
21
23
|
flexContainer: classes.flexContainer,
|
|
22
24
|
indicator: classes.indicator,
|
|
23
25
|
scroller: classes.scroller
|
|
24
26
|
},
|
|
25
|
-
TabIndicatorProps: { children: /* @__PURE__ */ jsxRuntime.jsx("div", {}) },
|
|
26
|
-
className: cx(floating && classes.floating),
|
|
27
27
|
...others
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
};
|
|
30
|
+
});
|
|
31
31
|
exports.tabsClasses = Tabs_styles.staticClasses;
|
|
32
32
|
exports.HvTabs = HvTabs;
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
4
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTabs", {
|
|
6
5
|
root: {
|
|
7
6
|
minHeight: 0,
|
|
8
7
|
overflow: "visible"
|
|
9
8
|
},
|
|
10
|
-
indicator: {
|
|
11
|
-
display: "flex",
|
|
12
|
-
justifyContent: "center",
|
|
13
|
-
backgroundColor: "transparent",
|
|
14
|
-
"& > div": {
|
|
15
|
-
width: "100%",
|
|
16
|
-
backgroundColor: `${uikitStyles.theme.colors.secondary}`
|
|
17
|
-
},
|
|
18
|
-
height: 2
|
|
19
|
-
},
|
|
9
|
+
indicator: {},
|
|
20
10
|
scroller: {
|
|
21
11
|
overflow: "visible !important"
|
|
22
12
|
},
|
|
23
13
|
flexContainer: {
|
|
24
|
-
|
|
25
|
-
marginLeft: "3px"
|
|
26
|
-
}
|
|
14
|
+
marginLeft: "3px"
|
|
27
15
|
},
|
|
28
16
|
floating: {}
|
|
29
17
|
});
|
package/dist/cjs/Tag/Tag.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const Chip__default = /* @__PURE__ */ _interopDefault(Chip);
|
|
|
13
13
|
const getCategoricalColor = (customColor, colors) => {
|
|
14
14
|
return customColor && colors?.[customColor] || customColor || colors?.cat1;
|
|
15
15
|
};
|
|
16
|
-
const HvTag = React.forwardRef((props, ref)
|
|
16
|
+
const HvTag = React.forwardRef(function HvTag2(props, ref) {
|
|
17
17
|
const {
|
|
18
18
|
classes: classesProp,
|
|
19
19
|
className,
|
|
@@ -25,7 +25,7 @@ const Input = require("../Input/Input.cjs");
|
|
|
25
25
|
const Suggestions = require("../Forms/Suggestions/Suggestions.cjs");
|
|
26
26
|
const WarningText = require("../Forms/WarningText/WarningText.cjs");
|
|
27
27
|
const HvTagsInput = React.forwardRef(
|
|
28
|
-
(props, ref)
|
|
28
|
+
function HvTagsInput2(props, ref) {
|
|
29
29
|
const {
|
|
30
30
|
classes: classesProp,
|
|
31
31
|
className,
|
|
@@ -16,7 +16,7 @@ const InfoMessage = require("../Forms/InfoMessage/InfoMessage.cjs");
|
|
|
16
16
|
const CharCounter = require("../Forms/CharCounter/CharCounter.cjs");
|
|
17
17
|
const BaseInput = require("../BaseInput/BaseInput.cjs");
|
|
18
18
|
const WarningText = require("../Forms/WarningText/WarningText.cjs");
|
|
19
|
-
const HvTextArea = React.forwardRef((props, ref)
|
|
19
|
+
const HvTextArea = React.forwardRef(function HvTextArea2(props, ref) {
|
|
20
20
|
const {
|
|
21
21
|
id,
|
|
22
22
|
className,
|
|
@@ -22,7 +22,7 @@ const PlaceholderSegment = ({
|
|
|
22
22
|
})() });
|
|
23
23
|
};
|
|
24
24
|
const Placeholder = React.forwardRef(
|
|
25
|
-
(props, ref)
|
|
25
|
+
function Placeholder2(props, ref) {
|
|
26
26
|
const { name, state, placeholders, onKeyDown, ...others } = props;
|
|
27
27
|
const { value, segments } = state;
|
|
28
28
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5,7 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
6
|
const useControlled = require("../hooks/useControlled.cjs");
|
|
7
7
|
const Button = require("../Button/Button.cjs");
|
|
8
|
-
const HvToggleButton = React.forwardRef((props, ref)
|
|
8
|
+
const HvToggleButton = React.forwardRef(function HvToggleButton2(props, ref) {
|
|
9
9
|
const {
|
|
10
10
|
defaultSelected,
|
|
11
11
|
selected,
|
|
@@ -10,7 +10,7 @@ const Tooltip_styles = require("./Tooltip.styles.cjs");
|
|
|
10
10
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
11
11
|
const Fade__default = /* @__PURE__ */ _interopDefault(Fade);
|
|
12
12
|
const Tooltip__default = /* @__PURE__ */ _interopDefault(Tooltip);
|
|
13
|
-
const HvTooltip = React.forwardRef((props, ref)
|
|
13
|
+
const HvTooltip = React.forwardRef(function HvTooltip2(props, ref) {
|
|
14
14
|
const {
|
|
15
15
|
className,
|
|
16
16
|
classes: classesProp,
|
|
@@ -12,7 +12,7 @@ const TreeItem_styles = require("./TreeItem.styles.cjs");
|
|
|
12
12
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
13
13
|
const Collapse__default = /* @__PURE__ */ _interopDefault(Collapse);
|
|
14
14
|
const HvTreeItem = React.forwardRef(
|
|
15
|
-
(props, ref)
|
|
15
|
+
function HvTreeItem2(props, ref) {
|
|
16
16
|
const {
|
|
17
17
|
id: idProp,
|
|
18
18
|
nodeId,
|
|
@@ -18,7 +18,7 @@ function findNextFirstChar(firstChars, startIndex, char) {
|
|
|
18
18
|
function noopSelection() {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
const HvVerticalNavigationTreeView = React.forwardRef((props, ref)
|
|
21
|
+
const HvVerticalNavigationTreeView = React.forwardRef(function HvVerticalNavigationTreeView2(props, ref) {
|
|
22
22
|
const {
|
|
23
23
|
id: idProp,
|
|
24
24
|
className,
|
|
@@ -7,7 +7,7 @@ const utils = require("./NavigationSlider/utils.cjs");
|
|
|
7
7
|
const VerticalNavigation_utils = require("./utils/VerticalNavigation.utils.cjs");
|
|
8
8
|
const VerticalNavigation_styles = require("./VerticalNavigation.styles.cjs");
|
|
9
9
|
const VerticalNavigationContext = require("./VerticalNavigationContext.cjs");
|
|
10
|
-
const HvVerticalNavigation = React.forwardRef((props, ref)
|
|
10
|
+
const HvVerticalNavigation = React.forwardRef(function HvVerticalNavigation2(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
id,
|
|
13
13
|
className,
|
|
@@ -6,8 +6,8 @@ const uniqueId = (prefix = "") => {
|
|
|
6
6
|
const range = (length, start = 0) => {
|
|
7
7
|
return Array.from({ length: length - start }, (_, i) => i + start);
|
|
8
8
|
};
|
|
9
|
-
const capitalize = (string
|
|
10
|
-
return string.charAt(0).toUpperCase() + string.slice(1)
|
|
9
|
+
const capitalize = (string) => {
|
|
10
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
11
11
|
};
|
|
12
12
|
function isEqual(obj1, obj2) {
|
|
13
13
|
if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo } from "react";
|
|
2
|
+
import { forwardRef, useCallback, useMemo } from "react";
|
|
3
3
|
import { DropUpXS } from "@hitachivantara/uikit-react-icons";
|
|
4
4
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
5
5
|
import { useExpandable } from "../hooks/useExpandable.js";
|
|
@@ -7,9 +7,9 @@ import { useClasses } from "./Accordion.styles.js";
|
|
|
7
7
|
import { staticClasses } from "./Accordion.styles.js";
|
|
8
8
|
import { HvButtonBase } from "../ButtonBase/ButtonBase.js";
|
|
9
9
|
import { HvTypography } from "../Typography/Typography.js";
|
|
10
|
-
const HvAccordion = (props)
|
|
10
|
+
const HvAccordion = forwardRef(function HvAccordion2(props, ref) {
|
|
11
11
|
const {
|
|
12
|
-
id
|
|
12
|
+
id,
|
|
13
13
|
className,
|
|
14
14
|
classes: classesProp,
|
|
15
15
|
disabled = false,
|
|
@@ -26,7 +26,7 @@ const HvAccordion = (props) => {
|
|
|
26
26
|
} = useDefaultProps("HvAccordion", props);
|
|
27
27
|
const { classes, cx } = useClasses(classesProp);
|
|
28
28
|
const { isOpen, toggleOpen, buttonProps, regionProps } = useExpandable({
|
|
29
|
-
id
|
|
29
|
+
id,
|
|
30
30
|
expanded,
|
|
31
31
|
disabled,
|
|
32
32
|
defaultExpanded
|
|
@@ -78,7 +78,7 @@ const HvAccordion = (props) => {
|
|
|
78
78
|
isOpen,
|
|
79
79
|
labelVariant
|
|
80
80
|
]);
|
|
81
|
-
return /* @__PURE__ */ jsxs("div", { id
|
|
81
|
+
return /* @__PURE__ */ jsxs("div", { ref, id, className: cx(classes.root, className), ...others, children: [
|
|
82
82
|
accordionHeader,
|
|
83
83
|
/* @__PURE__ */ jsx(
|
|
84
84
|
"div",
|
|
@@ -91,7 +91,7 @@ const HvAccordion = (props) => {
|
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
] });
|
|
94
|
-
};
|
|
94
|
+
});
|
|
95
95
|
export {
|
|
96
96
|
HvAccordion,
|
|
97
97
|
staticClasses as accordionClasses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../src/Accordion/Accordion.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase } from \"../ButtonBase\";\nimport { useExpandable } from \"../hooks/useExpandable\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography, HvTypographyVariants } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Accordion.styles\";\n\nexport { staticClasses as accordionClasses };\n\nexport type HvAccordionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAccordionProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"children\"> {\n /** Content to be rendered. */\n children: React.ReactNode;\n /** The accordion label button. */\n label?: string;\n /** The function that will be executed whenever the accordion toggles. It will receive the state of the accordion. */\n onChange?: (event: React.SyntheticEvent, value: boolean) => void;\n /** Whether the accordion is open or not. If this property is defined the accordion must be fully controlled. */\n expanded?: boolean;\n /** When uncontrolled, defines the initial expanded state. */\n defaultExpanded?: boolean;\n /** An object containing props to be passed onto container holding the accordion children. */\n containerProps?: React.HTMLAttributes<HTMLDivElement>;\n /** Heading level to apply to accordion button. If ´undefined´ the button won't have a header wrapper. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Whether the accordion is disabled. */\n disabled?: boolean;\n /** Typography variant for the label. */\n labelVariant?: HvTypographyVariants;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvAccordionClasses;\n /** Whether to disable the internal usage of `preventDefault` and `stopPropagation` when the `onChange` event is triggered. */\n disableEventHandling?: boolean; // TODO - remove in v6 as this should be the default behavior: `preventDefault` and `stopPropagation` shouldn't be triggered internally\n}\n\n/**\n * A accordion is a design element that expands in place to expose hidden information.\n */\nexport const HvAccordion = (props
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../src/Accordion/Accordion.tsx"],"sourcesContent":["import { forwardRef, useCallback, useMemo } from \"react\";\nimport { DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase } from \"../ButtonBase\";\nimport { useExpandable } from \"../hooks/useExpandable\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography, HvTypographyVariants } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Accordion.styles\";\n\nexport { staticClasses as accordionClasses };\n\nexport type HvAccordionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAccordionProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"children\"> {\n /** Content to be rendered. */\n children: React.ReactNode;\n /** The accordion label button. */\n label?: string;\n /** The function that will be executed whenever the accordion toggles. It will receive the state of the accordion. */\n onChange?: (event: React.SyntheticEvent, value: boolean) => void;\n /** Whether the accordion is open or not. If this property is defined the accordion must be fully controlled. */\n expanded?: boolean;\n /** When uncontrolled, defines the initial expanded state. */\n defaultExpanded?: boolean;\n /** An object containing props to be passed onto container holding the accordion children. */\n containerProps?: React.HTMLAttributes<HTMLDivElement>;\n /** Heading level to apply to accordion button. If ´undefined´ the button won't have a header wrapper. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Whether the accordion is disabled. */\n disabled?: boolean;\n /** Typography variant for the label. */\n labelVariant?: HvTypographyVariants;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvAccordionClasses;\n /** Whether to disable the internal usage of `preventDefault` and `stopPropagation` when the `onChange` event is triggered. */\n disableEventHandling?: boolean; // TODO - remove in v6 as this should be the default behavior: `preventDefault` and `stopPropagation` shouldn't be triggered internally\n}\n\n/**\n * A accordion is a design element that expands in place to expose hidden information.\n */\nexport const HvAccordion = forwardRef<\n React.ComponentRef<\"div\">,\n HvAccordionProps\n>(function HvAccordion(props, ref) {\n const {\n id,\n className,\n classes: classesProp,\n disabled = false,\n label,\n onChange,\n children,\n expanded,\n headingLevel,\n defaultExpanded = false,\n containerProps,\n labelVariant = \"label\",\n disableEventHandling,\n ...others\n } = useDefaultProps(\"HvAccordion\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const { isOpen, toggleOpen, buttonProps, regionProps } = useExpandable({\n id,\n expanded,\n disabled,\n defaultExpanded,\n });\n\n const handleClick = useCallback(\n (event: React.SyntheticEvent) => {\n if (!disabled) {\n onChange?.(event, isOpen);\n toggleOpen();\n }\n\n if (!disableEventHandling) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [disableEventHandling, disabled, isOpen, onChange, toggleOpen],\n );\n\n const accordionHeader = useMemo(() => {\n const accordionButton = (\n <HvTypography\n {...buttonProps}\n component={HvButtonBase}\n className={cx(classes.label, { [classes.disabled]: disabled })}\n disabled={disabled}\n onClick={handleClick}\n variant={labelVariant}\n >\n <DropUpXS\n color=\"inherit\"\n style={{ rotate: isOpen ? undefined : \"180deg\" }}\n />\n {label}\n </HvTypography>\n );\n\n return headingLevel === undefined ? (\n accordionButton\n ) : (\n <HvTypography component={`h${headingLevel}`} variant={labelVariant}>\n {accordionButton}\n </HvTypography>\n );\n }, [\n cx,\n classes,\n handleClick,\n label,\n buttonProps,\n disabled,\n headingLevel,\n isOpen,\n labelVariant,\n ]);\n\n return (\n <div ref={ref} id={id} className={cx(classes.root, className)} {...others}>\n {accordionHeader}\n <div\n className={cx(classes.container, { [classes.hidden]: !isOpen })}\n hidden={!isOpen}\n {...regionProps}\n {...containerProps}\n >\n {children}\n </div>\n </div>\n );\n});\n"],"names":["HvAccordion"],"mappings":";;;;;;;;;AA8CO,MAAM,cAAc,WAGzB,SAASA,aAAY,OAAO,KAAK;AAC3B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,EAAE,QAAQ,YAAY,aAAa,YAAA,IAAgB,cAAc;AAAA,IACrE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAED,QAAM,cAAc;AAAA,IAClB,CAAC,UAAgC;AAC/B,UAAI,CAAC,UAAU;AACb,mBAAW,OAAO,MAAM;AACb;MACb;AAEA,UAAI,CAAC,sBAAsB;AACzB,cAAM,eAAe;AACrB,cAAM,gBAAgB;AAAA,MACxB;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,UAAU,QAAQ,UAAU,UAAU;AAAA,EAAA;AAGzD,QAAA,kBAAkB,QAAQ,MAAM;AACpC,UAAM,kBACJ;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ,WAAW;AAAA,QACX,WAAW,GAAG,QAAQ,OAAO,EAAE,CAAC,QAAQ,QAAQ,GAAG,UAAU;AAAA,QAC7D;AAAA,QACA,SAAS;AAAA,QACT,SAAS;AAAA,QAET,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,OAAO,EAAE,QAAQ,SAAS,SAAY,SAAS;AAAA,YAAA;AAAA,UACjD;AAAA,UACC;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAIE,WAAA,iBAAiB,SACtB,kBAEC,oBAAA,cAAA,EAAa,WAAW,IAAI,YAAY,IAAI,SAAS,cACnD,UACH,gBAAA,CAAA;AAAA,EAAA,GAED;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAGC,SAAA,qBAAC,OAAI,EAAA,KAAU,IAAQ,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QAChE,UAAA;AAAA,IAAA;AAAA,IACD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,GAAG,QAAQ,WAAW,EAAE,CAAC,QAAQ,MAAM,GAAG,CAAC,QAAQ;AAAA,QAC9D,QAAQ,CAAC;AAAA,QACR,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
3
4
|
import { useClasses } from "./ActionBar.styles.js";
|
|
4
5
|
import { staticClasses } from "./ActionBar.styles.js";
|
|
5
|
-
const HvActionBar = (props)
|
|
6
|
+
const HvActionBar = forwardRef(function HvActionBar2(props, ref) {
|
|
6
7
|
const {
|
|
7
8
|
classes: classesProp,
|
|
8
9
|
className,
|
|
@@ -10,8 +11,8 @@ const HvActionBar = (props) => {
|
|
|
10
11
|
...others
|
|
11
12
|
} = useDefaultProps("HvActionBar", props);
|
|
12
13
|
const { classes, cx } = useClasses(classesProp);
|
|
13
|
-
return /* @__PURE__ */ jsx("div", { className: cx(classes.root, className), ...others, children });
|
|
14
|
-
};
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cx(classes.root, className), ...others, children });
|
|
15
|
+
});
|
|
15
16
|
export {
|
|
16
17
|
HvActionBar,
|
|
17
18
|
staticClasses as actionBarClasses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.js","sources":["../../../src/ActionBar/ActionBar.tsx"],"sourcesContent":["import {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./ActionBar.styles\";\n\nexport { staticClasses as actionBarClasses };\n\nexport type HvActionBarClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvActionBarProps extends HvBaseProps {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionBarClasses;\n}\n\nexport const HvActionBar = (props
|
|
1
|
+
{"version":3,"file":"ActionBar.js","sources":["../../../src/ActionBar/ActionBar.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./ActionBar.styles\";\n\nexport { staticClasses as actionBarClasses };\n\nexport type HvActionBarClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvActionBarProps extends HvBaseProps {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionBarClasses;\n}\n\nexport const HvActionBar = forwardRef<\n React.ComponentRef<\"div\">,\n HvActionBarProps\n>(function HvActionBar(props, ref) {\n const {\n classes: classesProp,\n className,\n children,\n ...others\n } = useDefaultProps(\"HvActionBar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div ref={ref} className={cx(classes.root, className)} {...others}>\n {children}\n </div>\n );\n});\n"],"names":["HvActionBar"],"mappings":";;;;;AAkBO,MAAM,cAAc,WAGzB,SAASA,aAAY,OAAO,KAAK;AAC3B,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAG5C,SAAA,oBAAC,OAAI,EAAA,KAAU,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QACxD,SACH,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { isValidElement } from "react";
|
|
2
|
+
import { forwardRef, isValidElement } from "react";
|
|
3
3
|
import { MoreOptionsVertical } from "@hitachivantara/uikit-react-icons";
|
|
4
4
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
5
5
|
import { setId } from "../utils/setId.js";
|
|
@@ -8,7 +8,7 @@ import { staticClasses } from "./ActionsGeneric.styles.js";
|
|
|
8
8
|
import { HvIconButton } from "../IconButton/IconButton.js";
|
|
9
9
|
import { HvButton } from "../Button/Button.js";
|
|
10
10
|
import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js";
|
|
11
|
-
const HvActionsGeneric = (props)
|
|
11
|
+
const HvActionsGeneric = forwardRef(function HvActionsGeneric2(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
id: idProp,
|
|
14
14
|
classes: classesProp,
|
|
@@ -96,6 +96,7 @@ const HvActionsGeneric = (props) => {
|
|
|
96
96
|
return /* @__PURE__ */ jsx(
|
|
97
97
|
"div",
|
|
98
98
|
{
|
|
99
|
+
ref,
|
|
99
100
|
className: cx(
|
|
100
101
|
classes.root,
|
|
101
102
|
{ [classes.actionContainer]: actionOverflow },
|
|
@@ -105,7 +106,7 @@ const HvActionsGeneric = (props) => {
|
|
|
105
106
|
children: actionOverflow ? renderActionsGrid() : actions.map((action, idx) => renderButton(action, idx))
|
|
106
107
|
}
|
|
107
108
|
);
|
|
108
|
-
};
|
|
109
|
+
});
|
|
109
110
|
export {
|
|
110
111
|
HvActionsGeneric,
|
|
111
112
|
staticClasses as actionsGenericClasses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsGeneric.js","sources":["../../../src/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import { 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 = (props
|
|
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 semantic = variant === \"semantic\";\n const iconColor =\n (disabled && \"secondary_60\") || (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;AAE3B,QAAM,UAAU,eAAe;AAE/B,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,iBAA2D,CAC/D,OACA,IACA,WACG;AACe,sBAAA,OAAO,IAAI,MAAM;AACnC,eAAW,OAAO,MAAM;AAAA,EAAA;AAGtB,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,IACD,IAAA;AACJ,UAAM,WAAW,MAAM,QAAQ,KAAK,UAAU,OAAO,EAAE;AAEjD,UAAA,eAAe,eAAe,IAAI,IACpC,OACC,OAAoB,EAAE,YAAY,SAAA,CAAU;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,IAAA;AAGL,UAAM,MAAM,YAAY;AACxB,UAAM,SAAS,YAAY;AAE3B,QAAI,QAAQ;AACV,iCACG,cAAwB,EAAA,GAAG,mBAAmB,OAAO,OACnD,0BADgB,GAEnB;AAAA,IAEJ;AAEA,+BACG,UAAoB,EAAA,GAAG,mBAAmB,WAAW,cACnD,mBADY,GAEf;AAAA,EAAA;AAIJ,QAAM,oBAAoB,MAAM;AAC9B,UAAM,cAAc,QAAQ,MAAM,GAAG,iBAAiB;AAChD,UAAA,eAAe,QAAQ,MAAM,iBAAiB;AAEpD,UAAM,WAAW,YAAY;AAC7B,UAAM,YACH,YAAY,kBAAoB,YAAY,eAAgB;AAE/D,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,MACN;AAAA,IACF,EAAA,CAAA;AAAA,EAAA;AAIE,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,EAAA;AAGhE,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
3
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
4
4
|
import { useClasses } from "./AppSwitcher.styles.js";
|
|
5
5
|
import { staticClasses } from "./AppSwitcher.styles.js";
|
|
@@ -8,7 +8,7 @@ import { HvPanel } from "../Panel/Panel.js";
|
|
|
8
8
|
import { HvTypography } from "../Typography/Typography.js";
|
|
9
9
|
import { HvOverflowTooltip } from "../OverflowTooltip/OverflowTooltip.js";
|
|
10
10
|
import { HvListContainer } from "../ListContainer/ListContainer.js";
|
|
11
|
-
const HvAppSwitcher = (props)
|
|
11
|
+
const HvAppSwitcher = forwardRef(function HvAppSwitcher2(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
className,
|
|
14
14
|
classes: classesProp,
|
|
@@ -53,6 +53,7 @@ const HvAppSwitcher = (props) => {
|
|
|
53
53
|
return /* @__PURE__ */ jsxs(
|
|
54
54
|
HvPanel,
|
|
55
55
|
{
|
|
56
|
+
ref,
|
|
56
57
|
className: cx(
|
|
57
58
|
classes.root,
|
|
58
59
|
classes[layout],
|
|
@@ -93,7 +94,7 @@ const HvAppSwitcher = (props) => {
|
|
|
93
94
|
]
|
|
94
95
|
}
|
|
95
96
|
);
|
|
96
|
-
};
|
|
97
|
+
});
|
|
97
98
|
export {
|
|
98
99
|
HvAppSwitcher,
|
|
99
100
|
staticClasses as appSwitcherClasses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSwitcher.js","sources":["../../../src/AppSwitcher/AppSwitcher.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvListContainer } from \"../ListContainer\";\nimport { HvOverflowTooltip } from \"../OverflowTooltip\";\nimport { HvPanel } from \"../Panel\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport { HvAppSwitcherAction, HvAppSwitcherActionApplication } from \"./Action\";\nimport { staticClasses, useClasses } from \"./AppSwitcher.styles\";\n\nexport { staticClasses as appSwitcherClasses };\n\nexport type HvAppSwitcherClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAppSwitcherProps extends HvBaseProps {\n /** Number of columns to render. One, two, or whatever fits the component's width. */\n layout?: \"single\" | \"dual\" | \"fluid\";\n /** Title to be displayed on the header of the component. */\n title?: string;\n /** The list of applications to be used to render the actions on the component. */\n applications?: HvAppSwitcherActionApplication[];\n /** Triggered when an action is clicked. */\n onActionClickedCallback?: (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication,\n ) => void;\n /** Must return a boolean stating if the action element is selected or not. */\n isActionSelectedCallback?: (\n application: HvAppSwitcherActionApplication,\n ) => boolean;\n /** Element to be added to the header container, if none is provided a label with the title will be added. */\n header?: React.ReactNode;\n /** Element to be added to the footer container. */\n footer?: React.ReactNode;\n /**\n * Flag stating if the panel is opened or closed.\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcher inside a Drawer component.\n */\n isOpen?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAppSwitcherClasses;\n}\n\nexport const HvAppSwitcher = (props
|
|
1
|
+
{"version":3,"file":"AppSwitcher.js","sources":["../../../src/AppSwitcher/AppSwitcher.tsx"],"sourcesContent":["import { forwardRef, useMemo } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvListContainer } from \"../ListContainer\";\nimport { HvOverflowTooltip } from \"../OverflowTooltip\";\nimport { HvPanel } from \"../Panel\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport { HvAppSwitcherAction, HvAppSwitcherActionApplication } from \"./Action\";\nimport { staticClasses, useClasses } from \"./AppSwitcher.styles\";\n\nexport { staticClasses as appSwitcherClasses };\n\nexport type HvAppSwitcherClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAppSwitcherProps extends HvBaseProps {\n /** Number of columns to render. One, two, or whatever fits the component's width. */\n layout?: \"single\" | \"dual\" | \"fluid\";\n /** Title to be displayed on the header of the component. */\n title?: string;\n /** The list of applications to be used to render the actions on the component. */\n applications?: HvAppSwitcherActionApplication[];\n /** Triggered when an action is clicked. */\n onActionClickedCallback?: (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication,\n ) => void;\n /** Must return a boolean stating if the action element is selected or not. */\n isActionSelectedCallback?: (\n application: HvAppSwitcherActionApplication,\n ) => boolean;\n /** Element to be added to the header container, if none is provided a label with the title will be added. */\n header?: React.ReactNode;\n /** Element to be added to the footer container. */\n footer?: React.ReactNode;\n /**\n * Flag stating if the panel is opened or closed.\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcher inside a Drawer component.\n */\n isOpen?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAppSwitcherClasses;\n}\n\nexport const HvAppSwitcher = forwardRef<\n React.ComponentRef<typeof HvPanel>,\n HvAppSwitcherProps\n>(function HvAppSwitcher(props, ref) {\n const {\n className,\n classes: classesProp,\n layout = \"single\",\n title,\n applications,\n onActionClickedCallback = () => {},\n isActionSelectedCallback = () => false,\n header,\n footer,\n isOpen,\n ...others\n } = useDefaultProps(\"HvAppSwitcher\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const panelActions = useMemo(\n () =>\n applications?.map((application) => {\n if (application.name) {\n return (\n <HvAppSwitcherAction\n key={application.id || `${application.name}_${application.url}`}\n application={application}\n onClickCallback={onActionClickedCallback}\n isSelectedCallback={isActionSelectedCallback}\n classes={{\n root: classes.item,\n selected: classes.itemSelected,\n disabled: classes.itemDisabled,\n typography: classes.itemTrigger,\n icon: classes.itemIcon,\n title: classes.itemTitle,\n iconInfo: classes.itemInfoIcon,\n }}\n />\n );\n }\n\n return undefined;\n }),\n [applications, classes, isActionSelectedCallback, onActionClickedCallback],\n );\n\n return (\n <HvPanel\n ref={ref}\n className={cx(\n classes.root,\n classes[layout],\n { [classes.open]: !!isOpen, [classes.closed]: isOpen === false },\n className,\n )}\n {...others}\n >\n {(header && (\n <HvTypography component=\"div\" variant=\"label\" className={classes.title}>\n {header}\n </HvTypography>\n )) ||\n (title && (\n <HvOverflowTooltip\n className={classes.title}\n data={title}\n placement=\"top-start\"\n classes={{\n tooltipAnchorParagraph: classes.titleAnchor,\n }}\n />\n ))}\n <HvListContainer\n condensed\n disableGutters\n className={classes.actionsContainer}\n >\n {panelActions}\n </HvListContainer>\n {footer && (\n <HvTypography\n component=\"div\"\n variant=\"label\"\n className={classes.footerContainer}\n >\n {footer}\n </HvTypography>\n )}\n </HvPanel>\n );\n});\n"],"names":["HvAppSwitcher"],"mappings":";;;;;;;;;;AAgDO,MAAM,gBAAgB,WAG3B,SAASA,eAAc,OAAO,KAAK;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,0BAA0B,MAAM;AAAA,IAAC;AAAA,IACjC,2BAA2B,MAAM;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAC1C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,eAAe;AAAA,IACnB,MACE,cAAc,IAAI,CAAC,gBAAgB;AACjC,UAAI,YAAY,MAAM;AAElB,eAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC;AAAA,YACA,iBAAiB;AAAA,YACjB,oBAAoB;AAAA,YACpB,SAAS;AAAA,cACP,MAAM,QAAQ;AAAA,cACd,UAAU,QAAQ;AAAA,cAClB,UAAU,QAAQ;AAAA,cAClB,YAAY,QAAQ;AAAA,cACpB,MAAM,QAAQ;AAAA,cACd,OAAO,QAAQ;AAAA,cACf,UAAU,QAAQ;AAAA,YACpB;AAAA,UAAA;AAAA,UAZK,YAAY,MAAM,GAAG,YAAY,IAAI,IAAI,YAAY,GAAG;AAAA,QAAA;AAAA,MAenE;AAEO,aAAA;AAAA,IAAA,CACR;AAAA,IACH,CAAC,cAAc,SAAS,0BAA0B,uBAAuB;AAAA,EAAA;AAIzE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ,MAAM;AAAA,QACd,EAAE,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,MAAM,GAAG,WAAW,MAAM;AAAA,QAC/D;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEF,UAAA;AAAA,QACA,UAAA,oBAAC,cAAa,EAAA,WAAU,OAAM,SAAQ,SAAQ,WAAW,QAAQ,OAC9D,UACH,OAAA,CAAA,KAEC,SACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,QAAQ;AAAA,YACnB,MAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAS;AAAA,cACP,wBAAwB,QAAQ;AAAA,YAClC;AAAA,UAAA;AAAA,QACF;AAAA,QAEJ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAS;AAAA,YACT,gBAAc;AAAA,YACd,WAAW,QAAQ;AAAA,YAElB,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,QACC,UACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,WAAW,QAAQ;AAAA,YAElB,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
|