@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,29 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("@testing-library/jest-dom");
|
|
4
|
-
|
|
5
4
|
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
5
|
var _testUtils = require("../../shared/tests/test-utils");
|
|
8
|
-
|
|
9
6
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
10
|
-
|
|
11
7
|
var _ = require(".");
|
|
12
|
-
|
|
13
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
10
|
+
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); }
|
|
17
11
|
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; }
|
|
18
|
-
|
|
19
12
|
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; }
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
23
16
|
var makeSut = function makeSut(props) {
|
|
24
17
|
var _render = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Thumbnail, _objectSpread({}, props))),
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
container = _render.container;
|
|
27
19
|
var file = new File(['any_content'], 'any_name.png', {
|
|
28
20
|
type: 'image/png'
|
|
29
21
|
});
|
|
@@ -34,7 +26,6 @@ var makeSut = function makeSut(props) {
|
|
|
34
26
|
input: input
|
|
35
27
|
};
|
|
36
28
|
};
|
|
37
|
-
|
|
38
29
|
describe('Thumbnail', function () {
|
|
39
30
|
beforeEach(function () {
|
|
40
31
|
window.URL.createObjectURL = jest.fn(function () {
|
|
@@ -50,33 +41,26 @@ describe('Thumbnail', function () {
|
|
|
50
41
|
});
|
|
51
42
|
it('Should input recieve file', function () {
|
|
52
43
|
var _makeSut = makeSut(),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
file = _makeSut.file,
|
|
45
|
+
input = _makeSut.input;
|
|
56
46
|
_userEvent.default.upload(input, file);
|
|
57
|
-
|
|
58
47
|
expect(input.files && input.files[0]).toStrictEqual(file);
|
|
59
48
|
});
|
|
60
49
|
it('Should render preview image', function () {
|
|
61
50
|
var _makeSut2 = makeSut(),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
file = _makeSut2.file,
|
|
52
|
+
input = _makeSut2.input;
|
|
65
53
|
_userEvent.default.upload(input, file);
|
|
66
|
-
|
|
67
54
|
expect(_react.screen.getByAltText(file.name)).toBeInTheDocument();
|
|
68
55
|
});
|
|
69
56
|
it('Should return image on onSelect', function () {
|
|
70
57
|
var mockState = jest.fn();
|
|
71
|
-
|
|
72
58
|
var _makeSut3 = makeSut({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
getThumbImage: mockState
|
|
60
|
+
}),
|
|
61
|
+
file = _makeSut3.file,
|
|
62
|
+
input = _makeSut3.input;
|
|
78
63
|
_userEvent.default.upload(input, file);
|
|
79
|
-
|
|
80
64
|
expect(mockState).toBeCalledWith(file);
|
|
81
65
|
});
|
|
82
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Thumbnail/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AAED,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Thumbnail/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _validateFileSize = require("./validate-file-size");
|
|
8
|
-
|
|
9
7
|
Object.keys(_validateFileSize).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _validateFileSize[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_validateFileSize).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _validateFileType = require("./validate-file-type");
|
|
21
|
-
|
|
22
18
|
Object.keys(_validateFileType).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _validateFileType[key]) return;
|
|
@@ -4,18 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Timeline = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("@emotion/react");
|
|
9
|
-
|
|
10
8
|
var _styles = require("../styles");
|
|
11
|
-
|
|
12
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
10
|
var Timeline = function Timeline(_ref) {
|
|
15
11
|
var children = _ref.children,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
_ref$position = _ref.position,
|
|
13
|
+
position = _ref$position === void 0 ? 'left' : _ref$position,
|
|
14
|
+
fullWidth = _ref.fullWidth;
|
|
19
15
|
var flexDirections = {
|
|
20
16
|
left: 'row',
|
|
21
17
|
right: 'row-reverse',
|
|
@@ -31,5 +27,4 @@ var Timeline = function Timeline(_ref) {
|
|
|
31
27
|
})
|
|
32
28
|
});
|
|
33
29
|
};
|
|
34
|
-
|
|
35
30
|
exports.Timeline = Timeline;
|
|
@@ -1,38 +1,28 @@
|
|
|
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.TimelineContent = void 0;
|
|
7
|
-
|
|
8
8
|
var _Typography = _interopRequireDefault(require("../../Typography"));
|
|
9
|
-
|
|
10
9
|
var _Flex = _interopRequireDefault(require("../../Flex"));
|
|
11
|
-
|
|
12
10
|
var _styles = require("../styles");
|
|
13
|
-
|
|
14
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
12
|
var _excluded = ["title", "description", "date"];
|
|
17
|
-
|
|
18
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
14
|
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; }
|
|
21
|
-
|
|
22
15
|
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; }
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
26
19
|
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; }
|
|
27
|
-
|
|
28
20
|
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; }
|
|
29
|
-
|
|
30
21
|
var TimelineContent = function TimelineContent(_ref) {
|
|
31
22
|
var title = _ref.title,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
description = _ref.description,
|
|
24
|
+
date = _ref.date,
|
|
25
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
26
|
var parseDate = date && new Date(date);
|
|
37
27
|
var getDay = parseDate === null || parseDate === void 0 ? void 0 : parseDate.getDate();
|
|
38
28
|
var getShortMonth = (parseDate === null || parseDate === void 0 ? void 0 : parseDate.toLocaleString('default', {
|
|
@@ -68,5 +58,4 @@ var TimelineContent = function TimelineContent(_ref) {
|
|
|
68
58
|
})]
|
|
69
59
|
}));
|
|
70
60
|
};
|
|
71
|
-
|
|
72
61
|
exports.TimelineContent = TimelineContent;
|
|
@@ -1,33 +1,25 @@
|
|
|
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.TimelineItem = void 0;
|
|
7
|
-
|
|
8
8
|
var _styles = require("../styles");
|
|
9
|
-
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
10
|
var _excluded = ["children"];
|
|
13
|
-
|
|
14
11
|
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; }
|
|
15
|
-
|
|
16
12
|
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; }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
20
16
|
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
17
|
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
18
|
var TimelineItem = function TimelineItem(_ref) {
|
|
25
19
|
var children = _ref.children,
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TimelineItemContainer, _objectSpread(_objectSpread({}, rest), {}, {
|
|
29
22
|
children: children
|
|
30
23
|
}));
|
|
31
24
|
};
|
|
32
|
-
|
|
33
25
|
exports.TimelineItem = TimelineItem;
|
|
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TimelineSeparator = void 0;
|
|
7
|
-
|
|
8
7
|
var _styles = require("../styles");
|
|
9
|
-
|
|
10
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
9
|
var TimelineSeparator = function TimelineSeparator(_ref) {
|
|
13
10
|
var icon = _ref.icon,
|
|
14
|
-
|
|
11
|
+
circleColor = _ref.circleColor;
|
|
15
12
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.TimelineSeparatorContainer, {
|
|
16
13
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TimelineSeparatorLine, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TimelineSeparatorCircle, {
|
|
17
14
|
icon: icon === null || icon === void 0 ? void 0 : icon.toString().length,
|
|
@@ -20,5 +17,4 @@ var TimelineSeparator = function TimelineSeparator(_ref) {
|
|
|
20
17
|
})]
|
|
21
18
|
});
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
exports.TimelineSeparator = TimelineSeparator;
|
|
@@ -27,11 +27,7 @@ Object.defineProperty(exports, "TimelineSeparator", {
|
|
|
27
27
|
return _TimelineSeparator.TimelineSeparator;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
var _Timeline = require("./components/Timeline");
|
|
32
|
-
|
|
33
31
|
var _TimelineItem = require("./components/TimelineItem");
|
|
34
|
-
|
|
35
32
|
var _TimelineSeparator = require("./components/TimelineSeparator");
|
|
36
|
-
|
|
37
33
|
var _TimelineContent = require("./components/TimelineContent");
|
|
@@ -4,41 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TimelineSeparatorLine = exports.TimelineSeparatorContainer = exports.TimelineSeparatorCircle = exports.TimelineItemContent = exports.TimelineItemContainer = exports.TimelineContainer = void 0;
|
|
7
|
-
|
|
8
7
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
-
|
|
10
8
|
var _getColorValue = require("./../../utils/getColorValue");
|
|
11
|
-
|
|
12
9
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
17
|
-
|
|
18
12
|
var TimelineContainer = _styled.default.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n list-style: none;\n margin: 0;\n width: ", ";\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 1.25rem;\n"])), function (props) {
|
|
19
13
|
return props.fullWidth ? '100%' : '23.75rem';
|
|
20
14
|
});
|
|
21
|
-
|
|
22
15
|
exports.TimelineContainer = TimelineContainer;
|
|
23
|
-
|
|
24
16
|
var TimelineItemContainer = _styled.default.li(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n width: 100%;\n gap: 0.5rem;\n\n ", "\n"])), function (props) {
|
|
25
17
|
return props.theme.position !== 'alternate' ? props.theme.position : 'row';
|
|
26
18
|
}, function (props) {
|
|
27
19
|
return props.theme.position === 'alternate' && "\n &:nth-of-type(even) {\n flex-direction: row-reverse;\n }\n ";
|
|
28
20
|
});
|
|
29
|
-
|
|
30
21
|
exports.TimelineItemContainer = TimelineItemContainer;
|
|
31
|
-
|
|
32
22
|
var TimelineSeparatorContainer = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n min-width: 66px;\n"])));
|
|
33
|
-
|
|
34
23
|
exports.TimelineSeparatorContainer = TimelineSeparatorContainer;
|
|
35
|
-
|
|
36
24
|
var TimelineSeparatorLine = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 66px;\n width: 2px;\n background-color: ", ";\n"])), function (props) {
|
|
37
25
|
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.neutral5 : props.theme.colors.neutral.neutral1;
|
|
38
26
|
});
|
|
39
|
-
|
|
40
27
|
exports.TimelineSeparatorLine = TimelineSeparatorLine;
|
|
41
|
-
|
|
42
28
|
var TimelineSeparatorCircle = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 999999px;\n\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n background-color: ", ";\n\n & svg {\n color: ", ";\n }\n"])), function (props) {
|
|
43
29
|
return props.icon ? '10px' : '4px';
|
|
44
30
|
}, function (props) {
|
|
@@ -46,9 +32,6 @@ var TimelineSeparatorCircle = _styled.default.div(_templateObject5 || (_template
|
|
|
46
32
|
}, function (props) {
|
|
47
33
|
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black;
|
|
48
34
|
});
|
|
49
|
-
|
|
50
35
|
exports.TimelineSeparatorCircle = TimelineSeparatorCircle;
|
|
51
|
-
|
|
52
36
|
var TimelineItemContent = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1.25rem;\n flex: 1;\n\n & p {\n margin: 0;\n }\n"])));
|
|
53
|
-
|
|
54
37
|
exports.TimelineItemContent = TimelineItemContent;
|
|
@@ -1,152 +1,140 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
4
|
require("@testing-library/jest-dom/extend-expect");
|
|
6
|
-
|
|
7
5
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
8
|
-
|
|
9
6
|
var _ = require(".");
|
|
10
|
-
|
|
11
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
9
|
describe('Timeline', function () {
|
|
16
10
|
it('should it render the Timeline component with childrens', function () {
|
|
17
11
|
var _render = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
13
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
14
|
+
title: "Title",
|
|
15
|
+
description: "Description",
|
|
16
|
+
date: new Date()
|
|
17
|
+
})]
|
|
18
|
+
})
|
|
19
|
+
})),
|
|
20
|
+
container = _render.container;
|
|
28
21
|
expect(container).toBeInTheDocument();
|
|
29
22
|
});
|
|
30
23
|
it('should it render the Timeline component with different position', function () {
|
|
31
24
|
var _render2 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
position: "right",
|
|
26
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
28
|
+
title: "Title",
|
|
29
|
+
description: "Description",
|
|
30
|
+
date: new Date()
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
33
|
+
})),
|
|
34
|
+
container = _render2.container;
|
|
43
35
|
expect(container).toBeInTheDocument();
|
|
44
36
|
});
|
|
45
37
|
it('should it render the Timeline component with full width', function () {
|
|
46
38
|
var _render3 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
fullWidth: true,
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
42
|
+
title: "Title",
|
|
43
|
+
description: "Description",
|
|
44
|
+
date: new Date()
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
})),
|
|
48
|
+
container = _render3.container;
|
|
58
49
|
expect(container).toBeInTheDocument();
|
|
59
50
|
});
|
|
60
51
|
it('should it render the TimelineSeparator component with an icon', function () {
|
|
61
52
|
var _render4 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
54
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
55
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
56
|
+
name: "shopping-cart"
|
|
57
|
+
})
|
|
58
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
59
|
+
title: "Title",
|
|
60
|
+
description: "Description",
|
|
61
|
+
date: new Date()
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
})),
|
|
65
|
+
container = _render4.container;
|
|
76
66
|
expect(container).toBeInTheDocument();
|
|
77
67
|
expect(container.querySelector('svg')).toBeInTheDocument();
|
|
78
68
|
});
|
|
79
69
|
it('should it render the TimelineSeparator component with an icon and different color in the circle', function () {
|
|
80
70
|
var _render5 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
71
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
72
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
73
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
74
|
+
name: "shopping-cart"
|
|
75
|
+
}),
|
|
76
|
+
circleColor: "primary.default"
|
|
77
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
78
|
+
title: "Title",
|
|
79
|
+
description: "Description",
|
|
80
|
+
date: new Date()
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
})),
|
|
84
|
+
container = _render5.container;
|
|
96
85
|
expect(container).toBeInTheDocument();
|
|
97
86
|
expect(container.querySelector('svg')).toBeInTheDocument();
|
|
98
87
|
});
|
|
99
88
|
it('should it render the Timeline component with multiply childrens', function () {
|
|
100
89
|
var _render6 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Timeline, {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
90
|
+
position: "alternate",
|
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
92
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
93
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
94
|
+
name: "shopping-cart"
|
|
95
|
+
}),
|
|
96
|
+
circleColor: "primary.default"
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
98
|
+
title: "Title",
|
|
99
|
+
description: "Description",
|
|
100
|
+
date: new Date()
|
|
101
|
+
})]
|
|
102
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
104
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
105
|
+
name: "shopping-cart"
|
|
106
|
+
}),
|
|
107
|
+
circleColor: "primary.default"
|
|
108
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
109
|
+
title: "Title",
|
|
110
|
+
description: "Description",
|
|
111
|
+
date: new Date()
|
|
112
|
+
})]
|
|
113
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
114
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
115
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
116
|
+
name: "shopping-cart"
|
|
117
|
+
}),
|
|
118
|
+
circleColor: "primary.default"
|
|
119
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
120
|
+
title: "Title",
|
|
121
|
+
description: "Description",
|
|
122
|
+
date: new Date()
|
|
123
|
+
})]
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
125
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
126
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
127
|
+
name: "shopping-cart"
|
|
128
|
+
}),
|
|
129
|
+
circleColor: "primary.default"
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
131
|
+
title: "Title",
|
|
132
|
+
description: "Description",
|
|
133
|
+
date: new Date()
|
|
134
|
+
})]
|
|
134
135
|
})]
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
138
|
-
name: "shopping-cart"
|
|
139
|
-
}),
|
|
140
|
-
circleColor: "primary.default"
|
|
141
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
142
|
-
title: "Title",
|
|
143
|
-
description: "Description",
|
|
144
|
-
date: new Date()
|
|
145
|
-
})]
|
|
146
|
-
})]
|
|
147
|
-
})),
|
|
148
|
-
container = _render6.container;
|
|
149
|
-
|
|
136
|
+
})),
|
|
137
|
+
container = _render6.container;
|
|
150
138
|
expect(container).toBeInTheDocument();
|
|
151
139
|
});
|
|
152
140
|
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { ExtendThemeProps, GlobalColorsProps } from '../../shared/theme/theme.types';
|
|
3
|
-
export
|
|
3
|
+
export type ITimelineProps = HTMLAttributes<HTMLUListElement> & {
|
|
4
4
|
position?: 'left' | 'right' | 'alternate';
|
|
5
5
|
fullWidth?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type ITimelineContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
8
8
|
title: string;
|
|
9
9
|
description: string;
|
|
10
10
|
date?: Date;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type ITimelineSeparatorProps = HTMLAttributes<HTMLDivElement> & {
|
|
13
13
|
icon?: ReactNode;
|
|
14
14
|
circleColor?: GlobalColorsProps | (string & {});
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type GenericStyledProps = {
|
|
17
17
|
theme?: ExtendThemeProps & {
|
|
18
18
|
position?: 'left' | 'right' | 'alternate';
|
|
19
19
|
};
|