@tecsinapse/react-core 1.21.1-beta.1 → 1.21.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Avatar/Avatar.cjs +38 -0
- package/dist/components/atoms/Avatar/Avatar.cjs.map +1 -0
- package/dist/components/atoms/Avatar/Avatar.mjs +32 -0
- package/dist/components/atoms/Avatar/Avatar.mjs.map +1 -0
- package/dist/components/atoms/Avatar/helpers.cjs +14 -0
- package/dist/components/atoms/Avatar/helpers.cjs.map +1 -0
- package/dist/components/atoms/Avatar/helpers.mjs +10 -0
- package/dist/components/atoms/Avatar/helpers.mjs.map +1 -0
- package/dist/components/atoms/Avatar/styled.cjs +46 -0
- package/dist/components/atoms/Avatar/styled.cjs.map +1 -0
- package/dist/components/atoms/Avatar/styled.mjs +35 -0
- package/dist/components/atoms/Avatar/styled.mjs.map +1 -0
- package/dist/components/atoms/Badge/Badge.cjs +25 -0
- package/dist/components/atoms/Badge/Badge.cjs.map +1 -0
- package/dist/components/atoms/Badge/Badge.mjs +19 -0
- package/dist/components/atoms/Badge/Badge.mjs.map +1 -0
- package/dist/components/atoms/Badge/styled.cjs +48 -0
- package/dist/components/atoms/Badge/styled.cjs.map +1 -0
- package/dist/components/atoms/Badge/styled.mjs +39 -0
- package/dist/components/atoms/Badge/styled.mjs.map +1 -0
- package/dist/components/atoms/BoxContent/BoxContent.cjs +44 -0
- package/dist/components/atoms/BoxContent/BoxContent.cjs.map +1 -0
- package/dist/components/atoms/BoxContent/BoxContent.mjs +38 -0
- package/dist/components/atoms/BoxContent/BoxContent.mjs.map +1 -0
- package/dist/components/atoms/BoxContent/styled.cjs +63 -0
- package/dist/components/atoms/BoxContent/styled.cjs.map +1 -0
- package/dist/components/atoms/BoxContent/styled.mjs +54 -0
- package/dist/components/atoms/BoxContent/styled.mjs.map +1 -0
- package/dist/components/atoms/Button/Button.cjs +105 -0
- package/dist/components/atoms/Button/Button.cjs.map +1 -0
- package/dist/components/atoms/Button/Button.mjs +99 -0
- package/dist/components/atoms/Button/Button.mjs.map +1 -0
- package/dist/components/atoms/Button/States/BaseState.cjs +35 -0
- package/dist/components/atoms/Button/States/BaseState.cjs.map +1 -0
- package/dist/components/atoms/Button/States/BaseState.mjs +29 -0
- package/dist/components/atoms/Button/States/BaseState.mjs.map +1 -0
- package/dist/components/atoms/Button/States/Error.cjs +36 -0
- package/dist/components/atoms/Button/States/Error.cjs.map +1 -0
- package/dist/components/atoms/Button/States/Error.mjs +30 -0
- package/dist/components/atoms/Button/States/Error.mjs.map +1 -0
- package/dist/components/atoms/Button/States/Loading.cjs +32 -0
- package/dist/components/atoms/Button/States/Loading.cjs.map +1 -0
- package/dist/components/atoms/Button/States/Loading.mjs +26 -0
- package/dist/components/atoms/Button/States/Loading.mjs.map +1 -0
- package/dist/components/atoms/Button/States/Success.cjs +36 -0
- package/dist/components/atoms/Button/States/Success.cjs.map +1 -0
- package/dist/components/atoms/Button/States/Success.mjs +30 -0
- package/dist/components/atoms/Button/States/Success.mjs.map +1 -0
- package/dist/components/atoms/Button/States/styled.cjs +25 -0
- package/dist/components/atoms/Button/States/styled.cjs.map +1 -0
- package/dist/components/atoms/Button/States/styled.mjs +16 -0
- package/dist/components/atoms/Button/States/styled.mjs.map +1 -0
- package/dist/components/atoms/Button/styled.cjs +58 -0
- package/dist/components/atoms/Button/styled.cjs.map +1 -0
- package/dist/components/atoms/Button/styled.mjs +50 -0
- package/dist/components/atoms/Button/styled.mjs.map +1 -0
- package/dist/components/atoms/Card/Card.cjs +64 -0
- package/dist/components/atoms/Card/Card.cjs.map +1 -0
- package/dist/components/atoms/Card/Card.mjs +58 -0
- package/dist/components/atoms/Card/Card.mjs.map +1 -0
- package/dist/components/atoms/Card/Footer/Footer.cjs +15 -0
- package/dist/components/atoms/Card/Footer/Footer.cjs.map +1 -0
- package/dist/components/atoms/Card/Footer/Footer.mjs +9 -0
- package/dist/components/atoms/Card/Footer/Footer.mjs.map +1 -0
- package/dist/components/atoms/Card/Header/Header.cjs +15 -0
- package/dist/components/atoms/Card/Header/Header.cjs.map +1 -0
- package/dist/components/atoms/Card/Header/Header.mjs +9 -0
- package/dist/components/atoms/Card/Header/Header.mjs.map +1 -0
- package/dist/components/atoms/Card/styled.cjs +21 -0
- package/dist/components/atoms/Card/styled.cjs.map +1 -0
- package/dist/components/atoms/Card/styled.mjs +13 -0
- package/dist/components/atoms/Card/styled.mjs.map +1 -0
- package/dist/components/atoms/Checkbox/Checkbox.cjs +88 -0
- package/dist/components/atoms/Checkbox/Checkbox.cjs.map +1 -0
- package/dist/components/atoms/Checkbox/Checkbox.mjs +82 -0
- package/dist/components/atoms/Checkbox/Checkbox.mjs.map +1 -0
- package/dist/components/atoms/Checkbox/styled.cjs +48 -0
- package/dist/components/atoms/Checkbox/styled.cjs.map +1 -0
- package/dist/components/atoms/Checkbox/styled.mjs +37 -0
- package/dist/components/atoms/Checkbox/styled.mjs.map +1 -0
- package/dist/components/atoms/Divider/Divider.cjs +44 -0
- package/dist/components/atoms/Divider/Divider.cjs.map +1 -0
- package/dist/components/atoms/Divider/Divider.mjs +38 -0
- package/dist/components/atoms/Divider/Divider.mjs.map +1 -0
- package/dist/components/atoms/Divider/styled.cjs +32 -0
- package/dist/components/atoms/Divider/styled.cjs.map +1 -0
- package/dist/components/atoms/Divider/styled.mjs +24 -0
- package/dist/components/atoms/Divider/styled.mjs.map +1 -0
- package/dist/components/atoms/GroupButton/GroupButton.cjs +105 -0
- package/dist/components/atoms/GroupButton/GroupButton.cjs.map +1 -0
- package/dist/components/atoms/GroupButton/GroupButton.mjs +99 -0
- package/dist/components/atoms/GroupButton/GroupButton.mjs.map +1 -0
- package/dist/components/atoms/GroupButton/GroupButtonOption.cjs +25 -0
- package/dist/components/atoms/GroupButton/GroupButtonOption.cjs.map +1 -0
- package/dist/components/atoms/GroupButton/GroupButtonOption.mjs +19 -0
- package/dist/components/atoms/GroupButton/GroupButtonOption.mjs.map +1 -0
- package/dist/components/atoms/GroupButton/styled.cjs +126 -0
- package/dist/components/atoms/GroupButton/styled.cjs.map +1 -0
- package/dist/components/atoms/GroupButton/styled.mjs +114 -0
- package/dist/components/atoms/GroupButton/styled.mjs.map +1 -0
- package/dist/components/atoms/Icon/Icon.cjs +74 -0
- package/dist/components/atoms/Icon/Icon.cjs.map +1 -0
- package/dist/components/atoms/Icon/Icon.mjs +68 -0
- package/dist/components/atoms/Icon/Icon.mjs.map +1 -0
- package/dist/components/atoms/Icon/helpers.cjs +127 -0
- package/dist/components/atoms/Icon/helpers.cjs.map +1 -0
- package/dist/components/atoms/Icon/helpers.mjs +100 -0
- package/dist/components/atoms/Icon/helpers.mjs.map +1 -0
- package/dist/components/atoms/Input/Hint.cjs +39 -0
- package/dist/components/atoms/Input/Hint.cjs.map +1 -0
- package/dist/components/atoms/Input/Hint.mjs +33 -0
- package/dist/components/atoms/Input/Hint.mjs.map +1 -0
- package/dist/components/atoms/Input/InputContainer/InputContainer.cjs +105 -0
- package/dist/components/atoms/Input/InputContainer/InputContainer.cjs.map +1 -0
- package/dist/components/atoms/Input/InputContainer/InputContainer.mjs +99 -0
- package/dist/components/atoms/Input/InputContainer/InputContainer.mjs.map +1 -0
- package/dist/components/atoms/Input/InputElement/InputElement.cjs +73 -0
- package/dist/components/atoms/Input/InputElement/InputElement.cjs.map +1 -0
- package/dist/components/atoms/Input/InputElement/InputElement.mjs +67 -0
- package/dist/components/atoms/Input/InputElement/InputElement.mjs.map +1 -0
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.cjs +113 -0
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.cjs.map +1 -0
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.mjs +107 -0
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.mjs.map +1 -0
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.cjs +77 -0
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.cjs.map +1 -0
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.mjs +55 -0
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.mjs.map +1 -0
- package/dist/components/atoms/Input/PressableInputContainer/styled.cjs +16 -0
- package/dist/components/atoms/Input/PressableInputContainer/styled.cjs.map +1 -0
- package/dist/components/atoms/Input/PressableInputContainer/styled.mjs +8 -0
- package/dist/components/atoms/Input/PressableInputContainer/styled.mjs.map +1 -0
- package/dist/components/atoms/Input/hooks/useInputFocus.cjs +29 -0
- package/dist/components/atoms/Input/hooks/useInputFocus.cjs.map +1 -0
- package/dist/components/atoms/Input/hooks/useInputFocus.mjs +25 -0
- package/dist/components/atoms/Input/hooks/useInputFocus.mjs.map +1 -0
- package/dist/components/atoms/Input/hooks/useNumberMask.cjs +100 -0
- package/dist/components/atoms/Input/hooks/useNumberMask.cjs.map +1 -0
- package/dist/components/atoms/Input/hooks/useNumberMask.mjs +91 -0
- package/dist/components/atoms/Input/hooks/useNumberMask.mjs.map +1 -0
- package/dist/components/atoms/Input/hooks/useStringMask.cjs +101 -0
- package/dist/components/atoms/Input/hooks/useStringMask.cjs.map +1 -0
- package/dist/components/atoms/Input/hooks/useStringMask.mjs +95 -0
- package/dist/components/atoms/Input/hooks/useStringMask.mjs.map +1 -0
- package/dist/components/atoms/Input/styled.cjs +111 -0
- package/dist/components/atoms/Input/styled.cjs.map +1 -0
- package/dist/components/atoms/Input/styled.mjs +95 -0
- package/dist/components/atoms/Input/styled.mjs.map +1 -0
- package/dist/components/atoms/Paper/Paper.cjs +55 -0
- package/dist/components/atoms/Paper/Paper.cjs.map +1 -0
- package/dist/components/atoms/Paper/Paper.mjs +49 -0
- package/dist/components/atoms/Paper/Paper.mjs.map +1 -0
- package/dist/components/atoms/Paper/styled.cjs +21 -0
- package/dist/components/atoms/Paper/styled.cjs.map +1 -0
- package/dist/components/atoms/Paper/styled.mjs +13 -0
- package/dist/components/atoms/Paper/styled.mjs.map +1 -0
- package/dist/components/atoms/PressableSurface/PressableSurface.cjs +109 -0
- package/dist/components/atoms/PressableSurface/PressableSurface.cjs.map +1 -0
- package/dist/components/atoms/PressableSurface/PressableSurface.mjs +103 -0
- package/dist/components/atoms/PressableSurface/PressableSurface.mjs.map +1 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.cjs +127 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.cjs.map +1 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.mjs +105 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.mjs.map +1 -0
- package/dist/components/atoms/ProgressBar/styled.cjs +42 -0
- package/dist/components/atoms/ProgressBar/styled.cjs.map +1 -0
- package/dist/components/atoms/ProgressBar/styled.mjs +32 -0
- package/dist/components/atoms/ProgressBar/styled.mjs.map +1 -0
- package/dist/components/atoms/RadioButton/RadioButton.cjs +83 -0
- package/dist/components/atoms/RadioButton/RadioButton.cjs.map +1 -0
- package/dist/components/atoms/RadioButton/RadioButton.mjs +77 -0
- package/dist/components/atoms/RadioButton/RadioButton.mjs.map +1 -0
- package/dist/components/atoms/RadioButton/styled.cjs +37 -0
- package/dist/components/atoms/RadioButton/styled.cjs.map +1 -0
- package/dist/components/atoms/RadioButton/styled.mjs +26 -0
- package/dist/components/atoms/RadioButton/styled.mjs.map +1 -0
- package/dist/components/atoms/Switch/Switch.cjs +119 -0
- package/dist/components/atoms/Switch/Switch.cjs.map +1 -0
- package/dist/components/atoms/Switch/Switch.mjs +113 -0
- package/dist/components/atoms/Switch/Switch.mjs.map +1 -0
- package/dist/components/atoms/Switch/animation.cjs +39 -0
- package/dist/components/atoms/Switch/animation.cjs.map +1 -0
- package/dist/components/atoms/Switch/animation.mjs +35 -0
- package/dist/components/atoms/Switch/animation.mjs.map +1 -0
- package/dist/components/atoms/Switch/styled.cjs +40 -0
- package/dist/components/atoms/Switch/styled.cjs.map +1 -0
- package/dist/components/atoms/Switch/styled.mjs +29 -0
- package/dist/components/atoms/Switch/styled.mjs.map +1 -0
- package/dist/components/atoms/Tag/Tag.cjs +92 -0
- package/dist/components/atoms/Tag/Tag.cjs.map +1 -0
- package/dist/components/atoms/Tag/Tag.mjs +86 -0
- package/dist/components/atoms/Tag/Tag.mjs.map +1 -0
- package/dist/components/atoms/Tag/styled.cjs +45 -0
- package/dist/components/atoms/Tag/styled.cjs.map +1 -0
- package/dist/components/atoms/Tag/styled.mjs +35 -0
- package/dist/components/atoms/Tag/styled.mjs.map +1 -0
- package/dist/components/atoms/Text/Text.cjs +82 -0
- package/dist/components/atoms/Text/Text.cjs.map +1 -0
- package/dist/components/atoms/Text/Text.mjs +76 -0
- package/dist/components/atoms/Text/Text.mjs.map +1 -0
- package/dist/components/atoms/Text/functions.cjs +10 -0
- package/dist/components/atoms/Text/functions.cjs.map +1 -0
- package/dist/components/atoms/Text/functions.mjs +5 -0
- package/dist/components/atoms/Text/functions.mjs.map +1 -0
- package/dist/components/atoms/Text/styled.cjs +31 -0
- package/dist/components/atoms/Text/styled.cjs.map +1 -0
- package/dist/components/atoms/Text/styled.mjs +22 -0
- package/dist/components/atoms/Text/styled.mjs.map +1 -0
- package/dist/components/atoms/shared/PaperAndCard.cjs +26 -0
- package/dist/components/atoms/shared/PaperAndCard.cjs.map +1 -0
- package/dist/components/atoms/shared/PaperAndCard.mjs +21 -0
- package/dist/components/atoms/shared/PaperAndCard.mjs.map +1 -0
- package/dist/components/molecules/Calendar/Calendar.cjs +172 -0
- package/dist/components/molecules/Calendar/Calendar.cjs.map +1 -0
- package/dist/components/molecules/Calendar/Calendar.mjs +150 -0
- package/dist/components/molecules/Calendar/Calendar.mjs.map +1 -0
- package/dist/components/molecules/Calendar/components/MonthWeek.cjs +116 -0
- package/dist/components/molecules/Calendar/components/MonthWeek.cjs.map +1 -0
- package/dist/components/molecules/Calendar/components/MonthWeek.mjs +110 -0
- package/dist/components/molecules/Calendar/components/MonthWeek.mjs.map +1 -0
- package/dist/components/molecules/Calendar/components/Weekdays.cjs +29 -0
- package/dist/components/molecules/Calendar/components/Weekdays.cjs.map +1 -0
- package/dist/components/molecules/Calendar/components/Weekdays.mjs +23 -0
- package/dist/components/molecules/Calendar/components/Weekdays.mjs.map +1 -0
- package/dist/components/molecules/Calendar/styled.cjs +97 -0
- package/dist/components/molecules/Calendar/styled.cjs.map +1 -0
- package/dist/components/molecules/Calendar/styled.mjs +83 -0
- package/dist/components/molecules/Calendar/styled.mjs.map +1 -0
- package/dist/components/molecules/DatePicker/DatePicker.cjs +177 -0
- package/dist/components/molecules/DatePicker/DatePicker.cjs.map +1 -0
- package/dist/components/molecules/DatePicker/DatePicker.mjs +156 -0
- package/dist/components/molecules/DatePicker/DatePicker.mjs.map +1 -0
- package/dist/components/molecules/DatePicker/styled.cjs +37 -0
- package/dist/components/molecules/DatePicker/styled.cjs.map +1 -0
- package/dist/components/molecules/DatePicker/styled.mjs +28 -0
- package/dist/components/molecules/DatePicker/styled.mjs.map +1 -0
- package/dist/components/molecules/DateTimePicker/DateTimePicker.cjs +197 -0
- package/dist/components/molecules/DateTimePicker/DateTimePicker.cjs.map +1 -0
- package/dist/components/molecules/DateTimePicker/DateTimePicker.mjs +175 -0
- package/dist/components/molecules/DateTimePicker/DateTimePicker.mjs.map +1 -0
- package/dist/components/molecules/DateTimePicker/styled.cjs +18 -0
- package/dist/components/molecules/DateTimePicker/styled.cjs.map +1 -0
- package/dist/components/molecules/DateTimePicker/styled.mjs +10 -0
- package/dist/components/molecules/DateTimePicker/styled.mjs.map +1 -0
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.cjs +237 -0
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.cjs.map +1 -0
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.mjs +215 -0
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.mjs.map +1 -0
- package/dist/components/molecules/DateTimeSelector/Selector.cjs +148 -0
- package/dist/components/molecules/DateTimeSelector/Selector.cjs.map +1 -0
- package/dist/components/molecules/DateTimeSelector/Selector.mjs +124 -0
- package/dist/components/molecules/DateTimeSelector/Selector.mjs.map +1 -0
- package/dist/components/molecules/DateTimeSelector/styled.cjs +71 -0
- package/dist/components/molecules/DateTimeSelector/styled.cjs.map +1 -0
- package/dist/components/molecules/DateTimeSelector/styled.mjs +56 -0
- package/dist/components/molecules/DateTimeSelector/styled.mjs.map +1 -0
- package/dist/components/molecules/Grid/functions.cjs +31 -0
- package/dist/components/molecules/Grid/functions.cjs.map +1 -0
- package/dist/components/molecules/Grid/functions.mjs +26 -0
- package/dist/components/molecules/Grid/functions.mjs.map +1 -0
- package/dist/components/molecules/HintInputContainer/HintInputContainer.cjs +103 -0
- package/dist/components/molecules/HintInputContainer/HintInputContainer.cjs.map +1 -0
- package/dist/components/molecules/HintInputContainer/HintInputContainer.mjs +81 -0
- package/dist/components/molecules/HintInputContainer/HintInputContainer.mjs.map +1 -0
- package/dist/components/molecules/IconTextButton/IconComponent.cjs +40 -0
- package/dist/components/molecules/IconTextButton/IconComponent.cjs.map +1 -0
- package/dist/components/molecules/IconTextButton/IconComponent.mjs +34 -0
- package/dist/components/molecules/IconTextButton/IconComponent.mjs.map +1 -0
- package/dist/components/molecules/InputPassword/InputPasswordIcon.cjs +63 -0
- package/dist/components/molecules/InputPassword/InputPasswordIcon.cjs.map +1 -0
- package/dist/components/molecules/InputPassword/InputPasswordIcon.mjs +57 -0
- package/dist/components/molecules/InputPassword/InputPasswordIcon.mjs.map +1 -0
- package/dist/components/molecules/InputPassword/styled.cjs +22 -0
- package/dist/components/molecules/InputPassword/styled.cjs.map +1 -0
- package/dist/components/molecules/InputPassword/styled.mjs +14 -0
- package/dist/components/molecules/InputPassword/styled.mjs.map +1 -0
- package/dist/components/molecules/Snackbar/Snackbar.cjs +108 -0
- package/dist/components/molecules/Snackbar/Snackbar.cjs.map +1 -0
- package/dist/components/molecules/Snackbar/Snackbar.mjs +102 -0
- package/dist/components/molecules/Snackbar/Snackbar.mjs.map +1 -0
- package/dist/components/molecules/Snackbar/styled.cjs +104 -0
- package/dist/components/molecules/Snackbar/styled.cjs.map +1 -0
- package/dist/components/molecules/Snackbar/styled.mjs +90 -0
- package/dist/components/molecules/Snackbar/styled.mjs.map +1 -0
- package/dist/components/molecules/TextArea/TextArea.cjs +82 -0
- package/dist/components/molecules/TextArea/TextArea.cjs.map +1 -0
- package/dist/components/molecules/TextArea/TextArea.mjs +76 -0
- package/dist/components/molecules/TextArea/TextArea.mjs.map +1 -0
- package/dist/components/molecules/TextArea/styled.cjs +36 -0
- package/dist/components/molecules/TextArea/styled.cjs.map +1 -0
- package/dist/components/molecules/TextArea/styled.mjs +27 -0
- package/dist/components/molecules/TextArea/styled.mjs.map +1 -0
- package/dist/hooks/useDebouncedState.cjs +20 -0
- package/dist/hooks/useDebouncedState.cjs.map +1 -0
- package/dist/hooks/useDebouncedState.mjs +16 -0
- package/dist/hooks/useDebouncedState.mjs.map +1 -0
- package/dist/hooks/useTheme.cjs +10 -0
- package/dist/hooks/useTheme.cjs.map +1 -0
- package/dist/hooks/useTheme.mjs +6 -0
- package/dist/hooks/useTheme.mjs.map +1 -0
- package/dist/index.cjs +141 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +55 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles/ThemeProvider.cjs +20 -0
- package/dist/styles/ThemeProvider.cjs.map +1 -0
- package/dist/styles/ThemeProvider.mjs +14 -0
- package/dist/styles/ThemeProvider.mjs.map +1 -0
- package/dist/styles/definitions.cjs +175 -0
- package/dist/styles/definitions.cjs.map +1 -0
- package/dist/styles/definitions.mjs +158 -0
- package/dist/styles/definitions.mjs.map +1 -0
- package/dist/styles/light.cjs +59 -0
- package/dist/styles/light.cjs.map +1 -0
- package/dist/styles/light.mjs +55 -0
- package/dist/styles/light.mjs.map +1 -0
- package/dist/utils/IPhoneXHelper.cjs +32 -0
- package/dist/utils/IPhoneXHelper.cjs.map +1 -0
- package/dist/utils/IPhoneXHelper.mjs +25 -0
- package/dist/utils/IPhoneXHelper.mjs.map +1 -0
- package/dist/utils/ResponsiveFontSize.cjs +38 -0
- package/dist/utils/ResponsiveFontSize.cjs.map +1 -0
- package/dist/utils/ResponsiveFontSize.mjs +32 -0
- package/dist/utils/ResponsiveFontSize.mjs.map +1 -0
- package/dist/utils/extractNumbersFromString.cjs +10 -0
- package/dist/utils/extractNumbersFromString.cjs.map +1 -0
- package/dist/utils/extractNumbersFromString.mjs +5 -0
- package/dist/utils/extractNumbersFromString.mjs.map +1 -0
- package/dist/utils/formatWithMask.cjs +34 -0
- package/dist/utils/formatWithMask.cjs.map +1 -0
- package/dist/utils/formatWithMask.mjs +26 -0
- package/dist/utils/formatWithMask.mjs.map +1 -0
- package/dist/utils/lightenDarkenColor.cjs +31 -0
- package/dist/utils/lightenDarkenColor.cjs.map +1 -0
- package/dist/utils/lightenDarkenColor.mjs +27 -0
- package/dist/utils/lightenDarkenColor.mjs.map +1 -0
- package/dist/utils/masks.cjs +24 -0
- package/dist/utils/masks.cjs.map +1 -0
- package/dist/utils/masks.mjs +20 -0
- package/dist/utils/masks.mjs.map +1 -0
- package/dist/utils/variantComplement.cjs +36 -0
- package/dist/utils/variantComplement.cjs.map +1 -0
- package/dist/utils/variantComplement.mjs +28 -0
- package/dist/utils/variantComplement.mjs.map +1 -0
- package/package.json +14 -6
- package/CHANGELOG.md +0 -868
- package/dist/components/atoms/Avatar/Avatar.js +0 -38
- package/dist/components/atoms/Avatar/Avatar.js.map +0 -1
- package/dist/components/atoms/Avatar/helpers.js +0 -14
- package/dist/components/atoms/Avatar/helpers.js.map +0 -1
- package/dist/components/atoms/Avatar/styled.js +0 -46
- package/dist/components/atoms/Avatar/styled.js.map +0 -1
- package/dist/components/atoms/Badge/Badge.js +0 -25
- package/dist/components/atoms/Badge/Badge.js.map +0 -1
- package/dist/components/atoms/Badge/styled.js +0 -48
- package/dist/components/atoms/Badge/styled.js.map +0 -1
- package/dist/components/atoms/BoxContent/BoxContent.js +0 -44
- package/dist/components/atoms/BoxContent/BoxContent.js.map +0 -1
- package/dist/components/atoms/BoxContent/styled.js +0 -63
- package/dist/components/atoms/BoxContent/styled.js.map +0 -1
- package/dist/components/atoms/Button/Button.js +0 -105
- package/dist/components/atoms/Button/Button.js.map +0 -1
- package/dist/components/atoms/Button/States/BaseState.js +0 -35
- package/dist/components/atoms/Button/States/BaseState.js.map +0 -1
- package/dist/components/atoms/Button/States/Error.js +0 -36
- package/dist/components/atoms/Button/States/Error.js.map +0 -1
- package/dist/components/atoms/Button/States/Loading.js +0 -32
- package/dist/components/atoms/Button/States/Loading.js.map +0 -1
- package/dist/components/atoms/Button/States/Success.js +0 -36
- package/dist/components/atoms/Button/States/Success.js.map +0 -1
- package/dist/components/atoms/Button/States/styled.js +0 -25
- package/dist/components/atoms/Button/States/styled.js.map +0 -1
- package/dist/components/atoms/Button/styled.js +0 -58
- package/dist/components/atoms/Button/styled.js.map +0 -1
- package/dist/components/atoms/Card/Card.js +0 -64
- package/dist/components/atoms/Card/Card.js.map +0 -1
- package/dist/components/atoms/Card/Footer/Footer.js +0 -15
- package/dist/components/atoms/Card/Footer/Footer.js.map +0 -1
- package/dist/components/atoms/Card/Header/Header.js +0 -15
- package/dist/components/atoms/Card/Header/Header.js.map +0 -1
- package/dist/components/atoms/Card/styled.js +0 -21
- package/dist/components/atoms/Card/styled.js.map +0 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +0 -88
- package/dist/components/atoms/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/atoms/Checkbox/styled.js +0 -48
- package/dist/components/atoms/Checkbox/styled.js.map +0 -1
- package/dist/components/atoms/Divider/Divider.js +0 -44
- package/dist/components/atoms/Divider/Divider.js.map +0 -1
- package/dist/components/atoms/Divider/styled.js +0 -32
- package/dist/components/atoms/Divider/styled.js.map +0 -1
- package/dist/components/atoms/GroupButton/GroupButton.js +0 -105
- package/dist/components/atoms/GroupButton/GroupButton.js.map +0 -1
- package/dist/components/atoms/GroupButton/GroupButtonOption.js +0 -25
- package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +0 -1
- package/dist/components/atoms/GroupButton/styled.js +0 -126
- package/dist/components/atoms/GroupButton/styled.js.map +0 -1
- package/dist/components/atoms/Icon/Icon.js +0 -74
- package/dist/components/atoms/Icon/Icon.js.map +0 -1
- package/dist/components/atoms/Icon/helpers.js +0 -127
- package/dist/components/atoms/Icon/helpers.js.map +0 -1
- package/dist/components/atoms/Input/Hint.js +0 -39
- package/dist/components/atoms/Input/Hint.js.map +0 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.js +0 -105
- package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +0 -1
- package/dist/components/atoms/Input/InputElement/InputElement.js +0 -73
- package/dist/components/atoms/Input/InputElement/InputElement.js.map +0 -1
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +0 -113
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +0 -1
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +0 -77
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +0 -1
- package/dist/components/atoms/Input/PressableInputContainer/styled.js +0 -16
- package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +0 -1
- package/dist/components/atoms/Input/hooks/useInputFocus.js +0 -29
- package/dist/components/atoms/Input/hooks/useInputFocus.js.map +0 -1
- package/dist/components/atoms/Input/hooks/useNumberMask.js +0 -100
- package/dist/components/atoms/Input/hooks/useNumberMask.js.map +0 -1
- package/dist/components/atoms/Input/hooks/useStringMask.js +0 -101
- package/dist/components/atoms/Input/hooks/useStringMask.js.map +0 -1
- package/dist/components/atoms/Input/styled.js +0 -111
- package/dist/components/atoms/Input/styled.js.map +0 -1
- package/dist/components/atoms/Paper/Paper.js +0 -55
- package/dist/components/atoms/Paper/Paper.js.map +0 -1
- package/dist/components/atoms/Paper/styled.js +0 -21
- package/dist/components/atoms/Paper/styled.js.map +0 -1
- package/dist/components/atoms/PressableSurface/PressableSurface.js +0 -109
- package/dist/components/atoms/PressableSurface/PressableSurface.js.map +0 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.js +0 -127
- package/dist/components/atoms/ProgressBar/ProgressBar.js.map +0 -1
- package/dist/components/atoms/ProgressBar/styled.js +0 -42
- package/dist/components/atoms/ProgressBar/styled.js.map +0 -1
- package/dist/components/atoms/RadioButton/RadioButton.js +0 -83
- package/dist/components/atoms/RadioButton/RadioButton.js.map +0 -1
- package/dist/components/atoms/RadioButton/styled.js +0 -37
- package/dist/components/atoms/RadioButton/styled.js.map +0 -1
- package/dist/components/atoms/Switch/Switch.js +0 -119
- package/dist/components/atoms/Switch/Switch.js.map +0 -1
- package/dist/components/atoms/Switch/animation.js +0 -39
- package/dist/components/atoms/Switch/animation.js.map +0 -1
- package/dist/components/atoms/Switch/styled.js +0 -40
- package/dist/components/atoms/Switch/styled.js.map +0 -1
- package/dist/components/atoms/Tag/Tag.js +0 -92
- package/dist/components/atoms/Tag/Tag.js.map +0 -1
- package/dist/components/atoms/Tag/styled.js +0 -45
- package/dist/components/atoms/Tag/styled.js.map +0 -1
- package/dist/components/atoms/Text/Text.js +0 -82
- package/dist/components/atoms/Text/Text.js.map +0 -1
- package/dist/components/atoms/Text/functions.js +0 -10
- package/dist/components/atoms/Text/functions.js.map +0 -1
- package/dist/components/atoms/Text/styled.js +0 -31
- package/dist/components/atoms/Text/styled.js.map +0 -1
- package/dist/components/atoms/shared/PaperAndCard.js +0 -26
- package/dist/components/atoms/shared/PaperAndCard.js.map +0 -1
- package/dist/components/molecules/Calendar/Calendar.js +0 -172
- package/dist/components/molecules/Calendar/Calendar.js.map +0 -1
- package/dist/components/molecules/Calendar/components/MonthWeek.js +0 -116
- package/dist/components/molecules/Calendar/components/MonthWeek.js.map +0 -1
- package/dist/components/molecules/Calendar/components/Weekdays.js +0 -29
- package/dist/components/molecules/Calendar/components/Weekdays.js.map +0 -1
- package/dist/components/molecules/Calendar/styled.js +0 -97
- package/dist/components/molecules/Calendar/styled.js.map +0 -1
- package/dist/components/molecules/DatePicker/DatePicker.js +0 -177
- package/dist/components/molecules/DatePicker/DatePicker.js.map +0 -1
- package/dist/components/molecules/DatePicker/styled.js +0 -37
- package/dist/components/molecules/DatePicker/styled.js.map +0 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js +0 -197
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +0 -1
- package/dist/components/molecules/DateTimePicker/styled.js +0 -18
- package/dist/components/molecules/DateTimePicker/styled.js.map +0 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +0 -237
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +0 -1
- package/dist/components/molecules/DateTimeSelector/Selector.js +0 -148
- package/dist/components/molecules/DateTimeSelector/Selector.js.map +0 -1
- package/dist/components/molecules/DateTimeSelector/styled.js +0 -71
- package/dist/components/molecules/DateTimeSelector/styled.js.map +0 -1
- package/dist/components/molecules/Grid/functions.js +0 -31
- package/dist/components/molecules/Grid/functions.js.map +0 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js +0 -103
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +0 -1
- package/dist/components/molecules/IconTextButton/IconComponent.js +0 -40
- package/dist/components/molecules/IconTextButton/IconComponent.js.map +0 -1
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js +0 -63
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +0 -1
- package/dist/components/molecules/InputPassword/styled.js +0 -22
- package/dist/components/molecules/InputPassword/styled.js.map +0 -1
- package/dist/components/molecules/Snackbar/Snackbar.js +0 -108
- package/dist/components/molecules/Snackbar/Snackbar.js.map +0 -1
- package/dist/components/molecules/Snackbar/styled.js +0 -104
- package/dist/components/molecules/Snackbar/styled.js.map +0 -1
- package/dist/components/molecules/TextArea/TextArea.js +0 -82
- package/dist/components/molecules/TextArea/TextArea.js.map +0 -1
- package/dist/components/molecules/TextArea/styled.js +0 -36
- package/dist/components/molecules/TextArea/styled.js.map +0 -1
- package/dist/hooks/useDebouncedState.js +0 -20
- package/dist/hooks/useDebouncedState.js.map +0 -1
- package/dist/hooks/useTheme.js +0 -10
- package/dist/hooks/useTheme.js.map +0 -1
- package/dist/index.js +0 -141
- package/dist/index.js.map +0 -1
- package/dist/styles/ThemeProvider.js +0 -20
- package/dist/styles/ThemeProvider.js.map +0 -1
- package/dist/styles/definitions.js +0 -175
- package/dist/styles/definitions.js.map +0 -1
- package/dist/styles/light.js +0 -59
- package/dist/styles/light.js.map +0 -1
- package/dist/utils/IPhoneXHelper.js +0 -32
- package/dist/utils/IPhoneXHelper.js.map +0 -1
- package/dist/utils/ResponsiveFontSize.js +0 -38
- package/dist/utils/ResponsiveFontSize.js.map +0 -1
- package/dist/utils/extractNumbersFromString.js +0 -10
- package/dist/utils/extractNumbersFromString.js.map +0 -1
- package/dist/utils/formatWithMask.js +0 -34
- package/dist/utils/formatWithMask.js.map +0 -1
- package/dist/utils/lightenDarkenColor.js +0 -31
- package/dist/utils/lightenDarkenColor.js.map +0 -1
- package/dist/utils/masks.js +0 -24
- package/dist/utils/masks.js.map +0 -1
- package/dist/utils/variantComplement.js +0 -36
- package/dist/utils/variantComplement.js.map +0 -1
- package/esm/components/atoms/Avatar/Avatar.d.ts +0 -14
- package/esm/components/atoms/Avatar/Avatar.js +0 -32
- package/esm/components/atoms/Avatar/Avatar.js.map +0 -1
- package/esm/components/atoms/Avatar/helpers.d.ts +0 -1
- package/esm/components/atoms/Avatar/helpers.js +0 -10
- package/esm/components/atoms/Avatar/helpers.js.map +0 -1
- package/esm/components/atoms/Avatar/index.d.ts +0 -2
- package/esm/components/atoms/Avatar/styled.d.ts +0 -28
- package/esm/components/atoms/Avatar/styled.js +0 -35
- package/esm/components/atoms/Avatar/styled.js.map +0 -1
- package/esm/components/atoms/Badge/Badge.d.ts +0 -11
- package/esm/components/atoms/Badge/Badge.js +0 -19
- package/esm/components/atoms/Badge/Badge.js.map +0 -1
- package/esm/components/atoms/Badge/index.d.ts +0 -2
- package/esm/components/atoms/Badge/styled.d.ts +0 -15
- package/esm/components/atoms/Badge/styled.js +0 -39
- package/esm/components/atoms/Badge/styled.js.map +0 -1
- package/esm/components/atoms/BoxContent/BoxContent.d.ts +0 -7
- package/esm/components/atoms/BoxContent/BoxContent.js +0 -38
- package/esm/components/atoms/BoxContent/BoxContent.js.map +0 -1
- package/esm/components/atoms/BoxContent/index.d.ts +0 -2
- package/esm/components/atoms/BoxContent/styled.d.ts +0 -11
- package/esm/components/atoms/BoxContent/styled.js +0 -54
- package/esm/components/atoms/BoxContent/styled.js.map +0 -1
- package/esm/components/atoms/Button/Button.d.ts +0 -28
- package/esm/components/atoms/Button/Button.js +0 -99
- package/esm/components/atoms/Button/Button.js.map +0 -1
- package/esm/components/atoms/Button/States/BaseState.d.ts +0 -7
- package/esm/components/atoms/Button/States/BaseState.js +0 -29
- package/esm/components/atoms/Button/States/BaseState.js.map +0 -1
- package/esm/components/atoms/Button/States/Error.d.ts +0 -4
- package/esm/components/atoms/Button/States/Error.js +0 -30
- package/esm/components/atoms/Button/States/Error.js.map +0 -1
- package/esm/components/atoms/Button/States/Loading.d.ts +0 -4
- package/esm/components/atoms/Button/States/Loading.js +0 -26
- package/esm/components/atoms/Button/States/Loading.js.map +0 -1
- package/esm/components/atoms/Button/States/Success.d.ts +0 -4
- package/esm/components/atoms/Button/States/Success.js +0 -30
- package/esm/components/atoms/Button/States/Success.js.map +0 -1
- package/esm/components/atoms/Button/States/index.d.ts +0 -3
- package/esm/components/atoms/Button/States/styled.d.ts +0 -7
- package/esm/components/atoms/Button/States/styled.js +0 -16
- package/esm/components/atoms/Button/States/styled.js.map +0 -1
- package/esm/components/atoms/Button/index.d.ts +0 -3
- package/esm/components/atoms/Button/styled.d.ts +0 -8
- package/esm/components/atoms/Button/styled.js +0 -50
- package/esm/components/atoms/Button/styled.js.map +0 -1
- package/esm/components/atoms/Card/Card.d.ts +0 -9
- package/esm/components/atoms/Card/Card.js +0 -58
- package/esm/components/atoms/Card/Card.js.map +0 -1
- package/esm/components/atoms/Card/Footer/Footer.d.ts +0 -7
- package/esm/components/atoms/Card/Footer/Footer.js +0 -9
- package/esm/components/atoms/Card/Footer/Footer.js.map +0 -1
- package/esm/components/atoms/Card/Footer/index.d.ts +0 -2
- package/esm/components/atoms/Card/Header/Header.d.ts +0 -7
- package/esm/components/atoms/Card/Header/Header.js +0 -9
- package/esm/components/atoms/Card/Header/Header.js.map +0 -1
- package/esm/components/atoms/Card/Header/index.d.ts +0 -2
- package/esm/components/atoms/Card/index.d.ts +0 -2
- package/esm/components/atoms/Card/styled.d.ts +0 -1
- package/esm/components/atoms/Card/styled.js +0 -13
- package/esm/components/atoms/Card/styled.js.map +0 -1
- package/esm/components/atoms/Checkbox/Checkbox.d.ts +0 -14
- package/esm/components/atoms/Checkbox/Checkbox.js +0 -82
- package/esm/components/atoms/Checkbox/Checkbox.js.map +0 -1
- package/esm/components/atoms/Checkbox/index.d.ts +0 -2
- package/esm/components/atoms/Checkbox/styled.d.ts +0 -23
- package/esm/components/atoms/Checkbox/styled.js +0 -37
- package/esm/components/atoms/Checkbox/styled.js.map +0 -1
- package/esm/components/atoms/Divider/Divider.d.ts +0 -8
- package/esm/components/atoms/Divider/Divider.js +0 -38
- package/esm/components/atoms/Divider/Divider.js.map +0 -1
- package/esm/components/atoms/Divider/index.d.ts +0 -2
- package/esm/components/atoms/Divider/styled.d.ts +0 -1
- package/esm/components/atoms/Divider/styled.js +0 -24
- package/esm/components/atoms/Divider/styled.js.map +0 -1
- package/esm/components/atoms/GroupButton/GroupButton.d.ts +0 -32
- package/esm/components/atoms/GroupButton/GroupButton.js +0 -99
- package/esm/components/atoms/GroupButton/GroupButton.js.map +0 -1
- package/esm/components/atoms/GroupButton/GroupButtonOption.d.ts +0 -9
- package/esm/components/atoms/GroupButton/GroupButtonOption.js +0 -19
- package/esm/components/atoms/GroupButton/GroupButtonOption.js.map +0 -1
- package/esm/components/atoms/GroupButton/index.d.ts +0 -4
- package/esm/components/atoms/GroupButton/styled.d.ts +0 -42
- package/esm/components/atoms/GroupButton/styled.js +0 -114
- package/esm/components/atoms/GroupButton/styled.js.map +0 -1
- package/esm/components/atoms/Icon/Icon.d.ts +0 -14
- package/esm/components/atoms/Icon/Icon.js +0 -68
- package/esm/components/atoms/Icon/Icon.js.map +0 -1
- package/esm/components/atoms/Icon/helpers.d.ts +0 -4
- package/esm/components/atoms/Icon/helpers.js +0 -100
- package/esm/components/atoms/Icon/helpers.js.map +0 -1
- package/esm/components/atoms/Icon/index.d.ts +0 -2
- package/esm/components/atoms/Input/Hint.d.ts +0 -10
- package/esm/components/atoms/Input/Hint.js +0 -33
- package/esm/components/atoms/Input/Hint.js.map +0 -1
- package/esm/components/atoms/Input/InputContainer/InputContainer.d.ts +0 -29
- package/esm/components/atoms/Input/InputContainer/InputContainer.js +0 -99
- package/esm/components/atoms/Input/InputContainer/InputContainer.js.map +0 -1
- package/esm/components/atoms/Input/InputElement/InputElement.d.ts +0 -13
- package/esm/components/atoms/Input/InputElement/InputElement.js +0 -67
- package/esm/components/atoms/Input/InputElement/InputElement.js.map +0 -1
- package/esm/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +0 -16
- package/esm/components/atoms/Input/InputMaskElement/InputMaskElement.js +0 -107
- package/esm/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +0 -1
- package/esm/components/atoms/Input/PressableInputContainer/PressableInputContainer.d.ts +0 -10
- package/esm/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +0 -55
- package/esm/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +0 -1
- package/esm/components/atoms/Input/PressableInputContainer/index.d.ts +0 -2
- package/esm/components/atoms/Input/PressableInputContainer/styled.d.ts +0 -5
- package/esm/components/atoms/Input/PressableInputContainer/styled.js +0 -8
- package/esm/components/atoms/Input/PressableInputContainer/styled.js.map +0 -1
- package/esm/components/atoms/Input/hooks/useInputFocus.d.ts +0 -5
- package/esm/components/atoms/Input/hooks/useInputFocus.js +0 -25
- package/esm/components/atoms/Input/hooks/useInputFocus.js.map +0 -1
- package/esm/components/atoms/Input/hooks/useNumberMask.d.ts +0 -8
- package/esm/components/atoms/Input/hooks/useNumberMask.js +0 -91
- package/esm/components/atoms/Input/hooks/useNumberMask.js.map +0 -1
- package/esm/components/atoms/Input/hooks/useStringMask.d.ts +0 -8
- package/esm/components/atoms/Input/hooks/useStringMask.js +0 -95
- package/esm/components/atoms/Input/hooks/useStringMask.js.map +0 -1
- package/esm/components/atoms/Input/index.d.ts +0 -13
- package/esm/components/atoms/Input/styled.d.ts +0 -64
- package/esm/components/atoms/Input/styled.js +0 -95
- package/esm/components/atoms/Input/styled.js.map +0 -1
- package/esm/components/atoms/Paper/Paper.d.ts +0 -8
- package/esm/components/atoms/Paper/Paper.js +0 -49
- package/esm/components/atoms/Paper/Paper.js.map +0 -1
- package/esm/components/atoms/Paper/index.d.ts +0 -2
- package/esm/components/atoms/Paper/styled.d.ts +0 -1
- package/esm/components/atoms/Paper/styled.js +0 -13
- package/esm/components/atoms/Paper/styled.js.map +0 -1
- package/esm/components/atoms/PressableSurface/PressableSurface.d.ts +0 -10
- package/esm/components/atoms/PressableSurface/PressableSurface.js +0 -103
- package/esm/components/atoms/PressableSurface/PressableSurface.js.map +0 -1
- package/esm/components/atoms/PressableSurface/index.d.ts +0 -2
- package/esm/components/atoms/ProgressBar/ProgressBar.d.ts +0 -18
- package/esm/components/atoms/ProgressBar/ProgressBar.js +0 -105
- package/esm/components/atoms/ProgressBar/ProgressBar.js.map +0 -1
- package/esm/components/atoms/ProgressBar/index.d.ts +0 -2
- package/esm/components/atoms/ProgressBar/styled.d.ts +0 -20
- package/esm/components/atoms/ProgressBar/styled.js +0 -32
- package/esm/components/atoms/ProgressBar/styled.js.map +0 -1
- package/esm/components/atoms/RadioButton/RadioButton.d.ts +0 -14
- package/esm/components/atoms/RadioButton/RadioButton.js +0 -77
- package/esm/components/atoms/RadioButton/RadioButton.js.map +0 -1
- package/esm/components/atoms/RadioButton/index.d.ts +0 -2
- package/esm/components/atoms/RadioButton/styled.d.ts +0 -27
- package/esm/components/atoms/RadioButton/styled.js +0 -26
- package/esm/components/atoms/RadioButton/styled.js.map +0 -1
- package/esm/components/atoms/Switch/Switch.d.ts +0 -16
- package/esm/components/atoms/Switch/Switch.js +0 -113
- package/esm/components/atoms/Switch/Switch.js.map +0 -1
- package/esm/components/atoms/Switch/animation.d.ts +0 -2
- package/esm/components/atoms/Switch/animation.js +0 -35
- package/esm/components/atoms/Switch/animation.js.map +0 -1
- package/esm/components/atoms/Switch/index.d.ts +0 -2
- package/esm/components/atoms/Switch/styled.d.ts +0 -4
- package/esm/components/atoms/Switch/styled.js +0 -29
- package/esm/components/atoms/Switch/styled.js.map +0 -1
- package/esm/components/atoms/Tag/Tag.d.ts +0 -12
- package/esm/components/atoms/Tag/Tag.js +0 -86
- package/esm/components/atoms/Tag/Tag.js.map +0 -1
- package/esm/components/atoms/Tag/index.d.ts +0 -2
- package/esm/components/atoms/Tag/styled.d.ts +0 -24
- package/esm/components/atoms/Tag/styled.js +0 -35
- package/esm/components/atoms/Tag/styled.js.map +0 -1
- package/esm/components/atoms/Text/Text.d.ts +0 -19
- package/esm/components/atoms/Text/Text.js +0 -76
- package/esm/components/atoms/Text/Text.js.map +0 -1
- package/esm/components/atoms/Text/functions.d.ts +0 -2
- package/esm/components/atoms/Text/functions.js +0 -5
- package/esm/components/atoms/Text/functions.js.map +0 -1
- package/esm/components/atoms/Text/index.d.ts +0 -2
- package/esm/components/atoms/Text/styled.d.ts +0 -6
- package/esm/components/atoms/Text/styled.js +0 -22
- package/esm/components/atoms/Text/styled.js.map +0 -1
- package/esm/components/atoms/shared/PaperAndCard.d.ts +0 -3
- package/esm/components/atoms/shared/PaperAndCard.js +0 -21
- package/esm/components/atoms/shared/PaperAndCard.js.map +0 -1
- package/esm/components/molecules/Calendar/Calendar.d.ts +0 -20
- package/esm/components/molecules/Calendar/Calendar.js +0 -150
- package/esm/components/molecules/Calendar/Calendar.js.map +0 -1
- package/esm/components/molecules/Calendar/components/MonthWeek.d.ts +0 -13
- package/esm/components/molecules/Calendar/components/MonthWeek.js +0 -110
- package/esm/components/molecules/Calendar/components/MonthWeek.js.map +0 -1
- package/esm/components/molecules/Calendar/components/Weekdays.d.ts +0 -8
- package/esm/components/molecules/Calendar/components/Weekdays.js +0 -23
- package/esm/components/molecules/Calendar/components/Weekdays.js.map +0 -1
- package/esm/components/molecules/Calendar/components/index.d.ts +0 -2
- package/esm/components/molecules/Calendar/index.d.ts +0 -2
- package/esm/components/molecules/Calendar/styled.d.ts +0 -61
- package/esm/components/molecules/Calendar/styled.js +0 -83
- package/esm/components/molecules/Calendar/styled.js.map +0 -1
- package/esm/components/molecules/DatePicker/DatePicker.d.ts +0 -19
- package/esm/components/molecules/DatePicker/DatePicker.js +0 -156
- package/esm/components/molecules/DatePicker/DatePicker.js.map +0 -1
- package/esm/components/molecules/DatePicker/index.d.ts +0 -2
- package/esm/components/molecules/DatePicker/styled.d.ts +0 -15
- package/esm/components/molecules/DatePicker/styled.js +0 -28
- package/esm/components/molecules/DatePicker/styled.js.map +0 -1
- package/esm/components/molecules/DateTimePicker/DateTimePicker.d.ts +0 -17
- package/esm/components/molecules/DateTimePicker/DateTimePicker.js +0 -175
- package/esm/components/molecules/DateTimePicker/DateTimePicker.js.map +0 -1
- package/esm/components/molecules/DateTimePicker/index.d.ts +0 -2
- package/esm/components/molecules/DateTimePicker/styled.d.ts +0 -8
- package/esm/components/molecules/DateTimePicker/styled.js +0 -10
- package/esm/components/molecules/DateTimePicker/styled.js.map +0 -1
- package/esm/components/molecules/DateTimeSelector/DateTimeSelector.d.ts +0 -28
- package/esm/components/molecules/DateTimeSelector/DateTimeSelector.js +0 -215
- package/esm/components/molecules/DateTimeSelector/DateTimeSelector.js.map +0 -1
- package/esm/components/molecules/DateTimeSelector/Selector.d.ts +0 -17
- package/esm/components/molecules/DateTimeSelector/Selector.js +0 -124
- package/esm/components/molecules/DateTimeSelector/Selector.js.map +0 -1
- package/esm/components/molecules/DateTimeSelector/index.d.ts +0 -2
- package/esm/components/molecules/DateTimeSelector/styled.d.ts +0 -52
- package/esm/components/molecules/DateTimeSelector/styled.js +0 -56
- package/esm/components/molecules/DateTimeSelector/styled.js.map +0 -1
- package/esm/components/molecules/Grid/functions.d.ts +0 -3
- package/esm/components/molecules/Grid/functions.js +0 -26
- package/esm/components/molecules/Grid/functions.js.map +0 -1
- package/esm/components/molecules/Grid/index.d.ts +0 -42
- package/esm/components/molecules/HintInputContainer/HintInputContainer.d.ts +0 -17
- package/esm/components/molecules/HintInputContainer/HintInputContainer.js +0 -81
- package/esm/components/molecules/HintInputContainer/HintInputContainer.js.map +0 -1
- package/esm/components/molecules/HintInputContainer/index.d.ts +0 -2
- package/esm/components/molecules/HintInputContainer/styled.d.ts +0 -0
- package/esm/components/molecules/IconTextButton/IconComponent.d.ts +0 -9
- package/esm/components/molecules/IconTextButton/IconComponent.js +0 -34
- package/esm/components/molecules/IconTextButton/IconComponent.js.map +0 -1
- package/esm/components/molecules/IconTextButton/IconTextButton.d.ts +0 -8
- package/esm/components/molecules/IconTextButton/index.d.ts +0 -2
- package/esm/components/molecules/InputPassword/InputPasswordIcon.d.ts +0 -8
- package/esm/components/molecules/InputPassword/InputPasswordIcon.js +0 -57
- package/esm/components/molecules/InputPassword/InputPasswordIcon.js.map +0 -1
- package/esm/components/molecules/InputPassword/index.d.ts +0 -1
- package/esm/components/molecules/InputPassword/styled.d.ts +0 -7
- package/esm/components/molecules/InputPassword/styled.js +0 -14
- package/esm/components/molecules/InputPassword/styled.js.map +0 -1
- package/esm/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +0 -7
- package/esm/components/molecules/LabeledSwitch/index.d.ts +0 -1
- package/esm/components/molecules/Snackbar/Snackbar.d.ts +0 -19
- package/esm/components/molecules/Snackbar/Snackbar.js +0 -102
- package/esm/components/molecules/Snackbar/Snackbar.js.map +0 -1
- package/esm/components/molecules/Snackbar/index.d.ts +0 -2
- package/esm/components/molecules/Snackbar/styled.d.ts +0 -47
- package/esm/components/molecules/Snackbar/styled.js +0 -90
- package/esm/components/molecules/Snackbar/styled.js.map +0 -1
- package/esm/components/molecules/TextArea/TextArea.d.ts +0 -14
- package/esm/components/molecules/TextArea/TextArea.js +0 -76
- package/esm/components/molecules/TextArea/TextArea.js.map +0 -1
- package/esm/components/molecules/TextArea/index.d.ts +0 -3
- package/esm/components/molecules/TextArea/styled.d.ts +0 -2
- package/esm/components/molecules/TextArea/styled.js +0 -27
- package/esm/components/molecules/TextArea/styled.js.map +0 -1
- package/esm/hooks/index.d.ts +0 -2
- package/esm/hooks/useDebouncedState.d.ts +0 -2
- package/esm/hooks/useDebouncedState.js +0 -16
- package/esm/hooks/useDebouncedState.js.map +0 -1
- package/esm/hooks/useTheme.d.ts +0 -2
- package/esm/hooks/useTheme.js +0 -6
- package/esm/hooks/useTheme.js.map +0 -1
- package/esm/index.d.ts +0 -64
- package/esm/index.js +0 -55
- package/esm/index.js.map +0 -1
- package/esm/styles/ThemeProvider.d.ts +0 -4
- package/esm/styles/ThemeProvider.js +0 -14
- package/esm/styles/ThemeProvider.js.map +0 -1
- package/esm/styles/definitions.d.ts +0 -45
- package/esm/styles/definitions.js +0 -158
- package/esm/styles/definitions.js.map +0 -1
- package/esm/styles/light.d.ts +0 -2
- package/esm/styles/light.js +0 -55
- package/esm/styles/light.js.map +0 -1
- package/esm/types/defaults.d.ts +0 -134
- package/esm/utils/IPhoneXHelper.d.ts +0 -4
- package/esm/utils/IPhoneXHelper.js +0 -25
- package/esm/utils/IPhoneXHelper.js.map +0 -1
- package/esm/utils/ResponsiveFontSize.d.ts +0 -3
- package/esm/utils/ResponsiveFontSize.js +0 -32
- package/esm/utils/ResponsiveFontSize.js.map +0 -1
- package/esm/utils/extractNumbersFromString.d.ts +0 -2
- package/esm/utils/extractNumbersFromString.js +0 -5
- package/esm/utils/extractNumbersFromString.js.map +0 -1
- package/esm/utils/formatWithMask.d.ts +0 -3
- package/esm/utils/formatWithMask.js +0 -26
- package/esm/utils/formatWithMask.js.map +0 -1
- package/esm/utils/index.d.ts +0 -7
- package/esm/utils/lightenDarkenColor.d.ts +0 -1
- package/esm/utils/lightenDarkenColor.js +0 -27
- package/esm/utils/lightenDarkenColor.js.map +0 -1
- package/esm/utils/masks.d.ts +0 -11
- package/esm/utils/masks.js +0 -20
- package/esm/utils/masks.js.map +0 -1
- package/esm/utils/variantComplement.d.ts +0 -6
- package/esm/utils/variantComplement.js +0 -28
- package/esm/utils/variantComplement.js.map +0 -1
- package/rollup.config.js +0 -36
- package/src/components/atoms/Avatar/Avatar.stories.tsx +0 -21
- package/src/components/atoms/Avatar/Avatar.tsx +0 -56
- package/src/components/atoms/Avatar/helpers.ts +0 -10
- package/src/components/atoms/Avatar/index.ts +0 -2
- package/src/components/atoms/Avatar/styled.ts +0 -43
- package/src/components/atoms/Badge/Badge.tsx +0 -30
- package/src/components/atoms/Badge/index.ts +0 -2
- package/src/components/atoms/Badge/styled.ts +0 -34
- package/src/components/atoms/BoxContent/BoxContent.stories.tsx +0 -30
- package/src/components/atoms/BoxContent/BoxContent.tsx +0 -13
- package/src/components/atoms/BoxContent/index.ts +0 -2
- package/src/components/atoms/BoxContent/styled.ts +0 -67
- package/src/components/atoms/Button/Button.tsx +0 -103
- package/src/components/atoms/Button/States/BaseState.tsx +0 -38
- package/src/components/atoms/Button/States/Error.tsx +0 -9
- package/src/components/atoms/Button/States/Loading.tsx +0 -33
- package/src/components/atoms/Button/States/Success.tsx +0 -9
- package/src/components/atoms/Button/States/index.ts +0 -3
- package/src/components/atoms/Button/States/styled.ts +0 -23
- package/src/components/atoms/Button/index.ts +0 -8
- package/src/components/atoms/Button/styled.ts +0 -51
- package/src/components/atoms/Card/Card.stories.tsx +0 -29
- package/src/components/atoms/Card/Card.tsx +0 -35
- package/src/components/atoms/Card/Footer/Footer.tsx +0 -12
- package/src/components/atoms/Card/Footer/index.ts +0 -2
- package/src/components/atoms/Card/Header/Header.tsx +0 -12
- package/src/components/atoms/Card/Header/index.ts +0 -2
- package/src/components/atoms/Card/index.ts +0 -2
- package/src/components/atoms/Card/styled.ts +0 -13
- package/src/components/atoms/Checkbox/Checkbox.stories.tsx +0 -32
- package/src/components/atoms/Checkbox/Checkbox.tsx +0 -81
- package/src/components/atoms/Checkbox/index.ts +0 -2
- package/src/components/atoms/Checkbox/styled.ts +0 -44
- package/src/components/atoms/Divider/Divider.stories.tsx +0 -28
- package/src/components/atoms/Divider/Divider.tsx +0 -14
- package/src/components/atoms/Divider/index.ts +0 -2
- package/src/components/atoms/Divider/styled.ts +0 -34
- package/src/components/atoms/GroupButton/GroupButton.stories.tsx +0 -55
- package/src/components/atoms/GroupButton/GroupButton.tsx +0 -118
- package/src/components/atoms/GroupButton/GroupButtonOption.tsx +0 -24
- package/src/components/atoms/GroupButton/index.ts +0 -4
- package/src/components/atoms/GroupButton/styled.ts +0 -147
- package/src/components/atoms/Icon/Icon.stories.tsx +0 -21
- package/src/components/atoms/Icon/Icon.tsx +0 -52
- package/src/components/atoms/Icon/helpers.ts +0 -120
- package/src/components/atoms/Icon/index.ts +0 -2
- package/src/components/atoms/Input/Hint.tsx +0 -48
- package/src/components/atoms/Input/InputContainer/InputContainer.tsx +0 -109
- package/src/components/atoms/Input/InputElement/InputElement.tsx +0 -50
- package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +0 -119
- package/src/components/atoms/Input/PressableInputContainer/PressableInputContainer.tsx +0 -36
- package/src/components/atoms/Input/PressableInputContainer/index.ts +0 -2
- package/src/components/atoms/Input/PressableInputContainer/styled.ts +0 -5
- package/src/components/atoms/Input/hooks/useInputFocus.ts +0 -29
- package/src/components/atoms/Input/hooks/useNumberMask.ts +0 -99
- package/src/components/atoms/Input/hooks/useStringMask.ts +0 -128
- package/src/components/atoms/Input/index.ts +0 -16
- package/src/components/atoms/Input/styled.ts +0 -130
- package/src/components/atoms/Paper/Paper.stories.tsx +0 -27
- package/src/components/atoms/Paper/Paper.tsx +0 -21
- package/src/components/atoms/Paper/index.ts +0 -2
- package/src/components/atoms/Paper/styled.ts +0 -14
- package/src/components/atoms/PressableSurface/PressableSurface.tsx +0 -82
- package/src/components/atoms/PressableSurface/index.ts +0 -2
- package/src/components/atoms/ProgressBar/ProgressBar.stories.tsx +0 -27
- package/src/components/atoms/ProgressBar/ProgressBar.tsx +0 -108
- package/src/components/atoms/ProgressBar/index.ts +0 -2
- package/src/components/atoms/ProgressBar/styled.ts +0 -25
- package/src/components/atoms/RadioButton/RadioButton.stories.tsx +0 -39
- package/src/components/atoms/RadioButton/RadioButton.tsx +0 -81
- package/src/components/atoms/RadioButton/index.ts +0 -2
- package/src/components/atoms/RadioButton/styled.ts +0 -29
- package/src/components/atoms/Switch/Switch.stories.tsx +0 -27
- package/src/components/atoms/Switch/Switch.tsx +0 -111
- package/src/components/atoms/Switch/animation.ts +0 -39
- package/src/components/atoms/Switch/index.ts +0 -2
- package/src/components/atoms/Switch/styled.ts +0 -22
- package/src/components/atoms/Tag/Tag.tsx +0 -71
- package/src/components/atoms/Tag/index.ts +0 -2
- package/src/components/atoms/Tag/styled.ts +0 -45
- package/src/components/atoms/Text/Text.stories.tsx +0 -32
- package/src/components/atoms/Text/Text.tsx +0 -68
- package/src/components/atoms/Text/functions.ts +0 -8
- package/src/components/atoms/Text/index.ts +0 -2
- package/src/components/atoms/Text/styled.ts +0 -31
- package/src/components/atoms/shared/PaperAndCard.ts +0 -24
- package/src/components/molecules/Calendar/Calendar.stories.tsx +0 -20
- package/src/components/molecules/Calendar/Calendar.tsx +0 -159
- package/src/components/molecules/Calendar/components/MonthWeek.tsx +0 -139
- package/src/components/molecules/Calendar/components/Weekdays.tsx +0 -34
- package/src/components/molecules/Calendar/components/index.ts +0 -2
- package/src/components/molecules/Calendar/index.ts +0 -7
- package/src/components/molecules/Calendar/styled.ts +0 -117
- package/src/components/molecules/DatePicker/DatePicker.tsx +0 -140
- package/src/components/molecules/DatePicker/index.ts +0 -2
- package/src/components/molecules/DatePicker/styled.ts +0 -20
- package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +0 -147
- package/src/components/molecules/DateTimePicker/index.ts +0 -2
- package/src/components/molecules/DateTimePicker/styled.ts +0 -12
- package/src/components/molecules/DateTimeSelector/DateTimeSelector.tsx +0 -319
- package/src/components/molecules/DateTimeSelector/Selector.tsx +0 -122
- package/src/components/molecules/DateTimeSelector/index.ts +0 -5
- package/src/components/molecules/DateTimeSelector/styled.ts +0 -55
- package/src/components/molecules/Grid/functions.ts +0 -25
- package/src/components/molecules/Grid/index.ts +0 -66
- package/src/components/molecules/HintInputContainer/HintInputContainer.tsx +0 -58
- package/src/components/molecules/HintInputContainer/index.ts +0 -2
- package/src/components/molecules/HintInputContainer/styled.ts +0 -0
- package/src/components/molecules/IconTextButton/IconComponent.tsx +0 -27
- package/src/components/molecules/IconTextButton/IconTextButton.ts +0 -10
- package/src/components/molecules/IconTextButton/index.ts +0 -5
- package/src/components/molecules/InputPassword/InputPasswordIcon.tsx +0 -29
- package/src/components/molecules/InputPassword/index.ts +0 -1
- package/src/components/molecules/InputPassword/styled.ts +0 -7
- package/src/components/molecules/LabeledSwitch/LabeledSwitch.tsx +0 -9
- package/src/components/molecules/LabeledSwitch/index.ts +0 -1
- package/src/components/molecules/Snackbar/Snackbar.tsx +0 -134
- package/src/components/molecules/Snackbar/index.ts +0 -2
- package/src/components/molecules/Snackbar/styled.ts +0 -103
- package/src/components/molecules/TextArea/TextArea.tsx +0 -97
- package/src/components/molecules/TextArea/index.ts +0 -3
- package/src/components/molecules/TextArea/styled.ts +0 -22
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useDebouncedState.ts +0 -24
- package/src/hooks/useTheme.ts +0 -4
- package/src/index.ts +0 -116
- package/src/styles/ThemeProvider.tsx +0 -12
- package/src/styles/definitions.ts +0 -188
- package/src/styles/light.ts +0 -56
- package/src/types/defaults.ts +0 -162
- package/src/utils/IPhoneXHelper.ts +0 -39
- package/src/utils/ResponsiveFontSize.ts +0 -71
- package/src/utils/extractNumbersFromString.ts +0 -5
- package/src/utils/formatWithMask.ts +0 -25
- package/src/utils/index.ts +0 -10
- package/src/utils/lightenDarkenColor.ts +0 -24
- package/src/utils/masks.ts +0 -24
- package/src/utils/variantComplement.ts +0 -36
- package/tsconfig.build.esm.json +0 -10
- package/tsconfig.build.json +0 -11
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var InputContainer = require('../InputContainer/InputContainer.cjs');
|
|
5
|
+
var styled = require('./styled.cjs');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var __defProp = Object.defineProperty;
|
|
28
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
29
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
30
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
31
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
32
|
+
var __spreadValues = (a, b) => {
|
|
33
|
+
for (var prop in b || (b = {}))
|
|
34
|
+
if (__hasOwnProp.call(b, prop))
|
|
35
|
+
__defNormalProp(a, prop, b[prop]);
|
|
36
|
+
if (__getOwnPropSymbols)
|
|
37
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
38
|
+
if (__propIsEnum.call(b, prop))
|
|
39
|
+
__defNormalProp(a, prop, b[prop]);
|
|
40
|
+
}
|
|
41
|
+
return a;
|
|
42
|
+
};
|
|
43
|
+
var __objRest = (source, exclude) => {
|
|
44
|
+
var target = {};
|
|
45
|
+
for (var prop in source)
|
|
46
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
47
|
+
target[prop] = source[prop];
|
|
48
|
+
if (source != null && __getOwnPropSymbols)
|
|
49
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
50
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
51
|
+
target[prop] = source[prop];
|
|
52
|
+
}
|
|
53
|
+
return target;
|
|
54
|
+
};
|
|
55
|
+
const PressableInputContainer = (_a) => {
|
|
56
|
+
var _b = _a, {
|
|
57
|
+
onPress,
|
|
58
|
+
disabled,
|
|
59
|
+
style,
|
|
60
|
+
children
|
|
61
|
+
} = _b, rest = __objRest(_b, [
|
|
62
|
+
"onPress",
|
|
63
|
+
"disabled",
|
|
64
|
+
"style",
|
|
65
|
+
"children"
|
|
66
|
+
]);
|
|
67
|
+
return /* @__PURE__ */ React__namespace.createElement(styled.StyledPressableSurface, {
|
|
68
|
+
onPress,
|
|
69
|
+
disabled,
|
|
70
|
+
style
|
|
71
|
+
}, /* @__PURE__ */ React__namespace.createElement(InputContainer, __spreadValues({
|
|
72
|
+
disabled
|
|
73
|
+
}, rest), children));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
module.exports = PressableInputContainer;
|
|
77
|
+
//# sourceMappingURL=PressableInputContainer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PressableInputContainer.cjs","sources":["../../../../../src/components/atoms/Input/PressableInputContainer/PressableInputContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PressableStateCallbackType, StyleProp, ViewStyle } from 'react-native';\nimport InputContainer, {\n InputContainerProps,\n} from '../InputContainer/InputContainer';\nimport { StyledPressableSurface } from './styled';\n\nexport interface PressableInputContainerProps\n extends Omit<\n InputContainerProps,\n 'value' | 'onChange' | 'onChangeText' | 'disabled' | 'style'\n > {\n onPress?: () => void | never;\n disabled?: boolean;\n style?:\n | StyleProp<ViewStyle>\n | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>);\n}\n\nconst PressableInputContainer: React.FC<PressableInputContainerProps> = ({\n onPress,\n disabled,\n style,\n children,\n ...rest\n}) => {\n return (\n <StyledPressableSurface onPress={onPress} disabled={disabled} style={style}>\n <InputContainer disabled={disabled} {...rest}>\n {children}\n </InputContainer>\n </StyledPressableSurface>\n );\n};\n\nexport default PressableInputContainer;\n"],"names":["React","StyledPressableSurface"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBM,MAAA,uBAAA,GAAkE,CAAC,EAMnE,KAAA;AANmE,EACvE,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,GAvBF,GAmByE,EAKpE,EAAA,IAAA,GAAA,SAAA,CALoE,EAKpE,EAAA;AAAA,IAJH,SAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,GAAA,CAAA,CAAA;AAGA,EAAA,uBACGA,gBAAA,CAAA,aAAA,CAAAC,6BAAA,EAAA;AAAA,IAAuB,OAAA;AAAA,IAAkB,QAAA;AAAA,IAAoB,KAAA;AAAA,GAAA,kBAC3DD,gBAAA,CAAA,aAAA,CAAA,cAAA,EAAA,cAAA,CAAA;AAAA,IAAe,QAAA;AAAA,GAAwB,EAAA,IAAA,CAAA,EACrC,QACH,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import InputContainer from '../InputContainer/InputContainer.mjs';
|
|
3
|
+
import { StyledPressableSurface } from './styled.mjs';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
const PressableInputContainer = (_a) => {
|
|
34
|
+
var _b = _a, {
|
|
35
|
+
onPress,
|
|
36
|
+
disabled,
|
|
37
|
+
style,
|
|
38
|
+
children
|
|
39
|
+
} = _b, rest = __objRest(_b, [
|
|
40
|
+
"onPress",
|
|
41
|
+
"disabled",
|
|
42
|
+
"style",
|
|
43
|
+
"children"
|
|
44
|
+
]);
|
|
45
|
+
return /* @__PURE__ */ React.createElement(StyledPressableSurface, {
|
|
46
|
+
onPress,
|
|
47
|
+
disabled,
|
|
48
|
+
style
|
|
49
|
+
}, /* @__PURE__ */ React.createElement(InputContainer, __spreadValues({
|
|
50
|
+
disabled
|
|
51
|
+
}, rest), children));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { PressableInputContainer as default };
|
|
55
|
+
//# sourceMappingURL=PressableInputContainer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PressableInputContainer.mjs","sources":["../../../../../src/components/atoms/Input/PressableInputContainer/PressableInputContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PressableStateCallbackType, StyleProp, ViewStyle } from 'react-native';\nimport InputContainer, {\n InputContainerProps,\n} from '../InputContainer/InputContainer';\nimport { StyledPressableSurface } from './styled';\n\nexport interface PressableInputContainerProps\n extends Omit<\n InputContainerProps,\n 'value' | 'onChange' | 'onChangeText' | 'disabled' | 'style'\n > {\n onPress?: () => void | never;\n disabled?: boolean;\n style?:\n | StyleProp<ViewStyle>\n | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>);\n}\n\nconst PressableInputContainer: React.FC<PressableInputContainerProps> = ({\n onPress,\n disabled,\n style,\n children,\n ...rest\n}) => {\n return (\n <StyledPressableSurface onPress={onPress} disabled={disabled} style={style}>\n <InputContainer disabled={disabled} {...rest}>\n {children}\n </InputContainer>\n </StyledPressableSurface>\n );\n};\n\nexport default PressableInputContainer;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBM,MAAA,uBAAA,GAAkE,CAAC,EAMnE,KAAA;AANmE,EACvE,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,GAvBF,GAmByE,EAKpE,EAAA,IAAA,GAAA,SAAA,CALoE,EAKpE,EAAA;AAAA,IAJH,SAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,GAAA,CAAA,CAAA;AAGA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,sBAAA,EAAA;AAAA,IAAuB,OAAA;AAAA,IAAkB,QAAA;AAAA,IAAoB,KAAA;AAAA,GAAA,kBAC3D,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,cAAA,CAAA;AAAA,IAAe,QAAA;AAAA,GAAwB,EAAA,IAAA,CAAA,EACrC,QACH,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('@emotion/native');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
|
+
|
|
11
|
+
const StyledPressableSurface = styled__default["default"].Pressable`
|
|
12
|
+
width: 100%;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports.StyledPressableSurface = StyledPressableSurface;
|
|
16
|
+
//# sourceMappingURL=styled.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.cjs","sources":["../../../../../src/components/atoms/Input/PressableInputContainer/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\n\nexport const StyledPressableSurface = styled.Pressable`\n width: 100%;\n`;\n"],"names":["styled"],"mappings":";;;;;;;;;;AAEO,MAAM,yBAAyBA,0BAAO,CAAA,SAAA,CAAA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.mjs","sources":["../../../../../src/components/atoms/Input/PressableInputContainer/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\n\nexport const StyledPressableSurface = styled.Pressable`\n width: 100%;\n`;\n"],"names":[],"mappings":";;AAEO,MAAM,yBAAyB,MAAO,CAAA,SAAA,CAAA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const useInputFocus = (onFocus, onBlur, focusEnabled = true) => {
|
|
8
|
+
const [focused, setFocused] = React.useState(false);
|
|
9
|
+
const handleFocus = React.useCallback(() => {
|
|
10
|
+
if (focusEnabled) {
|
|
11
|
+
setFocused(true);
|
|
12
|
+
onFocus && onFocus();
|
|
13
|
+
}
|
|
14
|
+
}, [focusEnabled, setFocused, onFocus]);
|
|
15
|
+
const handleBlur = React.useCallback(() => {
|
|
16
|
+
if (focusEnabled) {
|
|
17
|
+
setFocused(false);
|
|
18
|
+
onBlur && onBlur();
|
|
19
|
+
}
|
|
20
|
+
}, [focusEnabled, setFocused, onBlur]);
|
|
21
|
+
return {
|
|
22
|
+
focused,
|
|
23
|
+
handleBlur,
|
|
24
|
+
handleFocus
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.useInputFocus = useInputFocus;
|
|
29
|
+
//# sourceMappingURL=useInputFocus.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputFocus.cjs","sources":["../../../../../src/components/atoms/Input/hooks/useInputFocus.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nexport const useInputFocus = (\n onFocus?: () => void,\n onBlur?: () => void,\n focusEnabled = true\n) => {\n const [focused, setFocused] = useState<boolean>(false);\n\n const handleFocus = useCallback(() => {\n if (focusEnabled) {\n setFocused(true);\n onFocus && onFocus();\n }\n }, [focusEnabled, setFocused, onFocus]);\n\n const handleBlur = useCallback(() => {\n if (focusEnabled) {\n setFocused(false);\n onBlur && onBlur();\n }\n }, [focusEnabled, setFocused, onBlur]);\n\n return {\n focused,\n handleBlur,\n handleFocus,\n };\n};\n"],"names":["useState","useCallback"],"mappings":";;;;;;AAEO,MAAM,aAAgB,GAAA,CAC3B,OACA,EAAA,MAAA,EACA,eAAe,IACZ,KAAA;AACH,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAIA,eAAkB,KAAK,CAAA,CAAA;AAErD,EAAM,MAAA,WAAA,GAAcC,kBAAY,MAAM;AACpC,IAAA,IAAI,YAAc,EAAA;AAChB,MAAA,UAAA,CAAW,IAAI,CAAA,CAAA;AACf,MAAA,OAAA,IAAW,OAAQ,EAAA,CAAA;AAAA,KACrB;AAAA,GACC,EAAA,CAAC,YAAc,EAAA,UAAA,EAAY,OAAO,CAAC,CAAA,CAAA;AAEtC,EAAM,MAAA,UAAA,GAAaA,kBAAY,MAAM;AACnC,IAAA,IAAI,YAAc,EAAA;AAChB,MAAA,UAAA,CAAW,KAAK,CAAA,CAAA;AAChB,MAAA,MAAA,IAAU,MAAO,EAAA,CAAA;AAAA,KACnB;AAAA,GACC,EAAA,CAAC,YAAc,EAAA,UAAA,EAAY,MAAM,CAAC,CAAA,CAAA;AAErC,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
const useInputFocus = (onFocus, onBlur, focusEnabled = true) => {
|
|
4
|
+
const [focused, setFocused] = useState(false);
|
|
5
|
+
const handleFocus = useCallback(() => {
|
|
6
|
+
if (focusEnabled) {
|
|
7
|
+
setFocused(true);
|
|
8
|
+
onFocus && onFocus();
|
|
9
|
+
}
|
|
10
|
+
}, [focusEnabled, setFocused, onFocus]);
|
|
11
|
+
const handleBlur = useCallback(() => {
|
|
12
|
+
if (focusEnabled) {
|
|
13
|
+
setFocused(false);
|
|
14
|
+
onBlur && onBlur();
|
|
15
|
+
}
|
|
16
|
+
}, [focusEnabled, setFocused, onBlur]);
|
|
17
|
+
return {
|
|
18
|
+
focused,
|
|
19
|
+
handleBlur,
|
|
20
|
+
handleFocus
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { useInputFocus };
|
|
25
|
+
//# sourceMappingURL=useInputFocus.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputFocus.mjs","sources":["../../../../../src/components/atoms/Input/hooks/useInputFocus.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nexport const useInputFocus = (\n onFocus?: () => void,\n onBlur?: () => void,\n focusEnabled = true\n) => {\n const [focused, setFocused] = useState<boolean>(false);\n\n const handleFocus = useCallback(() => {\n if (focusEnabled) {\n setFocused(true);\n onFocus && onFocus();\n }\n }, [focusEnabled, setFocused, onFocus]);\n\n const handleBlur = useCallback(() => {\n if (focusEnabled) {\n setFocused(false);\n onBlur && onBlur();\n }\n }, [focusEnabled, setFocused, onBlur]);\n\n return {\n focused,\n handleBlur,\n handleFocus,\n };\n};\n"],"names":[],"mappings":";;AAEO,MAAM,aAAgB,GAAA,CAC3B,OACA,EAAA,MAAA,EACA,eAAe,IACZ,KAAA;AACH,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAErD,EAAM,MAAA,WAAA,GAAc,YAAY,MAAM;AACpC,IAAA,IAAI,YAAc,EAAA;AAChB,MAAA,UAAA,CAAW,IAAI,CAAA,CAAA;AACf,MAAA,OAAA,IAAW,OAAQ,EAAA,CAAA;AAAA,KACrB;AAAA,GACC,EAAA,CAAC,YAAc,EAAA,UAAA,EAAY,OAAO,CAAC,CAAA,CAAA;AAEtC,EAAM,MAAA,UAAA,GAAa,YAAY,MAAM;AACnC,IAAA,IAAI,YAAc,EAAA;AAChB,MAAA,UAAA,CAAW,KAAK,CAAA,CAAA;AAChB,MAAA,MAAA,IAAU,MAAO,EAAA,CAAA;AAAA,KACnB;AAAA,GACC,EAAA,CAAC,YAAc,EAAA,UAAA,EAAY,MAAM,CAAC,CAAA,CAAA;AAErC,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var currency = require('currency.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var extractNumbersFromString = require('../../../../utils/extractNumbersFromString.cjs');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var currency__default = /*#__PURE__*/_interopDefaultLegacy(currency);
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
+
if (__propIsEnum.call(b, prop))
|
|
25
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
const DEFAULT_OPTIONS = {
|
|
30
|
+
symbol: "R$ ",
|
|
31
|
+
separator: ".",
|
|
32
|
+
decimal: ",",
|
|
33
|
+
precision: 2
|
|
34
|
+
};
|
|
35
|
+
const getRegex = (precision) => new RegExp(`\\B(?=(\\d{${precision}})(?!\\d))`, "g");
|
|
36
|
+
const getInternalNumberAndMask = (value, options) => {
|
|
37
|
+
const mergedOptions = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options);
|
|
38
|
+
const { precision = -1 } = mergedOptions;
|
|
39
|
+
let internalNumber;
|
|
40
|
+
if (typeof value === "number") {
|
|
41
|
+
if (precision) {
|
|
42
|
+
let stringValue = String(value);
|
|
43
|
+
const decimalIndex = stringValue.indexOf(".");
|
|
44
|
+
const currentPrecision = decimalIndex + precision;
|
|
45
|
+
if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {
|
|
46
|
+
const zeros = stringValue.length + 1 - currentPrecision;
|
|
47
|
+
for (let i = 0; i < zeros; i++)
|
|
48
|
+
stringValue = stringValue + `0`;
|
|
49
|
+
}
|
|
50
|
+
internalNumber = Number(stringValue);
|
|
51
|
+
} else {
|
|
52
|
+
internalNumber = value;
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
const onlyNumbers = String(extractNumbersFromString.extractNumbersFromString(value));
|
|
56
|
+
const padZeros = String(onlyNumbers).padStart(precision + 1, "0");
|
|
57
|
+
internalNumber = Number(padZeros.replace(getRegex(precision), "."));
|
|
58
|
+
}
|
|
59
|
+
if (internalNumber > Number.MAX_SAFE_INTEGER) {
|
|
60
|
+
internalNumber = Number.MAX_SAFE_INTEGER;
|
|
61
|
+
}
|
|
62
|
+
if (internalNumber < Number.MIN_SAFE_INTEGER) {
|
|
63
|
+
internalNumber = Number.MIN_SAFE_INTEGER;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
internalNumber,
|
|
67
|
+
mergedOptions
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const useNumberMask = (options, defaultValue) => {
|
|
71
|
+
const applyMask = React.useCallback(
|
|
72
|
+
(value2 = 0) => {
|
|
73
|
+
const { internalNumber, mergedOptions } = getInternalNumberAndMask(
|
|
74
|
+
value2,
|
|
75
|
+
options
|
|
76
|
+
);
|
|
77
|
+
return {
|
|
78
|
+
raw: internalNumber,
|
|
79
|
+
formatted: currency__default["default"](internalNumber).format(mergedOptions)
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
[options, getRegex]
|
|
83
|
+
);
|
|
84
|
+
const [value, setValue] = React.useState(applyMask(defaultValue));
|
|
85
|
+
const handleChangeValue = React.useCallback(
|
|
86
|
+
(formattedValue) => {
|
|
87
|
+
const { raw, formatted } = applyMask(formattedValue);
|
|
88
|
+
setValue({
|
|
89
|
+
raw,
|
|
90
|
+
formatted
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
[applyMask, setValue]
|
|
94
|
+
);
|
|
95
|
+
return [value, handleChangeValue];
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.getInternalNumberAndMask = getInternalNumberAndMask;
|
|
99
|
+
exports.useNumberMask = useNumberMask;
|
|
100
|
+
//# sourceMappingURL=useNumberMask.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNumberMask.cjs","sources":["../../../../../src/components/atoms/Input/hooks/useNumberMask.ts"],"sourcesContent":["import currency from 'currency.js';\nimport { useCallback, useState } from 'react';\nimport { extractNumbersFromString } from '../../../../utils/extractNumbersFromString';\nimport { MaskValue } from './useStringMask';\n\nexport type CurrencyOptions = currency.Options;\n\nconst DEFAULT_OPTIONS: CurrencyOptions = {\n symbol: 'R$ ',\n separator: '.',\n decimal: ',',\n precision: 2,\n};\n\nconst getRegex = (precision: number) =>\n new RegExp(`\\\\B(?=(\\\\d{${precision}})(?!\\\\d))`, 'g');\n\nexport const getInternalNumberAndMask = (\n value: string | number,\n options?: CurrencyOptions\n): { internalNumber: number; mergedOptions: CurrencyOptions } => {\n const mergedOptions = { ...DEFAULT_OPTIONS, ...options };\n const { precision = -1 } = mergedOptions;\n\n let internalNumber;\n\n if (typeof value === 'number') {\n if (precision) {\n let stringValue = String(value);\n const decimalIndex = stringValue.indexOf('.');\n const currentPrecision = decimalIndex + precision;\n if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {\n const zeros = stringValue.length + 1 - currentPrecision;\n for (let i = 0; i < zeros; i++) stringValue = stringValue + `0`;\n }\n internalNumber = Number(stringValue);\n } else {\n internalNumber = value;\n }\n } else {\n const onlyNumbers = String(extractNumbersFromString(value));\n const padZeros = String(onlyNumbers).padStart(precision + 1, '0');\n internalNumber = Number(padZeros.replace(getRegex(precision), '.'));\n }\n\n if (internalNumber > Number.MAX_SAFE_INTEGER) {\n internalNumber = Number.MAX_SAFE_INTEGER;\n }\n\n if (internalNumber < Number.MIN_SAFE_INTEGER) {\n internalNumber = Number.MIN_SAFE_INTEGER;\n }\n\n return {\n internalNumber,\n mergedOptions,\n };\n};\n\n/**\n * TODO:\n * @param options\n * @param defaultValue\n * @returns\n */\nexport const useNumberMask = (\n options?: CurrencyOptions,\n defaultValue?: string | number\n): [MaskValue, (value: string | number) => void] => {\n const applyMask = useCallback(\n (value: string | number = 0): MaskValue => {\n const { internalNumber, mergedOptions } = getInternalNumberAndMask(\n value,\n options\n );\n\n return {\n raw: internalNumber,\n formatted: currency(internalNumber).format(mergedOptions),\n };\n },\n [options, getRegex]\n );\n\n const [value, setValue] = useState<MaskValue>(applyMask(defaultValue));\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue);\n setValue({\n raw,\n formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"names":["extractNumbersFromString","useCallback","value","currency","useState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,eAAmC,GAAA;AAAA,EACvC,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,GAAA;AAAA,EACX,OAAS,EAAA,GAAA;AAAA,EACT,SAAW,EAAA,CAAA;A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,KACH;AAAA,IACA,CAAC,WAAW,QAAQ,CAAA;AAAA,GACtB,CAAA;AAEA,EAAO,OAAA,CAAC,OAAO,iBAAiB,CAAA,CAAA;AAClC;;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import currency from 'currency.js';
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { extractNumbersFromString } from '../../../../utils/extractNumbersFromString.mjs';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
const DEFAULT_OPTIONS = {
|
|
22
|
+
symbol: "R$ ",
|
|
23
|
+
separator: ".",
|
|
24
|
+
decimal: ",",
|
|
25
|
+
precision: 2
|
|
26
|
+
};
|
|
27
|
+
const getRegex = (precision) => new RegExp(`\\B(?=(\\d{${precision}})(?!\\d))`, "g");
|
|
28
|
+
const getInternalNumberAndMask = (value, options) => {
|
|
29
|
+
const mergedOptions = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options);
|
|
30
|
+
const { precision = -1 } = mergedOptions;
|
|
31
|
+
let internalNumber;
|
|
32
|
+
if (typeof value === "number") {
|
|
33
|
+
if (precision) {
|
|
34
|
+
let stringValue = String(value);
|
|
35
|
+
const decimalIndex = stringValue.indexOf(".");
|
|
36
|
+
const currentPrecision = decimalIndex + precision;
|
|
37
|
+
if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {
|
|
38
|
+
const zeros = stringValue.length + 1 - currentPrecision;
|
|
39
|
+
for (let i = 0; i < zeros; i++)
|
|
40
|
+
stringValue = stringValue + `0`;
|
|
41
|
+
}
|
|
42
|
+
internalNumber = Number(stringValue);
|
|
43
|
+
} else {
|
|
44
|
+
internalNumber = value;
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
const onlyNumbers = String(extractNumbersFromString(value));
|
|
48
|
+
const padZeros = String(onlyNumbers).padStart(precision + 1, "0");
|
|
49
|
+
internalNumber = Number(padZeros.replace(getRegex(precision), "."));
|
|
50
|
+
}
|
|
51
|
+
if (internalNumber > Number.MAX_SAFE_INTEGER) {
|
|
52
|
+
internalNumber = Number.MAX_SAFE_INTEGER;
|
|
53
|
+
}
|
|
54
|
+
if (internalNumber < Number.MIN_SAFE_INTEGER) {
|
|
55
|
+
internalNumber = Number.MIN_SAFE_INTEGER;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
internalNumber,
|
|
59
|
+
mergedOptions
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const useNumberMask = (options, defaultValue) => {
|
|
63
|
+
const applyMask = useCallback(
|
|
64
|
+
(value2 = 0) => {
|
|
65
|
+
const { internalNumber, mergedOptions } = getInternalNumberAndMask(
|
|
66
|
+
value2,
|
|
67
|
+
options
|
|
68
|
+
);
|
|
69
|
+
return {
|
|
70
|
+
raw: internalNumber,
|
|
71
|
+
formatted: currency(internalNumber).format(mergedOptions)
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
[options, getRegex]
|
|
75
|
+
);
|
|
76
|
+
const [value, setValue] = useState(applyMask(defaultValue));
|
|
77
|
+
const handleChangeValue = useCallback(
|
|
78
|
+
(formattedValue) => {
|
|
79
|
+
const { raw, formatted } = applyMask(formattedValue);
|
|
80
|
+
setValue({
|
|
81
|
+
raw,
|
|
82
|
+
formatted
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
[applyMask, setValue]
|
|
86
|
+
);
|
|
87
|
+
return [value, handleChangeValue];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { getInternalNumberAndMask, useNumberMask };
|
|
91
|
+
//# sourceMappingURL=useNumberMask.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNumberMask.mjs","sources":["../../../../../src/components/atoms/Input/hooks/useNumberMask.ts"],"sourcesContent":["import currency from 'currency.js';\nimport { useCallback, useState } from 'react';\nimport { extractNumbersFromString } from '../../../../utils/extractNumbersFromString';\nimport { MaskValue } from './useStringMask';\n\nexport type CurrencyOptions = currency.Options;\n\nconst DEFAULT_OPTIONS: CurrencyOptions = {\n symbol: 'R$ ',\n separator: '.',\n decimal: ',',\n precision: 2,\n};\n\nconst getRegex = (precision: number) =>\n new RegExp(`\\\\B(?=(\\\\d{${precision}})(?!\\\\d))`, 'g');\n\nexport const getInternalNumberAndMask = (\n value: string | number,\n options?: CurrencyOptions\n): { internalNumber: number; mergedOptions: CurrencyOptions } => {\n const mergedOptions = { ...DEFAULT_OPTIONS, ...options };\n const { precision = -1 } = mergedOptions;\n\n let internalNumber;\n\n if (typeof value === 'number') {\n if (precision) {\n let stringValue = String(value);\n const decimalIndex = stringValue.indexOf('.');\n const currentPrecision = decimalIndex + precision;\n if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {\n const zeros = stringValue.length + 1 - currentPrecision;\n for (let i = 0; i < zeros; i++) stringValue = stringValue + `0`;\n }\n internalNumber = Number(stringValue);\n } else {\n internalNumber = value;\n }\n } else {\n const onlyNumbers = String(extractNumbersFromString(value));\n const padZeros = String(onlyNumbers).padStart(precision + 1, '0');\n internalNumber = Number(padZeros.replace(getRegex(precision), '.'));\n }\n\n if (internalNumber > Number.MAX_SAFE_INTEGER) {\n internalNumber = Number.MAX_SAFE_INTEGER;\n }\n\n if (internalNumber < Number.MIN_SAFE_INTEGER) {\n internalNumber = Number.MIN_SAFE_INTEGER;\n }\n\n return {\n internalNumber,\n mergedOptions,\n };\n};\n\n/**\n * TODO:\n * @param options\n * @param defaultValue\n * @returns\n */\nexport const useNumberMask = (\n options?: CurrencyOptions,\n defaultValue?: string | number\n): [MaskValue, (value: string | number) => void] => {\n const applyMask = useCallback(\n (value: string | number = 0): MaskValue => {\n const { internalNumber, mergedOptions } = getInternalNumberAndMask(\n value,\n options\n );\n\n return {\n raw: internalNumber,\n formatted: currency(internalNumber).format(mergedOptions),\n };\n },\n [options, getRegex]\n );\n\n const [value, setValue] = useState<MaskValue>(applyMask(defaultValue));\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue);\n setValue({\n raw,\n formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"names":["value"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,MAAM,eAAmC,GAAA;AAAA,EACvC,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,GAAA;AAAA,EACX,OAAS,EAAA,GAAA;AAAA,EACT,SAAW,EAAA,CAAA;AACb,CAAA,CAAA;AAEA,MAAM,WAAW,CAAC,SAAA,KAChB,IAAI,MAAO,CAAA,CAAA,WAAA,EAAc,uBAAuB,GAAG,CAAA,CAAA;AAExC,MAAA,wBAAA,GAA2B,CACtC,KAAA,EACA,OAC+D,KAAA;AAC/D,EAAM,MAAA,aAAA,GAAgB,kCAAK,eAAoB,CAAA,EAAA,OAAA,CAAA,CAAA;AAC/C,EAAM,MAAA,EAAE,SAAY,GAAA,CAAA,CAAA,EAAO,GAAA,aAAA,CAAA;AAE3B,EAAI,IAAA,cAAA,CAAA;AAEJ,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA;AAC7B,IAAA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AAA;AAAA,GACF,CAAA;AACF,EAAA;AAQa,MAAA,aAAA,GAAgB,CAC3B,OAAA,EACA,YACkD,KAAA;AAClD,EAAA,MAAM,SAAY,GAAA,WAAA;AAAA,IAChB,CAACA,SAAyB,CAAiB,KAAA;AACzC,MAAM,MAAA,EAAE,cAAgB,EAAA,aAAA,EAAkB,GAAA,wBAAA;AAAA,QACxCA,MAAAA;AAAA,QACA,OAAA;AAAA,OACF,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,GAAK,EAAA,cAAA;AAAA,QACL,SAAW,EAAA,QAAA,CAAS,cAAc,CAAA,CAAE,OAAO,aAAa,CAAA;AAAA,OAC1D,CAAA;AAAA,KACF;AAAA,IACA,CAAC,SAAS,QAAQ,CAAA;AAAA,GACpB,CAAA;AAEA,EAAA,MAAM,CAAC,KAAO,EAAA,QAAQ,IAAI,QAAoB,CAAA,SAAA,CAAU,YAAY,CAAC,CAAA,CAAA;AAErE,EAAA,MAAM,iBAAoB,GAAA,WAAA;AAAA,IACxB,CAAC,cAAoC,KAAA;AACnC,MAAA,MAAM,EAAE,GAAA,EAAK,SAAU,EAAA,GAAI,UAAU,cAAc,CAAA,CAAA;AACnD,MAAS,QAAA,CAAA;AAAA,QACP,GAAA;AAAA,QACA,SAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH;AAAA,IACA,CAAC,WAAW,QAAQ,CAAA;AAAA,GACtB,CAAA;AAEA,EAAO,OAAA,CAAC,OAAO,iBAAiB,CAAA,CAAA;AAClC;;;;"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const mergeMask = (value = "", mask) => {
|
|
8
|
+
let formatted = "";
|
|
9
|
+
let raw = "";
|
|
10
|
+
let iMask = 0;
|
|
11
|
+
let iChars = 0;
|
|
12
|
+
while (!(iMask === mask.length || iChars === value.length)) {
|
|
13
|
+
const maskChar = mask[iMask];
|
|
14
|
+
const valueChar = value[iChars];
|
|
15
|
+
if (maskChar === valueChar) {
|
|
16
|
+
formatted += maskChar;
|
|
17
|
+
iChars++;
|
|
18
|
+
iMask++;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const rawValueChar = value[iChars];
|
|
22
|
+
if (typeof maskChar === "object") {
|
|
23
|
+
iChars++;
|
|
24
|
+
const maskCharRegex = Array.isArray(maskChar) ? maskChar[0] : maskChar;
|
|
25
|
+
const matchRegex = RegExp(maskCharRegex).test(valueChar);
|
|
26
|
+
if (matchRegex) {
|
|
27
|
+
formatted += valueChar;
|
|
28
|
+
raw += rawValueChar;
|
|
29
|
+
iMask++;
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
formatted += maskChar;
|
|
33
|
+
iMask++;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { raw, formatted };
|
|
37
|
+
};
|
|
38
|
+
const getMask = (mask, newValue) => {
|
|
39
|
+
let maskArray;
|
|
40
|
+
const regexArray = [];
|
|
41
|
+
if (typeof mask === "function") {
|
|
42
|
+
maskArray = mask(newValue);
|
|
43
|
+
} else {
|
|
44
|
+
maskArray = mask;
|
|
45
|
+
}
|
|
46
|
+
maskArray.forEach((exp) => {
|
|
47
|
+
if (typeof exp !== "string") {
|
|
48
|
+
if (Array.isArray(exp))
|
|
49
|
+
regexArray.push(exp);
|
|
50
|
+
else
|
|
51
|
+
regexArray.push(exp);
|
|
52
|
+
} else {
|
|
53
|
+
for (let i = 0; i < exp.length; i++) {
|
|
54
|
+
if (exp[i] === "\\") {
|
|
55
|
+
regexArray.push(exp[i + 1]);
|
|
56
|
+
i++;
|
|
57
|
+
} else {
|
|
58
|
+
if (exp[i] === "9")
|
|
59
|
+
regexArray.push(/\d/);
|
|
60
|
+
else if (exp[i] === "a")
|
|
61
|
+
regexArray.push(/[a-zA-Z]/);
|
|
62
|
+
else
|
|
63
|
+
regexArray.push(exp[i]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return regexArray;
|
|
69
|
+
};
|
|
70
|
+
const useStringMask = (mask, defaultValue) => {
|
|
71
|
+
const applyMask = React.useCallback(
|
|
72
|
+
(value2 = "") => {
|
|
73
|
+
const selectedMask = getMask(mask, value2);
|
|
74
|
+
const { formatted, raw } = mergeMask(value2, selectedMask);
|
|
75
|
+
return {
|
|
76
|
+
raw,
|
|
77
|
+
formatted
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
[mask]
|
|
81
|
+
);
|
|
82
|
+
const [value, setValue] = React.useState(
|
|
83
|
+
applyMask(defaultValue == null ? void 0 : defaultValue.toString())
|
|
84
|
+
);
|
|
85
|
+
const handleChangeValue = React.useCallback(
|
|
86
|
+
(formattedValue) => {
|
|
87
|
+
const { raw, formatted } = applyMask(formattedValue == null ? void 0 : formattedValue.toString());
|
|
88
|
+
setValue({
|
|
89
|
+
raw,
|
|
90
|
+
formatted
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
[applyMask, setValue]
|
|
94
|
+
);
|
|
95
|
+
return [value, handleChangeValue];
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.getMask = getMask;
|
|
99
|
+
exports.mergeMask = mergeMask;
|
|
100
|
+
exports.useStringMask = useStringMask;
|
|
101
|
+
//# sourceMappingURL=useStringMask.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStringMask.cjs","sources":["../../../../../src/components/atoms/Input/hooks/useStringMask.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nexport interface MaskValue {\n formatted?: string;\n raw?: string | number;\n}\n\nexport type MaskType = string | RegExp | Array<RegExp>;\n\n/**\n * TODO:\n * @param value\n * @param mask\n * @returns\n */\nexport const mergeMask = (value = '', mask: MaskType[]): MaskValue => {\n let formatted = '';\n let raw = '';\n let iMask = 0;\n let iChars = 0;\n\n while (!(iMask === mask.length || iChars === value.length)) {\n const maskChar = mask[iMask];\n const valueChar = value[iChars];\n\n if (maskChar === valueChar) {\n formatted += maskChar;\n iChars++;\n iMask++;\n continue;\n }\n\n const rawValueChar = value[iChars];\n\n if (typeof maskChar === 'object') {\n iChars++;\n\n const maskCharRegex = Array.isArray(maskChar) ? maskChar[0] : maskChar;\n const matchRegex = RegExp(maskCharRegex).test(valueChar);\n\n if (matchRegex) {\n formatted += valueChar;\n raw += rawValueChar;\n iMask++;\n }\n } else {\n formatted += maskChar;\n iMask++;\n }\n }\n\n return { raw, formatted };\n};\n\nexport const getMask = (\n mask: MaskType[] | ((value: string) => MaskType[]),\n newValue: string\n): MaskType[] => {\n let maskArray: MaskType[];\n const regexArray: MaskType[] = [];\n\n if (typeof mask === 'function') {\n maskArray = mask(newValue);\n } else {\n maskArray = mask;\n }\n\n maskArray.forEach(exp => {\n if (typeof exp !== 'string') {\n if (Array.isArray(exp)) regexArray.push(exp);\n else regexArray.push(exp);\n } else {\n for (let i = 0; i < exp.length; i++) {\n if (exp[i] === '\\\\') {\n regexArray.push(exp[i + 1]);\n i++;\n } else {\n if (exp[i] === '9') regexArray.push(/\\d/);\n else if (exp[i] === 'a') regexArray.push(/[a-zA-Z]/);\n else regexArray.push(exp[i]);\n }\n }\n }\n });\n\n return regexArray;\n};\n\n/**\n * TODO:\n * @param mask\n * @param defaultValue\n * @returns\n */\nexport const useStringMask = (\n mask: MaskType[] | ((value: string) => MaskType[]),\n defaultValue?: string | number\n): [MaskValue, (text: string | number) => void] => {\n const applyMask = useCallback(\n (value = ''): MaskValue => {\n const selectedMask = getMask(mask, value);\n const { formatted, raw } = mergeMask(value, selectedMask);\n\n return {\n raw,\n formatted,\n };\n },\n [mask]\n );\n\n const [value, setValue] = useState<MaskValue>(\n applyMask(defaultValue?.toString())\n );\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue?.toString());\n setValue({\n raw,\n format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