@pedidopago/ui 1.6.9 → 1.6.11
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/@types/index.d.ts +1 -1
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/components/Alert/alert.test.js +4 -11
- package/dist/components/Alert/index.js +9 -16
- package/dist/components/Alert/styles.js +0 -16
- package/dist/components/Alert/types.d.ts +2 -2
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Avatar/avatar.test.js +4 -11
- package/dist/components/Avatar/index.js +15 -38
- package/dist/components/Avatar/styles.js +0 -16
- package/dist/components/Avatar/types.d.ts +2 -2
- package/dist/components/Avatar/types.d.ts.map +1 -1
- package/dist/components/Badge/badge.test.js +5 -16
- package/dist/components/Badge/index.js +5 -9
- package/dist/components/Badge/styles.js +1 -11
- package/dist/components/Badge/types.d.ts +3 -3
- package/dist/components/Badge/types.d.ts.map +1 -1
- package/dist/components/Button/Button.test.js +14 -32
- package/dist/components/Button/index.js +21 -37
- package/dist/components/Button/styles.js +6 -35
- package/dist/components/Button/types.d.ts +4 -4
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/card.test.js +8 -15
- package/dist/components/Card/index.js +15 -24
- package/dist/components/Card/styles.js +0 -8
- package/dist/components/Card/types.d.ts +2 -2
- package/dist/components/Card/types.d.ts.map +1 -1
- package/dist/components/CheckboxInput/checkbox-input.test.js +65 -89
- package/dist/components/CheckboxInput/components/MultipleCheckbox.js +27 -58
- package/dist/components/CheckboxInput/index.js +20 -41
- package/dist/components/CheckboxInput/styles.js +9 -33
- package/dist/components/CheckboxInput/types.d.ts +1 -1
- package/dist/components/CheckboxInput/types.d.ts.map +1 -1
- package/dist/components/CollapseCard/ExpandButton/index.js +3 -11
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts +4 -2
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts.map +1 -1
- package/dist/components/CollapseCard/ExpandButton/styles.js +0 -6
- package/dist/components/CollapseCard/expand-button.test.js +71 -110
- package/dist/components/CollapseCard/index.js +23 -44
- package/dist/components/CollapseCard/styles.d.ts +4 -1
- package/dist/components/CollapseCard/styles.d.ts.map +1 -1
- package/dist/components/CollapseCard/styles.js +0 -9
- package/dist/components/ColorPicker/colorpicker.test.js +6 -16
- package/dist/components/ColorPicker/components/ColorHue.js +1 -12
- package/dist/components/ColorPicker/components/ColorInput.js +10 -31
- package/dist/components/ColorPicker/components/ColorPickerBox.js +5 -17
- package/dist/components/ColorPicker/components/ColorPointer.js +3 -8
- package/dist/components/ColorPicker/components/ColorSelector.js +45 -77
- package/dist/components/ColorPicker/hooks/useCachedCallback.js +0 -3
- package/dist/components/ColorPicker/hooks/useHsva.js +7 -20
- package/dist/components/ColorPicker/index.js +18 -41
- package/dist/components/ColorPicker/styles.js +0 -24
- package/dist/components/ColorPicker/types.d.ts +11 -11
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/utils/checkers.js +0 -19
- package/dist/components/ColorPicker/utils/conversors.js +41 -88
- package/dist/components/ColorPicker/utils/parsers.js +11 -40
- package/dist/components/DateInput/DateInput-example.js +14 -23
- package/dist/components/DateInput/components/ModalWrapper/index.js +8 -12
- package/dist/components/DateInput/components/ModalWrapper/styles.d.ts +4 -1
- package/dist/components/DateInput/components/ModalWrapper/styles.d.ts.map +1 -1
- package/dist/components/DateInput/components/ModalWrapper/styles.js +1 -12
- package/dist/components/DateInput/dateInput.test.js +17 -26
- package/dist/components/DateInput/index.js +32 -54
- package/dist/components/DateInput/styles.js +0 -9
- package/dist/components/DateInput/types.d.ts +1 -1
- package/dist/components/DateInput/types.d.ts.map +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.d.ts +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.d.ts.map +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.js +19 -43
- package/dist/components/DatePicker/components/DateYearPicker.js +11 -31
- package/dist/components/DatePicker/datepicker.test.js +44 -62
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +74 -118
- package/dist/components/DatePicker/styles.js +2 -35
- package/dist/components/DatePicker/types.d.ts +4 -4
- package/dist/components/DatePicker/types.d.ts.map +1 -1
- package/dist/components/DatePicker/utils/getMonthName.js +0 -2
- package/dist/components/Dialog/dialog-example.js +9 -22
- package/dist/components/Dialog/dialog.test.js +32 -45
- package/dist/components/Dialog/index.js +14 -22
- package/dist/components/Dialog/styles.js +0 -13
- package/dist/components/Dropzone/dropzone.test.js +35 -45
- package/dist/components/Dropzone/index.js +29 -68
- package/dist/components/Dropzone/styles.js +8 -32
- package/dist/components/Dropzone/types.d.ts +4 -4
- package/dist/components/Dropzone/types.d.ts.map +1 -1
- package/dist/components/Dropzone/utils/accepts.js +0 -5
- package/dist/components/Flex/flex.test.js +267 -286
- package/dist/components/Flex/index.js +16 -24
- package/dist/components/Flex/styles.js +0 -11
- package/dist/components/Flex/types.d.ts +13 -13
- package/dist/components/Flex/types.d.ts.map +1 -1
- package/dist/components/Grid/grid.test.js +0 -6
- package/dist/components/Grid/index.js +17 -25
- package/dist/components/Grid/styles.js +1 -9
- package/dist/components/Grid/types.d.ts +2 -2
- package/dist/components/Grid/types.d.ts.map +1 -1
- package/dist/components/Icon/data/beauty.js +1 -0
- package/dist/components/Icon/data/ecommerce.js +1 -0
- package/dist/components/Icon/data/form.js +1 -0
- package/dist/components/Icon/data/health.js +1 -0
- package/dist/components/Icon/data/illustrations.js +1 -0
- package/dist/components/Icon/data/men.js +1 -0
- package/dist/components/Icon/data/payment.js +1 -0
- package/dist/components/Icon/data/pedidoPago.js +1 -0
- package/dist/components/Icon/data/physicalPerfomance.js +1 -0
- package/dist/components/Icon/data/social.js +1 -0
- package/dist/components/Icon/data/status.js +1 -0
- package/dist/components/Icon/data/summer.js +1 -0
- package/dist/components/Icon/data/woman.js +1 -0
- package/dist/components/Icon/icon.test.js +19 -32
- package/dist/components/Icon/index.js +14 -28
- package/dist/components/Icon/scripts/build.js +14 -51
- package/dist/components/Icon/scripts/extractor.js +0 -6
- package/dist/components/Icon/scripts/run-build.js +0 -2
- package/dist/components/Icon/scripts/writers.d.ts +1 -1
- package/dist/components/Icon/scripts/writers.d.ts.map +1 -1
- package/dist/components/Icon/scripts/writers.js +1 -12
- package/dist/components/Icon/styles.d.ts +1 -1
- package/dist/components/Icon/styles.d.ts.map +1 -1
- package/dist/components/Icon/styles.js +3 -11
- package/dist/components/Icon/types.d.ts +2 -2
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Icon/utils/allIcons.js +1 -22
- package/dist/components/Icon/utils/iconExists.d.ts +1 -1
- package/dist/components/Icon/utils/iconExists.d.ts.map +1 -1
- package/dist/components/Icon/utils/iconExists.js +0 -3
- package/dist/components/IconItem/IconItem.test.js +27 -37
- package/dist/components/IconItem/index.js +5 -12
- package/dist/components/IconItem/styles.js +2 -16
- package/dist/components/IconItem/types.d.ts +3 -3
- package/dist/components/IconItem/types.d.ts.map +1 -1
- package/dist/components/Illustration/AlternativeOrderSvg/index.js +0 -2
- package/dist/components/Illustration/BoletoSvg/index.js +0 -2
- package/dist/components/Illustration/BoxClosedSvg/index.js +0 -2
- package/dist/components/Illustration/BoxDeliverySvg/index.js +0 -2
- package/dist/components/Illustration/BoxOpenSvg/index.js +0 -2
- package/dist/components/Illustration/CalendarSvg/index.js +0 -2
- package/dist/components/Illustration/CardSvg/index.js +0 -2
- package/dist/components/Illustration/CollaboratorSvg/index.js +0 -2
- package/dist/components/Illustration/InquirySvg/index.js +0 -2
- package/dist/components/Illustration/OrderSvg/index.js +0 -2
- package/dist/components/Illustration/PixSvg/index.js +0 -2
- package/dist/components/Illustration/PrescriptionSvg/index.js +0 -2
- package/dist/components/Illustration/TransportSvg/index.js +0 -2
- package/dist/components/Illustration/illustration.test.js +20 -31
- package/dist/components/Illustration/index.js +11 -43
- package/dist/components/Illustration/styles.js +0 -14
- package/dist/components/ImageItem/imageFake.js +0 -2
- package/dist/components/ImageItem/index.js +18 -25
- package/dist/components/ImageItem/input.test.js +31 -51
- package/dist/components/ImageItem/styles.js +2 -22
- package/dist/components/ImageItem/types.d.ts +2 -2
- package/dist/components/ImageItem/types.d.ts.map +1 -1
- package/dist/components/Input/index.js +25 -47
- package/dist/components/Input/input.test.js +49 -73
- package/dist/components/Input/styles.js +12 -65
- package/dist/components/Input/types.d.ts +1 -1
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/Label/index.js +9 -19
- package/dist/components/Label/label.test.js +32 -58
- package/dist/components/Label/styles.js +0 -6
- package/dist/components/Label/types.d.ts +2 -2
- package/dist/components/Label/types.d.ts.map +1 -1
- package/dist/components/List/index.js +9 -17
- package/dist/components/List/list.test.js +4 -11
- package/dist/components/List/styles.js +0 -11
- package/dist/components/Modal/ModalExample.js +9 -27
- package/dist/components/Modal/index.js +23 -47
- package/dist/components/Modal/modal.test.js +15 -33
- package/dist/components/Modal/styles.d.ts +8 -2
- package/dist/components/Modal/styles.d.ts.map +1 -1
- package/dist/components/Modal/styles.js +3 -16
- package/dist/components/Modal/types.d.ts +2 -2
- package/dist/components/Modal/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/MultipleSelect.test.js +106 -223
- package/dist/components/MultipleSelect/components/InputWrapper/index.js +1 -11
- package/dist/components/MultipleSelect/components/InputWrapper/types.d.ts +1 -1
- package/dist/components/MultipleSelect/components/InputWrapper/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/components/OptionsArea/index.js +36 -70
- package/dist/components/MultipleSelect/components/OptionsArea/styles.d.ts +4 -1
- package/dist/components/MultipleSelect/components/OptionsArea/styles.d.ts.map +1 -1
- package/dist/components/MultipleSelect/components/OptionsArea/styles.js +6 -19
- package/dist/components/MultipleSelect/components/SelectArea/ButtonsArea.js +0 -9
- package/dist/components/MultipleSelect/components/SelectArea/SelectAreaWrapper.js +2 -12
- package/dist/components/MultipleSelect/components/SelectArea/SelectedOptionsArea.js +0 -15
- package/dist/components/MultipleSelect/components/SelectArea/index.js +10 -20
- package/dist/components/MultipleSelect/components/SelectArea/styles.js +1 -12
- package/dist/components/MultipleSelect/components/SelectArea/types.d.ts +1 -1
- package/dist/components/MultipleSelect/components/SelectArea/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/components/index.js +0 -6
- package/dist/components/MultipleSelect/index.d.ts +1 -1
- package/dist/components/MultipleSelect/index.d.ts.map +1 -1
- package/dist/components/MultipleSelect/index.js +51 -94
- package/dist/components/MultipleSelect/types.d.ts +2 -2
- package/dist/components/MultipleSelect/types.d.ts.map +1 -1
- package/dist/components/Observer/index.js +10 -25
- package/dist/components/Observer/observer.test.js +0 -4
- package/dist/components/Observer/types.d.ts +1 -1
- package/dist/components/Observer/types.d.ts.map +1 -1
- package/dist/components/Pagination/hooks/usePagination.js +2 -18
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +53 -86
- package/dist/components/Pagination/pagination.test.js +16 -50
- package/dist/components/Pagination/styles.js +23 -45
- package/dist/components/Progress/Circle/index.js +15 -31
- package/dist/components/Progress/Circle/styles.js +1 -15
- package/dist/components/Progress/Circle/types.d.ts +1 -1
- package/dist/components/Progress/Circle/types.d.ts.map +1 -1
- package/dist/components/Progress/Linear/index.js +12 -30
- package/dist/components/Progress/Linear/styles.js +1 -14
- package/dist/components/Progress/Linear/types.d.ts +3 -3
- package/dist/components/Progress/Linear/types.d.ts.map +1 -1
- package/dist/components/Progress/getSteps.js +0 -3
- package/dist/components/Progress/index.js +10 -19
- package/dist/components/Progress/progress.test.js +47 -64
- package/dist/components/Progress/types.d.ts +2 -2
- package/dist/components/Progress/types.d.ts.map +1 -1
- package/dist/components/RadioInput/components/ChoiceList/index.js +14 -27
- package/dist/components/RadioInput/index.js +15 -26
- package/dist/components/RadioInput/radio-input.test.js +44 -68
- package/dist/components/RadioInput/styles.js +2 -21
- package/dist/components/RadioInput/types.d.ts +4 -4
- package/dist/components/RadioInput/types.d.ts.map +1 -1
- package/dist/components/RadioInput/utils/get-colors-props.js +0 -1
- package/dist/components/Rating/index.js +35 -66
- package/dist/components/Rating/rating.test.js +0 -16
- package/dist/components/Rating/styles.js +1 -12
- package/dist/components/ReactPortal/index.js +7 -22
- package/dist/components/ReactPortal/reactPortal.test.js +0 -5
- package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.js +0 -1
- package/dist/components/Select/components/OptionsSelect/index.js +25 -45
- package/dist/components/Select/components/OptionsSelect/styles.d.ts +4 -1
- package/dist/components/Select/components/OptionsSelect/styles.d.ts.map +1 -1
- package/dist/components/Select/components/OptionsSelect/styles.js +1 -12
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +37 -74
- package/dist/components/Select/select.test.js +13 -22
- package/dist/components/Select/styles.js +0 -12
- package/dist/components/Select/types.d.ts +2 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +6 -14
- package/dist/components/Skeleton/skeleton.test.js +35 -51
- package/dist/components/Skeleton/styles.js +0 -10
- package/dist/components/Skeleton/types.d.ts +1 -1
- package/dist/components/Skeleton/types.d.ts.map +1 -1
- package/dist/components/Slider/SliderExample.js +11 -25
- package/dist/components/Slider/components/SliderPointer.js +1 -7
- package/dist/components/Slider/components/SliderRail.js +49 -81
- package/dist/components/Slider/components/SliderSelector.js +22 -45
- package/dist/components/Slider/hooks/useEventCallback.js +0 -3
- package/dist/components/Slider/index.js +26 -62
- package/dist/components/Slider/slider.test.js +52 -65
- package/dist/components/Slider/styles.js +0 -25
- package/dist/components/Slider/types.d.ts +5 -5
- package/dist/components/Slider/types.d.ts.map +1 -1
- package/dist/components/Spinner/index.js +6 -10
- package/dist/components/Spinner/spinner.test.js +14 -24
- package/dist/components/Spinner/styles.js +5 -10
- package/dist/components/Spinner/types.d.ts +2 -2
- package/dist/components/Spinner/types.d.ts.map +1 -1
- package/dist/components/Steps/components/StepIcon/index.js +5 -14
- package/dist/components/Steps/components/StepIconMobile/index.js +5 -14
- package/dist/components/Steps/index.js +12 -37
- package/dist/components/Steps/steps.test.js +23 -33
- package/dist/components/Steps/styles.js +4 -27
- package/dist/components/Steps/types.d.ts +1 -1
- package/dist/components/Steps/types.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +22 -39
- package/dist/components/Switch/styles.js +4 -21
- package/dist/components/Switch/switch.test.js +41 -179
- package/dist/components/Switch/types.d.ts +2 -2
- package/dist/components/Switch/types.d.ts.map +1 -1
- package/dist/components/Table/components/MenuItem.js +5 -11
- package/dist/components/Table/components/TableSkeleton.js +3 -9
- package/dist/components/Table/index.js +38 -71
- package/dist/components/Table/styles.js +0 -19
- package/dist/components/Table/table.test.js +68 -84
- package/dist/components/Table/types.d.ts +3 -3
- package/dist/components/Table/types.d.ts.map +1 -1
- package/dist/components/Tabs/TabsExample.js +11 -24
- package/dist/components/Tabs/components/Tab.js +12 -20
- package/dist/components/Tabs/components/TabPanel.js +3 -7
- package/dist/components/Tabs/components/Tabs.js +25 -49
- package/dist/components/Tabs/index.js +0 -3
- package/dist/components/Tabs/styles.js +9 -29
- package/dist/components/Tabs/tabs.test.js +104 -117
- package/dist/components/Tabs/types.d.ts +7 -7
- package/dist/components/Tabs/types.d.ts.map +1 -1
- package/dist/components/Tag/index.js +6 -13
- package/dist/components/Tag/styles.js +7 -18
- package/dist/components/Tag/tag.test.js +3 -17
- package/dist/components/TextAreaInput/index.js +16 -35
- package/dist/components/TextAreaInput/styles.js +10 -23
- package/dist/components/TextAreaInput/text-area-input.test.js +21 -36
- package/dist/components/TextAreaInput/types.d.ts +3 -3
- package/dist/components/TextAreaInput/types.d.ts.map +1 -1
- package/dist/components/Thumbnail/index.js +31 -60
- package/dist/components/Thumbnail/styles.js +9 -26
- package/dist/components/Thumbnail/thumbnail.test.js +13 -29
- package/dist/components/Thumbnail/types.d.ts +1 -1
- package/dist/components/Thumbnail/types.d.ts.map +1 -1
- package/dist/components/Thumbnail/utils/index.js +0 -4
- package/dist/components/Thumbnail/utils/validate-file-size.js +0 -1
- package/dist/components/Thumbnail/utils/validate-file-type.js +0 -1
- package/dist/components/Timeline/components/Timeline.js +3 -8
- package/dist/components/Timeline/components/TimelineContent.js +7 -18
- package/dist/components/Timeline/components/TimelineItem.js +5 -13
- package/dist/components/Timeline/components/TimelineSeparator.js +1 -5
- package/dist/components/Timeline/index.js +0 -4
- package/dist/components/Timeline/styles.js +0 -17
- package/dist/components/Timeline/timeline.test.js +103 -115
- package/dist/components/Timeline/types.d.ts +4 -4
- package/dist/components/Timeline/types.d.ts.map +1 -1
- package/dist/components/Toast/button-example.js +1 -14
- package/dist/components/Toast/components/Toast.js +12 -21
- package/dist/components/Toast/contexts/ToastProvider.js +9 -31
- package/dist/components/Toast/hooks/useToast.js +1 -7
- package/dist/components/Toast/index.js +6 -17
- package/dist/components/Toast/styles.js +0 -12
- package/dist/components/Toast/toast.test.js +4 -14
- package/dist/components/Toast/types.d.ts +5 -5
- package/dist/components/Toast/types.d.ts.map +1 -1
- package/dist/components/Tooltip/components/TooltipLabel.js +12 -23
- package/dist/components/Tooltip/example.js +0 -4
- package/dist/components/Tooltip/index.js +29 -66
- package/dist/components/Tooltip/styles.js +0 -10
- package/dist/components/Tooltip/types.d.ts +3 -3
- package/dist/components/Tooltip/types.d.ts.map +1 -1
- package/dist/components/Typography/index.js +9 -21
- package/dist/components/Typography/styles.js +0 -7
- package/dist/components/Typography/types.d.ts +1 -1
- package/dist/components/Typography/types.d.ts.map +1 -1
- package/dist/components/Typography/typography.test.js +134 -171
- package/dist/index.js +0 -61
- package/dist/shared/components/FocusLock/index.js +17 -30
- package/dist/shared/formatters/format-number.js +4 -10
- package/dist/shared/hooks/devices.d.ts +1 -1
- package/dist/shared/hooks/devices.d.ts.map +1 -1
- package/dist/shared/hooks/useBreakpoints.d.ts +3 -3
- package/dist/shared/hooks/useBreakpoints.d.ts.map +1 -1
- package/dist/shared/hooks/useBreakpoints.js +5 -34
- package/dist/shared/hooks/useDebounce.js +1 -12
- package/dist/shared/hooks/useDevices.js +6 -20
- package/dist/shared/hooks/useDisableBodyScroll.js +6 -15
- package/dist/shared/hooks/useKeyPress.js +0 -3
- package/dist/shared/hooks/useObserver.js +1 -5
- package/dist/shared/hooks/useOnClickOutside.js +0 -7
- package/dist/shared/hooks/useWindowSize.d.ts +1 -1
- package/dist/shared/hooks/useWindowSize.d.ts.map +1 -1
- package/dist/shared/hooks/useWindowSize.js +8 -18
- package/dist/shared/tests/test-utils.js +5 -13
- package/dist/shared/tests/types.d.ts +1 -1
- package/dist/shared/tests/types.d.ts.map +1 -1
- package/dist/shared/theme/button-example.js +2 -12
- package/dist/shared/theme/contexts/ThemeContext.d.ts +2 -2
- package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.js +14 -37
- package/dist/shared/theme/hooks/useColorMode.js +2 -7
- package/dist/shared/theme/hooks/useColorModeValue.js +1 -5
- package/dist/shared/theme/hooks/useTheme.js +1 -7
- package/dist/shared/theme/index.js +0 -8
- package/dist/shared/theme/theme.js +5 -9
- package/dist/shared/theme/theme.test.js +35 -61
- package/dist/shared/theme/theme.types.d.ts +5 -5
- package/dist/shared/theme/theme.types.d.ts.map +1 -1
- package/dist/shared/theme/utils/extendTheme.js +0 -4
- package/dist/shared/types/credit-card.d.ts +1 -1
- package/dist/shared/types/credit-card.d.ts.map +1 -1
- package/dist/shared/types/file.d.ts +2 -2
- package/dist/shared/types/file.d.ts.map +1 -1
- package/dist/shared/types/name.d.ts +1 -1
- package/dist/shared/types/name.d.ts.map +1 -1
- package/dist/utils/GenerateKey.js +1 -3
- package/dist/utils/brightnessColorChange.js +0 -1
- package/dist/utils/colorCheck.d.ts +1 -1
- package/dist/utils/colorCheck.d.ts.map +1 -1
- package/dist/utils/colorCheck.js +9 -29
- package/dist/utils/colorFunctions.js +0 -6
- package/dist/utils/colorToGray.js +5 -22
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +56 -83
- package/dist/utils/formatters/bytes.js +0 -1
- package/dist/utils/formatters/capitalize.js +0 -1
- package/dist/utils/formatters/cep.js +1 -3
- package/dist/utils/formatters/cnpj.js +2 -9
- package/dist/utils/formatters/color.js +19 -20
- package/dist/utils/formatters/cpf.js +18 -25
- package/dist/utils/formatters/credit-card.js +6 -19
- package/dist/utils/formatters/index.js +0 -30
- package/dist/utils/formatters/name.js +1 -6
- package/dist/utils/formatters/number.js +0 -1
- package/dist/utils/formatters/passport.js +3 -7
- package/dist/utils/formatters/phone.js +17 -45
- package/dist/utils/formatters/price.js +1 -3
- package/dist/utils/formatters/rg.js +1 -3
- package/dist/utils/formatters/strings.js +0 -5
- package/dist/utils/fuctionsColors.js +0 -6
- package/dist/utils/generateUUID.js +0 -1
- package/dist/utils/getColorValue.js +0 -5
- package/dist/utils/getSvg.d.ts +1 -1
- package/dist/utils/getSvg.d.ts.map +1 -1
- package/dist/utils/getSvg.js +0 -3
- package/dist/utils/getValuesBySize.d.ts +2 -2
- package/dist/utils/getValuesBySize.d.ts.map +1 -1
- package/dist/utils/getValuesBySize.js +0 -1
- package/dist/utils/invertColor.js +7 -15
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAErF,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAErF,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,gBAAgB,CAAC,GAAG;IAC9D,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACrE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,gBAAgB,GAAG;QACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;KAC3C,CAAC;CACH,CAAC"}
|
|
@@ -4,31 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
-
|
|
10
8
|
var _useToast = _interopRequireDefault(require("./hooks/useToast"));
|
|
11
|
-
|
|
12
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
10
|
var _excluded = ["buttonText"];
|
|
15
|
-
|
|
16
11
|
var _templateObject;
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
-
|
|
22
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
-
|
|
24
15
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
-
|
|
26
16
|
var Button = _styled.default.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 1rem;\n border-radius: 8px;\n background-color: #f5f5f5;\n border: 1px solid #e3e3e3;\n font-size: 1rem;\n font-weight: bold;\n color: #333;\n cursor: pointer;\n\n transition: all 0.2s ease;\n\n &:hover {\n background-color: #e3e3e3;\n }\n\n &:active {\n background-color: #d6d6d6;\n }\n"])));
|
|
27
|
-
|
|
28
17
|
var ToastButtonExample = function ToastButtonExample(_ref) {
|
|
29
18
|
var buttonText = _ref.buttonText,
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
options = _objectWithoutProperties(_ref, _excluded);
|
|
32
20
|
var toast = (0, _useToast.default)();
|
|
33
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
34
22
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
@@ -39,6 +27,5 @@ var ToastButtonExample = function ToastButtonExample(_ref) {
|
|
|
39
27
|
})
|
|
40
28
|
});
|
|
41
29
|
};
|
|
42
|
-
|
|
43
30
|
var _default = ToastButtonExample;
|
|
44
31
|
exports.default = _default;
|
|
@@ -4,31 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _framerMotion = require("framer-motion");
|
|
11
|
-
|
|
12
9
|
var _Alert = _interopRequireDefault(require("../../Alert"));
|
|
13
|
-
|
|
14
10
|
var _styles = require("../styles");
|
|
15
|
-
|
|
16
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
|
|
13
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
17
|
var Toast = function Toast(_ref) {
|
|
23
18
|
var type = _ref.type,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
close = _ref.close,
|
|
20
|
+
duration = _ref.duration,
|
|
21
|
+
content = _ref.content,
|
|
22
|
+
icon = _ref.icon,
|
|
23
|
+
id = _ref.toastId,
|
|
24
|
+
title = _ref.title,
|
|
25
|
+
_ref$position = _ref.position,
|
|
26
|
+
position = _ref$position === void 0 ? 'top-right' : _ref$position;
|
|
32
27
|
(0, _react.useEffect)(function () {
|
|
33
28
|
var timer = setTimeout(function () {
|
|
34
29
|
close(id);
|
|
@@ -37,15 +32,12 @@ var Toast = function Toast(_ref) {
|
|
|
37
32
|
return clearTimeout(timer);
|
|
38
33
|
};
|
|
39
34
|
}, [duration, close, id]);
|
|
40
|
-
|
|
41
35
|
function handleCloseButtonClick() {
|
|
42
36
|
close(id);
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
var toastAnimationVariants = {
|
|
46
39
|
initial: function initial() {
|
|
47
40
|
var _ref2;
|
|
48
|
-
|
|
49
41
|
var positionDirection = ['top', 'bottom'].includes(position) ? 'y' : 'x';
|
|
50
42
|
var translateValue = position.indexOf('top') !== -1 ? position.indexOf('left') !== -1 ? -30 : 30 : position.indexOf('left') !== -1 ? -30 : 30;
|
|
51
43
|
return _ref2 = {}, _defineProperty(_ref2, positionDirection, translateValue), _defineProperty(_ref2, "opacity", 0), _ref2;
|
|
@@ -83,6 +75,5 @@ var Toast = function Toast(_ref) {
|
|
|
83
75
|
})
|
|
84
76
|
});
|
|
85
77
|
};
|
|
86
|
-
|
|
87
78
|
var _default = Toast;
|
|
88
79
|
exports.default = _default;
|
|
@@ -1,55 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = exports.ToastContext = void 0;
|
|
7
|
-
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
10
9
|
var _ = _interopRequireDefault(require(".."));
|
|
11
|
-
|
|
12
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
12
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
-
|
|
18
13
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
|
|
20
14
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
|
-
|
|
22
15
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
-
|
|
24
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
-
|
|
32
22
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
|
|
34
23
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
-
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
40
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
|
|
42
27
|
var ToastContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
43
28
|
exports.ToastContext = ToastContext;
|
|
44
|
-
|
|
45
29
|
var ToastProvider = function ToastProvider(_ref) {
|
|
46
30
|
var children = _ref.children;
|
|
47
|
-
|
|
48
31
|
var _useState = (0, _react.useState)([]),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
toasts = _useState2[0],
|
|
34
|
+
setToasts = _useState2[1];
|
|
53
35
|
var addToast = (0, _react.useCallback)(function (options) {
|
|
54
36
|
var toastOptions = {
|
|
55
37
|
config: _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -68,13 +50,10 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
68
50
|
var filterToast = prevState.filter(function (toast) {
|
|
69
51
|
return toast.id === id;
|
|
70
52
|
});
|
|
71
|
-
|
|
72
53
|
if (filterToast[0]) {
|
|
73
54
|
var _filterToast$0$config, _filterToast$0$config2;
|
|
74
|
-
|
|
75
55
|
(_filterToast$0$config = (_filterToast$0$config2 = filterToast[0].config).onClose) === null || _filterToast$0$config === void 0 ? void 0 : _filterToast$0$config.call(_filterToast$0$config2, id);
|
|
76
56
|
}
|
|
77
|
-
|
|
78
57
|
return prevState.filter(function (toast) {
|
|
79
58
|
return toast.id !== id;
|
|
80
59
|
});
|
|
@@ -89,6 +68,5 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
89
68
|
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {})]
|
|
90
69
|
});
|
|
91
70
|
};
|
|
92
|
-
|
|
93
71
|
var _default = ToastProvider;
|
|
94
72
|
exports.default = _default;
|
|
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _ToastProvider = require("../contexts/ToastProvider");
|
|
11
|
-
|
|
12
9
|
var useToast = function useToast() {
|
|
13
10
|
var _useContext = (0, _react.useContext)(_ToastProvider.ToastContext),
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
add = _useContext.add;
|
|
16
12
|
if (!add) {
|
|
17
13
|
throw new Error('useToast must be used within ToastProvider');
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
return add;
|
|
21
16
|
};
|
|
22
|
-
|
|
23
17
|
var _default = useToast;
|
|
24
18
|
exports.default = _default;
|
|
@@ -4,34 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _framerMotion = require("framer-motion");
|
|
11
|
-
|
|
12
9
|
var _Toast = _interopRequireDefault(require("./components/Toast"));
|
|
13
|
-
|
|
14
10
|
var _ReactPortal = require("../ReactPortal");
|
|
15
|
-
|
|
16
11
|
var _ToastProvider = require("./contexts/ToastProvider");
|
|
17
|
-
|
|
18
12
|
var _styles = require("./styles");
|
|
19
|
-
|
|
20
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
15
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
24
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
21
|
var ToastContainer = function ToastContainer() {
|
|
31
22
|
var _useContext = (0, _react.useContext)(_ToastProvider.ToastContext),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
toasts = _useContext.toasts,
|
|
24
|
+
remove = _useContext.remove;
|
|
35
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReactPortal.ReactPortal, {
|
|
36
26
|
wrapperId: "toast-root",
|
|
37
27
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledToastContainerOverlay, {
|
|
@@ -117,6 +107,5 @@ var ToastContainer = function ToastContainer() {
|
|
|
117
107
|
})
|
|
118
108
|
});
|
|
119
109
|
};
|
|
120
|
-
|
|
121
110
|
var _default = ToastContainer;
|
|
122
111
|
exports.default = _default;
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.StyledToastManagerOverlay = exports.StyledToastManagerInner = exports.StyledToastContainerOverlay = exports.StyledToastComponent = void 0;
|
|
7
|
-
|
|
8
7
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
-
|
|
10
8
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
-
|
|
16
11
|
var StyledToastContainerOverlay = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-wrap: break-word;\n"])));
|
|
17
|
-
|
|
18
12
|
exports.StyledToastContainerOverlay = StyledToastContainerOverlay;
|
|
19
|
-
|
|
20
13
|
var StyledToastManagerOverlay = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: fixed;\n pointer-events: none;\n width: 100%;\n height: 100%;\n z-index: ", ";\n top: 0;\n left: 0;\n\n & > div {\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n }\n"])), function (_ref) {
|
|
21
14
|
var theme = _ref.theme;
|
|
22
15
|
return theme.zIndex.level48;
|
|
@@ -33,16 +26,11 @@ var StyledToastManagerOverlay = _styled.default.div(_templateObject2 || (_templa
|
|
|
33
26
|
}, function (props) {
|
|
34
27
|
return props.position === 'bottom' && "\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n ";
|
|
35
28
|
});
|
|
36
|
-
|
|
37
29
|
exports.StyledToastManagerOverlay = StyledToastManagerOverlay;
|
|
38
|
-
|
|
39
30
|
var StyledToastManagerInner = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n padding: 1.5rem;\n width: 400px;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"])), function (_ref2) {
|
|
40
31
|
var theme = _ref2.theme;
|
|
41
32
|
return theme.zIndex.level48;
|
|
42
33
|
});
|
|
43
|
-
|
|
44
34
|
exports.StyledToastManagerInner = StyledToastManagerInner;
|
|
45
|
-
|
|
46
35
|
var StyledToastComponent = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n user-select: none;\n pointer-events: auto;\n"])));
|
|
47
|
-
|
|
48
36
|
exports.StyledToastComponent = StyledToastComponent;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
4
|
require("@testing-library/jest-dom");
|
|
6
|
-
|
|
7
5
|
var _buttonExample = _interopRequireDefault(require("./button-example"));
|
|
8
|
-
|
|
9
6
|
var _ToastProvider = _interopRequireDefault(require("./contexts/ToastProvider"));
|
|
10
|
-
|
|
11
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
-
|
|
17
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
15
|
var setup = function setup(props) {
|
|
22
16
|
return (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToastProvider.default, {
|
|
23
17
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttonExample.default, _objectSpread({}, props))
|
|
24
18
|
}));
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
describe('Toast', function () {
|
|
28
21
|
it('should it render the toast on the screen', function () {
|
|
29
22
|
var container = setup({
|
|
@@ -96,7 +89,6 @@ describe('Toast', function () {
|
|
|
96
89
|
});
|
|
97
90
|
it('should it render the toast on the screen and close it by alert close button', function () {
|
|
98
91
|
var _container$baseElemen;
|
|
99
|
-
|
|
100
92
|
var container = setup({
|
|
101
93
|
title: 'Toast Title',
|
|
102
94
|
content: 'Toast Message',
|
|
@@ -110,7 +102,6 @@ describe('Toast', function () {
|
|
|
110
102
|
});
|
|
111
103
|
it('should it call the callback provided in onClose prop', function () {
|
|
112
104
|
var _container$baseElemen2;
|
|
113
|
-
|
|
114
105
|
var onClose = jest.fn();
|
|
115
106
|
var container = setup({
|
|
116
107
|
title: 'Toast Title',
|
|
@@ -124,7 +115,6 @@ describe('Toast', function () {
|
|
|
124
115
|
});
|
|
125
116
|
it('should it call the callback provided in onClose prop and pass the id', function () {
|
|
126
117
|
var _container$baseElemen3;
|
|
127
|
-
|
|
128
118
|
var onClose = jest.fn();
|
|
129
119
|
var container = setup({
|
|
130
120
|
title: 'Toast Title',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { IconName } from '../Icon/types';
|
|
3
|
-
export
|
|
3
|
+
export type IToastConfig = {
|
|
4
4
|
title: string;
|
|
5
5
|
content: ReactNode;
|
|
6
6
|
position?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right';
|
|
@@ -9,22 +9,22 @@ export declare type IToastConfig = {
|
|
|
9
9
|
icon?: IconName;
|
|
10
10
|
onClose?: (id: string) => void;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type IToastList = {
|
|
13
13
|
id: string;
|
|
14
14
|
config: Required<Omit<IToastConfig, 'onClose'>> & {
|
|
15
15
|
onClose?: (id: string) => void;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type Toast = IToastConfig & {
|
|
19
19
|
toastId: string;
|
|
20
20
|
close: (id: string) => void;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type ToastContextProps = {
|
|
23
23
|
add: (options: IToastConfig) => void;
|
|
24
24
|
remove: (id: string) => void;
|
|
25
25
|
toasts: IToastList[];
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export type ToastProviderProps = {
|
|
28
28
|
children?: React.ReactNode;
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,CAAC;IACxF,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,GAAG;QAChD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;KAChC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,YAAY,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACrC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC"}
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.TooltipLabel = void 0;
|
|
7
|
-
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
10
9
|
var _Flex = _interopRequireDefault(require("../../../components/Flex"));
|
|
11
|
-
|
|
12
10
|
var _Typography = _interopRequireDefault(require("../../../components/Typography"));
|
|
13
|
-
|
|
14
11
|
var _styles = require("../styles");
|
|
15
|
-
|
|
16
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
13
|
var _excluded = ["tooltipPositions", "animationDuration", "setShowTooltip", "showLabelModal", "setShowLabelModal", "maxWidth", "isVisible"];
|
|
19
|
-
|
|
20
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
|
|
24
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
-
|
|
30
21
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
-
|
|
32
22
|
var TooltipLabel = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
33
23
|
var tooltipPositions = _ref.tooltipPositions,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
_ref$animationDuratio = _ref.animationDuration,
|
|
25
|
+
animationDuration = _ref$animationDuratio === void 0 ? 0.2 : _ref$animationDuratio,
|
|
26
|
+
setShowTooltip = _ref.setShowTooltip,
|
|
27
|
+
showLabelModal = _ref.showLabelModal,
|
|
28
|
+
setShowLabelModal = _ref.setShowLabelModal,
|
|
29
|
+
maxWidth = _ref.maxWidth,
|
|
30
|
+
isVisible = _ref.isVisible,
|
|
31
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
32
|
var labelRef = (0, _react.useRef)(null);
|
|
44
33
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
45
34
|
return labelRef.current;
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ExampleTooltip = ExampleTooltip;
|
|
7
|
-
|
|
8
7
|
var _ = _interopRequireDefault(require("."));
|
|
9
|
-
|
|
10
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function ExampleTooltip() {
|
|
15
11
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
16
12
|
style: {
|