@tecsinapse/react-core 1.17.3 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/components/atoms/Avatar/helpers.js.map +1 -1
- package/dist/components/atoms/Avatar/index.js.map +1 -1
- package/dist/components/atoms/Avatar/styled.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/components/atoms/Badge/index.js.map +1 -1
- package/dist/components/atoms/Badge/styled.js.map +1 -1
- package/dist/components/atoms/BoxContent/BoxContent.js.map +1 -1
- package/dist/components/atoms/BoxContent/index.js.map +1 -1
- package/dist/components/atoms/BoxContent/styled.js +1 -1
- package/dist/components/atoms/BoxContent/styled.js.map +1 -1
- package/dist/components/atoms/Button/Button.js +1 -1
- package/dist/components/atoms/Button/Button.js.map +1 -1
- package/dist/components/atoms/Button/States/BaseState.js.map +1 -1
- package/dist/components/atoms/Button/States/Error.js +1 -1
- package/dist/components/atoms/Button/States/Error.js.map +1 -1
- package/dist/components/atoms/Button/States/Loading.js.map +1 -1
- package/dist/components/atoms/Button/States/Success.js +1 -1
- package/dist/components/atoms/Button/States/Success.js.map +1 -1
- package/dist/components/atoms/Button/States/index.js.map +1 -1
- package/dist/components/atoms/Button/States/styled.js +1 -1
- package/dist/components/atoms/Button/States/styled.js.map +1 -1
- package/dist/components/atoms/Button/index.js +1 -1
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Button/styled.js.map +1 -1
- package/dist/components/atoms/Card/Card.js +1 -1
- package/dist/components/atoms/Card/Card.js.map +1 -1
- package/dist/components/atoms/Card/Footer/Footer.js.map +1 -1
- package/dist/components/atoms/Card/Footer/index.js.map +1 -1
- package/dist/components/atoms/Card/Header/Header.js.map +1 -1
- package/dist/components/atoms/Card/Header/index.js.map +1 -1
- package/dist/components/atoms/Card/index.js.map +1 -1
- package/dist/components/atoms/Card/styled.js.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Checkbox/styled.js +1 -1
- package/dist/components/atoms/Checkbox/styled.js.map +1 -1
- package/dist/components/atoms/Divider/Divider.js.map +1 -1
- package/dist/components/atoms/Divider/index.js.map +1 -1
- package/dist/components/atoms/Divider/styled.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.d.ts +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.js +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
- package/dist/components/atoms/GroupButton/index.js +1 -1
- package/dist/components/atoms/GroupButton/index.js.map +1 -1
- package/dist/components/atoms/GroupButton/styled.js +1 -1
- package/dist/components/atoms/GroupButton/styled.js.map +1 -1
- package/dist/components/atoms/Icon/Icon.js +1 -1
- package/dist/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/components/atoms/Icon/helpers.js +1 -1
- package/dist/components/atoms/Icon/helpers.js.map +1 -1
- package/dist/components/atoms/Icon/index.js.map +1 -1
- package/dist/components/atoms/Input/Hint.js.map +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.d.ts +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.js +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +1 -1
- package/dist/components/atoms/Input/InputElement/InputElement.d.ts +3 -4
- package/dist/components/atoms/Input/InputElement/InputElement.js +1 -1
- package/dist/components/atoms/Input/InputElement/InputElement.js.map +1 -1
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +3 -4
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +1 -1
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/index.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useInputFocus.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useNumberMask.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useStringMask.js +1 -1
- package/dist/components/atoms/Input/hooks/useStringMask.js.map +1 -1
- package/dist/components/atoms/Input/index.js +1 -1
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/Input/styled.js +1 -1
- package/dist/components/atoms/Input/styled.js.map +1 -1
- package/dist/components/atoms/Paper/Paper.js +1 -1
- package/dist/components/atoms/Paper/Paper.js.map +1 -1
- package/dist/components/atoms/Paper/index.js.map +1 -1
- package/dist/components/atoms/Paper/styled.js.map +1 -1
- package/dist/components/atoms/PressableSurface/PressableSurface.js +1 -1
- package/dist/components/atoms/PressableSurface/PressableSurface.js.map +1 -1
- package/dist/components/atoms/PressableSurface/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/atoms/ProgressBar/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/styled.js +1 -1
- package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
- package/dist/components/atoms/RadioButton/RadioButton.js +1 -1
- package/dist/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/RadioButton/styled.js +1 -1
- package/dist/components/atoms/RadioButton/styled.js.map +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts +1 -1
- package/dist/components/atoms/Switch/Switch.js +1 -1
- package/dist/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/components/atoms/Switch/animation.js.map +1 -1
- package/dist/components/atoms/Switch/index.js.map +1 -1
- package/dist/components/atoms/Switch/styled.d.ts +2 -14
- package/dist/components/atoms/Switch/styled.js +1 -1
- package/dist/components/atoms/Switch/styled.js.map +1 -1
- package/dist/components/atoms/Tag/Tag.js +1 -1
- package/dist/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/components/atoms/Tag/index.js.map +1 -1
- package/dist/components/atoms/Tag/styled.js +1 -1
- package/dist/components/atoms/Tag/styled.js.map +1 -1
- package/dist/components/atoms/Text/Text.js +1 -1
- package/dist/components/atoms/Text/Text.js.map +1 -1
- package/dist/components/atoms/Text/functions.js.map +1 -1
- package/dist/components/atoms/Text/index.js.map +1 -1
- package/dist/components/atoms/Text/styled.js +1 -1
- package/dist/components/atoms/Text/styled.js.map +1 -1
- package/dist/components/atoms/shared/PaperAndCard.js.map +1 -1
- package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
- package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
- package/dist/components/molecules/Calendar/components/Weekdays.js.map +1 -1
- package/dist/components/molecules/Calendar/components/index.js +1 -1
- package/dist/components/molecules/Calendar/components/index.js.map +1 -1
- package/dist/components/molecules/Calendar/index.d.ts +1 -1
- package/dist/components/molecules/Calendar/index.js +1 -1
- package/dist/components/molecules/Calendar/index.js.map +1 -1
- package/dist/components/molecules/Calendar/styled.js +1 -1
- package/dist/components/molecules/Calendar/styled.js.map +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/molecules/DatePicker/index.js.map +1 -1
- package/dist/components/molecules/DatePicker/styled.js +1 -1
- package/dist/components/molecules/DatePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +2 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/Selector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/index.js +1 -1
- package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/styled.js +1 -1
- package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
- package/dist/components/molecules/Grid/functions.d.ts +3 -0
- package/dist/components/molecules/Grid/functions.js +21 -0
- package/dist/components/molecules/Grid/functions.js.map +1 -0
- package/dist/components/molecules/Grid/index.d.ts +42 -2
- package/dist/components/molecules/Grid/index.js +4 -13
- package/dist/components/molecules/Grid/index.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js +1 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/index.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/styled.js.map +1 -1
- package/dist/components/molecules/IconTextButton/IconComponent.d.ts +9 -0
- package/dist/components/molecules/IconTextButton/IconComponent.js +28 -0
- package/dist/components/molecules/IconTextButton/IconComponent.js.map +1 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.d.ts +8 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js +4 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
- package/dist/components/molecules/IconTextButton/index.d.ts +2 -0
- package/dist/components/molecules/IconTextButton/index.js +16 -0
- package/dist/components/molecules/IconTextButton/index.js.map +1 -0
- package/dist/components/molecules/IconTextButton/styled.d.ts +4 -0
- package/dist/components/molecules/{Grid/Item/index.js → IconTextButton/styled.js} +19 -5
- package/dist/components/molecules/IconTextButton/styled.js.map +1 -0
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js +1 -1
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +1 -1
- package/dist/components/molecules/InputPassword/index.js.map +1 -1
- package/dist/components/molecules/InputPassword/styled.js.map +1 -1
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +7 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js +4 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -0
- package/dist/components/molecules/LabeledSwitch/index.d.ts +1 -0
- package/dist/components/molecules/LabeledSwitch/index.js +10 -0
- package/dist/components/molecules/LabeledSwitch/index.js.map +1 -0
- package/dist/components/molecules/Snackbar/Snackbar.js +1 -1
- package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/molecules/Snackbar/index.js.map +1 -1
- package/dist/components/molecules/Snackbar/styled.js +1 -1
- package/dist/components/molecules/Snackbar/styled.js.map +1 -1
- package/dist/components/molecules/TextArea/TextArea.d.ts +1 -1
- package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
- package/dist/components/molecules/TextArea/index.js +1 -1
- package/dist/components/molecules/TextArea/index.js.map +1 -1
- package/dist/components/molecules/TextArea/styled.d.ts +2 -14
- package/dist/components/molecules/TextArea/styled.js.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useDebouncedState.js +1 -1
- package/dist/hooks/useDebouncedState.js.map +1 -1
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +58 -30
- package/dist/index.js.map +1 -1
- package/dist/styles/ThemeProvider.js.map +1 -1
- package/dist/styles/definitions.d.ts +2 -1
- package/dist/styles/definitions.js +7 -1
- package/dist/styles/definitions.js.map +1 -1
- package/dist/styles/light.js +2 -1
- package/dist/styles/light.js.map +1 -1
- package/dist/types/defaults.d.ts +8 -2
- package/dist/types/defaults.js.map +1 -1
- package/dist/utils/IPhoneXHelper.js +3 -3
- package/dist/utils/IPhoneXHelper.js.map +1 -1
- package/dist/utils/ResponsiveFontSize.js +6 -6
- package/dist/utils/ResponsiveFontSize.js.map +1 -1
- package/dist/utils/extractNumbersFromString.js +1 -1
- package/dist/utils/extractNumbersFromString.js.map +1 -1
- package/dist/utils/formatWithMask.js.map +1 -1
- package/dist/utils/index.d.ts +5 -4
- package/dist/utils/index.js +28 -19
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lightenDarkenColor.js.map +1 -1
- package/dist/utils/masks.js.map +1 -1
- package/dist/utils/variantComplement.d.ts +6 -0
- package/dist/utils/variantComplement.js +35 -0
- package/dist/utils/variantComplement.js.map +1 -0
- package/package.json +5 -5
- package/src/components/atoms/Badge/styled.ts +2 -3
- package/src/components/atoms/GroupButton/GroupButton.tsx +2 -5
- package/src/components/atoms/Input/InputContainer/InputContainer.tsx +3 -3
- package/src/components/atoms/Input/InputElement/InputElement.tsx +4 -5
- package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +4 -5
- package/src/components/atoms/ProgressBar/ProgressBar.tsx +2 -4
- package/src/components/atoms/Switch/Switch.tsx +39 -19
- package/src/components/atoms/Switch/animation.ts +4 -6
- package/src/components/atoms/Switch/styled.ts +4 -6
- package/src/components/atoms/Tag/Tag.tsx +1 -1
- package/src/components/atoms/shared/PaperAndCard.ts +1 -1
- package/src/components/molecules/Calendar/index.ts +1 -1
- package/src/components/molecules/DatePicker/DatePicker.tsx +12 -8
- package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +19 -11
- package/src/components/molecules/DateTimeSelector/DateTimeSelector.tsx +0 -1
- package/src/components/molecules/Grid/functions.ts +29 -0
- package/src/components/molecules/Grid/index.ts +66 -2
- package/src/components/molecules/HintInputContainer/HintInputContainer.tsx +6 -1
- package/src/components/molecules/IconTextButton/IconComponent.tsx +31 -0
- package/src/components/molecules/IconTextButton/IconTextButton.tsx +10 -0
- package/src/components/molecules/IconTextButton/index.ts +2 -0
- package/src/components/molecules/IconTextButton/styled.ts +20 -0
- package/src/components/molecules/LabeledSwitch/LabeledSwitch.tsx +9 -0
- package/src/components/molecules/LabeledSwitch/index.ts +1 -0
- package/src/components/molecules/Snackbar/Snackbar.tsx +1 -1
- package/src/components/molecules/Snackbar/styled.ts +6 -2
- package/src/components/molecules/TextArea/TextArea.tsx +6 -2
- package/src/components/molecules/TextArea/styled.ts +5 -2
- package/src/hooks/useDebouncedState.ts +1 -1
- package/src/index.ts +26 -6
- package/src/styles/definitions.ts +8 -1
- package/src/styles/light.ts +2 -0
- package/src/types/defaults.ts +11 -1
- package/src/utils/IPhoneXHelper.ts +27 -22
- package/src/utils/ResponsiveFontSize.ts +55 -36
- package/src/utils/index.ts +5 -4
- package/src/utils/variantComplement.ts +36 -0
- package/dist/components/molecules/Grid/Grid.d.ts +0 -15
- package/dist/components/molecules/Grid/Grid.js +0 -55
- package/dist/components/molecules/Grid/Grid.js.map +0 -1
- package/dist/components/molecules/Grid/Item/Item.d.ts +0 -30
- package/dist/components/molecules/Grid/Item/Item.js +0 -68
- package/dist/components/molecules/Grid/Item/Item.js.map +0 -1
- package/dist/components/molecules/Grid/Item/index.d.ts +0 -1
- package/dist/components/molecules/Grid/Item/index.js.map +0 -1
- package/src/components/molecules/Grid/Grid.stories.tsx +0 -132
- package/src/components/molecules/Grid/Grid.tsx +0 -87
- package/src/components/molecules/Grid/Item/Item.tsx +0 -93
- package/src/components/molecules/Grid/Item/index.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.GroupButtonValue = exports.GroupButtonProps = exports.GroupButtonOptionProps = exports.GroupButtonOption = exports.GroupButton = void 0;
|
|
5
5
|
|
|
6
6
|
var _GroupButton = _interopRequireWildcard(require("./GroupButton"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/GroupButton/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/GroupButton/index.ts"],"sourcesContent":["export {\n default as GroupButton,\n GroupButtonProps,\n GroupButtonValue,\n} from './GroupButton';\nexport {\n default as GroupButtonOption,\n GroupButtonOptionProps,\n} from './GroupButtonOption';\n"],"mappings":";;;;;AAAA;;;;;;AAKA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.getStyledGroupItemText = exports.StyledPressable = exports.StyledOption = exports.StyledGroupButton = exports.StyledDivider = void 0;
|
|
5
5
|
|
|
6
6
|
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["StyledGroupButton","styled","View","disabledStyles","disabled","isActive","css","getStyledGroupItemText","component","active","theme","miscellaneous","surfaceColor","color","secondary","medium","activeStyles","activeBorderColor","activeBorderColorTone","inactiveStyles","inactiveBackgroundColor","inactiveBackgroundColorTone","inactiveBorderColor","inactiveBorderColorTone","leftStyles","isFirstOption","borderRadius","mili","borderWidth","pico","rightStyles","isLastOption","sizeStyles","buttonSize","spacing","deca","RFValueStr","kilo","StyledPressableBase","PressableSurface","StyledOption","StyledDivider","light","StyledPressable","props"],"sources":["../../../../src/components/atoms/GroupButton/styled.ts"],"sourcesContent":["import styled, { css } from '@emotion/native';\nimport { FC } from 'react';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\nimport { ButtonSizeType } from '../Button';\nimport { PressableSurface } from '../PressableSurface';\nimport { TextProps } from '../Text';\nimport { GroupButtonOptions } from './GroupButton';\nimport { GroupButtonOptionProps } from './GroupButtonOption';\n\ninterface PressableOptions extends GroupButtonOptions {\n isActive: boolean;\n isFirstOption: boolean;\n isLastOption: boolean;\n buttonSize?: ButtonSizeType;\n}\n\nexport const StyledGroupButton = styled.View<Partial<StyleProps>>`\n flex-direction: row;\n`;\n\n// TO FIXED: hexa color to theme definitions\nconst disabledStyles = ({\n disabled,\n isActive,\n}: PressableOptions & Partial<StyleProps>) =>\n disabled &&\n !isActive &&\n css`\n background-color: #dcdcdc;\n `;\n\nexport const getStyledGroupItemText = (component: FC<TextProps>) => {\n return styled(component)<\n Partial<GroupButtonOptionProps> & Partial<StyleProps>\n >`\n color: ${({ active, theme }) =>\n active ? theme.miscellaneous.surfaceColor : theme.color.secondary.medium};\n `;\n};\n\nconst activeStyles = ({\n theme,\n isActive,\n activeBorderColor = 'secondary',\n activeBorderColorTone = 'medium',\n}: PressableOptions & Partial<StyleProps>) =>\n isActive &&\n css`\n border-color: ${theme?.color[activeBorderColor][activeBorderColorTone]};\n `;\n\nconst inactiveStyles = ({\n theme,\n isActive,\n inactiveBackgroundColor,\n inactiveBackgroundColorTone,\n inactiveBorderColor = 'secondary',\n inactiveBorderColorTone = 'light',\n}: PressableOptions & Partial<StyleProps>) => {\n if (!isActive && inactiveBackgroundColor && inactiveBackgroundColorTone) {\n return css`\n border-color: ${theme?.color[inactiveBorderColor][\n inactiveBorderColorTone\n ]};\n `;\n }\n\n if (!isActive) {\n return css`\n border-color: ${theme?.color[inactiveBorderColor][\n inactiveBorderColorTone\n ]};\n `;\n }\n};\n\nconst leftStyles = ({\n theme,\n isFirstOption,\n}: PressableOptions & Partial<StyleProps>) =>\n isFirstOption &&\n css`\n border-top-left-radius: ${theme?.borderRadius.mili};\n border-bottom-left-radius: ${theme?.borderRadius.mili};\n border-left-width: ${theme?.borderWidth.pico};\n `;\n\nconst rightStyles = ({\n theme,\n isLastOption,\n}: PressableOptions & Partial<StyleProps>) =>\n isLastOption &&\n css`\n border-top-right-radius: ${theme?.borderRadius.mili};\n border-bottom-right-radius: ${theme?.borderRadius.mili};\n border-right-width: ${theme?.borderWidth.pico};\n `;\n\nconst sizeStyles = ({\n theme,\n buttonSize = 'small',\n}: PressableOptions & Partial<StyleProps>) => {\n switch (buttonSize) {\n case 'small':\n return css`\n padding: ${theme?.spacing.mili} ${theme?.spacing.deca};\n min-height: ${RFValueStr('34px')};\n `;\n default:\n return css`\n padding: ${theme?.spacing.mili} ${theme?.spacing.kilo};\n min-height: ${RFValueStr('44px')};\n `;\n }\n};\n\nconst StyledPressableBase = styled(PressableSurface)<\n PressableOptions & Partial<StyleProps>\n>`\n border-top-width: ${({ theme }) => theme.borderWidth.pico};\n border-bottom-width: ${({ theme }) => theme.borderWidth.pico};\n justify-content: center;\n align-items: center;\n flex: 1;\n`;\n\nexport const StyledOption = styled.View`\n flex-direction: row;\n flex: 1;\n`;\n\nexport const StyledDivider = styled.View<Partial<StyleProps>>`\n width: ${({ theme }) => theme.borderWidth.pico};\n background-color: ${({ theme }) => theme.color.secondary.light}; ;\n`;\n\nexport const StyledPressable = styled(StyledPressableBase)(\n (props: PressableOptions & Partial<StyleProps>) => css`\n ${activeStyles(props)}\n ${inactiveStyles(props)}\n ${leftStyles(props)}\n ${rightStyles(props)}\n ${sizeStyles(props)}\n ${disabledStyles(props)}\n `\n);\n"],"mappings":";;;;;AAAA;;AAGA;;AAEA;;;;;;AAYO,MAAMA,iBAAiB,GAAGC,eAAA,CAAOC,IAA0B;AAClE;AACA,CAFO;;;AAKP,MAAMC,cAAc,GAAG,CAAC;EACtBC,QADsB;EAEtBC;AAFsB,CAAD,KAIrBD,QAAQ,IACR,CAACC,QADD,IAEA,IAAAC,WAAA,CAAI;AACN;AACA,GARA;;AAUO,MAAMC,sBAAsB,GAAIC,SAAD,IAA8B;EAClE,OAAO,IAAAP,eAAA,EAAOO,SAAP,CAEL;AACJ,aAAa,CAAC;IAAEC,MAAF;IAAUC;EAAV,CAAD,KACPD,MAAM,GAAGC,KAAK,CAACC,aAAN,CAAoBC,YAAvB,GAAsCF,KAAK,CAACG,KAAN,CAAYC,SAAZ,CAAsBC,MAAO;AAC/E,GALE;AAMD,CAPM;;;;AASP,MAAMC,YAAY,GAAG,CAAC;EACpBN,KADoB;EAEpBL,QAFoB;EAGpBY,iBAAiB,GAAG,WAHA;EAIpBC,qBAAqB,GAAG;AAJJ,CAAD,KAMnBb,QAAQ,IACR,IAAAC,WAAA,CAAI;AACN,oBA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AD,IAAmD,IAAAtC,WAAA,CAAI;AACzD,MAAMU,YAAY,CAAC4B,KAAD,CAAQ;AAC1B,MAAMzB,cAAc,CAACyB,KAAD,CAAQ;AAC5B,MAAMpB,UAAU,CAACoB,KAAD,CAAQ;AACxB,MAAMd,WAAW,CAACc,KAAD,CAAQ;AACzB,MAAMZ,UAAU,CAACY,KAAD,CAAQ;AACxB,MAAMzC,cAAc,CAACyC,KAAD,CAAQ;AAC5B,GAR+B,CAAxB"}
|
|
@@ -11,7 +11,7 @@ var _helpers = require("./helpers");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function _extends() { _extends = Object.assign
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
const Icon = ({
|
|
17
17
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["Icon","name","size","type","style","fontColor","colorVariant","colorTone","rest","theme","useTheme","color","getIconColor","RNVIcon","getIconComponent"],"sources":["../../../../src/components/atoms/Icon/Icon.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { useTheme } from '@emotion/react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n IconSizeType,\n IconType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport { getIconColor, getIconComponent } from './helpers';\n\nexport interface IconProps {\n /** Name of the icon. You must use the same icons from react-native-vector-icons */\n name: string;\n /** Default icon sizes from theme */\n size?: IconSizeType;\n /** Icon family. You must use the same icons from react-native-vector-icons */\n type: IconType;\n /** Font theme fill color */\n fontColor?: FontColorType;\n /** Palette theme fill color */\n colorVariant?: ColorType;\n /** Palette theme gradation fill color */\n colorTone?: ColorGradationType;\n style?: StyleProp<TextStyle>;\n}\n\n/** NOTE: When using colors, the order matters if you're trying to merge multiple types. */\nconst Icon: FC<IconProps> = ({\n name,\n size = 'centi',\n type,\n style,\n fontColor = 'dark',\n colorVariant,\n colorTone = 'medium',\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n const color = getIconColor(colorVariant, colorTone, fontColor, theme);\n const RNVIcon = getIconComponent(type, size);\n\n return <RNVIcon {...rest} style={style} name={name} color={color} />;\n};\n\nexport default Icon;\n"],"mappings":";;;;;AAAA;;AAEA;;AASA;;;;;;AAmBA,MAAMA,IAAmB,GAAG,CAAC;EAC3BC,IAD2B;EAE3BC,IAAI,GAAG,OAFoB;EAG3BC,IAH2B;EAI3BC,KAJ2B;EAK3BC,SAAS,GAAG,MALe;EAM3BC,YAN2B;EAO3BC,SAAS,GAAG,QAPe;EAQ3B,GAAGC;AARwB,CAAD,KAStB;EACJ,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EACA,MAAMC,KAAK,GAAG,IAAAC,qBAAA,EAAaN,YAAb,EAA2BC,SAA3B,EAAsCF,SAAtC,EAAiDI,KAAjD,CAAd;EACA,MAAMI,OAAO,GAAG,IAAAC,yBAAA,EAAiBX,IAAjB,EAAuBD,IAAvB,CAAhB;EAEA,OAAO,6BAAC,OAAD,eAAaM,IAAb;IAAmB,KAAK,EAAEJ,KAA1B;IAAiC,IAAI,EAAEH,IAAvC;IAA6C,KAAK,EAAEU;EAApD,GAAP;AACD,CAfD;;eAiBeX,I"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.registerCustomIconType = exports.getIconComponent = exports.getIconColor = void 0;
|
|
5
5
|
|
|
6
6
|
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["customIcons","registerCustomIconType","id","customIcon","getStyledIcon","Component","size","styled","theme","iconSize","getIconComponent","type","require","default","Object","prototype","hasOwnProperty","call","getIconColor","colorVariant","colorGradation","fontColor","color","font"],"sources":["../../../../src/components/atoms/Icon/helpers.ts"],"sourcesContent":["import {\n ColorGradationType,\n ColorType,\n FontColorType,\n IconSizeType,\n IconType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport styled from '@emotion/native';\n\n/* eslint-disable */\nconst customIcons: any = {};\n\nexport const registerCustomIconType = (id: string, customIcon: any) => {\n customIcons[id] = customIcon;\n};\n\nconst getStyledIcon = (Component, size) => styled(Component)`\n font-size: ${({ theme }) => theme.iconSize[size]};\n text-align: center;\n`;\n\nexport const getIconComponent = (type: IconType, size: IconSizeType): any => {\n switch (type) {\n case 'zocial':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Zocial').default,\n size\n );\n case 'octicon':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Octicons').default,\n size\n );\n case 'material':\n return getStyledIcon(\n require('react-native-vector-icons/dist/MaterialIcons').default,\n size\n );\n case 'material-community':\n return getStyledIcon(\n require('react-native-vector-icons/dist/MaterialCommunityIcons')\n .default,\n size\n );\n case 'ionicon':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Ionicons').default,\n size\n );\n case 'foundation':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Foundation').default,\n size\n );\n case 'evilicon':\n return getStyledIcon(\n require('react-native-vector-icons/dist/EvilIcons').default,\n size\n );\n case 'entypo':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Entypo').default,\n size\n );\n case 'font-awesome':\n return getStyledIcon(\n require('react-native-vector-icons/dist/FontAwesome').default,\n size\n );\n case 'font-awesome-5':\n return getStyledIcon(\n require('react-native-vector-icons/dist/FontAwesome5').default,\n size\n );\n case 'simple-line-icon':\n return getStyledIcon(\n require('react-native-vector-icons/dist/SimpleLineIcons').default,\n size\n );\n case 'feather':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Feather').default,\n size\n );\n case 'antdesign':\n case 'ant-design':\n return getStyledIcon(\n require('react-native-vector-icons/dist/AntDesign').default,\n size\n );\n case 'fontisto':\n return getStyledIcon(\n require('react-native-vector-icons/dist/Fontisto').default,\n size\n );\n default:\n if (Object.prototype.hasOwnProperty.call(customIcons, type)) {\n return getStyledIcon(customIcons[type], size);\n }\n return getStyledIcon(\n require('react-native-vector-icons/dist/MaterialIcons').default,\n size\n );\n }\n};\n/* eslint-enable */\nexport const getIconColor = (\n colorVariant: ColorType | undefined,\n colorGradation: ColorGradationType | undefined,\n fontColor: FontColorType,\n theme: ThemeProp\n): string => {\n if (colorVariant && colorGradation) {\n return theme.color[colorVariant][colorGradation];\n }\n return theme.font.color[fontColor];\n};\n"],"mappings":";;;;;AAQA;;;;AAGA,MAAMA,WAAgB,GAAG,EAAzB;;AAEO,MAAMC,sBAAsB,GAAG,CAACC,EAAD,EAAaC,UAAb,KAAiC;EACrEH,WAAW,CAACE,EAAD,CAAX,GAAkBC,UAAlB;AACD,CAFM;;;;AAIP,MAAMC,aAAa,GAAG,CAACC,SAAD,EAAYC,IAAZ,KAAqB,IAAAC,eAAA,EAAOF,SAAP,CAAkB;AAC7D,eAAe,CAAC;EAAEG;AAAF,CAAD,KAAeA,KAAK,CAACC,QAAN,CAAeH,IAAf,CAAqB;AACnD;AACA,CAHA;;AAKO,MAAMI,gBAAgB,GAAG,CAACC,IAAD,EAAiBL,IAAjB,KAA6C;EAC3E,QAAQK,IAAR;IACE,KAAK,QAAL;MACE,OAAOP,aAAa,CAClBQ,OAAO,CAAC,uCAAD,CAAP,CAAiDC,OAD/B,EAElBP,IAFkB,CAApB;;IAIF,KAAK,SAAL;MACE,OAAOF,aAAa,CAClBQ,OAAO,CAAC,yCAAD,CAAP,CAAmDC,OADjC,EAElBP,IAFkB,CAApB;;IAIF,KAAK,UAAL;MACE,OAAOF,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,OADjC,EAElBP,IAFkB,CAApB;;IAIF;MACE,IAAIQ,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCjB,WAArC,EAAkDW,IAAlD,CAAJ,EAA6D;QAC3D,OAAOP,aAAa,CAACJ,WAAW,CAACW,IAAD,CAAZ,EAAoBL,IAApB,CAApB;MACD;;MACD,OAAOF,aAAa,CAClBQ,OAAO,CAAC,8CAAD,CAAP,CAAwDC,OADtC,EAElBP,IAFkB,CAApB;EA7EJ;AAkFD,CAnFM;;;;AAqFA,MAAMY,YAAY,GAAG,CAC1BC,YAD0B,EAE1BC,cAF0B,EAG1BC,SAH0B,EAI1Bb,KAJ0B,KAKf;EACX,IAAIW,YAAY,IAAIC,cAApB,EAAoC;IAClC,OAAOZ,KAAK,CAACc,KAAN,CAAYH,YAAZ,EAA0BC,cAA1B,CAAP;EACD;;EACD,OAAOZ,KAAK,CAACe,IAAN,CAAWD,KAAX,CAAiBD,SAAjB,CAAP;AACD,CAVM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Icon/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Icon/index.ts"],"sourcesContent":["export { default as Icon, IconProps } from './Icon';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Hint.js","names":["Hint","variant","text","TextComponent","Text","color","icon"],"sources":["../../../../src/components/atoms/Input/Hint.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { ColorType } from '../../../types/defaults';\nimport { InputVariantType } from '../Input';\nimport { Text, TextProps } from '../Text';\nimport { StyledHintContainer, StyledHintIcon } from './styled';\n\ninterface HintProps {\n text?: string;\n variant: InputVariantType;\n TextComponent?: FC<TextProps>;\n}\n\nconst Hint: FC<HintProps> = ({ variant, text, TextComponent = Text }) => {\n let color: ColorType;\n let icon;\n\n switch (variant) {\n case 'default':\n color = 'secondary';\n break;\n case 'error':\n color = 'error';\n icon = 'close-circle-outline';\n break;\n case 'success':\n color = 'success';\n icon = 'checkmark-circle-outline';\n break;\n }\n\n return (\n <StyledHintContainer>\n {icon && (\n <StyledHintIcon\n name={icon}\n type=\"ionicon\"\n size=\"centi\"\n colorVariant={color}\n />\n )}\n <TextComponent typography=\"label\" colorVariant={color}>\n {text}\n </TextComponent>\n </StyledHintContainer>\n );\n};\n\nexport default Hint;\n"],"mappings":";;;;;AAAA;;AAGA;;AACA;;;;AAQA,MAAMA,IAAmB,GAAG,CAAC;EAAEC,OAAF;EAAWC,IAAX;EAAiBC,aAAa,GAAGC;AAAjC,CAAD,KAA6C;EACvE,IAAIC,KAAJ;EACA,IAAIC,IAAJ;;EAEA,QAAQL,OAAR;IACE,KAAK,SAAL;MACEI,KAAK,GAAG,WAAR;MACA;;IACF,KAAK,OAAL;MACEA,KAAK,GAAG,OAAR;MACAC,IAAI,GAAG,sBAAP;MACA;;IACF,KAAK,SAAL;MACED,KAAK,GAAG,SAAR;MACAC,IAAI,GAAG,0BAAP;MACA;EAXJ;;EAcA,OACE,6BAAC,2BAAD,QACGA,IAAI,IACH,6BAAC,sBAAD;IACE,IAAI,EAAEA,IADR;IAEE,IAAI,EAAC,SAFP;IAGE,IAAI,EAAC,OAHP;IAIE,YAAY,EAAED;EAJhB,EAFJ,EASE,6BAAC,aAAD;IAAe,UAAU,EAAC,OAA1B;IAAkC,YAAY,EAAEA;EAAhD,GACGH,IADH,CATF,CADF;AAeD,CAjCD;;eAmCeF,I"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { InputElementProps } from '..';
|
|
4
|
-
import { ColorGradationType, ColorType, FontColorType, FontStackType, FontWeightType, TypographyVariationType } from '
|
|
4
|
+
import { ColorGradationType, ColorType, FontColorType, FontStackType, FontWeightType, TypographyVariationType } from '@tecsinapse/react-core';
|
|
5
5
|
import { TextProps } from '../../Text';
|
|
6
6
|
export declare type InputVariantType = 'default' | 'error' | 'success';
|
|
7
7
|
export interface InputContainerProps {
|
|
@@ -11,7 +11,7 @@ var _styled = require("../styled");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function _extends() { _extends = Object.assign
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
const InputContainer = ({
|
|
17
17
|
label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputContainer.js","names":["InputContainer","label","labelColor","labelColorTone","labelColorVariant","labelTypography","labelStack","labelWeight","LabelComponent","Text","leftComponent","rightComponent","inputContainerStyle","disabled","focused","variant","children","rest","_defaultLabelColor","_labelColorVariant","_labelColorTone"],"sources":["../../../../../src/components/atoms/Input/InputContainer/InputContainer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { InputElementProps } from '..';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { Text, TextProps } from '../../Text';\nimport {\n StyledBorderKeeper,\n StyledIconContent,\n StyledInputContainer,\n StyledLabelContainer,\n} from '../styled';\n\nexport type InputVariantType = 'default' | 'error' | 'success';\n\nexport interface InputContainerProps {\n label?: string;\n labelColor?: FontColorType;\n labelColorVariant?: ColorType;\n labelColorTone?: ColorGradationType;\n labelTypography?: TypographyVariationType;\n labelStack?: FontStackType;\n LabelComponent?: FC<TextProps>;\n labelWeight?: FontWeightType;\n leftComponent?: JSX.Element;\n rightComponent?: JSX.Element;\n borderColor?: ColorType;\n borderColorGradation?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n inputContainerStyle?: StyleProp<ViewStyle>;\n focused?: boolean;\n disabled?: boolean;\n variant?: InputVariantType;\n hint?: string;\n hintComponent?: JSX.Element;\n}\n\nconst InputContainer: FC<InputContainerProps & Partial<InputElementProps>> = ({\n label,\n labelColor = 'medium',\n labelColorTone,\n labelColorVariant,\n labelTypography = 'label',\n labelStack = 'default',\n labelWeight = 'bold',\n LabelComponent = Text,\n leftComponent,\n rightComponent,\n inputContainerStyle,\n disabled,\n focused,\n variant,\n children,\n ...rest\n}): JSX.Element => {\n let _defaultLabelColor = labelColorVariant;\n if (variant === 'error') _defaultLabelColor = 'error';\n if (variant === 'success') _defaultLabelColor = 'success';\n const _labelColorVariant = disabled ? 'secondary' : _defaultLabelColor;\n const _labelColorTone = disabled ? 'light' : labelColorTone;\n\n return (\n <StyledInputContainer\n {...rest}\n style={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n >\n <StyledBorderKeeper\n focused={focused}\n disabled={disabled}\n borderColor={_defaultLabelColor}\n />\n\n {leftComponent && <StyledIconContent>{leftComponent}</StyledIconContent>}\n\n <StyledLabelContainer\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n >\n {label && (\n <LabelComponent\n fontColor={labelColor}\n colorTone={_labelColorTone}\n colorVariant={_labelColorVariant}\n typography={labelTypography}\n fontWeight={labelWeight}\n fontStack={labelStack}\n >\n {label}\n </LabelComponent>\n )}\n {children}\n </StyledLabelContainer>\n\n {rightComponent && (\n <StyledIconContent>{rightComponent}</StyledIconContent>\n )}\n </StyledInputContainer>\n );\n};\n\nexport default InputContainer;\n"],"mappings":";;;;;AAAA;;AAWA;;AACA;;;;;;AA+BA,MAAMA,cAAoE,GAAG,CAAC;EAC5EC,KAD4E;EAE5EC,UAAU,GAAG,QAF+D;EAG5EC,cAH4E;EAI5EC,iBAJ4E;EAK5EC,eAAe,GA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
import { StyleProp, TextInputProps, TextStyle } from 'react-native';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';
|
|
3
3
|
export interface InputElementProps extends Omit<TextInputProps, 'onChange' | 'value' | 'ref'> {
|
|
4
4
|
style?: StyleProp<TextStyle>;
|
|
5
5
|
value?: string;
|
|
@@ -8,7 +8,6 @@ export interface InputElementProps extends Omit<TextInputProps, 'onChange' | 'va
|
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
9
|
onFocus?: () => void;
|
|
10
10
|
onBlur?: () => void;
|
|
11
|
-
ref?: React.Ref<any>;
|
|
12
11
|
}
|
|
13
|
-
declare const InputElement:
|
|
12
|
+
declare const InputElement: React.ForwardRefExoticComponent<InputElementProps & React.RefAttributes<TextInput>>;
|
|
14
13
|
export default InputElement;
|
|
@@ -11,7 +11,7 @@ var _styled = require("../styled");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function _extends() { _extends = Object.assign
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
const InputElement = _react2.default.forwardRef(({
|
|
17
17
|
onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputElement.js","names":["InputElement","React","forwardRef","onChange","placeholder","value","disabled","placeholderTextColor","rest","ref","theme","useTheme","_placeholderColor","font","color","dark","displayName"],"sources":["../../../../../src/components/atoms/Input/InputElement/InputElement.tsx"],"sourcesContent":["import { useTheme } from '@emotion/react';\nimport { ThemeProp } from '@tecsinapse/react-core';\nimport React from 'react';\nimport { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport { StyledInputElement } from '../styled';\n\nexport interface InputElementProps\n extends Omit<TextInputProps, 'onChange' | 'value' | 'ref'> {\n style?: StyleProp<TextStyle>;\n value?: string;\n placeholder?: string;\n disabled?: boolean;\n onChange?: (value: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n}\n\nconst InputElement = React.forwardRef<TextInput, InputElementProps>(\n (\n {\n onChange,\n placeholder,\n value,\n disabled = false,\n placeholderTextColor,\n ...rest\n },\n ref\n ): JSX.Element => {\n const theme = useTheme() as ThemeProp;\n const _placeholderColor = placeholderTextColor || theme.font.color.dark;\n\n return (\n <StyledInputElement\n {...rest}\n ref={ref}\n onChangeText={onChange}\n value={value}\n placeholder={placeholder}\n placeholderTextColor={_placeholderColor}\n disabled={disabled}\n editable={!disabled}\n />\n );\n }\n);\n\nInputElement.displayName = 'InputElement';\n\nexport default InputElement;\n"],"mappings":";;;;;AAAA;;AAEA;;AAEA;;;;;;AAaA,MAAMA,YAAY,GAAGC,eAAA,CAAMC,UAAN,CACnB,CACE;EACEC,QADF;EAEEC,WAFF;EAGEC,KAHF;EAIEC,QAAQ,GAAG,KAJb;EAKEC,oBALF;EAME,GAAGC;AANL,CADF,EASEC,GATF,KAUkB;EAChB,MAAMC,KAAK,GAAG,IAAAC,eAAA,GAAd;;EACA,MAAMC,iBAAiB,GAAGL,oBAAoB,IAAIG,KAAK,CAACG,IAAN,CAAWC,KAAX,CAAiBC,IAAnE;;EAEA,OACE,8BAAC,0BAAD,eACMP,IADN;IAEE,GAAG,EAAEC,GAFP;IAGE,YAAY,EAAEN,QAHhB;IAIE,KAAK,EAAEE,KAJT;IAKE,WAAW,EAAED,WALf;IAME,oBAAoB,EAAEQ,iBANxB;IAOE,QAAQ,EAAEN,QAPZ;IAQE,QAAQ,EAAE,CAACA;EARb,GADF;AAYD,CA3BkB,CAArB;;AA8BAN,YAAY,CAACgB,WAAb,GAA2B,cAA3B;eAEehB,Y"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { StyleProp, TextInputProps, TextStyle } from 'react-native';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';
|
|
3
3
|
import { MaskType } from '../hooks/useStringMask';
|
|
4
4
|
import { CurrencyOptions } from '../hooks/useNumberMask';
|
|
5
5
|
export interface InputMaskElementProps extends Omit<TextInputProps, 'onChange' | 'value' | 'ref'> {
|
|
@@ -11,7 +11,6 @@ export interface InputMaskElementProps extends Omit<TextInputProps, 'onChange' |
|
|
|
11
11
|
mask?: (MaskType[] | ((value: string) => MaskType[])) | CurrencyOptions;
|
|
12
12
|
onFocus?: () => void;
|
|
13
13
|
onBlur?: () => void;
|
|
14
|
-
ref?: React.Ref<any>;
|
|
15
14
|
}
|
|
16
|
-
declare const InputMaskElement:
|
|
15
|
+
declare const InputMaskElement: React.ForwardRefExoticComponent<InputMaskElementProps & React.RefAttributes<TextInput>>;
|
|
17
16
|
export default InputMaskElement;
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
|
-
function _extends() { _extends = Object.assign
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
21
|
|
|
22
22
|
const InputMaskElement = _react2.default.forwardRef(({
|
|
23
23
|
onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputMaskElement.js","names":["InputMaskElement","React","forwardRef","onChange","placeholder","value","disabled","placeholderTextColor","mask","rest","ref","theme","useTheme","_placeholderColor","font","color","dark","getInputHook","undefined","Array","isArray","useStringMask","useNumberMask","maskValue","setMaskValue","_value","toString","formatted","useEffect","raw","onChangeValue","useCallback","displayName"],"sources":["../../../../../src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx"],"sourcesContent":["import { useTheme } from '@emotion/react';\nimport { ThemeProp } from '@tecsinapse/react-core';\nimport React, { useCallback, useEffect } from 'react';\nimport { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport { StyledInputElement } from '../styled';\nimport { MaskType, useStringMask } from '../hooks/useStringMask';\nimport { CurrencyOptions, useNumberMask } from '../hooks/useNumberMask';\n\nexport interface InputMaskElementProps\n extends Omit<TextInputProps, 'onChange' | 'value' | 'ref'> {\n style?: StyleProp<TextStyle>;\n value?: string | number;\n placeholder?: string;\n disabled?: boolean;\n onChange?: (value: any) => void;\n /**\n To use mask for strings you have to pass a MaskType[] or ((value: string) => MaskType[])\n A MaskType can be a string, RegExp, or Array<RegExp>.\n In case we have a string, '9' represents digits, 'a' represents alphabet characters, and any other character represents fixed characters in the mask.\n For example a phone mask can be represented as ['(99) \\\\99999-9999'], or ['(99) ', '/[9]/', '9999-9999'], or ['(', /[0-9]/, /[0-9]/, ') ', '/[9]/', '9999-9999'] and many others.\n To use mask for numbers you have to pass a CurrencyOptions object\n A CurrencyOptions object contains symbol, separator, decimal, precision. For example {symbol: 'R$ ', separator: '.', decimal: ',', precision: 2,}.\n **/\n mask?: (MaskType[] | ((value: string) => MaskType[])) | CurrencyOptions;\n onFocus?: () => void;\n onBlur?: () => void;\n}\n\nconst InputMaskElement = React.forwardRef<TextInput, InputMaskElementProps>(\n (\n {\n onChange,\n placeholder,\n value,\n disabled = false,\n placeholderTextColor,\n mask,\n ...rest\n },\n ref\n ): JSX.Element => {\n const theme = useTheme() as ThemeProp;\n\n const _placeholderColor = placeholderTextColor || theme.font.color.dark;\n\n const getInputHook = (value: string | number) => {\n if (mask !== undefined) {\n if (Array.isArray(mask) || typeof mask === 'function') {\n return useStringMask(mask, value);\n } else {\n return useNumberMask(mask, value);\n }\n } else {\n return [undefined, undefined];\n }\n };\n\n const [maskValue, setMaskValue] = getInputHook(value ?? '');\n\n const _value =\n maskValue === undefined\n ? value?.toString()\n : maskValue.formatted\n ? maskValue.formatted\n : '';\n\n useEffect(() => {\n if (onChange) {\n onChange(maskValue?.raw);\n }\n }, [maskValue]);\n\n const onChangeValue = useCallback(\n (value: string | number) => {\n if (maskValue !== undefined && setMaskValue !== undefined) {\n setMaskValue(value);\n } else onChange && onChange(value);\n },\n [value]\n );\n\n useEffect(() => {\n /** Used to reinitialize maskValue when the value is updated in the parent component **/\n if (\n maskValue !== undefined &&\n setMaskValue !== undefined &&\n value !== undefined &&\n typeof maskValue === 'object'\n ) {\n /** Case there is a mask **/\n if (\n maskValue.raw !== undefined &&\n maskValue.raw.toString() !== value.toString()\n ) {\n onChangeValue(value);\n }\n } else if (maskValue === undefined && value !== undefined) {\n onChangeValue(value);\n }\n }, [value]);\n\n return (\n <StyledInputElement\n {...rest}\n ref={ref}\n onChangeText={onChangeValue}\n value={_value}\n placeholder={placeholder}\n placeholderTextColor={_placeholderColor}\n disabled={disabled}\n editable={!disabled}\n />\n );\n }\n);\n\nInputMaskElement.displayName = 'InputMaskElement';\n\nexport default InputMaskElement;\n"],"mappings":";;;;;AAAA;;AAEA;;AAEA;;AACA;;AACA;;;;;;;;AAsBA,MAAMA,gB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MACzDM,YAAY,CAACnB,KAAD,CAAZ;IACD,CAFD,MAEOF,QAAQ,IAAIA,QAAQ,CAACE,KAAD,CAApB;EACR,CALmB,EAMpB,CAACA,KAAD,CANoB,CAAtB;EASA,IAAAuB,iBAAA,EAAU,MAAM;IAEd,IACEL,SAAS,KAAKL,SAAd,IACAM,YAAY,KAAKN,SADjB,IAEAb,KAAK,KAAKa,SAFV,IAGA,OAAOK,SAAP,KAAqB,QAJvB,EAKE;MAEA,IACEA,SAAS,CAACM,GAAV,KAAkBX,SAAlB,IACAK,SAAS,CAACM,GAAV,CAAcH,QAAd,OAA6BrB,KAAK,CAACqB,QAAN,EAF/B,EAGE;QACAI,aAAa,CAACzB,KAAD,CAAb;MACD;IACF,CAbD,MAaO,IAAIkB,SAAS,KAAKL,SAAd,IAA2Bb,KAAK,KAAKa,SAAzC,EAAoD;MACzDY,aAAa,CAACzB,KAAD,CAAb;IACD;EACF,CAlBD,EAkBG,CAACA,KAAD,CAlBH;EAoBA,OACE,8BAAC,0BAAD,eACMI,IADN;IAEE,GAAG,EAAEC,GAFP;IAGE,YAAY,EAAEoB,aAHhB;IAIE,KAAK,EAAEL,MAJT;IAKE,WAAW,EAAErB,WALf;IAME,oBAAoB,EAAES,iBANxB;IAOE,QAAQ,EAAEP,QAPZ;IAQE,QAAQ,EAAE,CAACA;EARb,GADF;AAYD,CArFsB,CAAzB;;AAwFAN,gBAAgB,CAACgC,WAAjB,GAA+B,kBAA/B;eAEehC,gB"}
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
19
|
|
|
20
20
|
const PressableInputContainer = ({
|
|
21
21
|
onPress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"PressableInputContainer.js","names":["PressableInputContainer","onPress","disabled","style","children","rest"],"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"],"mappings":";;;;;AAAA;;AAEA;;AAGA;;;;;;;;;;AAcA,MAAMA,uBAA+D,GAAG,CAAC;EACvEC,OADuE;EAEvEC,QAFuE;EAGvEC,KAHuE;EAIvEC,QAJuE;EAKvE,GAAGC;AALoE,CAAD,KAMlE;EACJ,OACE,oBAAC,8BAAD;IAAwB,OAAO,EAAEJ,OAAjC;IAA0C,QAAQ,EAAEC,QAApD;IAA8D,KAAK,EAAEC;EAArE,GACE,oBAAC,uBAAD;IAAgB,QAAQ,EAAED;EAA1B,GAAwCG,IAAxC,GACGD,QADH,CADF,CADF;AAOD,CAdD;;eAgBeJ,uB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/atoms/Input/PressableInputContainer/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/atoms/Input/PressableInputContainer/index.ts"],"sourcesContent":["export {\n default as PressableInputContainer,\n PressableInputContainerProps,\n} from './PressableInputContainer';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["StyledPressableSurface","styled","Pressable"],"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"],"mappings":";;;;;AAAA;;;;AAEO,MAAMA,sBAAsB,GAAGC,eAAA,CAAOC,SAAU;AACvD;AACA,CAFO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useInputFocus.js","names":["useInputFocus","onFocus","onBlur","focusEnabled","focused","setFocused","useState","handleFocus","useCallback","handleBlur"],"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"],"mappings":";;;;;AAAA;;AAEO,MAAMA,aAAa,GAAG,CAC3BC,OAD2B,EAE3BC,MAF2B,EAG3BC,YAAY,GAAG,IAHY,KAIxB;EACH,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,IAAAC,eAAA,EAAkB,KAAlB,CAA9B;EAEA,MAAMC,WAAW,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACpC,IAAIL,YAAJ,EAAkB;MAChBE,UAAU,CAAC,IAAD,CAAV;MACAJ,OAAO,IAAIA,OAAO,EAAlB;IACD;EACF,CALmB,EAKjB,CAACE,YAAD,EAAeE,UAAf,EAA2BJ,OAA3B,CALiB,CAApB;EAOA,MAAMQ,UAAU,GAAG,IAAAD,kBAAA,EAAY,MAAM;IACnC,IAAIL,YAAJ,EAAkB;MAChBE,UAAU,CAAC,KAAD,CAAV;MACAH,MAAM,IAAIA,MAAM,EAAhB;IACD;EACF,CALkB,EAKhB,CAACC,YAAD,EAAeE,UAAf,EAA2BH,MAA3B,CALgB,CAAnB;EAOA,OAAO;IACLE,OADK;IAELK,UAFK;IAGLF;EAHK,CAAP;AAKD,CA1BM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useNumberMask.js","names":["DEFAULT_OPTIONS","symbol","separator","decimal","precision","getRegex","RegExp","getInternalNumberAndMask","value","options","mergedOptions","internalNumber","stringValue","String","decimalIndex","indexOf","currentPrecision","length","zeros","i","Number","onlyNumbers","extractNumbersFromString","padZeros","padStart","replace","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","useNumberMask","defaultValue","applyMask","useCallback","raw","formatted","currency","format","setValue","useState","handleChangeValue","formattedValue"],"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"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAKA,MAAMA,eAAgC,GAAG;EACvCC,MAAM,EAAE,KAD+B;EAEvCC,SAAS,EAAE,GAF4B;EAGvCC,OAAO,EAAE,GAH8B;EAIvCC,SAAS,EAAE;AAJ4B,CAAzC;;AAOA,MAAMC,QAAQ,GAAID,SAAD,IACf,IAAIE,MAAJ,CAAY,cAAaF,SAAU,YAAnC,EAAgD,GAAhD,CADF;;AAGO,MAAMG,wBAAwB,GAAG,CACtCC,KADsC,EAEtCC,OAFsC,KAGyB;EAC/D,MAAMC,aAAa,GAAG,EAAE,GAAGV,eAAL;IAAsB,GAAGS;EAAzB,CAAtB;EACA,MAAM;IAAEL,SAAS,GAAG,CAAC;EAAf,IAAqBM,aAA3B;EAEA,IAAIC,cAAJ;;EAEA,IAAI,OAAOH,KAAP,KAAiB,QAArB,EAA+B;IAC7B,IAAIJ,SAAJ,EAAe;MACb,IAAIQ,WAAW,GAAGC,MAAM,CAACL,KAAD,CAAxB;MACA,MAAMM,YAAY,GAAGF,WAAW,CAACG,OAAZ,CAAoB,GAApB,CAArB;MACA,MAAMC,gBAAgB,GAAGF,YAAY,GAAGV,SAAxC;;MACA,IAAIU,YAAY,KAAK,CAAC,CAAlB,IAAuBE,gBAAgB,IAAIJ,WAAW,CAACK,MAA3D,EAAmE;QACjE,MAAMC,KAAK,GAAGN,WAAW,CAACK,MAAZ,GAAqB,CAArB,GAAyBD,gBAAvC;;QACA,KAAK,IAAIG,CAAC,GAAG,CAA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ACG,KAAD,EAAQ4B,QAAR,IAAoB,IAAAC,eAAA,EAAoBP,SAAS,CAACD,YAAD,CAA7B,CAA1B;EAEA,MAAMS,iBAAiB,GAAG,IAAAP,kBAAA,EACvBQ,cAAD,IAAqC;IACnC,MAAM;MAAEP,GAAF;MAAOC;IAAP,IAAqBH,SAAS,CAACS,cAAD,CAApC;IACAH,QAAQ,CAAC;MACPJ,GADO;MAEPC;IAFO,CAAD,CAAR;EAID,CAPuB,EAQxB,CAACH,SAAD,EAAYM,QAAZ,CARwB,CAA1B;EAWA,OAAO,CAAC5B,KAAD,EAAQ8B,iBAAR,CAAP;AACD,CAjCM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useStringMask.js","names":["mergeMask","value","mask","formatted","raw","iMask","iChars","length","maskChar","valueChar","rawValueChar","maskCharRegex","Array","isArray","matchRegex","RegExp","test","getMask","newValue","maskArray","regexArray","forEach","exp","push","i","useStringMask","defaultValue","applyMask","useCallback","selectedMask","setValue","useState","toString","handleChangeValue","formattedValue"],"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 formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"mappings":";;;;;AAAA;;AAeO,MAAMA,SAAS,GAAG,CAACC,KAAK,GAAG,EAAT,EAAaC,IAAb,KAA6C;EACpE,IAAIC,SAAS,GAAG,EAAhB;EACA,IAAIC,GAAG,GAAG,EAAV;EACA,IAAIC,KAAK,GAAG,CAAZ;EACA,IAAIC,MAAM,GAAG,CAAb;;EAEA,OAAO,EAAED,KAAK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A,EACvBM,cAAD,IAAqC;IACnC,MAAM;MAAE9B,GAAF;MAAOD;IAAP,IAAqBwB,SAAS,CAACO,cAAD,oBAACA,cAAc,CAAEF,QAAhB,EAAD,CAApC;IACAF,QAAQ,CAAC;MACP1B,GADO;MAEPD;IAFO,CAAD,CAAR;EAID,CAPuB,EAQxB,CAACwB,SAAD,EAAYG,QAAZ,CARwB,CAA1B;EAWA,OAAO,CAAC7B,KAAD,EAAQgC,iBAAR,CAAP;AACD,CAjCM"}
|
|
@@ -15,7 +15,7 @@ var _exportNames = {
|
|
|
15
15
|
StyledBorderKeeper: true,
|
|
16
16
|
disabledInputStyles: true
|
|
17
17
|
};
|
|
18
|
-
exports.disabledInputStyles = exports.StyledBorderKeeper = exports.PressableInputContainerProps = exports.PressableInputContainer = exports.
|
|
18
|
+
exports.disabledInputStyles = exports.StyledBorderKeeper = exports.PressableInputContainerProps = exports.PressableInputContainer = exports.InputVariantType = exports.InputMaskElementProps = exports.InputMaskElement = exports.InputElementProps = exports.InputElement = exports.InputContainerProps = exports.InputContainer = exports.Hint = void 0;
|
|
19
19
|
|
|
20
20
|
var _Hint = _interopRequireDefault(require("./Hint"));
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Input/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Input/index.ts"],"sourcesContent":["export { default as Hint } from './Hint';\nexport * from './hooks/useInputFocus';\nexport * from './hooks/useNumberMask';\nexport * from './hooks/useStringMask';\nexport {\n default as InputContainer,\n InputContainerProps,\n InputVariantType,\n} from './InputContainer/InputContainer';\nexport {\n default as InputElement,\n InputElementProps,\n} from './InputElement/InputElement';\nexport {\n default as InputMaskElement,\n InputMaskElementProps,\n} from './InputMaskElement/InputMaskElement';\nexport {\n PressableInputContainer,\n PressableInputContainerProps,\n} from './PressableInputContainer';\nexport { StyledBorderKeeper, disabledInputStyles } from './styled';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;AAAA;;AACA;;;;;;AAKA;;;;;AAIA;;;;;AAIA;;;;;AAIA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.disabledInputStyles = exports.StyledLabelContainer = exports.StyledInputElementBase = exports.StyledInputElement = exports.StyledInputContainer = exports.StyledIconContent = exports.StyledHintIcon = exports.StyledHintContainer = exports.StyledBorderKeeper = void 0;
|
|
5
5
|
|
|
6
6
|
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["leftIconStyles","leftComponent","theme","css","spacing","centi","rightIconStyles","rightComponent","disabledContainerStyles","disabled","disabledInputStyles","color","secondary","light","focusedStyles","focused","borderColor","borderWidth","nano","dark","StyledIconContent","styled","View","zIndex","default","StyledInputContainer","RFValueStr","StyledInputElementBase","TextInput","font","stack","typography","base","fontSize","weight","bold","StyledLabelContainer","props","micro","StyledBorderKeeperBase","miscellaneous","surfaceColor","borderColorGradation","borderRadius","mili","pico","StyledBorderKeeper","StyledInputElement","StyledHintContainer","StyledHintIcon","Icon"],"sources":["../../../../src/components/atoms/Input/styled.ts"],"sourcesContent":["import styled, { css } from '@emotion/native';\nimport { TextInput } from 'react-native';\nimport { InputElementProps } from '.';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils/ResponsiveFontSize';\nimport { Icon } from '../Icon';\nimport { InputContainerProps } from './InputContainer/InputContainer';\n\nconst leftIconStyles = ({\n leftComponent,\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n !leftComponent &&\n css`\n padding-left: ${theme.spacing.centi};\n `;\n\nconst rightIconStyles = ({\n rightComponent,\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n !rightComponent &&\n css`\n padding-right: ${theme.spacing.centi};\n `;\n\nconst disabledContainerStyles = ({\n disabled,\n}: Partial<InputContainerProps> & StyleProps) =>\n disabled &&\n css`\n background-color: transparent;\n `;\n\nexport const disabledInputStyles = ({\n disabled,\n theme,\n}: Partial<InputContainerProps> & Partial<StyleProps>) =>\n disabled &&\n css`\n color: ${theme?.color.secondary.light};\n `;\n\nconst focusedStyles = ({\n focused,\n borderColor = 'secondary',\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n focused &&\n css`\n border-width: ${theme.borderWidth.nano};\n border-color: ${theme.color[borderColor].dark};\n `;\n\nexport const StyledIconContent = styled.View<Partial<StyleProps>>`\n z-index: ${({ theme }) => theme.zIndex.default};\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledInputContainer = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>`\n flex-direction: row;\n align-items: center;\n min-height: ${RFValueStr('44px')};\n`;\n\nexport const StyledInputElementBase = styled(TextInput)<\n InputElementProps & Partial<StyleProps>\n>`\n font-family: ${({ theme }) => `'${theme.font.stack.default}'`};\n font-size: ${({ theme }) => theme.typography.base.fontSize};\n font-weight: ${({ theme }) => theme.font.weight.bold};\n color: ${({ theme }) => theme.font.color.dark};\n`;\n\nexport const StyledLabelContainer = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>(\n props => css`\n flex: 1;\n padding: ${props.theme.spacing.micro} 0;\n ${leftIconStyles(props)}\n ${rightIconStyles(props)}\n `\n);\n\nconst StyledBorderKeeperBase = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>`\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n border-color: ${({\n theme,\n borderColor = 'secondary',\n borderColorGradation = 'light',\n }) => theme.color[borderColor][borderColorGradation]};\n border-radius: ${({ theme }) => theme.borderRadius.mili};\n border-width: ${({ theme }) => theme.borderWidth.pico};\n position: absolute;\n width: 100%;\n height: 100%;\n`;\n\nexport const StyledBorderKeeper = styled(StyledBorderKeeperBase)<\n Partial<StyleProps>\n>(\n props => css`\n ${focusedStyles(props)}\n ${disabledContainerStyles(props)}\n `\n);\n\nexport const StyledInputElement = styled(StyledInputElementBase)<\n InputElementProps & Partial<StyleProps>\n>(\n props => css`\n ${disabledInputStyles(props)}\n `\n);\n\nexport const StyledHintContainer = styled.View<Partial<StyleProps>>`\n margin-top: ${({ theme }) => theme.spacing.micro};\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledHintIcon = styled(Icon)<Partial<StyleProps>>`\n margin-right: ${({ theme }) => theme.spacing.micro};\n`;\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;AACA;;;;;;AAGA,MAAMA,cAAc,GAAG,CAAC;EACtBC,aADsB;EAEtBC;AAFsB,CAAD,KAIrB,CAACD,aAAD,IACA,IAAAE,WAAA,CAAI;AACN,oBAAoBD,KAAK,CAACE,OAAN,CAAcC,KAAM;AACxC,GAPA;;AASA,MAAMC,eAAe,GAAG,CAAC;EACvBC,cADuB;EAEvBL;AAFuB,CAAD,KAItB,CAACK,cAAD,IACA,IAAAJ,WAAA,CAAI;AACN,qBAAqBD,KAAK,CAACE,OAAN,CAAcC,KAAM;AACzC,GAPA;;AASA,MAAMG,uBAAuB,GAAG,CAAC;EAC/BC;AAD+B,CAAD,KAG9BA,QAAQ,IACR,IAAAN,WAAA,CAAI;AACN;AACA,GANA;;AAQO,MAAMO,mBAAmB,GAAG,CAAC;EAClCD,QADkC;EAElCP;AAFkC,CAAD,KAIjCO,QAAQ,IACR,IAAAN,WAAA,CAAI;AACN,aAAaD,KADR,oBACQA,KAAK,CAAES,KAAP,CAAaC,SAAb,CAAuBC,KAAM;AAC1C,GAPO;;;;AASP,MAAMC,aAAa,GAAG,CAAC;EACrBC,OADqB;EAErBC,WAAW,GAAG,WAFO;EAGrBd;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pC;AACF,sBAAsB,CAAC;EAAEpB;AAAF,CAAD,KAAeA,KAAK,CAACsC,aAAN,CAAoBC,YAAa;AACtE,kBAAkB,CAAC;EACfvC,KADe;EAEfc,WAAW,GAAG,WAFC;EAGf0B,oBAAoB,GAAG;AAHR,CAAD,KAIVxC,KAAK,CAACS,KAAN,CAAYK,WAAZ,EAAyB0B,oBAAzB,CAA+C;AACvD,mBAAmB,CAAC;EAAExC;AAAF,CAAD,KAAeA,KAAK,CAACyC,YAAN,CAAmBC,IAAK;AAC1D,kBAAkB,CAAC;EAAE1C;AAAF,CAAD,KAAeA,KAAK,CAACe,WAAN,CAAkB4B,IAAK;AACxD;AACA;AACA;AACA,CAdA;AAgBO,MAAMC,kBAAkB,GAAG,IAAAzB,eAAA,EAAOkB,sBAAP,EAGhCF,KAAK,IAAI,IAAAlC,WAAA,CAAI;AACf,MAAMW,aAAa,CAACuB,KAAD,CAAQ;AAC3B,MAAM7B,uBAAuB,CAAC6B,KAAD,CAAQ;AACrC,GANkC,CAA3B;;AASA,MAAMU,kBAAkB,GAAG,IAAA1B,eAAA,EAAOM,sBAAP,EAGhCU,KAAK,IAAI,IAAAlC,WAAA,CAAI;AACf,MAAMO,mBAAmB,CAAC2B,KAAD,CAAQ;AACjC,GALkC,CAA3B;;AAQA,MAAMW,mBAAmB,GAAG3B,eAAA,CAAOC,IAA0B;AACpE,gBAAgB,CAAC;EAAEpB;AAAF,CAAD,KAAeA,KAAK,CAACE,OAAN,CAAckC,KAAM;AACnD;AACA;AACA,CAJO;;AAMA,MAAMW,cAAc,GAAG,IAAA5B,eAAA,EAAO6B,UAAP,CAAkC;AAChE,kBAAkB,CAAC;EAAEhD;AAAF,CAAD,KAAeA,KAAK,CAACE,OAAN,CAAckC,KAAM;AACrD,CAFO"}
|
|
@@ -9,7 +9,7 @@ var _styled = require("./styled");
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
function _extends() { _extends = Object.assign
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
13
|
|
|
14
14
|
const Paper = ({
|
|
15
15
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Paper.js","names":["Paper","children","elevated","rest"],"sources":["../../../../src/components/atoms/Paper/Paper.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { StyledPaper } from './styled';\n\nexport interface PaperProps {\n /** Creates elevation shadow */\n elevated?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Paper: FC<PaperProps> = ({\n children,\n elevated = false,\n ...rest\n}): JSX.Element => (\n <StyledPaper {...rest} elevated={elevated}>\n {children}\n </StyledPaper>\n);\n\nexport default Paper;\n"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAQA,MAAMA,KAAqB,GAAG,CAAC;EAC7BC,QAD6B;EAE7BC,QAAQ,GAAG,KAFkB;EAG7B,GAAGC;AAH0B,CAAD,KAK5B,6BAAC,mBAAD,eAAiBA,IAAjB;EAAuB,QAAQ,EAAED;AAAjC,IACGD,QADH,CALF;;eAUeD,K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Paper/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Paper/index.ts"],"sourcesContent":["export { default as Paper, PaperProps } from './Paper';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["StyledPaper","styled","Animated","View","props","css","baseStyles","elevatedStyles"],"sources":["../../../../src/components/atoms/Paper/styled.ts"],"sourcesContent":["import { Animated } from 'react-native';\nimport styled, { css } from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { PaperProps } from './Paper';\nimport { baseStyles, elevatedStyles } from '../shared/PaperAndCard';\n\nexport const StyledPaper = styled(Animated.View)<\n PaperProps & Partial<StyleProps>\n>(\n props => css`\n ${baseStyles(props)}\n ${elevatedStyles(props)}\n `\n);\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;;;AAEO,MAAMA,WAAW,GAAG,IAAAC,eAAA,EAAOC,qBAAA,CAASC,IAAhB,EAGzBC,KAAK,IAAI,IAAAC,WAAA,CAAI;AACf,MAAM,IAAAC,wBAAA,EAAWF,KAAX,CAAkB;AACxB,MAAM,IAAAG,4BAAA,EAAeH,KAAf,CAAsB;AAC5B,GAN2B,CAApB"}
|
|
@@ -13,7 +13,7 @@ var _utils = require("../../../utils");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
18
|
const COLOR_VARIATION_FACTOR = 25;
|
|
19
19
|
|