@hitachivantara/uikit-react-core 5.31.0 → 5.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Accordion/Accordion.cjs +4 -5
- package/dist/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs +5 -5
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/Action/Action.cjs +2 -2
- package/dist/cjs/components/AppSwitcher/Action/Action.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/AppSwitcher.cjs +2 -2
- package/dist/cjs/components/AppSwitcher/AppSwitcher.cjs.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.cjs +1 -1
- package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/BannerContent.cjs +1 -1
- package/dist/cjs/components/Banner/BannerContent/BannerContent.cjs.map +1 -1
- package/dist/cjs/components/BaseCheckBox/BaseCheckBox.cjs +3 -3
- package/dist/cjs/components/BaseCheckBox/BaseCheckBox.cjs.map +1 -1
- package/dist/cjs/components/BaseDropdown/BaseDropdown.cjs +15 -18
- package/dist/cjs/components/BaseDropdown/BaseDropdown.cjs.map +1 -1
- package/dist/cjs/components/BaseDropdown/BaseDropdown.styles.cjs +6 -6
- package/dist/cjs/components/BaseDropdown/BaseDropdown.styles.cjs.map +1 -1
- package/dist/cjs/components/BaseInput/BaseInput.cjs +1 -1
- package/dist/cjs/components/BaseInput/BaseInput.cjs.map +1 -1
- package/dist/cjs/components/BaseInput/validations.cjs +12 -13
- package/dist/cjs/components/BaseInput/validations.cjs.map +1 -1
- package/dist/cjs/components/BaseRadio/BaseRadio.cjs +3 -3
- package/dist/cjs/components/BaseRadio/BaseRadio.cjs.map +1 -1
- package/dist/cjs/components/BaseSwitch/BaseSwitch.cjs +3 -3
- package/dist/cjs/components/BaseSwitch/BaseSwitch.cjs.map +1 -1
- package/dist/cjs/components/Box/Box.cjs +1 -1
- package/dist/cjs/components/Box/Box.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs +2 -5
- package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/Page/Page.cjs +11 -9
- package/dist/cjs/components/BreadCrumb/Page/Page.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/Page/Page.styles.cjs +3 -3
- package/dist/cjs/components/BreadCrumb/Page/Page.styles.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/utils.cjs +1 -1
- package/dist/cjs/components/BreadCrumb/utils.cjs.map +1 -1
- package/dist/cjs/components/BulkActions/BulkActions.cjs +4 -4
- package/dist/cjs/components/BulkActions/BulkActions.cjs.map +1 -1
- package/dist/cjs/components/BulkActions/BulkActions.styles.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +1 -1
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/Calendar/Calendar.cjs +3 -3
- package/dist/cjs/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/cjs/components/Calendar/Calendar.styles.cjs +1 -1
- package/dist/cjs/components/Calendar/Calendar.styles.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs +6 -9
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.styles.cjs +1 -1
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.styles.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs +4 -4
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.cjs +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs +2 -2
- package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.cjs +8 -28
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.styles.cjs +9 -39
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.styles.cjs.map +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs +3 -6
- package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs.map +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.cjs +15 -19
- package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.cjs.map +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.styles.cjs +9 -1
- package/dist/cjs/components/Calendar/SingleCalendar/SingleCalendar.styles.cjs.map +1 -1
- package/dist/cjs/components/Calendar/utils.cjs +8 -13
- package/dist/cjs/components/Calendar/utils.cjs.map +1 -1
- package/dist/cjs/components/Card/Card.cjs.map +1 -1
- package/dist/cjs/components/Card/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/Card/Media/Media.cjs.map +1 -1
- package/dist/cjs/components/Carousel/Carousel.cjs +10 -11
- package/dist/cjs/components/Carousel/Carousel.cjs.map +1 -1
- package/dist/cjs/components/Carousel/CarouselControls.cjs +1 -1
- package/dist/cjs/components/Carousel/CarouselControls.cjs.map +1 -1
- package/dist/cjs/components/Carousel/CarouselThumbnails.cjs +1 -1
- package/dist/cjs/components/Carousel/CarouselThumbnails.cjs.map +1 -1
- package/dist/cjs/components/CheckBox/CheckBox.cjs +3 -3
- package/dist/cjs/components/CheckBox/CheckBox.cjs.map +1 -1
- package/dist/cjs/components/CheckBoxGroup/CheckBoxGroup.cjs +11 -17
- package/dist/cjs/components/CheckBoxGroup/CheckBoxGroup.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/ColorPicker.cjs +10 -10
- package/dist/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/Fields/Fields.cjs +16 -16
- package/dist/cjs/components/ColorPicker/Fields/Fields.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/Picker/Picker.cjs +3 -3
- package/dist/cjs/components/ColorPicker/Picker/Picker.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/PresetColors/PresetColors.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/SavedColors/SavedColors.cjs.map +1 -1
- package/dist/cjs/components/Controls/Controls.cjs +7 -13
- package/dist/cjs/components/Controls/Controls.cjs.map +1 -1
- package/dist/cjs/components/Controls/LeftControl/LeftControl.cjs +2 -2
- package/dist/cjs/components/Controls/LeftControl/LeftControl.cjs.map +1 -1
- package/dist/cjs/components/Controls/RightControl/RightControl.cjs +3 -3
- package/dist/cjs/components/Controls/RightControl/RightControl.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.cjs +10 -11
- package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/utils.cjs +1 -1
- package/dist/cjs/components/DatePicker/utils.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Content/Content.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +5 -5
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Title/Title.cjs.map +1 -1
- package/dist/cjs/components/DotPagination/DotPagination.cjs +4 -4
- package/dist/cjs/components/DotPagination/DotPagination.cjs.map +1 -1
- package/dist/cjs/components/Drawer/Drawer.cjs +1 -1
- package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs +5 -6
- package/dist/cjs/components/DropDownMenu/DropDownMenu.cjs.map +1 -1
- package/dist/cjs/components/Dropdown/Dropdown.cjs +10 -12
- package/dist/cjs/components/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/cjs/components/Dropdown/List/List.cjs +10 -13
- package/dist/cjs/components/Dropdown/List/List.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs +13 -14
- package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/DropZone/DropZone.styles.cjs +1 -1
- package/dist/cjs/components/FileUploader/DropZone/DropZone.styles.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/File/File.cjs +6 -6
- package/dist/cjs/components/FileUploader/File/File.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/File/File.styles.cjs +1 -1
- package/dist/cjs/components/FileUploader/File/File.styles.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/FileList/FileList.cjs +1 -1
- package/dist/cjs/components/FileUploader/FileList/FileList.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/FileList/FileList.styles.cjs +1 -1
- package/dist/cjs/components/FileUploader/FileList/FileList.styles.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/FileUploader.cjs +1 -1
- package/dist/cjs/components/FileUploader/FileUploader.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/Preview/Preview.cjs +1 -1
- package/dist/cjs/components/FileUploader/Preview/Preview.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/Preview/Preview.styles.cjs +1 -1
- package/dist/cjs/components/FileUploader/Preview/Preview.styles.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/Counter/Counter.cjs +2 -4
- package/dist/cjs/components/FilterGroup/Counter/Counter.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.cjs +10 -11
- package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterGroupContext.cjs +1 -1
- package/dist/cjs/components/FilterGroup/FilterGroupContext.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs +14 -26
- package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs.map +1 -1
- package/dist/cjs/components/Focus/Focus.cjs +8 -13
- package/dist/cjs/components/Focus/Focus.cjs.map +1 -1
- package/dist/cjs/components/Focus/utils.cjs +1 -1
- package/dist/cjs/components/Focus/utils.cjs.map +1 -1
- package/dist/cjs/components/Footer/Footer.cjs.map +1 -1
- package/dist/cjs/components/Footer/Footer.styles.cjs.map +1 -1
- package/dist/cjs/components/Forms/Adornment/Adornment.cjs +1 -2
- package/dist/cjs/components/Forms/Adornment/Adornment.cjs.map +1 -1
- package/dist/cjs/components/Forms/FormElement/utils/FormUtils.cjs +17 -20
- package/dist/cjs/components/Forms/FormElement/utils/FormUtils.cjs.map +1 -1
- package/dist/cjs/components/Forms/Label/Label.cjs +1 -2
- package/dist/cjs/components/Forms/Label/Label.cjs.map +1 -1
- package/dist/cjs/components/Forms/Suggestions/Suggestions.cjs +2 -2
- package/dist/cjs/components/Forms/Suggestions/Suggestions.cjs.map +1 -1
- package/dist/cjs/components/Forms/WarningText/WarningText.cjs +3 -6
- package/dist/cjs/components/Forms/WarningText/WarningText.cjs.map +1 -1
- package/dist/cjs/components/Forms/WarningText/WarningText.styles.cjs +6 -7
- package/dist/cjs/components/Forms/WarningText/WarningText.styles.cjs.map +1 -1
- package/dist/cjs/components/GlobalActions/GlobalActions.cjs +1 -1
- package/dist/cjs/components/GlobalActions/GlobalActions.cjs.map +1 -1
- package/dist/cjs/components/GlobalActions/GlobalActions.styles.cjs.map +1 -1
- package/dist/cjs/components/Grid/Grid.cjs +1 -1
- package/dist/cjs/components/Grid/Grid.cjs.map +1 -1
- package/dist/cjs/components/Header/Actions/Actions.styles.cjs +1 -2
- package/dist/cjs/components/Header/Actions/Actions.styles.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuBar/Bar.cjs +1 -1
- package/dist/cjs/components/Header/Navigation/MenuBar/Bar.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuBar/MenuBar.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.cjs +14 -15
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/Navigation.cjs +1 -1
- package/dist/cjs/components/Header/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/useSelectionPath.cjs +1 -1
- package/dist/cjs/components/Header/Navigation/useSelectionPath.cjs.map +1 -1
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs +8 -7
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs.map +1 -1
- package/dist/cjs/components/InlineEditor/InlineEditor.styles.cjs +2 -2
- package/dist/cjs/components/InlineEditor/InlineEditor.styles.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.cjs +24 -29
- package/dist/cjs/components/Input/Input.cjs.map +1 -1
- package/dist/cjs/components/Kpi/Kpi.cjs +4 -4
- package/dist/cjs/components/Kpi/Kpi.cjs.map +1 -1
- package/dist/cjs/components/Link/Link.cjs +1 -1
- package/dist/cjs/components/Link/Link.cjs.map +1 -1
- package/dist/cjs/components/List/List.cjs +5 -6
- package/dist/cjs/components/List/List.cjs.map +1 -1
- package/dist/cjs/components/List/utils.cjs +6 -6
- package/dist/cjs/components/List/utils.cjs.map +1 -1
- package/dist/cjs/components/ListContainer/ListItem/ListItem.cjs +4 -4
- package/dist/cjs/components/ListContainer/ListItem/ListItem.cjs.map +1 -1
- package/dist/cjs/components/Login/Login.styles.cjs +1 -1
- package/dist/cjs/components/Login/Login.styles.cjs.map +1 -1
- package/dist/cjs/components/MultiButton/MultiButton.cjs +1 -1
- package/dist/cjs/components/MultiButton/MultiButton.cjs.map +1 -1
- package/dist/cjs/components/MultiButton/MultiButton.styles.cjs.map +1 -1
- package/dist/cjs/components/OverflowTooltip/OverflowTooltip.cjs +3 -4
- package/dist/cjs/components/OverflowTooltip/OverflowTooltip.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs +18 -16
- package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.styles.cjs +27 -8
- package/dist/cjs/components/Pagination/Pagination.styles.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Select.cjs +1 -1
- package/dist/cjs/components/Pagination/Select.cjs.map +1 -1
- package/dist/cjs/components/Panel/Panel.cjs.map +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.cjs +2 -2
- package/dist/cjs/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Context.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs +3 -3
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Attribute/Attribute.cjs +4 -6
- package/dist/cjs/components/QueryBuilder/Rule/Attribute/Attribute.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Rule.cjs +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Rule.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs +18 -23
- package/dist/cjs/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs +31 -35
- package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs +10 -12
- package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/utils/index.cjs +1 -1
- package/dist/cjs/components/QueryBuilder/utils/index.cjs.map +1 -1
- package/dist/cjs/components/Radio/Radio.cjs +3 -3
- package/dist/cjs/components/Radio/Radio.cjs.map +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup.cjs +11 -16
- package/dist/cjs/components/RadioGroup/RadioGroup.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs +7 -7
- package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs +4 -4
- package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.cjs +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/useScrollTo.cjs +3 -3
- package/dist/cjs/components/ScrollTo/useScrollTo.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/utils.cjs +4 -7
- package/dist/cjs/components/ScrollTo/utils.cjs.map +1 -1
- package/dist/cjs/components/Section/Section.cjs +50 -0
- package/dist/cjs/components/Section/Section.cjs.map +1 -0
- package/dist/cjs/components/Section/Section.styles.cjs +40 -0
- package/dist/cjs/components/Section/Section.styles.cjs.map +1 -0
- package/dist/cjs/components/SelectionList/SelectionList.cjs +9 -15
- package/dist/cjs/components/SelectionList/SelectionList.cjs.map +1 -1
- package/dist/cjs/components/Slider/Slider.cjs +9 -10
- package/dist/cjs/components/Slider/Slider.cjs.map +1 -1
- package/dist/cjs/components/Slider/Slider.styles.cjs.map +1 -1
- package/dist/cjs/components/Slider/SliderInput/SliderInput.cjs +2 -2
- package/dist/cjs/components/Slider/SliderInput/SliderInput.cjs.map +1 -1
- package/dist/cjs/components/Slider/utils.cjs +2 -2
- package/dist/cjs/components/Slider/utils.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarContent/SnackbarContent.cjs +2 -2
- package/dist/cjs/components/Snackbar/SnackbarContent/SnackbarContent.cjs.map +1 -1
- package/dist/cjs/components/Stack/Stack.cjs.map +1 -1
- package/dist/cjs/components/Switch/Switch.cjs +1 -1
- package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
- package/dist/cjs/components/Tab/Tab.cjs.map +1 -1
- package/dist/cjs/components/Tab/Tab.styles.cjs +1 -1
- package/dist/cjs/components/Tab/Tab.styles.cjs.map +1 -1
- package/dist/cjs/components/Table/TableBody/TableBody.cjs +1 -2
- package/dist/cjs/components/Table/TableBody/TableBody.cjs.map +1 -1
- package/dist/cjs/components/Table/TableCell/TableCell.cjs +3 -4
- package/dist/cjs/components/Table/TableCell/TableCell.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHead/TableHead.cjs +1 -2
- package/dist/cjs/components/Table/TableHead/TableHead.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHeader/TableHeader.cjs +3 -4
- package/dist/cjs/components/Table/TableHeader/TableHeader.cjs.map +1 -1
- package/dist/cjs/components/Table/TableRow/TableRow.cjs +2 -3
- package/dist/cjs/components/Table/TableRow/TableRow.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useHeaderGroups.cjs +1 -2
- package/dist/cjs/components/Table/hooks/useHeaderGroups.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useResizeColumns.cjs +1 -2
- package/dist/cjs/components/Table/hooks/useResizeColumns.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useRowExpand.cjs +2 -5
- package/dist/cjs/components/Table/hooks/useRowExpand.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useRowSelection.cjs +2 -4
- package/dist/cjs/components/Table/hooks/useRowSelection.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useSticky.cjs +5 -7
- package/dist/cjs/components/Table/hooks/useSticky.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useTable.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useTableStyles.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.cjs +1 -1
- package/dist/cjs/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs +1 -1
- package/dist/cjs/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/renderers.cjs +6 -7
- package/dist/cjs/components/Table/renderers/renderers.cjs.map +1 -1
- package/dist/cjs/components/Table/utils/fallbacks.cjs +1 -1
- package/dist/cjs/components/Table/utils/fallbacks.cjs.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.styles.cjs.map +1 -1
- package/dist/cjs/components/Tag/Tag.cjs +2 -2
- package/dist/cjs/components/Tag/Tag.cjs.map +1 -1
- package/dist/cjs/components/Tag/Tag.styles.cjs.map +1 -1
- package/dist/cjs/components/TagsInput/TagsInput.cjs +16 -26
- package/dist/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/dist/cjs/components/TextArea/TextArea.cjs +5 -9
- package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/cjs/components/TimePicker/Placeholder.cjs +1 -1
- package/dist/cjs/components/TimePicker/Placeholder.cjs.map +1 -1
- package/dist/cjs/components/TimePicker/TimePicker.cjs +3 -4
- package/dist/cjs/components/TimePicker/TimePicker.cjs.map +1 -1
- package/dist/cjs/components/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/cjs/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.styles.cjs.map +1 -1
- package/dist/cjs/components/Typography/Typography.cjs +1 -1
- package/dist/cjs/components/Typography/Typography.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Action.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Action.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.styles.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs +10 -10
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.styles.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopup.styles.cjs +2 -2
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopup.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +2 -2
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/utils/NavigationSlider.utils.cjs +2 -4
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/utils/NavigationSlider.utils.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeView.cjs +5 -16
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeView.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeView.styles.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeView.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs +7 -8
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/descendants.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs +2 -2
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.styles.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.styles.cjs.map +1 -1
- package/dist/cjs/hocs/withTooltip.cjs +1 -1
- package/dist/cjs/hocs/withTooltip.cjs.map +1 -1
- package/dist/cjs/hooks/useClickOutside.cjs +2 -2
- package/dist/cjs/hooks/useClickOutside.cjs.map +1 -1
- package/dist/cjs/hooks/useComputation.cjs +1 -1
- package/dist/cjs/hooks/useComputation.cjs.map +1 -1
- package/dist/cjs/hooks/useCss.cjs.map +1 -1
- package/dist/cjs/hooks/useDefaultProps.cjs +4 -5
- package/dist/cjs/hooks/useDefaultProps.cjs.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +1 -2
- package/dist/cjs/hooks/useTheme.cjs.map +1 -1
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/utils/classes.cjs +2 -2
- package/dist/cjs/utils/classes.cjs.map +1 -1
- package/dist/cjs/utils/keyboardUtils.cjs +1 -1
- package/dist/cjs/utils/keyboardUtils.cjs.map +1 -1
- package/dist/cjs/utils/setId.cjs +1 -3
- package/dist/cjs/utils/setId.cjs.map +1 -1
- package/dist/cjs/utils/theme.cjs +2 -4
- package/dist/cjs/utils/theme.cjs.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +4 -5
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js +5 -5
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/components/AppSwitcher/Action/Action.js +2 -2
- package/dist/esm/components/AppSwitcher/Action/Action.js.map +1 -1
- package/dist/esm/components/AppSwitcher/AppSwitcher.js +2 -2
- package/dist/esm/components/AppSwitcher/AppSwitcher.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/BannerContent.js +1 -1
- package/dist/esm/components/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/components/BaseCheckBox/BaseCheckBox.js +3 -3
- package/dist/esm/components/BaseCheckBox/BaseCheckBox.js.map +1 -1
- package/dist/esm/components/BaseDropdown/BaseDropdown.js +15 -18
- package/dist/esm/components/BaseDropdown/BaseDropdown.js.map +1 -1
- package/dist/esm/components/BaseDropdown/BaseDropdown.styles.js +6 -6
- package/dist/esm/components/BaseDropdown/BaseDropdown.styles.js.map +1 -1
- package/dist/esm/components/BaseInput/BaseInput.js +1 -1
- package/dist/esm/components/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/components/BaseInput/validations.js +12 -13
- package/dist/esm/components/BaseInput/validations.js.map +1 -1
- package/dist/esm/components/BaseRadio/BaseRadio.js +3 -3
- package/dist/esm/components/BaseRadio/BaseRadio.js.map +1 -1
- package/dist/esm/components/BaseSwitch/BaseSwitch.js +3 -3
- package/dist/esm/components/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/esm/components/Box/Box.js +1 -1
- package/dist/esm/components/Box/Box.js.map +1 -1
- package/dist/esm/components/BreadCrumb/BreadCrumb.js +3 -4
- package/dist/esm/components/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/esm/components/BreadCrumb/Page/Page.js +11 -9
- package/dist/esm/components/BreadCrumb/Page/Page.js.map +1 -1
- package/dist/esm/components/BreadCrumb/Page/Page.styles.js +3 -3
- package/dist/esm/components/BreadCrumb/Page/Page.styles.js.map +1 -1
- package/dist/esm/components/BreadCrumb/utils.js +1 -1
- package/dist/esm/components/BreadCrumb/utils.js.map +1 -1
- package/dist/esm/components/BulkActions/BulkActions.js +4 -4
- package/dist/esm/components/BulkActions/BulkActions.js.map +1 -1
- package/dist/esm/components/BulkActions/BulkActions.styles.js.map +1 -1
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js +3 -3
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.styles.js +1 -1
- package/dist/esm/components/Calendar/Calendar.styles.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js +6 -8
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.styles.js +1 -1
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +4 -4
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +2 -2
- package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.js +8 -28
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.styles.js +9 -39
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.styles.js.map +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js +3 -6
- package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.js +15 -17
- package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.js.map +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.styles.js +9 -1
- package/dist/esm/components/Calendar/SingleCalendar/SingleCalendar.styles.js.map +1 -1
- package/dist/esm/components/Calendar/utils.js +8 -12
- package/dist/esm/components/Calendar/utils.js.map +1 -1
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/Header/Header.js.map +1 -1
- package/dist/esm/components/Card/Media/Media.js.map +1 -1
- package/dist/esm/components/Carousel/Carousel.js +10 -11
- package/dist/esm/components/Carousel/Carousel.js.map +1 -1
- package/dist/esm/components/Carousel/CarouselControls.js +1 -1
- package/dist/esm/components/Carousel/CarouselControls.js.map +1 -1
- package/dist/esm/components/Carousel/CarouselThumbnails.js +1 -1
- package/dist/esm/components/Carousel/CarouselThumbnails.js.map +1 -1
- package/dist/esm/components/CheckBox/CheckBox.js +3 -3
- package/dist/esm/components/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/CheckBoxGroup/CheckBoxGroup.js +11 -17
- package/dist/esm/components/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/esm/components/ColorPicker/ColorPicker.js +10 -10
- package/dist/esm/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/components/ColorPicker/Fields/Fields.js +16 -16
- package/dist/esm/components/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/esm/components/ColorPicker/Picker/Picker.js +3 -3
- package/dist/esm/components/ColorPicker/Picker/Picker.js.map +1 -1
- package/dist/esm/components/ColorPicker/PresetColors/PresetColors.js.map +1 -1
- package/dist/esm/components/ColorPicker/SavedColors/SavedColors.js.map +1 -1
- package/dist/esm/components/Controls/Controls.js +7 -13
- package/dist/esm/components/Controls/Controls.js.map +1 -1
- package/dist/esm/components/Controls/LeftControl/LeftControl.js +2 -2
- package/dist/esm/components/Controls/LeftControl/LeftControl.js.map +1 -1
- package/dist/esm/components/Controls/RightControl/RightControl.js +3 -3
- package/dist/esm/components/Controls/RightControl/RightControl.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js +10 -11
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/DatePicker/utils.js +1 -1
- package/dist/esm/components/DatePicker/utils.js.map +1 -1
- package/dist/esm/components/Dialog/Actions/Actions.js.map +1 -1
- package/dist/esm/components/Dialog/Content/Content.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +5 -5
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/Title/Title.js.map +1 -1
- package/dist/esm/components/DotPagination/DotPagination.js +4 -4
- package/dist/esm/components/DotPagination/DotPagination.js.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js +1 -1
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/DropDownMenu/DropDownMenu.js +5 -6
- package/dist/esm/components/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js +10 -12
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Dropdown/List/List.js +10 -11
- package/dist/esm/components/Dropdown/List/List.js.map +1 -1
- package/dist/esm/components/FileUploader/DropZone/DropZone.js +13 -14
- package/dist/esm/components/FileUploader/DropZone/DropZone.js.map +1 -1
- package/dist/esm/components/FileUploader/DropZone/DropZone.styles.js +1 -1
- package/dist/esm/components/FileUploader/DropZone/DropZone.styles.js.map +1 -1
- package/dist/esm/components/FileUploader/File/File.js +6 -6
- package/dist/esm/components/FileUploader/File/File.js.map +1 -1
- package/dist/esm/components/FileUploader/File/File.styles.js +1 -1
- package/dist/esm/components/FileUploader/File/File.styles.js.map +1 -1
- package/dist/esm/components/FileUploader/FileList/FileList.js +1 -1
- package/dist/esm/components/FileUploader/FileList/FileList.js.map +1 -1
- package/dist/esm/components/FileUploader/FileList/FileList.styles.js +1 -1
- package/dist/esm/components/FileUploader/FileList/FileList.styles.js.map +1 -1
- package/dist/esm/components/FileUploader/FileUploader.js +1 -1
- package/dist/esm/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/esm/components/FileUploader/Preview/Preview.js +1 -1
- package/dist/esm/components/FileUploader/Preview/Preview.js.map +1 -1
- package/dist/esm/components/FileUploader/Preview/Preview.styles.js +1 -1
- package/dist/esm/components/FileUploader/Preview/Preview.styles.js.map +1 -1
- package/dist/esm/components/FilterGroup/Counter/Counter.js +2 -4
- package/dist/esm/components/FilterGroup/Counter/Counter.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterContent/FilterContent.js +10 -11
- package/dist/esm/components/FilterGroup/FilterContent/FilterContent.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterGroupContext.js +1 -1
- package/dist/esm/components/FilterGroup/FilterGroupContext.js.map +1 -1
- package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js +14 -26
- package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js.map +1 -1
- package/dist/esm/components/Focus/Focus.js +8 -12
- package/dist/esm/components/Focus/Focus.js.map +1 -1
- package/dist/esm/components/Focus/utils.js +1 -1
- package/dist/esm/components/Focus/utils.js.map +1 -1
- package/dist/esm/components/Footer/Footer.js.map +1 -1
- package/dist/esm/components/Footer/Footer.styles.js.map +1 -1
- package/dist/esm/components/Forms/Adornment/Adornment.js +1 -2
- package/dist/esm/components/Forms/Adornment/Adornment.js.map +1 -1
- package/dist/esm/components/Forms/FormElement/utils/FormUtils.js +17 -20
- package/dist/esm/components/Forms/FormElement/utils/FormUtils.js.map +1 -1
- package/dist/esm/components/Forms/Label/Label.js +1 -2
- package/dist/esm/components/Forms/Label/Label.js.map +1 -1
- package/dist/esm/components/Forms/Suggestions/Suggestions.js +2 -2
- package/dist/esm/components/Forms/Suggestions/Suggestions.js.map +1 -1
- package/dist/esm/components/Forms/WarningText/WarningText.js +3 -4
- package/dist/esm/components/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/esm/components/Forms/WarningText/WarningText.styles.js +6 -7
- package/dist/esm/components/Forms/WarningText/WarningText.styles.js.map +1 -1
- package/dist/esm/components/GlobalActions/GlobalActions.js +1 -1
- package/dist/esm/components/GlobalActions/GlobalActions.js.map +1 -1
- package/dist/esm/components/GlobalActions/GlobalActions.styles.js.map +1 -1
- package/dist/esm/components/Grid/Grid.js +1 -1
- package/dist/esm/components/Grid/Grid.js.map +1 -1
- package/dist/esm/components/Header/Actions/Actions.styles.js +1 -2
- package/dist/esm/components/Header/Actions/Actions.styles.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuBar/Bar.js +1 -1
- package/dist/esm/components/Header/Navigation/MenuBar/Bar.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuBar/MenuBar.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.js +14 -15
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
- package/dist/esm/components/Header/Navigation/Navigation.js +1 -1
- package/dist/esm/components/Header/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Header/Navigation/useSelectionPath.js +1 -1
- package/dist/esm/components/Header/Navigation/useSelectionPath.js.map +1 -1
- package/dist/esm/components/InlineEditor/InlineEditor.js +8 -7
- package/dist/esm/components/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/components/InlineEditor/InlineEditor.styles.js +2 -2
- package/dist/esm/components/InlineEditor/InlineEditor.styles.js.map +1 -1
- package/dist/esm/components/Input/Input.js +24 -29
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Kpi/Kpi.js +4 -4
- package/dist/esm/components/Kpi/Kpi.js.map +1 -1
- package/dist/esm/components/Link/Link.js +1 -1
- package/dist/esm/components/Link/Link.js.map +1 -1
- package/dist/esm/components/List/List.js +5 -6
- package/dist/esm/components/List/List.js.map +1 -1
- package/dist/esm/components/List/utils.js +6 -6
- package/dist/esm/components/List/utils.js.map +1 -1
- package/dist/esm/components/ListContainer/ListItem/ListItem.js +4 -4
- package/dist/esm/components/ListContainer/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/Login/Login.styles.js +1 -1
- package/dist/esm/components/Login/Login.styles.js.map +1 -1
- package/dist/esm/components/MultiButton/MultiButton.js +1 -1
- package/dist/esm/components/MultiButton/MultiButton.js.map +1 -1
- package/dist/esm/components/MultiButton/MultiButton.styles.js.map +1 -1
- package/dist/esm/components/OverflowTooltip/OverflowTooltip.js +3 -4
- package/dist/esm/components/OverflowTooltip/OverflowTooltip.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +18 -16
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.styles.js +29 -10
- package/dist/esm/components/Pagination/Pagination.styles.js.map +1 -1
- package/dist/esm/components/Pagination/Select.js +1 -1
- package/dist/esm/components/Pagination/Select.js.map +1 -1
- package/dist/esm/components/Panel/Panel.js.map +1 -1
- package/dist/esm/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/esm/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js +2 -2
- package/dist/esm/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Context.js.map +1 -1
- package/dist/esm/components/QueryBuilder/QueryBuilder.js +3 -3
- package/dist/esm/components/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Attribute/Attribute.js +4 -6
- package/dist/esm/components/QueryBuilder/Rule/Attribute/Attribute.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Rule.js +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Rule.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js +18 -23
- package/dist/esm/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.js +31 -35
- package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js +10 -12
- package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
- package/dist/esm/components/QueryBuilder/utils/index.js +1 -1
- package/dist/esm/components/QueryBuilder/utils/index.js.map +1 -1
- package/dist/esm/components/Radio/Radio.js +3 -3
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +11 -16
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js +7 -7
- package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js +4 -4
- package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js +1 -1
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js +1 -1
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +1 -1
- package/dist/esm/components/ScrollTo/useScrollTo.js +3 -3
- package/dist/esm/components/ScrollTo/useScrollTo.js.map +1 -1
- package/dist/esm/components/ScrollTo/utils.js +4 -7
- package/dist/esm/components/ScrollTo/utils.js.map +1 -1
- package/dist/esm/components/Section/Section.js +51 -0
- package/dist/esm/components/Section/Section.js.map +1 -0
- package/dist/esm/components/Section/Section.styles.js +40 -0
- package/dist/esm/components/Section/Section.styles.js.map +1 -0
- package/dist/esm/components/SelectionList/SelectionList.js +9 -15
- package/dist/esm/components/SelectionList/SelectionList.js.map +1 -1
- package/dist/esm/components/Slider/Slider.js +9 -10
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Slider/Slider.styles.js.map +1 -1
- package/dist/esm/components/Slider/SliderInput/SliderInput.js +2 -2
- package/dist/esm/components/Slider/SliderInput/SliderInput.js.map +1 -1
- package/dist/esm/components/Slider/utils.js +2 -2
- package/dist/esm/components/Slider/utils.js.map +1 -1
- package/dist/esm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarContent/SnackbarContent.js +2 -2
- package/dist/esm/components/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
- package/dist/esm/components/Stack/Stack.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tab/Tab.js.map +1 -1
- package/dist/esm/components/Tab/Tab.styles.js +1 -1
- package/dist/esm/components/Tab/Tab.styles.js.map +1 -1
- package/dist/esm/components/Table/TableBody/TableBody.js +1 -2
- package/dist/esm/components/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/components/Table/TableCell/TableCell.js +3 -4
- package/dist/esm/components/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/Table/TableHead/TableHead.js +1 -2
- package/dist/esm/components/Table/TableHead/TableHead.js.map +1 -1
- package/dist/esm/components/Table/TableHeader/TableHeader.js +3 -4
- package/dist/esm/components/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/esm/components/Table/TableRow/TableRow.js +2 -3
- package/dist/esm/components/Table/TableRow/TableRow.js.map +1 -1
- package/dist/esm/components/Table/hooks/useHeaderGroups.js +1 -2
- package/dist/esm/components/Table/hooks/useHeaderGroups.js.map +1 -1
- package/dist/esm/components/Table/hooks/useResizeColumns.js +1 -2
- package/dist/esm/components/Table/hooks/useResizeColumns.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowExpand.js +2 -5
- package/dist/esm/components/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowSelection.js +2 -4
- package/dist/esm/components/Table/hooks/useRowSelection.js.map +1 -1
- package/dist/esm/components/Table/hooks/useSticky.js +5 -7
- package/dist/esm/components/Table/hooks/useSticky.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTableStyles.js.map +1 -1
- package/dist/esm/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.js +1 -1
- package/dist/esm/components/Table/renderers/DropdownColumnCell/DropdownColumnCell.js.map +1 -1
- package/dist/esm/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.js +1 -1
- package/dist/esm/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.js.map +1 -1
- package/dist/esm/components/Table/renderers/renderers.js +6 -7
- package/dist/esm/components/Table/renderers/renderers.js.map +1 -1
- package/dist/esm/components/Table/utils/fallbacks.js +1 -1
- package/dist/esm/components/Table/utils/fallbacks.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.styles.js.map +1 -1
- package/dist/esm/components/Tag/Tag.js +2 -2
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/Tag/Tag.styles.js.map +1 -1
- package/dist/esm/components/TagsInput/TagsInput.js +16 -24
- package/dist/esm/components/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/components/TextArea/TextArea.js +5 -7
- package/dist/esm/components/TextArea/TextArea.js.map +1 -1
- package/dist/esm/components/TimePicker/Placeholder.js +1 -1
- package/dist/esm/components/TimePicker/Placeholder.js.map +1 -1
- package/dist/esm/components/TimePicker/TimePicker.js +3 -4
- package/dist/esm/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/components/ToggleButton/ToggleButton.js +1 -1
- package/dist/esm/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/esm/components/Typography/Typography.js +1 -1
- package/dist/esm/components/Typography/Typography.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Action.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Action.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Actions.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Actions.styles.js +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Actions.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Header/Header.js +1 -1
- package/dist/esm/components/VerticalNavigation/Header/Header.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js +10 -10
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.styles.js +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js +2 -2
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js +2 -2
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationSlider/utils/NavigationSlider.utils.js +2 -4
- package/dist/esm/components/VerticalNavigation/NavigationSlider/utils/NavigationSlider.utils.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeView.js +5 -16
- package/dist/esm/components/VerticalNavigation/TreeView/TreeView.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeView.styles.js +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeView.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js +7 -8
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/descendants.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js +2 -2
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.styles.js +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
- package/dist/esm/hocs/withTooltip.js +1 -1
- package/dist/esm/hocs/withTooltip.js.map +1 -1
- package/dist/esm/hooks/useClickOutside.js +2 -2
- package/dist/esm/hooks/useClickOutside.js.map +1 -1
- package/dist/esm/hooks/useComputation.js +1 -1
- package/dist/esm/hooks/useComputation.js.map +1 -1
- package/dist/esm/hooks/useCss.js.map +1 -1
- package/dist/esm/hooks/useDefaultProps.js +4 -5
- package/dist/esm/hooks/useDefaultProps.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +1 -2
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/classes.js +2 -2
- package/dist/esm/utils/classes.js.map +1 -1
- package/dist/esm/utils/keyboardUtils.js +1 -1
- package/dist/esm/utils/keyboardUtils.js.map +1 -1
- package/dist/esm/utils/setId.js +1 -2
- package/dist/esm/utils/setId.js.map +1 -1
- package/dist/esm/utils/theme.js +2 -4
- package/dist/esm/utils/theme.js.map +1 -1
- package/dist/types/index.d.ts +59 -4
- package/package.json +5 -5
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.cjs +0 -24
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.cjs.map +0 -1
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.styles.cjs +0 -19
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.styles.cjs.map +0 -1
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.js +0 -25
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.js.map +0 -1
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.styles.js +0 -19
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.styles.js.map +0 -1
package/dist/cjs/utils/theme.cjs
CHANGED
|
@@ -43,7 +43,6 @@ const applyThemeCustomizations = (obj, customizations) => {
|
|
|
43
43
|
return customizedTheme;
|
|
44
44
|
};
|
|
45
45
|
const createTheme = (props) => {
|
|
46
|
-
var _a;
|
|
47
46
|
const {
|
|
48
47
|
name,
|
|
49
48
|
base = "ds5",
|
|
@@ -65,10 +64,9 @@ const createTheme = (props) => {
|
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
|
-
if (!inheritColorModes &&
|
|
67
|
+
if (!inheritColorModes && customizations.colors?.modes) {
|
|
69
68
|
Object.keys(customizedTheme.colors.modes).forEach((mode) => {
|
|
70
|
-
|
|
71
|
-
if (!Object.keys(((_a2 = customizations.colors) == null ? void 0 : _a2.modes) || {}).includes(mode)) {
|
|
69
|
+
if (!Object.keys(customizations.colors?.modes || {}).includes(mode)) {
|
|
72
70
|
delete customizedTheme.colors.modes[mode];
|
|
73
71
|
}
|
|
74
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.cjs","sources":["../../../src/utils/theme.ts"],"sourcesContent":["/* eslint import/namespace: [2, { allowComputed: true }] */\nimport { CSSProperties } from \"react\";\n\nimport {\n themes,\n HvThemeColorModeStructure,\n HvThemeStructure,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { HvTheme, HvCreateThemeProps } from \"@core/types/theme\";\n\n/**\n * Sets the element style properties.\n */\nconst setElementStyle = (element: HTMLElement, style: CSSProperties) => {\n Object.entries(style).forEach(([property, value]) => {\n element.style[property] = value;\n });\n};\n\n/**\n * Sets the element attributes and style for a theme and color mode.\n */\nexport const setElementAttrs = (\n themeName: string,\n modeName: string,\n colorScheme: string,\n themeRootId?: string\n) => {\n const element = themeRootId\n ? document.getElementById(themeRootId)\n : document.body;\n\n if (element) {\n element.setAttribute(`data-theme`, themeName);\n element.setAttribute(`data-color-mode`, modeName);\n\n // Set default properties for all components to inherit\n setElementStyle(element, {\n colorScheme,\n backgroundColor: theme.colors.backgroundColor,\n accentColor: theme.colors.secondary,\n color: theme.colors.secondary,\n fontSize: theme.typography.body.fontSize,\n fontWeight: theme.typography.body.fontWeight,\n lineHeight: theme.typography.body.lineHeight,\n letterSpacing: theme.typography.body.letterSpacing,\n fontFamily: theme.fontFamily.body,\n });\n }\n};\n\n/**\n * Applies customizations to a theme.\n */\nconst applyThemeCustomizations = (obj: object, customizations: object) => {\n const isObject = (val: any) =>\n val && typeof val === \"object\" && !Array.isArray(val);\n\n // Customized theme\n const customizedTheme = { ...obj };\n\n // Add new values to the theme or replace values\n Object.keys(customizations).forEach((key) => {\n if (customizedTheme[key]) {\n if (isObject(customizedTheme[key]) && isObject(customizations[key])) {\n customizedTheme[key] = applyThemeCustomizations(\n customizedTheme[key],\n customizations[key]\n );\n } else if (typeof customizedTheme[key] === typeof customizations[key]) {\n customizedTheme[key] = customizations[key];\n }\n } else {\n customizedTheme[key] = customizations[key];\n }\n });\n\n return customizedTheme;\n};\n\n/**\n * Creates a customized theme based on the base theme and customizations given.\n * For the color modes, the colors that are not defined will be replaced by the values from the dawn mode of the base theme.\n */\nexport const createTheme = (\n props: HvCreateThemeProps\n): HvTheme | HvThemeStructure => {\n const {\n name,\n base = \"ds5\",\n inheritColorModes = true,\n ...customizations\n } = props;\n\n // Apply customizations to the base theme\n const customizedTheme: HvTheme | HvThemeStructure = customizations\n ? (applyThemeCustomizations(themes[base], customizations) as HvTheme)\n : { ...themes[base] };\n\n // Set theme name\n customizedTheme.name = name.trim();\n // Set theme base\n customizedTheme.base = base;\n\n // Fill new color modes with missing colors\n if (customizations) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!themes[base].colors.modes[mode]) {\n customizedTheme.colors.modes[mode] = {\n ...themes[base].colors.modes.dawn,\n ...(customizedTheme.colors.modes[mode] as Partial<\n HvThemeColorModeStructure & { [key: string]: string }\n >),\n };\n }\n });\n }\n\n // If the flag `inheritColorModes` is false and customizations were given for the color modes,\n // we're removing any color modes that might have been inherited\n if (!inheritColorModes && customizations.colors?.modes) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!Object.keys(customizations.colors?.modes || {}).includes(mode)) {\n delete customizedTheme.colors.modes[mode];\n }\n });\n }\n\n // Created theme\n return customizedTheme;\n};\n\n/**\n * Process the themes provided to the HvProvider:\n * - Cleans themes with the same name\n * - Returns the default if the list is empty (ds5)\n */\nexport const processThemes = (\n themesList?: (HvTheme | HvThemeStructure)[]\n): (HvTheme | HvThemeStructure)[] => {\n if (themesList && Array.isArray(themesList) && themesList.length > 0) {\n const list: (HvTheme | HvThemeStructure)[] = [];\n\n themesList.forEach((thm) => {\n const i: number = list.findIndex(\n (t) => t.name.trim() === thm.name.trim()\n );\n\n if (i !== -1) {\n list.splice(i, 1);\n list.push(thm);\n } else {\n list.push(thm);\n }\n });\n\n // Cleaned themes\n return list;\n }\n // DS5\n return [themes.ds5];\n};\n\nexport const getVarValue = (cssVar: string, rootElementId?: string) => {\n if (typeof window !== \"undefined\") {\n const root = document.getElementById(rootElementId || \"hv-root\");\n\n if (root) {\n const computedValue = getComputedStyle(root)\n .getPropertyValue(cssVar.replace(\"var(\", \"\").replace(\")\", \"\"))\n .trim();\n\n return computedValue;\n }\n }\n};\n"],"names":["setElementStyle","element","style","entries","forEach","property","value","setElementAttrs","themeName","modeName","colorScheme","themeRootId","document","getElementById","body","setAttribute","backgroundColor","theme","colors","accentColor","secondary","color","fontSize","typography","fontWeight","lineHeight","letterSpacing","fontFamily","applyThemeCustomizations","obj","customizations","isObject","val","Array","isArray","customizedTheme","Object","keys","key","createTheme","props","name","base","inheritColorModes","themes","trim","modes","mode","dawn","includes","processThemes","themesList","length","list","thm","i","findIndex","t","splice","push","ds5","getVarValue","cssVar","rootElementId","window","root","computedValue","getComputedStyle","getPropertyValue","replace"],"mappings":";;;AAeA,MAAMA,kBAAkBA,CAACC,SAAsBC,UAAyB;AAC/DC,SAAAA,QAAQD,KAAK,EAAEE,QAAQ,CAAC,CAACC,UAAUC,KAAK,MAAM;AAC3CJ,YAAAA,MAAMG,QAAQ,IAAIC;AAAAA,EAAAA,CAC3B;AACH;AAKO,MAAMC,kBAAkBA,CAC7BC,WACAC,UACAC,aACAC,gBACG;AACH,QAAMV,UAAUU,cACZC,SAASC,eAAeF,WAAW,IACnCC,SAASE;AAEb,MAAIb,SAAS;AACHc,YAAAA,aAA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
1
|
+
{"version":3,"file":"theme.cjs","sources":["../../../src/utils/theme.ts"],"sourcesContent":["/* eslint import/namespace: [2, { allowComputed: true }] */\nimport { CSSProperties } from \"react\";\n\nimport {\n themes,\n HvThemeColorModeStructure,\n HvThemeStructure,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { HvTheme, HvCreateThemeProps } from \"@core/types/theme\";\n\n/**\n * Sets the element style properties.\n */\nconst setElementStyle = (element: HTMLElement, style: CSSProperties) => {\n Object.entries(style).forEach(([property, value]) => {\n element.style[property] = value;\n });\n};\n\n/**\n * Sets the element attributes and style for a theme and color mode.\n */\nexport const setElementAttrs = (\n themeName: string,\n modeName: string,\n colorScheme: string,\n themeRootId?: string\n) => {\n const element = themeRootId\n ? document.getElementById(themeRootId)\n : document.body;\n\n if (element) {\n element.setAttribute(`data-theme`, themeName);\n element.setAttribute(`data-color-mode`, modeName);\n\n // Set default properties for all components to inherit\n setElementStyle(element, {\n colorScheme,\n backgroundColor: theme.colors.backgroundColor,\n accentColor: theme.colors.secondary,\n color: theme.colors.secondary,\n fontSize: theme.typography.body.fontSize,\n fontWeight: theme.typography.body.fontWeight,\n lineHeight: theme.typography.body.lineHeight,\n letterSpacing: theme.typography.body.letterSpacing,\n fontFamily: theme.fontFamily.body,\n });\n }\n};\n\n/**\n * Applies customizations to a theme.\n */\nconst applyThemeCustomizations = (obj: object, customizations: object) => {\n const isObject = (val: any) =>\n val && typeof val === \"object\" && !Array.isArray(val);\n\n // Customized theme\n const customizedTheme = { ...obj };\n\n // Add new values to the theme or replace values\n Object.keys(customizations).forEach((key) => {\n if (customizedTheme[key]) {\n if (isObject(customizedTheme[key]) && isObject(customizations[key])) {\n customizedTheme[key] = applyThemeCustomizations(\n customizedTheme[key],\n customizations[key]\n );\n } else if (typeof customizedTheme[key] === typeof customizations[key]) {\n customizedTheme[key] = customizations[key];\n }\n } else {\n customizedTheme[key] = customizations[key];\n }\n });\n\n return customizedTheme;\n};\n\n/**\n * Creates a customized theme based on the base theme and customizations given.\n * For the color modes, the colors that are not defined will be replaced by the values from the dawn mode of the base theme.\n */\nexport const createTheme = (\n props: HvCreateThemeProps\n): HvTheme | HvThemeStructure => {\n const {\n name,\n base = \"ds5\",\n inheritColorModes = true,\n ...customizations\n } = props;\n\n // Apply customizations to the base theme\n const customizedTheme: HvTheme | HvThemeStructure = customizations\n ? (applyThemeCustomizations(themes[base], customizations) as HvTheme)\n : { ...themes[base] };\n\n // Set theme name\n customizedTheme.name = name.trim();\n // Set theme base\n customizedTheme.base = base;\n\n // Fill new color modes with missing colors\n if (customizations) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!themes[base].colors.modes[mode]) {\n customizedTheme.colors.modes[mode] = {\n ...themes[base].colors.modes.dawn,\n ...(customizedTheme.colors.modes[mode] as Partial<\n HvThemeColorModeStructure & { [key: string]: string }\n >),\n };\n }\n });\n }\n\n // If the flag `inheritColorModes` is false and customizations were given for the color modes,\n // we're removing any color modes that might have been inherited\n if (!inheritColorModes && customizations.colors?.modes) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!Object.keys(customizations.colors?.modes || {}).includes(mode)) {\n delete customizedTheme.colors.modes[mode];\n }\n });\n }\n\n // Created theme\n return customizedTheme;\n};\n\n/**\n * Process the themes provided to the HvProvider:\n * - Cleans themes with the same name\n * - Returns the default if the list is empty (ds5)\n */\nexport const processThemes = (\n themesList?: (HvTheme | HvThemeStructure)[]\n): (HvTheme | HvThemeStructure)[] => {\n if (themesList && Array.isArray(themesList) && themesList.length > 0) {\n const list: (HvTheme | HvThemeStructure)[] = [];\n\n themesList.forEach((thm) => {\n const i: number = list.findIndex(\n (t) => t.name.trim() === thm.name.trim()\n );\n\n if (i !== -1) {\n list.splice(i, 1);\n list.push(thm);\n } else {\n list.push(thm);\n }\n });\n\n // Cleaned themes\n return list;\n }\n // DS5\n return [themes.ds5];\n};\n\nexport const getVarValue = (cssVar: string, rootElementId?: string) => {\n if (typeof window !== \"undefined\") {\n const root = document.getElementById(rootElementId || \"hv-root\");\n\n if (root) {\n const computedValue = getComputedStyle(root)\n .getPropertyValue(cssVar.replace(\"var(\", \"\").replace(\")\", \"\"))\n .trim();\n\n return computedValue;\n }\n }\n};\n"],"names":["setElementStyle","element","style","entries","forEach","property","value","setElementAttrs","themeName","modeName","colorScheme","themeRootId","document","getElementById","body","setAttribute","backgroundColor","theme","colors","accentColor","secondary","color","fontSize","typography","fontWeight","lineHeight","letterSpacing","fontFamily","applyThemeCustomizations","obj","customizations","isObject","val","Array","isArray","customizedTheme","Object","keys","key","createTheme","props","name","base","inheritColorModes","themes","trim","modes","mode","dawn","includes","processThemes","themesList","length","list","thm","i","findIndex","t","splice","push","ds5","getVarValue","cssVar","rootElementId","window","root","computedValue","getComputedStyle","getPropertyValue","replace"],"mappings":";;;AAeA,MAAMA,kBAAkBA,CAACC,SAAsBC,UAAyB;AAC/DC,SAAAA,QAAQD,KAAK,EAAEE,QAAQ,CAAC,CAACC,UAAUC,KAAK,MAAM;AAC3CJ,YAAAA,MAAMG,QAAQ,IAAIC;AAAAA,EAAAA,CAC3B;AACH;AAKO,MAAMC,kBAAkBA,CAC7BC,WACAC,UACAC,aACAC,gBACG;AACH,QAAMV,UAAUU,cACZC,SAASC,eAAeF,WAAW,IACnCC,SAASE;AAEb,MAAIb,SAAS;AACHc,YAAAA,aAAc,cAAaP,SAAS;AACpCO,YAAAA,aAAc,mBAAkBN,QAAQ;AAGhDT,oBAAgBC,SAAS;AAAA,MACvBS;AAAAA,MACAM,iBAAiBC,YAAAA,MAAMC,OAAOF;AAAAA,MAC9BG,aAAaF,YAAAA,MAAMC,OAAOE;AAAAA,MAC1BC,OAAOJ,YAAAA,MAAMC,OAAOE;AAAAA,MACpBE,UAAUL,YAAMM,MAAAA,WAAWT,KAAKQ;AAAAA,MAChCE,YAAYP,YAAMM,MAAAA,WAAWT,KAAKU;AAAAA,MAClCC,YAAYR,YAAMM,MAAAA,WAAWT,KAAKW;AAAAA,MAClCC,e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AAS;AAE/D,QAAIE,MAAM;AACR,YAAMC,gBAAgBC,iBAAiBF,IAAI,EACxCG,iBAAiBN,OAAOO,QAAQ,QAAQ,EAAE,EAAEA,QAAQ,KAAK,EAAE,CAAC,EAC5DxB;AAEIqB,aAAAA;AAAAA,IACT;AAAA,EACF;AACF;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
|
-
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
4
3
|
import { DropUpXS, DropDownXS } from "@hitachivantara/uikit-react-icons";
|
|
4
|
+
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
5
5
|
import { useControlled } from "../../hooks/useControlled.js";
|
|
6
6
|
import { setId } from "../../utils/setId.js";
|
|
7
7
|
import { useClasses } from "./Accordion.styles.js";
|
|
@@ -30,7 +30,7 @@ const HvAccordion = (props) => {
|
|
|
30
30
|
const [isOpen, setIsOpen] = useControlled(expanded, Boolean(defaultExpanded));
|
|
31
31
|
const handleAction = useCallback((event) => {
|
|
32
32
|
if (!disabled) {
|
|
33
|
-
onChange
|
|
33
|
+
onChange?.(event, isOpen);
|
|
34
34
|
setIsOpen(!isOpen);
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
@@ -65,15 +65,14 @@ const HvAccordion = (props) => {
|
|
|
65
65
|
const accordionHeaderId = setId(id, "button");
|
|
66
66
|
const accordionContainer = setId(id, "container");
|
|
67
67
|
const accordionHeader = useMemo(() => {
|
|
68
|
-
const color = disabled
|
|
68
|
+
const color = disabled ? "secondary_60" : void 0;
|
|
69
69
|
const accordionButton = /* @__PURE__ */ jsxs(HvTypography, { id: accordionHeaderId, component: "div", role: "button", className: cx(classes.label, {
|
|
70
70
|
[classes.disabled]: disabled
|
|
71
71
|
}), disabled, tabIndex: 0, onKeyDown: handleKeyDown, onClick: handleClick, variant: labelVariant, "aria-expanded": isOpen, "aria-disabled": disabled, children: [
|
|
72
72
|
isOpen ? /* @__PURE__ */ jsx(DropUpXS, { color }) : /* @__PURE__ */ jsx(DropDownXS, { color }),
|
|
73
73
|
label
|
|
74
74
|
] });
|
|
75
|
-
|
|
76
|
-
return result;
|
|
75
|
+
return headingLevel === void 0 ? accordionButton : /* @__PURE__ */ jsx(HvTypography, { component: `h${headingLevel}`, variant: labelVariant, children: accordionButton });
|
|
77
76
|
}, [cx, classes, handleClick, handleKeyDown, label, accordionHeaderId, disabled, headingLevel, isOpen, labelVariant]);
|
|
78
77
|
return /* @__PURE__ */ jsxs("div", { id, className: cx(classes.root, className), ...others, children: [
|
|
79
78
|
accordionHeader,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React, {\n SyntheticEvent,\n useCallback,\n useMemo,\n HTMLAttributes,\n} from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React, {\n SyntheticEvent,\n useCallback,\n useMemo,\n HTMLAttributes,\n} from \"react\";\n\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { useControlled } from \"@core/hooks/useControlled\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { setId } from \"@core/utils/setId\";\nimport {\n HvTypographyVariants,\n HvTypography,\n} from \"@core/components/Typography\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { staticClasses, useClasses } from \"./Accordion.styles\";\n\nexport { staticClasses as accordionClasses };\n\nexport type HvAccordionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAccordionProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The accordion label button.\n */\n label?: string;\n /**\n * The function that will be executed whenever the accordion toggles it will receive the state of the accordion\n */\n onChange?: (event: React.SyntheticEvent, value: boolean) => void;\n /**\n * Whether the accordion is open or not, if this property is defined the accordion must be fully controlled.\n */\n expanded?: boolean;\n /**\n * When uncontrolled, defines the initial expanded state.\n */\n defaultExpanded?: boolean;\n /**\n * An object containing props to be passed onto container holding the accordion children.\n */\n containerProps?: HTMLAttributes<HTMLDivElement>;\n /**\n * Heading Level to apply to accordion button if ´undefined´ the button won't have a header wrapper.\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * Is the accordion disabled.\n */\n disabled?: boolean;\n /**\n * Typography variant for the label.\n */\n labelVariant?: HvTypographyVariants;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvAccordionClasses;\n}\n\n/**\n * A accordion is a design element that expands in place to expose hidden information.\n */\nexport const HvAccordion = (props: HvAccordionProps) => {\n const {\n id,\n className,\n classes: classesProp,\n disabled = false,\n label,\n onChange,\n children,\n expanded,\n headingLevel,\n defaultExpanded = false,\n containerProps,\n labelVariant = \"label\",\n ...others\n } = useDefaultProps(\"HvAccordion\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const [isOpen, setIsOpen] = useControlled(expanded, Boolean(defaultExpanded));\n\n const handleAction = useCallback(\n (event: SyntheticEvent) => {\n if (!disabled) {\n onChange?.(event, isOpen);\n setIsOpen(!isOpen);\n return true;\n }\n return false;\n },\n [disabled, onChange, isOpen, setIsOpen]\n );\n\n const handleClick = useCallback(\n (event: SyntheticEvent) => {\n handleAction(event);\n event.preventDefault();\n event.stopPropagation();\n },\n [handleAction]\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n let isEventHandled = false;\n const { key } = event;\n\n if (\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.currentTarget !== event.target\n ) {\n return;\n }\n switch (key) {\n case \"Enter\":\n case \" \":\n isEventHandled = handleAction(event);\n break;\n default:\n return;\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [handleAction]\n );\n\n const accordionHeaderId = setId(id, \"button\");\n const accordionContainer = setId(id, \"container\");\n const accordionHeader = useMemo(() => {\n const color = disabled ? \"secondary_60\" : undefined;\n\n const accordionButton = (\n <HvTypography\n id={accordionHeaderId}\n component=\"div\"\n role=\"button\"\n className={cx(classes.label, { [classes.disabled]: disabled })}\n disabled={disabled}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onClick={handleClick}\n variant={labelVariant}\n aria-expanded={isOpen}\n aria-disabled={disabled}\n >\n {isOpen ? <DropUpXS color={color} /> : <DropDownXS color={color} />}\n {label}\n </HvTypography>\n );\n\n return headingLevel === undefined ? (\n accordionButton\n ) : (\n <HvTypography component={`h${headingLevel}`} variant={labelVariant}>\n {accordionButton}\n </HvTypography>\n );\n }, [\n cx,\n classes,\n handleClick,\n handleKeyDown,\n label,\n accordionHeaderId,\n disabled,\n headingLevel,\n isOpen,\n labelVariant,\n ]);\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n {accordionHeader}\n <div\n id={accordionContainer}\n role=\"region\"\n aria-labelledby={accordionHeaderId}\n className={cx(classes.container, { [classes.hidden]: !isOpen })}\n hidden={!isOpen}\n {...containerProps}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["HvAccordion","props","id","className","classes","classesProp","disabled","label","onChange","children","expanded","headingLevel","defaultExpanded","containerProps","labelVariant","others","useDefaultProps","cx","useClasses","isOpen","setIsOpen","useControlled","Boolean","handleAction","useCallback","event","handleClick","preventDefault","stopPropagation","handleKeyDown","isEventHandled","key","altKey","ctrlKey","metaKey","currentTarget","target","accordionHeaderId","setId","accordionContainer","accordionHeader","useMemo","color","undefined","accordionButton","root","container","hidden"],"mappings":";;;;;;;;;AAyEaA,MAAAA,cAAcA,CAACC,UAA4B;AAChD,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC,WAAW;AAAA,IACXC;AAAAA,IACAC;A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pC,WAAW,iBAAiBqC;AAE1C,UAAMC,kBACJ,qBAAC,cACC,EAAA,IAAIP,mBACJ,WAAU,OACV,MAAK,UACL,WAAWpB,GAAGb,QAAQG,OAAO;AAAA,MAAE,CAACH,QAAQE,QAAQ,GAAGA;AAAAA,IAAAA,CAAU,GAC7D,UACA,UAAU,GACV,WAAWuB,eACX,SAASH,aACT,SAASZ,cACT,iBAAeK,QACf,iBAAeb,UAEda,UAAAA;AAAAA,MAAAA,6BAAU,UAAS,EAAA,MAAA,CAAgB,IAAG,oBAAC,cAAW,OAAgB;AAAA,MAClEZ;AAAAA,IACH,EAAA,CAAA;AAGKI,WAAAA,iBAAiBgC,SACtBC,kBAEC,oBAAA,cAAA,EAAa,WAAY,IAAGjC,YAAa,IAAG,SAASG,cACnD8B,UACH,gBAAA,CAAA;AAAA,EAED,GAAA,CACD3B,IACAb,SACAsB,aACAG,eACAtB,OACA8B,mBACA/B,UACAK,cACAQ,QACAL,YAAY,CACb;AAGC,SAAA,qBAAC,OAAI,EAAA,IAAQ,WAAWG,GAAGb,QAAQyC,MAAM1C,SAAS,GAAOY,GAAAA,QACtDyB,UAAAA;AAAAA,IAAAA;AAAAA,IACD,oBAAC,OACC,EAAA,IAAID,oBACJ,MAAK,UACL,mBAAiBF,mBACjB,WAAWpB,GAAGb,QAAQ0C,WAAW;AAAA,MAAE,CAAC1C,QAAQ2C,MAAM,GAAG,CAAC5B;AAAAA,IAAAA,CAAQ,GAC9D,QAAQ,CAACA,QACLN,GAAAA,gBAEHJ,SACH,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { isValidElement } from "react";
|
|
3
|
-
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
4
3
|
import { MoreOptionsVertical } from "@hitachivantara/uikit-react-icons";
|
|
5
4
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
5
|
+
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
6
6
|
import { hexToRgbA } from "../../utils/hexToRgbA.js";
|
|
7
7
|
import { setId } from "../../utils/setId.js";
|
|
8
8
|
import { useTheme } from "../../hooks/useTheme.js";
|
|
@@ -41,14 +41,14 @@ const HvActionsGeneric = (props) => {
|
|
|
41
41
|
...other
|
|
42
42
|
} = action;
|
|
43
43
|
const actionId = setId(id, idx, "action", action.id);
|
|
44
|
-
const renderedIcon = isValidElement(icon) ? icon : icon
|
|
44
|
+
const renderedIcon = isValidElement(icon) ? icon : icon?.({
|
|
45
45
|
isDisabled: disabled
|
|
46
46
|
});
|
|
47
47
|
return /* @__PURE__ */ jsx(HvButton, { id: actionId, variant: category, className: cx(css({
|
|
48
48
|
"&:hover": {
|
|
49
|
-
backgroundColor: hexToRgbA(
|
|
49
|
+
backgroundColor: hexToRgbA(colors?.base_light || theme.colors.base_light, 0.3)
|
|
50
50
|
}
|
|
51
|
-
}), classes.button), disabled: actDisabled ?? disabled, onClick: (event) => actionsCallback
|
|
51
|
+
}), classes.button), disabled: actDisabled ?? disabled, onClick: (event) => actionsCallback?.(event, id || "", action), startIcon: renderedIcon, ...other, children: label }, actionId || idx);
|
|
52
52
|
};
|
|
53
53
|
const renderActionsGrid = () => {
|
|
54
54
|
const actsVisible = actions.slice(0, maxVisibleActions);
|
|
@@ -61,7 +61,7 @@ const HvActionsGeneric = (props) => {
|
|
|
61
61
|
root: classes.dropDownMenu,
|
|
62
62
|
icon: classes.dropDownMenuButton,
|
|
63
63
|
iconSelected: classes.dropDownMenuButtonSelected
|
|
64
|
-
}, icon: /* @__PURE__ */ jsx(MoreOptionsVertical, { color: iconColor }), placement: "left", onClick: (event, action) => actionsCallback
|
|
64
|
+
}, icon: /* @__PURE__ */ jsx(MoreOptionsVertical, { color: iconColor }), placement: "left", onClick: (event, action) => actionsCallback?.(event, id || "", action), dataList: actsDropdown, keepOpened: false, disablePortal: false })
|
|
65
65
|
] });
|
|
66
66
|
};
|
|
67
67
|
const actionOverflow = actions.length > maxVisibleActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsGeneric.js","sources":["../../../../src/components/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import React, { isValidElement } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ActionsGeneric.js","sources":["../../../../src/components/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import React, { isValidElement } from \"react\";\n\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\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":";;;;;;;;;;;;AAiDaA,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,I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,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;"}
|
|
@@ -32,7 +32,7 @@ const HvAppSwitcherAction = ({
|
|
|
32
32
|
url,
|
|
33
33
|
target
|
|
34
34
|
} = application;
|
|
35
|
-
const color = disabled ? theme.colors.secondary_60 : getColor(application
|
|
35
|
+
const color = disabled ? theme.colors.secondary_60 : getColor(application?.color, theme.colors.secondary);
|
|
36
36
|
const [validIconUrl, setValidIconUrl] = useState(true);
|
|
37
37
|
const renderApplicationIcon = () => {
|
|
38
38
|
if (iconElement) {
|
|
@@ -53,7 +53,7 @@ const HvAppSwitcherAction = ({
|
|
|
53
53
|
event.preventDefault();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
onClickCallback
|
|
56
|
+
onClickCallback?.(event, {
|
|
57
57
|
...application,
|
|
58
58
|
isSelected
|
|
59
59
|
});
|
|
@@ -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","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,
|
|
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,aAAaY,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,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AAQS,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;"}
|
|
@@ -26,7 +26,7 @@ const HvAppSwitcher = (props) => {
|
|
|
26
26
|
classes,
|
|
27
27
|
cx
|
|
28
28
|
} = useClasses(classesProp);
|
|
29
|
-
const panelActions = useMemo(() => applications &&
|
|
29
|
+
const panelActions = useMemo(() => applications && applications?.map((application) => {
|
|
30
30
|
if (application.name) {
|
|
31
31
|
return /* @__PURE__ */ jsx(HvAppSwitcherAction, { application, onClickCallback: onActionClickedCallback, isSelectedCallback: isActionSelectedCallback, classes: {
|
|
32
32
|
root: classes.item,
|
|
@@ -39,7 +39,7 @@ const HvAppSwitcher = (props) => {
|
|
|
39
39
|
} }, application.id || `${application.name}_${application.url}`);
|
|
40
40
|
}
|
|
41
41
|
return void 0;
|
|
42
|
-
})
|
|
42
|
+
}), [applications, classes, isActionSelectedCallback, onActionClickedCallback]);
|
|
43
43
|
return /* @__PURE__ */ jsxs("div", { id, className: cx(classes.root, classes[layout], {
|
|
44
44
|
[classes.open]: !!isOpen,
|
|
45
45
|
[classes.closed]: isOpen === false
|
|
@@ -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","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,
|
|
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,I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AAA,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,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
4
3
|
import { User } from "@hitachivantara/uikit-react-icons";
|
|
5
4
|
import { getColor, theme } from "@hitachivantara/uikit-styles";
|
|
6
5
|
import MuiAvatar from "@mui/material/Avatar";
|
|
6
|
+
import { useDefaultProps } from "../../hooks/useDefaultProps.js";
|
|
7
7
|
import { useImageLoaded } from "../../hooks/useImageLoaded.js";
|
|
8
8
|
import { decreaseSize } from "../../utils/sizes.js";
|
|
9
9
|
import { useClasses } from "./Avatar.styles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { CSSProperties, HTMLAttributes, forwardRef } from \"react\";\
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { CSSProperties, HTMLAttributes, forwardRef } from \"react\";\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 { useDefaultProps } from \"@core/hooks/useDefaultProps\";\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":";;;;;;;;;;AAgEO,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;"}
|
|
@@ -31,7 +31,7 @@ const HvBannerContent = forwardRef((props, ref) => {
|
|
|
31
31
|
root: classes.root,
|
|
32
32
|
message: classes.message,
|
|
33
33
|
action: classes.action
|
|
34
|
-
}, className: cx(classes
|
|
34
|
+
}, className: cx(classes?.baseVariant, classes?.[variant]), message: /* @__PURE__ */ jsx(HvMessageContainer, { id, icon, ...effectiveActionsPosition === "inline" && {
|
|
35
35
|
actionsOnMessage: actions,
|
|
36
36
|
actionsOnMessageCallback: actionsCallback
|
|
37
37
|
}, message: content }), action: /* @__PURE__ */ jsx(HvActionContainer, { id, onClose, ...effectiveActionsPosition === "bottom-right" && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerContent.js","sources":["../../../../../src/components/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport SnackbarContent, {\n SnackbarContentProps as MuiSnackbarContentProps,\n} from \"@mui/material/SnackbarContent\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { iconVariant } from \"@core/utils/iconVariant\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { HvActionGeneric } from \"@core/components/ActionsGeneric\";\n\nimport { HvBannerActionPosition, HvBannerVariant } from \"../types\";\nimport { HvActionContainer, HvActionContainerProps } from \"./ActionContainer\";\nimport { HvMessageContainer } from \"./MessageContainer\";\nimport { useClasses, staticClasses } from \"./BannerContent.styles\";\n\nexport { staticClasses as bannerContentClasses };\n\nexport type HvBannerContentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerContentProps\n extends Omit<MuiSnackbarContentProps, \"variant\" | \"classes\" | \"onClose\">,\n HvBaseProps {\n /** The message to display. */\n content?: string;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** onClose function. */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Actions to display on the right side. */\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 position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: HvActionContainerProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n}\n\nexport const HvBannerContent = forwardRef<HTMLDivElement, HvBannerContentProps>(\n (props, ref) => {\n const {\n id,\n classes: classesProp,\n showIcon = false,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n content,\n actionProps,\n ...others\n } = props;\n const { classes, cx } = useClasses(classesProp);\n const icon = customIcon || (showIcon && iconVariant(variant, \"base_dark\"));\n\n // default to inline\n // this might try to be more intelligent in the future,\n // taking into account the content length, available space,\n // number of actions, etc..\n const effectiveActionsPosition =\n actionsPosition === \"auto\" ? \"inline\" : actionsPosition;\n\n return (\n <div className={classes.outContainer}>\n <SnackbarContent\n ref={ref}\n id={id}\n classes={{\n root: classes.root,\n message: classes.message,\n action: classes.action,\n }}\n className={cx(classes?.baseVariant, classes?.[variant])}\n message={\n <HvMessageContainer\n id={id}\n icon={icon}\n {...(effectiveActionsPosition === \"inline\" && {\n actionsOnMessage: actions,\n actionsOnMessageCallback: actionsCallback,\n })}\n message={content}\n />\n }\n action={\n <HvActionContainer\n id={id}\n onClose={onClose}\n {...(effectiveActionsPosition === \"bottom-right\" && {\n action: actions,\n actionCallback: actionsCallback,\n })}\n {...actionProps}\n />\n }\n {...others}\n />\n </div>\n );\n }\n);\n"],"names":["HvBannerContent","forwardRef","props","ref","id","classes","classesProp","showIcon","customIcon","variant","onClose","actions","actionsCallback","actionsPosition","content","actionProps","others","cx","useClasses","icon","iconVariant","effectiveActionsPosition","outContainer","root","message","action","baseVariant","actionsOnMessage","actionsOnMessageCallback","actionCallback"],"mappings":";;;;;;;;AAiDO,MAAMA,kBAAkBC,WAC7B,CAACC,OAAOC,QAAQ;AACR,QAAA;AAAA,IACJC;AAAAA,IACAC,SAASC;AAAAA,IACTC,WAAW;AAAA,IACXC;AAAAA,IACAC,UAAU;AAAA,IACVC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,kBAAkB;AAAA,IAClBC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EACDd,IAAAA;AACE,QAAA;AAAA,IAAEG;AAAAA,IAASY;AAAAA,EAAAA,IAAOC,WAAWZ,WAAW;AAC9C,QAAMa,OAAOX,cAAeD,YAAYa,YAAYX,SAAS,WAAW;AAMlEY,QAAAA,2BACJR,oBAAoB,SAAS,WAAWA;AAGxC,SAAA,oBAAC,SAAI,WAAWR,QAAQiB,cACtB,UAAC,oBAAA,iBAAA,EACC,KACA,IACA,SAAS;AAAA,IACPC,MAAMlB,QAAQkB;AAAAA,IACdC,SAASnB,QAAQmB;AAAAA,IACjBC,QAAQpB,QAAQoB;AAAAA,EAAAA,GAElB,WAAWR,GAAGZ,
|
|
1
|
+
{"version":3,"file":"BannerContent.js","sources":["../../../../../src/components/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport SnackbarContent, {\n SnackbarContentProps as MuiSnackbarContentProps,\n} from \"@mui/material/SnackbarContent\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { iconVariant } from \"@core/utils/iconVariant\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { HvActionGeneric } from \"@core/components/ActionsGeneric\";\n\nimport { HvBannerActionPosition, HvBannerVariant } from \"../types\";\nimport { HvActionContainer, HvActionContainerProps } from \"./ActionContainer\";\nimport { HvMessageContainer } from \"./MessageContainer\";\nimport { useClasses, staticClasses } from \"./BannerContent.styles\";\n\nexport { staticClasses as bannerContentClasses };\n\nexport type HvBannerContentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerContentProps\n extends Omit<MuiSnackbarContentProps, \"variant\" | \"classes\" | \"onClose\">,\n HvBaseProps {\n /** The message to display. */\n content?: string;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** onClose function. */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Actions to display on the right side. */\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 position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: HvActionContainerProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n}\n\nexport const HvBannerContent = forwardRef<HTMLDivElement, HvBannerContentProps>(\n (props, ref) => {\n const {\n id,\n classes: classesProp,\n showIcon = false,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n content,\n actionProps,\n ...others\n } = props;\n const { classes, cx } = useClasses(classesProp);\n const icon = customIcon || (showIcon && iconVariant(variant, \"base_dark\"));\n\n // default to inline\n // this might try to be more intelligent in the future,\n // taking into account the content length, available space,\n // number of actions, etc..\n const effectiveActionsPosition =\n actionsPosition === \"auto\" ? \"inline\" : actionsPosition;\n\n return (\n <div className={classes.outContainer}>\n <SnackbarContent\n ref={ref}\n id={id}\n classes={{\n root: classes.root,\n message: classes.message,\n action: classes.action,\n }}\n className={cx(classes?.baseVariant, classes?.[variant])}\n message={\n <HvMessageContainer\n id={id}\n icon={icon}\n {...(effectiveActionsPosition === \"inline\" && {\n actionsOnMessage: actions,\n actionsOnMessageCallback: actionsCallback,\n })}\n message={content}\n />\n }\n action={\n <HvActionContainer\n id={id}\n onClose={onClose}\n {...(effectiveActionsPosition === \"bottom-right\" && {\n action: actions,\n actionCallback: actionsCallback,\n })}\n {...actionProps}\n />\n }\n {...others}\n />\n </div>\n );\n }\n);\n"],"names":["HvBannerContent","forwardRef","props","ref","id","classes","classesProp","showIcon","customIcon","variant","onClose","actions","actionsCallback","actionsPosition","content","actionProps","others","cx","useClasses","icon","iconVariant","effectiveActionsPosition","outContainer","root","message","action","baseVariant","actionsOnMessage","actionsOnMessageCallback","actionCallback"],"mappings":";;;;;;;;AAiDO,MAAMA,kBAAkBC,WAC7B,CAACC,OAAOC,QAAQ;AACR,QAAA;AAAA,IACJC;AAAAA,IACAC,SAASC;AAAAA,IACTC,WAAW;AAAA,IACXC;AAAAA,IACAC,UAAU;AAAA,IACVC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,kBAAkB;AAAA,IAClBC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EACDd,IAAAA;AACE,QAAA;AAAA,IAAEG;AAAAA,IAASY;AAAAA,EAAAA,IAAOC,WAAWZ,WAAW;AAC9C,QAAMa,OAAOX,cAAeD,YAAYa,YAAYX,SAAS,WAAW;AAMlEY,QAAAA,2BACJR,oBAAoB,SAAS,WAAWA;AAGxC,SAAA,oBAAC,SAAI,WAAWR,QAAQiB,cACtB,UAAC,oBAAA,iBAAA,EACC,KACA,IACA,SAAS;AAAA,IACPC,MAAMlB,QAAQkB;AAAAA,IACdC,SAASnB,QAAQmB;AAAAA,IACjBC,QAAQpB,QAAQoB;AAAAA,EAAAA,GAElB,WAAWR,GAAGZ,SAASqB,aAAarB,UAAUI,OAAO,CAAC,GACtD,6BACG,oBACC,EAAA,IACA,SACKY,6BAA6B,YAAY;AAAA,IAC5CM,kBAAkBhB;AAAAA,IAClBiB,0BAA0BhB;AAAAA,EAC5B,GACA,SAASE,SACT,GAEJ,QACG,oBAAA,mBAAA,EACC,IACA,SACA,GAAKO,6BAA6B,kBAAkB;AAAA,IAClDI,QAAQd;AAAAA,IACRkB,gBAAgBjB;AAAAA,EAAAA,GAElB,GAAIG,YAAAA,IAGJC,GAAAA,OAAO,CAAA,EAEf,CAAA;AAEJ,CACF;"}
|
|
@@ -51,15 +51,15 @@ const HvBaseCheckBox = forwardRef((props, ref) => {
|
|
|
51
51
|
if (readOnly) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
onChange
|
|
54
|
+
onChange?.(event, event.target.checked, value);
|
|
55
55
|
}, [onChange, readOnly, value]);
|
|
56
56
|
const onBlurCallback = useCallback((event) => {
|
|
57
57
|
setFocusVisible(false);
|
|
58
|
-
onBlur
|
|
58
|
+
onBlur?.(event);
|
|
59
59
|
}, [onBlur]);
|
|
60
60
|
const onFocusVisibleCallback = useCallback((event) => {
|
|
61
61
|
setFocusVisible(true);
|
|
62
|
-
onFocusVisible
|
|
62
|
+
onFocusVisible?.(event);
|
|
63
63
|
}, [onFocusVisible]);
|
|
64
64
|
return /* @__PURE__ */ jsx(MuiCheckbox, { ref, id, name, value, className: cx(classes.root, {
|
|
65
65
|
[classes.disabled]: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCheckBox.js","sources":["../../../../src/components/BaseCheckBox/BaseCheckBox.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useState } from \"react\";\n\nimport MuiCheckbox, {\n CheckboxProps as MuiCheckboxProps,\n} from \"@mui/material/Checkbox\";\n\nimport {\n CheckboxCheck as CheckboxCheckIcon,\n CheckboxPartial as CheckboxPartialIcon,\n Checkbox as CheckboxIcon,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { staticClasses, useClasses } from \"./BaseCheckBox.styles\";\n\nexport { staticClasses as baseCheckBoxClasses };\n\nexport type HvBaseCheckBoxClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBaseCheckBoxProps\n extends Omit<MuiCheckboxProps, \"onChange\" | \"classes\">,\n HvBaseProps<HTMLButtonElement, \"onChange\" | \"color\"> {\n /**\n * The input name.\n */\n name?: string;\n /**\n * The value of the input.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the checkbox is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n value?: any;\n /**\n * Indicates that the input is disabled.\n */\n disabled?: boolean;\n /**\n * Indicates that the input is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that user input is required.\n */\n required?: boolean;\n /**\n * If `true` the checkbox is selected, if set to `false` the checkbox is not selected.\n *\n * When defined the checkbox state becomes controlled.\n */\n checked?: boolean;\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked?: boolean;\n /**\n * If `true` the checkbox visually shows the indeterminate state.\n */\n indeterminate?: boolean;\n /**\n * The callback fired when the checkbox is pressed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement>,\n checked: boolean,\n value: any\n ) => void;\n /**\n * Whether the selector should use semantic colors.\n */\n semantic?: boolean;\n /**\n * Properties passed on to the input element.\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible?: (event: React.FocusEvent<any>) => void;\n /**\n * Callback fired when the component is blurred.\n */\n onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;\n /**\n * A Jss Object used to override or extend the styles applied to the checkbox.\n */\n classes?: HvBaseCheckBoxClasses;\n}\n\nconst getSelectorIcons = (\n options: {\n disabled: boolean;\n semantic: boolean;\n },\n classes: HvBaseCheckBoxClasses\n) => {\n const { disabled, semantic } = options;\n const color =\n (disabled && [\"atmo3\", \"secondary_60\"]) ||\n (semantic && [\"base_light\", \"base_dark\"]) ||\n undefined;\n const checkedColor =\n (disabled && [\"atmo3\", \"secondary_60\"]) ||\n (semantic && [\"base_dark\", \"base_light\"]) ||\n undefined;\n\n // Default colors: [\"atmo1\",\"secondary\"]\n return {\n checkbox: <CheckboxIcon color={color} className={classes.icon} />,\n checkboxPartial: (\n <CheckboxPartialIcon color={color} className={classes.icon} />\n ),\n checkboxChecked: (\n <CheckboxCheckIcon color={checkedColor} className={classes.icon} />\n ),\n };\n};\n\n/**\n * A Checkbox is a mechanism that allows user to select one or more options.\n *\n * The Base Checkbox is a building block of the Checkbox form element. Don't use unless\n * implementing a custom use case not covered by the Checkbox form element.\n */\nexport const HvBaseCheckBox = forwardRef<\n HTMLButtonElement,\n HvBaseCheckBoxProps\n>((props, ref) => {\n const {\n id,\n classes: classesProp,\n className,\n name,\n inputProps,\n onChange,\n onFocusVisible,\n onBlur,\n checked,\n indeterminate,\n defaultChecked,\n value = \"on\",\n required = false,\n readOnly = false,\n disabled = false,\n semantic = false,\n ...others\n } = useDefaultProps(\"HvBaseCheckBox\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const [focusVisible, setFocusVisible] = useState<boolean>(false);\n\n const icons = getSelectorIcons({ disabled, semantic }, classes);\n\n const onChangeCallback = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n if (readOnly) {\n return;\n }\n\n onChange?.(event, event.target.checked, value);\n },\n [onChange, readOnly, value]\n );\n\n const onBlurCallback = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n setFocusVisible(false);\n onBlur?.(event);\n },\n [onBlur]\n );\n\n const onFocusVisibleCallback = useCallback(\n (event: React.FocusEvent<any>) => {\n setFocusVisible(true);\n onFocusVisible?.(event);\n },\n [onFocusVisible]\n );\n\n return (\n <MuiCheckbox\n ref={ref}\n id={id}\n name={name}\n value={value}\n className={cx(\n classes.root,\n { [classes.disabled]: disabled, [classes.focusVisible]: focusVisible },\n className\n )}\n icon={icons.checkbox}\n indeterminateIcon={icons.checkboxPartial}\n checkedIcon={icons.checkboxChecked}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n checked={checked}\n defaultChecked={defaultChecked}\n indeterminate={indeterminate}\n inputProps={inputProps}\n onChange={onChangeCallback}\n onFocusVisible={onFocusVisibleCallback}\n onBlur={onBlurCallback}\n color=\"default\"\n disableRipple\n {...others}\n />\n );\n});\n"],"names":["getSelectorIcons","options","classes","disabled","semantic","color","undefined","checkedColor","checkbox","CheckboxIcon","icon","checkboxPartial","CheckboxPartialIcon","checkboxChecked","CheckboxCheckIcon","HvBaseCheckBox","forwardRef","props","ref","id","classesProp","className","name","inputProps","onChange","onFocusVisible","onBlur","checked","indeterminate","defaultChecked","value","required","readOnly","others","useDefaultProps","cx","useClasses","focusVisible","setFocusVisible","useState","icons","onChangeCallback","useCallback","event","target","onBlurCallback","onFocusVisibleCallback","root"],"mappings":";;;;;;;AA+FA,MAAMA,mBAAmBA,CACvBC,SAIAC,YACG;AACG,QAAA;AAAA,IAAEC;AAAAA,IAAUC;AAAAA,EAAaH,IAAAA;AACzBI,QAAAA,QACHF,YAAY,CAAC,SAAS,cAAc,KACpCC,YAAY,CAAC,cAAc,WAAW,KACvCE;AACIC,QAAAA,eACHJ,YAAY,CAAC,SAAS,cAAc,KACpCC,YAAY,CAAC,aAAa,YAAY,KACvCE;AAGK,SAAA;AAAA,IACLE,UAAW,oBAAAC,UAAA,EAAa,OAAc,WAAWP,QAAQQ,MAAQ;AAAA,IACjEC,iBACG,oBAAAC,iBAAA,EAAoB,OAAc,WAAWV,QAAQQ,MACvD;AAAA,IACDG,iBACG,oBAAAC,eAAA,EAAkB,OAAOP,cAAc,WAAWL,QAAQQ,MAAK;AAAA,EAAA;AAGtE;AAQO,MAAMK,iBAAiBC,WAG5B,CAACC,OAAOC,QAAQ;AACV,QAAA;AAAA,IACJC;AAAAA,IACAjB,SAASkB;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,QAAQ;AAAA,IACRC,WAAW;AAAA,IACXC,WAAW;AAAA,IACX7B,WAAW;AAAA,IACXC,WAAW;AAAA,IACX,GAAG6B;AAAAA,EAAAA,IACDC,gBAAgB,kBAAkBjB,KAAK;AAErC,QAAA;AAAA,IAAEf;AAAAA,IAASiC;AAAAA,EAAAA,IAAOC,WAAWhB,WAAW;AAE9C,QAAM,CAACiB,cAAcC,eAAe,IAAIC,SAAkB,KAAK;AAE/D,QAAMC,QAAQxC,iBAAiB;AAAA,IAAEG;AAAAA,IAAUC;AAAAA,KAAYF,OAAO;AAExDuC,QAAAA,mBAAmBC,YACvB,CAACC,UAA+C;AAC9C,QAAIX,UAAU;AACZ;AAAA,IACF;AAEAR,
|
|
1
|
+
{"version":3,"file":"BaseCheckBox.js","sources":["../../../../src/components/BaseCheckBox/BaseCheckBox.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useState } from \"react\";\n\nimport MuiCheckbox, {\n CheckboxProps as MuiCheckboxProps,\n} from \"@mui/material/Checkbox\";\n\nimport {\n CheckboxCheck as CheckboxCheckIcon,\n CheckboxPartial as CheckboxPartialIcon,\n Checkbox as CheckboxIcon,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { staticClasses, useClasses } from \"./BaseCheckBox.styles\";\n\nexport { staticClasses as baseCheckBoxClasses };\n\nexport type HvBaseCheckBoxClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBaseCheckBoxProps\n extends Omit<MuiCheckboxProps, \"onChange\" | \"classes\">,\n HvBaseProps<HTMLButtonElement, \"onChange\" | \"color\"> {\n /**\n * The input name.\n */\n name?: string;\n /**\n * The value of the input.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the checkbox is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n value?: any;\n /**\n * Indicates that the input is disabled.\n */\n disabled?: boolean;\n /**\n * Indicates that the input is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that user input is required.\n */\n required?: boolean;\n /**\n * If `true` the checkbox is selected, if set to `false` the checkbox is not selected.\n *\n * When defined the checkbox state becomes controlled.\n */\n checked?: boolean;\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked?: boolean;\n /**\n * If `true` the checkbox visually shows the indeterminate state.\n */\n indeterminate?: boolean;\n /**\n * The callback fired when the checkbox is pressed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement>,\n checked: boolean,\n value: any\n ) => void;\n /**\n * Whether the selector should use semantic colors.\n */\n semantic?: boolean;\n /**\n * Properties passed on to the input element.\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible?: (event: React.FocusEvent<any>) => void;\n /**\n * Callback fired when the component is blurred.\n */\n onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;\n /**\n * A Jss Object used to override or extend the styles applied to the checkbox.\n */\n classes?: HvBaseCheckBoxClasses;\n}\n\nconst getSelectorIcons = (\n options: {\n disabled: boolean;\n semantic: boolean;\n },\n classes: HvBaseCheckBoxClasses\n) => {\n const { disabled, semantic } = options;\n const color =\n (disabled && [\"atmo3\", \"secondary_60\"]) ||\n (semantic && [\"base_light\", \"base_dark\"]) ||\n undefined;\n const checkedColor =\n (disabled && [\"atmo3\", \"secondary_60\"]) ||\n (semantic && [\"base_dark\", \"base_light\"]) ||\n undefined;\n\n // Default colors: [\"atmo1\",\"secondary\"]\n return {\n checkbox: <CheckboxIcon color={color} className={classes.icon} />,\n checkboxPartial: (\n <CheckboxPartialIcon color={color} className={classes.icon} />\n ),\n checkboxChecked: (\n <CheckboxCheckIcon color={checkedColor} className={classes.icon} />\n ),\n };\n};\n\n/**\n * A Checkbox is a mechanism that allows user to select one or more options.\n *\n * The Base Checkbox is a building block of the Checkbox form element. Don't use unless\n * implementing a custom use case not covered by the Checkbox form element.\n */\nexport const HvBaseCheckBox = forwardRef<\n HTMLButtonElement,\n HvBaseCheckBoxProps\n>((props, ref) => {\n const {\n id,\n classes: classesProp,\n className,\n name,\n inputProps,\n onChange,\n onFocusVisible,\n onBlur,\n checked,\n indeterminate,\n defaultChecked,\n value = \"on\",\n required = false,\n readOnly = false,\n disabled = false,\n semantic = false,\n ...others\n } = useDefaultProps(\"HvBaseCheckBox\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const [focusVisible, setFocusVisible] = useState<boolean>(false);\n\n const icons = getSelectorIcons({ disabled, semantic }, classes);\n\n const onChangeCallback = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n if (readOnly) {\n return;\n }\n\n onChange?.(event, event.target.checked, value);\n },\n [onChange, readOnly, value]\n );\n\n const onBlurCallback = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n setFocusVisible(false);\n onBlur?.(event);\n },\n [onBlur]\n );\n\n const onFocusVisibleCallback = useCallback(\n (event: React.FocusEvent<any>) => {\n setFocusVisible(true);\n onFocusVisible?.(event);\n },\n [onFocusVisible]\n );\n\n return (\n <MuiCheckbox\n ref={ref}\n id={id}\n name={name}\n value={value}\n className={cx(\n classes.root,\n { [classes.disabled]: disabled, [classes.focusVisible]: focusVisible },\n className\n )}\n icon={icons.checkbox}\n indeterminateIcon={icons.checkboxPartial}\n checkedIcon={icons.checkboxChecked}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n checked={checked}\n defaultChecked={defaultChecked}\n indeterminate={indeterminate}\n inputProps={inputProps}\n onChange={onChangeCallback}\n onFocusVisible={onFocusVisibleCallback}\n onBlur={onBlurCallback}\n color=\"default\"\n disableRipple\n {...others}\n />\n );\n});\n"],"names":["getSelectorIcons","options","classes","disabled","semantic","color","undefined","checkedColor","checkbox","CheckboxIcon","icon","checkboxPartial","CheckboxPartialIcon","checkboxChecked","CheckboxCheckIcon","HvBaseCheckBox","forwardRef","props","ref","id","classesProp","className","name","inputProps","onChange","onFocusVisible","onBlur","checked","indeterminate","defaultChecked","value","required","readOnly","others","useDefaultProps","cx","useClasses","focusVisible","setFocusVisible","useState","icons","onChangeCallback","useCallback","event","target","onBlurCallback","onFocusVisibleCallback","root"],"mappings":";;;;;;;AA+FA,MAAMA,mBAAmBA,CACvBC,SAIAC,YACG;AACG,QAAA;AAAA,IAAEC;AAAAA,IAAUC;AAAAA,EAAaH,IAAAA;AACzBI,QAAAA,QACHF,YAAY,CAAC,SAAS,cAAc,KACpCC,YAAY,CAAC,cAAc,WAAW,KACvCE;AACIC,QAAAA,eACHJ,YAAY,CAAC,S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