@hero-design/rn 7.1.3-alpha → 7.1.3-alpha4
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/assets/fonts/be-vietnam-pro-light.ttf +0 -0
- package/assets/fonts/be-vietnam-pro-regular.ttf +0 -0
- package/assets/fonts/be-vietnam-pro-semibold.ttf +0 -0
- package/es/index.js +96 -38
- package/lib/index.js +95 -37
- package/package.json +1 -1
- package/playground/components/Card.tsx +1 -1
- package/playground/components/Typography.tsx +2 -2
- package/playground/index.tsx +13 -6
- package/src/components/Badge/StyledBadge.tsx +1 -1
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +4 -4
- package/src/components/BottomNavigation/__tests__/__snapshots__/BottomNavigation.spec.tsx.snap +4 -4
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -1
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +1 -1
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +24 -24
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/FAB/__tests__/__snapshots__/StyledFABContainer.spec.tsx.snap +1 -1
- package/src/components/Typography/Text/StyledText.tsx +3 -3
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +9 -9
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +13 -14
- package/src/theme/components/badge.ts +5 -5
- package/src/theme/components/fab.ts +6 -6
- package/src/theme/components/typography.ts +7 -7
- package/src/theme/global/index.ts +2 -2
- package/src/theme/global/typography.ts +7 -8
- package/src/utils/scale.ts +68 -5
- package/types/src/theme/components/badge.d.ts +3 -3
- package/types/src/theme/components/fab.d.ts +4 -4
- package/types/src/theme/components/typography.d.ts +5 -5
- package/types/src/theme/global/index.d.ts +5 -6
- package/types/src/theme/global/typography.d.ts +6 -7
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useMemo, createElement, useRef, useEffect } from 'react';
|
|
2
|
-
import require$$0$1, { Dimensions, View, Text as Text$1, Platform, TouchableWithoutFeedback, Animated, StyleSheet as StyleSheet$1, TouchableHighlight, TouchableOpacity } from 'react-native';
|
|
2
|
+
import require$$0$1, { PixelRatio, Dimensions, View, Text as Text$1, Platform, TouchableWithoutFeedback, Animated, StyleSheet as StyleSheet$1, TouchableHighlight, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -9875,13 +9875,72 @@ var systemPalette = {
|
|
|
9875
9875
|
|
|
9876
9876
|
var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
9877
9877
|
|
|
9878
|
+
var pixelRatio = PixelRatio.get();
|
|
9879
|
+
var deviceHeight = Dimensions.get('window').height;
|
|
9880
|
+
var deviceWidth = Dimensions.get('window').width;
|
|
9878
9881
|
var scale = function scale(size) {
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
+
if (pixelRatio >= 2 && pixelRatio < 3) {
|
|
9883
|
+
// iphone 5s and older Androids
|
|
9884
|
+
if (deviceWidth < BASE_WIDTH) {
|
|
9885
|
+
return size * 0.95;
|
|
9886
|
+
} // iphone 5
|
|
9882
9887
|
|
|
9883
|
-
|
|
9884
|
-
|
|
9888
|
+
|
|
9889
|
+
if (deviceHeight < 667) {
|
|
9890
|
+
return size; // iphone 6-6s
|
|
9891
|
+
}
|
|
9892
|
+
|
|
9893
|
+
if (deviceHeight >= 667 && deviceHeight <= 735) {
|
|
9894
|
+
return size * 1.15;
|
|
9895
|
+
} // older phablets
|
|
9896
|
+
|
|
9897
|
+
|
|
9898
|
+
return size * 1.25;
|
|
9899
|
+
}
|
|
9900
|
+
|
|
9901
|
+
if (pixelRatio >= 3 && pixelRatio < 3.5) {
|
|
9902
|
+
// catch Android font scaling on small machines
|
|
9903
|
+
// where pixel ratio / font scale ratio => 3:3
|
|
9904
|
+
if (deviceWidth <= BASE_WIDTH) {
|
|
9905
|
+
return size;
|
|
9906
|
+
} // Catch other weird android width sizings
|
|
9907
|
+
|
|
9908
|
+
|
|
9909
|
+
if (deviceHeight < 667) {
|
|
9910
|
+
return size * 1.15; // catch in-between size Androids and scale font up
|
|
9911
|
+
// a tad but not too much
|
|
9912
|
+
}
|
|
9913
|
+
|
|
9914
|
+
if (deviceHeight >= 667 && deviceHeight <= 735) {
|
|
9915
|
+
return size * 1.2;
|
|
9916
|
+
} // catch larger devices
|
|
9917
|
+
// ie iphone 6s plus / 7 plus / mi note 等等
|
|
9918
|
+
|
|
9919
|
+
|
|
9920
|
+
return size * 1.27;
|
|
9921
|
+
}
|
|
9922
|
+
|
|
9923
|
+
if (pixelRatio >= 3.5) {
|
|
9924
|
+
// catch Android font scaling on small machines
|
|
9925
|
+
// where pixel ratio / font scale ratio => 3:3
|
|
9926
|
+
if (deviceWidth <= BASE_WIDTH) {
|
|
9927
|
+
return size; // Catch other smaller android height sizings
|
|
9928
|
+
}
|
|
9929
|
+
|
|
9930
|
+
if (deviceHeight < 667) {
|
|
9931
|
+
return size * 1.2; // catch in-between size Androids and scale font up
|
|
9932
|
+
// a tad but not too much
|
|
9933
|
+
}
|
|
9934
|
+
|
|
9935
|
+
if (deviceHeight >= 667 && deviceHeight <= 735) {
|
|
9936
|
+
return size * 1.25;
|
|
9937
|
+
} // catch larger phablet devices
|
|
9938
|
+
|
|
9939
|
+
|
|
9940
|
+
return size * 1.4;
|
|
9941
|
+
}
|
|
9942
|
+
|
|
9943
|
+
return size;
|
|
9885
9944
|
};
|
|
9886
9945
|
|
|
9887
9946
|
var BASE$1 = 8;
|
|
@@ -9898,6 +9957,11 @@ var space = {
|
|
|
9898
9957
|
};
|
|
9899
9958
|
|
|
9900
9959
|
var BASE = 16;
|
|
9960
|
+
var fonts = {
|
|
9961
|
+
light: 'Be Vietnam Pro Light',
|
|
9962
|
+
regular: 'Be Vietnam Pro Regular',
|
|
9963
|
+
semiBold: 'Be Vietnam Pro SemiBold'
|
|
9964
|
+
};
|
|
9901
9965
|
var fontSizes = {
|
|
9902
9966
|
xxxxxlarge: scale(BASE * 2),
|
|
9903
9967
|
xxxxlarge: scale(BASE * 1.75),
|
|
@@ -9910,12 +9974,6 @@ var fontSizes = {
|
|
|
9910
9974
|
xsmall: scale(BASE * 0.625) // 10
|
|
9911
9975
|
|
|
9912
9976
|
};
|
|
9913
|
-
var fontWeights = {
|
|
9914
|
-
light: 200,
|
|
9915
|
-
regular: 400,
|
|
9916
|
-
semiBold: 600,
|
|
9917
|
-
bold: 700
|
|
9918
|
-
};
|
|
9919
9977
|
var lineHeights = {
|
|
9920
9978
|
xxxxxlarge: fontSizes.xxxxxlarge + 8,
|
|
9921
9979
|
xxxxlarge: fontSizes.xxxxlarge + 8,
|
|
@@ -9935,8 +9993,8 @@ var borderWidths = {
|
|
|
9935
9993
|
var globalTheme = {
|
|
9936
9994
|
colors: _objectSpread2({}, systemPalette),
|
|
9937
9995
|
space: space,
|
|
9996
|
+
fonts: fonts,
|
|
9938
9997
|
fontSizes: fontSizes,
|
|
9939
|
-
fontWeights: fontWeights,
|
|
9940
9998
|
lineHeights: lineHeights,
|
|
9941
9999
|
borderWidths: borderWidths
|
|
9942
10000
|
};
|
|
@@ -9958,12 +10016,12 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
9958
10016
|
var padding = {
|
|
9959
10017
|
"default": "".concat(theme.space.xsmall, "px ").concat(theme.space.small, "px")
|
|
9960
10018
|
};
|
|
10019
|
+
var fonts = {
|
|
10020
|
+
"default": theme.fonts.semiBold
|
|
10021
|
+
};
|
|
9961
10022
|
var fontSizes = {
|
|
9962
10023
|
"default": "".concat(theme.fontSizes.small, "px")
|
|
9963
10024
|
};
|
|
9964
|
-
var fontWeights = {
|
|
9965
|
-
"default": theme.fontWeights.semiBold
|
|
9966
|
-
};
|
|
9967
10025
|
var radii = {
|
|
9968
10026
|
"default": "4px"
|
|
9969
10027
|
};
|
|
@@ -9971,8 +10029,8 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
9971
10029
|
borderWidths: borderWidths,
|
|
9972
10030
|
colors: colors,
|
|
9973
10031
|
padding: padding,
|
|
10032
|
+
fonts: fonts,
|
|
9974
10033
|
fontSizes: fontSizes,
|
|
9975
|
-
fontWeights: fontWeights,
|
|
9976
10034
|
radii: radii
|
|
9977
10035
|
};
|
|
9978
10036
|
};
|
|
@@ -10060,17 +10118,17 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
10060
10118
|
subdued: theme.colors.disabledText,
|
|
10061
10119
|
primary: theme.colors.primary
|
|
10062
10120
|
};
|
|
10121
|
+
var fonts = {
|
|
10122
|
+
light: theme.fonts.light,
|
|
10123
|
+
regular: theme.fonts.regular,
|
|
10124
|
+
semiBold: theme.fonts.semiBold
|
|
10125
|
+
};
|
|
10063
10126
|
var fontSizes = {
|
|
10064
10127
|
small: theme.fontSizes.small,
|
|
10065
10128
|
medium: theme.fontSizes.medium,
|
|
10066
10129
|
large: theme.fontSizes.large,
|
|
10067
10130
|
xlarge: theme.fontSizes.xlarge
|
|
10068
10131
|
};
|
|
10069
|
-
var fontWeights = {
|
|
10070
|
-
light: theme.fontWeights.light,
|
|
10071
|
-
regular: theme.fontWeights.regular,
|
|
10072
|
-
semiBold: theme.fontWeights.semiBold
|
|
10073
|
-
};
|
|
10074
10132
|
var lineHeights = {
|
|
10075
10133
|
small: "".concat(theme.lineHeights.small, "px"),
|
|
10076
10134
|
medium: "".concat(theme.lineHeights.medium, "px"),
|
|
@@ -10079,8 +10137,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
10079
10137
|
};
|
|
10080
10138
|
return {
|
|
10081
10139
|
colors: colors,
|
|
10140
|
+
fonts: fonts,
|
|
10082
10141
|
fontSizes: fontSizes,
|
|
10083
|
-
fontWeights: fontWeights,
|
|
10084
10142
|
lineHeights: lineHeights
|
|
10085
10143
|
};
|
|
10086
10144
|
};
|
|
@@ -10097,15 +10155,15 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
10097
10155
|
width: '64px',
|
|
10098
10156
|
height: '64px'
|
|
10099
10157
|
};
|
|
10158
|
+
var fonts = {
|
|
10159
|
+
header: theme.fonts.semiBold,
|
|
10160
|
+
actionItemText: theme.fonts.regular
|
|
10161
|
+
};
|
|
10100
10162
|
var fontSizes = {
|
|
10101
10163
|
header: "".concat(theme.fontSizes.xxxlarge, "px"),
|
|
10102
10164
|
buttonIcon: "".concat(theme.fontSizes.xxxlarge, "px"),
|
|
10103
10165
|
actionItemText: "".concat(theme.fontSizes.medium, "px")
|
|
10104
10166
|
};
|
|
10105
|
-
var fontWeights = {
|
|
10106
|
-
header: "".concat(theme.fontWeights.semiBold),
|
|
10107
|
-
actionItemText: "".concat(theme.fontWeights.regular)
|
|
10108
|
-
};
|
|
10109
10167
|
var lineHeights = {
|
|
10110
10168
|
header: "".concat(theme.lineHeights.xxxlarge, "px"),
|
|
10111
10169
|
actionItemText: "".concat(theme.lineHeights.medium, "px")
|
|
@@ -10126,11 +10184,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
10126
10184
|
};
|
|
10127
10185
|
return {
|
|
10128
10186
|
radii: radii,
|
|
10187
|
+
fonts: fonts,
|
|
10129
10188
|
fontSizes: fontSizes,
|
|
10130
10189
|
colors: colors,
|
|
10131
10190
|
sizes: sizes,
|
|
10132
10191
|
lineHeights: lineHeights,
|
|
10133
|
-
fontWeights: fontWeights,
|
|
10134
10192
|
space: space
|
|
10135
10193
|
};
|
|
10136
10194
|
};
|
|
@@ -10178,9 +10236,9 @@ var StyledView = styled(View)(_templateObject$9 || (_templateObject$9 = _taggedT
|
|
|
10178
10236
|
return theme.__hd__.badge.colors[BACKGROUND_INTENTS[themeIntent]];
|
|
10179
10237
|
});
|
|
10180
10238
|
});
|
|
10181
|
-
var StyledText$1 = styled(Text$1)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n font-
|
|
10239
|
+
var StyledText$1 = styled(Text$1)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n font-family: ", ";\n font-size: ", ";\n\n ", ";\n"])), function (_ref7) {
|
|
10182
10240
|
var theme = _ref7.theme;
|
|
10183
|
-
return theme.__hd__.badge.
|
|
10241
|
+
return theme.__hd__.badge.fonts["default"];
|
|
10184
10242
|
}, function (_ref8) {
|
|
10185
10243
|
var theme = _ref8.theme;
|
|
10186
10244
|
return theme.__hd__.badge.fontSizes["default"];
|
|
@@ -19900,13 +19958,13 @@ var StyledText = styled(Text$1)(_templateObject$7 || (_templateObject$7 = _tagge
|
|
|
19900
19958
|
|
|
19901
19959
|
switch (themeFontWeight) {
|
|
19902
19960
|
case 'light':
|
|
19903
|
-
return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-
|
|
19961
|
+
return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.light);
|
|
19904
19962
|
|
|
19905
19963
|
case 'regular':
|
|
19906
|
-
return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-
|
|
19964
|
+
return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.regular);
|
|
19907
19965
|
|
|
19908
19966
|
case 'semi-bold':
|
|
19909
|
-
return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-
|
|
19967
|
+
return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.semiBold);
|
|
19910
19968
|
}
|
|
19911
19969
|
}, function (_ref3) {
|
|
19912
19970
|
var themeIntent = _ref3.themeIntent,
|
|
@@ -20269,7 +20327,7 @@ var StyledActionItem = styled(TouchableOpacity)(_templateObject$1 || (_templateO
|
|
|
20269
20327
|
var theme = _ref8.theme;
|
|
20270
20328
|
return theme.__hd__.fab.radii.actionItem;
|
|
20271
20329
|
});
|
|
20272
|
-
var StyledActionItemText = styled(Typography.Text)(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding-left: ", ";\n font-size: ", ";\n line-height: ", ";\n font-
|
|
20330
|
+
var StyledActionItemText = styled(Typography.Text)(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding-left: ", ";\n font-size: ", ";\n line-height: ", ";\n font-family: ", ";\n"])), function (_ref9) {
|
|
20273
20331
|
var theme = _ref9.theme;
|
|
20274
20332
|
return theme.__hd__.fab.space.actionItemTextPaddingLeft;
|
|
20275
20333
|
}, function (_ref10) {
|
|
@@ -20280,7 +20338,7 @@ var StyledActionItemText = styled(Typography.Text)(_templateObject2$1 || (_templ
|
|
|
20280
20338
|
return theme.__hd__.fab.lineHeights.actionItemText;
|
|
20281
20339
|
}, function (_ref12) {
|
|
20282
20340
|
var theme = _ref12.theme;
|
|
20283
|
-
return theme.__hd__.fab.
|
|
20341
|
+
return theme.__hd__.fab.fonts.actionItemText;
|
|
20284
20342
|
});
|
|
20285
20343
|
|
|
20286
20344
|
var ActionItem = function ActionItem(_ref) {
|
|
@@ -20312,7 +20370,7 @@ var StyledBackdrop = styled(Animated.View)(_templateObject4 || (_templateObject4
|
|
|
20312
20370
|
var theme = _ref3.theme;
|
|
20313
20371
|
return theme.__hd__.fab.colors.backdropBackground;
|
|
20314
20372
|
});
|
|
20315
|
-
var StyledHeaderText = styled(Typography.Text)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: ", ";\n font-
|
|
20373
|
+
var StyledHeaderText = styled(Typography.Text)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: ", ";\n font-family: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n text-align: right;\n"])), function (_ref4) {
|
|
20316
20374
|
var theme = _ref4.theme;
|
|
20317
20375
|
return theme.__hd__.fab.fontSizes.header;
|
|
20318
20376
|
}, function (_ref5) {
|
|
@@ -20320,7 +20378,7 @@ var StyledHeaderText = styled(Typography.Text)(_templateObject5 || (_templateObj
|
|
|
20320
20378
|
return theme.__hd__.fab.lineHeights.header;
|
|
20321
20379
|
}, function (_ref6) {
|
|
20322
20380
|
var theme = _ref6.theme;
|
|
20323
|
-
return theme.__hd__.fab.
|
|
20381
|
+
return theme.__hd__.fab.fonts.header;
|
|
20324
20382
|
}, function (_ref7) {
|
|
20325
20383
|
var theme = _ref7.theme;
|
|
20326
20384
|
return theme.__hd__.fab.space.headerTextMarginRight;
|
|
@@ -20362,7 +20420,7 @@ var ActionGroup = function ActionGroup(_ref2) {
|
|
|
20362
20420
|
});
|
|
20363
20421
|
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
20364
20422
|
inputRange: [0, 1],
|
|
20365
|
-
outputRange: [0, 0.
|
|
20423
|
+
outputRange: [0, 0.9]
|
|
20366
20424
|
});
|
|
20367
20425
|
return /*#__PURE__*/React.createElement(StyledContainer, {
|
|
20368
20426
|
testID: testID,
|
package/lib/index.js
CHANGED
|
@@ -9884,13 +9884,72 @@ var systemPalette = {
|
|
|
9884
9884
|
|
|
9885
9885
|
var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
9886
9886
|
|
|
9887
|
+
var pixelRatio = require$$0$1.PixelRatio.get();
|
|
9888
|
+
var deviceHeight = require$$0$1.Dimensions.get('window').height;
|
|
9889
|
+
var deviceWidth = require$$0$1.Dimensions.get('window').width;
|
|
9887
9890
|
var scale = function scale(size) {
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
+
if (pixelRatio >= 2 && pixelRatio < 3) {
|
|
9892
|
+
// iphone 5s and older Androids
|
|
9893
|
+
if (deviceWidth < BASE_WIDTH) {
|
|
9894
|
+
return size * 0.95;
|
|
9895
|
+
} // iphone 5
|
|
9891
9896
|
|
|
9892
|
-
|
|
9893
|
-
|
|
9897
|
+
|
|
9898
|
+
if (deviceHeight < 667) {
|
|
9899
|
+
return size; // iphone 6-6s
|
|
9900
|
+
}
|
|
9901
|
+
|
|
9902
|
+
if (deviceHeight >= 667 && deviceHeight <= 735) {
|
|
9903
|
+
return size * 1.15;
|
|
9904
|
+
} // older phablets
|
|
9905
|
+
|
|
9906
|
+
|
|
9907
|
+
return size * 1.25;
|
|
9908
|
+
}
|
|
9909
|
+
|
|
9910
|
+
if (pixelRatio >= 3 && pixelRatio < 3.5) {
|
|
9911
|
+
// catch Android font scaling on small machines
|
|
9912
|
+
// where pixel ratio / font scale ratio => 3:3
|
|
9913
|
+
if (deviceWidth <= BASE_WIDTH) {
|
|
9914
|
+
return size;
|
|
9915
|
+
} // Catch other weird android width sizings
|
|
9916
|
+
|
|
9917
|
+
|
|
9918
|
+
if (deviceHeight < 667) {
|
|
9919
|
+
return size * 1.15; // catch in-between size Androids and scale font up
|
|
9920
|
+
// a tad but not too much
|
|
9921
|
+
}
|
|
9922
|
+
|
|
9923
|
+
if (deviceHeight >= 667 && deviceHeight <= 735) {
|
|
9924
|
+
return size * 1.2;
|
|
9925
|
+
} // catch larger devices
|
|
9926
|
+
// ie iphone 6s plus / 7 plus / mi note 等等
|
|
9927
|
+
|
|
9928
|
+
|
|
9929
|
+
return size * 1.27;
|
|
9930
|
+
}
|
|
9931
|
+
|
|
9932
|
+
if (pixelRatio >= 3.5) {
|
|
9933
|
+
// catch Android font scaling on small machines
|
|
9934
|
+
// where pixel ratio / font scale ratio => 3:3
|
|
9935
|
+
if (deviceWidth <= BASE_WIDTH) {
|
|
9936
|
+
return size; // Catch other smaller android height sizings
|
|
9937
|
+
}
|
|
9938
|
+
|
|
9939
|
+
if (deviceHeight < 667) {
|
|
9940
|
+
return size * 1.2; // catch in-between size Androids and scale font up
|
|
9941
|
+
// a tad but not too much
|
|
9942
|
+
}
|
|
9943
|
+
|
|
9944
|
+
if (deviceHeight >= 667 && deviceHeight <= 735) {
|
|
9945
|
+
return size * 1.25;
|
|
9946
|
+
} // catch larger phablet devices
|
|
9947
|
+
|
|
9948
|
+
|
|
9949
|
+
return size * 1.4;
|
|
9950
|
+
}
|
|
9951
|
+
|
|
9952
|
+
return size;
|
|
9894
9953
|
};
|
|
9895
9954
|
|
|
9896
9955
|
var BASE$1 = 8;
|
|
@@ -9907,6 +9966,11 @@ var space = {
|
|
|
9907
9966
|
};
|
|
9908
9967
|
|
|
9909
9968
|
var BASE = 16;
|
|
9969
|
+
var fonts = {
|
|
9970
|
+
light: 'Be Vietnam Pro Light',
|
|
9971
|
+
regular: 'Be Vietnam Pro Regular',
|
|
9972
|
+
semiBold: 'Be Vietnam Pro SemiBold'
|
|
9973
|
+
};
|
|
9910
9974
|
var fontSizes = {
|
|
9911
9975
|
xxxxxlarge: scale(BASE * 2),
|
|
9912
9976
|
xxxxlarge: scale(BASE * 1.75),
|
|
@@ -9919,12 +9983,6 @@ var fontSizes = {
|
|
|
9919
9983
|
xsmall: scale(BASE * 0.625) // 10
|
|
9920
9984
|
|
|
9921
9985
|
};
|
|
9922
|
-
var fontWeights = {
|
|
9923
|
-
light: 200,
|
|
9924
|
-
regular: 400,
|
|
9925
|
-
semiBold: 600,
|
|
9926
|
-
bold: 700
|
|
9927
|
-
};
|
|
9928
9986
|
var lineHeights = {
|
|
9929
9987
|
xxxxxlarge: fontSizes.xxxxxlarge + 8,
|
|
9930
9988
|
xxxxlarge: fontSizes.xxxxlarge + 8,
|
|
@@ -9944,8 +10002,8 @@ var borderWidths = {
|
|
|
9944
10002
|
var globalTheme = {
|
|
9945
10003
|
colors: _objectSpread2({}, systemPalette),
|
|
9946
10004
|
space: space,
|
|
10005
|
+
fonts: fonts,
|
|
9947
10006
|
fontSizes: fontSizes,
|
|
9948
|
-
fontWeights: fontWeights,
|
|
9949
10007
|
lineHeights: lineHeights,
|
|
9950
10008
|
borderWidths: borderWidths
|
|
9951
10009
|
};
|
|
@@ -9967,12 +10025,12 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
9967
10025
|
var padding = {
|
|
9968
10026
|
"default": "".concat(theme.space.xsmall, "px ").concat(theme.space.small, "px")
|
|
9969
10027
|
};
|
|
10028
|
+
var fonts = {
|
|
10029
|
+
"default": theme.fonts.semiBold
|
|
10030
|
+
};
|
|
9970
10031
|
var fontSizes = {
|
|
9971
10032
|
"default": "".concat(theme.fontSizes.small, "px")
|
|
9972
10033
|
};
|
|
9973
|
-
var fontWeights = {
|
|
9974
|
-
"default": theme.fontWeights.semiBold
|
|
9975
|
-
};
|
|
9976
10034
|
var radii = {
|
|
9977
10035
|
"default": "4px"
|
|
9978
10036
|
};
|
|
@@ -9980,8 +10038,8 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
9980
10038
|
borderWidths: borderWidths,
|
|
9981
10039
|
colors: colors,
|
|
9982
10040
|
padding: padding,
|
|
10041
|
+
fonts: fonts,
|
|
9983
10042
|
fontSizes: fontSizes,
|
|
9984
|
-
fontWeights: fontWeights,
|
|
9985
10043
|
radii: radii
|
|
9986
10044
|
};
|
|
9987
10045
|
};
|
|
@@ -10069,17 +10127,17 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
10069
10127
|
subdued: theme.colors.disabledText,
|
|
10070
10128
|
primary: theme.colors.primary
|
|
10071
10129
|
};
|
|
10130
|
+
var fonts = {
|
|
10131
|
+
light: theme.fonts.light,
|
|
10132
|
+
regular: theme.fonts.regular,
|
|
10133
|
+
semiBold: theme.fonts.semiBold
|
|
10134
|
+
};
|
|
10072
10135
|
var fontSizes = {
|
|
10073
10136
|
small: theme.fontSizes.small,
|
|
10074
10137
|
medium: theme.fontSizes.medium,
|
|
10075
10138
|
large: theme.fontSizes.large,
|
|
10076
10139
|
xlarge: theme.fontSizes.xlarge
|
|
10077
10140
|
};
|
|
10078
|
-
var fontWeights = {
|
|
10079
|
-
light: theme.fontWeights.light,
|
|
10080
|
-
regular: theme.fontWeights.regular,
|
|
10081
|
-
semiBold: theme.fontWeights.semiBold
|
|
10082
|
-
};
|
|
10083
10141
|
var lineHeights = {
|
|
10084
10142
|
small: "".concat(theme.lineHeights.small, "px"),
|
|
10085
10143
|
medium: "".concat(theme.lineHeights.medium, "px"),
|
|
@@ -10088,8 +10146,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
10088
10146
|
};
|
|
10089
10147
|
return {
|
|
10090
10148
|
colors: colors,
|
|
10149
|
+
fonts: fonts,
|
|
10091
10150
|
fontSizes: fontSizes,
|
|
10092
|
-
fontWeights: fontWeights,
|
|
10093
10151
|
lineHeights: lineHeights
|
|
10094
10152
|
};
|
|
10095
10153
|
};
|
|
@@ -10106,15 +10164,15 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
10106
10164
|
width: '64px',
|
|
10107
10165
|
height: '64px'
|
|
10108
10166
|
};
|
|
10167
|
+
var fonts = {
|
|
10168
|
+
header: theme.fonts.semiBold,
|
|
10169
|
+
actionItemText: theme.fonts.regular
|
|
10170
|
+
};
|
|
10109
10171
|
var fontSizes = {
|
|
10110
10172
|
header: "".concat(theme.fontSizes.xxxlarge, "px"),
|
|
10111
10173
|
buttonIcon: "".concat(theme.fontSizes.xxxlarge, "px"),
|
|
10112
10174
|
actionItemText: "".concat(theme.fontSizes.medium, "px")
|
|
10113
10175
|
};
|
|
10114
|
-
var fontWeights = {
|
|
10115
|
-
header: "".concat(theme.fontWeights.semiBold),
|
|
10116
|
-
actionItemText: "".concat(theme.fontWeights.regular)
|
|
10117
|
-
};
|
|
10118
10176
|
var lineHeights = {
|
|
10119
10177
|
header: "".concat(theme.lineHeights.xxxlarge, "px"),
|
|
10120
10178
|
actionItemText: "".concat(theme.lineHeights.medium, "px")
|
|
@@ -10135,11 +10193,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
10135
10193
|
};
|
|
10136
10194
|
return {
|
|
10137
10195
|
radii: radii,
|
|
10196
|
+
fonts: fonts,
|
|
10138
10197
|
fontSizes: fontSizes,
|
|
10139
10198
|
colors: colors,
|
|
10140
10199
|
sizes: sizes,
|
|
10141
10200
|
lineHeights: lineHeights,
|
|
10142
|
-
fontWeights: fontWeights,
|
|
10143
10201
|
space: space
|
|
10144
10202
|
};
|
|
10145
10203
|
};
|
|
@@ -10187,9 +10245,9 @@ var StyledView = styled(require$$0$1.View)(_templateObject$9 || (_templateObject
|
|
|
10187
10245
|
return theme.__hd__.badge.colors[BACKGROUND_INTENTS[themeIntent]];
|
|
10188
10246
|
});
|
|
10189
10247
|
});
|
|
10190
|
-
var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n font-
|
|
10248
|
+
var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n font-family: ", ";\n font-size: ", ";\n\n ", ";\n"])), function (_ref7) {
|
|
10191
10249
|
var theme = _ref7.theme;
|
|
10192
|
-
return theme.__hd__.badge.
|
|
10250
|
+
return theme.__hd__.badge.fonts["default"];
|
|
10193
10251
|
}, function (_ref8) {
|
|
10194
10252
|
var theme = _ref8.theme;
|
|
10195
10253
|
return theme.__hd__.badge.fontSizes["default"];
|
|
@@ -19909,13 +19967,13 @@ var StyledText = styled(require$$0$1.Text)(_templateObject$7 || (_templateObject
|
|
|
19909
19967
|
|
|
19910
19968
|
switch (themeFontWeight) {
|
|
19911
19969
|
case 'light':
|
|
19912
|
-
return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-
|
|
19970
|
+
return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.light);
|
|
19913
19971
|
|
|
19914
19972
|
case 'regular':
|
|
19915
|
-
return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-
|
|
19973
|
+
return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.regular);
|
|
19916
19974
|
|
|
19917
19975
|
case 'semi-bold':
|
|
19918
|
-
return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-
|
|
19976
|
+
return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.semiBold);
|
|
19919
19977
|
}
|
|
19920
19978
|
}, function (_ref3) {
|
|
19921
19979
|
var themeIntent = _ref3.themeIntent,
|
|
@@ -20278,7 +20336,7 @@ var StyledActionItem = styled(require$$0$1.TouchableOpacity)(_templateObject$1 |
|
|
|
20278
20336
|
var theme = _ref8.theme;
|
|
20279
20337
|
return theme.__hd__.fab.radii.actionItem;
|
|
20280
20338
|
});
|
|
20281
|
-
var StyledActionItemText = styled(Typography.Text)(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding-left: ", ";\n font-size: ", ";\n line-height: ", ";\n font-
|
|
20339
|
+
var StyledActionItemText = styled(Typography.Text)(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding-left: ", ";\n font-size: ", ";\n line-height: ", ";\n font-family: ", ";\n"])), function (_ref9) {
|
|
20282
20340
|
var theme = _ref9.theme;
|
|
20283
20341
|
return theme.__hd__.fab.space.actionItemTextPaddingLeft;
|
|
20284
20342
|
}, function (_ref10) {
|
|
@@ -20289,7 +20347,7 @@ var StyledActionItemText = styled(Typography.Text)(_templateObject2$1 || (_templ
|
|
|
20289
20347
|
return theme.__hd__.fab.lineHeights.actionItemText;
|
|
20290
20348
|
}, function (_ref12) {
|
|
20291
20349
|
var theme = _ref12.theme;
|
|
20292
|
-
return theme.__hd__.fab.
|
|
20350
|
+
return theme.__hd__.fab.fonts.actionItemText;
|
|
20293
20351
|
});
|
|
20294
20352
|
|
|
20295
20353
|
var ActionItem = function ActionItem(_ref) {
|
|
@@ -20321,7 +20379,7 @@ var StyledBackdrop = styled(require$$0$1.Animated.View)(_templateObject4 || (_te
|
|
|
20321
20379
|
var theme = _ref3.theme;
|
|
20322
20380
|
return theme.__hd__.fab.colors.backdropBackground;
|
|
20323
20381
|
});
|
|
20324
|
-
var StyledHeaderText = styled(Typography.Text)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: ", ";\n font-
|
|
20382
|
+
var StyledHeaderText = styled(Typography.Text)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: ", ";\n font-family: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n text-align: right;\n"])), function (_ref4) {
|
|
20325
20383
|
var theme = _ref4.theme;
|
|
20326
20384
|
return theme.__hd__.fab.fontSizes.header;
|
|
20327
20385
|
}, function (_ref5) {
|
|
@@ -20329,7 +20387,7 @@ var StyledHeaderText = styled(Typography.Text)(_templateObject5 || (_templateObj
|
|
|
20329
20387
|
return theme.__hd__.fab.lineHeights.header;
|
|
20330
20388
|
}, function (_ref6) {
|
|
20331
20389
|
var theme = _ref6.theme;
|
|
20332
|
-
return theme.__hd__.fab.
|
|
20390
|
+
return theme.__hd__.fab.fonts.header;
|
|
20333
20391
|
}, function (_ref7) {
|
|
20334
20392
|
var theme = _ref7.theme;
|
|
20335
20393
|
return theme.__hd__.fab.space.headerTextMarginRight;
|
|
@@ -20371,7 +20429,7 @@ var ActionGroup = function ActionGroup(_ref2) {
|
|
|
20371
20429
|
});
|
|
20372
20430
|
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
20373
20431
|
inputRange: [0, 1],
|
|
20374
|
-
outputRange: [0, 0.
|
|
20432
|
+
outputRange: [0, 0.9]
|
|
20375
20433
|
});
|
|
20376
20434
|
return /*#__PURE__*/React__default["default"].createElement(StyledContainer, {
|
|
20377
20435
|
testID: testID,
|
package/package.json
CHANGED
|
@@ -245,7 +245,7 @@ const MyLeaveCard = (props: ViewProps) => {
|
|
|
245
245
|
};
|
|
246
246
|
|
|
247
247
|
const CardPlayground = () => (
|
|
248
|
-
<ScrollView
|
|
248
|
+
<ScrollView contentContainerStyle={{ padding: theme.space.medium }}>
|
|
249
249
|
<View style={{ flexDirection: 'row', height: scale(216) }}>
|
|
250
250
|
<View style={{ flex: 1, marginRight: theme.space.medium }}>
|
|
251
251
|
<InductionCard
|
|
@@ -12,9 +12,9 @@ const TypographyPlayground = () => {
|
|
|
12
12
|
</Typography.Text>
|
|
13
13
|
<Typography.Text fontSize="large">This is a subtitle</Typography.Text>
|
|
14
14
|
<Typography.Text>This is a 2nd subtitle</Typography.Text>
|
|
15
|
-
<Typography.Text>This is body text</Typography.Text>
|
|
15
|
+
<Typography.Text fontWeight="light">This is body text</Typography.Text>
|
|
16
16
|
<Typography.Text intent="subdued" fontWeight="light">
|
|
17
|
-
This is
|
|
17
|
+
This is subdued text
|
|
18
18
|
</Typography.Text>
|
|
19
19
|
</View>
|
|
20
20
|
);
|
package/playground/index.tsx
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
NativeStackScreenProps,
|
|
7
7
|
} from '@react-navigation/native-stack';
|
|
8
8
|
import { useFonts } from 'expo-font';
|
|
9
|
-
import { SafeAreaView, FlatList
|
|
10
|
-
import { ThemeProvider, theme, useTheme } from '../src/index';
|
|
9
|
+
import { SafeAreaView, FlatList } from 'react-native';
|
|
10
|
+
import { ThemeProvider, theme, useTheme, Typography } from '../src/index';
|
|
11
11
|
import BadgePlayground from './components/Badge';
|
|
12
12
|
import BottomNavigation from './components/BottomNavigation';
|
|
13
13
|
import CardPlayground from './components/Card';
|
|
@@ -17,6 +17,9 @@ import TypographyPlayground from './components/Typography';
|
|
|
17
17
|
import FABPlayground from './components/FAB';
|
|
18
18
|
|
|
19
19
|
const heroIconFontPath = require('../assets/fonts/hero-icons.ttf');
|
|
20
|
+
const beVietnamProLightFont = require('../assets/fonts/be-vietnam-pro-light.ttf');
|
|
21
|
+
const beVietnamProRegularFont = require('../assets/fonts/be-vietnam-pro-regular.ttf');
|
|
22
|
+
const beVietnamProSemiBoldFont = require('../assets/fonts/be-vietnam-pro-semibold.ttf');
|
|
20
23
|
|
|
21
24
|
type RootStackParamList = {
|
|
22
25
|
Home: undefined;
|
|
@@ -52,15 +55,15 @@ const ComponentItem = ({
|
|
|
52
55
|
}) => {
|
|
53
56
|
const hdTheme = useTheme();
|
|
54
57
|
return (
|
|
55
|
-
<Text
|
|
58
|
+
<Typography.Text
|
|
59
|
+
fontSize="large"
|
|
56
60
|
onPress={onPress}
|
|
57
61
|
style={{
|
|
58
|
-
marginTop: hdTheme.space.
|
|
59
|
-
fontSize: hdTheme.fontSizes.large,
|
|
62
|
+
marginTop: hdTheme.space.medium,
|
|
60
63
|
}}
|
|
61
64
|
>
|
|
62
65
|
{name}
|
|
63
|
-
</Text>
|
|
66
|
+
</Typography.Text>
|
|
64
67
|
);
|
|
65
68
|
};
|
|
66
69
|
|
|
@@ -93,7 +96,11 @@ const App = () => {
|
|
|
93
96
|
|
|
94
97
|
const [fontsLoaded] = useFonts({
|
|
95
98
|
'hero-icons': heroIconFontPath,
|
|
99
|
+
'Be Vietnam Pro Light': beVietnamProLightFont,
|
|
100
|
+
'Be Vietnam Pro Regular': beVietnamProRegularFont,
|
|
101
|
+
'Be Vietnam Pro SemiBold': beVietnamProSemiBoldFont,
|
|
96
102
|
});
|
|
103
|
+
|
|
97
104
|
if (!fontsLoaded) {
|
|
98
105
|
return null;
|
|
99
106
|
}
|
|
@@ -23,7 +23,7 @@ const StyledView = styled(View)<{ themeIntent: ThemeIntent }>`
|
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
25
|
const StyledText = styled(Text)<{ themeIntent: ThemeIntent }>`
|
|
26
|
-
font-
|
|
26
|
+
font-family: ${({ theme }) => theme.__hd__.badge.fonts.default};
|
|
27
27
|
font-size: ${({ theme }) => theme.__hd__.badge.fontSizes.default};
|
|
28
28
|
|
|
29
29
|
${({ themeIntent }) => css`
|