@hero-design/rn 7.0.4 → 7.1.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/.expo/packager-info.json +1 -1
- package/babel.config.js +1 -1
- package/es/index.js +170 -49
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +169 -46
- package/package.json +6 -4
- package/playground/components/Card.tsx +75 -92
- package/playground/components/FAB.tsx +49 -0
- package/playground/index.tsx +3 -1
- package/rollup.config.js +11 -2
- package/src/components/Badge/index.tsx +12 -6
- package/src/components/Card/__tests__/__snapshots__/Card.spec.tsx.snap +4 -4
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +4 -4
- package/src/components/Card/index.tsx +16 -3
- package/src/components/Divider/StyledDivider.tsx +1 -1
- package/src/components/Divider/index.tsx +20 -2
- package/src/components/FAB/AnimatedFABIcon.tsx +47 -0
- package/src/components/FAB/StyledFABContainer.tsx +14 -0
- package/src/components/FAB/StyledFABIcon.tsx +9 -0
- package/src/components/FAB/__tests__/AnimatedFABIcon.spec.tsx +20 -0
- package/src/components/FAB/__tests__/StyledFABContainer.spec.tsx +18 -0
- package/src/components/FAB/__tests__/StyledFABIcon.spec.tsx +16 -0
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +71 -0
- package/src/components/FAB/__tests__/__snapshots__/StyledFABContainer.spec.tsx.snap +46 -0
- package/src/components/FAB/__tests__/__snapshots__/StyledFABIcon.spec.tsx.snap +21 -0
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +120 -0
- package/src/components/FAB/__tests__/index.spec.tsx +58 -0
- package/src/components/FAB/index.tsx +56 -0
- package/src/components/Icon/index.tsx +8 -8
- package/src/components/Typography/Text/{__test__ → __tests__}/StyledText.spec.tsx +0 -0
- package/src/components/Typography/Text/{__test__ → __tests__}/__snapshots__/StyledText.spec.tsx.snap +0 -0
- package/src/components/Typography/Text/{__test__ → __tests__}/index.spec.tsx +0 -0
- package/src/components/Typography/Text/index.tsx +13 -1
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +15 -2
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/divider.ts +2 -2
- package/src/theme/components/fab.ts +21 -0
- package/src/theme/global/space.ts +11 -9
- package/src/theme/global/typography.ts +11 -9
- package/src/theme/index.ts +3 -0
- package/src/utils/__tests__/scale.spec.ts +26 -0
- package/src/utils/scale.ts +10 -0
- package/testUtils/setup.ts +4 -0
- package/types/components/Card/StyledCard.d.ts +3 -0
- package/types/components/Card/__tests__/Card.spec.d.ts +1 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
- package/types/components/Card/index.d.ts +5 -0
- package/types/components/Divider/StyledDivider.d.ts +7 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
- package/types/components/Divider/index.d.ts +12 -0
- package/types/index.d.ts +4 -3
- package/types/playground/components/FAB.d.ts +2 -0
- package/types/src/components/Badge/index.d.ts +6 -6
- package/types/src/components/Card/index.d.ts +14 -1
- package/types/src/components/Divider/index.d.ts +11 -2
- package/types/src/components/FAB/AnimatedFABIcon.d.ts +6 -0
- package/types/src/components/FAB/StyledFABContainer.d.ts +3 -0
- package/types/src/components/FAB/StyledFABIcon.d.ts +3 -0
- package/types/src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +1 -0
- package/types/src/components/FAB/__tests__/StyledFABContainer.spec.d.ts +1 -0
- package/types/src/components/FAB/__tests__/StyledFABIcon.spec.d.ts +1 -0
- package/types/src/components/FAB/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/FAB/index.d.ts +30 -0
- package/types/src/components/Icon/index.d.ts +8 -8
- package/types/src/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
- package/types/src/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Typography/Text/index.d.ts +9 -1
- package/types/src/index.d.ts +3 -1
- package/types/src/theme/components/divider.d.ts +1 -1
- package/types/src/theme/components/fab.d.ts +15 -0
- package/types/src/theme/index.d.ts +2 -0
- package/types/src/utils/__tests__/scale.spec.d.ts +1 -0
- package/types/src/utils/scale.d.ts +2 -0
- package/types/theme/__tests__/index.spec.d.ts +1 -0
- package/types/theme/components/card.d.ts +10 -0
- package/types/theme/components/divider.d.ts +17 -0
- package/types/theme/global/borders.d.ts +4 -0
- package/types/theme/global/colors.d.ts +2 -0
- package/types/theme/global/index.d.ts +5 -0
- package/types/theme/index.d.ts +4 -2
- package/types/theme/colors.d.ts +0 -24
- package/types/theme/components/demoStyle.d.ts +0 -11
- package/types/theme/space.d.ts +0 -12
- package/types/theme/typography.d.ts +0 -21
package/.expo/packager-info.json
CHANGED
package/babel.config.js
CHANGED
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useContext, useMemo, createElement } from 'react';
|
|
2
|
-
import require$$0$1, { View, Text as Text$1 } from 'react-native';
|
|
1
|
+
import React, { useContext, useMemo, createElement, useRef, useEffect } from 'react';
|
|
2
|
+
import require$$0$1, { Dimensions, View, Text as Text$1, Animated, StyleSheet as StyleSheet$1, TouchableHighlight } from 'react-native';
|
|
3
3
|
|
|
4
4
|
function ownKeys(object, enumerableOnly) {
|
|
5
5
|
var keys = Object.keys(object);
|
|
@@ -8130,7 +8130,7 @@ Processor$1["default"] = Processor$1;
|
|
|
8130
8130
|
Root$2.registerProcessor(Processor$1);
|
|
8131
8131
|
Document$1.registerProcessor(Processor$1);
|
|
8132
8132
|
|
|
8133
|
-
var _excluded$
|
|
8133
|
+
var _excluded$4 = ["inputs"],
|
|
8134
8134
|
_excluded2 = ["inputId"];
|
|
8135
8135
|
|
|
8136
8136
|
var Declaration$1 = declaration;
|
|
@@ -8147,7 +8147,7 @@ function fromJSON$1(json, inputs) {
|
|
|
8147
8147
|
});
|
|
8148
8148
|
|
|
8149
8149
|
var ownInputs = json.inputs,
|
|
8150
|
-
defaults = _objectWithoutProperties$1(json, _excluded$
|
|
8150
|
+
defaults = _objectWithoutProperties$1(json, _excluded$4);
|
|
8151
8151
|
|
|
8152
8152
|
if (ownInputs) {
|
|
8153
8153
|
inputs = [];
|
|
@@ -9780,6 +9780,7 @@ var palette = {
|
|
|
9780
9780
|
greenDark30: '#017d6d',
|
|
9781
9781
|
greenDark75: '#002d27',
|
|
9782
9782
|
greenLight30: '#4dcaba',
|
|
9783
|
+
greenLight75: '#c0ece6',
|
|
9783
9784
|
greenLight90: '#e6f7f5',
|
|
9784
9785
|
grey: '#a3a6ac',
|
|
9785
9786
|
greyDark15: '#8b8d92',
|
|
@@ -9819,6 +9820,7 @@ var palette = {
|
|
|
9819
9820
|
redDark15: '#bd2d09',
|
|
9820
9821
|
redDark30: '#9b2508',
|
|
9821
9822
|
redDark75: '#380d03',
|
|
9823
|
+
redLight15: '#e35330',
|
|
9822
9824
|
redLight30: '#e87254',
|
|
9823
9825
|
redLight60: '#f2ae9d',
|
|
9824
9826
|
redLight75: '#f7cdc2',
|
|
@@ -9870,30 +9872,41 @@ var systemPalette = {
|
|
|
9870
9872
|
outline: palette.greyLight60
|
|
9871
9873
|
};
|
|
9872
9874
|
|
|
9875
|
+
var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
9876
|
+
|
|
9877
|
+
var scale = function scale(size) {
|
|
9878
|
+
var _Dimensions$get = Dimensions.get('window'),
|
|
9879
|
+
width = _Dimensions$get.width,
|
|
9880
|
+
height = _Dimensions$get.height;
|
|
9881
|
+
|
|
9882
|
+
var shortDimension = width < height ? width : height;
|
|
9883
|
+
return shortDimension / BASE_WIDTH * size;
|
|
9884
|
+
};
|
|
9885
|
+
|
|
9873
9886
|
var BASE$1 = 8;
|
|
9874
9887
|
var space = {
|
|
9875
|
-
xxsmall: BASE$1 * 0.25,
|
|
9876
|
-
xsmall: BASE$1 * 0.5,
|
|
9877
|
-
small: BASE$1,
|
|
9878
|
-
medium: BASE$1 * 2,
|
|
9879
|
-
large: BASE$1 * 3,
|
|
9880
|
-
xlarge: BASE$1 * 4,
|
|
9881
|
-
xxlarge: BASE$1 * 5,
|
|
9882
|
-
xxxlarge: BASE$1 * 6,
|
|
9883
|
-
xxxxlarge: BASE$1 * 7
|
|
9888
|
+
xxsmall: scale(BASE$1 * 0.25),
|
|
9889
|
+
xsmall: scale(BASE$1 * 0.5),
|
|
9890
|
+
small: scale(BASE$1),
|
|
9891
|
+
medium: scale(BASE$1 * 2),
|
|
9892
|
+
large: scale(BASE$1 * 3),
|
|
9893
|
+
xlarge: scale(BASE$1 * 4),
|
|
9894
|
+
xxlarge: scale(BASE$1 * 5),
|
|
9895
|
+
xxxlarge: scale(BASE$1 * 6),
|
|
9896
|
+
xxxxlarge: scale(BASE$1 * 7)
|
|
9884
9897
|
};
|
|
9885
9898
|
|
|
9886
9899
|
var BASE = 16;
|
|
9887
9900
|
var fontSizes = {
|
|
9888
|
-
xxxxxlarge: BASE * 2,
|
|
9889
|
-
xxxxlarge: BASE * 1.75,
|
|
9890
|
-
xxxlarge: BASE * 1.5,
|
|
9891
|
-
xxlarge: BASE * 1.25,
|
|
9892
|
-
xlarge: BASE * 1.125,
|
|
9893
|
-
large: BASE,
|
|
9894
|
-
medium: BASE * 0.875,
|
|
9895
|
-
small: BASE * 0.75,
|
|
9896
|
-
xsmall: BASE * 0.625 //
|
|
9901
|
+
xxxxxlarge: scale(BASE * 2),
|
|
9902
|
+
xxxxlarge: scale(BASE * 1.75),
|
|
9903
|
+
xxxlarge: scale(BASE * 1.5),
|
|
9904
|
+
xxlarge: scale(BASE * 1.25),
|
|
9905
|
+
xlarge: scale(BASE * 1.125),
|
|
9906
|
+
large: scale(BASE),
|
|
9907
|
+
medium: scale(BASE * 0.875),
|
|
9908
|
+
small: scale(BASE * 0.75),
|
|
9909
|
+
xsmall: scale(BASE * 0.625) // 10
|
|
9897
9910
|
|
|
9898
9911
|
};
|
|
9899
9912
|
var fontWeights = {
|
|
@@ -9964,7 +9977,7 @@ var getCardTheme = function getCardTheme(theme) {
|
|
|
9964
9977
|
"default": "12px"
|
|
9965
9978
|
};
|
|
9966
9979
|
var padding = {
|
|
9967
|
-
"default": "".concat(theme.space.
|
|
9980
|
+
"default": "".concat(theme.space.small, "px")
|
|
9968
9981
|
};
|
|
9969
9982
|
return {
|
|
9970
9983
|
radii: radii,
|
|
@@ -9983,13 +9996,13 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
9983
9996
|
large: "".concat(theme.space.large, "px"),
|
|
9984
9997
|
xlarge: "".concat(theme.space.xlarge, "px")
|
|
9985
9998
|
};
|
|
9986
|
-
var
|
|
9999
|
+
var borderWidths = {
|
|
9987
10000
|
"default": "".concat(theme.borderWidths.base, "px")
|
|
9988
10001
|
};
|
|
9989
10002
|
return {
|
|
9990
10003
|
colors: colors,
|
|
9991
10004
|
space: space,
|
|
9992
|
-
|
|
10005
|
+
borderWidths: borderWidths
|
|
9993
10006
|
};
|
|
9994
10007
|
};
|
|
9995
10008
|
|
|
@@ -10045,6 +10058,25 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
10045
10058
|
};
|
|
10046
10059
|
};
|
|
10047
10060
|
|
|
10061
|
+
var getFABTheme = function getFABTheme(theme) {
|
|
10062
|
+
var colors = {
|
|
10063
|
+
buttonBackground: theme.colors.backgroundDark,
|
|
10064
|
+
icon: theme.colors.invertedText
|
|
10065
|
+
};
|
|
10066
|
+
var sizes = {
|
|
10067
|
+
width: '64px',
|
|
10068
|
+
height: '64px'
|
|
10069
|
+
};
|
|
10070
|
+
var fontSizes = {
|
|
10071
|
+
"default": "".concat(theme.fontSizes.xxxxlarge, "px")
|
|
10072
|
+
};
|
|
10073
|
+
return {
|
|
10074
|
+
fontSizes: fontSizes,
|
|
10075
|
+
colors: colors,
|
|
10076
|
+
sizes: sizes
|
|
10077
|
+
};
|
|
10078
|
+
};
|
|
10079
|
+
|
|
10048
10080
|
var getTheme = function getTheme() {
|
|
10049
10081
|
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalTheme;
|
|
10050
10082
|
return _objectSpread2(_objectSpread2({}, theme), {}, {
|
|
@@ -10053,21 +10085,22 @@ var getTheme = function getTheme() {
|
|
|
10053
10085
|
card: getCardTheme(theme),
|
|
10054
10086
|
divider: getDividerTheme(theme),
|
|
10055
10087
|
icon: getIconTheme(theme),
|
|
10056
|
-
typography: getTypographyTheme(theme)
|
|
10088
|
+
typography: getTypographyTheme(theme),
|
|
10089
|
+
fab: getFABTheme(theme)
|
|
10057
10090
|
}
|
|
10058
10091
|
});
|
|
10059
10092
|
};
|
|
10060
10093
|
|
|
10061
10094
|
var theme = getTheme();
|
|
10062
10095
|
|
|
10063
|
-
var _templateObject$
|
|
10096
|
+
var _templateObject$6, _templateObject2$3, _templateObject3$2, _templateObject4$2;
|
|
10064
10097
|
var BACKGROUND_INTENTS = {
|
|
10065
10098
|
success: 'successBackground',
|
|
10066
10099
|
warning: 'warningBackground',
|
|
10067
10100
|
danger: 'dangerBackground',
|
|
10068
10101
|
info: 'infoBackground'
|
|
10069
10102
|
};
|
|
10070
|
-
var StyledView = styled(View)(_templateObject$
|
|
10103
|
+
var StyledView = styled(View)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n\n ", ";\n"])), function (_ref) {
|
|
10071
10104
|
var theme = _ref.theme;
|
|
10072
10105
|
return theme.__hd__.badge.borderWidths["default"];
|
|
10073
10106
|
}, function (_ref2) {
|
|
@@ -10100,23 +10133,27 @@ var StyledText$1 = styled(Text$1)(_templateObject3$2 || (_templateObject3$2 = _t
|
|
|
10100
10133
|
});
|
|
10101
10134
|
});
|
|
10102
10135
|
|
|
10136
|
+
var _excluded$3 = ["content", "intent", "style", "testID"];
|
|
10137
|
+
|
|
10103
10138
|
var Badge = function Badge(_ref) {
|
|
10104
10139
|
var content = _ref.content,
|
|
10105
10140
|
_ref$intent = _ref.intent,
|
|
10106
10141
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
10107
10142
|
style = _ref.style,
|
|
10108
|
-
testID = _ref.testID
|
|
10109
|
-
|
|
10110
|
-
|
|
10143
|
+
testID = _ref.testID,
|
|
10144
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
10145
|
+
|
|
10146
|
+
return /*#__PURE__*/React.createElement(StyledView, _extends$1({
|
|
10111
10147
|
themeIntent: intent,
|
|
10112
|
-
style: style
|
|
10113
|
-
|
|
10148
|
+
style: style,
|
|
10149
|
+
testID: testID
|
|
10150
|
+
}, nativeProps), /*#__PURE__*/React.createElement(StyledText$1, {
|
|
10114
10151
|
themeIntent: intent
|
|
10115
10152
|
}, content));
|
|
10116
10153
|
};
|
|
10117
10154
|
|
|
10118
|
-
var _templateObject$
|
|
10119
|
-
var StyledCard = styled(View)(_templateObject$
|
|
10155
|
+
var _templateObject$5;
|
|
10156
|
+
var StyledCard = styled(View)(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n border-radius: ", ";\n padding: ", ";\n"])), function (_ref) {
|
|
10120
10157
|
var theme = _ref.theme;
|
|
10121
10158
|
return theme.__hd__.card.radii["default"];
|
|
10122
10159
|
}, function (_ref2) {
|
|
@@ -10128,10 +10165,10 @@ var Card = function Card(props) {
|
|
|
10128
10165
|
return /*#__PURE__*/React.createElement(StyledCard, props);
|
|
10129
10166
|
};
|
|
10130
10167
|
|
|
10131
|
-
var _templateObject$
|
|
10132
|
-
var StyledDivider = styled(View)(_templateObject$
|
|
10168
|
+
var _templateObject$4, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11, _templateObject12, _templateObject13;
|
|
10169
|
+
var StyledDivider = styled(View)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n max-width: 100%;\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
10133
10170
|
var theme = _ref.theme;
|
|
10134
|
-
return theme.__hd__.divider.
|
|
10171
|
+
return theme.__hd__.divider.borderWidths["default"];
|
|
10135
10172
|
}, function (_ref2) {
|
|
10136
10173
|
var theme = _ref2.theme;
|
|
10137
10174
|
return theme.__hd__.divider.colors["default"];
|
|
@@ -10183,13 +10220,21 @@ var StyledDivider = styled(View)(_templateObject$2 || (_templateObject$2 = _tagg
|
|
|
10183
10220
|
}
|
|
10184
10221
|
});
|
|
10185
10222
|
|
|
10223
|
+
var _excluded$2 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
10224
|
+
|
|
10186
10225
|
var Divider = function Divider(_ref) {
|
|
10187
10226
|
var marginHorizontal = _ref.marginHorizontal,
|
|
10188
|
-
marginVertical = _ref.marginVertical
|
|
10189
|
-
|
|
10227
|
+
marginVertical = _ref.marginVertical,
|
|
10228
|
+
style = _ref.style,
|
|
10229
|
+
testID = _ref.testID,
|
|
10230
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
10231
|
+
|
|
10232
|
+
return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({
|
|
10190
10233
|
themeMarginHorizontal: marginHorizontal,
|
|
10191
|
-
themeMarginVertical: marginVertical
|
|
10192
|
-
|
|
10234
|
+
themeMarginVertical: marginVertical,
|
|
10235
|
+
style: style,
|
|
10236
|
+
testID: testID
|
|
10237
|
+
}, nativeProps));
|
|
10193
10238
|
};
|
|
10194
10239
|
|
|
10195
10240
|
var dist = {};
|
|
@@ -19820,9 +19865,9 @@ var heroIconConfig = {
|
|
|
19820
19865
|
preferences: preferences
|
|
19821
19866
|
};
|
|
19822
19867
|
|
|
19823
|
-
var _templateObject$
|
|
19868
|
+
var _templateObject$3, _templateObject2$1;
|
|
19824
19869
|
var HeroIcon = dist.createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
|
|
19825
|
-
var StyledHeroIcon = styled(HeroIcon)(_templateObject$
|
|
19870
|
+
var StyledHeroIcon = styled(HeroIcon)(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref) {
|
|
19826
19871
|
var themeIntent = _ref.themeIntent,
|
|
19827
19872
|
themeSize = _ref.themeSize;
|
|
19828
19873
|
return css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", "px;\n "])), function (_ref2) {
|
|
@@ -19851,8 +19896,8 @@ var Icon = function Icon(_ref) {
|
|
|
19851
19896
|
});
|
|
19852
19897
|
};
|
|
19853
19898
|
|
|
19854
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
19855
|
-
var StyledText = styled(Text$1)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
19899
|
+
var _templateObject$2, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
19900
|
+
var StyledText = styled(Text$1)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
19856
19901
|
var themeFontSize = _ref.themeFontSize,
|
|
19857
19902
|
theme = _ref.theme;
|
|
19858
19903
|
|
|
@@ -19896,7 +19941,7 @@ var StyledText = styled(Text$1)(_templateObject || (_templateObject = _taggedTem
|
|
|
19896
19941
|
}
|
|
19897
19942
|
});
|
|
19898
19943
|
|
|
19899
|
-
var _excluded = ["children", "fontSize", "fontWeight", "intent"];
|
|
19944
|
+
var _excluded$1 = ["children", "fontSize", "fontWeight", "intent"];
|
|
19900
19945
|
|
|
19901
19946
|
var Text = function Text(_ref) {
|
|
19902
19947
|
var children = _ref.children,
|
|
@@ -19906,7 +19951,7 @@ var Text = function Text(_ref) {
|
|
|
19906
19951
|
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
19907
19952
|
_ref$intent = _ref.intent,
|
|
19908
19953
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
19909
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
19954
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
19910
19955
|
|
|
19911
19956
|
return /*#__PURE__*/React.createElement(StyledText, _extends$1({
|
|
19912
19957
|
themeFontSize: fontSize,
|
|
@@ -19919,4 +19964,80 @@ var Typography = {
|
|
|
19919
19964
|
Text: Text
|
|
19920
19965
|
};
|
|
19921
19966
|
|
|
19922
|
-
|
|
19967
|
+
var _templateObject$1;
|
|
19968
|
+
var StyledFABIcon = styled(Icon)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n"])), function (_ref) {
|
|
19969
|
+
var theme = _ref.theme;
|
|
19970
|
+
return theme.__hd__.fab.colors.icon;
|
|
19971
|
+
}, function (_ref2) {
|
|
19972
|
+
var theme = _ref2.theme;
|
|
19973
|
+
return theme.__hd__.fab.fontSizes["default"];
|
|
19974
|
+
});
|
|
19975
|
+
|
|
19976
|
+
var _excluded = ["active"];
|
|
19977
|
+
var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
|
|
19978
|
+
|
|
19979
|
+
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
19980
|
+
var active = _ref.active,
|
|
19981
|
+
iconProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
19982
|
+
|
|
19983
|
+
var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
19984
|
+
useEffect(function () {
|
|
19985
|
+
var animation = Animated.timing(rotateAnimation.current, {
|
|
19986
|
+
toValue: active ? 1 : 0,
|
|
19987
|
+
useNativeDriver: true
|
|
19988
|
+
});
|
|
19989
|
+
animation.start();
|
|
19990
|
+
return function () {
|
|
19991
|
+
animation.stop();
|
|
19992
|
+
};
|
|
19993
|
+
}, [active]);
|
|
19994
|
+
var interpolatedRotateAnimation = rotateAnimation.current.interpolate({
|
|
19995
|
+
inputRange: [0, 1],
|
|
19996
|
+
outputRange: ['0deg', '-45deg']
|
|
19997
|
+
});
|
|
19998
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
19999
|
+
style: StyleSheet$1.flatten([{
|
|
20000
|
+
transform: [{
|
|
20001
|
+
rotate: interpolatedRotateAnimation
|
|
20002
|
+
}]
|
|
20003
|
+
}])
|
|
20004
|
+
}, /*#__PURE__*/React.createElement(AnimatedIcons, iconProps));
|
|
20005
|
+
};
|
|
20006
|
+
|
|
20007
|
+
var _templateObject;
|
|
20008
|
+
var StyledFABContainer = styled(TouchableHighlight)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n background-color: ", ";\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"])), function (_ref) {
|
|
20009
|
+
var theme = _ref.theme;
|
|
20010
|
+
return theme.__hd__.fab.sizes.height;
|
|
20011
|
+
}, function (_ref2) {
|
|
20012
|
+
var theme = _ref2.theme;
|
|
20013
|
+
return theme.__hd__.fab.sizes.width;
|
|
20014
|
+
}, function (_ref3) {
|
|
20015
|
+
var theme = _ref3.theme;
|
|
20016
|
+
return theme.__hd__.fab.colors.buttonBackground;
|
|
20017
|
+
});
|
|
20018
|
+
|
|
20019
|
+
var FAB = function FAB(_ref) {
|
|
20020
|
+
var _onPress = _ref.onPress,
|
|
20021
|
+
icon = _ref.icon,
|
|
20022
|
+
animated = _ref.animated,
|
|
20023
|
+
testID = _ref.testID,
|
|
20024
|
+
active = _ref.active,
|
|
20025
|
+
style = _ref.style;
|
|
20026
|
+
return /*#__PURE__*/React.createElement(StyledFABContainer, {
|
|
20027
|
+
testID: testID,
|
|
20028
|
+
onPress: function onPress() {
|
|
20029
|
+
_onPress === null || _onPress === void 0 ? void 0 : _onPress();
|
|
20030
|
+
},
|
|
20031
|
+
activeOpacity: 0.6,
|
|
20032
|
+
style: style
|
|
20033
|
+
}, animated ? /*#__PURE__*/React.createElement(AnimatedFABIcon, {
|
|
20034
|
+
active: active,
|
|
20035
|
+
icon: icon,
|
|
20036
|
+
testID: "animatedFABIcon"
|
|
20037
|
+
}) : /*#__PURE__*/React.createElement(StyledFABIcon, {
|
|
20038
|
+
icon: icon,
|
|
20039
|
+
testID: "styledFABIcon"
|
|
20040
|
+
}));
|
|
20041
|
+
};
|
|
20042
|
+
|
|
20043
|
+
export { Badge, Card, Divider, FAB, Icon, ThemeProvider, Typography, getTheme, scale, theme, useTheme };
|
|
Binary file
|