@hero-design/rn 7.1.3-alpha3 → 7.1.3-alpha6
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/es/index.js +328 -128
- package/lib/index.js +328 -126
- package/package.json +1 -1
- package/playground/components/BottomNavigation.tsx +8 -8
- package/playground/components/Button.tsx +67 -0
- package/playground/components/FAB.tsx +4 -1
- package/playground/components/Tabs.tsx +45 -0
- package/playground/index.tsx +10 -4
- package/src/components/Badge/StyledBadge.tsx +3 -5
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +52 -20
- package/src/components/Badge/index.tsx +3 -1
- package/src/components/BottomNavigation/StyledBottomNavigation.tsx +7 -0
- package/src/components/BottomNavigation/__tests__/BottomNavigation.spec.tsx +1 -1
- package/src/components/BottomNavigation/index.tsx +14 -18
- package/src/components/Button/IconButton.tsx +62 -0
- package/src/components/Button/__tests__/__snapshots__/index.spec.tsx.snap +43 -0
- package/src/components/Button/__tests__/index.spec.tsx +29 -0
- package/src/components/Button/index.tsx +5 -0
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -1
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Tabs/StyledTabs.tsx +72 -0
- package/src/components/Tabs/__tests__/Tabs.spec.tsx +79 -0
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.spec.tsx.snap +295 -0
- package/src/components/Tabs/index.tsx +177 -0
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +16 -6
- package/src/theme/components/badge.ts +1 -9
- package/src/theme/components/bottomNavigation.ts +5 -1
- package/src/theme/components/fab.ts +2 -2
- package/src/theme/components/tabs.ts +20 -0
- package/src/theme/index.ts +3 -0
- package/src/utils/__tests__/scale.spec.ts +3 -3
- package/src/utils/scale.ts +4 -1
- package/types/playground/components/BottomNavigation.d.ts +2 -2
- package/types/playground/components/Button.d.ts +2 -0
- package/types/playground/components/Tabs.d.ts +2 -0
- package/types/src/components/Badge/StyledBadge.d.ts +2 -2
- package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +2 -1
- package/types/src/components/BottomNavigation/index.d.ts +10 -10
- package/types/src/components/Button/IconButton.d.ts +34 -0
- package/types/src/components/Button/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Button/index.d.ts +4 -0
- package/types/src/components/Tabs/StyledTabs.d.ts +23 -0
- package/types/src/components/Tabs/__tests__/Tabs.spec.d.ts +1 -0
- package/types/src/components/Tabs/index.d.ts +40 -0
- package/types/src/index.d.ts +3 -1
- package/types/src/theme/components/badge.d.ts +0 -6
- package/types/src/theme/components/bottomNavigation.d.ts +3 -0
- package/types/src/theme/components/tabs.d.ts +15 -0
- package/types/src/theme/index.d.ts +2 -0
- package/types/src/utils/scale.d.ts +2 -1
package/lib/index.js
CHANGED
|
@@ -8140,7 +8140,7 @@ Processor$1["default"] = Processor$1;
|
|
|
8140
8140
|
Root$2.registerProcessor(Processor$1);
|
|
8141
8141
|
Document$1.registerProcessor(Processor$1);
|
|
8142
8142
|
|
|
8143
|
-
var _excluded$
|
|
8143
|
+
var _excluded$6 = ["inputs"],
|
|
8144
8144
|
_excluded2 = ["inputId"];
|
|
8145
8145
|
|
|
8146
8146
|
var Declaration$1 = declaration;
|
|
@@ -8157,7 +8157,7 @@ function fromJSON$1(json, inputs) {
|
|
|
8157
8157
|
});
|
|
8158
8158
|
|
|
8159
8159
|
var ownInputs = json.inputs,
|
|
8160
|
-
defaults = _objectWithoutProperties$1(json, _excluded$
|
|
8160
|
+
defaults = _objectWithoutProperties$1(json, _excluded$6);
|
|
8161
8161
|
|
|
8162
8162
|
if (ownInputs) {
|
|
8163
8163
|
inputs = [];
|
|
@@ -9884,7 +9884,7 @@ var systemPalette = {
|
|
|
9884
9884
|
|
|
9885
9885
|
var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
9886
9886
|
|
|
9887
|
-
var
|
|
9887
|
+
var horizontalScale = function horizontalScale(size) {
|
|
9888
9888
|
var _Dimensions$get = require$$0$1.Dimensions.get('window'),
|
|
9889
9889
|
width = _Dimensions$get.width,
|
|
9890
9890
|
height = _Dimensions$get.height;
|
|
@@ -9892,6 +9892,10 @@ var scale = function scale(size) {
|
|
|
9892
9892
|
var shortDimension = width < height ? width : height;
|
|
9893
9893
|
return shortDimension / BASE_WIDTH * size;
|
|
9894
9894
|
};
|
|
9895
|
+
var scale = function scale(size) {
|
|
9896
|
+
var factor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
|
|
9897
|
+
return size + (horizontalScale(size) - size) * factor;
|
|
9898
|
+
};
|
|
9895
9899
|
|
|
9896
9900
|
var BASE$1 = 8;
|
|
9897
9901
|
var space = {
|
|
@@ -9966,12 +9970,6 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
9966
9970
|
var padding = {
|
|
9967
9971
|
"default": "".concat(theme.space.xsmall, "px ").concat(theme.space.small, "px")
|
|
9968
9972
|
};
|
|
9969
|
-
var fonts = {
|
|
9970
|
-
"default": theme.fonts.semiBold
|
|
9971
|
-
};
|
|
9972
|
-
var fontSizes = {
|
|
9973
|
-
"default": "".concat(theme.fontSizes.small, "px")
|
|
9974
|
-
};
|
|
9975
9973
|
var radii = {
|
|
9976
9974
|
"default": "4px"
|
|
9977
9975
|
};
|
|
@@ -9979,8 +9977,6 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
9979
9977
|
borderWidths: borderWidths,
|
|
9980
9978
|
colors: colors,
|
|
9981
9979
|
padding: padding,
|
|
9982
|
-
fonts: fonts,
|
|
9983
|
-
fontSizes: fontSizes,
|
|
9984
9980
|
radii: radii
|
|
9985
9981
|
};
|
|
9986
9982
|
};
|
|
@@ -9999,10 +9995,14 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
|
|
|
9999
9995
|
radius: "4.65px",
|
|
10000
9996
|
elevation: 10
|
|
10001
9997
|
};
|
|
9998
|
+
var space = {
|
|
9999
|
+
titleMarginTop: "".concat(theme.space.xsmall, "px")
|
|
10000
|
+
};
|
|
10002
10001
|
return {
|
|
10003
10002
|
colors: colors,
|
|
10004
10003
|
shadows: shadows,
|
|
10005
|
-
sizes: sizes
|
|
10004
|
+
sizes: sizes,
|
|
10005
|
+
space: space
|
|
10006
10006
|
};
|
|
10007
10007
|
};
|
|
10008
10008
|
|
|
@@ -10040,6 +10040,24 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
10040
10040
|
};
|
|
10041
10041
|
};
|
|
10042
10042
|
|
|
10043
|
+
var getTabsTheme = function getTabsTheme(theme) {
|
|
10044
|
+
var colors = {
|
|
10045
|
+
background: theme.colors.primary,
|
|
10046
|
+
active: theme.colors.invertedText,
|
|
10047
|
+
inactive: "".concat(theme.colors.invertedText, "50")
|
|
10048
|
+
};
|
|
10049
|
+
var space = {
|
|
10050
|
+
flatListHorizontalPadding: "".concat(theme.space.small, "px"),
|
|
10051
|
+
titleMarginLeft: "".concat(theme.space.small, "px"),
|
|
10052
|
+
itemHorizontalPadding: "".concat(theme.space.medium, "px"),
|
|
10053
|
+
itemVerticalPadding: "".concat(theme.space.large, "px")
|
|
10054
|
+
};
|
|
10055
|
+
return {
|
|
10056
|
+
colors: colors,
|
|
10057
|
+
space: space
|
|
10058
|
+
};
|
|
10059
|
+
};
|
|
10060
|
+
|
|
10043
10061
|
var getIconTheme = function getIconTheme(theme) {
|
|
10044
10062
|
var colors = {
|
|
10045
10063
|
text: theme.colors.text,
|
|
@@ -10123,11 +10141,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
10123
10141
|
actionItemPaddingRight: "".concat(theme.space.medium, "px"),
|
|
10124
10142
|
actionItemPaddingTop: "".concat(theme.space.small, "px"),
|
|
10125
10143
|
actionItemPaddingBottom: "".concat(theme.space.small, "px"),
|
|
10126
|
-
actionItemMargin: "".concat(theme.space.
|
|
10144
|
+
actionItemMargin: "".concat(theme.space.xsmall, "px"),
|
|
10127
10145
|
actionItemMarginRight: "".concat(theme.space.large, "px"),
|
|
10128
10146
|
actionItemTextPaddingLeft: "".concat(theme.space.small, "px"),
|
|
10129
10147
|
headerTextMarginRight: "".concat(theme.space.large, "px"),
|
|
10130
|
-
headerTextMarginBottom: "".concat(theme.space.
|
|
10148
|
+
headerTextMarginBottom: "".concat(theme.space.medium, "px")
|
|
10131
10149
|
};
|
|
10132
10150
|
var radii = {
|
|
10133
10151
|
actionItem: "999px"
|
|
@@ -10152,6 +10170,7 @@ var getTheme = function getTheme() {
|
|
|
10152
10170
|
card: getCardTheme(theme),
|
|
10153
10171
|
divider: getDividerTheme(theme),
|
|
10154
10172
|
icon: getIconTheme(theme),
|
|
10173
|
+
tabs: getTabsTheme(theme),
|
|
10155
10174
|
typography: getTypographyTheme(theme),
|
|
10156
10175
|
fab: getFABTheme(theme)
|
|
10157
10176
|
}
|
|
@@ -10160,6 +10179,77 @@ var getTheme = function getTheme() {
|
|
|
10160
10179
|
|
|
10161
10180
|
var theme = getTheme();
|
|
10162
10181
|
|
|
10182
|
+
var _templateObject$a, _templateObject2$7, _templateObject3$5, _templateObject4$5, _templateObject5$4, _templateObject6$3, _templateObject7$3, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1;
|
|
10183
|
+
var StyledText$1 = styled(require$$0$1.Text)(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
10184
|
+
var themeFontSize = _ref.themeFontSize,
|
|
10185
|
+
theme = _ref.theme;
|
|
10186
|
+
|
|
10187
|
+
switch (themeFontSize) {
|
|
10188
|
+
case 'small':
|
|
10189
|
+
return css(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.small, theme.__hd__.typography.lineHeights.small, theme.__hd__.typography.fontSizes.small * 0.03);
|
|
10190
|
+
|
|
10191
|
+
case 'medium':
|
|
10192
|
+
return css(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.medium, theme.__hd__.typography.lineHeights.medium, theme.__hd__.typography.fontSizes.medium * 0.03);
|
|
10193
|
+
|
|
10194
|
+
case 'large':
|
|
10195
|
+
return css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.large, theme.__hd__.typography.lineHeights.large, theme.__hd__.typography.fontSizes.large * 0.03);
|
|
10196
|
+
|
|
10197
|
+
case 'xlarge':
|
|
10198
|
+
return css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.xlarge, theme.__hd__.typography.lineHeights.xlarge, theme.__hd__.typography.fontSizes.xlarge * 0.03);
|
|
10199
|
+
}
|
|
10200
|
+
}, function (_ref2) {
|
|
10201
|
+
var themeFontWeight = _ref2.themeFontWeight,
|
|
10202
|
+
theme = _ref2.theme;
|
|
10203
|
+
|
|
10204
|
+
switch (themeFontWeight) {
|
|
10205
|
+
case 'light':
|
|
10206
|
+
return css(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.light);
|
|
10207
|
+
|
|
10208
|
+
case 'regular':
|
|
10209
|
+
return css(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.regular);
|
|
10210
|
+
|
|
10211
|
+
case 'semi-bold':
|
|
10212
|
+
return css(_templateObject8$2 || (_templateObject8$2 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.semiBold);
|
|
10213
|
+
}
|
|
10214
|
+
}, function (_ref3) {
|
|
10215
|
+
var themeIntent = _ref3.themeIntent,
|
|
10216
|
+
theme = _ref3.theme;
|
|
10217
|
+
|
|
10218
|
+
switch (themeIntent) {
|
|
10219
|
+
case 'body':
|
|
10220
|
+
return css(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.body);
|
|
10221
|
+
|
|
10222
|
+
case 'subdued':
|
|
10223
|
+
return css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.subdued);
|
|
10224
|
+
|
|
10225
|
+
case 'primary':
|
|
10226
|
+
return css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.primary);
|
|
10227
|
+
}
|
|
10228
|
+
});
|
|
10229
|
+
|
|
10230
|
+
var _excluded$5 = ["children", "fontSize", "fontWeight", "intent"];
|
|
10231
|
+
|
|
10232
|
+
var Text = function Text(_ref) {
|
|
10233
|
+
var children = _ref.children,
|
|
10234
|
+
_ref$fontSize = _ref.fontSize,
|
|
10235
|
+
fontSize = _ref$fontSize === void 0 ? 'medium' : _ref$fontSize,
|
|
10236
|
+
_ref$fontWeight = _ref.fontWeight,
|
|
10237
|
+
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
10238
|
+
_ref$intent = _ref.intent,
|
|
10239
|
+
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
10240
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
10241
|
+
|
|
10242
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledText$1, _extends$1({
|
|
10243
|
+
themeFontSize: fontSize,
|
|
10244
|
+
themeFontWeight: fontWeight,
|
|
10245
|
+
themeIntent: intent
|
|
10246
|
+
}, nativeProps), children);
|
|
10247
|
+
};
|
|
10248
|
+
|
|
10249
|
+
var Typography = {
|
|
10250
|
+
Text: Text
|
|
10251
|
+
};
|
|
10252
|
+
|
|
10163
10253
|
var _templateObject$9, _templateObject2$6, _templateObject3$4, _templateObject4$4;
|
|
10164
10254
|
var BACKGROUND_INTENTS = {
|
|
10165
10255
|
success: 'successBackground',
|
|
@@ -10186,16 +10276,10 @@ var StyledView = styled(require$$0$1.View)(_templateObject$9 || (_templateObject
|
|
|
10186
10276
|
return theme.__hd__.badge.colors[BACKGROUND_INTENTS[themeIntent]];
|
|
10187
10277
|
});
|
|
10188
10278
|
});
|
|
10189
|
-
var StyledText
|
|
10190
|
-
var
|
|
10191
|
-
return
|
|
10192
|
-
|
|
10193
|
-
var theme = _ref8.theme;
|
|
10194
|
-
return theme.__hd__.badge.fontSizes["default"];
|
|
10195
|
-
}, function (_ref9) {
|
|
10196
|
-
var themeIntent = _ref9.themeIntent;
|
|
10197
|
-
return css(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (_ref10) {
|
|
10198
|
-
var theme = _ref10.theme;
|
|
10279
|
+
var StyledText = styled(Typography.Text)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref7) {
|
|
10280
|
+
var themeIntent = _ref7.themeIntent;
|
|
10281
|
+
return css(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (_ref8) {
|
|
10282
|
+
var theme = _ref8.theme;
|
|
10199
10283
|
return theme.__hd__.badge.colors[themeIntent];
|
|
10200
10284
|
});
|
|
10201
10285
|
});
|
|
@@ -10214,8 +10298,10 @@ var Badge = function Badge(_ref) {
|
|
|
10214
10298
|
themeIntent: intent,
|
|
10215
10299
|
style: style,
|
|
10216
10300
|
testID: testID
|
|
10217
|
-
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledText
|
|
10218
|
-
themeIntent: intent
|
|
10301
|
+
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledText, {
|
|
10302
|
+
themeIntent: intent,
|
|
10303
|
+
fontSize: "small",
|
|
10304
|
+
fontWeight: "semi-bold"
|
|
10219
10305
|
}, content));
|
|
10220
10306
|
};
|
|
10221
10307
|
|
|
@@ -19884,85 +19970,14 @@ var isHeroIcon = function isHeroIcon(x) {
|
|
|
19884
19970
|
return IconList.includes(x);
|
|
19885
19971
|
};
|
|
19886
19972
|
|
|
19887
|
-
var _templateObject$7, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$
|
|
19888
|
-
var
|
|
19889
|
-
var themeFontSize = _ref.themeFontSize,
|
|
19890
|
-
theme = _ref.theme;
|
|
19891
|
-
|
|
19892
|
-
switch (themeFontSize) {
|
|
19893
|
-
case 'small':
|
|
19894
|
-
return css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.small, theme.__hd__.typography.lineHeights.small, theme.__hd__.typography.fontSizes.small * 0.03);
|
|
19895
|
-
|
|
19896
|
-
case 'medium':
|
|
19897
|
-
return css(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.medium, theme.__hd__.typography.lineHeights.medium, theme.__hd__.typography.fontSizes.medium * 0.03);
|
|
19898
|
-
|
|
19899
|
-
case 'large':
|
|
19900
|
-
return css(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.large, theme.__hd__.typography.lineHeights.large, theme.__hd__.typography.fontSizes.large * 0.03);
|
|
19901
|
-
|
|
19902
|
-
case 'xlarge':
|
|
19903
|
-
return css(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", "px;\n "])), theme.__hd__.typography.fontSizes.xlarge, theme.__hd__.typography.lineHeights.xlarge, theme.__hd__.typography.fontSizes.xlarge * 0.03);
|
|
19904
|
-
}
|
|
19905
|
-
}, function (_ref2) {
|
|
19906
|
-
var themeFontWeight = _ref2.themeFontWeight,
|
|
19907
|
-
theme = _ref2.theme;
|
|
19908
|
-
|
|
19909
|
-
switch (themeFontWeight) {
|
|
19910
|
-
case 'light':
|
|
19911
|
-
return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.light);
|
|
19912
|
-
|
|
19913
|
-
case 'regular':
|
|
19914
|
-
return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.regular);
|
|
19915
|
-
|
|
19916
|
-
case 'semi-bold':
|
|
19917
|
-
return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.semiBold);
|
|
19918
|
-
}
|
|
19919
|
-
}, function (_ref3) {
|
|
19920
|
-
var themeIntent = _ref3.themeIntent,
|
|
19921
|
-
theme = _ref3.theme;
|
|
19922
|
-
|
|
19923
|
-
switch (themeIntent) {
|
|
19924
|
-
case 'body':
|
|
19925
|
-
return css(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.body);
|
|
19926
|
-
|
|
19927
|
-
case 'subdued':
|
|
19928
|
-
return css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.subdued);
|
|
19929
|
-
|
|
19930
|
-
case 'primary':
|
|
19931
|
-
return css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.primary);
|
|
19932
|
-
}
|
|
19933
|
-
});
|
|
19934
|
-
|
|
19935
|
-
var _excluded$3 = ["children", "fontSize", "fontWeight", "intent"];
|
|
19936
|
-
|
|
19937
|
-
var Text = function Text(_ref) {
|
|
19938
|
-
var children = _ref.children,
|
|
19939
|
-
_ref$fontSize = _ref.fontSize,
|
|
19940
|
-
fontSize = _ref$fontSize === void 0 ? 'medium' : _ref$fontSize,
|
|
19941
|
-
_ref$fontWeight = _ref.fontWeight,
|
|
19942
|
-
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
19943
|
-
_ref$intent = _ref.intent,
|
|
19944
|
-
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
19945
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
19946
|
-
|
|
19947
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledText, _extends$1({
|
|
19948
|
-
themeFontSize: fontSize,
|
|
19949
|
-
themeFontWeight: fontWeight,
|
|
19950
|
-
themeIntent: intent
|
|
19951
|
-
}, nativeProps), children);
|
|
19952
|
-
};
|
|
19953
|
-
|
|
19954
|
-
var Typography = {
|
|
19955
|
-
Text: Text
|
|
19956
|
-
};
|
|
19957
|
-
|
|
19958
|
-
var _templateObject$6, _templateObject2$3, _templateObject3$2, _templateObject4$2, _templateObject5$2, _templateObject6$1;
|
|
19959
|
-
var BottomNavigationTab = styled(require$$0$1.View)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
|
|
19973
|
+
var _templateObject$7, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2;
|
|
19974
|
+
var BottomNavigationTab = styled(require$$0$1.View)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
|
|
19960
19975
|
var themeVisibility = _ref.themeVisibility;
|
|
19961
19976
|
return themeVisibility === false ? 'none' : 'flex';
|
|
19962
19977
|
});
|
|
19963
|
-
var BottomNavigationContainer = styled(require$$0$1.View)(_templateObject2$
|
|
19964
|
-
var ContentWrapper = styled(require$$0$1.View)(_templateObject3$
|
|
19965
|
-
var BottomBarWrapper = styled(require$$0$1.View)(_templateObject4$
|
|
19978
|
+
var BottomNavigationContainer = styled(require$$0$1.View)(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n flex: 1;\n overflow: hidden;\n"])));
|
|
19979
|
+
var ContentWrapper$1 = styled(require$$0$1.View)(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n flex: 1;\n"])));
|
|
19980
|
+
var BottomBarWrapper = styled(require$$0$1.View)(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral(["\n height: ", "px;\n padding-bottom: ", "px;\n padding-left: ", "px;\n padding-right: ", "px;\n background-color: ", ";\n shadow-color: ", ";\n shadow-offset: ", ";\n shadow-opacity: ", ";\n shadow-radius: ", ";\n elevation: ", ";\n"])), function (_ref2) {
|
|
19966
19981
|
var theme = _ref2.theme,
|
|
19967
19982
|
themeInsets = _ref2.themeInsets;
|
|
19968
19983
|
return theme.__hd__.bottomNavigation.sizes.height + themeInsets.bottom;
|
|
@@ -19994,13 +20009,17 @@ var BottomBarWrapper = styled(require$$0$1.View)(_templateObject4$2 || (_templat
|
|
|
19994
20009
|
var theme = _ref11.theme;
|
|
19995
20010
|
return theme.__hd__.bottomNavigation.shadows.elevation;
|
|
19996
20011
|
});
|
|
19997
|
-
var BottomBar = styled(require$$0$1.View)(_templateObject5$
|
|
19998
|
-
var BottomBarItem = styled(require$$0$1.View)(_templateObject6$
|
|
20012
|
+
var BottomBar = styled(require$$0$1.View)(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteral(["\n flex: 1;\n flex-direction: row;\n overflow: hidden;\n align-items: center;\n"])));
|
|
20013
|
+
var BottomBarItem = styled(require$$0$1.View)(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n flex: 1;\n align-items: center;\n"])));
|
|
20014
|
+
var StyledBottomBarText = styled(Typography.Text)(_templateObject7$2 || (_templateObject7$2 = _taggedTemplateLiteral(["\n margin-top: ", ";\n"])), function (_ref12) {
|
|
20015
|
+
var theme = _ref12.theme;
|
|
20016
|
+
return theme.__hd__.bottomNavigation.space.titleMarginTop;
|
|
20017
|
+
});
|
|
19999
20018
|
|
|
20000
20019
|
var isIOS = require$$0$1.Platform.OS === 'ios';
|
|
20001
20020
|
require$$0$1.Platform.OS === 'android';
|
|
20002
20021
|
|
|
20003
|
-
var _excluded$
|
|
20022
|
+
var _excluded$3 = ["onChange", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
20004
20023
|
|
|
20005
20024
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
20006
20025
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
@@ -20013,9 +20032,8 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
20013
20032
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
20014
20033
|
selectedTabKey = _ref.selectedTabKey,
|
|
20015
20034
|
tabs = _ref.tabs,
|
|
20016
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20035
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
20017
20036
|
|
|
20018
|
-
var theme = useTheme();
|
|
20019
20037
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
20020
20038
|
/**
|
|
20021
20039
|
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
@@ -20033,7 +20051,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
20033
20051
|
});
|
|
20034
20052
|
}
|
|
20035
20053
|
|
|
20036
|
-
return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper, null, tabs.map(function (tab) {
|
|
20054
|
+
return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper$1, null, tabs.map(function (tab) {
|
|
20037
20055
|
var key = tab.key,
|
|
20038
20056
|
component = tab.component;
|
|
20039
20057
|
var active = selectedTabKey === key;
|
|
@@ -20080,20 +20098,17 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
20080
20098
|
icon: active ? icon : inactiveIcon,
|
|
20081
20099
|
intent: active ? 'primary' : 'text',
|
|
20082
20100
|
testID: "hero-icon-".concat(icon)
|
|
20083
|
-
}), title && /*#__PURE__*/React__default["default"].createElement(
|
|
20101
|
+
}), title && /*#__PURE__*/React__default["default"].createElement(StyledBottomBarText, {
|
|
20084
20102
|
fontSize: "small",
|
|
20085
20103
|
fontWeight: "semi-bold",
|
|
20086
20104
|
intent: active ? 'primary' : 'body',
|
|
20087
|
-
style: {
|
|
20088
|
-
marginTop: theme.space.xsmall
|
|
20089
|
-
},
|
|
20090
20105
|
numberOfLines: 1
|
|
20091
20106
|
}, title)));
|
|
20092
20107
|
}))));
|
|
20093
20108
|
};
|
|
20094
20109
|
|
|
20095
|
-
var _templateObject$
|
|
20096
|
-
var StyledCard = styled(require$$0$1.View)(_templateObject$
|
|
20110
|
+
var _templateObject$6;
|
|
20111
|
+
var StyledCard = styled(require$$0$1.View)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n border-radius: ", ";\n padding: ", ";\n overflow: hidden;\n"])), function (_ref) {
|
|
20097
20112
|
var theme = _ref.theme;
|
|
20098
20113
|
return theme.__hd__.card.radii["default"];
|
|
20099
20114
|
}, function (_ref2) {
|
|
@@ -20105,8 +20120,8 @@ var Card = function Card(props) {
|
|
|
20105
20120
|
return /*#__PURE__*/React__default["default"].createElement(StyledCard, props);
|
|
20106
20121
|
};
|
|
20107
20122
|
|
|
20108
|
-
var _templateObject$
|
|
20109
|
-
var StyledDivider = styled(require$$0$1.View)(_templateObject$
|
|
20123
|
+
var _templateObject$5, _templateObject2$3, _templateObject3$2, _templateObject4$2, _templateObject5$2, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
20124
|
+
var StyledDivider = styled(require$$0$1.View)(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n max-width: 100%;\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
20110
20125
|
var theme = _ref.theme;
|
|
20111
20126
|
return theme.__hd__.divider.borderWidths["default"];
|
|
20112
20127
|
}, function (_ref2) {
|
|
@@ -20118,22 +20133,22 @@ var StyledDivider = styled(require$$0$1.View)(_templateObject$4 || (_templateObj
|
|
|
20118
20133
|
|
|
20119
20134
|
switch (themeMarginHorizontal) {
|
|
20120
20135
|
case undefined:
|
|
20121
|
-
return css(_templateObject2$
|
|
20136
|
+
return css(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral([""])));
|
|
20122
20137
|
|
|
20123
20138
|
case 'xsmall':
|
|
20124
|
-
return css(_templateObject3$
|
|
20139
|
+
return css(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xsmall);
|
|
20125
20140
|
|
|
20126
20141
|
case 'small':
|
|
20127
|
-
return css(_templateObject4$
|
|
20142
|
+
return css(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.small);
|
|
20128
20143
|
|
|
20129
20144
|
case 'medium':
|
|
20130
|
-
return css(_templateObject5$
|
|
20145
|
+
return css(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.medium);
|
|
20131
20146
|
|
|
20132
20147
|
case 'large':
|
|
20133
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.large);
|
|
20148
|
+
return css(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.large);
|
|
20134
20149
|
|
|
20135
20150
|
case 'xlarge':
|
|
20136
|
-
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xlarge);
|
|
20151
|
+
return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xlarge);
|
|
20137
20152
|
}
|
|
20138
20153
|
}, function (_ref4) {
|
|
20139
20154
|
var themeMarginVertical = _ref4.themeMarginVertical,
|
|
@@ -20141,7 +20156,7 @@ var StyledDivider = styled(require$$0$1.View)(_templateObject$4 || (_templateObj
|
|
|
20141
20156
|
|
|
20142
20157
|
switch (themeMarginVertical) {
|
|
20143
20158
|
case undefined:
|
|
20144
|
-
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral([""])));
|
|
20159
|
+
return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral([""])));
|
|
20145
20160
|
|
|
20146
20161
|
case 'xsmall':
|
|
20147
20162
|
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.xsmall);
|
|
@@ -20160,14 +20175,14 @@ var StyledDivider = styled(require$$0$1.View)(_templateObject$4 || (_templateObj
|
|
|
20160
20175
|
}
|
|
20161
20176
|
});
|
|
20162
20177
|
|
|
20163
|
-
var _excluded$
|
|
20178
|
+
var _excluded$2 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
20164
20179
|
|
|
20165
20180
|
var Divider = function Divider(_ref) {
|
|
20166
20181
|
var marginHorizontal = _ref.marginHorizontal,
|
|
20167
20182
|
marginVertical = _ref.marginVertical,
|
|
20168
20183
|
style = _ref.style,
|
|
20169
20184
|
testID = _ref.testID,
|
|
20170
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
20185
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
20171
20186
|
|
|
20172
20187
|
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({
|
|
20173
20188
|
themeMarginHorizontal: marginHorizontal,
|
|
@@ -20177,6 +20192,167 @@ var Divider = function Divider(_ref) {
|
|
|
20177
20192
|
}, nativeProps));
|
|
20178
20193
|
};
|
|
20179
20194
|
|
|
20195
|
+
var _templateObject$4, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6, _templateObject7, _templateObject8;
|
|
20196
|
+
var TabScreen = styled(require$$0$1.View)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
|
|
20197
|
+
var themeVisibility = _ref.themeVisibility;
|
|
20198
|
+
return themeVisibility === false ? 'none' : 'flex';
|
|
20199
|
+
});
|
|
20200
|
+
var TabContainer = styled(require$$0$1.View)(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n flex: 1;\n overflow: hidden;\n"])));
|
|
20201
|
+
var ContentWrapper = styled(require$$0$1.View)(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n flex: 1;\n"])));
|
|
20202
|
+
var HeaderTabWrapper = styled(require$$0$1.View)(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n padding-left: ", "px;\n padding-right: ", "px;\n background-color: ", ";\n"])), function (_ref2) {
|
|
20203
|
+
var themeInsets = _ref2.themeInsets;
|
|
20204
|
+
return Math.max(themeInsets.left, themeInsets.right);
|
|
20205
|
+
}, function (_ref3) {
|
|
20206
|
+
var themeInsets = _ref3.themeInsets;
|
|
20207
|
+
return Math.max(themeInsets.left, themeInsets.right);
|
|
20208
|
+
}, function (_ref4) {
|
|
20209
|
+
var theme = _ref4.theme;
|
|
20210
|
+
return theme.__hd__.tabs.colors.background;
|
|
20211
|
+
});
|
|
20212
|
+
var StyledFlatList = styled(require$$0$1.FlatList)(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_ref5) {
|
|
20213
|
+
var theme = _ref5.theme;
|
|
20214
|
+
return theme.__hd__.tabs.space.flatListHorizontalPadding;
|
|
20215
|
+
}, function (_ref6) {
|
|
20216
|
+
var theme = _ref6.theme;
|
|
20217
|
+
return theme.__hd__.tabs.space.flatListHorizontalPadding;
|
|
20218
|
+
});
|
|
20219
|
+
var HeaderTabItem = styled(require$$0$1.View)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex-direction: row;\n align-items: center;\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n"])), function (_ref7) {
|
|
20220
|
+
var theme = _ref7.theme;
|
|
20221
|
+
return theme.__hd__.tabs.space.itemHorizontalPadding;
|
|
20222
|
+
}, function (_ref8) {
|
|
20223
|
+
var theme = _ref8.theme;
|
|
20224
|
+
return theme.__hd__.tabs.space.itemHorizontalPadding;
|
|
20225
|
+
}, function (_ref9) {
|
|
20226
|
+
var theme = _ref9.theme;
|
|
20227
|
+
return theme.__hd__.tabs.space.itemVerticalPadding;
|
|
20228
|
+
}, function (_ref10) {
|
|
20229
|
+
var theme = _ref10.theme;
|
|
20230
|
+
return theme.__hd__.tabs.space.itemVerticalPadding;
|
|
20231
|
+
});
|
|
20232
|
+
var StyledHeaderTabIcon = styled(Icon)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n color: ", ";\n"])), function (_ref11) {
|
|
20233
|
+
var theme = _ref11.theme,
|
|
20234
|
+
themeActive = _ref11.themeActive;
|
|
20235
|
+
return themeActive ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive;
|
|
20236
|
+
});
|
|
20237
|
+
var StyledHeaderTabText = styled(Typography.Text)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-left: ", ";\n color: ", ";\n"])), function (_ref12) {
|
|
20238
|
+
var theme = _ref12.theme;
|
|
20239
|
+
return theme.__hd__.tabs.space.titleMarginLeft;
|
|
20240
|
+
}, function (_ref13) {
|
|
20241
|
+
var theme = _ref13.theme,
|
|
20242
|
+
themeActive = _ref13.themeActive;
|
|
20243
|
+
return themeActive ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive;
|
|
20244
|
+
});
|
|
20245
|
+
|
|
20246
|
+
var _excluded$1 = ["onChange", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
20247
|
+
|
|
20248
|
+
var Tabs = function Tabs(_ref) {
|
|
20249
|
+
var onChange = _ref.onChange,
|
|
20250
|
+
_ref$renderActiveTabO = _ref.renderActiveTabOnly,
|
|
20251
|
+
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
20252
|
+
selectedTabKey = _ref.selectedTabKey,
|
|
20253
|
+
tabs = _ref.tabs,
|
|
20254
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
20255
|
+
|
|
20256
|
+
var flatListRef = React__default["default"].useRef(null);
|
|
20257
|
+
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
20258
|
+
/**
|
|
20259
|
+
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
20260
|
+
*/
|
|
20261
|
+
|
|
20262
|
+
var _React$useState = React__default["default"].useState([selectedTabKey]),
|
|
20263
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20264
|
+
loaded = _React$useState2[0],
|
|
20265
|
+
setLoaded = _React$useState2[1];
|
|
20266
|
+
|
|
20267
|
+
if (!loaded.includes(selectedTabKey)) {
|
|
20268
|
+
// Set the current tab to be loaded if it was not loaded before
|
|
20269
|
+
setLoaded(function (loadedState) {
|
|
20270
|
+
return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
|
|
20271
|
+
});
|
|
20272
|
+
}
|
|
20273
|
+
|
|
20274
|
+
return /*#__PURE__*/React__default["default"].createElement(TabContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(HeaderTabWrapper, {
|
|
20275
|
+
themeInsets: insets
|
|
20276
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledFlatList, {
|
|
20277
|
+
ref: flatListRef,
|
|
20278
|
+
horizontal: true,
|
|
20279
|
+
data: tabs,
|
|
20280
|
+
keyExtractor: function keyExtractor(tab) {
|
|
20281
|
+
return String(tab.key);
|
|
20282
|
+
},
|
|
20283
|
+
showsHorizontalScrollIndicator: false,
|
|
20284
|
+
onScrollToIndexFailed: function onScrollToIndexFailed(_ref2) {
|
|
20285
|
+
var index = _ref2.index;
|
|
20286
|
+
setTimeout(function () {
|
|
20287
|
+
var _flatListRef$current;
|
|
20288
|
+
|
|
20289
|
+
return (_flatListRef$current = flatListRef.current) === null || _flatListRef$current === void 0 ? void 0 : _flatListRef$current.scrollToIndex({
|
|
20290
|
+
index: index,
|
|
20291
|
+
viewPosition: 0.5
|
|
20292
|
+
});
|
|
20293
|
+
}, 100);
|
|
20294
|
+
},
|
|
20295
|
+
renderItem: function renderItem(_ref3) {
|
|
20296
|
+
var tab = _ref3.item,
|
|
20297
|
+
index = _ref3.index;
|
|
20298
|
+
var key = tab.key,
|
|
20299
|
+
icon = tab.icon,
|
|
20300
|
+
title = tab.title,
|
|
20301
|
+
testID = tab.testID;
|
|
20302
|
+
var active = selectedTabKey === key;
|
|
20303
|
+
return /*#__PURE__*/React__default["default"].createElement(require$$0$1.TouchableOpacity, {
|
|
20304
|
+
key: key,
|
|
20305
|
+
onPress: function onPress() {
|
|
20306
|
+
if (key !== selectedTabKey) {
|
|
20307
|
+
var _flatListRef$current2;
|
|
20308
|
+
|
|
20309
|
+
onChange(key);
|
|
20310
|
+
(_flatListRef$current2 = flatListRef.current) === null || _flatListRef$current2 === void 0 ? void 0 : _flatListRef$current2.scrollToIndex({
|
|
20311
|
+
index: index,
|
|
20312
|
+
viewPosition: 0.5
|
|
20313
|
+
});
|
|
20314
|
+
}
|
|
20315
|
+
},
|
|
20316
|
+
testID: testID
|
|
20317
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem, null, /*#__PURE__*/React__default["default"].createElement(StyledHeaderTabIcon, {
|
|
20318
|
+
icon: icon,
|
|
20319
|
+
testID: "hero-icon-".concat(icon),
|
|
20320
|
+
themeActive: active
|
|
20321
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledHeaderTabText, {
|
|
20322
|
+
fontWeight: "semi-bold",
|
|
20323
|
+
numberOfLines: 1,
|
|
20324
|
+
themeActive: active
|
|
20325
|
+
}, title)));
|
|
20326
|
+
}
|
|
20327
|
+
})), /*#__PURE__*/React__default["default"].createElement(ContentWrapper, null, tabs.map(function (tab) {
|
|
20328
|
+
var key = tab.key,
|
|
20329
|
+
component = tab.component;
|
|
20330
|
+
var active = selectedTabKey === key;
|
|
20331
|
+
|
|
20332
|
+
if (renderActiveTabOnly && !active) {
|
|
20333
|
+
return null;
|
|
20334
|
+
}
|
|
20335
|
+
|
|
20336
|
+
if (!loaded.includes(key)) {
|
|
20337
|
+
// Don't render a screen if we've never navigated to it
|
|
20338
|
+
return null;
|
|
20339
|
+
}
|
|
20340
|
+
|
|
20341
|
+
return /*#__PURE__*/React__default["default"].createElement(TabScreen, {
|
|
20342
|
+
key: key,
|
|
20343
|
+
testID: "tab-screen-".concat(selectedTabKey),
|
|
20344
|
+
pointerEvents: active ? 'auto' : 'none',
|
|
20345
|
+
accessibilityElementsHidden: !active,
|
|
20346
|
+
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
20347
|
+
collapsable: false,
|
|
20348
|
+
removeClippedSubviews: // On iOS, set removeClippedSubviews to true only when not focused
|
|
20349
|
+
// This is an workaround for a bug where the clipped view never re-appears.
|
|
20350
|
+
isIOS ? selectedTabKey !== key : true,
|
|
20351
|
+
themeVisibility: active
|
|
20352
|
+
}, component);
|
|
20353
|
+
})));
|
|
20354
|
+
};
|
|
20355
|
+
|
|
20180
20356
|
var _templateObject$3;
|
|
20181
20357
|
var StyledFABIcon = styled(Icon)(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n"])), function (_ref) {
|
|
20182
20358
|
var theme = _ref.theme;
|
|
@@ -20314,7 +20490,7 @@ var StyledFAB = styled(FAB)(_templateObject3 || (_templateObject3 = _taggedTempl
|
|
|
20314
20490
|
return theme.space.large;
|
|
20315
20491
|
}, function (_ref2) {
|
|
20316
20492
|
var theme = _ref2.theme;
|
|
20317
|
-
return theme.space.
|
|
20493
|
+
return theme.space.small;
|
|
20318
20494
|
});
|
|
20319
20495
|
var StyledBackdrop = styled(require$$0$1.Animated.View)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: ", ";\n"])), function (_ref3) {
|
|
20320
20496
|
var theme = _ref3.theme;
|
|
@@ -20406,12 +20582,38 @@ var index = Object.assign(FAB, {
|
|
|
20406
20582
|
ActionGroup: ActionGroup
|
|
20407
20583
|
});
|
|
20408
20584
|
|
|
20585
|
+
var IconButton = function IconButton(_ref) {
|
|
20586
|
+
var hitSlop = _ref.hitSlop,
|
|
20587
|
+
onPress = _ref.onPress,
|
|
20588
|
+
icon = _ref.icon,
|
|
20589
|
+
testID = _ref.testID,
|
|
20590
|
+
style = _ref.style,
|
|
20591
|
+
size = _ref.size,
|
|
20592
|
+
intent = _ref.intent;
|
|
20593
|
+
return /*#__PURE__*/React__default["default"].createElement(require$$0$1.TouchableOpacity, {
|
|
20594
|
+
style: style,
|
|
20595
|
+
onPress: onPress,
|
|
20596
|
+
testID: testID,
|
|
20597
|
+
hitSlop: hitSlop
|
|
20598
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
20599
|
+
icon: icon,
|
|
20600
|
+
size: size,
|
|
20601
|
+
intent: intent
|
|
20602
|
+
}));
|
|
20603
|
+
};
|
|
20604
|
+
|
|
20605
|
+
var Button = {
|
|
20606
|
+
Icon: IconButton
|
|
20607
|
+
};
|
|
20608
|
+
|
|
20409
20609
|
exports.Badge = Badge;
|
|
20410
20610
|
exports.BottomNavigation = BottomNavigation;
|
|
20611
|
+
exports.Button = Button;
|
|
20411
20612
|
exports.Card = Card;
|
|
20412
20613
|
exports.Divider = Divider;
|
|
20413
20614
|
exports.FAB = index;
|
|
20414
20615
|
exports.Icon = Icon;
|
|
20616
|
+
exports.Tabs = Tabs;
|
|
20415
20617
|
exports.ThemeProvider = ThemeProvider;
|
|
20416
20618
|
exports.Typography = Typography;
|
|
20417
20619
|
exports.getTheme = getTheme;
|