@tecsinapse/react-core 1.12.4 → 1.12.5
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 +8 -0
- package/dist/components/atoms/Badge/styled.d.ts +3 -2
- package/dist/components/atoms/Badge/styled.js +5 -3
- package/dist/components/atoms/Badge/styled.js.map +1 -1
- package/dist/components/atoms/Button/styled.js +4 -2
- package/dist/components/atoms/Button/styled.js.map +1 -1
- package/dist/components/atoms/GroupButton/styled.js +4 -2
- package/dist/components/atoms/GroupButton/styled.js.map +1 -1
- package/dist/components/atoms/Input/styled.js +3 -1
- package/dist/components/atoms/Input/styled.js.map +1 -1
- package/dist/components/atoms/ProgressBar/styled.d.ts +15 -3
- package/dist/components/atoms/ProgressBar/styled.js +3 -1
- package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
- package/dist/components/atoms/Switch/styled.d.ts +15 -2
- package/dist/components/atoms/Switch/styled.js +6 -4
- package/dist/components/atoms/Switch/styled.js.map +1 -1
- package/dist/components/molecules/DatePicker/styled.d.ts +25 -4
- package/dist/components/molecules/DatePicker/styled.js +7 -5
- package/dist/components/molecules/DatePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/styled.js +4 -2
- package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/styled.js +3 -1
- package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
- package/dist/components/molecules/Snackbar/styled.js +7 -5
- package/dist/components/molecules/Snackbar/styled.js.map +1 -1
- package/dist/components/molecules/TextArea/styled.d.ts +13 -6
- package/dist/components/molecules/TextArea/styled.js +8 -6
- package/dist/components/molecules/TextArea/styled.js.map +1 -1
- package/dist/styles/definitions.js +44 -41
- package/dist/styles/definitions.js.map +1 -1
- package/dist/utils/IPhoneXHelper.d.ts +4 -0
- package/dist/utils/IPhoneXHelper.js +38 -0
- package/dist/utils/IPhoneXHelper.js.map +1 -0
- package/dist/utils/ResponsiveFontSize.d.ts +3 -0
- package/dist/utils/ResponsiveFontSize.js +57 -0
- package/dist/utils/ResponsiveFontSize.js.map +1 -0
- package/dist/utils/extractNumbersFromString.js +2 -2
- package/dist/utils/extractNumbersFromString.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +33 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/Badge/styled.ts +5 -4
- package/src/components/atoms/Button/styled.ts +3 -2
- package/src/components/atoms/GroupButton/styled.ts +3 -2
- package/src/components/atoms/Input/styled.ts +2 -1
- package/src/components/atoms/ProgressBar/styled.ts +3 -2
- package/src/components/atoms/Switch/styled.ts +7 -5
- package/src/components/molecules/DatePicker/styled.ts +4 -2
- package/src/components/molecules/DateTimePicker/styled.ts +4 -3
- package/src/components/molecules/DateTimeSelector/styled.ts +2 -1
- package/src/components/molecules/Snackbar/styled.ts +6 -5
- package/src/components/molecules/TextArea/styled.ts +6 -12
- package/src/styles/definitions.ts +43 -42
- package/src/utils/IPhoneXHelper.ts +34 -0
- package/src/utils/ResponsiveFontSize.ts +52 -0
- package/src/utils/extractNumbersFromString.ts +2 -4
- package/src/utils/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/Snackbar/styled.ts"],"names":["baseStyles","theme","colorTone","colorVariant","visible","borderRadius","mili","color","zIndex","modal","anchorTop","anchor","anchorDistance","spacing","deca","anchorBottom","SnackbarContainer","Paper","props","ContentContainer","View","IconContainer","DismissContainer","PressableSurface","StyledProgressBar","ProgressBar","StyledContainerFlexRow","TextContainer"],"mappings":";;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Snackbar/styled.ts"],"names":["baseStyles","theme","colorTone","colorVariant","visible","borderRadius","mili","color","zIndex","modal","anchorTop","anchor","anchorDistance","spacing","deca","anchorBottom","SnackbarContainer","Paper","props","ContentContainer","View","IconContainer","DismissContain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MR,SAAS,CAACQ,KAAD,CAAQ;AACvB,GAPiC,CAA1B;;AAUA,MAAMC,gBAAgB,GAAG,qBAAOC,iBAAP,CAAa;AAC7C;AACA;AACA;AACA;AACA,CALO;;AAOA,MAAMC,aAAa,GAAG,qBAAOD,iBAAP,CAAkC;AAC/D;AACA;AACA;AACA,kBAAkB,CAAC;AAAEnB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,OAAN,CAAcP,IAAK;AACpD,CALO;;AAOA,MAAMgB,gBAAgB,GAAG,qBAAOC,kCAAP,CAA8C;AAC9E;AACA;AACA;AACA,iBAAiB,CAAC;AAAEtB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,OAAN,CAAcP,IAAK;AACnD,CALO;;AAOA,MAAMkB,iBAAiB,GAAG,qBAAOC,wBAAP,CAAyC;AAC1E;AACA;AACA,CAHO;;AAKA,MAAMC,sBAAsB,GAAG,qBAAON,iBAAP,CAAkC;AACxE;AACA;AACA;AACA,aAAa,CAAC;AAAEnB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,OAAN,CAAcP,IAAK;AAC/C,CALO;;AAOA,MAAMqB,aAAa,GAAG,qBAAOP,iBAAP,CAAa;AAC1C;AACA;AACA,CAHO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { View } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValue } from '../../../utils';\nimport { Paper } from '../../atoms/Paper';\nimport { PressableSurface } from '../../atoms/PressableSurface';\nimport { ProgressBar } from '../../atoms/ProgressBar';\nimport { SnackbarProps } from './Snackbar';\n\nconst baseStyles = ({\n theme,\n colorTone = 'xlight',\n colorVariant = 'primary',\n visible,\n}: StyleProps & Partial<SnackbarProps> & { visible: boolean }) => css`\n padding: 0;\n border-radius: ${theme.borderRadius.mili};\n background-color: ${theme.color[colorVariant][colorTone]};\n position: absolute;\n z-index: ${theme.zIndex.modal};\n display: ${visible ? 'flex' : 'none'};\n flex-direction: column;\n justify-content: space-between;\n align-items: stretch;\n`;\n\nconst anchorTop = ({\n theme,\n anchor,\n anchorDistance,\n}: Partial<SnackbarProps> & StyleProps) => {\n return (\n anchor === 'top' &&\n css`\n top: ${anchorDistance ? `${RFValue(anchorDistance)}px` : theme.spacing.deca};\n `\n );\n};\n\nconst anchorBottom = ({\n theme,\n anchor,\n anchorDistance,\n}: Partial<SnackbarProps> & StyleProps) => {\n return (\n anchor === 'bottom' &&\n css`\n bottom: ${anchorDistance ? `${RFValue(anchorDistance)}px` : theme.spacing.deca};\n `\n );\n};\n\nexport const SnackbarContainer = styled(Paper)<\n Partial<SnackbarProps & StyleProps> & { visible: boolean }\n>(\n props => css`\n ${baseStyles(props)}\n ${anchorBottom(props)}\n ${anchorTop(props)}\n `\n);\n\nexport const ContentContainer = styled(View)`\n flex-direction: row;\n display: flex;\n align-items: center;\n flex-shrink: 1;\n`;\n\nexport const IconContainer = styled(View)<Partial<StyleProps>>`\n flex-direction: row;\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing.mili};\n`;\n\nexport const DismissContainer = styled(PressableSurface)<Partial<StyleProps>>`\n flex-direction: row;\n display: flex;\n align-items: center;\n margin-left: ${({ theme }) => theme.spacing.mili};\n`;\n\nexport const StyledProgressBar = styled(ProgressBar)<Partial<StyleProps>>`\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n`;\n\nexport const StyledContainerFlexRow = styled(View)<Partial<StyleProps>>`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: ${({ theme }) => theme.spacing.mili};\n`;\n\nexport const TextContainer = styled(View)`\n display: flex;\n flex-shrink: 1;\n`;\n"],"file":"styled.js"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { TextAreaProps } from './TextArea';
|
|
3
|
+
export declare const StyledInputContainer: import("@emotion/native").StyledComponent<import("../../atoms/Input").InputContainerProps & Partial<import("../../atoms/Input").InputElementProps> & {
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
} & {
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
7
|
+
as?: import("react").ElementType<any> | undefined;
|
|
8
|
+
} & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {}>;
|
|
9
|
+
export declare const TextAreaInputBase: import("@emotion/native").StyledComponent<import("../../atoms/Input").InputElementProps & {
|
|
10
|
+
children?: import("react").ReactNode;
|
|
11
|
+
} & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
} & Partial<TextAreaProps> & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {}>;
|
|
@@ -7,22 +7,24 @@ exports.TextAreaInputBase = exports.StyledInputContainer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _utils = require("../../../utils");
|
|
11
|
+
|
|
12
|
+
var _Input = require("../../atoms/Input");
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
|
-
const StyledInputContainer = (0, _native.default)(
|
|
15
|
-
min-height: 50px;
|
|
16
|
+
const StyledInputContainer = (0, _native.default)(_Input.InputContainer)`
|
|
17
|
+
min-height: ${(0, _utils.RFValueStr)('50px')};
|
|
16
18
|
`;
|
|
17
19
|
exports.StyledInputContainer = StyledInputContainer;
|
|
18
|
-
const TextAreaInputBase = (0, _native.default)(
|
|
20
|
+
const TextAreaInputBase = (0, _native.default)(_Input.InputElement)`
|
|
19
21
|
max-height: ${({
|
|
20
22
|
theme,
|
|
21
23
|
numberOfLines
|
|
22
|
-
}) => `${(0,
|
|
24
|
+
}) => `${(0, _utils.RFValue)((0, _utils.extractNumbersFromString)(theme.typography.h5.lineHeight) * (numberOfLines || 1))}px`};
|
|
23
25
|
width: 100%;
|
|
24
26
|
padding: 0;
|
|
25
|
-
margin: 3px 0;
|
|
27
|
+
margin: ${(0, _utils.RFValueStr)('3px')} 0;
|
|
26
28
|
`;
|
|
27
29
|
exports.TextAreaInputBase = TextAreaInputBase;
|
|
28
30
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/TextArea/styled.ts"],"names":["StyledInputContainer","InputContainer","TextAreaInputBase","InputElement","theme","numberOfLines","typography","h5","lineHeight"],"mappings":";;;;;;;AAAA;;AACA;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/TextArea/styled.ts"],"names":["StyledInputContainer","InputContainer","TextAreaInputBase","InputElement","theme","numberOfLines","typography","h5","lineHeight"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;AAGO,MAAMA,oBAAoB,GAAG,qBAAOC,qBAAP,CAA4C;AAChF,gBAAgB,uBAAW,MAAX,CAAmB;AACnC,CAFO;;AAIA,MAAMC,iBAAiB,GAAG,qBAAOC,mBAAP,CAE/B;AACF,gBAAgB,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACX,GAAE,oBAAQ,qCAAyBD,KAAK,CAACE,UAAN,CAAiBC,EAAjB,CAAoBC,UAA7C,KAA4DH,aAAa,IAAI,CAA7E,CAAR,CAAyF,IAAI;AACpG;AACA;AACA,YAAY,uBAAW,KAAX,CAAkB;AAC9B,CARO","sourcesContent":["import styled from '@emotion/native';\nimport { StyleProps } from '../../../types/defaults';\nimport { extractNumbersFromString, RFValue, RFValueStr } from '../../../utils';\nimport { InputContainer, InputElement } from '../../atoms/Input';\nimport { TextAreaProps } from './TextArea';\n\nexport const StyledInputContainer = styled(InputContainer)<Partial<StyleProps>>`\n min-height: ${RFValueStr('50px')};\n`;\n\nexport const TextAreaInputBase = styled(InputElement)<\n Partial<TextAreaProps> & Partial<StyleProps>\n>`\n max-height: ${({ theme, numberOfLines }) =>\n `${RFValue(extractNumbersFromString(theme.typography.h5.lineHeight) * (numberOfLines || 1))}px`};\n width: 100%;\n padding: 0;\n margin: ${RFValueStr('3px')} 0;\n`;\n"],"file":"styled.js"}
|
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.zIndex = exports.fontColor = exports.fontFiles = exports.fontWeight = exports.fontStack = exports.typography = exports.borderWidth = exports.borderRadius = exports.iconSize = exports.spacing = exports.miscellaneous = exports.hex2rgba = exports.statusColor = void 0;
|
|
7
|
+
|
|
8
|
+
var _utils = require("../utils");
|
|
9
|
+
|
|
7
10
|
const statusColor = {
|
|
8
11
|
error: {
|
|
9
12
|
xlight: '#fdf3f2',
|
|
@@ -50,74 +53,74 @@ const miscellaneous = {
|
|
|
50
53
|
};
|
|
51
54
|
exports.miscellaneous = miscellaneous;
|
|
52
55
|
const spacing = {
|
|
53
|
-
nano: '2px',
|
|
54
|
-
micro: '4px',
|
|
55
|
-
mili: '8px',
|
|
56
|
-
centi: '12px',
|
|
57
|
-
deca: '16px',
|
|
58
|
-
kilo: '24px',
|
|
59
|
-
mega: '32px',
|
|
60
|
-
giga: '40px',
|
|
61
|
-
tera: '48px',
|
|
62
|
-
peta: '56px',
|
|
63
|
-
hexa: '64px'
|
|
56
|
+
nano: (0, _utils.RFValueStr)('2px'),
|
|
57
|
+
micro: (0, _utils.RFValueStr)('4px'),
|
|
58
|
+
mili: (0, _utils.RFValueStr)('8px'),
|
|
59
|
+
centi: (0, _utils.RFValueStr)('12px'),
|
|
60
|
+
deca: (0, _utils.RFValueStr)('16px'),
|
|
61
|
+
kilo: (0, _utils.RFValueStr)('24px'),
|
|
62
|
+
mega: (0, _utils.RFValueStr)('32px'),
|
|
63
|
+
giga: (0, _utils.RFValueStr)('40px'),
|
|
64
|
+
tera: (0, _utils.RFValueStr)('48px'),
|
|
65
|
+
peta: (0, _utils.RFValueStr)('56px'),
|
|
66
|
+
hexa: (0, _utils.RFValueStr)('64px')
|
|
64
67
|
};
|
|
65
68
|
exports.spacing = spacing;
|
|
66
69
|
const iconSize = {
|
|
67
|
-
micro: '12px',
|
|
68
|
-
mili: '14px',
|
|
69
|
-
centi: '16px',
|
|
70
|
-
deca: '18px',
|
|
71
|
-
kilo: '24px',
|
|
72
|
-
mega: '32px'
|
|
70
|
+
micro: (0, _utils.RFValueStr)('12px'),
|
|
71
|
+
mili: (0, _utils.RFValueStr)('14px'),
|
|
72
|
+
centi: (0, _utils.RFValueStr)('16px'),
|
|
73
|
+
deca: (0, _utils.RFValueStr)('18px'),
|
|
74
|
+
kilo: (0, _utils.RFValueStr)('24px'),
|
|
75
|
+
mega: (0, _utils.RFValueStr)('32px')
|
|
73
76
|
};
|
|
74
77
|
exports.iconSize = iconSize;
|
|
75
78
|
const borderRadius = {
|
|
76
|
-
nano: '2px',
|
|
77
|
-
micro: '4px',
|
|
78
|
-
mili: '8px',
|
|
79
|
-
centi: '16px',
|
|
80
|
-
deca: '24px',
|
|
81
|
-
pill: '999999px'
|
|
79
|
+
nano: (0, _utils.RFValueStr)('2px'),
|
|
80
|
+
micro: (0, _utils.RFValueStr)('4px'),
|
|
81
|
+
mili: (0, _utils.RFValueStr)('8px'),
|
|
82
|
+
centi: (0, _utils.RFValueStr)('16px'),
|
|
83
|
+
deca: (0, _utils.RFValueStr)('24px'),
|
|
84
|
+
pill: (0, _utils.RFValueStr)('999999px')
|
|
82
85
|
};
|
|
83
86
|
exports.borderRadius = borderRadius;
|
|
84
87
|
const borderWidth = {
|
|
85
|
-
pico: '1px',
|
|
86
|
-
nano: '2px'
|
|
88
|
+
pico: (0, _utils.RFValueStr)('1px'),
|
|
89
|
+
nano: (0, _utils.RFValueStr)('2px')
|
|
87
90
|
};
|
|
88
91
|
exports.borderWidth = borderWidth;
|
|
89
92
|
const typography = {
|
|
90
93
|
h5: {
|
|
91
|
-
fontSize: '16px',
|
|
92
|
-
lineHeight: '24px'
|
|
94
|
+
fontSize: (0, _utils.RFValueStr)('16px'),
|
|
95
|
+
lineHeight: (0, _utils.RFValueStr)('24px')
|
|
93
96
|
},
|
|
94
97
|
h4: {
|
|
95
|
-
fontSize: '18px',
|
|
96
|
-
lineHeight: '27px'
|
|
98
|
+
fontSize: (0, _utils.RFValueStr)('18px'),
|
|
99
|
+
lineHeight: (0, _utils.RFValueStr)('27px')
|
|
97
100
|
},
|
|
98
101
|
h3: {
|
|
99
|
-
fontSize: '20px',
|
|
100
|
-
lineHeight: '32px'
|
|
102
|
+
fontSize: (0, _utils.RFValueStr)('20px'),
|
|
103
|
+
lineHeight: (0, _utils.RFValueStr)('32px')
|
|
101
104
|
},
|
|
102
105
|
h2: {
|
|
103
|
-
fontSize: '26px',
|
|
104
|
-
lineHeight: '38px'
|
|
106
|
+
fontSize: (0, _utils.RFValueStr)('26px'),
|
|
107
|
+
lineHeight: (0, _utils.RFValueStr)('38px')
|
|
105
108
|
},
|
|
106
109
|
h1: {
|
|
107
|
-
fontSize: '32px',
|
|
108
|
-
lineHeight: '42px'
|
|
110
|
+
fontSize: (0, _utils.RFValueStr)('32px'),
|
|
111
|
+
lineHeight: (0, _utils.RFValueStr)('42px')
|
|
109
112
|
},
|
|
110
113
|
base: {
|
|
111
|
-
fontSize: '14px',
|
|
112
|
-
lineHeight: '21px'
|
|
114
|
+
fontSize: (0, _utils.RFValueStr)('14px'),
|
|
115
|
+
lineHeight: (0, _utils.RFValueStr)('21px')
|
|
113
116
|
},
|
|
114
117
|
sub: {
|
|
115
|
-
fontSize: '12px',
|
|
116
|
-
lineHeight: '18px'
|
|
118
|
+
fontSize: (0, _utils.RFValueStr)('12px'),
|
|
119
|
+
lineHeight: (0, _utils.RFValueStr)('18px')
|
|
117
120
|
},
|
|
118
121
|
label: {
|
|
119
|
-
fontSize: '10px',
|
|
120
|
-
lineHeight: '12px'
|
|
122
|
+
fontSize: (0, _utils.RFValueStr)('10px'),
|
|
123
|
+
lineHeight: (0, _utils.RFValueStr)('12px')
|
|
121
124
|
}
|
|
122
125
|
};
|
|
123
126
|
exports.typography = typography;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/styles/definitions.ts"],"names":["statusColor","error","xlight","light","medium","dark","xdark","warning","success","info","hex2rgba","hex","alpha","r","g","b","match","map","x","parseInt","miscellaneous","shadow","overlay","bodyColor","surfaceColor","spacing","nano","micro","mili","centi","deca","kilo","mega","giga","tera","peta","hexa","iconSize","borderRadius","pill","borderWidth","pico","typography","h5","fontSize","lineHeight","h4","h3","h2","h1","base","sub","label","fontStack","default","mono","fontWeight","regular","bold","black","fontFiles","fontColor","orange","zIndex","absolute","select","input","popover","tooltip","header","backdrop","drawer","sidebar","modal"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/styles/definitions.ts"],"names":["statusColor","error","xlight","light","medium","dark","xdark","warning","success","info","hex2rgba","hex","alpha","r","g","b","match","map","x","parseInt","miscellaneous","shadow","overlay","bodyColor","surfaceColor","spacing","nano","micro","mili","centi","deca","kilo","mega","giga","tera","peta","hexa","iconSize","borderRadius","pill","borderWidth","pico","typography","h5","fontSize","lineHeight","h4","h3","h2","h1","base","sub","label","fontStack","default","mono","fontWeight","regular","bold","black","fontFiles","fontColor","orange","zIndex","absolute","select","input","popover","tooltip","header","backdrop","drawer","sidebar","modal"],"mappings":";;;;;;;AAYA;;AAEO,MAAMA,WAAW,GAAG;AACzBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,SADH;AAELC,IAAAA,KAAK,EAAE,SAFF;AAGLC,IAAAA,MAAM,EAAE,SAHH;AAILC,IAAAA,IAAI,EAAE,SAJD;AAKLC,IAAAA,KAAK,EAAE;AALF,GADkB;AAQzBC,EAAAA,OAAO,EAAE;AACPL,IAAAA,MAAM,EAAE,SADD;AAEPC,IAAAA,KAAK,EAAE,SAFA;AAGPC,IAAAA,MAAM,EAAE,SAHD;AAIPC,IAAAA,IAAI,E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A9B;;AAMA,MAAMI,SAAoB,GAAG;AAClC1D,EAAAA,KAAK,EAAE,MAD2B;AAElCC,EAAAA,MAAM,EAAE,SAF0B;AAGlCC,EAAAA,IAAI,EAAE,SAH4B;AAIlCyD,EAAAA,MAAM,EAAE;AAJ0B,CAA7B;;AAOA,MAAMC,MAAc,GAAG;AAC5BT,EAAAA,OAAO,EAAE,CADmB;AAE5BU,EAAAA,QAAQ,EAAE,CAFkB;AAG5BC,EAAAA,MAAM,EAAE,EAHoB;AAI5BC,EAAAA,KAAK,EAAE,EAJqB;AAK5BC,EAAAA,OAAO,EAAE,EALmB;AAM5BC,EAAAA,OAAO,EAAE,EANmB;AAO5BC,EAAAA,MAAM,EAAE,GAPoB;AAQ5BC,EAAAA,QAAQ,EAAE,GARkB;AAS5BC,EAAAA,MAAM,EAAE,GAToB;AAU5BC,EAAAA,OAAO,EAAE,GAVmB;AAW5BC,EAAAA,KAAK,EAAE;AAXqB,CAAvB","sourcesContent":["import {\n BorderRadius,\n BorderWidth,\n FontColor,\n FontStack,\n FontWeight,\n IconSize,\n Miscellaneous,\n Spacing,\n TypographyVariation,\n ZIndex\n} from '../types/defaults';\nimport { RFValueStr } from '../utils';\n\nexport const statusColor = {\n error: {\n xlight: '#fdf3f2',\n light: '#ee9891',\n medium: '#e04638',\n dark: '#9b2318',\n xdark: '#58240e',\n },\n warning: {\n xlight: '#fffcf0',\n light: '#ffe380',\n medium: '#ffc700',\n dark: '#cc9f00',\n xdark: '#665000',\n },\n success: {\n xlight: '#f3fcf8',\n light: '#99e6c9',\n medium: '#2db783',\n dark: '#238f67',\n xdark: '#14523b',\n },\n info: {\n xlight: '#f0f8fe',\n light: '#85c7fa',\n medium: '#239bf6',\n dark: '#0873c4',\n xdark: '#043962',\n },\n};\n\nexport const hex2rgba: (hex, alpha?: number) => string = (hex, alpha = 1) => {\n const [r, g, b] = hex.match(/\\w\\w/g).map(x => parseInt(x, 16));\n return `rgba(${r},${g},${b},${alpha})`;\n};\n\nexport const miscellaneous: Miscellaneous = {\n shadow: '#85807a', // rgba(133, 128, 122, 0.08)\n overlay: '#282625', // rgba(40, 38, 37, 0.5)\n bodyColor: '#f8f7f7',\n surfaceColor: '#ffffff', //input, group button, cards\n};\n\nexport const spacing: Spacing = {\n nano: RFValueStr('2px'),\n micro: RFValueStr('4px'),\n mili: RFValueStr('8px'),\n centi: RFValueStr('12px'),\n deca: RFValueStr('16px'),\n kilo: RFValueStr('24px'),\n mega: RFValueStr('32px'),\n giga: RFValueStr('40px'),\n tera: RFValueStr('48px'),\n peta: RFValueStr('56px'),\n hexa: RFValueStr('64px'),\n};\n\nexport const iconSize: IconSize = {\n micro: RFValueStr('12px'),\n mili: RFValueStr('14px'),\n centi: RFValueStr('16px'), // '1rem'\n deca: RFValueStr('18px'), // '1.5rem'\n kilo: RFValueStr('24px'), // '1.6rem'\n mega: RFValueStr('32px'), // '2rem'\n};\n\nexport const borderRadius: BorderRadius = {\n nano: RFValueStr('2px'),\n micro: RFValueStr('4px'),\n mili: RFValueStr('8px'),\n centi: RFValueStr('16px'),\n deca: RFValueStr('24px'),\n pill: RFValueStr('999999px'), // also circle\n};\n\nexport const borderWidth: BorderWidth = {\n pico: RFValueStr('1px'),\n nano: RFValueStr('2px'),\n};\n\nexport const typography: TypographyVariation = {\n h5: {\n fontSize: RFValueStr('16px'), // '1rem'\n lineHeight: RFValueStr('24px'), // '1.5rem'\n },\n h4: {\n fontSize: RFValueStr('18px'), // '1.125rem'\n lineHeight: RFValueStr('27px'), // '1.688rem'\n },\n h3: {\n fontSize: RFValueStr('20px'), // '1.25rem'\n lineHeight: RFValueStr('32px'), // '2rem'\n },\n h2: {\n fontSize: RFValueStr('26px'), // '1.625rem'\n lineHeight: RFValueStr('38px'), // '2.375rem'\n },\n h1: {\n fontSize: RFValueStr('32px'), // '2rem'\n lineHeight: RFValueStr('42px'), // '2.625rem'\n },\n base: {\n fontSize: RFValueStr('14px'), // '0.875rem'\n lineHeight: RFValueStr('21px'), // '1.313rem'\n },\n sub: {\n fontSize: RFValueStr('12px'), // '0.75rem'\n lineHeight: RFValueStr('18px'), // '1.125rem'\n },\n label: {\n fontSize: RFValueStr('10px'),\n lineHeight: RFValueStr('12px'),\n },\n};\n\nexport const fontStack: FontStack = {\n default: 'Lato',\n mono: 'Consolas, monaco, monospace',\n};\n\nexport const fontWeight: FontWeight = {\n regular: '400',\n bold: '700',\n black: '900',\n};\n\nexport const fontFiles: FontWeight = {\n black: '{0}-Black',\n bold: '{0}-Bold',\n regular: '{0}-Regular',\n};\n\nexport const fontColor: FontColor = {\n light: '#fff',\n medium: '#85807a',\n dark: '#353231', // default\n orange: '#f89907',\n};\n\nexport const zIndex: ZIndex = {\n default: 0,\n absolute: 1,\n select: 20,\n input: 20,\n popover: 30,\n tooltip: 40,\n header: 600,\n backdrop: 700,\n drawer: 700,\n sidebar: 800,\n modal: 1000,\n};\n\nexport type IconType =\n | 'material'\n | 'material-community'\n | 'simple-line-icon'\n | 'zocial'\n | 'font-awesome'\n | 'octicon'\n | 'ionicon'\n | 'foundation'\n | 'evilicon'\n | 'entypo'\n | 'antdesign'\n | 'font-awesome-5'\n | string;\n"],"file":"definitions.js"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isIphoneX = isIphoneX;
|
|
7
|
+
exports.ifIphoneX = ifIphoneX;
|
|
8
|
+
exports.getStatusBarHeight = getStatusBarHeight;
|
|
9
|
+
exports.getBottomSpace = getBottomSpace;
|
|
10
|
+
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
|
|
13
|
+
function isIphoneX() {
|
|
14
|
+
const dimen = _reactNative.Dimensions.get('window');
|
|
15
|
+
|
|
16
|
+
return _reactNative.Platform.OS === 'ios' && !_reactNative.Platform.isPad && !_reactNative.Platform.isTVOS && (dimen.height === 780 || dimen.width === 780 || dimen.height === 812 || dimen.width === 812 || dimen.height === 844 || dimen.width === 844 || dimen.height === 896 || dimen.width === 896 || dimen.height === 926 || dimen.width === 926);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function ifIphoneX(iphoneXStyle, regularStyle) {
|
|
20
|
+
if (isIphoneX()) {
|
|
21
|
+
return iphoneXStyle;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return regularStyle;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getStatusBarHeight(safe) {
|
|
28
|
+
return _reactNative.Platform.select({
|
|
29
|
+
ios: ifIphoneX(safe ? 44 : 30, 20),
|
|
30
|
+
android: _reactNative.StatusBar.currentHeight,
|
|
31
|
+
default: 0
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getBottomSpace() {
|
|
36
|
+
return isIphoneX() ? 34 : 0;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=IPhoneXHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/IPhoneXHelper.ts"],"names":["isIphoneX","dimen","Dimensions","get","Platform","OS","isPad","isTVOS","height","width","ifIphoneX","iphoneXStyle","regularStyle","getStatusBarHeight","safe","select","ios","android","StatusBar","currentHeight","default","getBottomSpace"],"mappings":";;;;;;;;;;AAAA;;AAEO,SAASA,SAAT,GAAqB;AACxB,QAAMC,KAAK,GAAGC,wBAAWC,GAAX,CAAe,QAAf,CAAd;;AACA,SACIC,sBAASC,EAAT,KAAgB,KAAhB,IACA,CAACD,sBAASE,KADV,IAEA,CAACF,sBAASG,MAFV,KAGEN,KAAK,CAACO,MAAN,KAAiB,GAAjB,IAAwBP,KAAK,CAACQ,KAAN,KAAgB,GAAzC,IACKR,KAAK,CAACO,MAAN,KAAiB,GAAjB,IAAwBP,KAAK,CAACQ,KAAN,KAAgB,GAD7C,IAEKR,KAAK,CAACO,MAAN,KAAiB,GAAjB,IAAwBP,KAAK,CAACQ,KAAN,KAAgB,GAF7C,IAGKR,KAAK,CAACO,MAAN,KAAiB,GAAjB,IAAwBP,KAAK,CAACQ,KAAN,KAAgB,GAH7C,IAIKR,KAAK,CAACO,MAAN,KAAiB,GAAjB,IAAwBP,KAAK,CAACQ,KAAN,KAAgB,GAP9C,CADJ;AAUH;;AAEM,SAASC,SAAT,CAAmBC,YAAnB,EAAiCC,YAAjC,EAA+C;AAClD,MAAIZ,SAAS,EAAb,EAAiB;AACb,WAAOW,YAAP;AACH;;AACD,SAAOC,YAAP;AACH;;AAEM,SAASC,kBAAT,CAA4BC,IAA5B,EAAkC;AACrC,SAAOV,sBAASW,MAAT,CAAgB;AACnBC,IAAAA,GAAG,EAAEN,SAAS,CAACI,IAAI,GAAG,EAAH,GAAQ,EAAb,EAAiB,EAAjB,CADK;AAEnBG,IAAAA,OAAO,EAAEC,uBAAUC,aAFA;AAGnBC,IAAAA,OAAO,EAAE;AAHU,GAAhB,CAAP;AAKH;;AAEM,SAASC,cAAT,GAA0B;AAC7B,SAAOrB,SAAS,KAAK,EAAL,GAAU,CAA1B;AACH","sourcesContent":["import { Dimensions, Platform, StatusBar } from 'react-native';\n\nexport function isIphoneX() {\n const dimen = Dimensions.get('window');\n return (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n !Platform.isTVOS &&\n ((dimen.height === 780 || dimen.width === 780)\n || (dimen.height === 812 || dimen.width === 812)\n || (dimen.height === 844 || dimen.width === 844)\n || (dimen.height === 896 || dimen.width === 896)\n || (dimen.height === 926 || dimen.width === 926))\n );\n}\n\nexport function ifIphoneX(iphoneXStyle, regularStyle) {\n if (isIphoneX()) {\n return iphoneXStyle;\n }\n return regularStyle;\n}\n\nexport function getStatusBarHeight(safe) {\n return Platform.select({\n ios: ifIphoneX(safe ? 44 : 30, 20),\n android: StatusBar.currentHeight,\n default: 0\n });\n}\n\nexport function getBottomSpace() {\n return isIphoneX() ? 34 : 0;\n}"],"file":"IPhoneXHelper.js"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RFValueStr = exports.RFValue = exports.RFPercentage = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _extractNumbersFromString = require("./extractNumbersFromString");
|
|
11
|
+
|
|
12
|
+
var _IPhoneXHelper = require("./IPhoneXHelper");
|
|
13
|
+
|
|
14
|
+
const STANDARD_SCREEN_HEIGHT = 640;
|
|
15
|
+
|
|
16
|
+
const RFPercentage = percent => {
|
|
17
|
+
if (_reactNative.Platform.OS === 'web') return percent;
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
height,
|
|
21
|
+
width
|
|
22
|
+
} = _reactNative.Dimensions.get("window");
|
|
23
|
+
|
|
24
|
+
const standardLength = width > height ? width : height;
|
|
25
|
+
const offset = width > height ? 0 : _reactNative.Platform.OS === "ios" ? 78 : _reactNative.StatusBar.currentHeight || 0;
|
|
26
|
+
const deviceHeight = (0, _IPhoneXHelper.isIphoneX)() || _reactNative.Platform.OS === "android" ? standardLength - offset : standardLength;
|
|
27
|
+
const heightPercent = percent * deviceHeight / 100;
|
|
28
|
+
return Math.round(heightPercent);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.RFPercentage = RFPercentage;
|
|
32
|
+
|
|
33
|
+
const RFValue = (fontSize, standardScreenHeight = STANDARD_SCREEN_HEIGHT) => {
|
|
34
|
+
if (_reactNative.Platform.OS === 'web') return fontSize;
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
height,
|
|
38
|
+
width
|
|
39
|
+
} = _reactNative.Dimensions.get("window");
|
|
40
|
+
|
|
41
|
+
const standardLength = width > height ? width : height;
|
|
42
|
+
const offset = width > height ? 0 : _reactNative.Platform.OS === "ios" ? 78 : _reactNative.StatusBar.currentHeight || 0;
|
|
43
|
+
const deviceHeight = (0, _IPhoneXHelper.isIphoneX)() || _reactNative.Platform.OS === "android" ? standardLength - offset : standardLength;
|
|
44
|
+
const heightPercent = fontSize * deviceHeight / standardScreenHeight;
|
|
45
|
+
return Math.round(heightPercent);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.RFValue = RFValue;
|
|
49
|
+
|
|
50
|
+
const RFValueStr = (fontSize, standardScreenHeight) => {
|
|
51
|
+
const _fontSize = (0, _extractNumbersFromString.extractNumbersFromString)(fontSize);
|
|
52
|
+
|
|
53
|
+
return `${RFValue(_fontSize, standardScreenHeight)}px`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.RFValueStr = RFValueStr;
|
|
57
|
+
//# sourceMappingURL=ResponsiveFontSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/ResponsiveFontSize.ts"],"names":["STANDARD_SCREEN_HEIGHT","RFPercentage","percent","Platform","OS","height","width","Dimensions","get","standardLength","offset","StatusBar","currentHeight","deviceHeight","heightPercent","Math","round","RFValue","fontSize","standardScreenHeight","RFValueStr","_fontSize"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA,MAAMA,sBAAsB,GAAG,GAA/B;;AASO,MAAMC,YAAY,GAAIC,OAAD,IAAqB;AAC7C,MAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B,OAAOF,OAAP;;AAC3B,QAAM;AAAEG,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAoBC,wBAAWC,GAAX,CAAe,QAAf,CAA1B;;AACA,QAAMC,cAAc,GAAGH,KAAK,GAAGD,MAAR,GAAiBC,KAAjB,GAAyBD,MAAhD;AACA,QAAMK,MAAM,GAAGJ,KAAK,GAAGD,MAAR,GAAiB,CAAjB,GAAqBF,sBAASC,EAAT,KAAgB,KAAhB,GAAwB,EAAxB,GAA6BO,uBAAUC,aAAV,IAA2B,CAA5F;AACA,QAAMC,YAAY,GAAG,mCAAeV,sBAASC,EAAT,KAAgB,SAA/B,GAA2CK,cAAc,GAAGC,MAA5D,GAAqED,cAA1F;AACA,QAAMK,aAAa,GAAIZ,OAAO,GAAGW,YAAX,GAA2B,GAAjD;AACA,SAAOE,IAAI,CAACC,KAAL,CAAWF,aAAX,CAAP;AACH,CARM;;;;AAkBA,MAAMG,OAAO,GAAG,CAACC,QAAD,EAAmBC,oBAA4B,GAAGnB,sBAAlD,KAA6E;AAChG,MAAIG,sBAASC,EAAT,KAAgB,KAApB,EAA2B,OAAOc,QAAP;;AAC3B,QAAM;AAAEb,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAoBC,wBAAWC,GAAX,CAAe,QAAf,CAA1B;;AACA,QAAMC,cAAc,GAAGH,KAAK,GAAGD,MAAR,GAAiBC,KAAjB,GAAyBD,MAAhD;AACA,QAAMK,MAAM,GAAGJ,KAAK,GAAGD,MAAR,GAAiB,CAAjB,GAAqBF,sBAASC,EAAT,KAAgB,KAAhB,GAAwB,EAAxB,GAA6BO,uBAAUC,aAAV,IAA2B,CAA5F;AACA,QAAMC,YAAY,GAAG,mCAAeV,sBAASC,EAAT,KAAgB,SAA/B,GAA2CK,cAAc,GAAGC,MAA5D,GAAqED,cAA1F;AACA,QAAMK,aAAa,GAAII,QAAQ,GAAGL,YAAZ,GAA4BM,oBAAlD;AACA,SAAOJ,IAAI,CAACC,KAAL,CAAWF,aAAX,CAAP;AACH,CARM;;;;AAiBA,MAAMM,UAAU,GAAG,CAACF,QAAD,EAAmBC,oBAAnB,KAAqD;AAC3E,QAAME,SAAS,GAAG,wDAAyBH,QAAzB,CAAlB;;AACA,SAAQ,GAAED,OAAO,CAACI,SAAD,EAAYF,oBAAZ,CAAkC,IAAnD;AACH,CAHM","sourcesContent":["import { Dimensions, Platform, StatusBar } from \"react-native\";\nimport { extractNumbersFromString } from \"./extractNumbersFromString\";\nimport { isIphoneX } from \"./IPhoneXHelper\";\n\nconst STANDARD_SCREEN_HEIGHT = 640\n\n/**\n * Use this function when you want to scale a percentage number\n * to a reasonable value that will fit better on most of devices.\n * \n * @param percent \n * @returns \n */\nexport const RFPercentage = (percent: number) => {\n if (Platform.OS === 'web') return percent\n const { height, width } = Dimensions.get(\"window\");\n const standardLength = width > height ? width : height;\n const offset = width > height ? 0 : Platform.OS === \"ios\" ? 78 : StatusBar.currentHeight || 0 // iPhone X style SafeAreaView size in portrait\n const deviceHeight = isIphoneX() || Platform.OS === \"android\" ? standardLength - offset : standardLength;\n const heightPercent = (percent * deviceHeight) / 100;\n return Math.round(heightPercent);\n}\n\n/**\n * Use this function when you want to scale a font size based on pixel unit \n * to a reasonable value that will fit better on most of devices.\n * \n * @param fontSize \n * @param standardScreenHeight \n * @returns \n */\nexport const RFValue = (fontSize: number, standardScreenHeight: number = STANDARD_SCREEN_HEIGHT) => {\n if (Platform.OS === 'web') return fontSize\n const { height, width } = Dimensions.get(\"window\");\n const standardLength = width > height ? width : height;\n const offset = width > height ? 0 : Platform.OS === \"ios\" ? 78 : StatusBar.currentHeight || 0 // iPhone X style SafeAreaView size in portrait\n const deviceHeight = isIphoneX() || Platform.OS === \"android\" ? standardLength - offset : standardLength;\n const heightPercent = (fontSize * deviceHeight) / standardScreenHeight;\n return Math.round(heightPercent);\n}\n\n/**\n * Same of RFValue, however you can provide string values. E.g: '10px', '-5px'.\n * \n * @param fontSize \n * @param standardScreenHeight \n * @returns \n */\nexport const RFValueStr = (fontSize: string, standardScreenHeight?: number) => {\n const _fontSize = extractNumbersFromString(fontSize)\n return `${RFValue(_fontSize, standardScreenHeight)}px`\n}"],"file":"ResponsiveFontSize.js"}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractDigitsFromString = exports.extractNumbersFromString = void 0;
|
|
7
7
|
|
|
8
|
-
const extractNumbersFromString = value => Number(value
|
|
8
|
+
const extractNumbersFromString = value => Number(extractDigitsFromString(value));
|
|
9
9
|
|
|
10
10
|
exports.extractNumbersFromString = extractNumbersFromString;
|
|
11
11
|
|
|
12
|
-
const extractDigitsFromString = value => value.replace(/[
|
|
12
|
+
const extractDigitsFromString = value => value.replace(/[^-0-9]/g, '');
|
|
13
13
|
|
|
14
14
|
exports.extractDigitsFromString = extractDigitsFromString;
|
|
15
15
|
//# sourceMappingURL=extractNumbersFromString.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/extractNumbersFromString.ts"],"names":["extractNumbersFromString","value","Number","
|
|
1
|
+
{"version":3,"sources":["../../src/utils/extractNumbersFromString.ts"],"names":["extractNumbersFromString","value","Number","extractDigitsFromString","replace"],"mappings":";;;;;;;AAAO,MAAMA,wBAAwB,GAAIC,KAAD,IAA2BC,MAAM,CAACC,uBAAuB,CAACF,KAAD,CAAxB,CAAlE;;;;AAKA,MAAME,uBAAuB,GAAIF,KAAD,IAA2BA,KAAK,CAACG,OAAN,CAAc,UAAd,EAA0B,EAA1B,CAA3D","sourcesContent":["export const extractNumbersFromString = (value: string): number => Number(extractDigitsFromString(value));\n\n/*\n * implemented for the case: string numbers start with 0. Example: 012.345.678-91 Example: 012.345.678-91\n * */\nexport const extractDigitsFromString = (value: string): string => value.replace(/[^-0-9]/g, '');\n"],"file":"extractNumbersFromString.js"}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
lightenDarkenColor: true,
|
|
8
|
+
extractNumbersFromString: true,
|
|
9
|
+
extractDigitsFromString: true
|
|
10
|
+
};
|
|
6
11
|
Object.defineProperty(exports, "lightenDarkenColor", {
|
|
7
12
|
enumerable: true,
|
|
8
13
|
get: function () {
|
|
@@ -25,4 +30,32 @@ Object.defineProperty(exports, "extractDigitsFromString", {
|
|
|
25
30
|
var _lightenDarkenColor = require("./lightenDarkenColor");
|
|
26
31
|
|
|
27
32
|
var _extractNumbersFromString = require("./extractNumbersFromString");
|
|
33
|
+
|
|
34
|
+
var _IPhoneXHelper = require("./IPhoneXHelper");
|
|
35
|
+
|
|
36
|
+
Object.keys(_IPhoneXHelper).forEach(function (key) {
|
|
37
|
+
if (key === "default" || key === "__esModule") return;
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
39
|
+
if (key in exports && exports[key] === _IPhoneXHelper[key]) return;
|
|
40
|
+
Object.defineProperty(exports, key, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _IPhoneXHelper[key];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var _ResponsiveFontSize = require("./ResponsiveFontSize");
|
|
49
|
+
|
|
50
|
+
Object.keys(_ResponsiveFontSize).forEach(function (key) {
|
|
51
|
+
if (key === "default" || key === "__esModule") return;
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
53
|
+
if (key in exports && exports[key] === _ResponsiveFontSize[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _ResponsiveFontSize[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
28
61
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAIA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export { lightenDarkenColor } from './lightenDarkenColor';\nexport {\n extractNumbersFromString,\n extractDigitsFromString,\n} from './extractNumbersFromString';\nexport * from './IPhoneXHelper'\nexport * from './ResponsiveFontSize'"],"file":"index.js"}
|
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.12.
|
|
4
|
+
"version": "1.12.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"react-native": ">=0.64.0",
|
|
32
32
|
"react-native-vector-icons": ">=8.1.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "ce86b8c8b3e7c09e0fd86689418b540010f1419b"
|
|
35
35
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View } from 'react-native';
|
|
2
1
|
import styled, { css } from '@emotion/native';
|
|
3
|
-
import {
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleProps } from '../../../types/defaults';
|
|
4
|
+
import { RFValueStr } from '../../../utils';
|
|
4
5
|
import { BadgeProps } from './Badge';
|
|
5
6
|
|
|
6
7
|
const baseStyle = ({
|
|
@@ -17,8 +18,8 @@ const baseStyle = ({
|
|
|
17
18
|
justify-content: center;
|
|
18
19
|
height: ${theme.iconSize.centi};
|
|
19
20
|
width: ${theme.iconSize.centi};
|
|
20
|
-
top: -4px;
|
|
21
|
-
right: -4px;
|
|
21
|
+
top: ${RFValueStr('-4px')};
|
|
22
|
+
right: ${RFValueStr('-4px')};
|
|
22
23
|
`;
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled, { css } from '@emotion/native';
|
|
2
2
|
import { StyleProps } from '../../../types/defaults';
|
|
3
|
+
import { RFValueStr } from '../../../utils';
|
|
3
4
|
import { PressableSurface } from '../PressableSurface';
|
|
4
5
|
import { ButtonProps } from './Button';
|
|
5
6
|
|
|
@@ -20,12 +21,12 @@ const sizeStyles = ({ theme, size = 'default' }: StyleProps & ButtonProps) => {
|
|
|
20
21
|
case 'small':
|
|
21
22
|
return css`
|
|
22
23
|
padding: ${theme.spacing.mili} ${theme.spacing.deca};
|
|
23
|
-
min-height: 34px;
|
|
24
|
+
min-height: ${RFValueStr('34px')};
|
|
24
25
|
`;
|
|
25
26
|
default:
|
|
26
27
|
return css`
|
|
27
28
|
padding: ${theme.spacing.mili} ${theme.spacing.kilo};
|
|
28
|
-
min-height: 44px;
|
|
29
|
+
min-height: ${RFValueStr('44px')};
|
|
29
30
|
`;
|
|
30
31
|
}
|
|
31
32
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled, { css } from '@emotion/native';
|
|
2
2
|
import { FC } from 'react';
|
|
3
3
|
import { StyleProps } from '../../../types/defaults';
|
|
4
|
+
import { RFValueStr } from '../../../utils';
|
|
4
5
|
import { ButtonSizeType } from '../Button';
|
|
5
6
|
import { PressableSurface } from '../PressableSurface';
|
|
6
7
|
import { TextProps } from '../Text';
|
|
@@ -104,12 +105,12 @@ const sizeStyles = ({
|
|
|
104
105
|
case 'small':
|
|
105
106
|
return css`
|
|
106
107
|
padding: ${theme?.spacing.mili} ${theme?.spacing.deca};
|
|
107
|
-
min-height: 34px;
|
|
108
|
+
min-height: ${RFValueStr('34px')};
|
|
108
109
|
`;
|
|
109
110
|
default:
|
|
110
111
|
return css`
|
|
111
112
|
padding: ${theme?.spacing.mili} ${theme?.spacing.kilo};
|
|
112
|
-
min-height: 44px;
|
|
113
|
+
min-height: ${RFValueStr('44px')};
|
|
113
114
|
`;
|
|
114
115
|
}
|
|
115
116
|
};
|
|
@@ -2,6 +2,7 @@ import styled, { css } from '@emotion/native';
|
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
3
|
import { InputElementProps } from '.';
|
|
4
4
|
import { StyleProps } from '../../../types/defaults';
|
|
5
|
+
import { RFValueStr } from '../../../utils';
|
|
5
6
|
import { Icon } from '../Icon';
|
|
6
7
|
import { InputContainerProps } from './InputContainer/InputContainer';
|
|
7
8
|
|
|
@@ -62,7 +63,7 @@ export const StyledInputContainer = styled.View<
|
|
|
62
63
|
>`
|
|
63
64
|
flex-direction: row;
|
|
64
65
|
align-items: center;
|
|
65
|
-
min-height: 44px;
|
|
66
|
+
min-height: ${RFValueStr('44px')};
|
|
66
67
|
`;
|
|
67
68
|
|
|
68
69
|
export const StyledInputElementBase = styled(TextInput)<
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { StyleProps } from '@tecsinapse/react-core';
|
|
3
2
|
import { Animated } from 'react-native';
|
|
3
|
+
import { StyleProps } from '../../../types/defaults';
|
|
4
|
+
import { RFValueStr } from '../../../utils';
|
|
4
5
|
|
|
5
6
|
export const Container = styled.View<Partial<StyleProps>>`
|
|
6
7
|
display: flex;
|
|
@@ -14,7 +15,7 @@ export const Container = styled.View<Partial<StyleProps>>`
|
|
|
14
15
|
export const Segment = styled.View<Partial<StyleProps>>`
|
|
15
16
|
flex: 1;
|
|
16
17
|
background-color: ${({ theme }) => theme.color.secondary.light};
|
|
17
|
-
border-right-width: 2px;
|
|
18
|
+
border-right-width: ${RFValueStr('2px')};
|
|
18
19
|
border-color: ${({ theme }) => theme.color.secondary.xlight};
|
|
19
20
|
`;
|
|
20
21
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { StyleProps, SwitchProps } from '@tecsinapse/react-core';
|
|
3
2
|
import { Animated } from 'react-native';
|
|
3
|
+
import { StyleProps } from '../../../types/defaults';
|
|
4
|
+
import { RFValueStr } from '../../../utils';
|
|
5
|
+
import { SwitchProps } from './Switch';
|
|
4
6
|
|
|
5
7
|
export const StyledSwitchContent = styled(Animated.View)<
|
|
6
8
|
Partial<SwitchProps> & Partial<StyleProps>
|
|
@@ -8,13 +10,13 @@ export const StyledSwitchContent = styled(Animated.View)<
|
|
|
8
10
|
border-radius: ${({ theme }) => theme.borderRadius.pill};
|
|
9
11
|
padding: 0 ${({ theme }) => theme.spacing.micro};
|
|
10
12
|
justify-content: center;
|
|
11
|
-
width: 40px;
|
|
12
|
-
height: 22px;
|
|
13
|
+
width: ${RFValueStr('40px')};
|
|
14
|
+
height: ${RFValueStr('22px')};
|
|
13
15
|
`;
|
|
14
16
|
|
|
15
17
|
export const StyledSwitch = styled(Animated.View)<Partial<StyleProps>>`
|
|
16
18
|
border-radius: ${({ theme }) => theme.borderRadius.pill};
|
|
17
19
|
background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};
|
|
18
|
-
width: 16px;
|
|
19
|
-
height: 16px;
|
|
20
|
+
width: ${RFValueStr('16px')};
|
|
21
|
+
height: ${RFValueStr('16px')};
|
|
20
22
|
`;
|