@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,34 +1,27 @@
|
|
|
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 = void 0;
|
|
7
|
-
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
10
|
var _excluded = ["isLocked", "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 FocusLock = function FocusLock(_ref) {
|
|
25
19
|
var _ref$isLocked = _ref.isLocked,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
isLocked = _ref$isLocked === void 0 ? true : _ref$isLocked,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var rootNode = (0, _react.useRef)(null);
|
|
24
|
+
// const focusableItems = useRef([]);
|
|
32
25
|
var focusableItems = (0, _react.useRef)(null);
|
|
33
26
|
(0, _react.useEffect)(function () {
|
|
34
27
|
var updateFocusableItems = function updateFocusableItems() {
|
|
@@ -36,18 +29,15 @@ var FocusLock = function FocusLock(_ref) {
|
|
|
36
29
|
focusableItems.current = rootNode.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), video');
|
|
37
30
|
}
|
|
38
31
|
};
|
|
39
|
-
|
|
40
32
|
var observer = new MutationObserver(function () {
|
|
41
33
|
updateFocusableItems();
|
|
42
34
|
});
|
|
43
35
|
updateFocusableItems();
|
|
44
|
-
|
|
45
36
|
if (rootNode !== null && rootNode !== void 0 && rootNode.current) {
|
|
46
37
|
observer.observe(rootNode.current, {
|
|
47
38
|
childList: true
|
|
48
39
|
});
|
|
49
40
|
}
|
|
50
|
-
|
|
51
41
|
return function () {
|
|
52
42
|
observer.disconnect();
|
|
53
43
|
};
|
|
@@ -56,34 +46,32 @@ var FocusLock = function FocusLock(_ref) {
|
|
|
56
46
|
var handleKeyPress = function handleKeyPress(event) {
|
|
57
47
|
if (!focusableItems.current) return;
|
|
58
48
|
var key = event.key,
|
|
59
|
-
|
|
49
|
+
shiftKey = event.shiftKey;
|
|
60
50
|
var _focusableItems$curre = focusableItems.current,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
length = _focusableItems$curre.length,
|
|
52
|
+
firstItem = _focusableItems$curre[0],
|
|
53
|
+
lastItem = _focusableItems$curre[length - 1];
|
|
65
54
|
if (isLocked && key === 'Tab') {
|
|
66
55
|
// If only one item then prevent tabbing when locked
|
|
67
56
|
if (length === 1) {
|
|
68
57
|
event.preventDefault();
|
|
69
58
|
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
59
|
+
}
|
|
72
60
|
|
|
61
|
+
// If focused on last item then focus on first item when tab is pressed
|
|
73
62
|
if (!shiftKey && document.activeElement === lastItem) {
|
|
74
63
|
event.preventDefault();
|
|
75
64
|
firstItem.focus();
|
|
76
65
|
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
66
|
+
}
|
|
79
67
|
|
|
68
|
+
// If focused on first item then focus on last item when shift + tab is pressed
|
|
80
69
|
if (shiftKey && document.activeElement === firstItem) {
|
|
81
70
|
event.preventDefault();
|
|
82
71
|
lastItem.focus();
|
|
83
72
|
}
|
|
84
73
|
}
|
|
85
74
|
};
|
|
86
|
-
|
|
87
75
|
window.addEventListener('keydown', handleKeyPress);
|
|
88
76
|
return function () {
|
|
89
77
|
window.removeEventListener('keydown', handleKeyPress);
|
|
@@ -94,6 +82,5 @@ var FocusLock = function FocusLock(_ref) {
|
|
|
94
82
|
children: children
|
|
95
83
|
}));
|
|
96
84
|
};
|
|
97
|
-
|
|
98
85
|
var _default = FocusLock;
|
|
99
86
|
exports.default = _default;
|
|
@@ -7,32 +7,27 @@ exports.formatCurrency = formatCurrency;
|
|
|
7
7
|
exports.formatCurrencyWithoutSymbol = formatCurrencyWithoutSymbol;
|
|
8
8
|
exports.formatNumber = formatNumber;
|
|
9
9
|
exports.sanitizeNumber = sanitizeNumber;
|
|
10
|
-
|
|
11
10
|
function formatCurrency(_ref) {
|
|
12
11
|
var amount = _ref.amount,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
_ref$currency = _ref.currency,
|
|
13
|
+
currency = _ref$currency === void 0 ? 'BRL' : _ref$currency,
|
|
14
|
+
_ref$locale = _ref.locale,
|
|
15
|
+
locale = _ref$locale === void 0 ? 'pt-BR' : _ref$locale;
|
|
17
16
|
return new Intl.NumberFormat(locale, {
|
|
18
17
|
style: 'currency',
|
|
19
18
|
currency: currency
|
|
20
19
|
}).format(amount);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
function formatNumber(number) {
|
|
24
22
|
if (number) return number.replace(/[^\d.,]/g, ''); // Removes any character that is not a number, comma or dot.
|
|
25
|
-
|
|
26
23
|
return '';
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
function sanitizeNumber(number) {
|
|
30
26
|
return number ? number.replace(/[^\d.,]/g, '') // Removes any character that is not a number, comma or dot.
|
|
31
27
|
.replace(/(\.|,)(?=\d*(\.|,))/g, '') // Removes any dot or comma but the last one.
|
|
32
28
|
.replace(/,(\d*)$/, '.$1') // Assures the last dot or comma is a dot.
|
|
33
29
|
: '';
|
|
34
30
|
}
|
|
35
|
-
|
|
36
31
|
function formatCurrencyWithoutSymbol(value) {
|
|
37
32
|
if (value) {
|
|
38
33
|
var sanitizedNumber = sanitizeNumber(value);
|
|
@@ -42,6 +37,5 @@ function formatCurrencyWithoutSymbol(value) {
|
|
|
42
37
|
minimumFractionDigits: 2
|
|
43
38
|
}).format(Number(sanitizedNumber)).replace('R$', '');
|
|
44
39
|
}
|
|
45
|
-
|
|
46
40
|
return '';
|
|
47
41
|
}
|
|
@@ -5,5 +5,5 @@ export declare const devices: {
|
|
|
5
5
|
'monitor-wide': number;
|
|
6
6
|
'monitor-ultra': number;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type DeviceTypes = 'mobile' | 'tablet' | 'monitor-small' | 'monitor-wide' | 'monitor-ultra' | number;
|
|
9
9
|
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/devices.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;CAMnB,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/devices.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;CAMnB,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,cAAc,GACd,eAAe,GACf,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type BreakpointsConfig = {
|
|
2
2
|
base: number;
|
|
3
3
|
sm: number;
|
|
4
4
|
md: number;
|
|
@@ -6,8 +6,8 @@ declare type BreakpointsConfig = {
|
|
|
6
6
|
xl: number;
|
|
7
7
|
xxl: number;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type BreakpointName = 'base' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
10
|
+
type BreakpointValue<T> = {
|
|
11
11
|
[key in BreakpointName]?: T;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useBreakpoints.tsx"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useBreakpoints.tsx"],"names":[],"mappings":"AAGA,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,KAAK,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEjE,KAAK,eAAe,CAAC,CAAC,IAAI;KAEvB,GAAG,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,uBAAwB,iBAAiB;;;CAqGnE,CAAC"}
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useBreakpoints = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _useWindowSize = require("./useWindowSize");
|
|
11
|
-
|
|
12
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
|
|
14
10
|
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."); }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
12
|
+
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; }
|
|
13
|
+
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; } }
|
|
22
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
|
|
24
15
|
/**
|
|
25
16
|
* It returns a function that takes a breakpoint value object and returns the value
|
|
26
17
|
* of the closest breakpoint to the current window size
|
|
@@ -31,10 +22,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
31
22
|
*/
|
|
32
23
|
var useBreakpoints = function useBreakpoints(breakpointsConfig) {
|
|
33
24
|
var _useState = (0, _react.useState)(null),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
breakpoint = _useState2[0],
|
|
27
|
+
setBreakpoint = _useState2[1];
|
|
38
28
|
var defaultBreakpoints = {
|
|
39
29
|
base: 1,
|
|
40
30
|
sm: 480,
|
|
@@ -45,74 +35,56 @@ var useBreakpoints = function useBreakpoints(breakpointsConfig) {
|
|
|
45
35
|
};
|
|
46
36
|
var breakpoints = breakpointsConfig || defaultBreakpoints;
|
|
47
37
|
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
48
|
-
|
|
49
38
|
function breakpointPicker(breakpointValues) {
|
|
50
39
|
if (!breakpoint) return;
|
|
51
40
|
var closestBreakpoint = getClosestBreakpointName(breakpoint, breakpointValues, breakpoints);
|
|
52
41
|
if (!closestBreakpoint) return;
|
|
53
42
|
return breakpointValues[closestBreakpoint];
|
|
54
43
|
}
|
|
55
|
-
|
|
56
44
|
function currentBreakpointWidth(windowSize, breakpoints) {
|
|
57
45
|
var response;
|
|
58
|
-
|
|
59
46
|
if (breakpoints.base <= windowSize.width) {
|
|
60
47
|
response = breakpoints.base;
|
|
61
48
|
}
|
|
62
|
-
|
|
63
49
|
if (breakpoints.sm <= windowSize.width) {
|
|
64
50
|
response = breakpoints.sm;
|
|
65
51
|
}
|
|
66
|
-
|
|
67
52
|
if (breakpoints.md <= windowSize.width) {
|
|
68
53
|
response = breakpoints.md;
|
|
69
54
|
}
|
|
70
|
-
|
|
71
55
|
if (breakpoints.lg <= windowSize.width) {
|
|
72
56
|
response = breakpoints.lg;
|
|
73
57
|
}
|
|
74
|
-
|
|
75
58
|
if (breakpoints.xl <= windowSize.width) {
|
|
76
59
|
response = breakpoints.xl;
|
|
77
60
|
}
|
|
78
|
-
|
|
79
61
|
if (breakpoints.xxl <= windowSize.width) {
|
|
80
62
|
response = breakpoints.xxl;
|
|
81
63
|
}
|
|
82
|
-
|
|
83
64
|
return response;
|
|
84
65
|
}
|
|
85
|
-
|
|
86
66
|
function getClosestBreakpointName(activeBreakpoint, breakpointValues, breakpoints) {
|
|
87
67
|
var breakpointIndex = Object.keys(breakpointValues).findIndex(function (breakpoint) {
|
|
88
68
|
return breakpoint === activeBreakpoint;
|
|
89
69
|
});
|
|
90
|
-
|
|
91
70
|
if (breakpointIndex !== -1) {
|
|
92
71
|
return activeBreakpoint;
|
|
93
72
|
}
|
|
94
|
-
|
|
95
73
|
var stopIndex = Object.keys(breakpoints).indexOf(activeBreakpoint);
|
|
96
|
-
|
|
97
74
|
while (stopIndex >= 0) {
|
|
98
75
|
var key = Object.keys(breakpoints)[stopIndex];
|
|
99
|
-
|
|
100
76
|
if (Object.prototype.hasOwnProperty.call(breakpointValues, key)) {
|
|
101
77
|
breakpointIndex = stopIndex;
|
|
102
78
|
break;
|
|
103
79
|
}
|
|
104
|
-
|
|
105
80
|
stopIndex -= 1;
|
|
106
81
|
}
|
|
107
|
-
|
|
108
82
|
if (breakpointIndex !== -1) {
|
|
109
83
|
var _key = Object.keys(breakpoints)[breakpointIndex];
|
|
110
84
|
return _key;
|
|
111
85
|
}
|
|
112
|
-
|
|
113
86
|
return Object.keys(breakpointValues)[0];
|
|
114
87
|
}
|
|
115
|
-
|
|
116
88
|
(0, _react.useEffect)(function () {
|
|
117
89
|
var breakpointWidth = currentBreakpointWidth(windowSize, breakpoints);
|
|
118
90
|
if (!breakpointWidth) return;
|
|
@@ -126,5 +98,4 @@ var useBreakpoints = function useBreakpoints(breakpointsConfig) {
|
|
|
126
98
|
breakpointPicker: breakpointPicker
|
|
127
99
|
};
|
|
128
100
|
};
|
|
129
|
-
|
|
130
101
|
exports.useBreakpoints = useBreakpoints;
|
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDebounce = useDebounce;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
|
|
12
9
|
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."); }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
17
|
-
|
|
18
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
13
|
+
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; }
|
|
22
14
|
function useDebounce(callback, delay) {
|
|
23
15
|
var eachStep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
24
16
|
var argsState = (0, _react.useRef)();
|
|
@@ -27,14 +19,11 @@ function useDebounce(callback, delay) {
|
|
|
27
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
20
|
args[_key] = arguments[_key];
|
|
29
21
|
}
|
|
30
|
-
|
|
31
22
|
argsState.current = args;
|
|
32
|
-
|
|
33
23
|
if (!eachStep && timeout.current) {
|
|
34
24
|
clearTimeout(timeout.current);
|
|
35
25
|
timeout.current = undefined;
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
if (!timeout.current) {
|
|
39
28
|
timeout.current = setTimeout(function () {
|
|
40
29
|
if (argsState !== null && argsState !== void 0 && argsState.current) callback.apply(void 0, _toConsumableArray(argsState.current));
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDevices = useDevices;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _devices = require("./devices");
|
|
11
|
-
|
|
12
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
|
|
14
10
|
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."); }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
|
|
12
|
+
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; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // Types
|
|
24
15
|
/**
|
|
25
16
|
* Checks if the screen width matches the device in a certain direction everytime the screen resizes.
|
|
26
17
|
* @param device The target device to compare. Can use one of the specified devices or a custom one passing a number.
|
|
@@ -29,24 +20,19 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
29
20
|
*/
|
|
30
21
|
function useDevices(device) {
|
|
31
22
|
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'down';
|
|
32
|
-
|
|
33
23
|
var _useState = (0, _react.useState)(false),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
match = _useState2[0],
|
|
26
|
+
setMatch = _useState2[1];
|
|
38
27
|
var onWindowResize = (0, _react.useCallback)(function () {
|
|
39
28
|
var point = typeof device === 'number' ? device : _devices.devices[device];
|
|
40
|
-
|
|
41
29
|
switch (direction) {
|
|
42
30
|
case 'up':
|
|
43
31
|
setMatch(window.innerWidth >= point);
|
|
44
32
|
break;
|
|
45
|
-
|
|
46
33
|
case 'down':
|
|
47
34
|
setMatch(window.innerWidth <= point);
|
|
48
35
|
break;
|
|
49
|
-
|
|
50
36
|
default:
|
|
51
37
|
throw new Error("\"".concat(direction, "\" is not a valid device direction."));
|
|
52
38
|
}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDisableBodyScroll = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function disableBodyOverflow(noScrollbarPadding) {
|
|
11
9
|
if (noScrollbarPadding) {
|
|
12
10
|
document.body.style.paddingRight = "0px";
|
|
@@ -17,36 +15,30 @@ function disableBodyOverflow(noScrollbarPadding) {
|
|
|
17
15
|
document.body.style.overflow = 'hidden';
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
function enableBodyOverflow() {
|
|
22
19
|
document.body.style.overflow = '';
|
|
23
20
|
document.body.style.paddingRight = '';
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
function setBodyOverflow(isDisabled, type, noScrollbarPadding) {
|
|
27
23
|
// isDisabled body scroll when type modal:
|
|
28
24
|
if (isDisabled && type === 'modal') {
|
|
29
25
|
document.body.setAttribute('data-modal-open', 'true');
|
|
30
26
|
return disableBodyOverflow(noScrollbarPadding);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
}
|
|
28
|
+
// enable body scroll when type modal:
|
|
34
29
|
if (!isDisabled && type === 'modal') {
|
|
35
30
|
document.body.setAttribute('data-modal-open', 'false');
|
|
36
31
|
return enableBodyOverflow();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
}
|
|
33
|
+
// isDisabled body scroll when type child_element:
|
|
40
34
|
if (isDisabled && type === 'child_element') {
|
|
41
35
|
if (document.body.getAttribute('data-modal-open') === 'false') return disableBodyOverflow(noScrollbarPadding);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
}
|
|
37
|
+
// enable body scroll when type child_element:
|
|
45
38
|
if (!isDisabled && type === 'child_element') {
|
|
46
39
|
if (document.body.getAttribute('data-modal-open') === 'false') return enableBodyOverflow();
|
|
47
40
|
}
|
|
48
41
|
}
|
|
49
|
-
|
|
50
42
|
var useDisableBodyScroll = function useDisableBodyScroll(isDisabled) {
|
|
51
43
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'child_element';
|
|
52
44
|
var noScrollbarPadding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -57,5 +49,4 @@ var useDisableBodyScroll = function useDisableBodyScroll(isDisabled) {
|
|
|
57
49
|
};
|
|
58
50
|
}, [isDisabled, type, noScrollbarPadding]);
|
|
59
51
|
};
|
|
60
|
-
|
|
61
52
|
exports.useDisableBodyScroll = useDisableBodyScroll;
|
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useKeyPress = useKeyPress;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function useKeyPress(key, action) {
|
|
11
9
|
(0, _react.useEffect)(function () {
|
|
12
10
|
var handlePress = function handlePress(event) {
|
|
13
11
|
if (event.key === key) action();
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
window.addEventListener('keydown', handlePress);
|
|
17
14
|
return function () {
|
|
18
15
|
window.removeEventListener('keydown', handlePress);
|
|
@@ -4,28 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useObserver = useObserver;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var defaultOptions = {
|
|
11
9
|
root: null,
|
|
12
10
|
rootMargin: '20px',
|
|
13
11
|
threshold: 1.0
|
|
14
12
|
};
|
|
13
|
+
|
|
15
14
|
/* It's a custom hook that uses the Intersection Observer API to
|
|
16
15
|
detect when an element is in the viewport. */
|
|
17
|
-
|
|
18
16
|
function useObserver(ref, callback, options) {
|
|
19
17
|
(0, _react.useEffect)(function () {
|
|
20
18
|
var observer = new IntersectionObserver(function (entities) {
|
|
21
19
|
var target = entities[0];
|
|
22
|
-
|
|
23
20
|
if (target.isIntersecting) {
|
|
24
21
|
if (options && Object.keys(options).includes('enabled')) return options.enabled && callback();
|
|
25
22
|
callback();
|
|
26
23
|
}
|
|
27
24
|
}, options || defaultOptions);
|
|
28
|
-
|
|
29
25
|
if (ref.current) {
|
|
30
26
|
observer.observe(ref.current);
|
|
31
27
|
}
|
|
@@ -4,34 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useOnClickOutside = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var useOnClickOutside = function useOnClickOutside(ref, closeMenu) {
|
|
11
9
|
(0, _react.useEffect)(function () {
|
|
12
10
|
var listener = function listener(event) {
|
|
13
11
|
if (Array.isArray(ref)) {
|
|
14
12
|
var hasTarget = ref.find(function (ref) {
|
|
15
13
|
var _ref$current;
|
|
16
|
-
|
|
17
14
|
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.contains(event.target);
|
|
18
15
|
});
|
|
19
16
|
if (hasTarget) return;
|
|
20
17
|
return closeMenu();
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
if (ref.current && event.target && ref.current.contains(event.target)) {
|
|
24
20
|
return;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
closeMenu();
|
|
28
23
|
};
|
|
29
|
-
|
|
30
24
|
document.addEventListener('mousedown', listener);
|
|
31
25
|
return function () {
|
|
32
26
|
document.removeEventListener('mousedown', listener);
|
|
33
27
|
};
|
|
34
28
|
}, [ref, closeMenu]);
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
exports.useOnClickOutside = useOnClickOutside;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useWindowSize.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useWindowSize.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,aAAa;WACe,MAAM;YAAU,MAAM;EAuBjE"}
|
|
@@ -4,37 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useWindowSize = useWindowSize;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
-
|
|
12
9
|
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."); }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
20
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
|
|
22
14
|
function useWindowSize() {
|
|
23
15
|
var _useState = (0, _react.useState)({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0
|
|
18
|
+
}),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
size = _useState2[0],
|
|
21
|
+
setSize = _useState2[1];
|
|
31
22
|
function onWindowResize() {
|
|
32
23
|
setSize({
|
|
33
24
|
width: window.innerWidth,
|
|
34
25
|
height: window.innerHeight
|
|
35
26
|
});
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
(0, _react.useEffect)(function () {
|
|
39
29
|
onWindowResize();
|
|
40
30
|
window.addEventListener('resize', onWindowResize);
|