@orfium/ictinus 4.75.0 → 4.76.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/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +9 -22
- package/dist/components/Avatar/Avatar.style.js +3 -18
- package/dist/components/Avatar/AvatarStack/AvatarStack.d.ts +1 -1
- package/dist/components/Avatar/AvatarStack/AvatarStack.js +8 -24
- package/dist/components/Avatar/AvatarStack/AvatarStack.style.js +1 -12
- package/dist/components/Avatar/AvatarStack/index.js +0 -3
- package/dist/components/Avatar/AvatarStack/utils.js +1 -3
- package/dist/components/Avatar/index.js +0 -3
- package/dist/components/Avatar/utils.js +0 -5
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +5 -17
- package/dist/components/Breadcrumb/Breadcrumb.style.js +1 -9
- package/dist/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.js +2 -9
- package/dist/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.style.js +0 -5
- package/dist/components/Breadcrumb/Separator/Separator.js +1 -10
- package/dist/components/Breadcrumb/Separator/Separator.style.js +0 -4
- package/dist/components/Breadcrumb/index.js +0 -3
- package/dist/components/Button/Button.js +22 -37
- package/dist/components/Button/Button.style.js +3 -9
- package/dist/components/Button/ButtonLoader/ButtonLoader.js +5 -16
- package/dist/components/Button/ButtonLoader/ButtonLoader.style.js +0 -6
- package/dist/components/Button/ButtonLoader/index.js +0 -3
- package/dist/components/Button/index.js +0 -3
- package/dist/components/Button/utils.js +1 -15
- package/dist/components/ButtonBase/ButtonBase.d.ts +4 -4
- package/dist/components/ButtonBase/ButtonBase.js +31 -41
- package/dist/components/ButtonBase/ButtonBase.style.js +10 -28
- package/dist/components/ButtonBase/config.js +1 -1
- package/dist/components/ButtonBase/index.js +0 -3
- package/dist/components/ButtonBase/utils.js +6 -20
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Card/Card.js +4 -10
- package/dist/components/Card/Card.style.js +3 -10
- package/dist/components/Card/index.js +0 -3
- package/dist/components/Chart/BarChart/BarChart.js +10 -29
- package/dist/components/Chart/BarChart/components/CustomLabel/CustomLabel.js +6 -13
- package/dist/components/Chart/BarChart/components/CustomLabel/index.js +0 -3
- package/dist/components/Chart/BarChart/components/CustomTooltip/CustomTooltip.js +5 -15
- package/dist/components/Chart/BarChart/components/CustomTooltip/CustomTooltip.style.js +1 -12
- package/dist/components/Chart/BarChart/components/CustomTooltip/index.js +0 -3
- package/dist/components/Chart/BarChart/components/CustomTooltipContent/CustomTooltipContent.js +4 -11
- package/dist/components/Chart/BarChart/components/CustomTooltipContent/CustomTooltipContent.style.js +1 -10
- package/dist/components/Chart/BarChart/components/CustomTooltipContent/index.js +0 -3
- package/dist/components/Chart/BarChart/index.js +0 -3
- package/dist/components/Chart/BarChart/utils.js +4 -24
- package/dist/components/Chart/DonutChart/DonutChart.js +2 -13
- package/dist/components/Chart/DonutChart/components/CustomLabel/CustomLabel.js +4 -11
- package/dist/components/Chart/DonutChart/components/CustomLabel/CustomLabel.style.js +0 -8
- package/dist/components/Chart/DonutChart/components/CustomLabel/index.js +0 -3
- package/dist/components/Chart/DonutChart/index.js +0 -3
- package/dist/components/Chart/LineChart/LineChart.js +7 -22
- package/dist/components/Chart/LineChart/components/CustomTooltip/CustomTooltip.js +2 -8
- package/dist/components/Chart/LineChart/components/CustomTooltip/CustomTooltip.style.js +1 -10
- package/dist/components/Chart/LineChart/components/CustomTooltip/index.js +0 -3
- package/dist/components/Chart/LineChart/components/GradientLine/GradientLine.js +1 -7
- package/dist/components/Chart/LineChart/components/GradientLine/index.js +0 -3
- package/dist/components/Chart/LineChart/index.js +0 -3
- package/dist/components/Chart/LineChart/story.utils.js +0 -5
- package/dist/components/Chart/LineChart/utils.js +3 -9
- package/dist/components/Chart/Wrapper.js +2 -14
- package/dist/components/CheckBox/CheckBox.js +17 -39
- package/dist/components/CheckBox/CheckBox.style.js +4 -26
- package/dist/components/CheckBox/index.js +0 -3
- package/dist/components/Chip/Chip.js +13 -33
- package/dist/components/Chip/Chip.style.js +5 -15
- package/dist/components/Chip/Chip.types.js +1 -1
- package/dist/components/Chip/components/Badge/Badge.js +3 -10
- package/dist/components/Chip/components/Badge/Badge.style.js +2 -7
- package/dist/components/Chip/components/Badge/index.js +0 -3
- package/dist/components/Chip/index.js +0 -3
- package/dist/components/Chip/utils.js +5 -8
- package/dist/components/DatePicker/DatePickInput/DatePickInput.js +16 -37
- package/dist/components/DatePicker/DatePickInput/DatePickInput.style.js +0 -5
- package/dist/components/DatePicker/DatePickInput/index.js +0 -3
- package/dist/components/DatePicker/DatePicker.js +31 -63
- package/dist/components/DatePicker/DatePicker.style.js +0 -4
- package/dist/components/DatePicker/Day/Day.js +15 -32
- package/dist/components/DatePicker/Day/Day.style.js +11 -23
- package/dist/components/DatePicker/Day/index.js +0 -3
- package/dist/components/DatePicker/Month/Month.js +6 -26
- package/dist/components/DatePicker/Month/Month.style.js +1 -12
- package/dist/components/DatePicker/Month/Month.utils.js +1 -25
- package/dist/components/DatePicker/Month/index.js +0 -3
- package/dist/components/DatePicker/OverlayComponent/OverlayComponent.js +17 -33
- package/dist/components/DatePicker/OverlayComponent/OverlayComponent.style.js +1 -21
- package/dist/components/DatePicker/OverlayComponent/components/MonthWrapper/MonthWrapper.js +13 -32
- package/dist/components/DatePicker/OverlayComponent/components/MonthWrapper/MonthWrapper.style.js +2 -20
- package/dist/components/DatePicker/OverlayComponent/index.js +0 -3
- package/dist/components/DatePicker/index.js +0 -4
- package/dist/components/DatePicker/utils.js +0 -7
- package/dist/components/Drawer/Drawer.js +0 -9
- package/dist/components/Drawer/Drawer.style.js +0 -6
- package/dist/components/Drawer/Navigation/MenuItem/MenuItem.js +10 -26
- package/dist/components/Drawer/Navigation/Navigation.js +5 -20
- package/dist/components/Drawer/Navigation/Navigation.style.js +1 -34
- package/dist/components/Drawer/index.js +0 -3
- package/dist/components/ExpandCollapse/ExpandCollapse.js +15 -31
- package/dist/components/ExpandCollapse/ExpandCollapse.style.js +0 -5
- package/dist/components/ExpandCollapse/index.js +0 -3
- package/dist/components/ExpandCollapse/useManageContentRef.js +0 -13
- package/dist/components/ExpandCollapse/utils.js +2 -4
- package/dist/components/Filter/Filter.js +54 -90
- package/dist/components/Filter/Filter.style.js +15 -46
- package/dist/components/Filter/components/FilterBase/FilterBase.js +18 -36
- package/dist/components/Filter/components/FilterBase/index.js +0 -3
- package/dist/components/Filter/components/MultiFilter/MultiFilter.js +9 -23
- package/dist/components/Filter/components/MultiFilter/MultiFilter.style.js +1 -11
- package/dist/components/Filter/components/MultiFilter/index.js +0 -3
- package/dist/components/Filter/components/Options/Options.js +7 -16
- package/dist/components/Filter/components/Options/Options.style.js +0 -6
- package/dist/components/Filter/components/SingleFilter/SingleFilter.js +10 -19
- package/dist/components/Filter/components/SingleFilter/components/SearchInput/SearchInput.js +3 -16
- package/dist/components/Filter/components/SingleFilter/components/SearchInput/SearchInput.style.js +1 -9
- package/dist/components/Filter/components/SingleFilter/components/SearchInput/index.js +0 -3
- package/dist/components/Filter/components/SingleFilter/index.js +0 -3
- package/dist/components/Filter/hooks/useMultiFilterUtils.js +14 -32
- package/dist/components/Filter/index.js +0 -3
- package/dist/components/Filter/utils.d.ts +1 -1
- package/dist/components/Filter/utils.js +17 -39
- package/dist/components/Icon/Icon.js +8 -16
- package/dist/components/Icon/Icon.style.js +3 -9
- package/dist/components/Icon/assets/iconSelector.js +0 -347
- package/dist/components/Icon/index.js +0 -4
- package/dist/components/IconButton/IconButton.js +10 -24
- package/dist/components/IconButton/IconButton.style.js +0 -3
- package/dist/components/IconButton/index.js +0 -3
- package/dist/components/Label/Label.js +9 -17
- package/dist/components/Label/Label.style.js +1 -8
- package/dist/components/Label/index.js +0 -3
- package/dist/components/List/List.js +11 -24
- package/dist/components/List/List.style.js +4 -16
- package/dist/components/List/ListItem/ListItem.js +14 -23
- package/dist/components/List/ListItem/ListItem.style.js +5 -14
- package/dist/components/List/ListItem/index.js +0 -3
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.js +4 -11
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.style.js +2 -11
- package/dist/components/List/ListItemGroup/ListGroupTitle/index.js +0 -3
- package/dist/components/List/ListItemGroup/ListItemGroup.js +6 -17
- package/dist/components/List/ListItemGroup/index.js +0 -3
- package/dist/components/List/NormalList/NormalList.js +9 -20
- package/dist/components/List/NormalList/index.js +0 -3
- package/dist/components/List/VirtualizedList/VirtualizedList.js +12 -34
- package/dist/components/List/VirtualizedList/index.js +0 -3
- package/dist/components/List/index.js +0 -3
- package/dist/components/List/utils.d.ts +1 -1
- package/dist/components/List/utils.js +5 -24
- package/dist/components/Loader/Loader.js +3 -10
- package/dist/components/Loader/Loader.style.js +0 -5
- package/dist/components/Loader/Loader.utils.d.ts +2 -2
- package/dist/components/Loader/Loader.utils.js +1 -12
- package/dist/components/Loader/components/DotsLoader/DotsLoader.js +1 -8
- package/dist/components/Loader/components/DotsLoader/DotsLoader.style.js +1 -14
- package/dist/components/Loader/components/DotsLoader/index.js +0 -3
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.js +1 -8
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.style.js +1 -19
- package/dist/components/Loader/components/IndeterminateLoader/index.js +0 -3
- package/dist/components/Loader/components/Spinner/Spinner.js +1 -8
- package/dist/components/Loader/components/Spinner/Spinner.style.js +0 -7
- package/dist/components/Loader/components/Spinner/index.js +0 -3
- package/dist/components/Loader/index.js +0 -3
- package/dist/components/Menu/Menu.js +24 -46
- package/dist/components/Menu/Menu.style.js +4 -11
- package/dist/components/Menu/index.js +0 -3
- package/dist/components/Modal/Modal.d.ts +2 -3
- package/dist/components/Modal/Modal.js +11 -26
- package/dist/components/Modal/Modal.style.js +1 -14
- package/dist/components/Modal/ModalContent/ModalContent.js +7 -17
- package/dist/components/Modal/ModalContent/ModalContent.style.js +1 -18
- package/dist/components/Modal/ModalContent/index.js +0 -3
- package/dist/components/Modal/index.js +0 -3
- package/dist/components/MultiTextFieldBase/MultiTextFieldBase.js +42 -67
- package/dist/components/MultiTextFieldBase/MultiTextFieldBase.style.js +7 -34
- package/dist/components/MultiTextFieldBase/hooks.js +9 -30
- package/dist/components/MultiTextFieldBase/index.js +0 -3
- package/dist/components/Notification/Banner/Banner.js +12 -20
- package/dist/components/Notification/Banner/index.js +0 -3
- package/dist/components/Notification/InlineNotification/InlineNotification.js +11 -19
- package/dist/components/Notification/InlineNotification/index.js +0 -3
- package/dist/components/Notification/Notification.style.js +3 -22
- package/dist/components/Notification/NotificationVisual/NotificationVisual.js +8 -19
- package/dist/components/Notification/NotificationVisual/NotificationVisual.style.js +1 -9
- package/dist/components/Notification/NotificationVisual/index.js +0 -3
- package/dist/components/Notification/NotificationsContainer/NotificationsContainer.js +3 -12
- package/dist/components/Notification/NotificationsContainer/NotificationsContainer.style.js +0 -8
- package/dist/components/Notification/NotificationsContainer/index.js +0 -3
- package/dist/components/Notification/Snackbar/Snackbar.js +13 -29
- package/dist/components/Notification/Snackbar/Snackbar.style.js +1 -18
- package/dist/components/Notification/Snackbar/index.js +0 -3
- package/dist/components/Notification/subcomponents/CompactNotification/CompactNotification.js +14 -32
- package/dist/components/Notification/subcomponents/CompactNotification/CompactNotification.style.js +1 -23
- package/dist/components/Notification/subcomponents/CompactNotification/index.js +0 -3
- package/dist/components/Notification/subcomponents/NotificationActionsArea/NotificationActionsArea.js +5 -13
- package/dist/components/Notification/subcomponents/NotificationActionsArea/index.js +0 -3
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.js +7 -18
- package/dist/components/Overlay/Overlay.style.js +3 -33
- package/dist/components/Overlay/index.js +0 -3
- package/dist/components/Pagination/Pagination.js +19 -29
- package/dist/components/Pagination/index.js +0 -3
- package/dist/components/Radio/Radio.js +19 -38
- package/dist/components/Radio/Radio.style.js +3 -27
- package/dist/components/Radio/index.js +0 -3
- package/dist/components/RadioGroup/RadioGroup.js +7 -22
- package/dist/components/RadioGroup/RadioGroupContext.js +0 -4
- package/dist/components/RadioGroup/index.js +0 -3
- package/dist/components/RadioGroup/useRadioGroup.js +0 -6
- package/dist/components/SearchField/SearchField.js +12 -31
- package/dist/components/SearchField/SearchFieldShowcase.js +4 -15
- package/dist/components/SearchField/index.js +0 -3
- package/dist/components/Select/Select.js +63 -124
- package/dist/components/Select/Select.style.js +1 -10
- package/dist/components/Select/components/SelectMenu/SelectMenu.js +7 -23
- package/dist/components/Select/components/SelectMenu/SelectMenu.style.js +5 -15
- package/dist/components/Select/components/SelectMenu/index.js +0 -3
- package/dist/components/Select/hooks/useMultiselectUtils.js +18 -39
- package/dist/components/Select/index.js +0 -3
- package/dist/components/Slider/Slider.js +12 -42
- package/dist/components/Slider/Slider.style.js +4 -9
- package/dist/components/Slider/components/SliderMark/SliderMark.js +7 -19
- package/dist/components/Slider/components/SliderMark/SliderMark.style.js +3 -7
- package/dist/components/Slider/components/SliderMark/index.js +0 -3
- package/dist/components/Slider/components/SliderThumb/SliderThumb.js +5 -13
- package/dist/components/Slider/components/SliderThumb/SliderThumb.style.js +4 -10
- package/dist/components/Slider/components/SliderThumb/index.js +0 -3
- package/dist/components/Slider/components/SliderTrack/SliderTrack.d.ts +2 -3
- package/dist/components/Slider/components/SliderTrack/SliderTrack.js +8 -20
- package/dist/components/Slider/components/SliderTrack/SliderTrack.style.js +1 -5
- package/dist/components/Slider/components/SliderTrack/index.js +0 -3
- package/dist/components/Slider/index.js +0 -3
- package/dist/components/Switch/Switch.js +8 -20
- package/dist/components/Switch/Switch.style.js +9 -14
- package/dist/components/Switch/index.js +0 -3
- package/dist/components/Table/Table.d.ts +4 -4
- package/dist/components/Table/Table.js +40 -76
- package/dist/components/Table/Table.style.js +1 -14
- package/dist/components/Table/TableRowContext.js +0 -4
- package/dist/components/Table/components/ExtendedColumnItem/ExtendedColumnItem.js +10 -27
- package/dist/components/Table/components/ExtendedColumnItem/ExtendedColumnItem.style.js +0 -9
- package/dist/components/Table/components/ExtendedColumnItem/index.js +0 -3
- package/dist/components/Table/components/RenderRowOrNestedRow/RenderRowOrNestedRow.js +30 -59
- package/dist/components/Table/components/RenderRowOrNestedRow/RenderRowOrNestedRow.style.js +4 -13
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.js +12 -22
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.style.js +0 -4
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/index.js +0 -3
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ExpandedButtonCell/ExpandedButtonCell.js +6 -16
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ExpandedButtonCell/index.js +0 -3
- package/dist/components/Table/components/RenderRowOrNestedRow/index.js +0 -3
- package/dist/components/Table/components/TableCell/TableCell.d.ts +2 -2
- package/dist/components/Table/components/TableCell/TableCell.js +24 -36
- package/dist/components/Table/components/TableCell/TableCell.style.js +0 -8
- package/dist/components/Table/components/TableCell/index.js +0 -3
- package/dist/components/Table/components/TableCell/utils.js +0 -3
- package/dist/components/Table/components/TableRow/TableRow.d.ts +2 -2
- package/dist/components/Table/components/TableRow/TableRow.js +6 -18
- package/dist/components/Table/components/TableRow/index.js +0 -3
- package/dist/components/Table/components/TableRowWrapper/TableRowWrapper.js +14 -24
- package/dist/components/Table/components/TableRowWrapper/index.js +0 -3
- package/dist/components/Table/index.js +0 -3
- package/dist/components/Table/utils/index.js +0 -2
- package/dist/components/Table/utils/utils.js +1 -7
- package/dist/components/TextArea/TextArea.js +10 -27
- package/dist/components/TextArea/TextArea.style.js +0 -4
- package/dist/components/TextArea/index.js +0 -3
- package/dist/components/TextField/TextField.js +55 -85
- package/dist/components/TextField/TextField.style.js +1 -6
- package/dist/components/TextField/components/commons.d.ts +3 -2
- package/dist/components/TextField/components/commons.js +2 -8
- package/dist/components/TextField/hooks/useMultiTextFieldUtils.js +14 -31
- package/dist/components/TextField/index.js +0 -3
- package/dist/components/TextInputBase/TextInputBase.d.ts +6 -6
- package/dist/components/TextInputBase/TextInputBase.js +21 -31
- package/dist/components/TextInputBase/TextInputBase.style.js +21 -43
- package/dist/components/TextInputBase/config.js +1 -1
- package/dist/components/TextInputBase/index.js +0 -4
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +2 -3
- package/dist/components/ThemeProvider/ThemeProvider.js +6 -24
- package/dist/components/ThemeProvider/ThemeProvider.style.js +1 -9
- package/dist/components/ThemeProvider/index.js +0 -3
- package/dist/components/Toast/Toast.d.ts +2 -3
- package/dist/components/Toast/Toast.js +16 -33
- package/dist/components/Toast/Toast.style.js +1 -28
- package/dist/components/Toast/index.js +0 -3
- package/dist/components/Tooltip/Tooltip.js +11 -18
- package/dist/components/Tooltip/Tooltip.style.js +1 -10
- package/dist/components/Tooltip/index.js +0 -3
- package/dist/components/TopAppBar/TopAppBar.js +14 -24
- package/dist/components/TopAppBar/TopAppBar.style.js +0 -13
- package/dist/components/TopAppBar/TopAppBar.types.d.ts +2 -2
- package/dist/components/TopAppBar/components/Logo/Logo.style.js +1 -8
- package/dist/components/TopAppBar/components/Logo/Logo.wrapper.d.ts +2 -2
- package/dist/components/TopAppBar/components/Logo/Logo.wrapper.js +0 -7
- package/dist/components/TopAppBar/components/Logo/index.js +0 -3
- package/dist/components/TopAppBar/components/Search/Search.js +9 -18
- package/dist/components/TopAppBar/components/Search/Search.style.js +1 -13
- package/dist/components/TopAppBar/components/Search/index.js +0 -3
- package/dist/components/TopAppBar/components/SidebarMenuIcon/SidebarMenuIcon.js +0 -7
- package/dist/components/TopAppBar/components/SidebarMenuIcon/SidebarMenuIcon.style.js +0 -4
- package/dist/components/TopAppBar/components/SidebarMenuIcon/index.js +0 -3
- package/dist/components/TopAppBar/components/UserMenu/UserMenu.js +5 -12
- package/dist/components/TopAppBar/components/UserMenu/UserMenu.style.js +0 -4
- package/dist/components/TopAppBar/components/UserMenu/index.js +0 -3
- package/dist/components/TopAppBar/components/index.js +0 -7
- package/dist/components/TopAppBar/index.js +0 -3
- package/dist/components/TruncatedContent/TruncatedContent.d.ts +2 -2
- package/dist/components/TruncatedContent/TruncatedContent.js +7 -20
- package/dist/components/TruncatedContent/TruncatedContent.style.js +1 -5
- package/dist/components/TruncatedContent/index.js +0 -3
- package/dist/components/storyUtils/Stack/Stack.d.ts +2 -2
- package/dist/components/utils/ClickAwayListener/ClickAwayListener.d.ts +2 -2
- package/dist/components/utils/ClickAwayListener/ClickAwayListener.js +6 -17
- package/dist/components/utils/ClickAwayListener/index.js +0 -3
- package/dist/components/utils/DropdownOptions/index.js +0 -5
- package/dist/components/utils/PositionInScreen/PositionInScreen.d.ts +3 -2
- package/dist/components/utils/PositionInScreen/PositionInScreen.js +13 -24
- package/dist/components/utils/PositionInScreen/PositionInScreen.style.js +1 -10
- package/dist/components/utils/PositionInScreen/hooks.js +39 -60
- package/dist/components/utils/PositionInScreen/index.js +0 -3
- package/dist/components/utils/PositionInScreen/utils.js +1 -6
- package/dist/components/utils/handleSearch.js +7 -13
- package/dist/hooks/index.js +0 -3
- package/dist/hooks/useBreakpoints.js +1 -7
- package/dist/hooks/useCheck.d.ts +1 -1
- package/dist/hooks/useCheck.js +4 -9
- package/dist/hooks/useCombinedRefs.js +0 -7
- package/dist/hooks/useEscape.js +0 -4
- package/dist/hooks/useLoading.js +2 -7
- package/dist/hooks/useLocationToGetCurrentMenuItem.js +4 -10
- package/dist/hooks/usePagination.js +6 -17
- package/dist/hooks/useSearchQueryParams.js +1 -6
- package/dist/hooks/useTheme.js +0 -3
- package/dist/hooks/useThemeSwitch.d.ts +2 -2
- package/dist/hooks/useThemeSwitch.js +4 -15
- package/dist/hooks/useToggle.js +2 -9
- package/dist/hooks/useTypeColorToColorMatch.d.ts +4 -4
- package/dist/hooks/useTypeColorToColorMatch.js +6 -21
- package/dist/index.js +1 -108
- package/dist/test/index.js +0 -2
- package/dist/test/setup.js +2 -5
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.js +15 -39
- package/dist/theme/functions.js +5 -15
- package/dist/theme/index.js +0 -12
- package/dist/theme/palette.config.js +2 -4
- package/dist/theme/palette.js +12 -24
- package/dist/theme/spacing.js +1 -3
- package/dist/theme/states/disabled.js +1 -4
- package/dist/theme/states/focus.js +3 -7
- package/dist/theme/states/hover.js +2 -10
- package/dist/theme/states/index.js +0 -8
- package/dist/theme/states/pressed.js +2 -10
- package/dist/theme/states/statesConfig.js +1 -1
- package/dist/theme/states/utils.js +4 -9
- package/dist/theme/typography.js +0 -2
- package/dist/theme/utils.js +2 -23
- package/dist/utils/common.js +6 -3
- package/dist/utils/errors.js +4 -21
- package/dist/utils/helpers.d.ts +2 -2
- package/dist/utils/helpers.js +10 -26
- package/dist/utils/initLocaleFormat.js +1 -10
- package/dist/utils/size-utils.js +2 -20
- package/dist/utils/storyshots.js +4 -8
- package/dist/utils/themeFunctions.js +3 -25
- package/dist/utils/types.d.ts +2 -0
- package/package.json +16 -15
|
@@ -2,33 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.useWrapperWidth = exports.usePositionInScreen = void 0;
|
|
5
|
-
|
|
6
5
|
var _head = _interopRequireDefault(require("lodash/head"));
|
|
7
|
-
|
|
8
6
|
var _react = require("react");
|
|
9
|
-
|
|
10
7
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
9
|
var useHeights = function useHeights(parentRef, itemRef) {
|
|
15
10
|
var _itemRef$current2;
|
|
16
|
-
|
|
17
11
|
var _useState = (0, _react.useState)(0),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
parentHeight = _useState[0],
|
|
13
|
+
setParentHeight = _useState[1];
|
|
21
14
|
var _useState2 = (0, _react.useState)(0),
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
childHeight = _useState2[0],
|
|
16
|
+
setChildHeight = _useState2[1];
|
|
17
|
+
|
|
24
18
|
/**
|
|
25
19
|
* We use this ResizeObserver in order to track any changes on the parent's height:
|
|
26
20
|
* This is necessary for the case of the MultiSelect, where the height of the TextField is dynamic
|
|
27
21
|
* and will increase/decrease as more Chips (Selected Options) are added/deleted.
|
|
28
22
|
* Therefore the parentHeight is stored on the useState above.
|
|
29
23
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
24
|
(0, _react.useEffect)(function () {
|
|
33
25
|
if (!parentRef.current) return;
|
|
34
26
|
var parentResizeObserver = (0, _utils.resizeObserverHandler)(setParentHeight);
|
|
@@ -37,15 +29,14 @@ var useHeights = function useHeights(parentRef, itemRef) {
|
|
|
37
29
|
return parentResizeObserver.disconnect();
|
|
38
30
|
};
|
|
39
31
|
}, [parentRef]);
|
|
32
|
+
|
|
40
33
|
/**
|
|
41
34
|
* Same here to track the child's height:
|
|
42
35
|
* This is necessary for the case where the SelectMenu is rendered above the TextField, we need to track the
|
|
43
36
|
* dynamic height of the SelectMenu in order to keep the gap between SelectMenu and TextField fixed.
|
|
44
37
|
*/
|
|
45
|
-
|
|
46
38
|
(0, _react.useEffect)(function () {
|
|
47
39
|
var _itemRef$current;
|
|
48
|
-
|
|
49
40
|
var dropdownElement = (0, _head["default"])((_itemRef$current = itemRef.current) == null ? void 0 : _itemRef$current.children);
|
|
50
41
|
if (!dropdownElement) return;
|
|
51
42
|
var childResizeObserver = (0, _utils.resizeObserverHandler)(setChildHeight);
|
|
@@ -59,51 +50,46 @@ var useHeights = function useHeights(parentRef, itemRef) {
|
|
|
59
50
|
childHeight: childHeight
|
|
60
51
|
};
|
|
61
52
|
};
|
|
62
|
-
|
|
63
53
|
var usePositionInScreen = function usePositionInScreen(parentRef, itemRef, offsetX, offsetY, visible) {
|
|
64
54
|
var _useState3 = (0, _react.useState)({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
x: -1,
|
|
56
|
+
y: -1
|
|
57
|
+
}),
|
|
58
|
+
position = _useState3[0],
|
|
59
|
+
setPosition = _useState3[1];
|
|
71
60
|
var _useHeights = useHeights(parentRef, itemRef),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
parentHeight = _useHeights.parentHeight,
|
|
62
|
+
childHeight = _useHeights.childHeight;
|
|
75
63
|
(0, _react.useEffect)(function () {
|
|
76
|
-
var _parentRef$current, _itemRef$current3
|
|
77
|
-
|
|
64
|
+
var _parentRef$current, _itemRef$current3;
|
|
78
65
|
// x,y are cordinates in screen
|
|
79
66
|
// width is wrapper elements dimensions
|
|
80
|
-
var _ref = parentRef != null && parentRef.current ? parentRef == null
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var _ref2 = itemRef != null && itemRef.current ? itemRef == null
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var itemYOutOfScreenHeight = parentY + parentHeight + childHeight > window.innerHeight;
|
|
67
|
+
var _ref = parentRef != null && parentRef.current ? parentRef == null || (_parentRef$current = parentRef.current) == null ? void 0 : _parentRef$current.getBoundingClientRect() : {
|
|
68
|
+
x: 0,
|
|
69
|
+
y: 0,
|
|
70
|
+
width: 0
|
|
71
|
+
},
|
|
72
|
+
parentX = _ref.x,
|
|
73
|
+
parentY = _ref.y,
|
|
74
|
+
parentWidth = _ref.width;
|
|
75
|
+
|
|
76
|
+
// width is the element's that's going to be positioned dimensions
|
|
77
|
+
var _ref2 = itemRef != null && itemRef.current ? itemRef == null || (_itemRef$current3 = itemRef.current) == null || (_itemRef$current3 = _itemRef$current3.children[0]) == null ? void 0 : _itemRef$current3.getBoundingClientRect() : {
|
|
78
|
+
width: 0
|
|
79
|
+
},
|
|
80
|
+
width = _ref2.width;
|
|
81
|
+
|
|
82
|
+
// If the item-to-be-positioned is out of screen height
|
|
83
|
+
var itemYOutOfScreenHeight = parentY + parentHeight + childHeight > window.innerHeight;
|
|
84
|
+
|
|
85
|
+
// The element that we are positioning is absolutely positioned inside the relative
|
|
97
86
|
// container. So x,y are zero means the element will be positioned exactly on top
|
|
98
87
|
// of the parent element.
|
|
99
|
-
|
|
100
88
|
var x = 0;
|
|
101
89
|
var y = 0;
|
|
102
|
-
|
|
103
90
|
if (itemYOutOfScreenHeight) {
|
|
104
91
|
// We place the element height+offsetY (px) above the parent
|
|
105
92
|
y = y - childHeight - offsetY;
|
|
106
|
-
|
|
107
93
|
if (parentY + y < 0) {
|
|
108
94
|
// Rare case where client height is super small. We don't exactly support this.
|
|
109
95
|
// So we render it as if it was inside the screen height
|
|
@@ -112,11 +98,10 @@ var usePositionInScreen = function usePositionInScreen(parentRef, itemRef, offse
|
|
|
112
98
|
} else {
|
|
113
99
|
// We place the element offsetY (px) under the parent
|
|
114
100
|
y = parentHeight + offsetY;
|
|
115
|
-
}
|
|
116
|
-
|
|
101
|
+
}
|
|
117
102
|
|
|
103
|
+
// If the item-to-be-positioned is out of screen width
|
|
118
104
|
var itemXOutOfScreenWidth = parentX + width > window.innerWidth;
|
|
119
|
-
|
|
120
105
|
if (itemXOutOfScreenWidth) {
|
|
121
106
|
// We place the element parentWidth-width-offsetX (px) at the left of the parent
|
|
122
107
|
x = x + parentWidth - width - offsetX;
|
|
@@ -124,7 +109,6 @@ var usePositionInScreen = function usePositionInScreen(parentRef, itemRef, offse
|
|
|
124
109
|
// We place the element offset (px) at the right of the parent
|
|
125
110
|
x = offsetX;
|
|
126
111
|
}
|
|
127
|
-
|
|
128
112
|
setPosition({
|
|
129
113
|
x: x,
|
|
130
114
|
y: y
|
|
@@ -132,22 +116,17 @@ var usePositionInScreen = function usePositionInScreen(parentRef, itemRef, offse
|
|
|
132
116
|
}, [parentRef, itemRef, visible, offsetY, offsetX, parentHeight, childHeight]);
|
|
133
117
|
return position;
|
|
134
118
|
};
|
|
135
|
-
|
|
136
119
|
exports.usePositionInScreen = usePositionInScreen;
|
|
137
|
-
|
|
138
120
|
var useWrapperWidth = function useWrapperWidth(hasWrapperWidth, wrapperRef) {
|
|
139
121
|
var _useState4 = (0, _react.useState)(),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
122
|
+
width = _useState4[0],
|
|
123
|
+
setWidth = _useState4[1];
|
|
143
124
|
(0, _react.useEffect)(function () {
|
|
144
125
|
if (hasWrapperWidth) {
|
|
145
|
-
var _wrapperRef$current
|
|
146
|
-
|
|
147
|
-
setWidth(wrapperRef == null ? void 0 : (_wrapperRef$current = wrapperRef.current) == null ? void 0 : (_wrapperRef$current$g = _wrapperRef$current.getBoundingClientRect()) == null ? void 0 : _wrapperRef$current$g.width);
|
|
126
|
+
var _wrapperRef$current;
|
|
127
|
+
setWidth(wrapperRef == null || (_wrapperRef$current = wrapperRef.current) == null || (_wrapperRef$current = _wrapperRef$current.getBoundingClientRect()) == null ? void 0 : _wrapperRef$current.width);
|
|
148
128
|
}
|
|
149
129
|
}, [hasWrapperWidth, wrapperRef]);
|
|
150
130
|
return [width];
|
|
151
131
|
};
|
|
152
|
-
|
|
153
132
|
exports.useWrapperWidth = useWrapperWidth;
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _PositionInScreen = _interopRequireDefault(require("./PositionInScreen"));
|
|
7
|
-
|
|
8
6
|
exports["default"] = _PositionInScreen["default"];
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.resizeObserverHandler = void 0;
|
|
5
|
-
|
|
6
5
|
var _head = _interopRequireDefault(require("lodash/head"));
|
|
7
|
-
|
|
8
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
-
|
|
10
7
|
var resizeObserverHandler = function resizeObserverHandler(callback) {
|
|
11
8
|
return new ResizeObserver(function (entries) {
|
|
12
9
|
var parent = (0, _head["default"])(entries);
|
|
10
|
+
|
|
13
11
|
/** If the event is triggered by the element itself then return
|
|
14
12
|
* to avoid an infinite loop
|
|
15
13
|
*/
|
|
16
|
-
|
|
17
14
|
if ((parent == null ? void 0 : parent.target) === (parent == null ? void 0 : parent.contentRect)) {
|
|
18
15
|
return;
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
if (parent) {
|
|
22
18
|
callback(parent.contentRect.height);
|
|
23
19
|
}
|
|
24
20
|
});
|
|
25
21
|
};
|
|
26
|
-
|
|
27
22
|
exports.resizeObserverHandler = resizeObserverHandler;
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports["default"] =
|
|
5
|
-
|
|
4
|
+
exports.handleSearch = exports["default"] = void 0;
|
|
6
5
|
var handleSearch = function handleSearch(_ref) {
|
|
7
6
|
var event = _ref.event,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
isSearchable = _ref.isSearchable,
|
|
8
|
+
setSearchValue = _ref.setSearchValue,
|
|
9
|
+
isAsync = _ref.isAsync,
|
|
10
|
+
onChange = _ref.onChange,
|
|
11
|
+
_ref$minCharactersToS = _ref.minCharactersToSearch,
|
|
12
|
+
minCharactersToSearch = _ref$minCharactersToS === void 0 ? 0 : _ref$minCharactersToS;
|
|
14
13
|
var value = event.target.value;
|
|
15
|
-
|
|
16
14
|
if (isSearchable) {
|
|
17
15
|
setSearchValue(value);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
if (isAsync) {
|
|
21
18
|
event.persist();
|
|
22
|
-
|
|
23
19
|
if (minCharactersToSearch && value.length && value.length < minCharactersToSearch) {
|
|
24
20
|
return;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
onChange(value.trim());
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
|
-
|
|
31
25
|
exports.handleSearch = handleSearch;
|
|
32
26
|
var _default = handleSearch;
|
|
33
27
|
exports["default"] = _default;
|
package/dist/hooks/index.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.useSearchQueryParams = void 0;
|
|
5
|
-
|
|
6
5
|
var _useSearchQueryParams = _interopRequireDefault(require("./useSearchQueryParams"));
|
|
7
|
-
|
|
8
6
|
exports.useSearchQueryParams = _useSearchQueryParams["default"];
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports
|
|
5
|
-
|
|
4
|
+
exports.queriesSizes = exports.queriesKeys = exports["default"] = void 0;
|
|
6
5
|
var _toPairs = _interopRequireDefault(require("lodash/toPairs"));
|
|
7
|
-
|
|
8
6
|
var _reactMedia = require("react-media");
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
var queriesKeys = ['des1920', 'des1440', 'des1366', 'des1200', 'tab1024', 'tab970', 'tab750', 'mob480', 'mob320'];
|
|
13
9
|
exports.queriesKeys = queriesKeys;
|
|
14
10
|
var queriesSizes = {
|
|
@@ -27,12 +23,10 @@ var queries = (0, _toPairs["default"])(queriesSizes).reduce(function (acc, size)
|
|
|
27
23
|
acc[size[0]] = "(min-width: " + size[1] + "px)";
|
|
28
24
|
return acc;
|
|
29
25
|
}, {});
|
|
30
|
-
|
|
31
26
|
var useBreakpoints = function useBreakpoints() {
|
|
32
27
|
return (0, _reactMedia.useMedia)({
|
|
33
28
|
queries: queries
|
|
34
29
|
});
|
|
35
30
|
};
|
|
36
|
-
|
|
37
31
|
var _default = useBreakpoints;
|
|
38
32
|
exports["default"] = _default;
|
package/dist/hooks/useCheck.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { ChangeEvent } from 'react';
|
|
|
2
2
|
export declare type OnCheckHandler = (val: boolean, e?: ChangeEvent) => void;
|
|
3
3
|
export declare const useCheck: (isChecked: boolean, onCheck?: OnCheckHandler | undefined) => {
|
|
4
4
|
checked: boolean;
|
|
5
|
-
handleCheck: (checkedCheckbox:
|
|
5
|
+
handleCheck: (checkedCheckbox: boolean, e: ChangeEvent) => void;
|
|
6
6
|
};
|
package/dist/hooks/useCheck.js
CHANGED
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.useCheck = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
var useCheck = function useCheck(isChecked, onCheck) {
|
|
9
7
|
var _useState = (0, _react.useState)(function () {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
return isChecked;
|
|
9
|
+
}),
|
|
10
|
+
checked = _useState[0],
|
|
11
|
+
setIsChecked = _useState[1];
|
|
15
12
|
(0, _react.useEffect)(function () {
|
|
16
13
|
setIsChecked(isChecked);
|
|
17
14
|
}, [isChecked]);
|
|
@@ -19,7 +16,6 @@ var useCheck = function useCheck(isChecked, onCheck) {
|
|
|
19
16
|
if (onCheck) {
|
|
20
17
|
onCheck(checkedCheckbox, e);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
setIsChecked(checkedCheckbox);
|
|
24
20
|
}, [onCheck, setIsChecked]);
|
|
25
21
|
return {
|
|
@@ -27,5 +23,4 @@ var useCheck = function useCheck(isChecked, onCheck) {
|
|
|
27
23
|
handleCheck: handleCheck
|
|
28
24
|
};
|
|
29
25
|
};
|
|
30
|
-
|
|
31
26
|
exports.useCheck = useCheck;
|
|
@@ -2,25 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var React = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
6
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
|
|
10
7
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
|
|
12
8
|
var useCombinedRefs = function useCombinedRefs() {
|
|
13
9
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
10
|
refs[_key] = arguments[_key];
|
|
15
11
|
}
|
|
16
|
-
|
|
17
12
|
var targetRef = React.useRef(null);
|
|
18
13
|
React.useEffect(function () {
|
|
19
14
|
refs.forEach(function (ref) {
|
|
20
15
|
if (!ref) {
|
|
21
16
|
return;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
if (typeof ref === 'function') {
|
|
25
19
|
ref(targetRef.current);
|
|
26
20
|
} else if (ref && typeof ref === 'object') {
|
|
@@ -30,6 +24,5 @@ var useCombinedRefs = function useCombinedRefs() {
|
|
|
30
24
|
}, [refs]);
|
|
31
25
|
return targetRef;
|
|
32
26
|
};
|
|
33
|
-
|
|
34
27
|
var _default = useCombinedRefs;
|
|
35
28
|
exports["default"] = _default;
|
package/dist/hooks/useEscape.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
var useEscape = function useEscape(onEscape) {
|
|
9
7
|
(0, _react.useEffect)(function () {
|
|
10
8
|
var handleEsc = function handleEsc(event) {
|
|
@@ -12,13 +10,11 @@ var useEscape = function useEscape(onEscape) {
|
|
|
12
10
|
onEscape();
|
|
13
11
|
}
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
window.addEventListener('keydown', handleEsc);
|
|
17
14
|
return function () {
|
|
18
15
|
window.removeEventListener('keydown', handleEsc);
|
|
19
16
|
};
|
|
20
17
|
}, [onEscape]);
|
|
21
18
|
};
|
|
22
|
-
|
|
23
19
|
var _default = useEscape;
|
|
24
20
|
exports["default"] = _default;
|
package/dist/hooks/useLoading.js
CHANGED
|
@@ -2,18 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.useLoading = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
var useLoading = function useLoading(clickHandler, defaultState) {
|
|
9
7
|
if (defaultState === void 0) {
|
|
10
8
|
defaultState = false;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
var _useState = (0, _react.useState)(defaultState),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
loading = _useState[0],
|
|
12
|
+
setLoading = _useState[1];
|
|
17
13
|
var updateLoadingState = (0, _react.useCallback)(function (isLoading) {
|
|
18
14
|
setLoading(isLoading);
|
|
19
15
|
}, [setLoading]);
|
|
@@ -27,5 +23,4 @@ var useLoading = function useLoading(clickHandler, defaultState) {
|
|
|
27
23
|
handleAsyncOperation: handleAsyncOperation
|
|
28
24
|
};
|
|
29
25
|
};
|
|
30
|
-
|
|
31
26
|
exports.useLoading = useLoading;
|
|
@@ -2,27 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
|
|
10
7
|
var useLocationToGetCurrentMenuItem = function useLocationToGetCurrentMenuItem(menuItems, setOpenMenuItems) {
|
|
11
8
|
var location = (0, _reactRouterDom.useLocation)();
|
|
12
|
-
|
|
13
9
|
var _useState = (0, _react.useState)(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// we get that information from the current URL and then comparing it with the urls of each menuItem
|
|
17
|
-
|
|
10
|
+
currentMenuItem = _useState[0],
|
|
11
|
+
setCurrentMenuItem = _useState[1];
|
|
18
12
|
|
|
13
|
+
// we need to show an indication on the currently selected option
|
|
14
|
+
// we get that information from the current URL and then comparing it with the urls of each menuItem
|
|
19
15
|
(0, _react.useLayoutEffect)(function () {
|
|
20
16
|
menuItems.forEach(function (menuItem) {
|
|
21
17
|
var menuItemUrls = menuItem.options.map(function (subMenuItem) {
|
|
22
18
|
return subMenuItem.url;
|
|
23
19
|
});
|
|
24
20
|
var urlFound = menuItemUrls.includes(location.pathname) || menuItem.url === location.pathname;
|
|
25
|
-
|
|
26
21
|
if (urlFound) {
|
|
27
22
|
setCurrentMenuItem(menuItem.url);
|
|
28
23
|
setOpenMenuItems([menuItem.url]); // expand the current menu item
|
|
@@ -31,6 +26,5 @@ var useLocationToGetCurrentMenuItem = function useLocationToGetCurrentMenuItem(m
|
|
|
31
26
|
}, [location.pathname, menuItems, setOpenMenuItems]);
|
|
32
27
|
return [currentMenuItem];
|
|
33
28
|
};
|
|
34
|
-
|
|
35
29
|
var _default = useLocationToGetCurrentMenuItem;
|
|
36
30
|
exports["default"] = _default;
|
|
@@ -2,24 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var React = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
6
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
|
|
10
7
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
|
|
12
8
|
var usePagination = function usePagination(_ref) {
|
|
13
9
|
var _ref$page = _ref.page,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
page = _ref$page === void 0 ? 1 : _ref$page,
|
|
11
|
+
_ref$count = _ref.count,
|
|
12
|
+
count = _ref$count === void 0 ? 1 : _ref$count,
|
|
13
|
+
handleChange = _ref.onChange;
|
|
19
14
|
var _React$useState = React.useState(page),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
currentPage = _React$useState[0],
|
|
16
|
+
setCurrentPage = _React$useState[1];
|
|
23
17
|
var nextPage = currentPage + 1;
|
|
24
18
|
var prevPage = currentPage - 1;
|
|
25
19
|
var hasNextPage = nextPage <= count;
|
|
@@ -38,21 +32,17 @@ var usePagination = function usePagination(_ref) {
|
|
|
38
32
|
}, [handleChange, count]);
|
|
39
33
|
var navigateToNextPage = React.useCallback(function () {
|
|
40
34
|
var nextPage = currentPage;
|
|
41
|
-
|
|
42
35
|
if (nextPage + 1 <= count) {
|
|
43
36
|
nextPage += 1;
|
|
44
37
|
}
|
|
45
|
-
|
|
46
38
|
setCurrentPage(nextPage);
|
|
47
39
|
handleChange(nextPage);
|
|
48
40
|
}, [handleChange, count, currentPage]);
|
|
49
41
|
var navigateToPrevPage = React.useCallback(function () {
|
|
50
42
|
var prevPage = currentPage;
|
|
51
|
-
|
|
52
43
|
if (prevPage - 1 >= 1) {
|
|
53
44
|
prevPage -= 1;
|
|
54
45
|
}
|
|
55
|
-
|
|
56
46
|
setCurrentPage(prevPage);
|
|
57
47
|
handleChange(prevPage);
|
|
58
48
|
}, [handleChange, currentPage]);
|
|
@@ -66,6 +56,5 @@ var usePagination = function usePagination(_ref) {
|
|
|
66
56
|
navigateToPrevPage: navigateToPrevPage
|
|
67
57
|
};
|
|
68
58
|
};
|
|
69
|
-
|
|
70
59
|
var _default = usePagination;
|
|
71
60
|
exports["default"] = _default;
|
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
|
|
10
7
|
var useSearchQueryParams = function useSearchQueryParams() {
|
|
11
8
|
var _useLocation = (0, _reactRouterDom.useLocation)(),
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
search = _useLocation.search;
|
|
14
10
|
var urlSearchParams = (0, _react.useMemo)(function () {
|
|
15
11
|
return new URLSearchParams(search);
|
|
16
12
|
}, [search]);
|
|
@@ -20,6 +16,5 @@ var useSearchQueryParams = function useSearchQueryParams() {
|
|
|
20
16
|
});
|
|
21
17
|
return result;
|
|
22
18
|
};
|
|
23
|
-
|
|
24
19
|
var _default = useSearchQueryParams;
|
|
25
20
|
exports["default"] = _default;
|
package/dist/hooks/useTheme.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactFCC } from 'utils/types';
|
|
2
2
|
declare const useThemeSwitch: () => {
|
|
3
3
|
dark: boolean;
|
|
4
4
|
toggle: () => void;
|
|
5
5
|
};
|
|
6
|
-
declare const ThemeSwitchProvider:
|
|
6
|
+
declare const ThemeSwitchProvider: ReactFCC<{
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
}>;
|
|
9
9
|
export { ThemeSwitchProvider, useThemeSwitch };
|
|
@@ -2,36 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.useThemeSwitch = exports.ThemeSwitchProvider = void 0;
|
|
5
|
-
|
|
6
5
|
var React = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
6
|
var _react2 = require("@emotion/react");
|
|
9
|
-
|
|
10
7
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
|
|
12
8
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
14
9
|
var defaultContextData = {
|
|
15
10
|
dark: false,
|
|
16
11
|
toggle: function toggle() {}
|
|
17
12
|
};
|
|
18
13
|
var ThemeContext = /*#__PURE__*/React.createContext(defaultContextData);
|
|
19
|
-
|
|
20
14
|
var useThemeSwitch = function useThemeSwitch() {
|
|
21
15
|
return React.useContext(ThemeContext);
|
|
22
16
|
};
|
|
23
|
-
|
|
24
17
|
exports.useThemeSwitch = useThemeSwitch;
|
|
25
|
-
|
|
26
18
|
var ThemeSwitchProvider = function ThemeSwitchProvider(_ref) {
|
|
27
19
|
var children = _ref.children;
|
|
28
|
-
|
|
29
20
|
var _React$useState = React.useState({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
dark: false
|
|
22
|
+
}),
|
|
23
|
+
themeState = _React$useState[0],
|
|
24
|
+
setThemeState = _React$useState[1];
|
|
35
25
|
return (0, _react2.jsx)(ThemeContext.Provider, {
|
|
36
26
|
value: {
|
|
37
27
|
dark: themeState.dark,
|
|
@@ -45,5 +35,4 @@ var ThemeSwitchProvider = function ThemeSwitchProvider(_ref) {
|
|
|
45
35
|
}
|
|
46
36
|
}, children);
|
|
47
37
|
};
|
|
48
|
-
|
|
49
38
|
exports.ThemeSwitchProvider = ThemeSwitchProvider;
|
package/dist/hooks/useToggle.js
CHANGED
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var React = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
6
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
|
|
10
7
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
|
|
12
8
|
var useToggle = function useToggle(initialState) {
|
|
13
9
|
if (initialState === void 0) {
|
|
14
10
|
initialState = false;
|
|
15
11
|
}
|
|
16
|
-
|
|
17
12
|
var _React$useState = React.useState(initialState),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
state = _React$useState[0],
|
|
14
|
+
setState = _React$useState[1];
|
|
21
15
|
var toggle = React.useCallback(function () {
|
|
22
16
|
return setState(function (state) {
|
|
23
17
|
return !state;
|
|
@@ -25,6 +19,5 @@ var useToggle = function useToggle(initialState) {
|
|
|
25
19
|
}, []);
|
|
26
20
|
return [state, toggle];
|
|
27
21
|
};
|
|
28
|
-
|
|
29
22
|
var _default = useToggle;
|
|
30
23
|
exports["default"] = _default;
|