@tecsinapse/react-core 1.18.0 → 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 +11 -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.js +1 -1
- package/dist/components/molecules/Grid/functions.js.map +1 -1
- package/dist/components/molecules/Grid/index.d.ts +1 -1
- package/dist/components/molecules/Grid/index.js +3 -5
- 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.js +1 -1
- package/dist/components/molecules/IconTextButton/IconComponent.js.map +1 -1
- package/dist/components/molecules/IconTextButton/IconTextButton.d.ts +1 -3
- package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
- package/dist/components/molecules/IconTextButton/index.js.map +1 -1
- package/dist/components/molecules/IconTextButton/styled.js.map +1 -1
- 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.js.map +1 -1
- package/dist/components/molecules/LabeledSwitch/index.js +1 -1
- package/dist/components/molecules/LabeledSwitch/index.js.map +1 -1
- 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.map +1 -1
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/styles/ThemeProvider.js.map +1 -1
- package/dist/styles/definitions.js +1 -1
- package/dist/styles/definitions.js.map +1 -1
- package/dist/styles/light.js.map +1 -1
- 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.js.map +1 -1
- package/dist/utils/lightenDarkenColor.js.map +1 -1
- package/dist/utils/masks.js.map +1 -1
- package/dist/utils/variantComplement.js +1 -1
- package/dist/utils/variantComplement.js.map +1 -1
- package/package.json +2 -2
- 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 +1 -1
- 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/index.ts +1 -1
- package/src/components/molecules/HintInputContainer/HintInputContainer.tsx +6 -1
- package/src/components/molecules/IconTextButton/IconTextButton.tsx +1 -3
- 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/index.ts +12 -1
- package/src/utils/IPhoneXHelper.ts +27 -22
- package/src/utils/ResponsiveFontSize.ts +55 -36
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.fontColorVC = exports.colorVC = exports.colorGradationVC = exports.borderColorVC = exports.borderColorGradationVC = void 0;
|
|
5
5
|
const fontColorVC = {
|
|
6
6
|
filled: 'light',
|
|
7
7
|
outlined: 'orange',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"variantComplement.js","names":["fontColorVC","filled","outlined","text","colorVC","colorGradationVC","borderColorVC","borderColorGradationVC"],"sources":["../../src/utils/variantComplement.ts"],"sourcesContent":["import {\n ColorGradationType,\n ColorType,\n FontColorType,\n VariantType,\n} from '../types/defaults';\n\nexport const fontColorVC: Record<VariantType, FontColorType> = {\n filled: 'light',\n outlined: 'orange',\n text: 'orange',\n};\n\nexport const colorVC: Record<VariantType, ColorType> = {\n filled: 'primary',\n outlined: 'primary',\n text: 'primary',\n};\n\nexport const colorGradationVC: Record<VariantType, ColorGradationType> = {\n filled: 'dark',\n outlined: 'dark',\n text: 'dark',\n};\n\nexport const borderColorVC: Record<VariantType, ColorType> = {\n filled: 'primary',\n outlined: 'primary',\n text: 'primary',\n};\n\nexport const borderColorGradationVC: Record<VariantType, ColorGradationType> = {\n filled: 'dark',\n outlined: 'dark',\n text: 'dark',\n};\n"],"mappings":";;;;AAOO,MAAMA,WAA+C,GAAG;EAC7DC,MAAM,EAAE,OADqD;EAE7DC,QAAQ,EAAE,QAFmD;EAG7DC,IAAI,EAAE;AAHuD,CAAxD;;AAMA,MAAMC,OAAuC,GAAG;EACrDH,MAAM,EAAE,SAD6C;EAErDC,QAAQ,EAAE,SAF2C;EAGrDC,IAAI,EAAE;AAH+C,CAAhD;;AAMA,MAAME,gBAAyD,GAAG;EACvEJ,MAAM,EAAE,MAD+D;EAEvEC,QAAQ,EAAE,MAF6D;EAGvEC,IAAI,EAAE;AAHiE,CAAlE;;AAMA,MAAMG,aAA6C,GAAG;EAC3DL,MAAM,EAAE,SADmD;EAE3DC,QAAQ,EAAE,SAFiD;EAG3DC,IAAI,EAAE;AAHqD,CAAtD;;AAMA,MAAMI,sBAA+D,GAAG;EAC7EN,MAAM,EAAE,MADqE;EAE7EC,QAAQ,EAAE,MAFmE;EAG7EC,IAAI,EAAE;AAHuE,CAAxE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-core",
|
|
3
3
|
"description": "TecSinapse hybrid React components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.19.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"react-native": "^0.64.0",
|
|
35
35
|
"react-native-vector-icons": "^8.1.0 || ^9.0.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "59f85f1085ace4af0b26b85e32faf92cd2bf303f"
|
|
38
38
|
}
|
|
@@ -23,9 +23,8 @@ const baseStyle = ({
|
|
|
23
23
|
`;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export const BadgeStyle =
|
|
27
|
-
baseStyle
|
|
28
|
-
);
|
|
26
|
+
export const BadgeStyle =
|
|
27
|
+
styled(View)<Partial<StyleProps & BadgeProps>>(baseStyle);
|
|
29
28
|
|
|
30
29
|
export const ViewStyled = styled(View)<Partial<StyleProps & BadgeProps>>`
|
|
31
30
|
align-items: center;
|
|
@@ -44,16 +44,13 @@ export interface GroupButtonProps<T> {
|
|
|
44
44
|
disableAllOptions?: boolean;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const GroupButton = <T
|
|
48
|
-
style,
|
|
49
|
-
...rest
|
|
50
|
-
}: GroupButtonProps<T>) => {
|
|
47
|
+
const GroupButton = <T,>({ style, ...rest }: GroupButtonProps<T>) => {
|
|
51
48
|
return (
|
|
52
49
|
<StyledGroupButton style={style}>{groupOptions(rest)}</StyledGroupButton>
|
|
53
50
|
);
|
|
54
51
|
};
|
|
55
52
|
|
|
56
|
-
const groupOptions = <T
|
|
53
|
+
const groupOptions = <T,>({
|
|
57
54
|
options,
|
|
58
55
|
renderOption,
|
|
59
56
|
renderKey,
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
FontColorType,
|
|
8
8
|
FontStackType,
|
|
9
9
|
FontWeightType,
|
|
10
|
-
TypographyVariationType
|
|
11
|
-
} from '
|
|
10
|
+
TypographyVariationType,
|
|
11
|
+
} from '@tecsinapse/react-core';
|
|
12
12
|
import { Text, TextProps } from '../../Text';
|
|
13
13
|
import {
|
|
14
14
|
StyledBorderKeeper,
|
|
15
15
|
StyledIconContent,
|
|
16
16
|
StyledInputContainer,
|
|
17
|
-
StyledLabelContainer
|
|
17
|
+
StyledLabelContainer,
|
|
18
18
|
} from '../styled';
|
|
19
19
|
|
|
20
20
|
export type InputVariantType = 'default' | 'error' | 'success';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTheme } from '@emotion/react';
|
|
2
2
|
import { ThemeProp } from '@tecsinapse/react-core';
|
|
3
|
-
import React
|
|
4
|
-
import { StyleProp, TextInputProps, TextStyle } from 'react-native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';
|
|
5
5
|
import { StyledInputElement } from '../styled';
|
|
6
6
|
|
|
7
7
|
export interface InputElementProps
|
|
@@ -13,10 +13,9 @@ export interface InputElementProps
|
|
|
13
13
|
onChange?: (value: string) => void;
|
|
14
14
|
onFocus?: () => void;
|
|
15
15
|
onBlur?: () => void;
|
|
16
|
-
ref?: React.Ref<any>;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
const InputElement
|
|
18
|
+
const InputElement = React.forwardRef<TextInput, InputElementProps>(
|
|
20
19
|
(
|
|
21
20
|
{
|
|
22
21
|
onChange,
|
|
@@ -26,7 +25,7 @@ const InputElement: FC<InputElementProps> = React.forwardRef(
|
|
|
26
25
|
placeholderTextColor,
|
|
27
26
|
...rest
|
|
28
27
|
},
|
|
29
|
-
ref
|
|
28
|
+
ref
|
|
30
29
|
): JSX.Element => {
|
|
31
30
|
const theme = useTheme() as ThemeProp;
|
|
32
31
|
const _placeholderColor = placeholderTextColor || theme.font.color.dark;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTheme } from '@emotion/react';
|
|
2
2
|
import { ThemeProp } from '@tecsinapse/react-core';
|
|
3
|
-
import React, {
|
|
4
|
-
import { StyleProp, TextInputProps, TextStyle } from 'react-native';
|
|
3
|
+
import React, { useCallback, useEffect } from 'react';
|
|
4
|
+
import { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';
|
|
5
5
|
import { StyledInputElement } from '../styled';
|
|
6
6
|
import { MaskType, useStringMask } from '../hooks/useStringMask';
|
|
7
7
|
import { CurrencyOptions, useNumberMask } from '../hooks/useNumberMask';
|
|
@@ -24,10 +24,9 @@ export interface InputMaskElementProps
|
|
|
24
24
|
mask?: (MaskType[] | ((value: string) => MaskType[])) | CurrencyOptions;
|
|
25
25
|
onFocus?: () => void;
|
|
26
26
|
onBlur?: () => void;
|
|
27
|
-
ref?: React.Ref<any>;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
const InputMaskElement
|
|
29
|
+
const InputMaskElement = React.forwardRef<TextInput, InputMaskElementProps>(
|
|
31
30
|
(
|
|
32
31
|
{
|
|
33
32
|
onChange,
|
|
@@ -38,7 +37,7 @@ const InputMaskElement: FC<InputMaskElementProps> = React.forwardRef(
|
|
|
38
37
|
mask,
|
|
39
38
|
...rest
|
|
40
39
|
},
|
|
41
|
-
ref
|
|
40
|
+
ref
|
|
42
41
|
): JSX.Element => {
|
|
43
42
|
const theme = useTheme() as ThemeProp;
|
|
44
43
|
|
|
@@ -4,8 +4,8 @@ import { Animated, ViewProps } from 'react-native';
|
|
|
4
4
|
import {
|
|
5
5
|
ColorGradationType,
|
|
6
6
|
ColorType,
|
|
7
|
-
ThemeProp
|
|
8
|
-
} from '
|
|
7
|
+
ThemeProp,
|
|
8
|
+
} from '@tecsinapse/react-core';
|
|
9
9
|
import { extractNumbersFromString } from '../../../utils';
|
|
10
10
|
import { Container, Progress, Segment } from './styled';
|
|
11
11
|
|
|
@@ -54,8 +54,6 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
|
|
54
54
|
const items = [...Array(segments).keys()];
|
|
55
55
|
|
|
56
56
|
const segmentsRender = items.map(index => {
|
|
57
|
-
|
|
58
|
-
|
|
59
57
|
const max = segmentWidth * (index + 1);
|
|
60
58
|
const min = segmentWidth * index;
|
|
61
59
|
const minmax = (totalProgress - min) / (max - min);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Animated, Easing } from 'react-native';
|
|
2
2
|
|
|
3
|
-
const ANIMATION_SPEED = 140
|
|
3
|
+
const ANIMATION_SPEED = 140;
|
|
4
4
|
|
|
5
5
|
export const transitionSwitch = (
|
|
6
6
|
active: boolean,
|
|
@@ -8,9 +8,8 @@ export const transitionSwitch = (
|
|
|
8
8
|
transitionValue: Animated.Value,
|
|
9
9
|
animatedColor: Animated.Value
|
|
10
10
|
): void => {
|
|
11
|
+
if (translate <= 0) return;
|
|
11
12
|
|
|
12
|
-
if (translate <= 0) return
|
|
13
|
-
|
|
14
13
|
if (active) {
|
|
15
14
|
Animated.timing(transitionValue, {
|
|
16
15
|
toValue: translate,
|
|
@@ -23,8 +22,8 @@ export const transitionSwitch = (
|
|
|
23
22
|
duration: ANIMATION_SPEED,
|
|
24
23
|
useNativeDriver: false,
|
|
25
24
|
}).start();
|
|
26
|
-
return
|
|
27
|
-
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
28
27
|
|
|
29
28
|
Animated.timing(transitionValue, {
|
|
30
29
|
toValue: 0,
|
|
@@ -37,5 +36,4 @@ export const transitionSwitch = (
|
|
|
37
36
|
duration: ANIMATION_SPEED,
|
|
38
37
|
useNativeDriver: false,
|
|
39
38
|
}).start();
|
|
40
|
-
|
|
41
39
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
|
-
import { StyleProps } from '
|
|
3
|
+
import { StyleProps } from '@tecsinapse/react-core';
|
|
4
4
|
import { RFValueStr } from '../../../utils';
|
|
5
5
|
|
|
6
|
-
export const SWITCH_BODY_WIDTH = '40px'
|
|
7
|
-
export const SWITCH_PIN_WIDTH = '16px'
|
|
6
|
+
export const SWITCH_BODY_WIDTH = '40px';
|
|
7
|
+
export const SWITCH_PIN_WIDTH = '16px';
|
|
8
8
|
|
|
9
|
-
export const StyledSwitchContent = styled(Animated.View)<
|
|
10
|
-
Partial<StyleProps>
|
|
11
|
-
>`
|
|
9
|
+
export const StyledSwitchContent = styled(Animated.View)<Partial<StyleProps>>`
|
|
12
10
|
border-radius: ${({ theme }) => theme.borderRadius.pill};
|
|
13
11
|
padding: 0 ${({ theme }) => theme.spacing.micro};
|
|
14
12
|
justify-content: center;
|
|
@@ -43,7 +43,7 @@ const Tag: React.FC<TagProps> = ({
|
|
|
43
43
|
<StyledTagContainer
|
|
44
44
|
{...rest}
|
|
45
45
|
variant={variant}
|
|
46
|
-
style={[{ opacity:
|
|
46
|
+
style={[{ opacity: fadeAnim as unknown as number }, style]}
|
|
47
47
|
visible={!dismiss}
|
|
48
48
|
>
|
|
49
49
|
{icon && (
|
|
@@ -7,21 +7,26 @@ import { CalendarProps, DateRange, SelectionType } from '../Calendar';
|
|
|
7
7
|
import { HintInputContainer } from '../HintInputContainer';
|
|
8
8
|
import { CalendarIcon, getStyledTextComponent } from './styled';
|
|
9
9
|
|
|
10
|
-
export interface DatePickerProps<T extends SelectionType>
|
|
10
|
+
export interface DatePickerProps<T extends SelectionType>
|
|
11
|
+
extends InputContainerProps,
|
|
12
|
+
Omit<CalendarProps<T>, 'style'> {
|
|
11
13
|
controlComponent?: (
|
|
12
14
|
onPress: () => void,
|
|
13
15
|
displayValue?: string
|
|
14
16
|
) => JSX.Element;
|
|
15
17
|
TextComponent?: React.FC<TextProps>;
|
|
16
|
-
CalendarComponent: React.FC<CalendarProps<T
|
|
18
|
+
CalendarComponent: React.FC<CalendarProps<T>>;
|
|
17
19
|
placeholder?: string;
|
|
18
20
|
onFocus?: () => void | never;
|
|
19
21
|
onBlur?: () => void | never;
|
|
20
22
|
format?: string;
|
|
21
23
|
closeOnPick?: boolean;
|
|
22
|
-
renderCalendar: (
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
renderCalendar: (
|
|
25
|
+
calendar: React.ReactElement,
|
|
26
|
+
blur?: () => void
|
|
27
|
+
) => JSX.Element | null;
|
|
28
|
+
requestShowCalendar: () => void;
|
|
29
|
+
requestCloseCalendar: () => void;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
function DatePicker<T extends SelectionType>({
|
|
@@ -51,7 +56,6 @@ function DatePicker<T extends SelectionType>({
|
|
|
51
56
|
requestCloseCalendar,
|
|
52
57
|
...rest
|
|
53
58
|
}: DatePickerProps<T>): JSX.Element {
|
|
54
|
-
|
|
55
59
|
const { focused, handleBlur, handleFocus } = useInputFocus(
|
|
56
60
|
onFocus,
|
|
57
61
|
onBlur,
|
|
@@ -59,7 +63,7 @@ function DatePicker<T extends SelectionType>({
|
|
|
59
63
|
);
|
|
60
64
|
|
|
61
65
|
const handleShowCalendar = React.useCallback(() => {
|
|
62
|
-
requestShowCalendar()
|
|
66
|
+
requestShowCalendar();
|
|
63
67
|
handleFocus();
|
|
64
68
|
}, [handleFocus, requestShowCalendar]);
|
|
65
69
|
|
|
@@ -99,7 +103,7 @@ function DatePicker<T extends SelectionType>({
|
|
|
99
103
|
onChange={onChange}
|
|
100
104
|
locale={locale}
|
|
101
105
|
/>
|
|
102
|
-
)
|
|
106
|
+
);
|
|
103
107
|
|
|
104
108
|
return (
|
|
105
109
|
<>
|
|
@@ -7,7 +7,9 @@ import { DateTimeSelector, DateTimeSelectorProps } from '../DateTimeSelector';
|
|
|
7
7
|
import { HintInputContainer } from '../HintInputContainer';
|
|
8
8
|
import { getStyledDateTimeSelector } from './styled';
|
|
9
9
|
|
|
10
|
-
export interface DateTimePickerProps
|
|
10
|
+
export interface DateTimePickerProps
|
|
11
|
+
extends InputContainerProps,
|
|
12
|
+
Omit<DateTimeSelectorProps, 'style'> {
|
|
11
13
|
controlComponent?: (
|
|
12
14
|
onPress: () => void,
|
|
13
15
|
displayValue?: string
|
|
@@ -17,9 +19,12 @@ export interface DateTimePickerProps extends InputContainerProps, Omit<DateTimeS
|
|
|
17
19
|
placeholder?: string;
|
|
18
20
|
onFocus?: () => void | never;
|
|
19
21
|
onBlur?: () => void | never;
|
|
20
|
-
renderSelector: (
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
renderSelector: (
|
|
23
|
+
selector: React.ReactElement,
|
|
24
|
+
blur?: () => void
|
|
25
|
+
) => JSX.Element | null;
|
|
26
|
+
requestShowSelector: () => void;
|
|
27
|
+
requestCloseSelector: () => void;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
const DateTimePicker: React.FC<DateTimePickerProps> = ({
|
|
@@ -59,7 +64,6 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
|
|
|
59
64
|
requestCloseSelector,
|
|
60
65
|
...rest
|
|
61
66
|
}) => {
|
|
62
|
-
|
|
63
67
|
const { focused, handleBlur, handleFocus } = useInputFocus(
|
|
64
68
|
onFocus,
|
|
65
69
|
onBlur,
|
|
@@ -67,18 +71,22 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
|
|
|
67
71
|
);
|
|
68
72
|
|
|
69
73
|
const handleShowSelector = () => {
|
|
70
|
-
requestShowSelector()
|
|
74
|
+
requestShowSelector();
|
|
71
75
|
handleFocus();
|
|
72
76
|
};
|
|
73
77
|
|
|
74
78
|
const handleChoosing = (value: Date) => {
|
|
75
|
-
onChange?.(value)
|
|
76
|
-
requestCloseSelector()
|
|
79
|
+
onChange?.(value);
|
|
80
|
+
requestCloseSelector();
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
const StyledText = getStyledTextComponent(TextComponent);
|
|
80
|
-
const displayValue =
|
|
81
|
-
|
|
84
|
+
const displayValue =
|
|
85
|
+
(value ? formatDate(value, format, { locale: locale }) : placeholder) ||
|
|
86
|
+
' ';
|
|
87
|
+
const StyledDateTimeSelector = getStyledDateTimeSelector(
|
|
88
|
+
DateTimeSelectorComponent
|
|
89
|
+
);
|
|
82
90
|
|
|
83
91
|
const dateTimeSelector = (
|
|
84
92
|
<StyledDateTimeSelector
|
|
@@ -102,7 +110,7 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
|
|
|
102
110
|
minuteLabel={minuteLabel}
|
|
103
111
|
onChange={handleChoosing}
|
|
104
112
|
/>
|
|
105
|
-
)
|
|
113
|
+
);
|
|
106
114
|
|
|
107
115
|
return (
|
|
108
116
|
<>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Hint,
|
|
5
|
+
InputVariantType,
|
|
6
|
+
PressableInputContainer,
|
|
7
|
+
PressableInputContainerProps,
|
|
8
|
+
} from '../../atoms/Input';
|
|
4
9
|
import { TextProps } from '../../atoms/Text';
|
|
5
10
|
|
|
6
11
|
export interface HintInputContainerProps extends PressableInputContainerProps {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ButtonProps } from '
|
|
2
|
-
import { IconProps } from '../../atoms/Icon';
|
|
3
|
-
import { TextProps } from '../../atoms/Text';
|
|
1
|
+
import { ButtonProps, IconProps, TextProps } from '@tecsinapse/react-core';
|
|
4
2
|
|
|
5
3
|
export type IconPositionOptions = 'left' | 'right';
|
|
6
4
|
|
|
@@ -84,7 +84,7 @@ export const Snackbar: React.FC<SnackbarProps> = ({
|
|
|
84
84
|
anchor={anchor}
|
|
85
85
|
anchorDistance={anchorDistance}
|
|
86
86
|
visible={open}
|
|
87
|
-
style={[{ opacity:
|
|
87
|
+
style={[{ opacity: fadeAnim as unknown as number }, style]}
|
|
88
88
|
timeout={timeout}
|
|
89
89
|
>
|
|
90
90
|
<StyledContainerFlexRow>
|
|
@@ -32,7 +32,9 @@ const anchorTop = ({
|
|
|
32
32
|
return (
|
|
33
33
|
anchor === 'top' &&
|
|
34
34
|
css`
|
|
35
|
-
top: ${anchorDistance
|
|
35
|
+
top: ${anchorDistance
|
|
36
|
+
? `${RFValue(anchorDistance)}px`
|
|
37
|
+
: theme.spacing.deca};
|
|
36
38
|
`
|
|
37
39
|
);
|
|
38
40
|
};
|
|
@@ -45,7 +47,9 @@ const anchorBottom = ({
|
|
|
45
47
|
return (
|
|
46
48
|
anchor === 'bottom' &&
|
|
47
49
|
css`
|
|
48
|
-
bottom: ${anchorDistance
|
|
50
|
+
bottom: ${anchorDistance
|
|
51
|
+
? `${RFValue(anchorDistance)}px`
|
|
52
|
+
: theme.spacing.deca};
|
|
49
53
|
`
|
|
50
54
|
);
|
|
51
55
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { FontStackType, FontWeightType } from '
|
|
4
|
-
import {
|
|
3
|
+
import { FontStackType, FontWeightType } from '@tecsinapse/react-core';
|
|
4
|
+
import {
|
|
5
|
+
Hint,
|
|
6
|
+
InputContainerProps,
|
|
7
|
+
InputElementProps,
|
|
8
|
+
} from '../../atoms/Input';
|
|
5
9
|
import { Text, TextProps } from '../../atoms/Text';
|
|
6
10
|
import { StyledInputContainer } from './styled';
|
|
7
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { StyleProps } from '
|
|
2
|
+
import { StyleProps } from '@tecsinapse/react-core';
|
|
3
3
|
import { extractNumbersFromString, RFValue, RFValueStr } from '../../../utils';
|
|
4
4
|
import { InputContainer, InputElement } from '../../atoms/Input';
|
|
5
5
|
import { TextAreaProps } from './TextArea';
|
|
@@ -12,7 +12,10 @@ export const TextAreaInputBase = styled(InputElement)<
|
|
|
12
12
|
Partial<TextAreaProps> & Partial<StyleProps>
|
|
13
13
|
>`
|
|
14
14
|
max-height: ${({ theme, numberOfLines }) =>
|
|
15
|
-
`${RFValue(
|
|
15
|
+
`${RFValue(
|
|
16
|
+
extractNumbersFromString(theme.typography.h5.lineHeight) *
|
|
17
|
+
(numberOfLines || 1)
|
|
18
|
+
)}px`};
|
|
16
19
|
width: 100%;
|
|
17
20
|
padding: 0;
|
|
18
21
|
margin: ${RFValueStr('3px')} 0;
|
package/src/index.ts
CHANGED
|
@@ -68,7 +68,18 @@ export {
|
|
|
68
68
|
DateTimeSelectorMode,
|
|
69
69
|
DateTimeSelectorProps,
|
|
70
70
|
} from './components/molecules/DateTimeSelector';
|
|
71
|
-
export
|
|
71
|
+
export {
|
|
72
|
+
GridSpacing,
|
|
73
|
+
IGridItem,
|
|
74
|
+
getGridItemPadding,
|
|
75
|
+
getGridItemColumSpan,
|
|
76
|
+
IGrid,
|
|
77
|
+
FlexAlignBase,
|
|
78
|
+
FlexAlignType,
|
|
79
|
+
FlexPositioning,
|
|
80
|
+
FlexSpacing,
|
|
81
|
+
PaddingPosition,
|
|
82
|
+
} from './components/molecules/Grid';
|
|
72
83
|
export {
|
|
73
84
|
HintInputContainer,
|
|
74
85
|
HintInputContainerProps,
|
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
import { Dimensions, Platform, StatusBar } from 'react-native';
|
|
2
2
|
|
|
3
3
|
export function isIphoneX() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const dimen = Dimensions.get('window');
|
|
5
|
+
return (
|
|
6
|
+
Platform.OS === 'ios' &&
|
|
7
|
+
!Platform.isPad &&
|
|
8
|
+
!Platform.isTVOS &&
|
|
9
|
+
(dimen.height === 780 ||
|
|
10
|
+
dimen.width === 780 ||
|
|
11
|
+
dimen.height === 812 ||
|
|
12
|
+
dimen.width === 812 ||
|
|
13
|
+
dimen.height === 844 ||
|
|
14
|
+
dimen.width === 844 ||
|
|
15
|
+
dimen.height === 896 ||
|
|
16
|
+
dimen.width === 896 ||
|
|
17
|
+
dimen.height === 926 ||
|
|
18
|
+
dimen.width === 926)
|
|
19
|
+
);
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export function ifIphoneX(iphoneXStyle, regularStyle) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
if (isIphoneX()) {
|
|
24
|
+
return iphoneXStyle;
|
|
25
|
+
}
|
|
26
|
+
return regularStyle;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
export function getStatusBarHeight(safe) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
return Platform.select({
|
|
31
|
+
ios: ifIphoneX(safe ? 44 : 30, 20),
|
|
32
|
+
android: StatusBar.currentHeight,
|
|
33
|
+
default: 0,
|
|
34
|
+
});
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export function getBottomSpace() {
|
|
33
|
-
|
|
34
|
-
}
|
|
38
|
+
return isIphoneX() ? 34 : 0;
|
|
39
|
+
}
|