@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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.fontColorVC = exports.colorVC = exports.colorGradationVC = exports.borderColorVC = exports.borderColorGradationVC = void 0;
|
|
5
|
+
const fontColorVC = {
|
|
6
|
+
filled: 'light',
|
|
7
|
+
outlined: 'orange',
|
|
8
|
+
text: 'orange'
|
|
9
|
+
};
|
|
10
|
+
exports.fontColorVC = fontColorVC;
|
|
11
|
+
const colorVC = {
|
|
12
|
+
filled: 'primary',
|
|
13
|
+
outlined: 'primary',
|
|
14
|
+
text: 'primary'
|
|
15
|
+
};
|
|
16
|
+
exports.colorVC = colorVC;
|
|
17
|
+
const colorGradationVC = {
|
|
18
|
+
filled: 'dark',
|
|
19
|
+
outlined: 'dark',
|
|
20
|
+
text: 'dark'
|
|
21
|
+
};
|
|
22
|
+
exports.colorGradationVC = colorGradationVC;
|
|
23
|
+
const borderColorVC = {
|
|
24
|
+
filled: 'primary',
|
|
25
|
+
outlined: 'primary',
|
|
26
|
+
text: 'primary'
|
|
27
|
+
};
|
|
28
|
+
exports.borderColorVC = borderColorVC;
|
|
29
|
+
const borderColorGradationVC = {
|
|
30
|
+
filled: 'dark',
|
|
31
|
+
outlined: 'dark',
|
|
32
|
+
text: 'dark'
|
|
33
|
+
};
|
|
34
|
+
exports.borderColorGradationVC = borderColorGradationVC;
|
|
35
|
+
//# sourceMappingURL=variantComplement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"yalc:show": "yalc installations show $npm_package_name"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@emotion/native": "^11.
|
|
18
|
-
"@emotion/react": "^11.
|
|
17
|
+
"@emotion/native": "^11.10.0",
|
|
18
|
+
"@emotion/react": "^11.10.0",
|
|
19
19
|
"currency.js": "^2.0.4",
|
|
20
|
-
"date-fns": "^2.
|
|
20
|
+
"date-fns": "^2.29.1"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
@@ -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,12 +1,21 @@
|
|
|
1
1
|
import { useTheme } from '@emotion/react';
|
|
2
2
|
import React, { FC, useCallback, useEffect } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Animated,
|
|
5
|
+
LayoutChangeEvent,
|
|
6
|
+
StyleProp,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
4
9
|
import {
|
|
5
10
|
ColorGradationType,
|
|
6
11
|
ColorType,
|
|
7
|
-
ThemeProp
|
|
8
|
-
} from '
|
|
9
|
-
import {
|
|
12
|
+
ThemeProp,
|
|
13
|
+
} from '@tecsinapse/react-core';
|
|
14
|
+
import {
|
|
15
|
+
extractNumbersFromString,
|
|
16
|
+
lightenDarkenColor,
|
|
17
|
+
RFValueStr,
|
|
18
|
+
} from '../../../utils';
|
|
10
19
|
import { PressableSurface } from '../PressableSurface';
|
|
11
20
|
import { transitionSwitch } from './animation';
|
|
12
21
|
import { StyledSwitch, StyledSwitchContent, SWITCH_PIN_WIDTH } from './styled';
|
|
@@ -36,19 +45,25 @@ const Switch: FC<SwitchProps> = ({
|
|
|
36
45
|
}): JSX.Element => {
|
|
37
46
|
const theme = useTheme() as ThemeProp;
|
|
38
47
|
|
|
39
|
-
const width = React.useRef(0)
|
|
40
|
-
const transitionValue = React.useRef(new Animated.Value(0)).current
|
|
41
|
-
const animatedColor = React.useRef(new Animated.Value(0)).current
|
|
42
|
-
|
|
48
|
+
const width = React.useRef(0);
|
|
49
|
+
const transitionValue = React.useRef(new Animated.Value(0)).current;
|
|
50
|
+
const animatedColor = React.useRef(new Animated.Value(0)).current;
|
|
51
|
+
|
|
43
52
|
const calculateTranslate = () => {
|
|
44
53
|
if (width.current > 0) {
|
|
45
|
-
return
|
|
54
|
+
return (
|
|
55
|
+
width.current -
|
|
56
|
+
extractNumbersFromString(theme.spacing.micro) * 2 -
|
|
57
|
+
extractNumbersFromString(RFValueStr(SWITCH_PIN_WIDTH))
|
|
58
|
+
);
|
|
46
59
|
}
|
|
47
|
-
return 0
|
|
48
|
-
}
|
|
60
|
+
return 0;
|
|
61
|
+
};
|
|
49
62
|
|
|
50
63
|
const getBackgroundColor = (color: string) => {
|
|
51
|
-
return disabled
|
|
64
|
+
return disabled
|
|
65
|
+
? lightenDarkenColor(theme.color[inactiveColor][inactiveColorTone], 20)
|
|
66
|
+
: color;
|
|
52
67
|
};
|
|
53
68
|
|
|
54
69
|
const interpolateColor = animatedColor.interpolate({
|
|
@@ -56,11 +71,11 @@ const Switch: FC<SwitchProps> = ({
|
|
|
56
71
|
outputRange: [
|
|
57
72
|
getBackgroundColor(theme.color[inactiveColor][inactiveColorTone]),
|
|
58
73
|
getBackgroundColor(theme.color[activeColor][activeColorTone]),
|
|
59
|
-
]
|
|
74
|
+
],
|
|
60
75
|
});
|
|
61
76
|
|
|
62
77
|
useEffect(() => {
|
|
63
|
-
const translate = calculateTranslate()
|
|
78
|
+
const translate = calculateTranslate();
|
|
64
79
|
transitionSwitch(active, translate, transitionValue, animatedColor);
|
|
65
80
|
}, [active]);
|
|
66
81
|
|
|
@@ -69,10 +84,10 @@ const Switch: FC<SwitchProps> = ({
|
|
|
69
84
|
}, [active, onChange]);
|
|
70
85
|
|
|
71
86
|
const handleSwitchLayout = (lce: LayoutChangeEvent) => {
|
|
72
|
-
width.current = lce.nativeEvent.layout.width
|
|
73
|
-
const translate = calculateTranslate()
|
|
87
|
+
width.current = lce.nativeEvent.layout.width;
|
|
88
|
+
const translate = calculateTranslate();
|
|
74
89
|
transitionSwitch(active, translate, transitionValue, animatedColor);
|
|
75
|
-
}
|
|
90
|
+
};
|
|
76
91
|
|
|
77
92
|
return (
|
|
78
93
|
<PressableSurface
|
|
@@ -81,8 +96,13 @@ const Switch: FC<SwitchProps> = ({
|
|
|
81
96
|
effect="none"
|
|
82
97
|
disabled={disabled}
|
|
83
98
|
>
|
|
84
|
-
<StyledSwitchContent
|
|
85
|
-
|
|
99
|
+
<StyledSwitchContent
|
|
100
|
+
onLayout={handleSwitchLayout}
|
|
101
|
+
style={{ backgroundColor: interpolateColor }}
|
|
102
|
+
>
|
|
103
|
+
<StyledSwitch
|
|
104
|
+
style={[dotStyle, { transform: [{ translateX: transitionValue }] }]}
|
|
105
|
+
/>
|
|
86
106
|
</StyledSwitchContent>
|
|
87
107
|
</PressableSurface>
|
|
88
108
|
);
|
|
@@ -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
|
<>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extractNumbersFromString,
|
|
3
|
+
GridSpacing,
|
|
4
|
+
PaddingPosition,
|
|
5
|
+
Spacing,
|
|
6
|
+
} from '@tecsinapse/react-core';
|
|
7
|
+
|
|
8
|
+
export const getGridItemPadding = (
|
|
9
|
+
pos: PaddingPosition,
|
|
10
|
+
_spacing: GridSpacing | undefined,
|
|
11
|
+
themeSpacing: Spacing
|
|
12
|
+
): number | undefined => {
|
|
13
|
+
if (_spacing) {
|
|
14
|
+
if (typeof _spacing === 'string')
|
|
15
|
+
return extractNumbersFromString(themeSpacing[_spacing]);
|
|
16
|
+
else if (typeof _spacing === 'object' && _spacing[pos]) {
|
|
17
|
+
return extractNumbersFromString(themeSpacing[_spacing[pos] ?? '0']);
|
|
18
|
+
} else return undefined;
|
|
19
|
+
} else return undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Calc the basis width percentage for a given item
|
|
24
|
+
* @param columns - number of grid columns
|
|
25
|
+
* @param span - number of columns to merge
|
|
26
|
+
* @returns {number} - value in %
|
|
27
|
+
*/
|
|
28
|
+
export const getGridItemColumSpan = (columns: number, span: number): number =>
|
|
29
|
+
100 / (columns / span);
|
|
@@ -1,2 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpacingType } from '@tecsinapse/react-core';
|
|
3
|
+
|
|
4
|
+
export interface IGrid {
|
|
5
|
+
children: JSX.Element[];
|
|
6
|
+
/** Layout should represent the multiplier of columns to fill the rows properly.
|
|
7
|
+
* Example:
|
|
8
|
+
* const layout = [
|
|
9
|
+
* [6, 6], // Two elements on row
|
|
10
|
+
* [4, 4, 4], // Three elements on row
|
|
11
|
+
* [12], // One element on row
|
|
12
|
+
* ];
|
|
13
|
+
* */
|
|
14
|
+
layout?: number[][];
|
|
15
|
+
/** Number of grid columns to be considered (not the number of elements per row) */
|
|
16
|
+
columns?: number;
|
|
17
|
+
spacing?:
|
|
18
|
+
| SpacingType
|
|
19
|
+
| {
|
|
20
|
+
top?: SpacingType;
|
|
21
|
+
right?: SpacingType;
|
|
22
|
+
bottom?: SpacingType;
|
|
23
|
+
left?: SpacingType;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type FlexPositioning = 'flex-start' | 'flex-end' | 'center';
|
|
28
|
+
export type FlexAlignBase = FlexPositioning | 'stretch';
|
|
29
|
+
export type FlexAlignType = FlexAlignBase | 'baseline';
|
|
30
|
+
export type FlexSpacing = 'space-between' | 'space-around';
|
|
31
|
+
export type PaddingPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
32
|
+
|
|
33
|
+
export type GridSpacing =
|
|
34
|
+
| SpacingType
|
|
35
|
+
| {
|
|
36
|
+
top?: SpacingType;
|
|
37
|
+
right?: SpacingType;
|
|
38
|
+
bottom?: SpacingType;
|
|
39
|
+
left?: SpacingType;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export interface IGridItem {
|
|
43
|
+
children: React.ReactElement;
|
|
44
|
+
/** Number of columns to fill */
|
|
45
|
+
span: number;
|
|
46
|
+
/** You don't have to give this property since is inherited from Grid */
|
|
47
|
+
columns?: number;
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
/** If your GridItem has a loading state, specify the component here (Skeleton) */
|
|
50
|
+
loadingComponent?: React.ReactElement;
|
|
51
|
+
/** Flex properties below */
|
|
52
|
+
alignContent?: FlexAlignBase | FlexSpacing;
|
|
53
|
+
alignItems?: FlexAlignType;
|
|
54
|
+
alignSelf?: 'auto' | FlexAlignType;
|
|
55
|
+
flex?: number;
|
|
56
|
+
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
57
|
+
flexGrow?: number;
|
|
58
|
+
flexShrink?: number;
|
|
59
|
+
justifyContent?: FlexPositioning | FlexSpacing | 'space-evenly';
|
|
60
|
+
/** You don't have to give this property since is inherited from Grid */
|
|
61
|
+
spacing?: GridSpacing;
|
|
62
|
+
/** Used to wrap children in a View when its style extrapolates the dimensions*/
|
|
63
|
+
wrapper?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { getGridItemColumSpan, getGridItemPadding } from './functions';
|
|
@@ -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 {
|