@momo-kits/foundation 0.154.1-beta.0 → 0.154.1-beta.2
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/Layout/utils.ts +4 -16
- package/Text/index.tsx +21 -0
- package/package.json +1 -1
package/Layout/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { Fragment, ReactElement
|
|
2
|
-
import {
|
|
1
|
+
import React, { Fragment, ReactElement } from 'react';
|
|
2
|
+
import { useWindowDimensions } from 'react-native';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* validate children type
|
|
@@ -39,20 +39,8 @@ const validateChildren = (
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const useGridSystem = () => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
const subscription: any = Dimensions.addEventListener('change', () => {
|
|
48
|
-
const newColumns = Dimensions.get('window').width > 600 ? 24 : 12;
|
|
49
|
-
if (newColumns !== numberOfColumns) {
|
|
50
|
-
setNumberOfColumns(newColumns);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return () => subscription?.remove();
|
|
54
|
-
}, [numberOfColumns]);
|
|
55
|
-
|
|
42
|
+
const windowSize = useWindowDimensions();
|
|
43
|
+
const numberOfColumns = windowSize.width > 600 ? 24 : 12;
|
|
56
44
|
return { numberOfColumns };
|
|
57
45
|
};
|
|
58
46
|
|
package/Text/index.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { Typography, TypographyWeight } from './types';
|
|
|
5
5
|
import { ApplicationContext, SkeletonContext } from '../Context';
|
|
6
6
|
import { scaleSize, useScaleSize } from './utils';
|
|
7
7
|
import { Skeleton } from '../Skeleton';
|
|
8
|
+
import { Colors } from '../Consts';
|
|
8
9
|
|
|
9
10
|
const SFProText: TypographyWeight = {
|
|
10
11
|
100: 'Thin',
|
|
@@ -34,6 +35,20 @@ const AlegreyaSans: TypographyWeight = {
|
|
|
34
35
|
bold: 'Bold',
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
const BarlowCondensed: TypographyWeight = {
|
|
39
|
+
100: 'Thin',
|
|
40
|
+
200: 'ExtraLight',
|
|
41
|
+
300: 'Light',
|
|
42
|
+
400: 'Regular',
|
|
43
|
+
500: 'Medium',
|
|
44
|
+
600: 'SemiBold',
|
|
45
|
+
700: 'Bold',
|
|
46
|
+
800: 'ExtraBold',
|
|
47
|
+
900: 'Black',
|
|
48
|
+
normal: 'Regular',
|
|
49
|
+
bold: 'Bold',
|
|
50
|
+
};
|
|
51
|
+
|
|
37
52
|
const FontStyle: { [key: string]: string } = {
|
|
38
53
|
italic: 'Italic',
|
|
39
54
|
normal: '',
|
|
@@ -104,6 +119,10 @@ const TypoStyles = (
|
|
|
104
119
|
fontFamily = `${font}-${AlegreyaSans[fontWeight]}${style}`;
|
|
105
120
|
break;
|
|
106
121
|
}
|
|
122
|
+
case 'BarlowCondensed': {
|
|
123
|
+
fontFamily = `${font}-${BarlowCondensed[fontWeight]}${style}`;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
107
126
|
case 'Montserrat-Bold':
|
|
108
127
|
case 'iCielPanton-Black':
|
|
109
128
|
case 'iCielBCCubano-Normal':
|
|
@@ -175,6 +194,8 @@ const Text: React.FC<TextProps> = ({
|
|
|
175
194
|
textStyle,
|
|
176
195
|
{
|
|
177
196
|
color: color ?? theme.colors.text.default,
|
|
197
|
+
borderWidth: 1,
|
|
198
|
+
borderColor: Colors.green_06,
|
|
178
199
|
},
|
|
179
200
|
]}
|
|
180
201
|
>
|