@hitachivantara/uikit-react-core 5.7.4 → 5.8.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.map +1 -1
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs +1 -1
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs.map +1 -1
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.styles.cjs +5 -5
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.styles.cjs.map +1 -1
- package/dist/cjs/components/AppSwitcher/Action/Action.cjs.map +1 -1
- package/dist/cjs/components/Badge/Badge.cjs +2 -2
- package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
- package/dist/cjs/components/Banner/Banner.cjs +1 -1
- package/dist/cjs/components/Banner/Banner.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/ActionContainer/ActionContainer.cjs +1 -1
- package/dist/cjs/components/Banner/BannerContent/ActionContainer/ActionContainer.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/Banner/BannerContent/MessageContainer/MessageContainer.cjs +1 -1
- package/dist/cjs/components/Banner/BannerContent/MessageContainer/MessageContainer.cjs.map +1 -1
- package/dist/cjs/components/BaseDropdown/BaseDropdown.cjs +1 -1
- package/dist/cjs/components/BaseDropdown/BaseDropdown.cjs.map +1 -1
- package/dist/cjs/components/BaseInput/BaseInput.cjs +3 -3
- package/dist/cjs/components/BaseInput/BaseInput.cjs.map +1 -1
- package/dist/cjs/components/BaseInput/BaseInput.styles.cjs.map +1 -1
- package/dist/cjs/components/BaseSwitch/BaseSwitch.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs +18 -20
- package/dist/cjs/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
- package/dist/cjs/components/BreadCrumb/Page/Page.cjs.map +1 -1
- package/dist/cjs/components/BulkActions/BulkActions.cjs +2 -2
- package/dist/cjs/components/BulkActions/BulkActions.cjs.map +1 -1
- package/dist/cjs/components/BulkActions/BulkActions.styles.cjs +5 -5
- package/dist/cjs/components/BulkActions/BulkActions.styles.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs +2 -3
- package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs +0 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.cjs +1 -1
- package/dist/cjs/components/Calendar/CalendarNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.cjs +1 -1
- package/dist/cjs/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.cjs.map +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs +1 -1
- package/dist/cjs/components/Calendar/SingleCalendar/CalendarCell.cjs.map +1 -1
- package/dist/cjs/components/Card/Content/Content.cjs +2 -2
- package/dist/cjs/components/Card/Content/Content.cjs.map +1 -1
- package/dist/cjs/components/Card/Header/Header.cjs +1 -1
- package/dist/cjs/components/Card/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/Card/Media/Media.cjs +2 -2
- package/dist/cjs/components/Card/Media/Media.cjs.map +1 -1
- package/dist/cjs/components/Carousel/Carousel.cjs +230 -0
- package/dist/cjs/components/Carousel/Carousel.cjs.map +1 -0
- package/dist/cjs/components/Carousel/Carousel.styles.cjs +177 -0
- package/dist/cjs/components/Carousel/Carousel.styles.cjs.map +1 -0
- package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.cjs +43 -0
- package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.cjs.map +1 -0
- package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.styles.cjs +15 -0
- package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.styles.cjs.map +1 -0
- package/dist/cjs/components/Carousel/utils.cjs +36 -0
- package/dist/cjs/components/Carousel/utils.cjs.map +1 -0
- package/dist/cjs/components/CheckBoxGroup/CheckBoxGroup.cjs +9 -11
- package/dist/cjs/components/CheckBoxGroup/CheckBoxGroup.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/Picker/Picker.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/PresetColors/PresetColors.cjs +1 -1
- package/dist/cjs/components/ColorPicker/PresetColors/PresetColors.cjs.map +1 -1
- package/dist/cjs/components/ColorPicker/SavedColors/SavedColors.cjs +1 -1
- package/dist/cjs/components/ColorPicker/SavedColors/SavedColors.cjs.map +1 -1
- package/dist/cjs/components/Container/Container.cjs +1 -1
- package/dist/cjs/components/Container/Container.cjs.map +1 -1
- package/dist/cjs/components/Controls/Controls.cjs +3 -3
- package/dist/cjs/components/Controls/Controls.cjs.map +1 -1
- package/dist/cjs/components/Controls/LeftControl/LeftControl.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +6 -53
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Title/Title.cjs +1 -1
- package/dist/cjs/components/Dialog/Title/Title.cjs.map +1 -1
- package/dist/cjs/components/DotPagination/DotPagination.cjs +1 -1
- package/dist/cjs/components/DotPagination/DotPagination.cjs.map +1 -1
- package/dist/cjs/components/DotPagination/DotPagination.styles.cjs +5 -5
- package/dist/cjs/components/DotPagination/DotPagination.styles.cjs.map +1 -1
- package/dist/cjs/components/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/cjs/components/EmptyState/EmptyState.cjs +2 -2
- package/dist/cjs/components/EmptyState/EmptyState.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs +3 -3
- package/dist/cjs/components/FileUploader/DropZone/DropZone.cjs.map +1 -1
- package/dist/cjs/components/FileUploader/File/File.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/Preview/Preview.styles.cjs +4 -4
- package/dist/cjs/components/FileUploader/Preview/Preview.styles.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/Counter/Counter.cjs +1 -1
- package/dist/cjs/components/FilterGroup/Counter/Counter.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.cjs +3 -3
- package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/FilterGroup.cjs +1 -1
- package/dist/cjs/components/FilterGroup/FilterGroup.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/LeftPanel/LeftPanel.cjs +1 -1
- package/dist/cjs/components/FilterGroup/LeftPanel/LeftPanel.cjs.map +1 -1
- package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs +1 -1
- package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs.map +1 -1
- package/dist/cjs/components/Focus/Focus.cjs +2 -2
- package/dist/cjs/components/Focus/Focus.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/Header/Navigation/MenuItem/MenuItem.cjs +1 -1
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.styles.cjs +6 -4
- package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.styles.cjs.map +1 -1
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs +3 -3
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.cjs +1 -1
- package/dist/cjs/components/Input/Input.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.styles.cjs.map +1 -1
- package/dist/cjs/components/Kpi/Kpi.cjs.map +1 -1
- package/dist/cjs/components/Link/Link.cjs.map +1 -1
- package/dist/cjs/components/List/List.cjs.map +1 -1
- package/dist/cjs/components/ListContainer/ListContainer.cjs.map +1 -1
- package/dist/cjs/components/ListContainer/ListItem/ListItem.styles.cjs +2 -2
- package/dist/cjs/components/ListContainer/ListItem/ListItem.styles.cjs.map +1 -1
- package/dist/cjs/components/Loading/Loading.cjs.map +1 -1
- package/dist/cjs/components/MultiButton/MultiButton.styles.cjs +9 -6
- package/dist/cjs/components/MultiButton/MultiButton.styles.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.styles.cjs +9 -9
- package/dist/cjs/components/Pagination/Pagination.styles.cjs.map +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs +1 -0
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs +2 -2
- package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/Rule/Value/Value.cjs +6 -6
- package/dist/cjs/components/QueryBuilder/Rule/Value/Value.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs +1 -1
- package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs.map +1 -1
- package/dist/cjs/components/Radio/Radio.cjs.map +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup.cjs +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs +4 -4
- package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs +3 -3
- package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs.map +1 -1
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs +2 -2
- package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs.map +1 -1
- package/dist/cjs/components/Slider/SliderInput/SliderInput.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.cjs +5 -5
- package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarProvider/SnackbarProvider.cjs +2 -2
- package/dist/cjs/components/Snackbar/SnackbarProvider/SnackbarProvider.cjs.map +1 -1
- package/dist/cjs/components/Stack/Stack.cjs.map +1 -1
- package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
- package/dist/cjs/components/Table/Table.cjs +3 -3
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/Table/TableBody/TableBody.cjs +2 -2
- package/dist/cjs/components/Table/TableBody/TableBody.cjs.map +1 -1
- package/dist/cjs/components/Table/TableCell/TableCell.cjs +5 -5
- package/dist/cjs/components/Table/TableCell/TableCell.cjs.map +1 -1
- package/dist/cjs/components/Table/TableContainer/TableContainer.cjs +2 -2
- package/dist/cjs/components/Table/TableContainer/TableContainer.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHead/TableHead.cjs +3 -3
- package/dist/cjs/components/Table/TableHead/TableHead.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHeader/TableHeader.cjs +3 -3
- package/dist/cjs/components/Table/TableHeader/TableHeader.cjs.map +1 -1
- package/dist/cjs/components/Table/TableHeader/TableHeader.styles.cjs +5 -5
- package/dist/cjs/components/Table/TableHeader/TableHeader.styles.cjs.map +1 -1
- package/dist/cjs/components/Table/TableRow/TableRow.cjs +4 -4
- package/dist/cjs/components/Table/TableRow/TableRow.cjs.map +1 -1
- package/dist/cjs/components/Table/renderers/renderers.cjs +12 -6
- package/dist/cjs/components/Table/renderers/renderers.cjs.map +1 -1
- package/dist/cjs/components/Table/utils/utils.cjs +2 -1
- package/dist/cjs/components/Table/utils/utils.cjs.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Tag/Tag.cjs.map +1 -1
- package/dist/cjs/components/TextArea/TextArea.cjs +2 -2
- package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/cjs/components/TimeAgo/TimeAgo.cjs.map +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/Typography/Typography.cjs +2 -2
- 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/Actions.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs +5 -3
- package/dist/cjs/components/VerticalNavigation/Header/Header.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Header/Header.styles.cjs +3 -3
- package/dist/cjs/components/VerticalNavigation/Header/Header.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs +3 -2
- package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/navigationClasses.cjs +1 -1
- package/dist/cjs/components/VerticalNavigation/Navigation/navigationClasses.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopup.cjs +3 -1
- package/dist/cjs/components/VerticalNavigation/NavigationPopup/NavigationPopup.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +4 -4
- package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs +9 -13
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +4 -4
- package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.styles.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/descendants.cjs +4 -1
- package/dist/cjs/components/VerticalNavigation/TreeView/descendants.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs.map +1 -1
- package/dist/cjs/components/VerticalNavigation/VerticalNavigationContext.cjs.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs.map +1 -1
- package/dist/cjs/index.cjs +8 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/providers/Provider.cjs +2 -2
- package/dist/cjs/providers/Provider.cjs.map +1 -1
- package/dist/cjs/utils/iconVariant.cjs.map +1 -1
- package/dist/cjs/utils/theme.cjs +3 -4
- package/dist/cjs/utils/theme.cjs.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js +1 -1
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.styles.js +5 -5
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.styles.js.map +1 -1
- package/dist/esm/components/AppSwitcher/Action/Action.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +2 -2
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js +1 -1
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/ActionContainer/ActionContainer.js +1 -1
- package/dist/esm/components/Banner/BannerContent/ActionContainer/ActionContainer.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/Banner/BannerContent/MessageContainer/MessageContainer.js +1 -1
- package/dist/esm/components/Banner/BannerContent/MessageContainer/MessageContainer.js.map +1 -1
- package/dist/esm/components/BaseDropdown/BaseDropdown.js +1 -1
- package/dist/esm/components/BaseDropdown/BaseDropdown.js.map +1 -1
- package/dist/esm/components/BaseInput/BaseInput.js +3 -3
- package/dist/esm/components/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/components/BaseInput/BaseInput.styles.js.map +1 -1
- package/dist/esm/components/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/esm/components/BreadCrumb/BreadCrumb.js +18 -20
- package/dist/esm/components/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/esm/components/BreadCrumb/Page/Page.js.map +1 -1
- package/dist/esm/components/BulkActions/BulkActions.js +2 -2
- package/dist/esm/components/BulkActions/BulkActions.js.map +1 -1
- package/dist/esm/components/BulkActions/BulkActions.styles.js +5 -5
- package/dist/esm/components/BulkActions/BulkActions.styles.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js +2 -3
- package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +0 -1
- package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.js +1 -1
- package/dist/esm/components/Calendar/CalendarNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.js +1 -1
- package/dist/esm/components/Calendar/CalendarWeekLabels/CalendarWeekLabels.js.map +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js +1 -1
- package/dist/esm/components/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
- package/dist/esm/components/Card/Content/Content.js +2 -2
- package/dist/esm/components/Card/Content/Content.js.map +1 -1
- package/dist/esm/components/Card/Header/Header.js +1 -1
- package/dist/esm/components/Card/Header/Header.js.map +1 -1
- package/dist/esm/components/Card/Media/Media.js +2 -2
- package/dist/esm/components/Card/Media/Media.js.map +1 -1
- package/dist/esm/components/Carousel/Carousel.js +228 -0
- package/dist/esm/components/Carousel/Carousel.js.map +1 -0
- package/dist/esm/components/Carousel/Carousel.styles.js +177 -0
- package/dist/esm/components/Carousel/Carousel.styles.js.map +1 -0
- package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.js +43 -0
- package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.js.map +1 -0
- package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.styles.js +15 -0
- package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.styles.js.map +1 -0
- package/dist/esm/components/Carousel/utils.js +36 -0
- package/dist/esm/components/Carousel/utils.js.map +1 -0
- package/dist/esm/components/CheckBoxGroup/CheckBoxGroup.js +10 -12
- package/dist/esm/components/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/esm/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/components/ColorPicker/Picker/Picker.js.map +1 -1
- package/dist/esm/components/ColorPicker/PresetColors/PresetColors.js +1 -1
- package/dist/esm/components/ColorPicker/PresetColors/PresetColors.js.map +1 -1
- package/dist/esm/components/ColorPicker/SavedColors/SavedColors.js +1 -1
- package/dist/esm/components/ColorPicker/SavedColors/SavedColors.js.map +1 -1
- package/dist/esm/components/Container/Container.js +1 -1
- package/dist/esm/components/Container/Container.js.map +1 -1
- package/dist/esm/components/Controls/Controls.js +3 -3
- package/dist/esm/components/Controls/Controls.js.map +1 -1
- package/dist/esm/components/Controls/LeftControl/LeftControl.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +7 -53
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/Title/Title.js +1 -1
- package/dist/esm/components/Dialog/Title/Title.js.map +1 -1
- package/dist/esm/components/DotPagination/DotPagination.js +1 -1
- package/dist/esm/components/DotPagination/DotPagination.js.map +1 -1
- package/dist/esm/components/DotPagination/DotPagination.styles.js +5 -5
- package/dist/esm/components/DotPagination/DotPagination.styles.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.js +2 -2
- package/dist/esm/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/esm/components/FileUploader/DropZone/DropZone.js +3 -3
- package/dist/esm/components/FileUploader/DropZone/DropZone.js.map +1 -1
- package/dist/esm/components/FileUploader/File/File.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/Preview/Preview.styles.js +4 -4
- package/dist/esm/components/FileUploader/Preview/Preview.styles.js.map +1 -1
- package/dist/esm/components/FilterGroup/Counter/Counter.js +1 -1
- package/dist/esm/components/FilterGroup/Counter/Counter.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterContent/FilterContent.js +3 -3
- package/dist/esm/components/FilterGroup/FilterContent/FilterContent.js.map +1 -1
- package/dist/esm/components/FilterGroup/FilterGroup.js +1 -1
- package/dist/esm/components/FilterGroup/FilterGroup.js.map +1 -1
- package/dist/esm/components/FilterGroup/LeftPanel/LeftPanel.js +1 -1
- package/dist/esm/components/FilterGroup/LeftPanel/LeftPanel.js.map +1 -1
- package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js +1 -1
- package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js.map +1 -1
- package/dist/esm/components/Focus/Focus.js +2 -2
- package/dist/esm/components/Focus/Focus.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/Header/Navigation/MenuItem/MenuItem.js +1 -1
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.styles.js +6 -4
- package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.styles.js.map +1 -1
- package/dist/esm/components/InlineEditor/InlineEditor.js +3 -3
- package/dist/esm/components/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/components/Input/Input.js +1 -1
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/Input.styles.js.map +1 -1
- package/dist/esm/components/Kpi/Kpi.js.map +1 -1
- package/dist/esm/components/Link/Link.js.map +1 -1
- package/dist/esm/components/List/List.js.map +1 -1
- package/dist/esm/components/ListContainer/ListContainer.js.map +1 -1
- package/dist/esm/components/ListContainer/ListItem/ListItem.styles.js +2 -2
- package/dist/esm/components/ListContainer/ListItem/ListItem.styles.js.map +1 -1
- package/dist/esm/components/Loading/Loading.js.map +1 -1
- package/dist/esm/components/MultiButton/MultiButton.styles.js +9 -6
- package/dist/esm/components/MultiButton/MultiButton.styles.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.styles.js +9 -9
- package/dist/esm/components/Pagination/Pagination.styles.js.map +1 -1
- package/dist/esm/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/QueryBuilder/QueryBuilder.js +1 -0
- package/dist/esm/components/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.js +2 -2
- package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/NumericValue.js.map +1 -1
- package/dist/esm/components/QueryBuilder/Rule/Value/Value.js +6 -6
- package/dist/esm/components/QueryBuilder/Rule/Value/Value.js.map +1 -1
- package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js +1 -1
- package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -1
- package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js +4 -4
- package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js +3 -3
- package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js.map +1 -1
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js +2 -2
- package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -1
- package/dist/esm/components/Slider/SliderInput/SliderInput.js.map +1 -1
- package/dist/esm/components/Snackbar/Snackbar.js +5 -5
- package/dist/esm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarProvider/SnackbarProvider.js +2 -2
- package/dist/esm/components/Snackbar/SnackbarProvider/SnackbarProvider.js.map +1 -1
- package/dist/esm/components/Stack/Stack.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Table/Table.js +3 -3
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/TableBody/TableBody.js +2 -2
- package/dist/esm/components/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/components/Table/TableCell/TableCell.js +5 -5
- package/dist/esm/components/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/Table/TableContainer/TableContainer.js +2 -2
- package/dist/esm/components/Table/TableContainer/TableContainer.js.map +1 -1
- package/dist/esm/components/Table/TableHead/TableHead.js +3 -3
- package/dist/esm/components/Table/TableHead/TableHead.js.map +1 -1
- package/dist/esm/components/Table/TableHeader/TableHeader.js +3 -3
- package/dist/esm/components/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/esm/components/Table/TableHeader/TableHeader.styles.js +5 -5
- package/dist/esm/components/Table/TableHeader/TableHeader.styles.js.map +1 -1
- package/dist/esm/components/Table/TableRow/TableRow.js +4 -4
- package/dist/esm/components/Table/TableRow/TableRow.js.map +1 -1
- package/dist/esm/components/Table/renderers/renderers.js +12 -6
- package/dist/esm/components/Table/renderers/renderers.js.map +1 -1
- package/dist/esm/components/Table/utils/utils.js +2 -1
- package/dist/esm/components/Table/utils/utils.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +1 -1
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js.map +1 -1
- package/dist/esm/components/TimeAgo/TimeAgo.js.map +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/Typography/Typography.js +2 -2
- 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/Actions.js +1 -1
- package/dist/esm/components/VerticalNavigation/Actions/Actions.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Header/Header.js +6 -4
- package/dist/esm/components/VerticalNavigation/Header/Header.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Header/Header.styles.js +3 -3
- package/dist/esm/components/VerticalNavigation/Header/Header.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js +3 -2
- package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/navigationClasses.js +1 -1
- package/dist/esm/components/VerticalNavigation/Navigation/navigationClasses.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopup.js +3 -1
- package/dist/esm/components/VerticalNavigation/NavigationPopup/NavigationPopup.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js +4 -4
- package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js +9 -13
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.styles.js +4 -4
- package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/TreeView/descendants.js +4 -1
- package/dist/esm/components/VerticalNavigation/TreeView/descendants.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/components/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/providers/Provider.js +2 -2
- package/dist/esm/providers/Provider.js.map +1 -1
- package/dist/esm/utils/iconVariant.js.map +1 -1
- package/dist/esm/utils/theme.js +3 -4
- package/dist/esm/utils/theme.js.map +1 -1
- package/dist/types/index.d.ts +293 -43
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { CSSProperties, useState } from \"react\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\nimport { HvBaseProps } from \"@core/types\";\nimport { StyledChip, StyledButton, StyledCloseXS } from \"./Tag.styles\";\nimport { getOnDeleteCallback, hasDeleteAction, hasClickAction } from \"./utils\";\nimport {\n HvSemanticColorKeys,\n HvCategoricalColorKeys,\n} from \"@core/types/tokens\";\nimport { HvButtonProps } from \"../Button\";\nimport tagClasses, { HvTagClasses } from \"./tagClasses\";\nimport { useTheme } from \"@core/hooks\";\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\">,\n HvBaseProps<HTMLDivElement, \"children\"> {\n /** Inline styles to be applied to the root element. */\n style?: CSSProperties;\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvSemanticColorKeys | HvCategoricalColorKeys | string;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** The role of the element with an attributed event. */\n role?: string;\n /** Aria properties to apply to delete button in tag */\n deleteButtonArialLabel?: string;\n /** Props to apply to delete button */\n deleteButtonProps?: HvButtonProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n}\n\nconst getColor = (customColor, type, colors) => {\n const defaultSemanticColor = theme.colors.neutral_20;\n const defaultCategoricalColor = colors.cat1;\n\n let backgroundColor;\n\n if (type === \"semantic\") {\n backgroundColor =\n theme.colors[customColor] || customColor || defaultSemanticColor;\n }\n if (type === \"categorical\") {\n backgroundColor =\n colors[customColor] || customColor || defaultCategoricalColor;\n }\n return backgroundColor;\n};\n\n/**\n * A Tag is one word that describes a specific aspect of an asset. A single asset can have\n * multiple tags.\n * Use tags to highlight an item's status for quick recognition and navigation\n * Use color to indicate meanings that users can learn and recognize across products\n *\n * It leverages the Chip component from Material UI\n */\nexport const HvTag = ({\n classes,\n className,\n style,\n label,\n disabled,\n type = \"semantic\",\n color,\n deleteIcon,\n onDelete,\n onClick,\n role,\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n}: HvTagProps) => {\n const { activeTheme, selectedMode } = useTheme();\n\n const getDeleteIcon = () => {\n const disabledSemanticColor =\n type === \"semantic\" ? \"secondary_60\" : \"base_dark\";\n const { tabIndex = 0 } = deleteButtonProps;\n\n return (\n <StyledButton\n classes={{\n startIcon: clsx(tagClasses.tagButton, classes?.tagButton),\n focusVisible: clsx(tagClasses.focusVisible, classes?.focusVisible),\n root: clsx(tagClasses.button, classes?.button),\n }}\n aria-label={deleteButtonArialLabel}\n tabIndex={tabIndex}\n variant=\"secondaryGhost\"\n {...deleteButtonProps}\n >\n <StyledCloseXS\n iconSize=\"XS\"\n style={{\n ...(disabled ? { cursor: \"not-allowed\" } : undefined),\n height: 16,\n }}\n color={disabled ? disabledSemanticColor : \"base_dark\"}\n $color={disabled ? disabledSemanticColor : \"base_dark\"}\n />\n </StyledButton>\n );\n };\n\n const inlineStyle = {\n ...style,\n };\n\n let categoricalBackgroundColor;\n\n if (type === \"semantic\") {\n inlineStyle.backgroundColor = getColor(color, type, {});\n } else if (type === \"categorical\") {\n categoricalBackgroundColor = getColor(\n color,\n type,\n activeTheme?.colors?.modes[selectedMode]\n );\n\n inlineStyle.backgroundColor = `${categoricalBackgroundColor}30`;\n }\n\n const [hover, setHover] = useState(false);\n\n return (\n <StyledChip\n label={label}\n className={clsx(classes?.root, className, tagClasses.root)}\n onMouseEnter={() => {\n setHover(!!onClick);\n }}\n onMouseLeave={() => {\n setHover(false);\n }}\n style={{\n ...(disabled ? null : inlineStyle),\n ...(hover && !disabled\n ? { boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}` }\n : null),\n }}\n classes={{\n root: clsx(\n tagClasses.chipRoot,\n classes?.chipRoot,\n type === \"categorical\" &&\n clsx(tagClasses.categorical, classes?.categorical),\n disabled && clsx(tagClasses.disabled, classes?.disabled),\n !!onClick && clsx(tagClasses.clickable, classes?.clickable),\n type === \"categorical\" &&\n !disabled &&\n clsx(tagClasses.categoricalFocus, classes?.categoricalFocus),\n type === \"categorical\" &&\n disabled &&\n clsx(tagClasses.categoricalDisabled, classes?.categoricalDisabled)\n ),\n label: clsx(tagClasses.label, classes?.label),\n deleteIcon: clsx(\n classes?.deleteIcon,\n tagClasses.deleteIcon,\n disabled &&\n clsx(tagClasses.disabledDeleteIcon, classes?.disabledDeleteIcon)\n ),\n }}\n deleteIcon={(hasDeleteAction(onDelete) && deleteIcon) || getDeleteIcon()}\n onDelete={getOnDeleteCallback(disabled, onDelete)}\n onClick={disabled ? undefined : onClick}\n role={role || (hasClickAction(onClick) ? \"button\" : undefined)}\n tabIndex={hasDeleteAction(onDelete) ? undefined : 0}\n $type={type}\n $disabled={disabled || false}\n $categoricalFocus={type === \"categorical\" && !disabled}\n $categoricalDisabled={(type === \"categorical\" && disabled) || false}\n $baseLightColor={\n activeTheme?.colors?.modes[selectedMode].base_light ||\n theme.colors.base_light\n }\n {...others}\n />\n );\n};\n"],"names":["getColor","customColor","type","colors","defaultSemanticColor","theme","neutral_20","defaultCategoricalColor","cat1","backgroundColor","HvTag","classes","className","style","label","disabled","color","deleteIcon","onDelete","onClick","role","deleteButtonArialLabel","deleteButtonProps","others","activeTheme","selectedMode","useTheme","getDeleteIcon","disabledSemanticColor","tabIndex","StyledButton","startIcon","clsx","tagClasses","tagButton","focusVisible","root","button","variant","children","StyledCloseXS","iconSize","cursor","undefined","height","$color","inlineStyle","categoricalBackgroundColor","modes","hover","setHover","useState","StyledChip","onMouseEnter","onMouseLeave","boxShadow","chipRoot","categorical","clickable","categoricalFocus","categoricalDisabled","disabledDeleteIcon","hasDeleteAction","getOnDeleteCallback","hasClickAction","$type","$disabled","$categoricalFocus","$categoricalDisabled","$baseLightColor","base_light"],"mappings":";;;;;;;;AA+CA,MAAMA,WAAWA,CAACC,aAAaC,MAAMC,WAAW;AACxCC,QAAAA,uBAAuBC,MAAMF,OAAOG;AAC1C,QAAMC,0BAA0BJ,OAAOK;AAEnCC,MAAAA;AAEJ,MAAIP,SAAS,YAAY;AACvBO,sBACEJ,MAAMF,OAAOF,WAAW,KAAKA,eAAeG;AAAAA,EAChD;AACA,MAAIF,SAAS,eAAe;AAExBC,sBAAAA,OAAOF,WAAW,KAAKA,eAAeM;AAAAA,EAC1C;AACOE,SAAAA;AACT;AAUO,MAAMC,QAAQA,CAAC;AAAA,EACpBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAb,OAAO;AAAA,EACPc;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,yBAAyB;AAAA,EACzBC,oBAAoB,CAAC;AAAA,EACrB,GAAGC;AACO,MAAM;;AACV,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,MAAiBC,SAAU;AAEhD,QAAMC,gBAAgBA,MAAM;AACpBC,UAAAA,wBACJ1B,SAAS,aAAa,iBAAiB;AACnC,UAAA;AAAA,MAAE2B,WAAW;AAAA,IAAMP,IAAAA;AAEzB,+BACGQ,cAAY;AAAA,MACXnB,SAAS;AAAA,QACPoB,WAAWC,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file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { CSSProperties, useState } from \"react\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\nimport { HvBaseProps } from \"@core/types\";\nimport {\n HvSemanticColorKeys,\n HvCategoricalColorKeys,\n} from \"@core/types/tokens\";\nimport { useTheme } from \"@core/hooks\";\nimport { StyledChip, StyledButton, StyledCloseXS } from \"./Tag.styles\";\nimport { getOnDeleteCallback, hasDeleteAction, hasClickAction } from \"./utils\";\nimport { HvButtonProps } from \"../Button\";\nimport tagClasses, { HvTagClasses } from \"./tagClasses\";\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\">,\n HvBaseProps<HTMLDivElement, \"children\"> {\n /** Inline styles to be applied to the root element. */\n style?: CSSProperties;\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvSemanticColorKeys | HvCategoricalColorKeys | string;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** The role of the element with an attributed event. */\n role?: string;\n /** Aria properties to apply to delete button in tag */\n deleteButtonArialLabel?: string;\n /** Props to apply to delete button */\n deleteButtonProps?: HvButtonProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n}\n\nconst getColor = (customColor, type, colors) => {\n const defaultSemanticColor = theme.colors.neutral_20;\n const defaultCategoricalColor = colors.cat1;\n\n let backgroundColor;\n\n if (type === \"semantic\") {\n backgroundColor =\n theme.colors[customColor] || customColor || defaultSemanticColor;\n }\n if (type === \"categorical\") {\n backgroundColor =\n colors[customColor] || customColor || defaultCategoricalColor;\n }\n return backgroundColor;\n};\n\n/**\n * A Tag is one word that describes a specific aspect of an asset. A single asset can have\n * multiple tags.\n * Use tags to highlight an item's status for quick recognition and navigation\n * Use color to indicate meanings that users can learn and recognize across products\n *\n * It leverages the Chip component from Material UI\n */\nexport const HvTag = ({\n classes,\n className,\n style,\n label,\n disabled,\n type = \"semantic\",\n color,\n deleteIcon,\n onDelete,\n onClick,\n role,\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n}: HvTagProps) => {\n const { activeTheme, selectedMode } = useTheme();\n\n const getDeleteIcon = () => {\n const disabledSemanticColor =\n type === \"semantic\" ? \"secondary_60\" : \"base_dark\";\n const { tabIndex = 0 } = deleteButtonProps;\n\n return (\n <StyledButton\n classes={{\n startIcon: clsx(tagClasses.tagButton, classes?.tagButton),\n focusVisible: clsx(tagClasses.focusVisible, classes?.focusVisible),\n root: clsx(tagClasses.button, classes?.button),\n }}\n aria-label={deleteButtonArialLabel}\n tabIndex={tabIndex}\n variant=\"secondaryGhost\"\n {...deleteButtonProps}\n >\n <StyledCloseXS\n iconSize=\"XS\"\n style={{\n ...(disabled ? { cursor: \"not-allowed\" } : undefined),\n height: 16,\n }}\n color={disabled ? disabledSemanticColor : \"base_dark\"}\n $color={disabled ? disabledSemanticColor : \"base_dark\"}\n />\n </StyledButton>\n );\n };\n\n const inlineStyle = {\n ...style,\n };\n\n let categoricalBackgroundColor;\n\n if (type === \"semantic\") {\n inlineStyle.backgroundColor = getColor(color, type, {});\n } else if (type === \"categorical\") {\n categoricalBackgroundColor = getColor(\n color,\n type,\n activeTheme?.colors?.modes[selectedMode]\n );\n\n inlineStyle.backgroundColor = `${categoricalBackgroundColor}30`;\n }\n\n const [hover, setHover] = useState(false);\n\n return (\n <StyledChip\n label={label}\n className={clsx(classes?.root, className, tagClasses.root)}\n onMouseEnter={() => {\n setHover(!!onClick);\n }}\n onMouseLeave={() => {\n setHover(false);\n }}\n style={{\n ...(disabled ? null : inlineStyle),\n ...(hover && !disabled\n ? { boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}` }\n : null),\n }}\n classes={{\n root: clsx(\n tagClasses.chipRoot,\n classes?.chipRoot,\n type === \"categorical\" &&\n clsx(tagClasses.categorical, classes?.categorical),\n disabled && clsx(tagClasses.disabled, classes?.disabled),\n !!onClick && clsx(tagClasses.clickable, classes?.clickable),\n type === \"categorical\" &&\n !disabled &&\n clsx(tagClasses.categoricalFocus, classes?.categoricalFocus),\n type === \"categorical\" &&\n disabled &&\n clsx(tagClasses.categoricalDisabled, classes?.categoricalDisabled)\n ),\n label: clsx(tagClasses.label, classes?.label),\n deleteIcon: clsx(\n classes?.deleteIcon,\n tagClasses.deleteIcon,\n disabled &&\n clsx(tagClasses.disabledDeleteIcon, classes?.disabledDeleteIcon)\n ),\n }}\n deleteIcon={(hasDeleteAction(onDelete) && deleteIcon) || getDeleteIcon()}\n onDelete={getOnDeleteCallback(disabled, onDelete)}\n onClick={disabled ? undefined : onClick}\n role={role || (hasClickAction(onClick) ? \"button\" : undefined)}\n tabIndex={hasDeleteAction(onDelete) ? undefined : 0}\n $type={type}\n $disabled={disabled || false}\n $categoricalFocus={type === \"categorical\" && !disabled}\n $categoricalDisabled={(type === \"categorical\" && disabled) || false}\n $baseLightColor={\n activeTheme?.colors?.modes[selectedMode].base_light ||\n theme.colors.base_light\n }\n {...others}\n />\n );\n};\n"],"names":["getColor","customColor","type","colors","defaultSemanticColor","theme","neutral_20","defaultCategoricalColor","cat1","backgroundColor","HvTag","classes","className","style","label","disabled","color","deleteIcon","onDelete","onClick","role","deleteButtonArialLabel","deleteButtonProps","others","activeTheme","selectedMode","useTheme","getDeleteIcon","disabledSemanticColor","tabIndex","StyledButton","startIcon","clsx","tagClasses","tagButton","focusVisible","root","button","variant","children","StyledCloseXS","iconSize","cursor","undefined","height","$color","inlineStyle","categoricalBackgroundColor","modes","hover","setHover","useState","StyledChip","onMouseEnter","onMouseLeave","boxShadow","chipRoot","categorical","clickable","categoricalFocus","categoricalDisabled","disabledDeleteIcon","hasDeleteAction","getOnDeleteCallback","hasClickAction","$type","$disabled","$categoricalFocus","$categoricalDisabled","$baseLightColor","base_light"],"mappings":";;;;;;;;AA+CA,MAAMA,WAAWA,CAACC,aAAaC,MAAMC,WAAW;AACxCC,QAAAA,uBAAuBC,MAAMF,OAAOG;AAC1C,QAAMC,0BAA0BJ,OAAOK;AAEnCC,MAAAA;AAEJ,MAAIP,SAAS,YAAY;AACvBO,sBACEJ,MAAMF,OAAOF,WAAW,KAAKA,eAAeG;AAAAA,EAChD;AACA,MAAIF,SAAS,eAAe;AAExBC,sBAAAA,OAAOF,WAAW,KAAKA,eAAeM;AAAAA,EAC1C;AACOE,SAAAA;AACT;AAUO,MAAMC,QAAQA,CAAC;AAAA,EACpBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAb,OAAO;AAAA,EACPc;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,yBAAyB;AAAA,EACzBC,oBAAoB,CAAC;AAAA,EACrB,GAAGC;AACO,MAAM;;AACV,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,MAAiBC,SAAU;AAEhD,QAAMC,gBAAgBA,MAAM;AACpBC,UAAAA,wBACJ1B,SAAS,aAAa,iBAAiB;AACnC,UAAA;AAAA,MAAE2B,WAAW;AAAA,IAAMP,IAAAA;AAEzB,+BACGQ,cAAY;AAAA,MACXnB,SAAS;AAAA,QACPoB,WAAWC,KAAKC,WAAWC,WAAWvB,mCAASuB,SAAS;AAAA,QACxDC,cAAcH,KAAKC,WAAWE,cAAcxB,mCAASwB,YAAY;AAAA,QACjEC,MAAMJ,KAAKC,WAAWI,QAAQ1B,mCAAS0B,MAAM;AAAA,MAC/C;AAAA,MACA,cAAY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AAS8C,WAAW,GACnD1C,YAAYiB,KAAKC,WAAWlB,UAAUJ,mCAASI,QAAQ,GACvD,CAAC,CAACI,WAAWa,KAAKC,WAAWyB,WAAW/C,mCAAS+C,SAAS,GAC1DxD,SAAS,iBACP,CAACa,YACDiB,KAAKC,WAAW0B,kBAAkBhD,mCAASgD,gBAAgB,GAC7DzD,SAAS,iBACPa,YACAiB,KAAKC,WAAW2B,qBAAqBjD,mCAASiD,mBAAmB,CAAC;AAAA,MAEtE9C,OAAOkB,KAAKC,WAAWnB,OAAOH,mCAASG,KAAK;AAAA,MAC5CG,YAAYe,KACVrB,mCAASM,YACTgB,WAAWhB,YACXF,YACEiB,KAAKC,WAAW4B,oBAAoBlD,mCAASkD,kBAAkB,CAAC;AAAA,IAEtE;AAAA,IACA5C,YAAa6C,gBAAgB5C,QAAQ,KAAKD,cAAeU,cAAgB;AAAA,IACzET,UAAU6C,oBAAoBhD,UAAUG,QAAQ;AAAA,IAChDC,SAASJ,WAAW4B,SAAYxB;AAAAA,IAChCC,MAAMA,SAAS4C,eAAe7C,OAAO,IAAI,WAAWwB;AAAAA,IACpDd,UAAUiC,gBAAgB5C,QAAQ,IAAIyB,SAAY;AAAA,IAClDsB,OAAO/D;AAAAA,IACPgE,WAAWnD,YAAY;AAAA,IACvBoD,mBAAmBjE,SAAS,iBAAiB,CAACa;AAAAA,IAC9CqD,sBAAuBlE,SAAS,iBAAiBa,YAAa;AAAA,IAC9DsD,mBACE7C,gDAAarB,WAAbqB,mBAAqBwB,MAAMvB,cAAc6C,eACzCjE,MAAMF,OAAOmE;AAAAA,IACd,GACG/C;AAAAA,EAAAA,CACJ;AAEN;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { StyledFormElement, StyledLabelContainer, StyledLabel, StyledInfoMessage, StyledCharCounter, StyledBaseInput, StyledWarningText } from "./TextArea.styles.js";
|
|
2
1
|
import validationState, { isInvalid } from "../Forms/FormElement/validationStates.js";
|
|
3
2
|
import { clsx } from "clsx";
|
|
4
3
|
import { useRef, useState, useMemo, useCallback, useEffect } from "react";
|
|
5
|
-
import { DEFAULT_ERROR_MESSAGES, validateInput, validationTypes, computeValidationState, computeValidationMessage, hasBuiltInValidations } from "../BaseInput/validations.js";
|
|
6
4
|
import isNil from "lodash/isNil";
|
|
5
|
+
import { DEFAULT_ERROR_MESSAGES, validateInput, validationTypes, computeValidationState, computeValidationMessage, hasBuiltInValidations } from "../BaseInput/validations.js";
|
|
6
|
+
import { StyledFormElement, StyledLabelContainer, StyledLabel, StyledInfoMessage, StyledCharCounter, StyledBaseInput, StyledWarningText } from "./TextArea.styles.js";
|
|
7
7
|
import textAreaClasses from "./textAreaClasses.js";
|
|
8
8
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
9
9
|
import useUniqueId from "../../hooks/useUniqueId.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import { HvCharCounterProps, HvFormStatus } from \"../Forms\";\nimport { HvBaseInputProps } from \"../BaseInput\";\nimport {\n StyledBaseInput,\n StyledCharCounter,\n StyledFormElement,\n StyledInfoMessage,\n StyledLabel,\n StyledLabelContainer,\n StyledWarningText,\n} from \"./TextArea.styles\";\nimport { useControlled, useUniqueId } from \"@core/hooks\";\nimport validationStates, {\n isInvalid,\n} from \"@core/components/Forms/FormElement/validationStates\";\nimport { clsx } from \"clsx\";\nimport { useCallback, useRef, useState, useMemo, useEffect } from \"react\";\nimport {\n computeValidationMessage,\n computeValidationState,\n DEFAULT_ERROR_MESSAGES,\n hasBuiltInValidations,\n HvInputValidity,\n validateInput,\n validationTypes,\n} from \"../BaseInput/validations\";\nimport { setId } from \"@core/utils\";\nimport isNil from \"lodash/isNil\";\nimport { HvValidationMessages } from \"@core/types\";\nimport textAreaClasses, { HvTextAreaClasses } from \"./textAreaClasses\";\n\nexport interface HvTextAreaProps\n extends Omit<\n HvBaseInputProps,\n \"onChange\" | \"onBlur\" | \"rows\" | \"classes\" | \"onFocus\"\n > {\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label?: React.ReactNode;\n /**\n * Provide additional descriptive text for the form element.\n */\n description?: React.ReactNode;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to the state.\n */\n status?: HvFormStatus;\n /**\n * The error message to show when `status` is \"invalid\".\n */\n statusMessage?: React.ReactNode;\n /**\n * Text between the current char counter and max value.\n */\n middleCountLabel?: string;\n /**\n * An Object containing the various texts associated with the input.\n */\n validationMessages?: HvValidationMessages;\n /**\n * The custom validation function, it receives the value and must return\n * either `true` for valid or `false` for invalid, default validations would only\n * occur if this function is null or undefined\n */\n validation?: (value: string) => boolean;\n /**\n * The maximum allowed length of the characters, if this value is null no check\n * will be performed.\n */\n maxCharQuantity?: number;\n /**\n * The minimum allowed length of the characters, if this value is null no check\n * will be perform.\n */\n minCharQuantity?: number;\n /**\n * If `true` it should autofocus.\n */\n autoFocus?: boolean;\n /**\n * The number of rows of the text area\n */\n rows?: number;\n /**\n * If `true` the component is resizable.\n */\n resizable?: boolean;\n /**\n * Auto-scroll: automatically scroll to the end on value changes.\n * Will stop if the user scrolls up and resume if scrolled to the bottom.\n */\n autoScroll?: boolean;\n /**\n * If true it isn't possible to pass the `maxCharQuantity`\n */\n blockMax?: boolean;\n /**\n * If `true` the character counter isn't shown even if maxCharQuantity is set.\n */\n hideCounter?: boolean;\n /**\n * Props passed to the char count.\n */\n countCharProps?: Partial<HvCharCounterProps>;\n /**\n * Called back when the value is changed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n value: string\n ) => void;\n /**\n * Called back when the value is changed.\n */\n onBlur?: (\n event: React.FocusEvent<HTMLTextAreaElement>,\n value: string,\n validationState: HvInputValidity\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the value state,\n * it receives the value.\n */\n onFocus?: (\n event: React.FocusEvent<HTMLTextAreaElement>,\n value: string\n ) => void;\n /**\n * A Jss Object used to override or extend the component styles applied.\n */\n classes?: HvTextAreaClasses;\n}\n\n/**\n * A text area is a multiline text input box, with an optional character counter when there is a length limit.\n */\nexport const HvTextArea = ({\n id,\n className,\n classes,\n name,\n label,\n description,\n placeholder,\n status,\n statusMessage,\n validationMessages,\n maxCharQuantity,\n minCharQuantity,\n value: valueProp,\n inputRef: inputRefProp,\n rows = 1,\n defaultValue = \"\",\n middleCountLabel = \"/\",\n countCharProps = {},\n inputProps = {},\n required = false,\n readOnly = false,\n disabled = false,\n autoFocus = false,\n resizable = false,\n autoScroll = false,\n hideCounter = false,\n blockMax = false,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-errormessage\": ariaErrorMessage,\n validation,\n onChange,\n onBlur,\n onFocus,\n ...others\n}: HvTextAreaProps) => {\n const elementId = useUniqueId(id, \"hvtextarea\");\n\n // Signals that the user has manually edited the input value\n const isDirty = useRef<boolean>(false);\n\n const inputRefOwn = useRef(null);\n\n const inputRef = inputRefProp || inputRefOwn;\n\n const [focused, setFocused] = useState<boolean>(false);\n\n const [autoScrolling, setAutoScrolling] = useState(autoScroll);\n\n const [validationState, setValidationState] = useControlled(\n status,\n validationStates.standBy\n );\n\n const [validationMessage, setValidationMessage] = useControlled(\n statusMessage,\n \"\"\n );\n\n const [value, setValue] = useControlled(valueProp, defaultValue);\n\n const isStateInvalid = isInvalid(validationState);\n\n const isEmptyValue = value == null || value === \"\";\n\n const hasLabel = label != null;\n\n const hasDescription = description != null;\n\n const hasCounter = maxCharQuantity != null && !hideCounter;\n\n // ValidationMessages reference tends to change, as users will not memorize/useState for it;\n // Dependencies must be more explicit so we set\n const errorMessages = useMemo(\n () => ({ ...DEFAULT_ERROR_MESSAGES, ...validationMessages }),\n [\n validationMessages?.error,\n validationMessages?.requiredError,\n validationMessages?.minCharError,\n validationMessages?.maxCharError,\n ]\n );\n\n // Validates the input, sets the status and the statusMessage accordingly (if uncontrolled)\n // and returns the validity state of the input.\n const performValidation = useCallback(() => {\n const inputValidity = validateInput(\n inputRef.current,\n value,\n required,\n minCharQuantity,\n maxCharQuantity,\n validationTypes.none,\n validation\n );\n\n // This will only run if status is uncontrolled\n setValidationState(computeValidationState(inputValidity, isEmptyValue));\n\n // This will only run if statusMessage is uncontrolled\n setValidationMessage(\n computeValidationMessage(inputValidity, errorMessages)\n );\n\n return inputValidity;\n }, [\n errorMessages,\n inputRef,\n isEmptyValue,\n maxCharQuantity,\n minCharQuantity,\n required,\n setValidationMessage,\n setValidationState,\n validation,\n value,\n ]);\n\n const isOverflow = (currentValue) =>\n isNil(maxCharQuantity) ? false : currentValue.length > maxCharQuantity;\n\n /**\n * Limit the string to the maxCharQuantity length.\n *\n * @param value - string to evaluate\n * @returns {string|*} - string according the limit\n */\n const limitValue = (currentValue) => {\n if (currentValue === undefined || !blockMax) return currentValue;\n return !isOverflow(currentValue)\n ? currentValue\n : currentValue.substring(0, maxCharQuantity);\n };\n\n /**\n * Validates the text area updating the state and modifying the warning text, also executes\n * the user provided onBlur passing the current validation status and value.\n *\n * @returns {undefined}\n */\n const onContainerBlurHandler = (event) => {\n setFocused(false);\n\n const inputValidity = performValidation();\n\n onBlur?.(event, value, inputValidity);\n };\n\n /**\n * Updates the length of the string while is being inputted, also executes the user onChange\n * allowing the customization of the input if required.\n *\n * @param {String} value - The value provided by the HvInput\n */\n const onChangeHandler = (event, currentValue) => {\n isDirty.current = true;\n\n const limitedValue = blockMax ? limitValue(currentValue) : currentValue;\n\n // Set the input value (only when value is uncontrolled)\n setValue(limitedValue);\n\n onChange?.(event, limitedValue);\n };\n\n /**\n * Updates the state putting again the value from the state because the input value is\n * not automatically manage, it also executes the onFocus function from the user passing the value\n */\n const onFocusHandler = (event) => {\n setFocused(true);\n\n // Reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n onFocus?.(event, value);\n };\n\n const isScrolledDown = useCallback(() => {\n const el = inputRef.current;\n return el == null || el.offsetHeight + el.scrollTop >= el.scrollHeight;\n }, [inputRef]);\n\n const scrollDown = useCallback(() => {\n const el = inputRef.current;\n if (el != null) {\n el.scrollTop = el.scrollHeight - el.clientHeight;\n }\n }, [inputRef]);\n\n const addScrollListener = useCallback(() => {\n const scrollHandler = {\n handleEvent: () => {\n setAutoScrolling(isScrolledDown());\n },\n };\n inputRef.current?.addEventListener(\"scroll\", scrollHandler);\n }, [inputRef, isScrolledDown]);\n\n useEffect(() => {\n if (autoScroll) {\n addScrollListener();\n }\n }, [autoScroll, addScrollListener]);\n\n useEffect(() => {\n if (autoScrolling) {\n scrollDown();\n }\n }, [valueProp, autoScrolling, scrollDown]);\n\n // Run initial validation after first render\n // and also when any validation condition changes\n useEffect(() => {\n if (focused || (!isDirty.current && isEmptyValue)) {\n // Skip validation if currently focused or if empty and\n // the user never manually edited the input value\n return;\n }\n\n performValidation();\n }, [focused, isEmptyValue, performValidation]);\n\n // The error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and any of the built-in validations are active\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined &&\n hasBuiltInValidations(\n required,\n validationTypes.none,\n minCharQuantity,\n // If blockMax is true maxCharQuantity will never produce an error\n // unless the value is controlled, so we can't prevent it to overflow maxCharQuantity\n maxCharQuantity != null && (blockMax !== true || value != null)\n ? maxCharQuantity\n : null,\n validation,\n inputProps\n )));\n\n let errorMessageId;\n if (isStateInvalid) {\n errorMessageId = canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage;\n }\n\n return (\n <StyledFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={clsx(\n textAreaClasses.root,\n classes?.root,\n className,\n resizable && clsx(textAreaClasses.resizable, classes?.resizable),\n disabled && clsx(textAreaClasses.disabled, classes?.disabled),\n isStateInvalid && clsx(textAreaClasses.invalid, classes?.invalid)\n )}\n $resizable={resizable}\n onBlur={onContainerBlurHandler}\n >\n {(hasLabel || hasDescription) && (\n <StyledLabelContainer\n className={clsx(\n textAreaClasses.labelContainer,\n classes?.labelContainer\n )}\n >\n {hasLabel && (\n <StyledLabel\n className={clsx(textAreaClasses.label, classes?.label)}\n id={setId(id, \"label\")}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n />\n )}\n\n {hasDescription && (\n <StyledInfoMessage\n className={clsx(\n textAreaClasses.description,\n classes?.description\n )}\n id={setId(elementId, \"description\")}\n >\n {description}\n </StyledInfoMessage>\n )}\n </StyledLabelContainer>\n )}\n\n {hasCounter && (\n <StyledCharCounter\n id={setId(elementId, \"charCounter\")}\n className={clsx(\n textAreaClasses.characterCounter,\n classes?.characterCounter\n )}\n separator={middleCountLabel}\n currentCharQuantity={value.length}\n maxCharQuantity={maxCharQuantity}\n {...countCharProps}\n />\n )}\n\n <StyledBaseInput\n classes={{\n root: clsx(textAreaClasses.baseInput, classes?.baseInput),\n input: clsx(textAreaClasses.input, classes?.input),\n inputResizable: clsx(\n textAreaClasses.inputResizable,\n classes?.inputResizable\n ),\n }}\n id={hasLabel ? setId(elementId, \"input\") : setId(id, \"input\")}\n name={name}\n value={value}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChangeHandler}\n autoFocus={autoFocus}\n onFocus={onFocusHandler}\n placeholder={placeholder}\n invalid={isStateInvalid}\n resizable={resizable}\n multiline\n rows={rows}\n inputProps={{\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-describedby\":\n ariaDescribedBy != null\n ? ariaDescribedBy\n : (description && setId(elementId, \"description\")) || undefined,\n \"aria-controls\": maxCharQuantity\n ? setId(elementId, \"charCounter\")\n : undefined,\n ...inputProps,\n }}\n inputRef={inputRef}\n $resizable={resizable}\n {...others}\n />\n\n {canShowError && (\n <StyledWarningText\n id={setId(elementId, \"error\")}\n className={clsx(textAreaClasses.error, classes?.error)}\n disableBorder\n >\n {validationMessage}\n </StyledWarningText>\n )}\n </StyledFormElement>\n );\n};\n"],"names":["HvTextArea","id","className","classes","name","label","description","placeholder","status","statusMessage","validationMessages","maxCharQuantity","minCharQuantity","value","valueProp","inputRef","inputRefProp","rows","defaultValue","middleCountLabel","countCharProps","inputProps","required","readOnly","disabled","autoFocus","resizable","autoScroll","hideCounter","blockMax","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaErrorMessage","validation","onChange","onBlur","onFocus","others","elementId","useUniqueId","isDirty","useRef","inputRefOwn","focused","setFocused","useState","autoScrolling","setAutoScrolling","validationState","setValidationState","useControlled","validationStates","standBy","validationMessage","setValidationMessage","setValue","isStateInvalid","isInvalid","isEmptyValue","hasLabel","hasDescription","hasCounter","errorMessages","useMemo","DEFAULT_ERROR_MESSAGES","error","requiredError","minCharError","maxCharError","performValidation","useCallback","inputValidity","validateInput","current","validationTypes","none","computeValidationState","computeValidationMessage","isOverflow","currentValue","isNil","length","limitValue","undefined","substring","onContainerBlurHandler","event","onChangeHandler","limitedValue","onFocusHandler","isScrolledDown","el","offsetHeight","scrollTop","scrollHeight","scrollDown","clientHeight","addScrollListener","scrollHandler","handleEvent","addEventListener","useEffect","canShowError","hasBuiltInValidations","errorMessageId","setId","StyledFormElement","clsx","textAreaClasses","root","invalid","$resizable","children","StyledLabelContainer","labelContainer","_jsx","StyledLabel","htmlFor","StyledInfoMessage","StyledCharCounter","characterCounter","separator","currentCharQuantity","StyledBaseInput","baseInput","input","inputResizable","multiline","StyledWarningText","disableBorder"],"mappings":";;;;;;;;;;;AAiJO,MAAMA,aAAaA,CAAC;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;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sources":["../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import { useControlled, useUniqueId } from \"@core/hooks\";\nimport validationStates, {\n isInvalid,\n} from \"@core/components/Forms/FormElement/validationStates\";\nimport { clsx } from \"clsx\";\nimport { useCallback, useRef, useState, useMemo, useEffect } from \"react\";\nimport { setId } from \"@core/utils\";\nimport isNil from \"lodash/isNil\";\nimport { HvValidationMessages } from \"@core/types\";\nimport {\n computeValidationMessage,\n computeValidationState,\n DEFAULT_ERROR_MESSAGES,\n hasBuiltInValidations,\n HvInputValidity,\n validateInput,\n validationTypes,\n} from \"../BaseInput/validations\";\nimport {\n StyledBaseInput,\n StyledCharCounter,\n StyledFormElement,\n StyledInfoMessage,\n StyledLabel,\n StyledLabelContainer,\n StyledWarningText,\n} from \"./TextArea.styles\";\nimport { HvBaseInputProps } from \"../BaseInput\";\nimport { HvCharCounterProps, HvFormStatus } from \"../Forms\";\nimport textAreaClasses, { HvTextAreaClasses } from \"./textAreaClasses\";\n\nexport interface HvTextAreaProps\n extends Omit<\n HvBaseInputProps,\n \"onChange\" | \"onBlur\" | \"rows\" | \"classes\" | \"onFocus\"\n > {\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label?: React.ReactNode;\n /**\n * Provide additional descriptive text for the form element.\n */\n description?: React.ReactNode;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to the state.\n */\n status?: HvFormStatus;\n /**\n * The error message to show when `status` is \"invalid\".\n */\n statusMessage?: React.ReactNode;\n /**\n * Text between the current char counter and max value.\n */\n middleCountLabel?: string;\n /**\n * An Object containing the various texts associated with the input.\n */\n validationMessages?: HvValidationMessages;\n /**\n * The custom validation function, it receives the value and must return\n * either `true` for valid or `false` for invalid, default validations would only\n * occur if this function is null or undefined\n */\n validation?: (value: string) => boolean;\n /**\n * The maximum allowed length of the characters, if this value is null no check\n * will be performed.\n */\n maxCharQuantity?: number;\n /**\n * The minimum allowed length of the characters, if this value is null no check\n * will be perform.\n */\n minCharQuantity?: number;\n /**\n * If `true` it should autofocus.\n */\n autoFocus?: boolean;\n /**\n * The number of rows of the text area\n */\n rows?: number;\n /**\n * If `true` the component is resizable.\n */\n resizable?: boolean;\n /**\n * Auto-scroll: automatically scroll to the end on value changes.\n * Will stop if the user scrolls up and resume if scrolled to the bottom.\n */\n autoScroll?: boolean;\n /**\n * If true it isn't possible to pass the `maxCharQuantity`\n */\n blockMax?: boolean;\n /**\n * If `true` the character counter isn't shown even if maxCharQuantity is set.\n */\n hideCounter?: boolean;\n /**\n * Props passed to the char count.\n */\n countCharProps?: Partial<HvCharCounterProps>;\n /**\n * Called back when the value is changed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n value: string\n ) => void;\n /**\n * Called back when the value is changed.\n */\n onBlur?: (\n event: React.FocusEvent<HTMLTextAreaElement>,\n value: string,\n validationState: HvInputValidity\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the value state,\n * it receives the value.\n */\n onFocus?: (\n event: React.FocusEvent<HTMLTextAreaElement>,\n value: string\n ) => void;\n /**\n * A Jss Object used to override or extend the component styles applied.\n */\n classes?: HvTextAreaClasses;\n}\n\n/**\n * A text area is a multiline text input box, with an optional character counter when there is a length limit.\n */\nexport const HvTextArea = ({\n id,\n className,\n classes,\n name,\n label,\n description,\n placeholder,\n status,\n statusMessage,\n validationMessages,\n maxCharQuantity,\n minCharQuantity,\n value: valueProp,\n inputRef: inputRefProp,\n rows = 1,\n defaultValue = \"\",\n middleCountLabel = \"/\",\n countCharProps = {},\n inputProps = {},\n required = false,\n readOnly = false,\n disabled = false,\n autoFocus = false,\n resizable = false,\n autoScroll = false,\n hideCounter = false,\n blockMax = false,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-errormessage\": ariaErrorMessage,\n validation,\n onChange,\n onBlur,\n onFocus,\n ...others\n}: HvTextAreaProps) => {\n const elementId = useUniqueId(id, \"hvtextarea\");\n\n // Signals that the user has manually edited the input value\n const isDirty = useRef<boolean>(false);\n\n const inputRefOwn = useRef(null);\n\n const inputRef = inputRefProp || inputRefOwn;\n\n const [focused, setFocused] = useState<boolean>(false);\n\n const [autoScrolling, setAutoScrolling] = useState(autoScroll);\n\n const [validationState, setValidationState] = useControlled(\n status,\n validationStates.standBy\n );\n\n const [validationMessage, setValidationMessage] = useControlled(\n statusMessage,\n \"\"\n );\n\n const [value, setValue] = useControlled(valueProp, defaultValue);\n\n const isStateInvalid = isInvalid(validationState);\n\n const isEmptyValue = value == null || value === \"\";\n\n const hasLabel = label != null;\n\n const hasDescription = description != null;\n\n const hasCounter = maxCharQuantity != null && !hideCounter;\n\n // ValidationMessages reference tends to change, as users will not memorize/useState for it;\n // Dependencies must be more explicit so we set\n const errorMessages = useMemo(\n () => ({ ...DEFAULT_ERROR_MESSAGES, ...validationMessages }),\n [\n validationMessages?.error,\n validationMessages?.requiredError,\n validationMessages?.minCharError,\n validationMessages?.maxCharError,\n ]\n );\n\n // Validates the input, sets the status and the statusMessage accordingly (if uncontrolled)\n // and returns the validity state of the input.\n const performValidation = useCallback(() => {\n const inputValidity = validateInput(\n inputRef.current,\n value,\n required,\n minCharQuantity,\n maxCharQuantity,\n validationTypes.none,\n validation\n );\n\n // This will only run if status is uncontrolled\n setValidationState(computeValidationState(inputValidity, isEmptyValue));\n\n // This will only run if statusMessage is uncontrolled\n setValidationMessage(\n computeValidationMessage(inputValidity, errorMessages)\n );\n\n return inputValidity;\n }, [\n errorMessages,\n inputRef,\n isEmptyValue,\n maxCharQuantity,\n minCharQuantity,\n required,\n setValidationMessage,\n setValidationState,\n validation,\n value,\n ]);\n\n const isOverflow = (currentValue) =>\n isNil(maxCharQuantity) ? false : currentValue.length > maxCharQuantity;\n\n /**\n * Limit the string to the maxCharQuantity length.\n *\n * @param value - string to evaluate\n * @returns {string|*} - string according the limit\n */\n const limitValue = (currentValue) => {\n if (currentValue === undefined || !blockMax) return currentValue;\n return !isOverflow(currentValue)\n ? currentValue\n : currentValue.substring(0, maxCharQuantity);\n };\n\n /**\n * Validates the text area updating the state and modifying the warning text, also executes\n * the user provided onBlur passing the current validation status and value.\n *\n * @returns {undefined}\n */\n const onContainerBlurHandler = (event) => {\n setFocused(false);\n\n const inputValidity = performValidation();\n\n onBlur?.(event, value, inputValidity);\n };\n\n /**\n * Updates the length of the string while is being inputted, also executes the user onChange\n * allowing the customization of the input if required.\n *\n * @param {String} value - The value provided by the HvInput\n */\n const onChangeHandler = (event, currentValue) => {\n isDirty.current = true;\n\n const limitedValue = blockMax ? limitValue(currentValue) : currentValue;\n\n // Set the input value (only when value is uncontrolled)\n setValue(limitedValue);\n\n onChange?.(event, limitedValue);\n };\n\n /**\n * Updates the state putting again the value from the state because the input value is\n * not automatically manage, it also executes the onFocus function from the user passing the value\n */\n const onFocusHandler = (event) => {\n setFocused(true);\n\n // Reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n onFocus?.(event, value);\n };\n\n const isScrolledDown = useCallback(() => {\n const el = inputRef.current;\n return el == null || el.offsetHeight + el.scrollTop >= el.scrollHeight;\n }, [inputRef]);\n\n const scrollDown = useCallback(() => {\n const el = inputRef.current;\n if (el != null) {\n el.scrollTop = el.scrollHeight - el.clientHeight;\n }\n }, [inputRef]);\n\n const addScrollListener = useCallback(() => {\n const scrollHandler = {\n handleEvent: () => {\n setAutoScrolling(isScrolledDown());\n },\n };\n inputRef.current?.addEventListener(\"scroll\", scrollHandler);\n }, [inputRef, isScrolledDown]);\n\n useEffect(() => {\n if (autoScroll) {\n addScrollListener();\n }\n }, [autoScroll, addScrollListener]);\n\n useEffect(() => {\n if (autoScrolling) {\n scrollDown();\n }\n }, [valueProp, autoScrolling, scrollDown]);\n\n // Run initial validation after first render\n // and also when any validation condition changes\n useEffect(() => {\n if (focused || (!isDirty.current && isEmptyValue)) {\n // Skip validation if currently focused or if empty and\n // the user never manually edited the input value\n return;\n }\n\n performValidation();\n }, [focused, isEmptyValue, performValidation]);\n\n // The error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and any of the built-in validations are active\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined &&\n hasBuiltInValidations(\n required,\n validationTypes.none,\n minCharQuantity,\n // If blockMax is true maxCharQuantity will never produce an error\n // unless the value is controlled, so we can't prevent it to overflow maxCharQuantity\n maxCharQuantity != null && (blockMax !== true || value != null)\n ? maxCharQuantity\n : null,\n validation,\n inputProps\n )));\n\n let errorMessageId;\n if (isStateInvalid) {\n errorMessageId = canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage;\n }\n\n return (\n <StyledFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={clsx(\n textAreaClasses.root,\n classes?.root,\n className,\n resizable && clsx(textAreaClasses.resizable, classes?.resizable),\n disabled && clsx(textAreaClasses.disabled, classes?.disabled),\n isStateInvalid && clsx(textAreaClasses.invalid, classes?.invalid)\n )}\n $resizable={resizable}\n onBlur={onContainerBlurHandler}\n >\n {(hasLabel || hasDescription) && (\n <StyledLabelContainer\n className={clsx(\n textAreaClasses.labelContainer,\n classes?.labelContainer\n )}\n >\n {hasLabel && (\n <StyledLabel\n className={clsx(textAreaClasses.label, classes?.label)}\n id={setId(id, \"label\")}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n />\n )}\n\n {hasDescription && (\n <StyledInfoMessage\n className={clsx(\n textAreaClasses.description,\n classes?.description\n )}\n id={setId(elementId, \"description\")}\n >\n {description}\n </StyledInfoMessage>\n )}\n </StyledLabelContainer>\n )}\n\n {hasCounter && (\n <StyledCharCounter\n id={setId(elementId, \"charCounter\")}\n className={clsx(\n textAreaClasses.characterCounter,\n classes?.characterCounter\n )}\n separator={middleCountLabel}\n currentCharQuantity={value.length}\n maxCharQuantity={maxCharQuantity}\n {...countCharProps}\n />\n )}\n\n <StyledBaseInput\n classes={{\n root: clsx(textAreaClasses.baseInput, classes?.baseInput),\n input: clsx(textAreaClasses.input, classes?.input),\n inputResizable: clsx(\n textAreaClasses.inputResizable,\n classes?.inputResizable\n ),\n }}\n id={hasLabel ? setId(elementId, \"input\") : setId(id, \"input\")}\n name={name}\n value={value}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChangeHandler}\n autoFocus={autoFocus}\n onFocus={onFocusHandler}\n placeholder={placeholder}\n invalid={isStateInvalid}\n resizable={resizable}\n multiline\n rows={rows}\n inputProps={{\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-describedby\":\n ariaDescribedBy != null\n ? ariaDescribedBy\n : (description && setId(elementId, \"description\")) || undefined,\n \"aria-controls\": maxCharQuantity\n ? setId(elementId, \"charCounter\")\n : undefined,\n ...inputProps,\n }}\n inputRef={inputRef}\n $resizable={resizable}\n {...others}\n />\n\n {canShowError && (\n <StyledWarningText\n id={setId(elementId, \"error\")}\n className={clsx(textAreaClasses.error, classes?.error)}\n disableBorder\n >\n {validationMessage}\n </StyledWarningText>\n )}\n </StyledFormElement>\n );\n};\n"],"names":["HvTextArea","id","className","classes","name","label","description","placeholder","status","statusMessage","validationMessages","maxCharQuantity","minCharQuantity","value","valueProp","inputRef","inputRefProp","rows","defaultValue","middleCountLabel","countCharProps","inputProps","required","readOnly","disabled","autoFocus","resizable","autoScroll","hideCounter","blockMax","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaErrorMessage","validation","onChange","onBlur","onFocus","others","elementId","useUniqueId","isDirty","useRef","inputRefOwn","focused","setFocused","useState","autoScrolling","setAutoScrolling","validationState","setValidationState","useControlled","validationStates","standBy","validationMessage","setValidationMessage","setValue","isStateInvalid","isInvalid","isEmptyValue","hasLabel","hasDescription","hasCounter","errorMessages","useMemo","DEFAULT_ERROR_MESSAGES","error","requiredError","minCharError","maxCharError","performValidation","useCallback","inputValidity","validateInput","current","validationTypes","none","computeValidationState","computeValidationMessage","isOverflow","currentValue","isNil","length","limitValue","undefined","substring","onContainerBlurHandler","event","onChangeHandler","limitedValue","onFocusHandler","isScrolledDown","el","offsetHeight","scrollTop","scrollHeight","scrollDown","clientHeight","addScrollListener","scrollHandler","handleEvent","addEventListener","useEffect","canShowError","hasBuiltInValidations","errorMessageId","setId","StyledFormElement","clsx","textAreaClasses","root","invalid","$resizable","children","StyledLabelContainer","labelContainer","_jsx","StyledLabel","htmlFor","StyledInfoMessage","StyledCharCounter","characterCounter","separator","currentCharQuantity","StyledBaseInput","baseInput","input","inputResizable","multiline","StyledWarningText","disableBorder"],"mappings":";;;;;;;;;;;AAiJO,MAAMA,aAAaA,CAAC;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,OAAOC;AAAAA,EACPC,UAAUC;AAAAA,EACVC,OAAO;AAAA,EACPC,eAAe;AAAA,EACfC,mBAAmB;AAAA,EACnBC,iBAAiB,CAAC;AAAA,EAClBC,aAAa,CAAC;AAAA,EACdC,WAAW;AAAA,EACXC,WAAW;AAAA,EACXC,WAAW;AAAA,EACXC,YAAY;AAAA,EACZC,YAAY;AAAA,EACZC,aAAa;AAAA,EACbC,cAAc;AAAA,EACdC,WAAW;AAAA,EACX,cAAcC;AAAAA,EACd,mBAAmBC;AAAAA,EACnB,oBAAoBC;AAAAA,EACpB,qBAAqBC;AAAAA,EACrBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AACY,MAA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AA,MACT/G;AAAAA,MACAI,YAAY;AAAA,QACV,cAAcS;AAAAA,QACd,mBAAmBC;AAAAA,QACnB,gBAAgB0B,iBAAiB,OAAO2B;AAAAA,QACxC,qBAAqBqB;AAAAA,QACrB,oBACEzE,mBAAmB,OACfA,kBACC1B,eAAeoG,MAAMnE,WAAW,aAAa,KAAM6C;AAAAA,QAC1D,iBAAiBzE,kBACb+F,MAAMnE,WAAW,aAAa,IAC9B6C;AAAAA,QACJ,GAAG/D;AAAAA,MACL;AAAA,MACAN;AAAAA,MACAiG,YAAYtF;AAAAA,MAAU,GAClBY;AAAAA,IAAAA,CAAM,GAGXiE,gBACCa,oBAACa,mBAAiB;AAAA,MAChBhI,IAAIyG,MAAMnE,WAAW,OAAO;AAAA,MAC5BrC,WAAW0G,KAAKC,gBAAgB3C,OAAO/D,mCAAS+D,KAAK;AAAA,MACrDgE,eAAa;AAAA,MAAAjB,UAEZ3D;AAAAA,IAAAA,CAEJ,CAAA;AAAA,EAAA,CACiB;AAExB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeAgo.js","sources":["../../../../src/components/TimeAgo/TimeAgo.tsx"],"sourcesContent":["import { HvTypography } from \"@core/components\";\nimport { HvBaseProps } from \"@core/types\";\nimport { clsx } from \"clsx\";\nimport isEmpty from \"lodash/isEmpty\";\nimport timeAgoClasses, { HvTimeAgoClasses } from \"./timeAgoClasses\";\nimport useTimeAgo from \"./useTimeAgo\";\n\nexport interface HvTimeAgoProps extends HvBaseProps<HTMLElement, \"children\"> {\n /**\n * The timestamp to format, in seconds or milliseconds.\n * Defaults to `emptyElement` if value is null or 0\n */\n timestamp?: number;\n /**\n * The locale to be used. Should be on of the dayjs supported locales and explicitly imported\n * @see https://day.js.org/docs/en/i18n/i18n\n */\n locale?: string;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `HvTypography`.\n */\n component?: React.ElementType<React.HTMLAttributes<HTMLElement>>;\n /**\n * The element to render when the timestamp is null or 0\n * Defaults to `—` (Em Dash)\n */\n emptyElement?: React.ReactNode;\n /**\n * Disables periodic date refreshes\n */\n disableRefresh?: boolean;\n /**\n * Whether to show seconds in the rendered time\n */\n showSeconds?: boolean;\n /**\n * Whether the component should render just the string\n * Consider using `useTimeAgo` instead\n */\n justText?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTimeAgoClasses;\n}\n\n/**\n * The HvTimeAgo component implements the Design System relative time format guidelines.\n */\nexport const HvTimeAgo = ({\n classes,\n timestamp,\n locale: localeProp = \"en\",\n component: Component = HvTypography,\n emptyElement = \"—\",\n disableRefresh = false,\n showSeconds = false,\n justText = false,\n ...others\n}: HvTimeAgoProps) => {\n const locale = isEmpty(localeProp) ? \"en\" : localeProp;\n const timeAgo = useTimeAgo(timestamp, {\n locale,\n disableRefresh,\n showSeconds,\n });\n\n if (justText && timestamp) return <>{timeAgo}</>;\n\n return (\n <Component className={clsx(classes?.root, timeAgoClasses.root)} {...others}>\n {!timestamp ? emptyElement : timeAgo}\n </Component>\n );\n};\n"],"names":["HvTimeAgo","classes","timestamp","locale","localeProp","component","Component","HvTypography","emptyElement","disableRefresh","showSeconds","justText","others","isEmpty","timeAgo","useTimeAgo","_Fragment","children","className","clsx","root","timeAgoClasses"],"mappings":";;;;;;AAgDO,MAAMA,YAAYA,CAAC;AAAA,EACxBC;AAAAA,EACAC;AAAAA,EACAC,QAAQC,aAAa;AAAA,EACrBC,WAAWC,YAAYC;AAAAA,EACvBC,eAAe;AAAA,EACfC,iBAAiB;AAAA,EACjBC,cAAc;AAAA,EACdC,WAAW;AAAA,EACX,GAAGC;AACW,MAAM;AACpB,QAAMT,SAASU,QAAQT,UAAU,IAAI,OAAOA;AACtCU,QAAAA,UAAUC,WAAWb,WAAW;AAAA,IACpCC;AAAAA,IACAM;AAAAA,IACAC;AAAAA,EAAAA,CACD;
|
|
1
|
+
{"version":3,"file":"TimeAgo.js","sources":["../../../../src/components/TimeAgo/TimeAgo.tsx"],"sourcesContent":["import { HvTypography } from \"@core/components\";\nimport { HvBaseProps } from \"@core/types\";\nimport { clsx } from \"clsx\";\nimport isEmpty from \"lodash/isEmpty\";\nimport timeAgoClasses, { HvTimeAgoClasses } from \"./timeAgoClasses\";\nimport useTimeAgo from \"./useTimeAgo\";\n\nexport interface HvTimeAgoProps extends HvBaseProps<HTMLElement, \"children\"> {\n /**\n * The timestamp to format, in seconds or milliseconds.\n * Defaults to `emptyElement` if value is null or 0\n */\n timestamp?: number;\n /**\n * The locale to be used. Should be on of the dayjs supported locales and explicitly imported\n * @see https://day.js.org/docs/en/i18n/i18n\n */\n locale?: string;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `HvTypography`.\n */\n component?: React.ElementType<React.HTMLAttributes<HTMLElement>>;\n /**\n * The element to render when the timestamp is null or 0\n * Defaults to `—` (Em Dash)\n */\n emptyElement?: React.ReactNode;\n /**\n * Disables periodic date refreshes\n */\n disableRefresh?: boolean;\n /**\n * Whether to show seconds in the rendered time\n */\n showSeconds?: boolean;\n /**\n * Whether the component should render just the string\n * Consider using `useTimeAgo` instead\n */\n justText?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTimeAgoClasses;\n}\n\n/**\n * The HvTimeAgo component implements the Design System relative time format guidelines.\n */\nexport const HvTimeAgo = ({\n classes,\n timestamp,\n locale: localeProp = \"en\",\n component: Component = HvTypography,\n emptyElement = \"—\",\n disableRefresh = false,\n showSeconds = false,\n justText = false,\n ...others\n}: HvTimeAgoProps) => {\n const locale = isEmpty(localeProp) ? \"en\" : localeProp;\n const timeAgo = useTimeAgo(timestamp, {\n locale,\n disableRefresh,\n showSeconds,\n });\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (justText && timestamp) return <>{timeAgo}</>;\n\n return (\n <Component className={clsx(classes?.root, timeAgoClasses.root)} {...others}>\n {!timestamp ? emptyElement : timeAgo}\n </Component>\n );\n};\n"],"names":["HvTimeAgo","classes","timestamp","locale","localeProp","component","Component","HvTypography","emptyElement","disableRefresh","showSeconds","justText","others","isEmpty","timeAgo","useTimeAgo","_Fragment","children","className","clsx","root","timeAgoClasses"],"mappings":";;;;;;AAgDO,MAAMA,YAAYA,CAAC;AAAA,EACxBC;AAAAA,EACAC;AAAAA,EACAC,QAAQC,aAAa;AAAA,EACrBC,WAAWC,YAAYC;AAAAA,EACvBC,eAAe;AAAA,EACfC,iBAAiB;AAAA,EACjBC,cAAc;AAAA,EACdC,WAAW;AAAA,EACX,GAAGC;AACW,MAAM;AACpB,QAAMT,SAASU,QAAQT,UAAU,IAAI,OAAOA;AACtCU,QAAAA,UAAUC,WAAWb,WAAW;AAAA,IACpCC;AAAAA,IACAM;AAAAA,IACAC;AAAAA,EAAAA,CACD;AAGD,MAAIC,YAAYT;AAAW,+BAAOc,UAAA;AAAA,MAAAC,UAAGH;AAAAA,IAAAA,CAAW;AAEhD,6BACGR,WAAS;AAAA,IAACY,WAAWC,KAAKlB,mCAASmB,MAAMC,eAAeD,IAAI;AAAA,IAAE,GAAKR;AAAAA,IAAMK,UACvE,CAACf,YAAYM,eAAeM;AAAAA,EAAAA,CACnB;AAEhB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.js","sources":["../../../../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ToggleButton.js","sources":["../../../../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { useControlled } from \"@core/hooks\";\nimport { HvBaseProps } from \"@core/types\";\nimport { HvButton } from \"..\";\n\nexport interface HvToggleButtonProps\n extends HvBaseProps<HTMLButtonElement, \"onClick\"> {\n /** When uncontrolled, defines the initial selected state. */\n defaultSelected?: boolean;\n /** Defines if the button is selected. When defined the button state becomes controlled. */\n selected?: boolean;\n /** Defines if the button is disabled. */\n disabled?: boolean;\n /** Icon for when not selected. Ignored if the component has children. */\n notSelectedIcon?: React.ReactNode;\n /** Icon for when selected. Ignored if the component has children. */\n selectedIcon?: React.ReactNode;\n /** Function called when icon is clicked. */\n onClick?: (\n event: React.MouseEvent<HTMLButtonElement>,\n selected: boolean\n ) => void;\n}\n\nexport const HvToggleButton = forwardRef<\n HTMLButtonElement,\n HvToggleButtonProps\n>((props, ref) => {\n const {\n defaultSelected,\n selected,\n notSelectedIcon,\n selectedIcon = null,\n onClick,\n children,\n ...others\n } = props;\n\n const [isSelected, setIsSelected] = useControlled(\n selected,\n Boolean(defaultSelected)\n );\n\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n setIsSelected(!isSelected);\n onClick?.(event, !isSelected);\n };\n\n return (\n <HvButton\n ref={ref}\n icon\n variant=\"secondaryGhost\"\n aria-pressed={isSelected}\n onClick={onClickHandler}\n {...others}\n >\n {children || (!isSelected ? notSelectedIcon : selectedIcon)}\n </HvButton>\n );\n});\n"],"names":["HvToggleButton","forwardRef","props","ref","defaultSelected","selected","notSelectedIcon","selectedIcon","onClick","children","others","isSelected","setIsSelected","useControlled","Boolean","onClickHandler","event","HvButton","icon","variant"],"mappings":";;;;AAwBO,MAAMA,iBAAiBC,WAG5B,CAACC,OAAOC,QAAQ;AACV,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,eAAe;AAAA,IACfC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EACDR,IAAAA;AAEE,QAAA,CAACS,YAAYC,aAAa,IAAIC,cAClCR,UACAS,QAAQV,eAAe,CAAC;AAGpBW,QAAAA,iBAAiBA,CAACC,UAA+C;AACrEJ,kBAAc,CAACD,UAAU;AACfK,uCAAAA,OAAO,CAACL;AAAAA,EAAU;AAG9B,6BACGM,UAAQ;AAAA,IACPd;AAAAA,IACAe,MAAI;AAAA,IACJC,SAAQ;AAAA,IACR,gBAAcR;AAAAA,IACdH,SAASO;AAAAA,IAAe,GACpBL;AAAAA,IAAMD,UAETA,aAAa,CAACE,aAAaL,kBAAkBC;AAAAA,EAAAA,CACrC;AAEf,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Tooltip, Fade } from "@mui/material";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
3
4
|
import { popperSx } from "./Tooltip.styles.js";
|
|
4
5
|
import tooltipClasses from "./tooltipClasses.js";
|
|
5
|
-
import { clsx } from "clsx";
|
|
6
6
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
7
7
|
import { useTheme } from "../../hooks/useTheme.js";
|
|
8
8
|
const HvTooltip = forwardRef((props, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n Fade,\n Tooltip as MuiTooltip,\n TooltipProps as MuiTooltipProps,\n} from \"@mui/material\";\nimport { forwardRef, ReactElement } from \"react\";\nimport { TransitionProps as MuiTransitionProps } from \"@mui/material/transitions\";\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n Fade,\n Tooltip as MuiTooltip,\n TooltipProps as MuiTooltipProps,\n} from \"@mui/material\";\nimport { forwardRef, ReactElement } from \"react\";\nimport { TransitionProps as MuiTransitionProps } from \"@mui/material/transitions\";\nimport { clsx } from \"clsx\";\nimport { useTheme } from \"@core/hooks\";\nimport { popperSx } from \"./Tooltip.styles\";\nimport tooltipClasses, { HvTooltipClasses } from \"./tooltipClasses\";\n\nexport type HvTooltipPlacementType =\n | \"bottom-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"left-end\"\n | \"left-start\"\n | \"left\"\n | \"right-end\"\n | \"right-start\"\n | \"right\"\n | \"top-end\"\n | \"top-start\"\n | \"top\";\n\nexport interface HvTooltipProps\n extends Omit<MuiTooltipProps, \"classes\" | \"title\"> {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvTooltipClasses;\n /**\n * If true, the tooltip is shown.\n */\n open?: boolean;\n /**\n * Tooltip placement.\n */\n placement?: HvTooltipPlacementType;\n /**\n * The number of milliseconds to wait before showing the tooltip.\n * This property won't impact the enter touch delay (enterTouchDelay).\n */\n enterDelay?: number;\n /**\n * Tooltip title. Zero-length titles string are never displayed.\n */\n title?: string | ReactElement;\n /**\n * The component used for the transition\n */\n TransitionComponent?: React.JSXElementConstructor<\n MuiTransitionProps & { children: React.ReactElement<any, any> }\n >;\n /**\n * Properties applied to the Transition element.\n */\n TransitionProps?: MuiTransitionProps;\n /**\n * Defines if should use a single or multiline tooltip.\n */\n useSingle?: boolean;\n /**\n * Node to apply the tooltip.\n */\n children: ReactElement;\n}\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n */\n\nexport const HvTooltip = forwardRef((props: HvTooltipProps, ref) => {\n const {\n className,\n classes,\n open,\n enterDelay = 300,\n placement = \"top\",\n useSingle = true,\n children,\n title,\n TransitionComponent = Fade,\n TransitionProps = { timeout: 400, placement },\n ...others\n } = props;\n\n const { rootId } = useTheme();\n\n return (\n <MuiTooltip\n ref={ref}\n open={open ?? undefined}\n enterDelay={enterDelay}\n placement={placement}\n TransitionComponent={TransitionComponent}\n TransitionProps={TransitionProps}\n className={className}\n classes={{\n tooltip: useSingle\n ? clsx(tooltipClasses.tooltip, classes?.tooltip)\n : clsx(tooltipClasses.tooltipMulti, classes?.tooltipMulti),\n popper: clsx(tooltipClasses.popper, classes?.popper),\n }}\n title={title}\n PopperProps={{\n sx: popperSx(useSingle),\n container: document.getElementById(rootId || \"\") || document.body,\n }}\n {...others}\n >\n {children}\n </MuiTooltip>\n );\n});\n"],"names":["HvTooltip","forwardRef","props","ref","className","classes","open","enterDelay","placement","useSingle","children","title","TransitionComponent","Fade","TransitionProps","timeout","others","rootId","useTheme","MuiTooltip","undefined","tooltip","clsx","tooltipClasses","tooltipMulti","popper","PopperProps","sx","popperSx","container","document","getElementById","body"],"mappings":";;;;;;;AA6EO,MAAMA,YAAYC,WAAW,CAACC,OAAuBC,QAAQ;AAC5D,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,aAAa;AAAA,IACbC,YAAY;AAAA,IACZC,YAAY;AAAA,IACZC;AAAAA,IACAC;AAAAA,IACAC,sBAAsBC;AAAAA,IACtBC,kBAAkB;AAAA,MAAEC,SAAS;AAAA,MAAKP;AAAAA,IAAU;AAAA,IAC5C,GAAGQ;AAAAA,EACDd,IAAAA;AAEE,QAAA;AAAA,IAAEe;AAAAA,MAAWC,SAAU;AAE7B,6BACGC,SAAU;AAAA,IACThB;AAAAA,IACAG,MAAMA,QAAQc;AAAAA,IACdb;AAAAA,IACAC;AAAAA,IACAI;AAAAA,IACAE;AAAAA,IACAV;AAAAA,IACAC,SAAS;AAAA,MACPgB,SAASZ,YACLa,KAAKC,eAAeF,SAAShB,mCAASgB,OAAO,IAC7CC,KAAKC,eAAeC,cAAcnB,mCAASmB,YAAY;AAAA,MAC3DC,QAAQH,KAAKC,eAAeE,QAAQpB,mCAASoB,MAAM;AAAA,IACrD;AAAA,IACAd;AAAAA,IACAe,aAAa;AAAA,MACXC,IAAIC,SAASnB,SAAS;AAAA,MACtBoB,WAAWC,SAASC,eAAed,UAAU,EAAE,KAAKa,SAASE;AAAAA,IAC/D;AAAA,IAAE,GACEhB;AAAAA,IAAMN;AAAAA,EAAAA,CAGC;AAEjB,CAAC;"}
|
|
@@ -2,9 +2,9 @@ import _styled from "@emotion/styled/base";
|
|
|
2
2
|
import { forwardRef, useMemo } from "react";
|
|
3
3
|
import { transientOptions } from "../../utils/transientOptions.js";
|
|
4
4
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
5
|
+
import { clsx } from "clsx";
|
|
5
6
|
import { mapVariant } from "./utils.js";
|
|
6
7
|
import typographyClasses from "./typographyClasses.js";
|
|
7
|
-
import { clsx } from "clsx";
|
|
8
8
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
9
9
|
import { useTheme } from "../../hooks/useTheme.js";
|
|
10
10
|
function _extends() {
|
|
@@ -142,7 +142,7 @@ const getStyledComponent = (c) => /* @__PURE__ */ _styled(c, process.env.NODE_EN
|
|
|
142
142
|
textOverflow: "ellipsis",
|
|
143
143
|
whiteSpace: "nowrap"
|
|
144
144
|
}
|
|
145
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvVHlwb2dyYXBoeS9UeXBvZ3JhcGh5LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0RUUiLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvaHYtdWlraXQtcmVhY3QvaHYtdWlraXQtcmVhY3QvcGFja2FnZXMvY29yZS9zcmMvY29tcG9uZW50cy9UeXBvZ3JhcGh5L1R5cG9ncmFwaHkudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgZm9yd2FyZFJlZixcbiAgdXNlTWVtbyxcbiAgQ1NTUHJvcGVydGllcyxcbiAgQWxsSFRNTEF0dHJpYnV0ZXMsXG4gIFJlZixcbn0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQgeyBIdkJhc2VQcm9wcyB9IGZyb20gXCJAY29yZS90eXBlc1wiO1xuaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyB0cmFuc2llbnRPcHRpb25zIH0gZnJvbSBcIkBjb3JlL3V0aWxzL3RyYW5zaWVudE9wdGlvbnNcIjtcbmltcG9ydCB7IHRoZW1lIH0gZnJvbSBcIkBoaXRhY2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ApO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxTdHlsZWRDb21wb25lbnRcbiAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgIGNsYXNzTmFtZT17Y2xzeChcbiAgICAgICAgICBjbGFzc05hbWUsXG4gICAgICAgICAgY2xhc3Nlcz8ucm9vdCxcbiAgICAgICAgICB0eXBvZ3JhcGh5Q2xhc3Nlcy5yb290LFxuICAgICAgICAgIGNsYXNzZXM/Llt2YXJpYW50XSxcbiAgICAgICAgICB0eXBvZ3JhcGh5Q2xhc3Nlc1t2YXJpYW50XSxcbiAgICAgICAgICBub1dyYXAgJiYgY2xzeCh0eXBvZ3JhcGh5Q2xhc3Nlcy5ub1dyYXAsIGNsYXNzZXM/Lm5vV3JhcClcbiAgICAgICAgKX1cbiAgICAgICAgJHZhcmlhbnQ9e1xuICAgICAgICAgIG1hcHBlZFZhcmlhbnQgYXMgSHZUeXBvZ3JhcGh5VmFyaWFudHMgfCBIdlR5cG9ncmFwaHlMZWdhY3lWYXJpYW50c1xuICAgICAgICB9XG4gICAgICAgICRsaW5rPXtsaW5rfVxuICAgICAgICAkZGlzYWJsZWQ9e2Rpc2FibGVkfVxuICAgICAgICAkbm9XcmFwPXtub1dyYXB9XG4gICAgICAgIHsuLi5vdGhlcnN9XG4gICAgICA+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvU3R5bGVkQ29tcG9uZW50PlxuICAgICk7XG4gIH1cbik7XG4iXX0= */");
|
|
145
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvVHlwb2dyYXBoeS9UeXBvZ3JhcGh5LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQU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lWYXJpYW50cyB8IEh2VHlwb2dyYXBoeUxlZ2FjeVZhcmlhbnRzXG4gICAgICAgIH1cbiAgICAgICAgJGxpbms9e2xpbmt9XG4gICAgICAgICRkaXNhYmxlZD17ZGlzYWJsZWR9XG4gICAgICAgICRub1dyYXA9e25vV3JhcH1cbiAgICAgICAgey4uLm90aGVyc31cbiAgICAgID5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9TdHlsZWRDb21wb25lbnQ+XG4gICAgKTtcbiAgfVxuKTtcbiJdfQ== */");
|
|
146
146
|
const HvTypography = forwardRef((props, ref) => {
|
|
147
147
|
const {
|
|
148
148
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sources":["../../../../src/components/Typography/Typography.tsx"],"sourcesContent":["import {\n forwardRef,\n useMemo,\n CSSProperties,\n AllHTMLAttributes,\n Ref,\n} from \"react\";\nimport { HvBaseProps } from \"@core/types\";\nimport styled from \"@emotion/styled\";\nimport { transientOptions } from \"@core/utils/transientOptions\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { mapVariant } from \"./utils\";\nimport typographyClasses, { HvTypographyClasses } from \"./typographyClasses\";\nimport { clsx } from \"clsx\";\nimport { useTheme } from \"@core/hooks\";\n\nexport type HvTypographyVariants =\n | \"display\"\n | \"title1\"\n | \"title2\"\n | \"title3\"\n | \"title4\"\n | \"body\"\n | \"label\"\n | \"caption1\"\n | \"caption2\";\n\nexport type HvTypographyLegacyVariants =\n | \"5xlTitle\"\n | \"4xlTitle\"\n | \"3xlTitle\"\n | \"xxlTitle\"\n | \"xlTitle\"\n | \"lTitle\"\n | \"mTitle\"\n | \"sTitle\"\n | \"xsTitle\"\n | \"xxsTitle\"\n | \"sectionTitle\"\n | \"highlightText\"\n | \"normalText\"\n | \"placeholderText\"\n | \"link\"\n | \"disabledText\"\n | \"selectedNavText\"\n | \"vizText\"\n | \"vizTextDisabled\"\n | \"xsInlineLink\";\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"label\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n lTitle: \"h2\",\n sTitle: \"h4\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} as const;\n\nconst getStyledComponent = <T extends keyof JSX.IntrinsicElements>(c: T) =>\n styled(\n c,\n transientOptions\n )(\n ({\n $variant,\n $link = false,\n $disabled = false,\n $noWrap = false,\n }: {\n $variant: HvTypographyVariants | HvTypographyLegacyVariants;\n $link?: boolean;\n $disabled?: boolean;\n $noWrap?: boolean;\n }) => ({\n ...($variant === \"display\" && {\n ...(theme.typography.display as CSSProperties),\n }),\n ...($variant === \"title1\" && {\n ...(theme.typography.title1 as CSSProperties),\n }),\n ...($variant === \"title2\" && {\n ...(theme.typography.title2 as CSSProperties),\n }),\n ...($variant === \"title3\" && {\n ...(theme.typography.title3 as CSSProperties),\n }),\n ...($variant === \"title4\" && {\n ...(theme.typography.title4 as CSSProperties),\n }),\n ...($variant === \"body\" && {\n ...(theme.typography.body as CSSProperties),\n }),\n ...($variant === \"label\" && {\n ...(theme.typography.label as CSSProperties),\n }),\n ...($variant === \"caption1\" && {\n ...(theme.typography.caption1 as CSSProperties),\n }),\n ...($variant === \"caption2\" && {\n ...(theme.typography.caption2 as CSSProperties),\n }),\n // LEGACY\n ...($variant === \"5xlTitle\" && {\n ...(theme.typography[\"5xlTitle\"] as CSSProperties),\n }),\n ...($variant === \"4xlTitle\" && {\n ...(theme.typography[\"4xlTitle\"] as CSSProperties),\n }),\n ...($variant === \"xxlTitle\" && {\n ...(theme.typography.xxlTitle as CSSProperties),\n }),\n ...($variant === \"lTitle\" && {\n ...(theme.typography.lTitle as CSSProperties),\n }),\n ...($variant === \"sTitle\" && {\n ...(theme.typography.sTitle as CSSProperties),\n }),\n ...($variant === \"xxsTitle\" && {\n ...(theme.typography.xxsTitle as CSSProperties),\n }),\n ...($variant === \"sectionTitle\" && {\n ...(theme.typography.sectionTitle as CSSProperties),\n textTransform: \"uppercase\",\n }),\n ...($variant === \"placeholderText\" && {\n ...(theme.typography.placeholderText as CSSProperties),\n }),\n ...($variant === \"link\" && {\n ...(theme.typography.link as CSSProperties),\n textDecoration: \"underline\",\n cursor: \"pointer\",\n }),\n ...($variant === \"disabledText\" && {\n ...(theme.typography.disabledText as CSSProperties),\n }),\n ...($variant === \"selectedNavText\" && {\n ...(theme.typography.selectedNavText as CSSProperties),\n }),\n ...($variant === \"vizTextDisabled\" && {\n ...(theme.typography.vizTextDisabled as CSSProperties),\n }),\n ...($variant === \"xsInlineLink\" && {\n ...(theme.typography.xsInlineLink as CSSProperties),\n }),\n fontFamily: theme.fontFamily.body,\n // ADDED PROPS\n ...($link && {\n color: theme.colors.primary,\n textDecoration: \"underline\",\n cursor: \"pointer\",\n }),\n ...($disabled && {\n color: theme.colors.secondary_60,\n }),\n ...($noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n })\n );\n\nexport interface HvTypographyProps\n extends Omit<AllHTMLAttributes<HTMLElement>, \"disabled\">,\n HvBaseProps<HTMLElement> {\n component?: React.ReactNode | React.ElementType;\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n /** If `true`, the text will have a bottom margin. */\n paragraph?: boolean;\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTypographyClasses;\n}\n\n/**\n * Typography component is used to render text and paragraphs within an interface.\n */\nexport const HvTypography = forwardRef(\n (props: HvTypographyProps, ref: Ref<HTMLElement>) => {\n const {\n children,\n className,\n component,\n classes,\n variant = \"body\",\n link = false,\n disabled = false,\n noWrap = false,\n paragraph = false,\n ...others\n } = props;\n const { activeTheme } = useTheme();\n\n const mappedVariant = mapVariant(variant, activeTheme?.name);\n\n const comp =\n component || (paragraph ? \"p\" : HvTypographyMap[mappedVariant] || \"span\");\n\n const StyledComponent = useMemo(\n () => getStyledComponent(comp || \"p\"),\n [comp]\n );\n\n return (\n <StyledComponent\n ref={ref}\n className={clsx(\n className,\n classes?.root,\n typographyClasses.root,\n classes?.[variant],\n typographyClasses[variant],\n noWrap && clsx(typographyClasses.noWrap, classes?.noWrap)\n )}\n $variant={\n mappedVariant as HvTypographyVariants | HvTypographyLegacyVariants\n }\n $link={link}\n $disabled={disabled}\n $noWrap={noWrap}\n {...others}\n >\n {children}\n </StyledComponent>\n );\n }\n);\n"],"names":["HvTypographyMap","display","title1","title2","title3","title4","body","label","caption1","caption2","xxlTitle","lTitle","sTitle","xxsTitle","sectionTitle","placeholderText","link","disabledText","selectedNavText","vizTextDisabled","xsInlineLink","getStyledComponent","c","process","env","NODE_ENV","_extends","target","transientOptions","$variant","$link","$disabled","$noWrap","theme","typography","textTransform","textDecoration","cursor","fontFamily","color","colors","primary","secondary_60","overflow","textOverflow","whiteSpace","HvTypography","forwardRef","props","ref","children","className","component","classes","variant","disabled","noWrap","paragraph","others","activeTheme","useTheme","mappedVariant","mapVariant","name","comp","StyledComponent","useMemo","clsx","root","typographyClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAMA,kBAAkB;AAAA,EACtBC,SAAS;AAAA,EACTC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,MAAM;AAAA,EACNC,OAAO;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AAAAA,EAE7B,GAAIwB,SAAS;AAAA,IACXS,OAAON,MAAMO,OAAOC;AAAAA,IACpBL,gBAAgB;AAAA,IAChBC,QAAQ;AAAA,EACV;AAAA,EACA,GAAIN,aAAa;AAAA,IACfQ,OAAON,MAAMO,OAAOE;AAAAA,EACtB;AAAA,EACA,GAAIV,WAAW;AAAA,IACbW,UAAU;AAAA,IACVC,cAAc;AAAA,IACdC,YAAY;AAAA,EACd;AACF,IAAEtB,QAAAC,IAAAC,aACH,eAAA,KAAA,ypUAAA;AA4BI,MAAMqB,eAAeC,WAC1B,CAACC,OAA0BC,QAA0B;AAC7C,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,UAAU;AAAA,IACVtC,OAAO;AAAA,IACPuC,WAAW;AAAA,IACXC,SAAS;AAAA,IACTC,YAAY;AAAA,IACZ,GAAGC;AAAAA,EACDV,IAAAA;AACE,QAAA;AAAA,IAAEW;AAAAA,MAAgBC,SAAU;AAElC,QAAMC,gBAAgBC,WAAWR,SAASK,2CAAaI,IAAI;AAE3D,QAAMC,OACJZ,cAAcK,YAAY,MAAMzD,gBAAgB6D,aAAa,KAAK;AAE9DI,QAAAA,kBAAkBC,QACtB,MAAM7C,mBAAmB2C,QAAQ,GAAG,GACpC,CAACA,IAAI,CAAC;AAGR,6BACGC,iBAAe;AAAA,IACdhB;AAAAA,IACAE,WAAWgB,KACThB,WACAE,mCAASe,MACTC,kBAAkBD,MAClBf,mCAAUC,UACVe,kBAAkBf,OAAO,GACzBE,UAAUW,KAAKE,kBAAkBb,QAAQH,mCAASG,MAAM,CAAC;AAAA,IAE3D3B,UACEgC;AAAAA,IAEF/B,OAAOd;AAAAA,IACPe,WAAWwB;AAAAA,IACXvB,SAASwB;AAAAA,IAAO,GACZE;AAAAA,IAAMR;AAAAA,EAAAA,CAGM;AAEtB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Typography.js","sources":["../../../../src/components/Typography/Typography.tsx"],"sourcesContent":["import {\n forwardRef,\n useMemo,\n CSSProperties,\n AllHTMLAttributes,\n Ref,\n} from \"react\";\nimport { HvBaseProps } from \"@core/types\";\nimport styled from \"@emotion/styled\";\nimport { transientOptions } from \"@core/utils/transientOptions\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { clsx } from \"clsx\";\nimport { useTheme } from \"@core/hooks\";\nimport { mapVariant } from \"./utils\";\nimport typographyClasses, { HvTypographyClasses } from \"./typographyClasses\";\n\nexport type HvTypographyVariants =\n | \"display\"\n | \"title1\"\n | \"title2\"\n | \"title3\"\n | \"title4\"\n | \"body\"\n | \"label\"\n | \"caption1\"\n | \"caption2\";\n\n/** @deprecated */\nexport type HvTypographyLegacyVariants =\n | \"5xlTitle\"\n | \"4xlTitle\"\n | \"3xlTitle\"\n | \"xxlTitle\"\n | \"xlTitle\"\n | \"lTitle\"\n | \"mTitle\"\n | \"sTitle\"\n | \"xsTitle\"\n | \"xxsTitle\"\n | \"sectionTitle\"\n | \"highlightText\"\n | \"normalText\"\n | \"placeholderText\"\n | \"link\"\n | \"disabledText\"\n | \"selectedNavText\"\n | \"vizText\"\n | \"vizTextDisabled\"\n | \"xsInlineLink\";\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"label\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n lTitle: \"h2\",\n sTitle: \"h4\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} as const;\n\nconst getStyledComponent = <T extends keyof JSX.IntrinsicElements>(c: T) =>\n styled(\n c,\n transientOptions\n )(\n ({\n $variant,\n $link = false,\n $disabled = false,\n $noWrap = false,\n }: {\n $variant: HvTypographyVariants | HvTypographyLegacyVariants;\n $link?: boolean;\n $disabled?: boolean;\n $noWrap?: boolean;\n }) => ({\n ...($variant === \"display\" && {\n ...(theme.typography.display as CSSProperties),\n }),\n ...($variant === \"title1\" && {\n ...(theme.typography.title1 as CSSProperties),\n }),\n ...($variant === \"title2\" && {\n ...(theme.typography.title2 as CSSProperties),\n }),\n ...($variant === \"title3\" && {\n ...(theme.typography.title3 as CSSProperties),\n }),\n ...($variant === \"title4\" && {\n ...(theme.typography.title4 as CSSProperties),\n }),\n ...($variant === \"body\" && {\n ...(theme.typography.body as CSSProperties),\n }),\n ...($variant === \"label\" && {\n ...(theme.typography.label as CSSProperties),\n }),\n ...($variant === \"caption1\" && {\n ...(theme.typography.caption1 as CSSProperties),\n }),\n ...($variant === \"caption2\" && {\n ...(theme.typography.caption2 as CSSProperties),\n }),\n // LEGACY\n ...($variant === \"5xlTitle\" && {\n ...(theme.typography[\"5xlTitle\"] as CSSProperties),\n }),\n ...($variant === \"4xlTitle\" && {\n ...(theme.typography[\"4xlTitle\"] as CSSProperties),\n }),\n ...($variant === \"xxlTitle\" && {\n ...(theme.typography.xxlTitle as CSSProperties),\n }),\n ...($variant === \"lTitle\" && {\n ...(theme.typography.lTitle as CSSProperties),\n }),\n ...($variant === \"sTitle\" && {\n ...(theme.typography.sTitle as CSSProperties),\n }),\n ...($variant === \"xxsTitle\" && {\n ...(theme.typography.xxsTitle as CSSProperties),\n }),\n ...($variant === \"sectionTitle\" && {\n ...(theme.typography.sectionTitle as CSSProperties),\n textTransform: \"uppercase\",\n }),\n ...($variant === \"placeholderText\" && {\n ...(theme.typography.placeholderText as CSSProperties),\n }),\n ...($variant === \"link\" && {\n ...(theme.typography.link as CSSProperties),\n textDecoration: \"underline\",\n cursor: \"pointer\",\n }),\n ...($variant === \"disabledText\" && {\n ...(theme.typography.disabledText as CSSProperties),\n }),\n ...($variant === \"selectedNavText\" && {\n ...(theme.typography.selectedNavText as CSSProperties),\n }),\n ...($variant === \"vizTextDisabled\" && {\n ...(theme.typography.vizTextDisabled as CSSProperties),\n }),\n ...($variant === \"xsInlineLink\" && {\n ...(theme.typography.xsInlineLink as CSSProperties),\n }),\n fontFamily: theme.fontFamily.body,\n // ADDED PROPS\n ...($link && {\n color: theme.colors.primary,\n textDecoration: \"underline\",\n cursor: \"pointer\",\n }),\n ...($disabled && {\n color: theme.colors.secondary_60,\n }),\n ...($noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n })\n );\n\nexport interface HvTypographyProps\n extends Omit<AllHTMLAttributes<HTMLElement>, \"disabled\">,\n HvBaseProps<HTMLElement> {\n component?: React.ReactNode | React.ElementType;\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n /** If `true`, the text will have a bottom margin. */\n paragraph?: boolean;\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTypographyClasses;\n}\n\n/**\n * Typography component is used to render text and paragraphs within an interface.\n */\nexport const HvTypography = forwardRef(\n (props: HvTypographyProps, ref: Ref<HTMLElement>) => {\n const {\n children,\n className,\n component,\n classes,\n variant = \"body\",\n link = false,\n disabled = false,\n noWrap = false,\n paragraph = false,\n ...others\n } = props;\n const { activeTheme } = useTheme();\n\n const mappedVariant = mapVariant(variant, activeTheme?.name);\n\n const comp =\n component || (paragraph ? \"p\" : HvTypographyMap[mappedVariant] || \"span\");\n\n const StyledComponent = useMemo(\n () => getStyledComponent(comp || \"p\"),\n [comp]\n );\n\n return (\n <StyledComponent\n ref={ref}\n className={clsx(\n className,\n classes?.root,\n typographyClasses.root,\n classes?.[variant],\n typographyClasses[variant],\n noWrap && clsx(typographyClasses.noWrap, classes?.noWrap)\n )}\n $variant={\n mappedVariant as HvTypographyVariants | HvTypographyLegacyVariants\n }\n $link={link}\n $disabled={disabled}\n $noWrap={noWrap}\n {...others}\n >\n {children}\n </StyledComponent>\n );\n }\n);\n"],"names":["HvTypographyMap","display","title1","title2","title3","title4","body","label","caption1","caption2","xxlTitle","lTitle","sTitle","xxsTitle","sectionTitle","placeholderText","link","disabledText","selectedNavText","vizTextDisabled","xsInlineLink","getStyledComponent","c","process","env","NODE_ENV","_extends","target","transientOptions","$variant","$link","$disabled","$noWrap","theme","typography","textTransform","textDecoration","cursor","fontFamily","color","colors","primary","secondary_60","overflow","textOverflow","whiteSpace","HvTypography","forwardRef","props","ref","children","className","component","classes","variant","disabled","noWrap","paragraph","others","activeTheme","useTheme","mappedVariant","mapVariant","name","comp","StyledComponent","useMemo","clsx","root","typographyClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,kBAAkB;AAAA,EACtBC,SAAS;AAAA,EACTC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,MAAM;AAAA,EACNC,OAAO;AAAA,EACPC,UAAU;AAAA,EACVC,UAAU;AAAA;AAAA,EAEV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZC,UAAU;AAAA,EACVC,QAAQ;AAAA,EACRC,QAAQ;AAAA,EACRC,UAAU;AAAA,EACVC,cAAc;AAAA,EACdC,iBAAiB;AAAA,EACjBC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,iBAAiB;AAAA,EACjBC,iBAAiB;AAAA,EACjBC,cAAc;AAChB;AAEA,MAAMC,qBAAqB,CAAwCC,MAE/DA,wBAAAA,GAACC,QAAAC,IAAAC,aAAA,eAAAC,SAAA,IAAA;AAAA,EAAAC,QAAA;AAAA,GACDC,gBAAgB,IAAAF,SAAA,IAAA;AAAA,EAAAC,QAAA;AA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,IACVtC,OAAO;AAAA,IACPuC,WAAW;AAAA,IACXC,SAAS;AAAA,IACTC,YAAY;AAAA,IACZ,GAAGC;AAAAA,EACDV,IAAAA;AACE,QAAA;AAAA,IAAEW;AAAAA,MAAgBC,SAAU;AAElC,QAAMC,gBAAgBC,WAAWR,SAASK,2CAAaI,IAAI;AAE3D,QAAMC,OACJZ,cAAcK,YAAY,MAAMzD,gBAAgB6D,aAAa,KAAK;AAE9DI,QAAAA,kBAAkBC,QACtB,MAAM7C,mBAAmB2C,QAAQ,GAAG,GACpC,CAACA,IAAI,CAAC;AAGR,6BACGC,iBAAe;AAAA,IACdhB;AAAAA,IACAE,WAAWgB,KACThB,WACAE,mCAASe,MACTC,kBAAkBD,MAClBf,mCAAUC,UACVe,kBAAkBf,OAAO,GACzBE,UAAUW,KAAKE,kBAAkBb,QAAQH,mCAASG,MAAM,CAAC;AAAA,IAE3D3B,UACEgC;AAAAA,IAEF/B,OAAOd;AAAAA,IACPe,WAAWwB;AAAAA,IACXvB,SAASwB;AAAAA,IAAO,GACZE;AAAAA,IAAMR;AAAAA,EAAAA,CAGM;AAEtB,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sources":["../../../../../src/components/VerticalNavigation/Actions/Action.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { MouseEventHandler, useCallback, useContext } from \"react\";\nimport { isKeypress, keyboardCodes, setId } from \"@core/utils\";\nimport { VerticalNavigationContext } from \"
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../../../src/components/VerticalNavigation/Actions/Action.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { MouseEventHandler, useCallback, useContext } from \"react\";\nimport { isKeypress, keyboardCodes, setId } from \"@core/utils\";\nimport { VerticalNavigationContext } from \"..\";\nimport { StyledAction } from \"./Action.styles\";\nimport actionClasses, {\n HvVerticalNavigationActionClasses,\n} from \"./actionClasses\";\n\nexport interface HvVerticalNavigationActionProps {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationActionClasses;\n /**\n * Id to be applied to the action.\n */\n id?: string;\n /**\n * Visual label.\n */\n label?: string;\n /**\n * Icon.\n */\n icon?: React.ReactNode;\n /**\n * Callback called when clicked.\n */\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationAction = ({\n className,\n classes,\n id,\n label = \"\",\n icon,\n onClick,\n ...others\n}: HvVerticalNavigationActionProps) => {\n const { isOpen } = useContext(VerticalNavigationContext);\n\n const handleKeyDown = useCallback(\n (event) => {\n if (\n onClick == null ||\n (!isKeypress(event, keyboardCodes.Enter) &&\n !isKeypress(event, keyboardCodes.SpaceBar))\n ) {\n return;\n }\n\n onClick(event);\n },\n [onClick]\n );\n\n return (\n <StyledAction\n id={setId(id, \"button\")}\n component=\"div\"\n role=\"button\"\n className={clsx(\n className,\n actionClasses.action,\n classes?.action,\n !icon && clsx(actionClasses.noIcon, classes?.noIcon),\n !isOpen && clsx(actionClasses.minimized, classes?.action)\n )}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onClick={onClick}\n {...others}\n >\n {icon}\n {isOpen && label}\n </StyledAction>\n );\n};\n"],"names":["HvVerticalNavigationAction","className","classes","id","label","icon","onClick","others","isOpen","useContext","VerticalNavigationContext","handleKeyDown","useCallback","event","isKeypress","keyboardCodes","Enter","SpaceBar","StyledAction","setId","component","role","clsx","actionClasses","action","noIcon","minimized","tabIndex","onKeyDown","children"],"mappings":";;;;;;;;;AAoCO,MAAMA,6BAA6BA,CAAC;AAAA,EACzCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,QAAQ;AAAA,EACRC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AAC4B,MAAM;AAC/B,QAAA;AAAA,IAAEC;AAAAA,EAAAA,IAAWC,WAAWC,yBAAyB;AAEjDC,QAAAA,gBAAgBC,YACnBC,CAAU,UAAA;AACT,QACEP,WAAW,QACV,CAACQ,WAAWD,OAAOE,cAAcC,KAAK,KACrC,CAACF,WAAWD,OAAOE,cAAcE,QAAQ,GAC3C;AACA;AAAA,IACF;AAEAX,YAAQO,KAAK;AAAA,EAAA,GAEf,CAACP,OAAO,CAAC;AAGX,8BACGY,cAAY;AAAA,IACXf,IAAIgB,MAAMhB,IAAI,QAAQ;AAAA,IACtBiB,WAAU;AAAA,IACVC,MAAK;AAAA,IACLpB,WAAWqB,KACTrB,WACAsB,cAAcC,QACdtB,mCAASsB,QACT,CAACnB,QAAQiB,KAAKC,cAAcE,QAAQvB,mCAASuB,MAAM,GACnD,CAACjB,UAAUc,KAAKC,cAAcG,WAAWxB,mCAASsB,MAAM,CAAC;AAAA,IAE3DG,UAAU;AAAA,IACVC,WAAWjB;AAAAA,IACXL;AAAAA,IAAiB,GACbC;AAAAA,IAAMsB,UAETxB,CAAAA,MACAG,UAAUJ,KAAK;AAAA,EAAA,CACH;AAEnB;"}
|
|
@@ -17,7 +17,7 @@ const HvVerticalNavigationActions = ({
|
|
|
17
17
|
} = useContext(VerticalNavigationContext);
|
|
18
18
|
return /* @__PURE__ */ jsx(StyledRoot, {
|
|
19
19
|
id,
|
|
20
|
-
className: clsx(className, actionsClasses.root, classes == null ? void 0 : classes.root, !isOpen && collapsedMode
|
|
20
|
+
className: clsx(className, actionsClasses.root, classes == null ? void 0 : classes.root, !isOpen && collapsedMode === "simple" && clsx(actionsClasses.hide, classes == null ? void 0 : classes.hide)),
|
|
21
21
|
...others,
|
|
22
22
|
children
|
|
23
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/VerticalNavigation/Actions/Actions.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useContext } from \"react\";\nimport { VerticalNavigationContext } from \"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/VerticalNavigation/Actions/Actions.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useContext } from \"react\";\nimport { VerticalNavigationContext } from \"..\";\nimport { StyledRoot } from \"./Actions.styles\";\nimport actionsClasses, {\n HvVerticalNavigationActionsClasses,\n} from \"./actionsClasses\";\n\nexport interface HvVerticalNavigationActionsProps {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationActionsClasses;\n /**\n * Id to be applied to the actions container.\n */\n id?: string;\n /**\n * Node to be rendered\n */\n children?: React.ReactNode;\n}\n\nexport const HvVerticalNavigationActions = ({\n className,\n classes,\n id,\n children,\n ...others\n}: HvVerticalNavigationActionsProps) => {\n const { isOpen, collapsedMode } = useContext(VerticalNavigationContext);\n\n return (\n <StyledRoot\n id={id}\n className={clsx(\n className,\n actionsClasses.root,\n classes?.root,\n !isOpen &&\n collapsedMode === \"simple\" &&\n clsx(actionsClasses.hide, classes?.hide)\n )}\n {...others}\n >\n {children}\n </StyledRoot>\n );\n};\n"],"names":["HvVerticalNavigationActions","className","classes","id","children","others","isOpen","collapsedMode","useContext","VerticalNavigationContext","StyledRoot","clsx","actionsClasses","root","hide"],"mappings":";;;;;;AA2BO,MAAMA,8BAA8BA,CAAC;AAAA,EAC1CC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AAC6B,MAAM;AAChC,QAAA;AAAA,IAAEC;AAAAA,IAAQC;AAAAA,EAAAA,IAAkBC,WAAWC,yBAAyB;AAEtE,6BACGC,YAAU;AAAA,IACTP;AAAAA,IACAF,WAAWU,KACTV,WACAW,eAAeC,MACfX,mCAASW,MACT,CAACP,UACCC,kBAAkB,YAClBI,KAAKC,eAAeE,MAAMZ,mCAASY,IAAI,CAAC;AAAA,IAC1C,GACET;AAAAA,IAAMD;AAAAA,EAAAA,CAGC;AAEjB;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Backwards, Forwards, Menu } from "@hitachivantara/uikit-react-icons";
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
|
-
import { useContext } from "react";
|
|
3
|
+
import { useContext, useMemo } from "react";
|
|
4
4
|
import { VerticalNavigationContext } from "../VerticalNavigationContext.js";
|
|
5
5
|
import { StyledHeader, StyledCollapseButton } from "./Header.styles.js";
|
|
6
6
|
import verticalNavigationHeaderClasses from "./headerClasses.js";
|
|
@@ -23,14 +23,16 @@ const HvVerticalNavigationHeader = ({
|
|
|
23
23
|
collapsedMode,
|
|
24
24
|
headerTitle,
|
|
25
25
|
slider,
|
|
26
|
-
navigateToParentHandler
|
|
26
|
+
navigateToParentHandler,
|
|
27
|
+
parentItem
|
|
27
28
|
} = useContext(VerticalNavigationContext);
|
|
28
29
|
openIcon = collapsedMode === "simple" ? /* @__PURE__ */ jsx(Menu, {}) : openIcon;
|
|
29
30
|
const backButtonClickHandler = () => {
|
|
30
31
|
if (navigateToParentHandler)
|
|
31
32
|
navigateToParentHandler();
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
+
const shouldShowTitle = useMemo(() => !slider || slider && !Array.isArray(parentItem), [parentItem]);
|
|
35
|
+
return shouldShowTitle ? /* @__PURE__ */ jsxs(StyledHeader, {
|
|
34
36
|
className: clsx(className, verticalNavigationHeaderClasses.root, classes == null ? void 0 : classes.root, !isOpen && clsx(verticalNavigationHeaderClasses.minimized, classes == null ? void 0 : classes.minimized)),
|
|
35
37
|
...others,
|
|
36
38
|
children: [isOpen && headerTitle && slider && /* @__PURE__ */ jsx(HvButton, {
|
|
@@ -54,7 +56,7 @@ const HvVerticalNavigationHeader = ({
|
|
|
54
56
|
...collapseButtonProps,
|
|
55
57
|
children: isOpen ? closeIcon : openIcon
|
|
56
58
|
})]
|
|
57
|
-
});
|
|
59
|
+
}) : null;
|
|
58
60
|
};
|
|
59
61
|
export {
|
|
60
62
|
HvVerticalNavigationHeader
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../../../src/components/VerticalNavigation/Header/Header.tsx"],"sourcesContent":["import { Backwards, Forwards, Menu } from \"@hitachivantara/uikit-react-icons\";\nimport { clsx } from \"clsx\";\nimport { HvButton, HvButtonProps, HvTypography } from \"@core/components\";\nimport { MouseEventHandler, useContext } from \"react\";\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { StyledCollapseButton, StyledHeader } from \"./Header.styles\";\nimport verticalNavigationHeaderClasses, {\n HvVerticalNavigationHeaderClasses,\n} from \"./headerClasses\";\n\nexport interface HvVerticalNavigationHeaderProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The title text to show on Header.\n */\n title?: string;\n /**\n * Icon to show when Vertical Navigation is collapsed.\n */\n openIcon?: React.ReactNode;\n /**\n * Icon to show when Vertical Navigation is expanded.\n */\n closeIcon?: React.ReactNode;\n /**\n * Props for the collapse button.\n */\n collapseButtonProps?: HvButtonProps;\n /**\n * Props for the back button.\n */\n backButtonProps?: HvButtonProps;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationHeaderClasses;\n /**\n * Handler for the collapse button.\n */\n onCollapseButtonClick?: MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationHeader = ({\n title,\n openIcon = <Forwards />,\n closeIcon = <Backwards />,\n collapseButtonProps,\n backButtonProps,\n className,\n classes,\n onCollapseButtonClick,\n ...others\n}: HvVerticalNavigationHeaderProps) => {\n const {\n isOpen,\n collapsedMode,\n headerTitle,\n slider,\n navigateToParentHandler,\n } = useContext(VerticalNavigationContext);\n\n openIcon = collapsedMode === \"simple\" ? <Menu /> : openIcon;\n\n const backButtonClickHandler = () => {\n if (navigateToParentHandler) navigateToParentHandler();\n };\n\n return (\n <StyledHeader\n className={clsx(\n className,\n verticalNavigationHeaderClasses.root,\n classes?.root,\n !isOpen &&\n clsx(verticalNavigationHeaderClasses.minimized, classes?.minimized)\n )}\n {...others}\n >\n {isOpen && headerTitle && slider && (\n <HvButton\n icon\n variant=\"secondaryGhost\"\n onClick={backButtonClickHandler}\n {...backButtonProps}\n >\n <Backwards iconSize=\"XS\" />\n </HvButton>\n )}\n {isOpen && (\n <HvTypography variant={slider ? \"label\" : \"title3\"}>\n {headerTitle && slider ? headerTitle : title}\n </HvTypography>\n )}\n {onCollapseButtonClick && (\n <StyledCollapseButton\n icon\n variant=\"secondaryGhost\"\n onClick={onCollapseButtonClick}\n classes={{\n root: isOpen ? \"\" : verticalNavigationHeaderClasses.minimized,\n }}\n {...collapseButtonProps}\n >\n {isOpen ? closeIcon : openIcon}\n </StyledCollapseButton>\n )}\n </StyledHeader>\n );\n};\n"],"names":["HvVerticalNavigationHeader","title","openIcon","_jsx","Forwards","closeIcon","Backwards","collapseButtonProps","backButtonProps","className","classes","onCollapseButtonClick","others","isOpen","collapsedMode","headerTitle","slider","navigateToParentHandler","useContext","VerticalNavigationContext","Menu","backButtonClickHandler","StyledHeader","clsx","verticalNavigationHeaderClasses","root","minimized","children","HvButton","icon","variant","onClick","iconSize","HvTypography","StyledCollapseButton"],"mappings":";;;;;;;;;AAiDO,MAAMA,6BAA6BA,CAAC;AAAA,EACzCC;AAAAA,EACAC,WAAWC,oBAACC,UAAW,EAAA;AAAA,EACvBC,YAAYF,oBAACG,WAAY,EAAA;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AAC4B,MAAM;AAC/B,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,EAAAA,IACEC,WAAWC,yBAAyB;
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../../src/components/VerticalNavigation/Header/Header.tsx"],"sourcesContent":["import { Backwards, Forwards, Menu } from \"@hitachivantara/uikit-react-icons\";\nimport { clsx } from \"clsx\";\nimport { HvButton, HvButtonProps, HvTypography } from \"@core/components\";\nimport { MouseEventHandler, useContext, useMemo } from \"react\";\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { StyledCollapseButton, StyledHeader } from \"./Header.styles\";\nimport verticalNavigationHeaderClasses, {\n HvVerticalNavigationHeaderClasses,\n} from \"./headerClasses\";\n\nexport interface HvVerticalNavigationHeaderProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The title text to show on Header.\n */\n title?: string;\n /**\n * Icon to show when Vertical Navigation is collapsed.\n */\n openIcon?: React.ReactNode;\n /**\n * Icon to show when Vertical Navigation is expanded.\n */\n closeIcon?: React.ReactNode;\n /**\n * Props for the collapse button.\n */\n collapseButtonProps?: HvButtonProps;\n /**\n * Props for the back button.\n */\n backButtonProps?: HvButtonProps;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationHeaderClasses;\n /**\n * Handler for the collapse button.\n */\n onCollapseButtonClick?: MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationHeader = ({\n title,\n openIcon = <Forwards />,\n closeIcon = <Backwards />,\n collapseButtonProps,\n backButtonProps,\n className,\n classes,\n onCollapseButtonClick,\n ...others\n}: HvVerticalNavigationHeaderProps) => {\n const {\n isOpen,\n collapsedMode,\n headerTitle,\n slider,\n navigateToParentHandler,\n parentItem,\n } = useContext(VerticalNavigationContext);\n\n openIcon = collapsedMode === \"simple\" ? <Menu /> : openIcon;\n\n const backButtonClickHandler = () => {\n if (navigateToParentHandler) navigateToParentHandler();\n };\n\n // whenever we're in a sublevel, the parentItem is always a single item.\n // In the first level it's always an array with the first level elements.\n const shouldShowTitle = useMemo(\n () => !slider || (slider && !Array.isArray(parentItem)),\n [parentItem]\n );\n\n return shouldShowTitle ? (\n <StyledHeader\n className={clsx(\n className,\n verticalNavigationHeaderClasses.root,\n classes?.root,\n !isOpen &&\n clsx(verticalNavigationHeaderClasses.minimized, classes?.minimized)\n )}\n {...others}\n >\n {isOpen && headerTitle && slider && (\n <HvButton\n icon\n variant=\"secondaryGhost\"\n onClick={backButtonClickHandler}\n {...backButtonProps}\n >\n <Backwards iconSize=\"XS\" />\n </HvButton>\n )}\n {isOpen && (\n <HvTypography variant={slider ? \"label\" : \"title3\"}>\n {headerTitle && slider ? headerTitle : title}\n </HvTypography>\n )}\n {onCollapseButtonClick && (\n <StyledCollapseButton\n icon\n variant=\"secondaryGhost\"\n onClick={onCollapseButtonClick}\n classes={{\n root: isOpen ? \"\" : verticalNavigationHeaderClasses.minimized,\n }}\n {...collapseButtonProps}\n >\n {isOpen ? closeIcon : openIcon}\n </StyledCollapseButton>\n )}\n </StyledHeader>\n ) : null;\n};\n"],"names":["HvVerticalNavigationHeader","title","openIcon","_jsx","Forwards","closeIcon","Backwards","collapseButtonProps","backButtonProps","className","classes","onCollapseButtonClick","others","isOpen","collapsedMode","headerTitle","slider","navigateToParentHandler","parentItem","useContext","VerticalNavigationContext","Menu","backButtonClickHandler","shouldShowTitle","useMemo","Array","isArray","StyledHeader","clsx","verticalNavigationHeaderClasses","root","minimized","children","HvButton","icon","variant","onClick","iconSize","HvTypography","StyledCollapseButton"],"mappings":";;;;;;;;;AAiDO,MAAMA,6BAA6BA,CAAC;AAAA,EACzCC;AAAAA,EACAC,WAAWC,oBAACC,UAAW,EAAA;AAAA,EACvBC,YAAYF,oBAACG,WAAY,EAAA;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AAC4B,MAAM;AAC/B,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,EAAAA,IACEC,WAAWC,yBAAyB;AAExClB,aAAWY,kBAAkB,WAAWX,oBAACkB,MAAO,CAAA,CAAA,IAAGnB;AAEnD,QAAMoB,yBAAyBA,MAAM;AAC/BL,QAAAA;AAAkD;EAAA;AAKxD,QAAMM,kBAAkBC,QACtB,MAAM,CAACR,UAAWA,UAAU,CAACS,MAAMC,QAAQR,UAAU,GACrD,CAACA,UAAU,CAAC;AAGPK,SAAAA,uCACJI,cAAY;AAAA,IACXlB,WAAWmB,KACTnB,WACAoB,gCAAgCC,MAChCpB,mCAASoB,MACT,CAACjB,UACCe,KAAKC,gCAAgCE,WAAWrB,mCAASqB,SAAS,CAAC;AAAA,IACrE,GACEnB;AAAAA,IAAMoB,UAAA,CAETnB,UAAUE,eAAeC,8BACvBiB,UAAQ;AAAA,MACPC,MAAI;AAAA,MACJC,SAAQ;AAAA,MACRC,SAASd;AAAAA,MAAuB,GAC5Bd;AAAAA,MAAewB,8BAElB1B,WAAS;AAAA,QAAC+B,UAAS;AAAA,MAAA,CAAI;AAAA,IAAA,CAAG,GAG9BxB,UACCV,oBAACmC,cAAY;AAAA,MAACH,SAASnB,SAAS,UAAU;AAAA,MAASgB,UAChDjB,eAAeC,SAASD,cAAcd;AAAAA,IAAAA,CAAK,GAG/CU,yBACCR,oBAACoC,sBAAoB;AAAA,MACnBL,MAAI;AAAA,MACJC,SAAQ;AAAA,MACRC,SAASzB;AAAAA,MACTD,SAAS;AAAA,QACPoB,MAAMjB,SAAS,KAAKgB,gCAAgCE;AAAAA,MACtD;AAAA,MAAE,GACExB;AAAAA,MAAmByB,UAEtBnB,SAASR,YAAYH;AAAAA,IAAAA,CAEzB,CAAA;AAAA,EAAA,CAAA,IAED;AACN;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
|
-
import verticalNavigationHeaderClasses from "./headerClasses.js";
|
|
3
2
|
import { forwardRef } from "react";
|
|
3
|
+
import verticalNavigationHeaderClasses from "./headerClasses.js";
|
|
4
4
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
5
5
|
import { HvButton } from "../../Button/Button.js";
|
|
6
6
|
const StyledHeader = /* @__PURE__ */ _styled("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -17,7 +17,7 @@ const StyledHeader = /* @__PURE__ */ _styled("div", process.env.NODE_ENV === "pr
|
|
|
17
17
|
justifyContent: "center",
|
|
18
18
|
paddingRight: 0
|
|
19
19
|
}
|
|
20
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
20
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvVmVydGljYWxOYXZpZ2F0aW9uL0hlYWRlci9IZWFkZXIuc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLNEIiLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvaHYtdWlraXQtcmVhY3QvaHYtdWlraXQtcmVhY3QvcGFja2FnZXMvY29yZS9zcmMvY29tcG9uZW50cy9WZXJ0aWNhbE5hdmlnYXRpb24vSGVhZGVyL0hlYWRlci5zdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBIdkJ1dHRvbiwgSHZCdXR0b25Qcm9wcyB9IGZyb20gXCJAY29yZS9jb21wb25lbnRzXCI7XG5pbXBvcnQgeyBmb3J3YXJkUmVmLCBSZWYgfSBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB2ZXJ0aWNhbE5hdmlnYXRpb25IZWFkZXJDbGFzc2VzIGZyb20gXCIuL2hlYWRlckNsYXNzZXNcIjtcblxuZXhwb3J0IGNvbnN0IFN0eWxlZEhlYWRlciA9IHN0eWxlZChcImRpdlwiKSh7XG4gIHdpZHRoOiBcIjEwMCVcIixcbiAgZGlzcGxheTogXCJmbGV4XCIsXG4gIG1hcmdpblRvcDogXCIxMnB4XCIsXG4gIGFsaWduSXRlbXM6IFwiY2VudGVyXCIsXG5cbiAgW2AmLiR7dmVydGljYWxOYXZpZ2F0aW9uSGVhZGVyQ2xhc3Nlcy5taW5pbWl6ZWR9YF06IHtcbiAgICBqdXN0aWZ5Q29udGVudDogXCJjZW50ZXJcIixcbiAgICBwYWRkaW5nUmlnaHQ6IDAsXG4gIH0sXG59KTtcblxuZXhwb3J0IGNvbnN0IFN0eWxlZENvbGxhcHNlQnV0dG9uID0gc3R5bGVkKFxuICBmb3J3YXJkUmVmKChwcm9wczogSHZCdXR0b25Qcm9wcywgcmVmPzogUmVmPEhUTUxCdXR0b25FbGVtZW50PikgPT4ge1xuICAgIHJldHVybiA8SHZCdXR0b24gey4uLnByb3BzfSByZWY9e3JlZn0gLz47XG4gIH0pXG4pKHtcbiAgbWFyZ2luTGVmdDogXCJhdXRvXCIsXG5cbiAgW2AmLiR7dmVydGljYWxOYXZpZ2F0aW9uSGVhZGVyQ2xhc3Nlcy5taW5pbWl6ZWR9YF06IHtcbiAgICBtYXJnaW5MZWZ0OiAwLFxuICB9LFxufSk7XG4iXX0= */");
|
|
21
21
|
const StyledCollapseButton = /* @__PURE__ */ _styled(forwardRef((props, ref) => {
|
|
22
22
|
return /* @__PURE__ */ jsx(HvButton, {
|
|
23
23
|
...props,
|
|
@@ -33,7 +33,7 @@ const StyledCollapseButton = /* @__PURE__ */ _styled(forwardRef((props, ref) =>
|
|
|
33
33
|
[`&.${verticalNavigationHeaderClasses.minimized}`]: {
|
|
34
34
|
marginLeft: 0
|
|
35
35
|
}
|
|
36
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
36
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYW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JlZigocHJvcHM6IEh2QnV0dG9uUHJvcHMsIHJlZj86IFJlZjxIVE1MQnV0dG9uRWxlbWVudD4pID0+IHtcbiAgICByZXR1cm4gPEh2QnV0dG9uIHsuLi5wcm9wc30gcmVmPXtyZWZ9IC8+O1xuICB9KVxuKSh7XG4gIG1hcmdpbkxlZnQ6IFwiYXV0b1wiLFxuXG4gIFtgJi4ke3ZlcnRpY2FsTmF2aWdhdGlvbkhlYWRlckNsYXNzZXMubWluaW1pemVkfWBdOiB7XG4gICAgbWFyZ2luTGVmdDogMCxcbiAgfSxcbn0pO1xuIl19 */");
|
|
37
37
|
export {
|
|
38
38
|
StyledCollapseButton,
|
|
39
39
|
StyledHeader
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.styles.js","sources":["../../../../../src/components/VerticalNavigation/Header/Header.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { HvButton, HvButtonProps } from \"@core/components\";\nimport
|
|
1
|
+
{"version":3,"file":"Header.styles.js","sources":["../../../../../src/components/VerticalNavigation/Header/Header.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { HvButton, HvButtonProps } from \"@core/components\";\nimport { forwardRef, Ref } from \"react\";\nimport verticalNavigationHeaderClasses from \"./headerClasses\";\n\nexport const StyledHeader = styled(\"div\")({\n width: \"100%\",\n display: \"flex\",\n marginTop: \"12px\",\n alignItems: \"center\",\n\n [`&.${verticalNavigationHeaderClasses.minimized}`]: {\n justifyContent: \"center\",\n paddingRight: 0,\n },\n});\n\nexport const StyledCollapseButton = styled(\n forwardRef((props: HvButtonProps, ref?: Ref<HTMLButtonElement>) => {\n return <HvButton {...props} ref={ref} />;\n })\n)({\n marginLeft: \"auto\",\n\n [`&.${verticalNavigationHeaderClasses.minimized}`]: {\n marginLeft: 0,\n },\n});\n"],"names":["StyledHeader","process","env","NODE_ENV","target","label","width","display","marginTop","alignItems","verticalNavigationHeaderClasses","minimized","justifyContent","paddingRight","StyledCollapseButton","_styled","forwardRef","props","ref","HvButton","marginLeft"],"mappings":";;;;;AAKO,MAAMA,eAAsB,wBAAA,OAAKC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAE;AAAA,EACxCC,OAAO;AAAA,EACPC,SAAS;AAAA,EACTC,WAAW;AAAA,EACXC,YAAY;AAAA,EAEZ,CAAE,KAAIC,gCAAgCC,WAAW,GAAG;AAAA,IAClDC,gBAAgB;AAAA,IAChBC,cAAc;AAAA,EAChB;AACF,GAACZ,QAAAC,IAAAC,aAAC,eAAA,KAAA,qgDAAA;AAEK,MAAMW,uBAAuBC,wBAClCC,WAAW,CAACC,OAAsBC,QAAiC;AACjE,6BAAQC,UAAQ;AAAA,IAAA,GAAKF;AAAAA,IAAOC;AAAAA,EAAAA,CAAY;AAC1C,CAAC,GAACjB,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EACF;AAAA,EACAe,YAAY;AAAA,EAEZ,CAAE,KAAIV,gCAAgCC,WAAW,GAAG;AAAA,IAClDS,YAAY;AAAA,EACd;AACF,GAACnB,QAAAC,IAAAC,aAAC,eAAA,KAAA,qgDAAA;"}
|