@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
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
|
-
|
|
4
|
+
exports.palePaletteConfig = exports.lightPaletteConfig = exports.flatPaletteConfig = exports.darkPaletteConfig = void 0;
|
|
5
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
8
6
|
var flatPaletteConfig = {
|
|
9
7
|
greyScale: '#808080',
|
|
10
8
|
darkGrey: '#32324E',
|
package/dist/theme/palette.js
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
|
|
4
|
+
exports.paleColors = exports.neutralColors = exports.mainTypes = exports.getColor = exports.getAAColorFromSwatches = exports.getAAColor = exports.flatColors = exports.colorShades = exports.colorSchemes = exports.MIN_SHADE = exports.MAX_SHADE = exports.BASE_SHADE = void 0;
|
|
6
5
|
var _polished = require("polished");
|
|
7
|
-
|
|
8
6
|
var _helpers = require("../utils/helpers");
|
|
9
|
-
|
|
10
7
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
8
|
var neutralColors = ['neutralWhite', 'neutralBlack'];
|
|
13
9
|
exports.neutralColors = neutralColors;
|
|
14
10
|
var colorSchemes = ['light', 'dark'];
|
|
11
|
+
|
|
15
12
|
/**
|
|
16
13
|
* Here are listed all the colors available for our project
|
|
17
14
|
* Flat colors are the actual colors of the system
|
|
18
15
|
**/
|
|
19
|
-
|
|
20
16
|
exports.colorSchemes = colorSchemes;
|
|
21
17
|
var flatColors = ['greyScale', 'darkGrey', 'lightGrey', 'red', 'magenta', 'purple', 'darkBlue', 'blue', 'lightBlue', 'teal', 'green', 'yellow', 'orange', 'darkOrange'].concat(neutralColors);
|
|
18
|
+
|
|
22
19
|
/**
|
|
23
20
|
* Here are listed all the colors available for our project
|
|
24
21
|
* Pale colors are just colors without shades
|
|
25
22
|
**/
|
|
26
|
-
|
|
27
23
|
exports.flatColors = flatColors;
|
|
28
24
|
var paleColors = ['greyScale', 'darkGrey', 'lightGrey', 'red', 'magenta', 'purple', 'darkBlue', 'blue', 'lightBlue', 'teal', 'green', 'yellow', 'orange'];
|
|
29
25
|
/**
|
|
@@ -33,7 +29,6 @@ var paleColors = ['greyScale', 'darkGrey', 'lightGrey', 'red', 'magenta', 'purpl
|
|
|
33
29
|
* so there is no yellow but variations of yellow
|
|
34
30
|
* default variation: 500
|
|
35
31
|
**/
|
|
36
|
-
|
|
37
32
|
exports.paleColors = paleColors;
|
|
38
33
|
var colorShades = [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950];
|
|
39
34
|
exports.colorShades = colorShades;
|
|
@@ -42,57 +37,51 @@ exports.MIN_SHADE = MIN_SHADE;
|
|
|
42
37
|
var BASE_SHADE = 500;
|
|
43
38
|
exports.BASE_SHADE = BASE_SHADE;
|
|
44
39
|
var MAX_SHADE = 950;
|
|
40
|
+
|
|
45
41
|
/**
|
|
46
42
|
* mainTypes are not colors per se but a type of color
|
|
47
43
|
* for example error is red but also defines a state that's why is listed here and not in flat colors
|
|
48
44
|
* Each color has again the above variations (shades)
|
|
49
45
|
**/
|
|
50
|
-
|
|
51
46
|
exports.MAX_SHADE = MAX_SHADE;
|
|
52
47
|
var mainTypes = ['primary', 'secondary', 'success', 'error', 'warning', 'info', 'light', 'link'];
|
|
53
|
-
exports.mainTypes = mainTypes;
|
|
54
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Palette is end output of what is produced and exported to the client projects
|
|
51
|
+
**/
|
|
52
|
+
exports.mainTypes = mainTypes;
|
|
55
53
|
var getColor = function getColor(palette) {
|
|
56
54
|
return function (color, variant, scope) {
|
|
57
55
|
if (scope === void 0) {
|
|
58
56
|
scope = 'flat';
|
|
59
57
|
}
|
|
60
|
-
|
|
61
58
|
var endColor;
|
|
62
|
-
|
|
63
59
|
if (variant === null) {
|
|
64
60
|
var _palette$scope;
|
|
65
|
-
|
|
66
|
-
endColor = palette == null ? void 0 : (_palette$scope = palette[scope]) == null ? void 0 : _palette$scope[color];
|
|
61
|
+
endColor = palette == null || (_palette$scope = palette[scope]) == null ? void 0 : _palette$scope[color];
|
|
67
62
|
} else if (scope === 'normal') {
|
|
68
63
|
endColor = palette[color][variant];
|
|
69
64
|
} else {
|
|
70
|
-
var _palette$scope2
|
|
71
|
-
|
|
72
|
-
endColor = palette == null ? void 0 : (_palette$scope2 = palette[scope]) == null ? void 0 : (_palette$scope2$color = _palette$scope2[color]) == null ? void 0 : _palette$scope2$color[variant];
|
|
65
|
+
var _palette$scope2;
|
|
66
|
+
endColor = palette == null || (_palette$scope2 = palette[scope]) == null || (_palette$scope2 = _palette$scope2[color]) == null ? void 0 : _palette$scope2[variant];
|
|
73
67
|
}
|
|
74
|
-
|
|
75
68
|
(0, _helpers.errorHandler)(_utils.getColorErrors, endColor);
|
|
76
69
|
return endColor;
|
|
77
70
|
};
|
|
78
71
|
};
|
|
72
|
+
|
|
79
73
|
/**
|
|
80
74
|
* this function picks either white or black color based on the background that is passed
|
|
81
75
|
* swatches are calculated based on accessibility by getAAColor function and splited to those two colors
|
|
82
76
|
**/
|
|
83
|
-
|
|
84
|
-
|
|
85
77
|
exports.getColor = getColor;
|
|
86
|
-
|
|
87
78
|
var getAAColorFromSwatches = function getAAColorFromSwatches(palette) {
|
|
88
79
|
return function (color, shade) {
|
|
89
80
|
var hexColorCode = getColor(palette)(color, shade);
|
|
90
81
|
return getAAColor(palette)(hexColorCode);
|
|
91
82
|
};
|
|
92
83
|
};
|
|
93
|
-
|
|
94
84
|
exports.getAAColorFromSwatches = getAAColorFromSwatches;
|
|
95
|
-
|
|
96
85
|
var getAAColor = function getAAColor(palette) {
|
|
97
86
|
return function (color) {
|
|
98
87
|
var white = palette.white;
|
|
@@ -100,5 +89,4 @@ var getAAColor = function getAAColor(palette) {
|
|
|
100
89
|
return (0, _polished.getContrast)(color, black) > (0, _polished.getContrast)(color, white) ? black : white;
|
|
101
90
|
};
|
|
102
91
|
};
|
|
103
|
-
|
|
104
92
|
exports.getAAColor = getAAColor;
|
package/dist/theme/spacing.js
CHANGED
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.getDisabled = void 0;
|
|
5
|
-
|
|
6
5
|
var _statesConfig = require("./statesConfig");
|
|
7
|
-
|
|
8
6
|
var opacityAmount = _statesConfig.statesConfig['light'].disabled.opacity.amount;
|
|
9
7
|
var cursor = _statesConfig.statesConfig['light'].disabled.cursor.name;
|
|
8
|
+
|
|
10
9
|
/**
|
|
11
10
|
* On disabled opacity is dropped in half and cursor is 'not-allowed'
|
|
12
11
|
* **/
|
|
13
|
-
|
|
14
12
|
var getDisabled = function getDisabled() {
|
|
15
13
|
return {
|
|
16
14
|
style: {
|
|
@@ -21,5 +19,4 @@ var getDisabled = function getDisabled() {
|
|
|
21
19
|
cursor: cursor
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
|
-
|
|
25
22
|
exports.getDisabled = getDisabled;
|
|
@@ -2,22 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.getFocus = void 0;
|
|
5
|
-
|
|
6
5
|
var _utils = require("../utils");
|
|
7
|
-
|
|
8
6
|
var _statesConfig = require("./statesConfig");
|
|
9
|
-
|
|
10
7
|
var borderWidthStep = _statesConfig.statesConfig['light'].focus.border.width.step;
|
|
11
8
|
var borderColor = _statesConfig.statesConfig['light'].focus.border.color;
|
|
9
|
+
|
|
12
10
|
/**
|
|
13
11
|
* On focus border is darken by one step in shade.
|
|
14
12
|
* If we exceed the maximum value then we lighten it.
|
|
15
13
|
* This will be reviewed when dark theme is implemented. **/
|
|
16
|
-
|
|
17
14
|
var getFocus = function getFocus(_ref) {
|
|
18
15
|
var theme = _ref.theme,
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
_ref$borderWidth = _ref.borderWidth,
|
|
17
|
+
borderWidth = _ref$borderWidth === void 0 ? 0 : _ref$borderWidth;
|
|
21
18
|
var calculatedBorderWidth = borderWidth + borderWidthStep;
|
|
22
19
|
var focusColor = theme.utils.getColor(borderColor.name, borderColor.shade);
|
|
23
20
|
return {
|
|
@@ -27,5 +24,4 @@ var getFocus = function getFocus(_ref) {
|
|
|
27
24
|
styleOutline: focusColor + " auto " + (0, _utils.rem)(calculatedBorderWidth)
|
|
28
25
|
};
|
|
29
26
|
};
|
|
30
|
-
|
|
31
27
|
exports.getFocus = getFocus;
|
|
@@ -2,33 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.getHover = void 0;
|
|
5
|
-
|
|
6
5
|
var _rgba = _interopRequireDefault(require("polished/lib/color/rgba"));
|
|
7
|
-
|
|
8
6
|
var _statesConfig = require("./statesConfig");
|
|
9
|
-
|
|
10
7
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
9
|
/**
|
|
15
10
|
* On hover background is darken by one step in shade.
|
|
16
11
|
* If we exceed the maximum value then we lighten it.
|
|
17
12
|
* This will be reviewed when dark theme is implemented. **/
|
|
18
13
|
var getHover = function getHover(_ref) {
|
|
19
14
|
var theme = _ref.theme,
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
color = _ref.color,
|
|
16
|
+
shade = _ref.shade;
|
|
22
17
|
var backgroundColorStep = _statesConfig.statesConfig[theme.colorScheme].hover.backgroundColor.step;
|
|
23
18
|
var endColor = color || (theme.colorScheme === 'dark' ? 'darkGrey' : 'lightGrey');
|
|
24
19
|
var endShade = shade || (theme.colorScheme === 'dark' ? 700 : 0);
|
|
25
|
-
|
|
26
20
|
if (shade === 0 && color) {
|
|
27
21
|
return {
|
|
28
22
|
backgroundColor: (0, _rgba["default"])(theme.utils.getColor(color, 500), 0.07)
|
|
29
23
|
};
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
var calculatedShade = (0, _utils.getShadeWithStep)({
|
|
33
26
|
shade: endShade,
|
|
34
27
|
step: backgroundColorStep,
|
|
@@ -38,5 +31,4 @@ var getHover = function getHover(_ref) {
|
|
|
38
31
|
backgroundColor: theme.utils.getColor(endColor, calculatedShade)
|
|
39
32
|
};
|
|
40
33
|
};
|
|
41
|
-
|
|
42
34
|
exports.getHover = getHover;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
|
|
5
4
|
var _disabled = require("./disabled");
|
|
6
|
-
|
|
7
5
|
exports.getDisabled = _disabled.getDisabled;
|
|
8
|
-
|
|
9
6
|
var _focus = require("./focus");
|
|
10
|
-
|
|
11
7
|
exports.getFocus = _focus.getFocus;
|
|
12
|
-
|
|
13
8
|
var _hover = require("./hover");
|
|
14
|
-
|
|
15
9
|
exports.getHover = _hover.getHover;
|
|
16
|
-
|
|
17
10
|
var _pressed = require("./pressed");
|
|
18
|
-
|
|
19
11
|
exports.getPressed = _pressed.getPressed;
|
|
@@ -2,33 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.getPressed = void 0;
|
|
5
|
-
|
|
6
5
|
var _rgba = _interopRequireDefault(require("polished/lib/color/rgba"));
|
|
7
|
-
|
|
8
6
|
var _statesConfig = require("./statesConfig");
|
|
9
|
-
|
|
10
7
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
9
|
/**
|
|
15
10
|
* On pressed background is darken by two steps in shade.
|
|
16
11
|
* If we exceed the maximum value then we lighten it by two steps.
|
|
17
12
|
* This will be reviewed when dark theme is implemented. **/
|
|
18
13
|
var getPressed = function getPressed(_ref) {
|
|
19
14
|
var theme = _ref.theme,
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
color = _ref.color,
|
|
16
|
+
shade = _ref.shade;
|
|
22
17
|
var backgroundColorStep = _statesConfig.statesConfig[theme.colorScheme].pressed.backgroundColor.step;
|
|
23
18
|
var endColor = color || (theme.colorScheme === 'dark' ? 'darkGrey' : 'lightGrey');
|
|
24
19
|
var endShade = shade || (theme.colorScheme === 'dark' ? 700 : 0);
|
|
25
|
-
|
|
26
20
|
if (shade === 0 && color) {
|
|
27
21
|
return {
|
|
28
22
|
backgroundColor: (0, _rgba["default"])(theme.utils.getColor(color, 500), 0.14)
|
|
29
23
|
};
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
var calculatedShade = (0, _utils.getShadeWithStep)({
|
|
33
26
|
shade: endShade,
|
|
34
27
|
step: backgroundColorStep,
|
|
@@ -38,5 +31,4 @@ var getPressed = function getPressed(_ref) {
|
|
|
38
31
|
backgroundColor: theme.utils.getColor(endColor, calculatedShade)
|
|
39
32
|
};
|
|
40
33
|
};
|
|
41
|
-
|
|
42
34
|
exports.getPressed = getPressed;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.statesConfig = exports.
|
|
4
|
+
exports.statesConfig = exports.lightStatesConfig = exports.darkStatesConfig = void 0;
|
|
5
5
|
var lightStatesConfig = {
|
|
6
6
|
hover: {
|
|
7
7
|
backgroundColor: {
|
|
@@ -2,25 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.getShadeWithStep = void 0;
|
|
5
|
-
|
|
6
5
|
var _palette = require("../palette");
|
|
7
|
-
|
|
8
6
|
var getShadeWithStep = function getShadeWithStep(_ref) {
|
|
9
7
|
var _ref$shade = _ref.shade,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
shade = _ref$shade === void 0 ? 0 : _ref$shade,
|
|
9
|
+
_ref$step = _ref.step,
|
|
10
|
+
step = _ref$step === void 0 ? 50 : _ref$step,
|
|
11
|
+
colorScheme = _ref.colorScheme;
|
|
14
12
|
var calculation = colorScheme === 'light' ? shade + step > _palette.MAX_SHADE : shade - step > _palette.MIN_SHADE;
|
|
15
13
|
var calculatedShade = shade;
|
|
16
|
-
|
|
17
14
|
if (calculation) {
|
|
18
15
|
calculatedShade -= step;
|
|
19
16
|
} else {
|
|
20
17
|
calculatedShade += step;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
return calculatedShade;
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
exports.getShadeWithStep = getShadeWithStep;
|
package/dist/theme/typography.js
CHANGED
package/dist/theme/utils.js
CHANGED
|
@@ -1,62 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
|
|
4
|
+
exports.rem = exports.iterateObject = exports.getColorErrors = exports.enhancePaletteWithShades = exports.convertPointsToPixels = exports.colorShadesCreator = void 0;
|
|
6
5
|
var _polished = require("polished");
|
|
7
|
-
|
|
8
6
|
var _errors = require("../utils/errors");
|
|
9
|
-
|
|
10
7
|
var BASE_PERCENTAGE = 10;
|
|
11
8
|
var SHADES = 18;
|
|
12
9
|
var EXCLUDED = ['white', 'black', 'pale'];
|
|
13
|
-
|
|
14
10
|
var convertPointsToPixels = function convertPointsToPixels(pt) {
|
|
15
11
|
return 96 / 72 * pt;
|
|
16
12
|
};
|
|
17
|
-
|
|
18
13
|
exports.convertPointsToPixels = convertPointsToPixels;
|
|
19
|
-
|
|
20
14
|
var colorShadesCreator = function colorShadesCreator(base, per, shadesCount) {
|
|
21
15
|
if (per === void 0) {
|
|
22
16
|
per = BASE_PERCENTAGE;
|
|
23
17
|
}
|
|
24
|
-
|
|
25
18
|
if (shadesCount === void 0) {
|
|
26
19
|
shadesCount = SHADES / 2;
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
var newArray = function newArray(fn, length) {
|
|
30
22
|
return Array.from({
|
|
31
23
|
length: length
|
|
32
24
|
}, fn);
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
var tints = function tints(weight) {
|
|
36
27
|
return newArray(function (__, i) {
|
|
37
28
|
return (0, _polished.tint)((i + 1) * per / 100, base);
|
|
38
29
|
}, weight);
|
|
39
30
|
};
|
|
40
|
-
|
|
41
31
|
var shades = function shades(weight) {
|
|
42
32
|
return newArray(function (__, i) {
|
|
43
33
|
return (0, _polished.shade)((i + 1) * per / 100, base);
|
|
44
34
|
}, weight);
|
|
45
35
|
};
|
|
46
|
-
|
|
47
36
|
var all = function all(weight) {
|
|
48
37
|
if (weight === void 0) {
|
|
49
38
|
weight = shadesCount;
|
|
50
39
|
}
|
|
51
|
-
|
|
52
40
|
return [].concat(tints(weight).reverse(), [base], shades(weight));
|
|
53
41
|
};
|
|
54
|
-
|
|
55
42
|
return all().reduce(function (acc, _, index) {
|
|
56
43
|
acc["" + (index + 1) * 50] = _;
|
|
57
44
|
return acc;
|
|
58
45
|
}, {});
|
|
59
46
|
};
|
|
47
|
+
|
|
60
48
|
/**
|
|
61
49
|
* Recursive function that iterates over the theme.
|
|
62
50
|
* If, upon iteration it finds an object then it goes one level depper
|
|
@@ -69,10 +57,7 @@ var colorShadesCreator = function colorShadesCreator(base, per, shadesCount) {
|
|
|
69
57
|
* @returns {Record<string, unknown>>} Each level will have generatedColorShades and in whole it will return
|
|
70
58
|
* a complete palette.
|
|
71
59
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
60
|
exports.colorShadesCreator = colorShadesCreator;
|
|
75
|
-
|
|
76
61
|
var iterateObject = function iterateObject(obj, func) {
|
|
77
62
|
return Object.keys(obj).reduce(function (acc, value) {
|
|
78
63
|
if (typeof obj[value] !== 'object') {
|
|
@@ -82,25 +67,19 @@ var iterateObject = function iterateObject(obj, func) {
|
|
|
82
67
|
} else {
|
|
83
68
|
acc[value] = iterateObject(obj[value], func);
|
|
84
69
|
}
|
|
85
|
-
|
|
86
70
|
return acc;
|
|
87
71
|
}, {});
|
|
88
72
|
};
|
|
89
|
-
|
|
90
73
|
exports.iterateObject = iterateObject;
|
|
91
|
-
|
|
92
74
|
var enhancePaletteWithShades = function enhancePaletteWithShades(obj) {
|
|
93
75
|
return iterateObject(obj, function (value, name) {
|
|
94
76
|
return EXCLUDED.includes(name) ? value : colorShadesCreator(value, BASE_PERCENTAGE);
|
|
95
77
|
});
|
|
96
78
|
};
|
|
97
|
-
|
|
98
79
|
exports.enhancePaletteWithShades = enhancePaletteWithShades;
|
|
99
|
-
|
|
100
80
|
var rem = function rem(px) {
|
|
101
81
|
return (0, _polished.rem)(px, 16);
|
|
102
82
|
};
|
|
103
|
-
|
|
104
83
|
exports.rem = rem;
|
|
105
84
|
var getColorErrors = [{
|
|
106
85
|
condition: function condition(endColor) {
|
package/dist/utils/common.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
|
|
4
|
+
exports.Function = exports.FIGMA_URL = void 0;
|
|
6
5
|
var Function = function Function(_ref) {
|
|
7
6
|
var children = _ref.children;
|
|
8
7
|
return children();
|
|
9
8
|
};
|
|
9
|
+
|
|
10
10
|
/** A type to turn any type optional properties to required */
|
|
11
11
|
|
|
12
|
+
/** A generic type for native events */
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
//@TODO fix props to not overwrite button props from base
|
|
14
15
|
|
|
16
|
+
//@TODO fix props to not overwrite div props from base
|
|
17
|
+
exports.Function = Function;
|
|
15
18
|
/** URL currently used for figma version 4.5 frozen */
|
|
16
19
|
var FIGMA_URL = 'https://www.figma.com/file/3deO7jGtkly8ij4TiIUpzY/Design-System-V4.5-(%E2%9D%84%EF%B8%8FDO-NOT-EDIT)';
|
|
17
20
|
exports.FIGMA_URL = FIGMA_URL;
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,50 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
|
|
4
|
+
exports.ValidationError = exports.PropsValidationError = void 0;
|
|
6
5
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
7
|
-
|
|
8
6
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
9
|
-
|
|
10
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
11
|
-
|
|
7
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
12
8
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
9
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
-
|
|
10
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
12
|
var ValidationError = /*#__PURE__*/function (_Error) {
|
|
21
13
|
_inheritsLoose(ValidationError, _Error);
|
|
22
|
-
|
|
23
14
|
function ValidationError(message) {
|
|
24
15
|
var _this;
|
|
25
|
-
|
|
26
16
|
_this = _Error.call(this, message) || this;
|
|
27
17
|
_this.name = 'ValidationError';
|
|
28
18
|
return _this;
|
|
29
19
|
}
|
|
30
|
-
|
|
31
20
|
return ValidationError;
|
|
32
21
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
33
|
-
|
|
34
22
|
exports.ValidationError = ValidationError;
|
|
35
|
-
|
|
36
23
|
var PropsValidationError = /*#__PURE__*/function (_ValidationError) {
|
|
37
24
|
_inheritsLoose(PropsValidationError, _ValidationError);
|
|
38
|
-
|
|
39
25
|
function PropsValidationError(message) {
|
|
40
26
|
var _this2;
|
|
41
|
-
|
|
42
27
|
_this2 = _ValidationError.call(this, message) || this;
|
|
43
28
|
_this2.name = 'PropsValidationError';
|
|
44
29
|
return _this2;
|
|
45
30
|
}
|
|
46
|
-
|
|
47
31
|
return PropsValidationError;
|
|
48
32
|
}(ValidationError);
|
|
49
|
-
|
|
50
33
|
exports.PropsValidationError = PropsValidationError;
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { TestId } from 'utils/types';
|
|
3
3
|
/** A function that generates a unique id by making a value randomly based on time also */
|
|
4
4
|
export declare const generateUniqueID: (elementType?: string) => string;
|
|
5
5
|
/** A function that takes two strings to generate a test data id by combining them if both exist */
|
|
6
6
|
export declare const generateTestDataId: (defaultId: TestId, customId?: string | undefined) => string;
|
|
7
7
|
/** A function that determines if the element passed is a function and a react element */
|
|
8
|
-
export declare function isComponentFunctionType(element: string | number |
|
|
8
|
+
export declare function isComponentFunctionType(element: string | number | React.ReactElement | Function): element is Function;
|
|
9
9
|
/** A function that retrieves the correct date format based on system's locale */
|
|
10
10
|
export declare const getLocaleFormat: (dateFormat: string | undefined) => string;
|
|
11
11
|
/**
|
package/dist/utils/helpers.js
CHANGED
|
@@ -1,67 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports.getLocaleFormat = exports.generateUniqueID = exports.generateTestDataId = exports.errorHandler = void 0;
|
|
4
5
|
exports.isComponentFunctionType = isComponentFunctionType;
|
|
5
|
-
exports.errorHandler = exports.getLocaleFormat = exports.generateTestDataId = exports.generateUniqueID = void 0;
|
|
6
|
-
|
|
7
6
|
var _dayjs2 = _interopRequireDefault(require("dayjs"));
|
|
8
|
-
|
|
9
7
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
|
|
11
8
|
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); }
|
|
12
|
-
|
|
13
9
|
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; }
|
|
14
|
-
|
|
15
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
-
|
|
17
11
|
/** A function that generates a unique id by making a value randomly based on time also */
|
|
18
12
|
var generateUniqueID = function generateUniqueID(elementType) {
|
|
19
13
|
if (elementType === void 0) {
|
|
20
14
|
elementType = '';
|
|
21
15
|
}
|
|
22
|
-
|
|
23
16
|
return elementType + '_' + (Date.now() + Math.random()).toString(36).substr(2, 9);
|
|
24
17
|
};
|
|
25
|
-
/** A function that takes two strings to generate a test data id by combining them if both exist */
|
|
26
|
-
|
|
27
18
|
|
|
19
|
+
/** A function that takes two strings to generate a test data id by combining them if both exist */
|
|
28
20
|
exports.generateUniqueID = generateUniqueID;
|
|
29
|
-
|
|
30
21
|
var generateTestDataId = function generateTestDataId(defaultId, customId) {
|
|
31
22
|
return customId ? defaultId + "-" + customId : defaultId;
|
|
32
23
|
};
|
|
33
|
-
/** A function that determines if the element passed is a function and a react element */
|
|
34
|
-
|
|
35
24
|
|
|
25
|
+
/** A function that determines if the element passed is a function and a react element */
|
|
36
26
|
exports.generateTestDataId = generateTestDataId;
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
function isComponentFunctionType(
|
|
28
|
+
// TODO this must be fixed @Panagiotis
|
|
39
29
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
40
30
|
element) {
|
|
41
31
|
return typeof element === 'function' && /*#__PURE__*/React.isValidElement(element());
|
|
42
32
|
}
|
|
43
|
-
/** A function that retrieves the correct date format based on system's locale */
|
|
44
|
-
|
|
45
33
|
|
|
34
|
+
/** A function that retrieves the correct date format based on system's locale */
|
|
46
35
|
var getLocaleFormat = function getLocaleFormat(dateFormat) {
|
|
47
|
-
var _dayjs
|
|
48
|
-
|
|
49
|
-
var localeFormat = (_dayjs = (0, _dayjs2["default"])()) == null ? void 0 : (_dayjs$localeData = _dayjs.localeData()) == null ? void 0 : _dayjs$localeData.longDateFormat('L');
|
|
36
|
+
var _dayjs;
|
|
37
|
+
var localeFormat = (_dayjs = (0, _dayjs2["default"])()) == null || (_dayjs = _dayjs.localeData()) == null ? void 0 : _dayjs.longDateFormat('L');
|
|
50
38
|
return dateFormat ? dateFormat : localeFormat;
|
|
51
39
|
};
|
|
40
|
+
|
|
52
41
|
/**
|
|
53
42
|
* A function that takes an array of errors and the component props and throws an error
|
|
54
43
|
* if the condition is met
|
|
55
44
|
* */
|
|
56
|
-
|
|
57
|
-
|
|
58
45
|
exports.getLocaleFormat = getLocaleFormat;
|
|
59
|
-
|
|
60
46
|
var errorHandler = function errorHandler(errors, props) {
|
|
61
47
|
return errors.map(function (_ref) {
|
|
62
48
|
var condition = _ref.condition,
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
error = _ref.error;
|
|
65
50
|
if (condition(props)) {
|
|
66
51
|
if (typeof error === 'function') {
|
|
67
52
|
throw error(props);
|
|
@@ -71,5 +56,4 @@ var errorHandler = function errorHandler(errors, props) {
|
|
|
71
56
|
}
|
|
72
57
|
});
|
|
73
58
|
};
|
|
74
|
-
|
|
75
59
|
exports.errorHandler = errorHandler;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
4
|
-
|
|
5
4
|
var _localeData = _interopRequireDefault(require("dayjs/plugin/localeData"));
|
|
6
|
-
|
|
7
5
|
var _localizedFormat = _interopRequireDefault(require("dayjs/plugin/localizedFormat"));
|
|
8
|
-
|
|
9
6
|
require("dayjs/locale/en-gb");
|
|
10
|
-
|
|
11
7
|
require("dayjs/locale/en");
|
|
12
|
-
|
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
|
|
15
|
-
(function InitLocaleFormat(usLocale, euLocale) {
|
|
16
|
-
var _navigator;
|
|
17
|
-
|
|
9
|
+
(function InitLocaleFormat(usLocale, euLocale, _navigator) {
|
|
18
10
|
[_localizedFormat["default"], _localeData["default"]].forEach(_dayjs["default"].extend);
|
|
19
11
|
var browserLanguage = ((_navigator = navigator) == null ? void 0 : _navigator.language) === 'en-GB' ? euLocale : usLocale;
|
|
20
|
-
|
|
21
12
|
_dayjs["default"].locale(browserLanguage);
|
|
22
13
|
})('en', 'en-gb');
|