@hitachivantara/uikit-react-core 5.27.6 → 5.27.8
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/components/Accordion/Accordion.cjs +14 -42
- package/dist/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/cjs/components/ActionBar/ActionBar.cjs +2 -6
- package/dist/cjs/components/ActionBar/ActionBar.cjs.map +1 -1
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs +17 -42
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/Action/Action.cjs +15 -62
- package/dist/cjs/components/AppSwitcher/Action/Action.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/AppSwitcher.cjs +18 -40
- package/dist/cjs/components/AppSwitcher/AppSwitcher.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/TitleWithTooltip.cjs +2 -15
- package/dist/cjs/components/AppSwitcher/TitleWithTooltip.cjs.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.cjs +13 -30
- package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/cjs/components/Badge/Badge.cjs +12 -22
- package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
- package/dist/cjs/components/Banner/Banner.cjs +11 -36
- package/dist/cjs/components/Banner/Banner.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/ActionContainer/ActionContainer.cjs +5 -26
- package/dist/cjs/components/Banner/BannerContent/ActionContainer/ActionContainer.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/BannerContent.cjs +12 -33
- package/dist/cjs/components/Banner/BannerContent/BannerContent.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/MessageContainer/MessageContainer.cjs +6 -20
- package/dist/cjs/components/Banner/BannerContent/MessageContainer/MessageContainer.cjs.map +1 -1
- package/dist/cjs/components/BaseCheckBox/BaseCheckBox.cjs +8 -38
- package/dist/cjs/components/BaseCheckBox/BaseCheckBox.cjs.map +1 -1
- package/dist/cjs/components/BaseDropdown/BaseDropdown.cjs +68 -95
- package/dist/cjs/components/BaseDropdown/BaseDropdown.cjs.map +1 -1
- package/dist/cjs/components/BaseInput/BaseInput.cjs +31 -52
- package/dist/cjs/components/BaseInput/BaseInput.cjs.map +1 -1
- package/dist/cjs/components/BaseRadio/BaseRadio.cjs +7 -32
- package/dist/cjs/components/BaseRadio/BaseRadio.cjs.map +1 -1
- package/dist/cjs/components/BaseSwitch/BaseSwitch.cjs +13 -31
- package/dist/cjs/components/BaseSwitch/BaseSwitch.cjs.map +1 -1
- package/dist/cjs/components/Box/Box.cjs +2 -7
- package/dist/cjs/components/Box/Box.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs +12 -33
- package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/Page/Page.cjs +2 -13
- package/dist/cjs/components/BreadCrumb/Page/Page.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/PathElement/PathElement.cjs +5 -8
- package/dist/cjs/components/BreadCrumb/PathElement/PathElement.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/utils.cjs +2 -11
- package/dist/cjs/components/BreadCrumb/utils.cjs.map +1 -1
- package/dist/cjs/components/BulkActions/BulkActions.cjs +34 -69
- package/dist/cjs/components/BulkActions/BulkActions.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +15 -24
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/Calendar/Calendar.cjs +12 -54
- package/dist/cjs/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs +16 -44
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs +15 -31
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs +10 -24
- package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.cjs +24 -35
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.cjs +8 -10
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.cjs.map +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs +15 -33
- package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs.map +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.cjs +13 -54
- package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.cjs.map +1 -1
- package/dist/cjs/components/Card/Card.cjs +16 -22
- package/dist/cjs/components/Card/Card.cjs.map +1 -1
- package/dist/cjs/components/Card/Content/Content.cjs +2 -8
- package/dist/cjs/components/Card/Content/Content.cjs.map +1 -1
- package/dist/cjs/components/Card/Header/Header.cjs +15 -23
- package/dist/cjs/components/Card/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/Card/Media/Media.cjs +5 -14
- package/dist/cjs/components/Card/Media/Media.cjs.map +1 -1
- package/dist/cjs/components/Carousel/Carousel.cjs +37 -94
- package/dist/cjs/components/Carousel/Carousel.cjs.map +1 -1
- package/dist/cjs/components/Carousel/CarouselControls.cjs +11 -33
- package/dist/cjs/components/Carousel/CarouselControls.cjs.map +1 -1
- package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.cjs +4 -12
- package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.cjs.map +1 -1
- package/dist/cjs/components/Carousel/CarouselThumbnails.cjs +6 -23
- package/dist/cjs/components/Carousel/CarouselThumbnails.cjs.map +1 -1
- package/dist/cjs/components/CheckBox/CheckBox.cjs +23 -57
- package/dist/cjs/components/CheckBox/CheckBox.cjs.map +1 -1
- package/dist/cjs/components/CheckBoxGroup/CheckBoxGroup.cjs +21 -55
- package/dist/cjs/components/CheckBoxGroup/CheckBoxGroup.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/ColorPicker.cjs +28 -87
- package/dist/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/Fields/Fields.cjs +7 -37
- package/dist/cjs/components/ColorPicker/Fields/Fields.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/Picker/Picker.cjs +11 -38
- package/dist/cjs/components/ColorPicker/Picker/Picker.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/PresetColors/PresetColors.cjs +7 -21
- package/dist/cjs/components/ColorPicker/PresetColors/PresetColors.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/SavedColors/SavedColors.cjs +10 -39
- package/dist/cjs/components/ColorPicker/SavedColors/SavedColors.cjs.map +1 -1
- package/dist/cjs/components/Container/Container.cjs +13 -21
- package/dist/cjs/components/Container/Container.cjs.map +1 -1
- package/dist/cjs/components/Controls/Controls.cjs +15 -32
- package/dist/cjs/components/Controls/Controls.cjs.map +1 -1
- package/dist/cjs/components/Controls/LeftControl/LeftControl.cjs +5 -13
- package/dist/cjs/components/Controls/LeftControl/LeftControl.cjs.map +1 -1
- package/dist/cjs/components/Controls/RightControl/RightControl.cjs +5 -14
- package/dist/cjs/components/Controls/RightControl/RightControl.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.cjs +40 -119
- package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Actions/Actions.cjs +7 -12
- package/dist/cjs/components/Dialog/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Content/Content.cjs +4 -8
- package/dist/cjs/components/Dialog/Content/Content.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +29 -54
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Title/Title.cjs +14 -21
- package/dist/cjs/components/Dialog/Title/Title.cjs.map +1 -1
- package/dist/cjs/components/DotPagination/DotPagination.cjs +9 -29
- package/dist/cjs/components/DotPagination/DotPagination.cjs.map +1 -1
- package/dist/cjs/components/Drawer/Drawer.cjs +16 -32
- package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs +16 -55
- package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs.map +1 -1
- package/dist/cjs/components/Dropdown/Dropdown.cjs +36 -108
- package/dist/cjs/components/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/cjs/components/Dropdown/List/List.cjs +40 -91
- package/dist/cjs/components/Dropdown/List/List.cjs.map +1 -1
- package/dist/cjs/components/EmptyState/EmptyState.cjs +20 -30
- package/dist/cjs/components/EmptyState/EmptyState.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs +53 -93
- package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/File/File.cjs +21 -53
- package/dist/cjs/components/FileUploader/File/File.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/FileList/FileList.cjs +4 -14
- package/dist/cjs/components/FileUploader/FileList/FileList.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/FileUploader.cjs +5 -22
- package/dist/cjs/components/FileUploader/FileUploader.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/Preview/Preview.cjs +11 -20
- package/dist/cjs/components/FileUploader/Preview/Preview.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/Counter/Counter.cjs +5 -8
- package/dist/cjs/components/FilterGroup/Counter/Counter.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.cjs +30 -84
- package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterGroup.cjs +11 -50
- package/dist/cjs/components/FilterGroup/FilterGroup.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterGroupContext.cjs +2 -5
- package/dist/cjs/components/FilterGroup/FilterGroupContext.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/LeftPanel/LeftPanel.cjs +5 -23
- package/dist/cjs/components/FilterGroup/LeftPanel/LeftPanel.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs +16 -51
- package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs.map +1 -1
- package/dist/cjs/components/Focus/Focus.cjs +19 -25
- package/dist/cjs/components/Focus/Focus.cjs.map +1 -1
- package/dist/cjs/components/Footer/Footer.cjs +11 -20
- package/dist/cjs/components/Footer/Footer.cjs.map +1 -1
- package/dist/cjs/components/Forms/Adornment/Adornment.cjs +6 -31
- package/dist/cjs/components/Forms/Adornment/Adornment.cjs.map +1 -1
- package/dist/cjs/components/Forms/CharCounter/CharCounter.cjs +14 -30
- package/dist/cjs/components/Forms/CharCounter/CharCounter.cjs.map +1 -1
- package/dist/cjs/components/Forms/FormElement/FormElement.cjs +2 -16
- package/dist/cjs/components/Forms/FormElement/FormElement.cjs.map +1 -1
- package/dist/cjs/components/Forms/InfoMessage/InfoMessage.cjs +5 -12
- package/dist/cjs/components/Forms/InfoMessage/InfoMessage.cjs.map +1 -1
- package/dist/cjs/components/Forms/Label/Label.cjs +11 -18
- package/dist/cjs/components/Forms/Label/Label.cjs.map +1 -1
- package/dist/cjs/components/Forms/Suggestions/Suggestions.cjs +5 -26
- package/dist/cjs/components/Forms/Suggestions/Suggestions.cjs.map +1 -1
- package/dist/cjs/components/Forms/WarningText/WarningText.cjs +12 -23
- package/dist/cjs/components/Forms/WarningText/WarningText.cjs.map +1 -1
- package/dist/cjs/components/GlobalActions/GlobalActions.cjs +13 -27
- package/dist/cjs/components/GlobalActions/GlobalActions.cjs.map +1 -1
- package/dist/cjs/components/Grid/Grid.cjs +2 -7
- package/dist/cjs/components/Grid/Grid.cjs.map +1 -1
- package/dist/cjs/components/Header/Actions/Actions.cjs +2 -6
- package/dist/cjs/components/Header/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/Header/Brand/Brand.cjs +8 -14
- package/dist/cjs/components/Header/Brand/Brand.cjs.map +1 -1
- package/dist/cjs/components/Header/Header.cjs +9 -16
- package/dist/cjs/components/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuBar/Bar.cjs +6 -14
- package/dist/cjs/components/Header/Navigation/MenuBar/Bar.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuBar/MenuBar.cjs +2 -13
- package/dist/cjs/components/Header/Navigation/MenuBar/MenuBar.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.cjs +12 -42
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/Navigation.cjs +2 -17
- package/dist/cjs/components/Header/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/utils/FocusContext.cjs +2 -5
- package/dist/cjs/components/Header/Navigation/utils/FocusContext.cjs.map +1 -1
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs +17 -47
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.cjs +45 -116
- package/dist/cjs/components/Input/Input.cjs.map +1 -1
- package/dist/cjs/components/Kpi/Kpi.cjs +16 -47
- package/dist/cjs/components/Kpi/Kpi.cjs.map +1 -1
- package/dist/cjs/components/Link/Link.cjs +2 -8
- package/dist/cjs/components/Link/Link.cjs.map +1 -1
- package/dist/cjs/components/List/List.cjs +46 -108
- package/dist/cjs/components/List/List.cjs.map +1 -1
- package/dist/cjs/components/ListContainer/ListContainer.cjs +2 -11
- package/dist/cjs/components/ListContainer/ListContainer.cjs.map +1 -1
- package/dist/cjs/components/ListContainer/ListItem/ListItem.cjs +33 -34
- package/dist/cjs/components/ListContainer/ListItem/ListItem.cjs.map +1 -1
- package/dist/cjs/components/Loading/Loading.cjs +7 -19
- package/dist/cjs/components/Loading/Loading.cjs.map +1 -1
- package/dist/cjs/components/Login/Login.cjs +4 -13
- package/dist/cjs/components/Login/Login.cjs.map +1 -1
- package/dist/cjs/components/MultiButton/MultiButton.cjs +16 -20
- package/dist/cjs/components/MultiButton/MultiButton.cjs.map +1 -1
- package/dist/cjs/components/OverflowTooltip/OverflowTooltip.cjs +19 -24
- package/dist/cjs/components/OverflowTooltip/OverflowTooltip.cjs.map +1 -1
- package/dist/cjs/components/Pagination/ButtonIconTooltip.cjs +1 -12
- package/dist/cjs/components/Pagination/ButtonIconTooltip.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs +28 -123
- package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Select.cjs +7 -26
- package/dist/cjs/components/Pagination/Select.cjs.map +1 -1
- package/dist/cjs/components/Panel/Panel.cjs +2 -7
- package/dist/cjs/components/Panel/Panel.cjs.map +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs +12 -32
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.cjs +11 -28
- package/dist/cjs/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs +5 -20
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Attribute/Attribute.cjs +31 -43
- package/dist/cjs/components/QueryBuilder/Rule/Attribute/Attribute.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Operator/Operator.cjs +20 -32
- package/dist/cjs/components/QueryBuilder/Rule/Operator/Operator.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Rule.cjs +17 -57
- package/dist/cjs/components/QueryBuilder/Rule/Rule.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.cjs +18 -29
- package/dist/cjs/components/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs +24 -79
- package/dist/cjs/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs +35 -89
- package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/TextValue/TextValue.cjs +16 -29
- package/dist/cjs/components/QueryBuilder/Rule/Value/TextValue/TextValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/Value.cjs +5 -22
- package/dist/cjs/components/QueryBuilder/Rule/Value/Value.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs +75 -153
- package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs.map +1 -1
- package/dist/cjs/components/Radio/Radio.cjs +22 -52
- package/dist/cjs/components/Radio/Radio.cjs.map +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup.cjs +11 -37
- package/dist/cjs/components/RadioGroup/RadioGroup.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs +4 -24
- package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs +25 -45
- package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs +18 -31
- package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs +3 -29
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/withTooltip.cjs +2 -6
- package/dist/cjs/components/ScrollTo/withTooltip.cjs.map +1 -1
- package/dist/cjs/components/SelectionList/SelectionList.cjs +11 -43
- package/dist/cjs/components/SelectionList/SelectionList.cjs.map +1 -1
- package/dist/cjs/components/SimpleGrid/SimpleGrid.cjs +2 -6
- package/dist/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
- package/dist/cjs/components/Slider/Slider.cjs +26 -116
- package/dist/cjs/components/Slider/Slider.cjs.map +1 -1
- package/dist/cjs/components/Slider/SliderInput/SliderInput.cjs +9 -29
- package/dist/cjs/components/Slider/SliderInput/SliderInput.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.cjs +6 -40
- package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarContent/SnackbarContent.cjs +9 -31
- package/dist/cjs/components/Snackbar/SnackbarContent/SnackbarContent.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarContent/SnackbarContent.styles.cjs +1 -1
- package/dist/cjs/components/Snackbar/SnackbarProvider/SnackbarProvider.cjs +4 -27
- package/dist/cjs/components/Snackbar/SnackbarProvider/SnackbarProvider.cjs.map +1 -1
- package/dist/cjs/components/Stack/Stack.cjs +8 -27
- package/dist/cjs/components/Stack/Stack.cjs.map +1 -1
- package/dist/cjs/components/Switch/Switch.cjs +15 -47
- package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
- package/dist/cjs/components/Tab/Tab.cjs +17 -14
- package/dist/cjs/components/Tab/Tab.cjs.map +1 -1
- package/dist/cjs/components/Table/Table.cjs +6 -14
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/Table/TableBody/TableBody.cjs +6 -24
- package/dist/cjs/components/Table/TableBody/TableBody.cjs.map +1 -1
- package/dist/cjs/components/Table/TableCell/TableCell.cjs +23 -30
- package/dist/cjs/components/Table/TableCell/TableCell.cjs.map +1 -1
- package/dist/cjs/components/Table/TableContainer/TableContainer.cjs +2 -6
- package/dist/cjs/components/Table/TableContainer/TableContainer.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHead/TableHead.cjs +4 -12
- package/dist/cjs/components/Table/TableHead/TableHead.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHeader/TableHeader.cjs +30 -56
- package/dist/cjs/components/Table/TableHeader/TableHeader.cjs.map +1 -1
- package/dist/cjs/components/Table/TableRow/TableRow.cjs +21 -26
- package/dist/cjs/components/Table/TableRow/TableRow.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useRowExpand.cjs +5 -14
- package/dist/cjs/components/Table/hooks/useRowExpand.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useRowSelection.cjs +2 -8
- package/dist/cjs/components/Table/hooks/useRowSelection.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useTable.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/DateColumnCell/DateColumnCell.cjs +2 -4
- package/dist/cjs/components/Table/renderers/DateColumnCell/DateColumnCell.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.cjs +3 -10
- package/dist/cjs/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.cjs +7 -20
- package/dist/cjs/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs +9 -22
- package/dist/cjs/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/renderers.cjs +28 -78
- package/dist/cjs/components/Table/renderers/renderers.cjs.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs +9 -13
- package/dist/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Tag/Tag.cjs +28 -52
- package/dist/cjs/components/Tag/Tag.cjs.map +1 -1
- package/dist/cjs/components/TagsInput/TagsInput.cjs +66 -139
- package/dist/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/dist/cjs/components/TextArea/TextArea.cjs +26 -71
- package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/cjs/components/TimeAgo/TimeAgo.cjs +3 -10
- package/dist/cjs/components/TimeAgo/TimeAgo.cjs.map +1 -1
- package/dist/cjs/components/TimePicker/Placeholder.cjs +15 -31
- package/dist/cjs/components/TimePicker/Placeholder.cjs.map +1 -1
- package/dist/cjs/components/TimePicker/TimePicker.cjs +31 -91
- package/dist/cjs/components/TimePicker/TimePicker.cjs.map +1 -1
- package/dist/cjs/components/TimePicker/Unit/Unit.cjs +22 -42
- package/dist/cjs/components/TimePicker/Unit/Unit.cjs.map +1 -1
- package/dist/cjs/components/ToggleButton/ToggleButton.cjs +2 -9
- package/dist/cjs/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs +8 -21
- package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/cjs/components/Typography/Typography.cjs +6 -10
- package/dist/cjs/components/Typography/Typography.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Action.cjs +10 -18
- package/dist/cjs/components/VerticalNavigation/Actions/Action.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.cjs +4 -9
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs +10 -28
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs +8 -56
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.cjs +2 -18
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +10 -32
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs +7 -19
- package/dist/cjs/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TooltipWrapper/TooltipWrapper.cjs +1 -7
- package/dist/cjs/components/VerticalNavigation/TreeView/TooltipWrapper/TooltipWrapper.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeView.cjs +11 -26
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeView.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs +46 -80
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/descendants.cjs +2 -5
- package/dist/cjs/components/VerticalNavigation/TreeView/descendants.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs +6 -14
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs.map +1 -1
- package/dist/cjs/hocs/withTooltip.cjs +5 -24
- package/dist/cjs/hocs/withTooltip.cjs.map +1 -1
- package/dist/cjs/hooks/useEmotionCache.cjs +1 -1
- package/dist/cjs/hooks/useTheme.cjs +1 -1
- package/dist/cjs/providers/Provider.cjs +18 -33
- package/dist/cjs/providers/Provider.cjs.map +1 -1
- package/dist/cjs/providers/ThemeProvider.cjs +2 -11
- package/dist/cjs/providers/ThemeProvider.cjs.map +1 -1
- package/dist/cjs/utils/iconVariant.cjs +5 -16
- package/dist/cjs/utils/iconVariant.cjs.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +14 -42
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/ActionBar/ActionBar.js +2 -6
- package/dist/esm/components/ActionBar/ActionBar.js.map +1 -1
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js +17 -42
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/components/AppSwitcher/Action/Action.js +15 -62
- package/dist/esm/components/AppSwitcher/Action/Action.js.map +1 -1
- package/dist/esm/components/AppSwitcher/AppSwitcher.js +18 -40
- package/dist/esm/components/AppSwitcher/AppSwitcher.js.map +1 -1
- package/dist/esm/components/AppSwitcher/TitleWithTooltip.js +2 -15
- package/dist/esm/components/AppSwitcher/TitleWithTooltip.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +13 -30
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +12 -22
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js +11 -36
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/ActionContainer/ActionContainer.js +5 -26
- package/dist/esm/components/Banner/BannerContent/ActionContainer/ActionContainer.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/BannerContent.js +12 -33
- package/dist/esm/components/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/MessageContainer/MessageContainer.js +6 -20
- package/dist/esm/components/Banner/BannerContent/MessageContainer/MessageContainer.js.map +1 -1
- package/dist/esm/components/BaseCheckBox/BaseCheckBox.js +8 -38
- package/dist/esm/components/BaseCheckBox/BaseCheckBox.js.map +1 -1
- package/dist/esm/components/BaseDropdown/BaseDropdown.js +68 -95
- package/dist/esm/components/BaseDropdown/BaseDropdown.js.map +1 -1
- package/dist/esm/components/BaseInput/BaseInput.js +31 -52
- package/dist/esm/components/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/components/BaseRadio/BaseRadio.js +7 -32
- package/dist/esm/components/BaseRadio/BaseRadio.js.map +1 -1
- package/dist/esm/components/BaseSwitch/BaseSwitch.js +13 -31
- package/dist/esm/components/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/esm/components/Box/Box.js +2 -7
- package/dist/esm/components/Box/Box.js.map +1 -1
- package/dist/esm/components/BreadCrumb/BreadCrumb.js +12 -33
- package/dist/esm/components/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/esm/components/BreadCrumb/Page/Page.js +2 -13
- package/dist/esm/components/BreadCrumb/Page/Page.js.map +1 -1
- package/dist/esm/components/BreadCrumb/PathElement/PathElement.js +5 -8
- package/dist/esm/components/BreadCrumb/PathElement/PathElement.js.map +1 -1
- package/dist/esm/components/BreadCrumb/utils.js +2 -11
- package/dist/esm/components/BreadCrumb/utils.js.map +1 -1
- package/dist/esm/components/BulkActions/BulkActions.js +34 -69
- package/dist/esm/components/BulkActions/BulkActions.js.map +1 -1
- package/dist/esm/components/Button/Button.js +15 -24
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js +12 -54
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js +16 -44
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +15 -31
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +10 -24
- package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.js +24 -35
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.js +8 -10
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.js.map +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js +15 -33
- package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.js +13 -54
- package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.js.map +1 -1
- package/dist/esm/components/Card/Card.js +16 -22
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/Content/Content.js +2 -8
- package/dist/esm/components/Card/Content/Content.js.map +1 -1
- package/dist/esm/components/Card/Header/Header.js +15 -23
- package/dist/esm/components/Card/Header/Header.js.map +1 -1
- package/dist/esm/components/Card/Media/Media.js +5 -14
- package/dist/esm/components/Card/Media/Media.js.map +1 -1
- package/dist/esm/components/Carousel/Carousel.js +37 -94
- package/dist/esm/components/Carousel/Carousel.js.map +1 -1
- package/dist/esm/components/Carousel/CarouselControls.js +11 -33
- package/dist/esm/components/Carousel/CarouselControls.js.map +1 -1
- package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.js +4 -12
- package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.js.map +1 -1
- package/dist/esm/components/Carousel/CarouselThumbnails.js +6 -23
- package/dist/esm/components/Carousel/CarouselThumbnails.js.map +1 -1
- package/dist/esm/components/CheckBox/CheckBox.js +23 -57
- package/dist/esm/components/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/CheckBoxGroup/CheckBoxGroup.js +21 -55
- package/dist/esm/components/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/esm/components/ColorPicker/ColorPicker.js +28 -87
- package/dist/esm/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/components/ColorPicker/Fields/Fields.js +7 -37
- package/dist/esm/components/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/esm/components/ColorPicker/Picker/Picker.js +11 -38
- package/dist/esm/components/ColorPicker/Picker/Picker.js.map +1 -1
- package/dist/esm/components/ColorPicker/PresetColors/PresetColors.js +7 -21
- package/dist/esm/components/ColorPicker/PresetColors/PresetColors.js.map +1 -1
- package/dist/esm/components/ColorPicker/SavedColors/SavedColors.js +10 -39
- package/dist/esm/components/ColorPicker/SavedColors/SavedColors.js.map +1 -1
- package/dist/esm/components/Container/Container.js +13 -21
- package/dist/esm/components/Container/Container.js.map +1 -1
- package/dist/esm/components/Controls/Controls.js +15 -32
- package/dist/esm/components/Controls/Controls.js.map +1 -1
- package/dist/esm/components/Controls/LeftControl/LeftControl.js +5 -13
- package/dist/esm/components/Controls/LeftControl/LeftControl.js.map +1 -1
- package/dist/esm/components/Controls/RightControl/RightControl.js +5 -14
- package/dist/esm/components/Controls/RightControl/RightControl.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js +40 -119
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/Dialog/Actions/Actions.js +7 -12
- package/dist/esm/components/Dialog/Actions/Actions.js.map +1 -1
- package/dist/esm/components/Dialog/Content/Content.js +4 -8
- package/dist/esm/components/Dialog/Content/Content.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +29 -54
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/Title/Title.js +14 -21
- package/dist/esm/components/Dialog/Title/Title.js.map +1 -1
- package/dist/esm/components/DotPagination/DotPagination.js +9 -29
- package/dist/esm/components/DotPagination/DotPagination.js.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js +16 -32
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/DropDownMenu/DropDownMenu.js +16 -55
- package/dist/esm/components/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js +36 -108
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Dropdown/List/List.js +40 -91
- package/dist/esm/components/Dropdown/List/List.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.js +20 -30
- package/dist/esm/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/esm/components/FileUploader/DropZone/DropZone.js +53 -93
- package/dist/esm/components/FileUploader/DropZone/DropZone.js.map +1 -1
- package/dist/esm/components/FileUploader/File/File.js +21 -53
- package/dist/esm/components/FileUploader/File/File.js.map +1 -1
- package/dist/esm/components/FileUploader/FileList/FileList.js +4 -14
- package/dist/esm/components/FileUploader/FileList/FileList.js.map +1 -1
- package/dist/esm/components/FileUploader/FileUploader.js +5 -22
- package/dist/esm/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/esm/components/FileUploader/Preview/Preview.js +11 -20
- package/dist/esm/components/FileUploader/Preview/Preview.js.map +1 -1
- package/dist/esm/components/FilterGroup/Counter/Counter.js +5 -8
- package/dist/esm/components/FilterGroup/Counter/Counter.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterContent/FilterContent.js +30 -84
- package/dist/esm/components/FilterGroup/FilterContent/FilterContent.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterGroup.js +11 -50
- package/dist/esm/components/FilterGroup/FilterGroup.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterGroupContext.js +2 -5
- package/dist/esm/components/FilterGroup/FilterGroupContext.js.map +1 -1
- package/dist/esm/components/FilterGroup/LeftPanel/LeftPanel.js +5 -23
- package/dist/esm/components/FilterGroup/LeftPanel/LeftPanel.js.map +1 -1
- package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js +16 -51
- package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js.map +1 -1
- package/dist/esm/components/Focus/Focus.js +19 -25
- package/dist/esm/components/Focus/Focus.js.map +1 -1
- package/dist/esm/components/Footer/Footer.js +11 -20
- package/dist/esm/components/Footer/Footer.js.map +1 -1
- package/dist/esm/components/Forms/Adornment/Adornment.js +6 -31
- package/dist/esm/components/Forms/Adornment/Adornment.js.map +1 -1
- package/dist/esm/components/Forms/CharCounter/CharCounter.js +14 -30
- package/dist/esm/components/Forms/CharCounter/CharCounter.js.map +1 -1
- package/dist/esm/components/Forms/FormElement/FormElement.js +2 -16
- package/dist/esm/components/Forms/FormElement/FormElement.js.map +1 -1
- package/dist/esm/components/Forms/InfoMessage/InfoMessage.js +5 -12
- package/dist/esm/components/Forms/InfoMessage/InfoMessage.js.map +1 -1
- package/dist/esm/components/Forms/Label/Label.js +11 -18
- package/dist/esm/components/Forms/Label/Label.js.map +1 -1
- package/dist/esm/components/Forms/Suggestions/Suggestions.js +5 -26
- package/dist/esm/components/Forms/Suggestions/Suggestions.js.map +1 -1
- package/dist/esm/components/Forms/WarningText/WarningText.js +12 -23
- package/dist/esm/components/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/esm/components/GlobalActions/GlobalActions.js +13 -27
- package/dist/esm/components/GlobalActions/GlobalActions.js.map +1 -1
- package/dist/esm/components/Grid/Grid.js +2 -7
- package/dist/esm/components/Grid/Grid.js.map +1 -1
- package/dist/esm/components/Header/Actions/Actions.js +2 -6
- package/dist/esm/components/Header/Actions/Actions.js.map +1 -1
- package/dist/esm/components/Header/Brand/Brand.js +8 -14
- package/dist/esm/components/Header/Brand/Brand.js.map +1 -1
- package/dist/esm/components/Header/Header.js +9 -16
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuBar/Bar.js +6 -14
- package/dist/esm/components/Header/Navigation/MenuBar/Bar.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuBar/MenuBar.js +2 -13
- package/dist/esm/components/Header/Navigation/MenuBar/MenuBar.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.js +12 -42
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
- package/dist/esm/components/Header/Navigation/Navigation.js +2 -17
- package/dist/esm/components/Header/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Header/Navigation/utils/FocusContext.js +2 -5
- package/dist/esm/components/Header/Navigation/utils/FocusContext.js.map +1 -1
- package/dist/esm/components/InlineEditor/InlineEditor.js +17 -47
- package/dist/esm/components/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/components/Input/Input.js +45 -116
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Kpi/Kpi.js +16 -47
- package/dist/esm/components/Kpi/Kpi.js.map +1 -1
- package/dist/esm/components/Link/Link.js +2 -8
- package/dist/esm/components/Link/Link.js.map +1 -1
- package/dist/esm/components/List/List.js +46 -108
- package/dist/esm/components/List/List.js.map +1 -1
- package/dist/esm/components/ListContainer/ListContainer.js +2 -11
- package/dist/esm/components/ListContainer/ListContainer.js.map +1 -1
- package/dist/esm/components/ListContainer/ListItem/ListItem.js +33 -34
- package/dist/esm/components/ListContainer/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/Loading/Loading.js +7 -19
- package/dist/esm/components/Loading/Loading.js.map +1 -1
- package/dist/esm/components/Login/Login.js +4 -13
- package/dist/esm/components/Login/Login.js.map +1 -1
- package/dist/esm/components/MultiButton/MultiButton.js +16 -20
- package/dist/esm/components/MultiButton/MultiButton.js.map +1 -1
- package/dist/esm/components/OverflowTooltip/OverflowTooltip.js +19 -24
- package/dist/esm/components/OverflowTooltip/OverflowTooltip.js.map +1 -1
- package/dist/esm/components/Pagination/ButtonIconTooltip.js +1 -12
- package/dist/esm/components/Pagination/ButtonIconTooltip.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +28 -123
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/Select.js +7 -26
- package/dist/esm/components/Pagination/Select.js.map +1 -1
- package/dist/esm/components/Panel/Panel.js +2 -7
- package/dist/esm/components/Panel/Panel.js.map +1 -1
- package/dist/esm/components/ProgressBar/ProgressBar.js +12 -32
- package/dist/esm/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js +11 -28
- package/dist/esm/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/dist/esm/components/QueryBuilder/QueryBuilder.js +5 -20
- package/dist/esm/components/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Attribute/Attribute.js +31 -43
- package/dist/esm/components/QueryBuilder/Rule/Attribute/Attribute.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Operator/Operator.js +20 -32
- package/dist/esm/components/QueryBuilder/Rule/Operator/Operator.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Rule.js +17 -57
- package/dist/esm/components/QueryBuilder/Rule/Rule.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.js +18 -29
- package/dist/esm/components/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js +24 -79
- package/dist/esm/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.js +35 -89
- package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/TextValue/TextValue.js +16 -29
- package/dist/esm/components/QueryBuilder/Rule/Value/TextValue/TextValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/Value.js +5 -22
- package/dist/esm/components/QueryBuilder/Rule/Value/Value.js.map +1 -1
- package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js +75 -153
- package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
- package/dist/esm/components/Radio/Radio.js +22 -52
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +11 -37
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +4 -24
- package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js +25 -45
- package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js +18 -31
- package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js +3 -29
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -1
- package/dist/esm/components/ScrollTo/withTooltip.js +2 -6
- package/dist/esm/components/ScrollTo/withTooltip.js.map +1 -1
- package/dist/esm/components/SelectionList/SelectionList.js +11 -43
- package/dist/esm/components/SelectionList/SelectionList.js.map +1 -1
- package/dist/esm/components/SimpleGrid/SimpleGrid.js +2 -6
- package/dist/esm/components/SimpleGrid/SimpleGrid.js.map +1 -1
- package/dist/esm/components/Slider/Slider.js +26 -116
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Slider/SliderInput/SliderInput.js +9 -29
- package/dist/esm/components/Slider/SliderInput/SliderInput.js.map +1 -1
- package/dist/esm/components/Snackbar/Snackbar.js +6 -40
- package/dist/esm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarContent/SnackbarContent.js +9 -31
- package/dist/esm/components/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarContent/SnackbarContent.styles.js +1 -1
- package/dist/esm/components/Snackbar/SnackbarProvider/SnackbarProvider.js +4 -27
- package/dist/esm/components/Snackbar/SnackbarProvider/SnackbarProvider.js.map +1 -1
- package/dist/esm/components/Stack/Stack.js +8 -27
- package/dist/esm/components/Stack/Stack.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +15 -47
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tab/Tab.js +17 -14
- package/dist/esm/components/Tab/Tab.js.map +1 -1
- package/dist/esm/components/Table/Table.js +6 -14
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/TableBody/TableBody.js +6 -24
- package/dist/esm/components/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/components/Table/TableCell/TableCell.js +23 -30
- package/dist/esm/components/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/Table/TableContainer/TableContainer.js +2 -6
- package/dist/esm/components/Table/TableContainer/TableContainer.js.map +1 -1
- package/dist/esm/components/Table/TableHead/TableHead.js +4 -12
- package/dist/esm/components/Table/TableHead/TableHead.js.map +1 -1
- package/dist/esm/components/Table/TableHeader/TableHeader.js +30 -56
- package/dist/esm/components/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/esm/components/Table/TableRow/TableRow.js +21 -26
- package/dist/esm/components/Table/TableRow/TableRow.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowExpand.js +5 -14
- package/dist/esm/components/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowSelection.js +2 -8
- package/dist/esm/components/Table/hooks/useRowSelection.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/components/Table/renderers/DateColumnCell/DateColumnCell.js +2 -4
- package/dist/esm/components/Table/renderers/DateColumnCell/DateColumnCell.js.map +1 -1
- package/dist/esm/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.js +3 -10
- package/dist/esm/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.js.map +1 -1
- package/dist/esm/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.js +7 -20
- package/dist/esm/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.js.map +1 -1
- package/dist/esm/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.js +9 -22
- package/dist/esm/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.js.map +1 -1
- package/dist/esm/components/Table/renderers/renderers.js +28 -78
- package/dist/esm/components/Table/renderers/renderers.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +9 -13
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Tag/Tag.js +28 -52
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/TagsInput/TagsInput.js +66 -139
- package/dist/esm/components/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/components/TextArea/TextArea.js +26 -71
- package/dist/esm/components/TextArea/TextArea.js.map +1 -1
- package/dist/esm/components/TimeAgo/TimeAgo.js +3 -10
- package/dist/esm/components/TimeAgo/TimeAgo.js.map +1 -1
- package/dist/esm/components/TimePicker/Placeholder.js +15 -31
- package/dist/esm/components/TimePicker/Placeholder.js.map +1 -1
- package/dist/esm/components/TimePicker/TimePicker.js +31 -91
- package/dist/esm/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/components/TimePicker/Unit/Unit.js +22 -42
- package/dist/esm/components/TimePicker/Unit/Unit.js.map +1 -1
- package/dist/esm/components/ToggleButton/ToggleButton.js +2 -9
- package/dist/esm/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +8 -21
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Typography/Typography.js +6 -10
- package/dist/esm/components/Typography/Typography.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Action.js +10 -18
- package/dist/esm/components/VerticalNavigation/Actions/Action.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Actions.js +4 -9
- package/dist/esm/components/VerticalNavigation/Actions/Actions.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Header/Header.js +10 -28
- package/dist/esm/components/VerticalNavigation/Header/Header.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js +8 -56
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +2 -18
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js +10 -32
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js +7 -19
- package/dist/esm/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TooltipWrapper/TooltipWrapper.js +1 -7
- package/dist/esm/components/VerticalNavigation/TreeView/TooltipWrapper/TooltipWrapper.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeView.js +11 -26
- package/dist/esm/components/VerticalNavigation/TreeView/TreeView.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js +46 -80
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/descendants.js +2 -5
- package/dist/esm/components/VerticalNavigation/TreeView/descendants.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js +6 -14
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/hocs/withTooltip.js +5 -24
- package/dist/esm/hocs/withTooltip.js.map +1 -1
- package/dist/esm/hooks/useEmotionCache.js +1 -1
- package/dist/esm/hooks/useTheme.js +1 -1
- package/dist/esm/providers/Provider.js +18 -33
- package/dist/esm/providers/Provider.js.map +1 -1
- package/dist/esm/providers/ThemeProvider.js +2 -11
- package/dist/esm/providers/ThemeProvider.js.map +1 -1
- package/dist/esm/utils/iconVariant.js +5 -16
- package/dist/esm/utils/iconVariant.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.js","sources":["../../../../src/components/ActionBar/ActionBar.tsx"],"sourcesContent":["import { HvBaseProps } from \"@core/types/generic\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\n\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: HvActionBarProps) => {\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 className={cx(classes.root, className)} {...others}>\n {children}\n </div>\n );\n};\n"],"names":["HvActionBar","props","classes","classesProp","className","children","others","useDefaultProps","cx","useClasses","root"],"mappings":";;;;AAgBaA,MAAAA,cAAcA,CAACC,UAA4B;AAChD,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,eAAeN,KAAK;AAClC,QAAA;AAAA,IAAEC;AAAAA,IAASM;AAAAA,EAAAA,IAAOC,WAAWN,WAAW;
|
|
1
|
+
{"version":3,"file":"ActionBar.js","sources":["../../../../src/components/ActionBar/ActionBar.tsx"],"sourcesContent":["import { HvBaseProps } from \"@core/types/generic\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\n\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: HvActionBarProps) => {\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 className={cx(classes.root, className)} {...others}>\n {children}\n </div>\n );\n};\n"],"names":["HvActionBar","props","classes","classesProp","className","children","others","useDefaultProps","cx","useClasses","root"],"mappings":";;;;AAgBaA,MAAAA,cAAcA,CAACC,UAA4B;AAChD,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,eAAeN,KAAK;AAClC,QAAA;AAAA,IAAEC;AAAAA,IAASM;AAAAA,EAAAA,IAAOC,WAAWN,WAAW;AAG5C,SAAA,oBAAC,OAAI,EAAA,WAAWK,GAAGN,QAAQQ,MAAMN,SAAS,GAAG,GAAIE,QAC9CD,SACH,CAAA;AAEJ;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
1
2
|
import { isValidElement } from "react";
|
|
2
3
|
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
3
4
|
import { MoreOptionsVertical } from "@hitachivantara/uikit-react-icons";
|
|
@@ -7,7 +8,6 @@ import { setId } from "../../utils/setId.js";
|
|
|
7
8
|
import { useTheme } from "../../hooks/useTheme.js";
|
|
8
9
|
import { useClasses } from "./ActionsGeneric.styles.js";
|
|
9
10
|
import { staticClasses } from "./ActionsGeneric.styles.js";
|
|
10
|
-
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
11
11
|
import { HvButton } from "../Button/Button.js";
|
|
12
12
|
import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js";
|
|
13
13
|
const HvActionsGeneric = (props) => {
|
|
@@ -44,55 +44,30 @@ const HvActionsGeneric = (props) => {
|
|
|
44
44
|
const renderedIcon = isValidElement(icon) ? icon : icon == null ? void 0 : icon({
|
|
45
45
|
isDisabled: disabled
|
|
46
46
|
});
|
|
47
|
-
return /* @__PURE__ */ jsx(HvButton, {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
backgroundColor: hexToRgbA((colors == null ? void 0 : colors.base_light) || theme.colors.base_light, 0.3)
|
|
53
|
-
}
|
|
54
|
-
}), classes.button),
|
|
55
|
-
disabled: actDisabled ?? disabled,
|
|
56
|
-
onClick: (event) => actionsCallback == null ? void 0 : actionsCallback(event, id || "", action),
|
|
57
|
-
startIcon: renderedIcon,
|
|
58
|
-
...other,
|
|
59
|
-
children: label
|
|
60
|
-
}, actionId || idx);
|
|
47
|
+
return /* @__PURE__ */ jsx(HvButton, { id: actionId, variant: category, className: cx(css({
|
|
48
|
+
"&:hover": {
|
|
49
|
+
backgroundColor: hexToRgbA((colors == null ? void 0 : colors.base_light) || theme.colors.base_light, 0.3)
|
|
50
|
+
}
|
|
51
|
+
}), classes.button), disabled: actDisabled ?? disabled, onClick: (event) => actionsCallback == null ? void 0 : actionsCallback(event, id || "", action), startIcon: renderedIcon, ...other, children: label }, actionId || idx);
|
|
61
52
|
};
|
|
62
53
|
const renderActionsGrid = () => {
|
|
63
54
|
const actsVisible = actions.slice(0, maxVisibleActions);
|
|
64
55
|
const actsDropdown = actions.slice(maxVisibleActions);
|
|
65
56
|
const semantic = category === "semantic";
|
|
66
57
|
const iconColor = disabled && "secondary_60" || semantic && "base_dark" || void 0;
|
|
67
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
iconSelected: classes.dropDownMenuButtonSelected
|
|
76
|
-
},
|
|
77
|
-
icon: /* @__PURE__ */ jsx(MoreOptionsVertical, {
|
|
78
|
-
color: iconColor
|
|
79
|
-
}),
|
|
80
|
-
placement: "left",
|
|
81
|
-
onClick: (event, action) => actionsCallback == null ? void 0 : actionsCallback(event, id || "", action),
|
|
82
|
-
dataList: actsDropdown,
|
|
83
|
-
keepOpened: false,
|
|
84
|
-
disablePortal: false
|
|
85
|
-
})]
|
|
86
|
-
});
|
|
58
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
+
actsVisible.map((action, idx) => renderButton(action, idx)),
|
|
60
|
+
/* @__PURE__ */ jsx(HvDropDownMenu, { id: setId(id, "menu"), disabled, category, classes: {
|
|
61
|
+
root: classes.dropDownMenu,
|
|
62
|
+
icon: classes.dropDownMenuButton,
|
|
63
|
+
iconSelected: classes.dropDownMenuButtonSelected
|
|
64
|
+
}, icon: /* @__PURE__ */ jsx(MoreOptionsVertical, { color: iconColor }), placement: "left", onClick: (event, action) => actionsCallback == null ? void 0 : actionsCallback(event, id || "", action), dataList: actsDropdown, keepOpened: false, disablePortal: false })
|
|
65
|
+
] });
|
|
87
66
|
};
|
|
88
67
|
const actionOverflow = actions.length > maxVisibleActions;
|
|
89
|
-
return /* @__PURE__ */ jsx("div", {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, className),
|
|
93
|
-
...others,
|
|
94
|
-
children: actionOverflow ? renderActionsGrid() : actions.map((action, idx) => renderButton(action, idx))
|
|
95
|
-
});
|
|
68
|
+
return /* @__PURE__ */ jsx("div", { className: cx(classes.root, {
|
|
69
|
+
[classes.actionContainer]: actionOverflow
|
|
70
|
+
}, className), ...others, children: actionOverflow ? renderActionsGrid() : actions.map((action, idx) => renderButton(action, idx)) });
|
|
96
71
|
};
|
|
97
72
|
export {
|
|
98
73
|
HvActionsGeneric,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsGeneric.js","sources":["../../../../src/components/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import React, { isValidElement } from \"react\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\nimport { HvButton, HvButtonVariant } from \"@core/components/Button\";\nimport { HvDropDownMenu } from \"@core/components/DropDownMenu\";\nimport { setId } from \"@core/utils/setId\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useTheme } from \"@core/hooks/useTheme\";\n\nimport { staticClasses, useClasses } from \"./ActionsGeneric.styles\";\n\nexport { staticClasses as actionsGenericClasses };\n\nexport type HvActionsGenericClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvActionGeneric {\n id: string;\n label: string;\n icon?:\n | React.ReactNode\n | ((params: { isDisabled?: boolean }) => React.ReactNode);\n disabled?: boolean;\n}\n\nexport interface HvActionsGenericProps extends HvBaseProps {\n /** Button category. */\n category?: HvButtonVariant;\n /** Whether actions should be all disabled */\n disabled?: boolean;\n /** The renderable content inside the actions slot of the footer, or an Array of actions `{id, label, icon, disabled}` */\n actions: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** The number of maximum visible actions before they're collapsed into a `DropDownMenu`. */\n maxVisibleActions?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionsGenericClasses;\n}\n\nexport const HvActionsGeneric = (props: HvActionsGenericProps) => {\n const {\n id,\n classes: classesProp,\n className,\n category = \"secondaryGhost\",\n disabled = false,\n actions = [],\n actionsCallback,\n maxVisibleActions = Infinity,\n ...others\n } = useDefaultProps(\"HvActionsGeneric\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const { colors } = useTheme();\n\n if (!Array.isArray(actions)) return isValidElement(actions) ? actions : null;\n\n const renderButton = (action: HvActionGeneric, idx: number) => {\n const { disabled: actDisabled, id: actId, icon, label, ...other } = action;\n const actionId = setId(id, idx, \"action\", action.id);\n\n const renderedIcon = isValidElement(icon)\n ? icon\n : (icon as Function)?.({ isDisabled: disabled });\n\n return (\n <HvButton\n id={actionId}\n key={actionId || idx}\n variant={category}\n className={cx(\n css({\n \"&:hover\": {\n backgroundColor: hexToRgbA(\n colors?.base_light || theme.colors.base_light,\n 0.3\n ),\n },\n }),\n classes.button\n )}\n disabled={actDisabled ?? disabled}\n onClick={(event) => actionsCallback?.(event, id || \"\", action)}\n startIcon={renderedIcon}\n {...other}\n >\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 = category === \"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(id, \"menu\")}\n disabled={disabled}\n category={category}\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 actionsCallback?.(event, id || \"\", action as HvActionGeneric)\n }\n dataList={actsDropdown}\n keepOpened={false}\n disablePortal={false}\n />\n </>\n );\n };\n\n const actionOverflow = actions.length > maxVisibleActions;\n\n return (\n <div\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","props","id","classes","classesProp","className","category","disabled","actions","actionsCallback","maxVisibleActions","Infinity","others","useDefaultProps","cx","css","useClasses","colors","useTheme","Array","isArray","isValidElement","renderButton","action","idx","actDisabled","actId","icon","label","other","actionId","setId","renderedIcon","isDisabled","
|
|
1
|
+
{"version":3,"file":"ActionsGeneric.js","sources":["../../../../src/components/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import React, { isValidElement } from \"react\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\nimport { HvButton, HvButtonVariant } from \"@core/components/Button\";\nimport { HvDropDownMenu } from \"@core/components/DropDownMenu\";\nimport { setId } from \"@core/utils/setId\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useTheme } from \"@core/hooks/useTheme\";\n\nimport { staticClasses, useClasses } from \"./ActionsGeneric.styles\";\n\nexport { staticClasses as actionsGenericClasses };\n\nexport type HvActionsGenericClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvActionGeneric {\n id: string;\n label: string;\n icon?:\n | React.ReactNode\n | ((params: { isDisabled?: boolean }) => React.ReactNode);\n disabled?: boolean;\n}\n\nexport interface HvActionsGenericProps extends HvBaseProps {\n /** Button category. */\n category?: HvButtonVariant;\n /** Whether actions should be all disabled */\n disabled?: boolean;\n /** The renderable content inside the actions slot of the footer, or an Array of actions `{id, label, icon, disabled}` */\n actions: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** The number of maximum visible actions before they're collapsed into a `DropDownMenu`. */\n maxVisibleActions?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionsGenericClasses;\n}\n\nexport const HvActionsGeneric = (props: HvActionsGenericProps) => {\n const {\n id,\n classes: classesProp,\n className,\n category = \"secondaryGhost\",\n disabled = false,\n actions = [],\n actionsCallback,\n maxVisibleActions = Infinity,\n ...others\n } = useDefaultProps(\"HvActionsGeneric\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const { colors } = useTheme();\n\n if (!Array.isArray(actions)) return isValidElement(actions) ? actions : null;\n\n const renderButton = (action: HvActionGeneric, idx: number) => {\n const { disabled: actDisabled, id: actId, icon, label, ...other } = action;\n const actionId = setId(id, idx, \"action\", action.id);\n\n const renderedIcon = isValidElement(icon)\n ? icon\n : (icon as Function)?.({ isDisabled: disabled });\n\n return (\n <HvButton\n id={actionId}\n key={actionId || idx}\n variant={category}\n className={cx(\n css({\n \"&:hover\": {\n backgroundColor: hexToRgbA(\n colors?.base_light || theme.colors.base_light,\n 0.3\n ),\n },\n }),\n classes.button\n )}\n disabled={actDisabled ?? disabled}\n onClick={(event) => actionsCallback?.(event, id || \"\", action)}\n startIcon={renderedIcon}\n {...other}\n >\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 = category === \"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(id, \"menu\")}\n disabled={disabled}\n category={category}\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 actionsCallback?.(event, id || \"\", action as HvActionGeneric)\n }\n dataList={actsDropdown}\n keepOpened={false}\n disablePortal={false}\n />\n </>\n );\n };\n\n const actionOverflow = actions.length > maxVisibleActions;\n\n return (\n <div\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","props","id","classes","classesProp","className","category","disabled","actions","actionsCallback","maxVisibleActions","Infinity","others","useDefaultProps","cx","css","useClasses","colors","useTheme","Array","isArray","isValidElement","renderButton","action","idx","actDisabled","actId","icon","label","other","actionId","setId","renderedIcon","isDisabled","backgroundColor","hexToRgbA","base_light","theme","button","event","renderActionsGrid","actsVisible","slice","actsDropdown","semantic","iconColor","undefined","map","root","dropDownMenu","dropDownMenuButton","iconSelected","dropDownMenuButtonSelected","actionOverflow","length","actionContainer"],"mappings":";;;;;;;;;;;;AAgDaA,MAAAA,mBAAmBA,CAACC,UAAiC;AAC1D,QAAA;AAAA,IACJC;AAAAA,IACAC,SAASC;AAAAA,IACTC;AAAAA,IACAC,WAAW;AAAA,IACXC,WAAW;AAAA,IACXC,UAAU,CAAE;AAAA,IACZC;AAAAA,IACAC,oBAAoBC;AAAAA,IACpB,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,oBAAoBZ,KAAK;AAEvC,QAAA;AAAA,IAAEE;AAAAA,IAASW;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWZ,WAAW;AAE7C,QAAA;AAAA,IAAEa;AAAAA,MAAWC,SAAS;AAExB,MAAA,CAACC,MAAMC,QAAQZ,OAAO;AAAUa,WAAAA,eAAeb,OAAO,IAAIA,UAAU;AAElEc,QAAAA,eAAeA,CAACC,QAAyBC,QAAgB;AACvD,UAAA;AAAA,MAAEjB,UAAUkB;AAAAA,MAAavB,IAAIwB;AAAAA,MAAOC;AAAAA,MAAMC;AAAAA,MAAO,GAAGC;AAAAA,IAAUN,IAAAA;AACpE,UAAMO,WAAWC,MAAM7B,IAAIsB,KAAK,UAAUD,OAAOrB,EAAE;AAEnD,UAAM8B,eAAeX,eAAeM,IAAI,IACpCA,OACCA,6BAAoB;AAAA,MAAEM,YAAY1B;AAAAA,IAAAA;AAGrC,WAAA,oBAAC,YACC,IAAIuB,UAEJ,SAASxB,UACT,WAAWQ,GACTC,IAAI;AAAA,MACF,WAAW;AAAA,QACTmB,iBAAiBC,WACflB,iCAAQmB,eAAcC,MAAMpB,OAAOmB,YACnC,GACF;AAAA,MACF;AAAA,IACD,CAAA,GACDjC,QAAQmC,MACV,GACA,UAAUb,eAAelB,UACzB,SAAUgC,CAAU9B,UAAAA,mDAAkB8B,OAAOrC,MAAM,IAAIqB,SACvD,WAAWS,cACX,GAAIH,OAEHD,UAlBIE,MAAAA,GAAAA,YAAYN,GAmBnB;AAAA,EAAA;AAIJ,QAAMgB,oBAAoBA,MAAM;AAC9B,UAAMC,cAAcjC,QAAQkC,MAAM,GAAGhC,iBAAiB;AAChDiC,UAAAA,eAAenC,QAAQkC,MAAMhC,iBAAiB;AAEpD,UAAMkC,WAAWtC,aAAa;AAC9B,UAAMuC,YACHtC,YAAY,kBAAoBqC,YAAY,eAAgBE;AAE/D,WAEKL,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,MAAAA,YAAYM,IAAI,CAACxB,QAAQC,QAAQF,aAAaC,QAAQC,GAAG,CAAC;AAAA,MAC3D,oBAAC,kBACC,IAAIO,MAAM7B,IAAI,MAAM,GACpB,UACA,UACA,SAAS;AAAA,QACP8C,MAAM7C,QAAQ8C;AAAAA,QACdtB,MAAMxB,QAAQ+C;AAAAA,QACdC,cAAchD,QAAQiD;AAAAA,MACxB,GACA,MAAM,oBAAC,qBAAoB,EAAA,OAAOP,WAAa,GAC/C,WAAU,QACV,SAAS,CAACN,OAAOhB,WACfd,mDAAkB8B,OAAOrC,MAAM,IAAIqB,SAErC,UAAUoB,cACV,YAAY,OACZ,eAAe,MAAM,CAAA;AAAA,IAEzB,EAAA,CAAA;AAAA,EAAA;AAIEU,QAAAA,iBAAiB7C,QAAQ8C,SAAS5C;AAExC,SACG,oBAAA,OAAA,EACC,WAAWI,GACTX,QAAQ6C,MACR;AAAA,IAAE,CAAC7C,QAAQoD,eAAe,GAAGF;AAAAA,EAAAA,GAC7BhD,SACF,GACA,GAAIO,QAEHyC,2BACGb,kBAAkB,IAClBhC,QAAQuC,IAAI,CAACxB,QAAQC,QAAQF,aAAaC,QAAQC,GAAG,CAAC,EAC5D,CAAA;AAEJ;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
1
2
|
import { useState, useCallback } from "react";
|
|
2
3
|
import { theme, getColor } from "@hitachivantara/uikit-styles";
|
|
3
4
|
import { Info } from "@hitachivantara/uikit-react-icons";
|
|
@@ -5,7 +6,6 @@ import { useUniqueId } from "../../../hooks/useUniqueId.js";
|
|
|
5
6
|
import TitleWithTooltip from "../TitleWithTooltip.js";
|
|
6
7
|
import { useClasses } from "./Action.styles.js";
|
|
7
8
|
import { staticClasses } from "./Action.styles.js";
|
|
8
|
-
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
9
9
|
import { HvAvatar } from "../../Avatar/Avatar.js";
|
|
10
10
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
11
11
|
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
@@ -39,24 +39,13 @@ const HvAppSwitcherAction = ({
|
|
|
39
39
|
return iconElement;
|
|
40
40
|
}
|
|
41
41
|
if (iconUrl && validIconUrl) {
|
|
42
|
-
return /* @__PURE__ */ jsx("img", {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onError: () => {
|
|
46
|
-
setValidIconUrl(false);
|
|
47
|
-
},
|
|
48
|
-
alt: description
|
|
49
|
-
});
|
|
42
|
+
return /* @__PURE__ */ jsx("img", { className: classes.iconUrl, src: iconUrl, onError: () => {
|
|
43
|
+
setValidIconUrl(false);
|
|
44
|
+
}, alt: description });
|
|
50
45
|
}
|
|
51
46
|
const brokenTitle = name.split(" ");
|
|
52
47
|
const initials = brokenTitle[0].substring(0, 1) + (brokenTitle[1] ? brokenTitle[1].substring(0, 1) : "");
|
|
53
|
-
return /* @__PURE__ */ jsx(HvAvatar, {
|
|
54
|
-
size: "sm",
|
|
55
|
-
backgroundColor: color,
|
|
56
|
-
variant: "square",
|
|
57
|
-
"aria-hidden": true,
|
|
58
|
-
children: initials
|
|
59
|
-
});
|
|
48
|
+
return /* @__PURE__ */ jsx(HvAvatar, { size: "sm", backgroundColor: color, variant: "square", "aria-hidden": true, children: initials });
|
|
60
49
|
};
|
|
61
50
|
const isSelected = isSelectedCallback(application);
|
|
62
51
|
const handleOnClick = useCallback((event) => {
|
|
@@ -84,54 +73,18 @@ const HvAppSwitcherAction = ({
|
|
|
84
73
|
}
|
|
85
74
|
};
|
|
86
75
|
if (isLink) {
|
|
87
|
-
return /* @__PURE__ */ jsx(HvTypography, {
|
|
88
|
-
component: "a",
|
|
89
|
-
href: url,
|
|
90
|
-
target: target || "_top",
|
|
91
|
-
...typographyProps,
|
|
92
|
-
children
|
|
93
|
-
});
|
|
76
|
+
return /* @__PURE__ */ jsx(HvTypography, { component: "a", href: url, target: target || "_top", ...typographyProps, children });
|
|
94
77
|
}
|
|
95
|
-
return /* @__PURE__ */ jsx(HvTypography, {
|
|
96
|
-
component: "button",
|
|
97
|
-
...typographyProps,
|
|
98
|
-
children
|
|
99
|
-
});
|
|
78
|
+
return /* @__PURE__ */ jsx(HvTypography, { component: "button", ...typographyProps, children });
|
|
100
79
|
}, [classes.typography, color, description, descriptionElementId, handleOnClick, isLink, name, target, url]);
|
|
101
|
-
return /* @__PURE__ */ jsx(HvListItem, {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
className:
|
|
108
|
-
|
|
109
|
-
[classes.selected]: isSelected
|
|
110
|
-
}, className),
|
|
111
|
-
children: renderApplication(/* @__PURE__ */ jsxs(Fragment, {
|
|
112
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
113
|
-
className: classes.icon,
|
|
114
|
-
children: renderApplicationIcon()
|
|
115
|
-
}), /* @__PURE__ */ jsx(TitleWithTooltip, {
|
|
116
|
-
title: name,
|
|
117
|
-
className: classes.title
|
|
118
|
-
}), description && /* @__PURE__ */ jsx(HvTooltip, {
|
|
119
|
-
disableFocusListener: true,
|
|
120
|
-
disableTouchListener: true,
|
|
121
|
-
title: /* @__PURE__ */ jsx(HvTypography, {
|
|
122
|
-
children: description
|
|
123
|
-
}),
|
|
124
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
125
|
-
children: /* @__PURE__ */ jsx(Info, {
|
|
126
|
-
className: classes.iconInfo,
|
|
127
|
-
role: "img",
|
|
128
|
-
"aria-label": description,
|
|
129
|
-
id: descriptionElementId
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
})]
|
|
133
|
-
}))
|
|
134
|
-
});
|
|
80
|
+
return /* @__PURE__ */ jsx(HvListItem, { id, interactive: true, tabIndex: 0, selected: isSelected, disabled, className: cx(classes.root, {
|
|
81
|
+
[classes.disabled]: disabled,
|
|
82
|
+
[classes.selected]: isSelected
|
|
83
|
+
}, className), children: renderApplication(/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: classes.icon, children: renderApplicationIcon() }),
|
|
85
|
+
/* @__PURE__ */ jsx(TitleWithTooltip, { title: name, className: classes.title }),
|
|
86
|
+
description && /* @__PURE__ */ jsx(HvTooltip, { disableFocusListener: true, disableTouchListener: true, title: /* @__PURE__ */ jsx(HvTypography, { children: description }), children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Info, { className: classes.iconInfo, role: "img", "aria-label": description, id: descriptionElementId }) }) })
|
|
87
|
+
] })) });
|
|
135
88
|
};
|
|
136
89
|
export {
|
|
137
90
|
HvAppSwitcherAction,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sources":["../../../../../src/components/AppSwitcher/Action/Action.tsx"],"sourcesContent":["import { useCallback, useState } from \"react\";\n\nimport { theme, getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\nimport { Info } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvAvatar } from \"@core/components/Avatar\";\nimport { HvListItem } from \"@core/components/ListContainer\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { HvTooltip } from \"@core/components/Tooltip\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useUniqueId } from \"@core/hooks/useUniqueId\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport TitleWithTooltip from \"../TitleWithTooltip\";\nimport { useClasses, staticClasses } from \"./Action.styles\";\n\nexport { staticClasses as appSwitcherActionClasses };\n\nexport type HvAppSwitcherActionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAppSwitcherActionApplication {\n /** Id of the application. */\n id?: string;\n /** Name of the application, this is the value that will be displayed on the component. */\n name: string;\n /** URL with the icon location to be used to represent the application. iconUrl will only be used if no iconElement is provided. */\n iconUrl?: string;\n /** Element to be added as the icon representing the application. The iconElement will be the primary option to be displayed. */\n iconElement?: React.ReactElement;\n /** Small description of the application. */\n description?: string;\n /** URL where the application is accessible. */\n url?: string;\n /** Defines if the application should be opened in the same tab or in a new one. */\n target?: \"_top\" | \"_blank\";\n /** If true, the item will be disabled. */\n disabled?: boolean;\n /** True when the application is selected, false otherwise. */\n isSelected?: boolean;\n /** The color of the application. */\n color?: HvColorAny;\n}\n\nexport interface HvAppSwitcherActionProps extends HvBaseProps {\n /** The application data to be used to render the Action object. */\n application: HvAppSwitcherActionApplication;\n /** Callback triggered when the action is clicked. */\n onClickCallback?: (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication\n ) => void;\n /** Must return a boolean stating if the action element is selected or not. */\n isSelectedCallback?: (application: HvAppSwitcherActionApplication) => boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAppSwitcherActionClasses;\n}\n\nexport const HvAppSwitcherAction = ({\n id,\n className,\n classes: classesProp,\n application,\n onClickCallback = () => {},\n isSelectedCallback = () => false,\n}: HvAppSwitcherActionProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const { name, description, disabled, iconElement, iconUrl, url, target } =\n application;\n\n const color = disabled\n ? theme.colors.secondary_60\n : getColor(application?.color, theme.colors.secondary);\n\n const [validIconUrl, setValidIconUrl] = useState<boolean>(true);\n\n const renderApplicationIcon = () => {\n if (iconElement) {\n return iconElement;\n }\n\n if (iconUrl && validIconUrl) {\n return (\n <img\n className={classes.iconUrl}\n src={iconUrl}\n onError={() => {\n setValidIconUrl(false);\n }}\n alt={description}\n />\n );\n }\n\n const brokenTitle = name.split(\" \");\n const initials =\n brokenTitle[0].substring(0, 1) +\n (brokenTitle[1] ? brokenTitle[1].substring(0, 1) : \"\");\n\n return (\n <HvAvatar size=\"sm\" backgroundColor={color} variant=\"square\" aria-hidden>\n {initials}\n </HvAvatar>\n );\n };\n\n const isSelected = isSelectedCallback(application);\n\n /**\n * Handles the onClick event and triggers the appropriate callback if it exists.\n */\n const handleOnClick = useCallback(\n (event: React.MouseEvent) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onClickCallback?.(event, { ...application, isSelected });\n },\n [application, disabled, isSelected, onClickCallback]\n );\n\n const isLink = url != null;\n const descriptionElementId = useUniqueId(id, \"hvAction-description\");\n\n const renderApplication = useCallback(\n (children: React.ReactNode) => {\n const typographyProps = {\n className: classes.typography,\n onClick: handleOnClick,\n style: { borderColor: color },\n \"aria-label\": name,\n ...(description && { \"aria-describedby\": descriptionElementId }),\n };\n\n if (isLink) {\n return (\n <HvTypography\n component=\"a\"\n href={url}\n target={target || \"_top\"}\n {...typographyProps}\n >\n {children}\n </HvTypography>\n );\n }\n\n return (\n <HvTypography component=\"button\" {...typographyProps}>\n {children}\n </HvTypography>\n );\n },\n [\n classes.typography,\n color,\n description,\n descriptionElementId,\n handleOnClick,\n isLink,\n name,\n target,\n url,\n ]\n );\n\n return (\n <HvListItem\n id={id}\n interactive\n tabIndex={0}\n selected={isSelected}\n disabled={disabled}\n className={cx(\n classes.root,\n { [classes.disabled]: disabled, [classes.selected]: isSelected },\n className\n )}\n >\n {/* As HvTooltip don't have the id prop, is not possible to use the aria-labelledby to reference it.\n In substitution is used the aria-label with the \"title\" value */}\n {renderApplication(\n <>\n <div className={classes.icon}>{renderApplicationIcon()}</div>\n\n <TitleWithTooltip title={name} className={classes.title} />\n\n {description && (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={<HvTypography>{description}</HvTypography>}\n >\n <div>\n <Info\n className={classes.iconInfo}\n role=\"img\"\n aria-label={description}\n id={descriptionElementId}\n />\n </div>\n </HvTooltip>\n )}\n </>\n )}\n </HvListItem>\n );\n};\n"],"names":["HvAppSwitcherAction","id","className","classes","classesProp","application","onClickCallback","isSelectedCallback","cx","useClasses","name","description","disabled","iconElement","iconUrl","url","target","color","theme","colors","secondary_60","getColor","secondary","validIconUrl","setValidIconUrl","useState","renderApplicationIcon","src","onError","alt","brokenTitle","split","initials","substring","HvAvatar","size","backgroundColor","variant","children","isSelected","handleOnClick","useCallback","event","preventDefault","isLink","descriptionElementId","useUniqueId","renderApplication","typographyProps","typography","onClick","style","borderColor","HvTypography","component","href","HvListItem","interactive","tabIndex","selected","root","_jsxs","_Fragment","_jsx","icon","TitleWithTooltip","title","HvTooltip","disableFocusListener","disableTouchListener","Info","iconInfo","role"],"mappings":";;;;;;;;;;;;AAyDO,MAAMA,sBAAsBA,CAAC;AAAA,EAClCC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACAC,kBAAkBA,MAAM;AAAA,EAAC;AAAA,EACzBC,qBAAqBA,MAAM;AACH,MAAM;AACxB,QAAA;AAAA,IAAEJ;AAAAA,IAASK;AAAAA,EAAAA,IAAOC,WAAWL,WAAW;AAExC,QAAA;AAAA,IAAEM;AAAAA,IAAMC;AAAAA,IAAaC;AAAAA,IAAUC;AAAAA,IAAaC;AAAAA,IAASC;AAAAA,IAAKC;AAAAA,EAC9DX,IAAAA;AAEIY,QAAAA,QAAQL,WACVM,MAAMC,OAAOC,eACbC,SAAShB,2CAAaY,OAAOC,MAAMC,OAAOG,SAAS;AAEvD,QAAM,CAACC,cAAcC,eAAe,IAAIC,SAAkB,IAAI;AAE9D,QAAMC,wBAAwBA,MAAM;AAClC,QAAIb,aAAa;AACRA,aAAAA;AAAAA,IACT;AAEA,QAAIC,WAAWS,cAAc;AAC3B,iCACE,OAAA;AAAA,QACErB,WAAWC,QAAQW;AAAAA,QACnBa,KAAKb;AAAAA,QACLc,SAASA,MAAM;AACbJ,0BAAgB,KAAK;AAAA,QACvB;AAAA,QACAK,KAAKlB;AAAAA,MAAAA,CACN;AAAA,IAEL;AAEMmB,UAAAA,cAAcpB,KAAKqB,MAAM,GAAG;AAClC,UAAMC,WACJF,YAAY,CAAC,EAAEG,UAAU,GAAG,CAAC,KAC5BH,YAAY,CAAC,IAAIA,YAAY,CAAC,EAAEG,UAAU,GAAG,CAAC,IAAI;AAErD,+BACGC,UAAQ;AAAA,MAACC,MAAK;AAAA,MAAKC,iBAAiBnB;AAAAA,MAAOoB,SAAQ;AAAA,MAAS,eAAW;AAAA,MAAAC,UACrEN;AAAAA,IAAAA,CACO;AAAA,EAAA;AAIRO,QAAAA,aAAahC,mBAAmBF,WAAW;AAK3CmC,QAAAA,gBAAgBC,YACpB,CAACC,UAA4B;AAC3B,QAAI9B,UAAU;AACZ8B,YAAMC,eAAe;AACrB;AAAA,IACF;AAEArC,uDAAkBoC,OAAO;AAAA,MAAE,GAAGrC;AAAAA,MAAakC;AAAAA,IAAAA;AAAAA,KAE7C,CAAClC,aAAaO,UAAU2B,YAAYjC,eAAe,CACrD;AAEA,QAAMsC,SAAS7B,OAAO;AAChB8B,QAAAA,uBAAuBC,YAAY7C,IAAI,sBAAsB;AAE7D8C,QAAAA,oBAAoBN,YACxB,CAACH,aAA8B;AAC7B,UAAMU,kBAAkB;AAAA,MACtB9C,WAAWC,QAAQ8C;AAAAA,MACnBC,SAASV;AAAAA,MACTW,OAAO;AAAA,QAAEC,aAAanC;AAAAA,MAAM;AAAA,MAC5B,cAAcP;AAAAA,MACd,GAAIC,eAAe;AAAA,QAAE,oBAAoBkC;AAAAA,MAAqB;AAAA,IAAA;AAGhE,QAAID,QAAQ;AACV,iCACGS,cAAY;AAAA,QACXC,WAAU;AAAA,QACVC,MAAMxC;AAAAA,QACNC,QAAQA,UAAU;AAAA,QAAO,GACrBgC;AAAAA,QAAeV;AAAAA,MAAAA,CAGP;AAAA,IAElB;AAEA,+BACGe,cAAY;AAAA,MAACC,WAAU;AAAA,MAAQ,GAAKN;AAAAA,MAAeV;AAAAA,IAAAA,CAEtC;AAAA,EAGlB,GAAA,CACEnC,QAAQ8C,YACRhC,OACAN,aACAkC,sBACAL,eACAI,QACAlC,MACAM,QACAD,GAAG,CAEP;AAEA,6BACGyC,YAAU;AAAA,IACTvD;AAAAA,IACAwD,aAAW;AAAA,IACXC,UAAU;AAAA,IACVC,UAAUpB;AAAAA,IACV3B;AAAAA,IACAV,WAAWM,GACTL,QAAQyD,MACR;AAAA,MAAE,CAACzD,QAAQS,QAAQ,GAAGA;AAAAA,MAAU,CAACT,QAAQwD,QAAQ,GAAGpB;AAAAA,OACpDrC,SACF;AAAA,IAAEoC,UAIDS,kBACCc,qBAAAC,UAAA;AAAA,MAAAxB,WACEyB,oBAAA,OAAA;AAAA,QAAK7D,WAAWC,QAAQ6D;AAAAA,QAAK1B,UAAEZ,sBAAsB;AAAA,MAAA,CAAO,GAE5DqC,oBAACE,kBAAgB;AAAA,QAACC,OAAOxD;AAAAA,QAAMR,WAAWC,QAAQ+D;AAAAA,MAAAA,CAAQ,GAEzDvD,eACCoD,oBAACI,WAAS;AAAA,QACRC,sBAAoB;AAAA,QACpBC,sBAAoB;AAAA,QACpBH,2BAAQb,cAAY;AAAA,UAAAf,UAAE3B;AAAAA,QAAAA,CAA0B;AAAA,QAAE2B,8BAElD,OAAA;AAAA,UAAAA,8BACGgC,MAAI;AAAA,YACHpE,WAAWC,QAAQoE;AAAAA,YACnBC,MAAK;AAAA,YACL,cAAY7D;AAAAA,YACZV,IAAI4C;AAAAA,UAAAA,CACL;AAAA,QAAA,CACE;AAAA,MAAA,CACI,CACZ;AAAA,IAAA,CACD,CACJ;AAAA,EAAA,CACU;AAEhB;"}
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../../../src/components/AppSwitcher/Action/Action.tsx"],"sourcesContent":["import { useCallback, useState } from \"react\";\n\nimport { theme, getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\nimport { Info } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvAvatar } from \"@core/components/Avatar\";\nimport { HvListItem } from \"@core/components/ListContainer\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { HvTooltip } from \"@core/components/Tooltip\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useUniqueId } from \"@core/hooks/useUniqueId\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport TitleWithTooltip from \"../TitleWithTooltip\";\nimport { useClasses, staticClasses } from \"./Action.styles\";\n\nexport { staticClasses as appSwitcherActionClasses };\n\nexport type HvAppSwitcherActionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAppSwitcherActionApplication {\n /** Id of the application. */\n id?: string;\n /** Name of the application, this is the value that will be displayed on the component. */\n name: string;\n /** URL with the icon location to be used to represent the application. iconUrl will only be used if no iconElement is provided. */\n iconUrl?: string;\n /** Element to be added as the icon representing the application. The iconElement will be the primary option to be displayed. */\n iconElement?: React.ReactElement;\n /** Small description of the application. */\n description?: string;\n /** URL where the application is accessible. */\n url?: string;\n /** Defines if the application should be opened in the same tab or in a new one. */\n target?: \"_top\" | \"_blank\";\n /** If true, the item will be disabled. */\n disabled?: boolean;\n /** True when the application is selected, false otherwise. */\n isSelected?: boolean;\n /** The color of the application. */\n color?: HvColorAny;\n}\n\nexport interface HvAppSwitcherActionProps extends HvBaseProps {\n /** The application data to be used to render the Action object. */\n application: HvAppSwitcherActionApplication;\n /** Callback triggered when the action is clicked. */\n onClickCallback?: (\n event: React.MouseEvent,\n application: HvAppSwitcherActionApplication\n ) => void;\n /** Must return a boolean stating if the action element is selected or not. */\n isSelectedCallback?: (application: HvAppSwitcherActionApplication) => boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAppSwitcherActionClasses;\n}\n\nexport const HvAppSwitcherAction = ({\n id,\n className,\n classes: classesProp,\n application,\n onClickCallback = () => {},\n isSelectedCallback = () => false,\n}: HvAppSwitcherActionProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const { name, description, disabled, iconElement, iconUrl, url, target } =\n application;\n\n const color = disabled\n ? theme.colors.secondary_60\n : getColor(application?.color, theme.colors.secondary);\n\n const [validIconUrl, setValidIconUrl] = useState<boolean>(true);\n\n const renderApplicationIcon = () => {\n if (iconElement) {\n return iconElement;\n }\n\n if (iconUrl && validIconUrl) {\n return (\n <img\n className={classes.iconUrl}\n src={iconUrl}\n onError={() => {\n setValidIconUrl(false);\n }}\n alt={description}\n />\n );\n }\n\n const brokenTitle = name.split(\" \");\n const initials =\n brokenTitle[0].substring(0, 1) +\n (brokenTitle[1] ? brokenTitle[1].substring(0, 1) : \"\");\n\n return (\n <HvAvatar size=\"sm\" backgroundColor={color} variant=\"square\" aria-hidden>\n {initials}\n </HvAvatar>\n );\n };\n\n const isSelected = isSelectedCallback(application);\n\n /**\n * Handles the onClick event and triggers the appropriate callback if it exists.\n */\n const handleOnClick = useCallback(\n (event: React.MouseEvent) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onClickCallback?.(event, { ...application, isSelected });\n },\n [application, disabled, isSelected, onClickCallback]\n );\n\n const isLink = url != null;\n const descriptionElementId = useUniqueId(id, \"hvAction-description\");\n\n const renderApplication = useCallback(\n (children: React.ReactNode) => {\n const typographyProps = {\n className: classes.typography,\n onClick: handleOnClick,\n style: { borderColor: color },\n \"aria-label\": name,\n ...(description && { \"aria-describedby\": descriptionElementId }),\n };\n\n if (isLink) {\n return (\n <HvTypography\n component=\"a\"\n href={url}\n target={target || \"_top\"}\n {...typographyProps}\n >\n {children}\n </HvTypography>\n );\n }\n\n return (\n <HvTypography component=\"button\" {...typographyProps}>\n {children}\n </HvTypography>\n );\n },\n [\n classes.typography,\n color,\n description,\n descriptionElementId,\n handleOnClick,\n isLink,\n name,\n target,\n url,\n ]\n );\n\n return (\n <HvListItem\n id={id}\n interactive\n tabIndex={0}\n selected={isSelected}\n disabled={disabled}\n className={cx(\n classes.root,\n { [classes.disabled]: disabled, [classes.selected]: isSelected },\n className\n )}\n >\n {/* As HvTooltip don't have the id prop, is not possible to use the aria-labelledby to reference it.\n In substitution is used the aria-label with the \"title\" value */}\n {renderApplication(\n <>\n <div className={classes.icon}>{renderApplicationIcon()}</div>\n\n <TitleWithTooltip title={name} className={classes.title} />\n\n {description && (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={<HvTypography>{description}</HvTypography>}\n >\n <div>\n <Info\n className={classes.iconInfo}\n role=\"img\"\n aria-label={description}\n id={descriptionElementId}\n />\n </div>\n </HvTooltip>\n )}\n </>\n )}\n </HvListItem>\n );\n};\n"],"names":["HvAppSwitcherAction","id","className","classes","classesProp","application","onClickCallback","isSelectedCallback","cx","useClasses","name","description","disabled","iconElement","iconUrl","url","target","color","theme","colors","secondary_60","getColor","secondary","validIconUrl","setValidIconUrl","useState","renderApplicationIcon","brokenTitle","split","initials","substring","isSelected","handleOnClick","useCallback","event","preventDefault","isLink","descriptionElementId","useUniqueId","renderApplication","children","typographyProps","typography","onClick","style","borderColor","root","selected","icon","title","iconInfo"],"mappings":";;;;;;;;;;;;AAyDO,MAAMA,sBAAsBA,CAAC;AAAA,EAClCC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACAC,kBAAkBA,MAAM;AAAA,EAAC;AAAA,EACzBC,qBAAqBA,MAAM;AACH,MAAM;AACxB,QAAA;AAAA,IAAEJ;AAAAA,IAASK;AAAAA,EAAAA,IAAOC,WAAWL,WAAW;AAExC,QAAA;AAAA,IAAEM;AAAAA,IAAMC;AAAAA,IAAaC;AAAAA,IAAUC;AAAAA,IAAaC;AAAAA,IAASC;AAAAA,IAAKC;AAAAA,EAC9DX,IAAAA;AAEIY,QAAAA,QAAQL,WACVM,MAAMC,OAAOC,eACbC,SAAShB,2CAAaY,OAAOC,MAAMC,OAAOG,SAAS;AAEvD,QAAM,CAACC,cAAcC,eAAe,IAAIC,SAAkB,IAAI;AAE9D,QAAMC,wBAAwBA,MAAM;AAClC,QAAIb,aAAa;AACRA,aAAAA;AAAAA,IACT;AAEA,QAAIC,WAAWS,cAAc;AAEzB,aAAA,oBAAC,SACC,WAAWpB,QAAQW,SACnB,KAAKA,SACL,SAAS,MAAM;AACbU,wBAAgB,KAAK;AAAA,MAAA,GAEvB,KAAKb,YACL,CAAA;AAAA,IAEN;AAEMgB,UAAAA,cAAcjB,KAAKkB,MAAM,GAAG;AAClC,UAAMC,WACJF,YAAY,CAAC,EAAEG,UAAU,GAAG,CAAC,KAC5BH,YAAY,CAAC,IAAIA,YAAY,CAAC,EAAEG,UAAU,GAAG,CAAC,IAAI;AAGnD,WAAA,oBAAC,UAAS,EAAA,MAAK,MAAK,iBAAiBb,OAAO,SAAQ,UAAS,eAAW,MACrEY,UACH,SAAA,CAAA;AAAA,EAAA;AAIEE,QAAAA,aAAaxB,mBAAmBF,WAAW;AAK3C2B,QAAAA,gBAAgBC,YACpB,CAACC,UAA4B;AAC3B,QAAItB,UAAU;AACZsB,YAAMC,eAAe;AACrB;AAAA,IACF;AAEA7B,uDAAkB4B,OAAO;AAAA,MAAE,GAAG7B;AAAAA,MAAa0B;AAAAA,IAAAA;AAAAA,KAE7C,CAAC1B,aAAaO,UAAUmB,YAAYzB,eAAe,CACrD;AAEA,QAAM8B,SAASrB,OAAO;AAChBsB,QAAAA,uBAAuBC,YAAYrC,IAAI,sBAAsB;AAE7DsC,QAAAA,oBAAoBN,YACxB,CAACO,aAA8B;AAC7B,UAAMC,kBAAkB;AAAA,MACtBvC,WAAWC,QAAQuC;AAAAA,MACnBC,SAASX;AAAAA,MACTY,OAAO;AAAA,QAAEC,aAAa5B;AAAAA,MAAM;AAAA,MAC5B,cAAcP;AAAAA,MACd,GAAIC,eAAe;AAAA,QAAE,oBAAoB0B;AAAAA,MAAqB;AAAA,IAAA;AAGhE,QAAID,QAAQ;AAER,aAAA,oBAAC,cACC,EAAA,WAAU,KACV,MAAMrB,KACN,QAAQC,UAAU,QACdyB,GAAAA,iBAEHD,SACH,CAAA;AAAA,IAEJ;AAEA,+BACG,cAAa,EAAA,WAAU,UAAaC,GAAAA,iBAClCD,SACH,CAAA;AAAA,EAGJ,GAAA,CACErC,QAAQuC,YACRzB,OACAN,aACA0B,sBACAL,eACAI,QACA1B,MACAM,QACAD,GAAG,CAEP;AAEA,SACG,oBAAA,YAAA,EACC,IACA,aAAW,MACX,UAAU,GACV,UAAUgB,YACV,UACA,WAAWvB,GACTL,QAAQ2C,MACR;AAAA,IAAE,CAAC3C,QAAQS,QAAQ,GAAGA;AAAAA,IAAU,CAACT,QAAQ4C,QAAQ,GAAGhB;AAAAA,EAAAA,GACpD7B,SACF,GAICqC,UAAAA,kBAEG,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA,oBAAC,OAAI,EAAA,WAAWpC,QAAQ6C,MAAOtB,mCAAwB;AAAA,wBAEtD,kBAAiB,EAAA,OAAOhB,MAAM,WAAWP,QAAQ8C,OAAM;AAAA,IAEvDtC,eACE,oBAAA,WAAA,EACC,sBAAoB,MACpB,sBAAoB,MACpB,OAAO,oBAAC,cAAcA,EAAAA,UAAAA,YAAY,CAAA,GAElC,UAAA,oBAAC,SACC,UAAC,oBAAA,MAAA,EACC,WAAWR,QAAQ+C,UACnB,MAAK,OACL,cAAYvC,aACZ,IAAI0B,qBAAqB,CAAA,EAE7B,CAAA,GACF;AAAA,EAAA,EAEJ,CAAA,CACF,EACF,CAAA;AAEJ;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
3
4
|
import { useClasses } from "./AppSwitcher.styles.js";
|
|
4
5
|
import { staticClasses } from "./AppSwitcher.styles.js";
|
|
5
6
|
import TitleWithTooltip from "./TitleWithTooltip.js";
|
|
6
|
-
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
7
7
|
import { HvAppSwitcherAction } from "./Action/Action.js";
|
|
8
8
|
import { HvTypography } from "../Typography/Typography.js";
|
|
9
9
|
import { HvListContainer } from "../ListContainer/ListContainer.js";
|
|
@@ -28,48 +28,26 @@ const HvAppSwitcher = (props) => {
|
|
|
28
28
|
} = useClasses(classesProp);
|
|
29
29
|
const panelActions = useMemo(() => applications && (applications == null ? void 0 : applications.map((application) => {
|
|
30
30
|
if (application.name) {
|
|
31
|
-
return /* @__PURE__ */ jsx(HvAppSwitcherAction, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
icon: classes.itemIcon,
|
|
41
|
-
title: classes.itemTitle,
|
|
42
|
-
iconInfo: classes.itemInfoIcon
|
|
43
|
-
}
|
|
44
|
-
}, application.id || `${application.name}_${application.url}`);
|
|
31
|
+
return /* @__PURE__ */ jsx(HvAppSwitcherAction, { application, onClickCallback: onActionClickedCallback, isSelectedCallback: isActionSelectedCallback, classes: {
|
|
32
|
+
root: classes.item,
|
|
33
|
+
selected: classes.itemSelected,
|
|
34
|
+
disabled: classes.itemDisabled,
|
|
35
|
+
typography: classes.itemTrigger,
|
|
36
|
+
icon: classes.itemIcon,
|
|
37
|
+
title: classes.itemTitle,
|
|
38
|
+
iconInfo: classes.itemInfoIcon
|
|
39
|
+
} }, application.id || `${application.name}_${application.url}`);
|
|
45
40
|
}
|
|
46
41
|
return void 0;
|
|
47
42
|
})), [applications, classes, isActionSelectedCallback, onActionClickedCallback]);
|
|
48
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
variant: "label",
|
|
57
|
-
className: classes.title,
|
|
58
|
-
children: header
|
|
59
|
-
}) || title && /* @__PURE__ */ jsx(TitleWithTooltip, {
|
|
60
|
-
className: classes.title,
|
|
61
|
-
title
|
|
62
|
-
}), /* @__PURE__ */ jsx(HvListContainer, {
|
|
63
|
-
disableGutters: true,
|
|
64
|
-
className: classes.actionsContainer,
|
|
65
|
-
children: panelActions
|
|
66
|
-
}), footer && /* @__PURE__ */ jsx(HvTypography, {
|
|
67
|
-
component: "div",
|
|
68
|
-
variant: "label",
|
|
69
|
-
className: classes.footerContainer,
|
|
70
|
-
children: footer
|
|
71
|
-
})]
|
|
72
|
-
});
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { id, className: cx(classes.root, classes[layout], {
|
|
44
|
+
[classes.open]: !!isOpen,
|
|
45
|
+
[classes.closed]: isOpen === false
|
|
46
|
+
}, className), children: [
|
|
47
|
+
header && /* @__PURE__ */ jsx(HvTypography, { component: "div", variant: "label", className: classes.title, children: header }) || title && /* @__PURE__ */ jsx(TitleWithTooltip, { className: classes.title, title }),
|
|
48
|
+
/* @__PURE__ */ jsx(HvListContainer, { disableGutters: true, className: classes.actionsContainer, children: panelActions }),
|
|
49
|
+
footer && /* @__PURE__ */ jsx(HvTypography, { component: "div", variant: "label", className: classes.footerContainer, children: footer })
|
|
50
|
+
] });
|
|
73
51
|
};
|
|
74
52
|
export {
|
|
75
53
|
HvAppSwitcher,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSwitcher.js","sources":["../../../../src/components/AppSwitcher/AppSwitcher.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { HvListContainer } from \"@core/components/ListContainer\";\nimport { HvTypography } from \"@core/components/Typography\";\n\nimport { HvAppSwitcherAction, HvAppSwitcherActionApplication } from \"./Action\";\nimport { useClasses, staticClasses } from \"./AppSwitcher.styles\";\nimport TitleWithTooltip from \"./TitleWithTooltip\";\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: HvAppSwitcherProps) => {\n const {\n id,\n className,\n classes: classesProp,\n layout = \"single\",\n title,\n applications,\n onActionClickedCallback = () => {},\n isActionSelectedCallback = () => false,\n header,\n footer,\n isOpen,\n } = useDefaultProps(\"HvAppSwitcher\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const panelActions = useMemo(\n () =>\n applications &&\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 <div\n id={id}\n className={cx(\n classes.root,\n classes[layout],\n { [classes.open]: !!isOpen, [classes.closed]: isOpen === false },\n className\n )}\n >\n {(header && (\n <HvTypography component=\"div\" variant=\"label\" className={classes.title}>\n {header}\n </HvTypography>\n )) ||\n (title && <TitleWithTooltip className={classes.title} title={title} />)}\n <HvListContainer disableGutters className={classes.actionsContainer}>\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 </div>\n );\n};\n"],"names":["HvAppSwitcher","props","id","className","classes","classesProp","layout","title","applications","onActionClickedCallback","isActionSelectedCallback","header","footer","isOpen","useDefaultProps","cx","useClasses","panelActions","useMemo","map","application","name","
|
|
1
|
+
{"version":3,"file":"AppSwitcher.js","sources":["../../../../src/components/AppSwitcher/AppSwitcher.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { HvListContainer } from \"@core/components/ListContainer\";\nimport { HvTypography } from \"@core/components/Typography\";\n\nimport { HvAppSwitcherAction, HvAppSwitcherActionApplication } from \"./Action\";\nimport { useClasses, staticClasses } from \"./AppSwitcher.styles\";\nimport TitleWithTooltip from \"./TitleWithTooltip\";\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: HvAppSwitcherProps) => {\n const {\n id,\n className,\n classes: classesProp,\n layout = \"single\",\n title,\n applications,\n onActionClickedCallback = () => {},\n isActionSelectedCallback = () => false,\n header,\n footer,\n isOpen,\n } = useDefaultProps(\"HvAppSwitcher\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const panelActions = useMemo(\n () =>\n applications &&\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 <div\n id={id}\n className={cx(\n classes.root,\n classes[layout],\n { [classes.open]: !!isOpen, [classes.closed]: isOpen === false },\n className\n )}\n >\n {(header && (\n <HvTypography component=\"div\" variant=\"label\" className={classes.title}>\n {header}\n </HvTypography>\n )) ||\n (title && <TitleWithTooltip className={classes.title} title={title} />)}\n <HvListContainer disableGutters className={classes.actionsContainer}>\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 </div>\n );\n};\n"],"names":["HvAppSwitcher","props","id","className","classes","classesProp","layout","title","applications","onActionClickedCallback","isActionSelectedCallback","header","footer","isOpen","useDefaultProps","cx","useClasses","panelActions","useMemo","map","application","name","root","item","selected","itemSelected","disabled","itemDisabled","typography","itemTrigger","icon","itemIcon","itemTitle","iconInfo","itemInfoIcon","url","undefined","open","closed","actionsContainer","footerContainer"],"mappings":";;;;;;;;;AA8CaA,MAAAA,gBAAgBA,CAACC,UAA8B;AACpD,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC,SAAS;AAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC,0BAA0BA,MAAM;AAAA,IAAC;AAAA,IACjCC,2BAA2BA,MAAM;AAAA,IACjCC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,EAAAA,IACEC,gBAAgB,iBAAiBb,KAAK;AACpC,QAAA;AAAA,IAAEG;AAAAA,IAASW;AAAAA,EAAAA,IAAOC,WAAWX,WAAW;AAE9C,QAAMY,eAAeC,QACnB,MACEV,iBACAA,6CAAcW,IAAKC,CAAgB,gBAAA;AACjC,QAAIA,YAAYC,MAAM;AACpB,iCACG,qBAEC,EAAA,aACA,iBAAiBZ,yBACjB,oBAAoBC,0BACpB,SAAS;AAAA,QACPY,MAAMlB,QAAQmB;AAAAA,QACdC,UAAUpB,QAAQqB;AAAAA,QAClBC,UAAUtB,QAAQuB;AAAAA,QAClBC,YAAYxB,QAAQyB;AAAAA,QACpBC,MAAM1B,QAAQ2B;AAAAA,QACdxB,OAAOH,QAAQ4B;AAAAA,QACfC,UAAU7B,QAAQ8B;AAAAA,MACpB,EAAA,GAZKd,YAAYlB,MAAO,GAAEkB,YAAYC,IAAK,IAAGD,YAAYe,GAAI,EAa9D;AAAA,IAEN;AAEOC,WAAAA;AAAAA,EAAAA,KAEX,CAAC5B,cAAcJ,SAASM,0BAA0BD,uBAAuB,CAC3E;AAGE,SAAA,qBAAC,SACC,IACA,WAAWM,GACTX,QAAQkB,MACRlB,QAAQE,MAAM,GACd;AAAA,IAAE,CAACF,QAAQiC,IAAI,GAAG,CAAC,CAACxB;AAAAA,IAAQ,CAACT,QAAQkC,MAAM,GAAGzB,WAAW;AAAA,EAAA,GACzDV,SACF,GAEEQ,UAAAA;AAAAA,IAAAA,8BACC,cAAa,EAAA,WAAU,OAAM,SAAQ,SAAQ,WAAWP,QAAQG,OAC9DI,UAAAA,OACH,CAAA,KAECJ,SAAS,oBAAC,oBAAiB,WAAWH,QAAQG,OAAO,OAAiB;AAAA,wBACxE,iBAAgB,EAAA,gBAAc,MAAC,WAAWH,QAAQmC,kBAChDtB,UACH,cAAA;AAAA,IACCL,UACE,oBAAA,cAAA,EACC,WAAU,OACV,SAAQ,SACR,WAAWR,QAAQoC,iBAElB5B,UACH,OAAA,CAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRef, useMemo } from "react";
|
|
2
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo } from "react";
|
|
3
3
|
import { HvTooltip } from "../Tooltip/Tooltip.js";
|
|
4
4
|
import { HvTypography } from "../Typography/Typography.js";
|
|
5
5
|
const TitleWithTooltip = ({
|
|
@@ -13,20 +13,7 @@ const TitleWithTooltip = ({
|
|
|
13
13
|
return false;
|
|
14
14
|
return el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight;
|
|
15
15
|
}, []);
|
|
16
|
-
return /* @__PURE__ */ jsx(HvTooltip, {
|
|
17
|
-
disableHoverListener: !isOverflowed,
|
|
18
|
-
placement: "top-start",
|
|
19
|
-
title: /* @__PURE__ */ jsx(HvTypography, {
|
|
20
|
-
children: title
|
|
21
|
-
}),
|
|
22
|
-
children: /* @__PURE__ */ jsx(HvTypography, {
|
|
23
|
-
className,
|
|
24
|
-
variant: "label",
|
|
25
|
-
component: "span",
|
|
26
|
-
ref: textRef,
|
|
27
|
-
children: title
|
|
28
|
-
})
|
|
29
|
-
});
|
|
16
|
+
return /* @__PURE__ */ jsx(HvTooltip, { disableHoverListener: !isOverflowed, placement: "top-start", title: /* @__PURE__ */ jsx(HvTypography, { children: title }), children: /* @__PURE__ */ jsx(HvTypography, { className, variant: "label", component: "span", ref: textRef, children: title }) });
|
|
30
17
|
};
|
|
31
18
|
const TitleWithTooltip$1 = TitleWithTooltip;
|
|
32
19
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleWithTooltip.js","sources":["../../../../src/components/AppSwitcher/TitleWithTooltip.tsx"],"sourcesContent":["import { useMemo, useRef } from \"react\";\n\nimport { HvTooltip } from \"@core/components/Tooltip\";\nimport { HvTypography } from \"@core/components/Typography\";\n\nconst TitleWithTooltip = ({ className, title }) => {\n const textRef = useRef<HTMLDivElement>(null);\n\n const isOverflowed = useMemo(() => {\n const el = textRef.current;\n if (!el) return false;\n\n return el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight;\n }, []);\n\n return (\n <HvTooltip\n disableHoverListener={!isOverflowed}\n placement=\"top-start\"\n title={<HvTypography>{title}</HvTypography>}\n >\n <HvTypography\n className={className}\n variant=\"label\"\n component=\"span\"\n ref={textRef}\n >\n {title}\n </HvTypography>\n </HvTooltip>\n );\n};\n\nexport default TitleWithTooltip;\n"],"names":["TitleWithTooltip","className","title","textRef","useRef","isOverflowed","useMemo","el","current","scrollWidth","clientWidth","scrollHeight","clientHeight"
|
|
1
|
+
{"version":3,"file":"TitleWithTooltip.js","sources":["../../../../src/components/AppSwitcher/TitleWithTooltip.tsx"],"sourcesContent":["import { useMemo, useRef } from \"react\";\n\nimport { HvTooltip } from \"@core/components/Tooltip\";\nimport { HvTypography } from \"@core/components/Typography\";\n\nconst TitleWithTooltip = ({ className, title }) => {\n const textRef = useRef<HTMLDivElement>(null);\n\n const isOverflowed = useMemo(() => {\n const el = textRef.current;\n if (!el) return false;\n\n return el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight;\n }, []);\n\n return (\n <HvTooltip\n disableHoverListener={!isOverflowed}\n placement=\"top-start\"\n title={<HvTypography>{title}</HvTypography>}\n >\n <HvTypography\n className={className}\n variant=\"label\"\n component=\"span\"\n ref={textRef}\n >\n {title}\n </HvTypography>\n </HvTooltip>\n );\n};\n\nexport default TitleWithTooltip;\n"],"names":["TitleWithTooltip","className","title","textRef","useRef","isOverflowed","useMemo","el","current","scrollWidth","clientWidth","scrollHeight","clientHeight"],"mappings":";;;;AAKA,MAAMA,mBAAmBA,CAAC;AAAA,EAAEC;AAAAA,EAAWC;AAAM,MAAM;AAC3CC,QAAAA,UAAUC,OAAuB,IAAI;AAErCC,QAAAA,eAAeC,QAAQ,MAAM;AACjC,UAAMC,KAAKJ,QAAQK;AACnB,QAAI,CAACD;AAAW,aAAA;AAEhB,WAAOA,GAAGE,cAAcF,GAAGG,eAAeH,GAAGI,eAAeJ,GAAGK;AAAAA,EACjE,GAAG,CAAE,CAAA;AAGH,SAAA,oBAAC,aACC,sBAAsB,CAACP,cACvB,WAAU,aACV,OAAO,oBAAC,cAAcH,EAAAA,UAAAA,MAAAA,CAAM,GAE5B,UAAC,oBAAA,cAAA,EACC,WACA,SAAQ,SACR,WAAU,QACV,KAAKC,SAEJD,UAAAA,MACH,CAAA,EACF,CAAA;AAEJ;AAEA,MAAA,qBAAeF;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
1
2
|
import { forwardRef } from "react";
|
|
2
3
|
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
3
4
|
import { User } from "@hitachivantara/uikit-react-icons";
|
|
@@ -7,7 +8,6 @@ import { useImageLoaded } from "../../hooks/useImageLoaded.js";
|
|
|
7
8
|
import { decreaseSize } from "../../utils/sizes.js";
|
|
8
9
|
import { useClasses } from "./Avatar.styles.js";
|
|
9
10
|
import { staticClasses } from "./Avatar.styles.js";
|
|
10
|
-
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
11
11
|
const HvAvatar = forwardRef((props, ref) => {
|
|
12
12
|
const {
|
|
13
13
|
className,
|
|
@@ -38,24 +38,13 @@ const HvAvatar = forwardRef((props, ref) => {
|
|
|
38
38
|
const hasImg = src || srcSet;
|
|
39
39
|
const hasImgNotFailing = hasImg && imageLoaded !== "error";
|
|
40
40
|
if (hasImgNotFailing) {
|
|
41
|
-
children = /* @__PURE__ */ jsx("img", {
|
|
42
|
-
alt,
|
|
43
|
-
src,
|
|
44
|
-
srcSet,
|
|
45
|
-
sizes,
|
|
46
|
-
className: classes.img,
|
|
47
|
-
...imgProps
|
|
48
|
-
});
|
|
41
|
+
children = /* @__PURE__ */ jsx("img", { alt, src, srcSet, sizes, className: classes.img, ...imgProps });
|
|
49
42
|
} else if (childrenProp != null) {
|
|
50
43
|
children = childrenProp;
|
|
51
44
|
} else if (hasImg && alt) {
|
|
52
45
|
[children] = alt;
|
|
53
46
|
} else {
|
|
54
|
-
children = /* @__PURE__ */ jsx(User, {
|
|
55
|
-
color,
|
|
56
|
-
iconSize: decreaseSize(size),
|
|
57
|
-
className: classes.fallback
|
|
58
|
-
});
|
|
47
|
+
children = /* @__PURE__ */ jsx(User, { color, iconSize: decreaseSize(size), className: classes.fallback });
|
|
59
48
|
}
|
|
60
49
|
const inlineStyle = {
|
|
61
50
|
...style
|
|
@@ -73,19 +62,13 @@ const HvAvatar = forwardRef((props, ref) => {
|
|
|
73
62
|
statusInlineStyle.boxShadow = `inset 0px 0px 0px 2px ${statusColor}`;
|
|
74
63
|
}
|
|
75
64
|
const badgeColor = getColor(badge || "", theme.colors.positive);
|
|
76
|
-
return /* @__PURE__ */ jsx("div", {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
children: [badge && /* @__PURE__ */ jsx("div", {
|
|
84
|
-
className: classes.badge,
|
|
85
|
-
style: {
|
|
86
|
-
backgroundColor: badgeColor
|
|
87
|
-
}
|
|
88
|
-
}), /* @__PURE__ */ jsx(MuiAvatar, {
|
|
65
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes.container, ...others, children: /* @__PURE__ */ jsxs("div", { className: cx(classes.status, classes[variant], classes[size]), style: statusInlineStyle, children: [
|
|
66
|
+
badge && /* @__PURE__ */ jsx("div", { className: classes.badge, style: {
|
|
67
|
+
backgroundColor: badgeColor
|
|
68
|
+
} }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
MuiAvatar,
|
|
71
|
+
{
|
|
89
72
|
component,
|
|
90
73
|
className: cx(classes.root, classes.avatar, classes[size], className),
|
|
91
74
|
style: inlineStyle,
|
|
@@ -93,9 +76,9 @@ const HvAvatar = forwardRef((props, ref) => {
|
|
|
93
76
|
size,
|
|
94
77
|
...avatarProps,
|
|
95
78
|
children
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
});
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }) });
|
|
99
82
|
});
|
|
100
83
|
export {
|
|
101
84
|
HvAvatar,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { CSSProperties, HTMLAttributes, forwardRef } from \"react\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { User } from \"@hitachivantara/uikit-react-icons\";\nimport { HvColorAny, getColor, theme } from \"@hitachivantara/uikit-styles\";\n\nimport MuiAvatar, { AvatarProps as MuiAvatarProps } from \"@mui/material/Avatar\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useImageLoaded } from \"@core/hooks/useImageLoaded\";\nimport { decreaseSize } from \"@core/utils/sizes\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { staticClasses, useClasses } from \"./Avatar.styles\";\n\nexport { staticClasses as avatarClasses };\n\nexport type HvAvatarClasses = ExtractNames<typeof useClasses>;\n\nexport type HvAvatarVariant = \"circular\" | \"square\";\n\nexport type HvAvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface HvAvatarProps extends HvBaseProps {\n /** Inline styles to be applied to the root element. */\n style?: CSSProperties;\n /** The component used for the root node. Either a string to use a DOM element or a component. */\n component?: React.ElementType;\n /** Sets one of the standard sizes of the icons */\n size?: HvAvatarSize;\n /** A color representing the foreground color of the avatar's letters or the generic User icon fallback. */\n color?: HvColorAny;\n /** A String representing the background color of the avatar. */\n backgroundColor?: HvColorAny;\n /** The `src` attribute for the `img` element. */\n src?: string;\n /** The `srcSet` attribute for the `img` element. Use this attribute for responsive image display. */\n srcSet?: string;\n /** The `sizes` attribute for the `img` element. */\n sizes?: string;\n /** Used in combination with `src` or `srcSet` to provide an alt attribute for the rendered `img` element. */\n alt?: string;\n /**\n * Attributes applied to the `img` element if the component is used to display an image.\n * It can be used to listen for the loading error event.\n */\n imgProps?: HTMLAttributes<HTMLImageElement>;\n /** A string representing the type of avatar to display, circular or square. */\n variant?: HvAvatarVariant;\n /** A string representing the color of the avatar border that represents its status. */\n status?: string;\n /** A string representing the color of the avatar badge. */\n badge?: string;\n /** Attributes applied to the avatar element. */\n avatarProps?: MuiAvatarProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarClasses;\n}\n\n/**\n * Avatars can be used to represent a user or a brand.\n * They can show an image, an icon or the initial letters of a name, for example.\n */\nexport const HvAvatar = forwardRef<any, HvAvatarProps>((props, ref) => {\n const {\n className,\n style,\n classes: classesProp,\n children: childrenProp,\n component = \"div\",\n size = \"sm\",\n backgroundColor = \"secondary\",\n color = \"atmo1\",\n src,\n srcSet,\n sizes,\n alt,\n imgProps,\n status,\n badge,\n variant = \"circular\",\n avatarProps,\n ...others\n } = useDefaultProps(\"HvAvatar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n let children: React.ReactNode;\n\n // Use a hook instead of onError on the img element to support server-side rendering.\n const imageLoaded = useImageLoaded(src, srcSet);\n const hasImg = src || srcSet;\n const hasImgNotFailing = hasImg && imageLoaded !== \"error\";\n\n if (hasImgNotFailing) {\n children = (\n <img\n alt={alt}\n src={src}\n srcSet={srcSet}\n sizes={sizes}\n className={classes.img}\n {...imgProps}\n />\n );\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (hasImg && alt) {\n [children] = alt;\n } else {\n children = (\n <User\n color={color}\n iconSize={decreaseSize(size)}\n className={classes.fallback}\n />\n );\n }\n\n const inlineStyle: CSSProperties = {\n ...style,\n };\n\n if (component != null && typeof component !== \"string\") {\n // override border-radius with custom components\n inlineStyle.borderRadius = \"50%\";\n }\n\n if (!hasImgNotFailing) {\n inlineStyle.backgroundColor = getColor(\n backgroundColor,\n theme.colors.secondary\n );\n inlineStyle.color = getColor(color, theme.colors.atmo1);\n }\n\n const statusInlineStyle: CSSProperties = {};\n if (status) {\n // set the status border. we're using the boxShadow property to set the border\n // to be inside the container and not on its edge.\n const statusColor = getColor(status, theme.colors.positive);\n statusInlineStyle.boxShadow = `inset 0px 0px 0px 2px ${statusColor}`;\n }\n\n const badgeColor = getColor(badge || \"\", theme.colors.positive);\n\n return (\n <div ref={ref} className={classes.container} {...others}>\n <div\n className={cx(classes.status, classes[variant], classes[size])}\n style={statusInlineStyle}\n >\n {badge && (\n <div\n className={classes.badge}\n style={{ backgroundColor: badgeColor }}\n />\n )}\n <MuiAvatar\n component={component}\n // Consider not using the root and className classes in this component\n className={cx(classes.root, classes.avatar, classes[size], className)}\n style={inlineStyle}\n variant={variant}\n size={size}\n {...avatarProps}\n >\n {children}\n </MuiAvatar>\n </div>\n </div>\n );\n});\n"],"names":["HvAvatar","forwardRef","props","ref","className","style","classes","classesProp","children","childrenProp","component","size","backgroundColor","color","src","srcSet","sizes","alt","imgProps","status","badge","variant","avatarProps","others","useDefaultProps","cx","useClasses","imageLoaded","useImageLoaded","hasImg","hasImgNotFailing","img","
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { CSSProperties, HTMLAttributes, forwardRef } from \"react\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { User } from \"@hitachivantara/uikit-react-icons\";\nimport { HvColorAny, getColor, theme } from \"@hitachivantara/uikit-styles\";\n\nimport MuiAvatar, { AvatarProps as MuiAvatarProps } from \"@mui/material/Avatar\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useImageLoaded } from \"@core/hooks/useImageLoaded\";\nimport { decreaseSize } from \"@core/utils/sizes\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { staticClasses, useClasses } from \"./Avatar.styles\";\n\nexport { staticClasses as avatarClasses };\n\nexport type HvAvatarClasses = ExtractNames<typeof useClasses>;\n\nexport type HvAvatarVariant = \"circular\" | \"square\";\n\nexport type HvAvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface HvAvatarProps extends HvBaseProps {\n /** Inline styles to be applied to the root element. */\n style?: CSSProperties;\n /** The component used for the root node. Either a string to use a DOM element or a component. */\n component?: React.ElementType;\n /** Sets one of the standard sizes of the icons */\n size?: HvAvatarSize;\n /** A color representing the foreground color of the avatar's letters or the generic User icon fallback. */\n color?: HvColorAny;\n /** A String representing the background color of the avatar. */\n backgroundColor?: HvColorAny;\n /** The `src` attribute for the `img` element. */\n src?: string;\n /** The `srcSet` attribute for the `img` element. Use this attribute for responsive image display. */\n srcSet?: string;\n /** The `sizes` attribute for the `img` element. */\n sizes?: string;\n /** Used in combination with `src` or `srcSet` to provide an alt attribute for the rendered `img` element. */\n alt?: string;\n /**\n * Attributes applied to the `img` element if the component is used to display an image.\n * It can be used to listen for the loading error event.\n */\n imgProps?: HTMLAttributes<HTMLImageElement>;\n /** A string representing the type of avatar to display, circular or square. */\n variant?: HvAvatarVariant;\n /** A string representing the color of the avatar border that represents its status. */\n status?: string;\n /** A string representing the color of the avatar badge. */\n badge?: string;\n /** Attributes applied to the avatar element. */\n avatarProps?: MuiAvatarProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarClasses;\n}\n\n/**\n * Avatars can be used to represent a user or a brand.\n * They can show an image, an icon or the initial letters of a name, for example.\n */\nexport const HvAvatar = forwardRef<any, HvAvatarProps>((props, ref) => {\n const {\n className,\n style,\n classes: classesProp,\n children: childrenProp,\n component = \"div\",\n size = \"sm\",\n backgroundColor = \"secondary\",\n color = \"atmo1\",\n src,\n srcSet,\n sizes,\n alt,\n imgProps,\n status,\n badge,\n variant = \"circular\",\n avatarProps,\n ...others\n } = useDefaultProps(\"HvAvatar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n let children: React.ReactNode;\n\n // Use a hook instead of onError on the img element to support server-side rendering.\n const imageLoaded = useImageLoaded(src, srcSet);\n const hasImg = src || srcSet;\n const hasImgNotFailing = hasImg && imageLoaded !== \"error\";\n\n if (hasImgNotFailing) {\n children = (\n <img\n alt={alt}\n src={src}\n srcSet={srcSet}\n sizes={sizes}\n className={classes.img}\n {...imgProps}\n />\n );\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (hasImg && alt) {\n [children] = alt;\n } else {\n children = (\n <User\n color={color}\n iconSize={decreaseSize(size)}\n className={classes.fallback}\n />\n );\n }\n\n const inlineStyle: CSSProperties = {\n ...style,\n };\n\n if (component != null && typeof component !== \"string\") {\n // override border-radius with custom components\n inlineStyle.borderRadius = \"50%\";\n }\n\n if (!hasImgNotFailing) {\n inlineStyle.backgroundColor = getColor(\n backgroundColor,\n theme.colors.secondary\n );\n inlineStyle.color = getColor(color, theme.colors.atmo1);\n }\n\n const statusInlineStyle: CSSProperties = {};\n if (status) {\n // set the status border. we're using the boxShadow property to set the border\n // to be inside the container and not on its edge.\n const statusColor = getColor(status, theme.colors.positive);\n statusInlineStyle.boxShadow = `inset 0px 0px 0px 2px ${statusColor}`;\n }\n\n const badgeColor = getColor(badge || \"\", theme.colors.positive);\n\n return (\n <div ref={ref} className={classes.container} {...others}>\n <div\n className={cx(classes.status, classes[variant], classes[size])}\n style={statusInlineStyle}\n >\n {badge && (\n <div\n className={classes.badge}\n style={{ backgroundColor: badgeColor }}\n />\n )}\n <MuiAvatar\n component={component}\n // Consider not using the root and className classes in this component\n className={cx(classes.root, classes.avatar, classes[size], className)}\n style={inlineStyle}\n variant={variant}\n size={size}\n {...avatarProps}\n >\n {children}\n </MuiAvatar>\n </div>\n </div>\n );\n});\n"],"names":["HvAvatar","forwardRef","props","ref","className","style","classes","classesProp","children","childrenProp","component","size","backgroundColor","color","src","srcSet","sizes","alt","imgProps","status","badge","variant","avatarProps","others","useDefaultProps","cx","useClasses","imageLoaded","useImageLoaded","hasImg","hasImgNotFailing","img","decreaseSize","fallback","inlineStyle","borderRadius","getColor","theme","colors","secondary","atmo1","statusInlineStyle","statusColor","positive","boxShadow","badgeColor","container","root","avatar"],"mappings":";;;;;;;;;;AA+DO,MAAMA,WAAWC,WAA+B,CAACC,OAAOC,QAAQ;AAC/D,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC,UAAUC;AAAAA,IACVC,YAAY;AAAA,IACZC,OAAO;AAAA,IACPC,kBAAkB;AAAA,IAClBC,QAAQ;AAAA,IACRC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,UAAU;AAAA,IACVC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,YAAYtB,KAAK;AAC/B,QAAA;AAAA,IAAEI;AAAAA,IAASmB;AAAAA,EAAAA,IAAOC,WAAWnB,WAAW;AAE1CC,MAAAA;AAGEmB,QAAAA,cAAcC,eAAed,KAAKC,MAAM;AAC9C,QAAMc,SAASf,OAAOC;AAChBe,QAAAA,mBAAmBD,UAAUF,gBAAgB;AAEnD,MAAIG,kBAAkB;AAElB,eAAA,oBAAC,OACC,EAAA,KACA,KACA,QACA,OACA,WAAWxB,QAAQyB,KACfb,GAAAA,SAEP,CAAA;AAAA,EAAA,WACQT,gBAAgB,MAAM;AACpBA,eAAAA;AAAAA,EAAAA,WACFoB,UAAUZ,KAAK;AACxB,KAACT,QAAQ,IAAIS;AAAAA,EAAAA,OACR;AAEH,eAAA,oBAAC,QACC,OACA,UAAUe,aAAarB,IAAI,GAC3B,WAAWL,QAAQ2B,SAEtB,CAAA;AAAA,EACH;AAEA,QAAMC,cAA6B;AAAA,IACjC,GAAG7B;AAAAA,EAAAA;AAGL,MAAIK,aAAa,QAAQ,OAAOA,cAAc,UAAU;AAEtDwB,gBAAYC,eAAe;AAAA,EAC7B;AAEA,MAAI,CAACL,kBAAkB;AACrBI,gBAAYtB,kBAAkBwB,SAC5BxB,iBACAyB,MAAMC,OAAOC,SACf;AACAL,gBAAYrB,QAAQuB,SAASvB,OAAOwB,MAAMC,OAAOE,KAAK;AAAA,EACxD;AAEA,QAAMC,oBAAmC,CAAA;AACzC,MAAItB,QAAQ;AAGV,UAAMuB,cAAcN,SAASjB,QAAQkB,MAAMC,OAAOK,QAAQ;AACxCC,sBAAAA,YAAa,yBAAwBF,WAAY;AAAA,EACrE;AAEA,QAAMG,aAAaT,SAAShB,SAAS,IAAIiB,MAAMC,OAAOK,QAAQ;AAG5D,SAAA,oBAAC,SAAI,KAAU,WAAWrC,QAAQwC,WAAW,GAAIvB,QAC/C,UAAA,qBAAC,OACC,EAAA,WAAWE,GAAGnB,QAAQa,QAAQb,QAAQe,OAAO,GAAGf,QAAQK,IAAI,CAAC,GAC7D,OAAO8B,mBAENrB,UAAAA;AAAAA,IAAAA,SACE,oBAAA,OAAA,EACC,WAAWd,QAAQc,OACnB,OAAO;AAAA,MAAER,iBAAiBiC;AAAAA,IAAAA,GAE7B;AAAA,IACD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QAEA,WAAWpB,GAAGnB,QAAQyC,MAAMzC,QAAQ0C,QAAQ1C,QAAQK,IAAI,GAAGP,SAAS;AAAA,QACpE,OAAO8B;AAAAA,QACP;AAAA,QACA;AAAA,QACA,GAAIZ;AAAAA,QAEHd;AAAAA,MAAAA;AAAAA,IACH;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,CAAC;"}
|