@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.
Files changed (51) hide show
  1. package/es/index.js +328 -128
  2. package/lib/index.js +328 -126
  3. package/package.json +1 -1
  4. package/playground/components/BottomNavigation.tsx +8 -8
  5. package/playground/components/Button.tsx +67 -0
  6. package/playground/components/FAB.tsx +4 -1
  7. package/playground/components/Tabs.tsx +45 -0
  8. package/playground/index.tsx +10 -4
  9. package/src/components/Badge/StyledBadge.tsx +3 -5
  10. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +52 -20
  11. package/src/components/Badge/index.tsx +3 -1
  12. package/src/components/BottomNavigation/StyledBottomNavigation.tsx +7 -0
  13. package/src/components/BottomNavigation/__tests__/BottomNavigation.spec.tsx +1 -1
  14. package/src/components/BottomNavigation/index.tsx +14 -18
  15. package/src/components/Button/IconButton.tsx +62 -0
  16. package/src/components/Button/__tests__/__snapshots__/index.spec.tsx.snap +43 -0
  17. package/src/components/Button/__tests__/index.spec.tsx +29 -0
  18. package/src/components/Button/index.tsx +5 -0
  19. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -1
  20. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  21. package/src/components/Tabs/StyledTabs.tsx +72 -0
  22. package/src/components/Tabs/__tests__/Tabs.spec.tsx +79 -0
  23. package/src/components/Tabs/__tests__/__snapshots__/Tabs.spec.tsx.snap +295 -0
  24. package/src/components/Tabs/index.tsx +177 -0
  25. package/src/index.ts +4 -0
  26. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +16 -6
  27. package/src/theme/components/badge.ts +1 -9
  28. package/src/theme/components/bottomNavigation.ts +5 -1
  29. package/src/theme/components/fab.ts +2 -2
  30. package/src/theme/components/tabs.ts +20 -0
  31. package/src/theme/index.ts +3 -0
  32. package/src/utils/__tests__/scale.spec.ts +3 -3
  33. package/src/utils/scale.ts +4 -1
  34. package/types/playground/components/BottomNavigation.d.ts +2 -2
  35. package/types/playground/components/Button.d.ts +2 -0
  36. package/types/playground/components/Tabs.d.ts +2 -0
  37. package/types/src/components/Badge/StyledBadge.d.ts +2 -2
  38. package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +2 -1
  39. package/types/src/components/BottomNavigation/index.d.ts +10 -10
  40. package/types/src/components/Button/IconButton.d.ts +34 -0
  41. package/types/src/components/Button/__tests__/index.spec.d.ts +1 -0
  42. package/types/src/components/Button/index.d.ts +4 -0
  43. package/types/src/components/Tabs/StyledTabs.d.ts +23 -0
  44. package/types/src/components/Tabs/__tests__/Tabs.spec.d.ts +1 -0
  45. package/types/src/components/Tabs/index.d.ts +40 -0
  46. package/types/src/index.d.ts +3 -1
  47. package/types/src/theme/components/badge.d.ts +0 -6
  48. package/types/src/theme/components/bottomNavigation.d.ts +3 -0
  49. package/types/src/theme/components/tabs.d.ts +15 -0
  50. package/types/src/theme/index.d.ts +2 -0
  51. package/types/src/utils/scale.d.ts +2 -1
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, { Dimensions, Text as Text$1, View, Platform, TouchableWithoutFeedback, FlatList, TouchableOpacity, Animated, StyleSheet as StyleSheet$1, TouchableHighlight } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
 
5
5
  function ownKeys(object, enumerableOnly) {
@@ -8131,7 +8131,7 @@ Processor$1["default"] = Processor$1;
8131
8131
  Root$2.registerProcessor(Processor$1);
8132
8132
  Document$1.registerProcessor(Processor$1);
8133
8133
 
8134
- var _excluded$5 = ["inputs"],
8134
+ var _excluded$6 = ["inputs"],
8135
8135
  _excluded2 = ["inputId"];
8136
8136
 
8137
8137
  var Declaration$1 = declaration;
@@ -8148,7 +8148,7 @@ function fromJSON$1(json, inputs) {
8148
8148
  });
8149
8149
 
8150
8150
  var ownInputs = json.inputs,
8151
- defaults = _objectWithoutProperties$1(json, _excluded$5);
8151
+ defaults = _objectWithoutProperties$1(json, _excluded$6);
8152
8152
 
8153
8153
  if (ownInputs) {
8154
8154
  inputs = [];
@@ -9875,7 +9875,7 @@ var systemPalette = {
9875
9875
 
9876
9876
  var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
9877
9877
 
9878
- var scale = function scale(size) {
9878
+ var horizontalScale = function horizontalScale(size) {
9879
9879
  var _Dimensions$get = Dimensions.get('window'),
9880
9880
  width = _Dimensions$get.width,
9881
9881
  height = _Dimensions$get.height;
@@ -9883,6 +9883,10 @@ var scale = function scale(size) {
9883
9883
  var shortDimension = width < height ? width : height;
9884
9884
  return shortDimension / BASE_WIDTH * size;
9885
9885
  };
9886
+ var scale = function scale(size) {
9887
+ var factor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
9888
+ return size + (horizontalScale(size) - size) * factor;
9889
+ };
9886
9890
 
9887
9891
  var BASE$1 = 8;
9888
9892
  var space = {
@@ -9957,12 +9961,6 @@ var getBadgeTheme = function getBadgeTheme(theme) {
9957
9961
  var padding = {
9958
9962
  "default": "".concat(theme.space.xsmall, "px ").concat(theme.space.small, "px")
9959
9963
  };
9960
- var fonts = {
9961
- "default": theme.fonts.semiBold
9962
- };
9963
- var fontSizes = {
9964
- "default": "".concat(theme.fontSizes.small, "px")
9965
- };
9966
9964
  var radii = {
9967
9965
  "default": "4px"
9968
9966
  };
@@ -9970,8 +9968,6 @@ var getBadgeTheme = function getBadgeTheme(theme) {
9970
9968
  borderWidths: borderWidths,
9971
9969
  colors: colors,
9972
9970
  padding: padding,
9973
- fonts: fonts,
9974
- fontSizes: fontSizes,
9975
9971
  radii: radii
9976
9972
  };
9977
9973
  };
@@ -9990,10 +9986,14 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
9990
9986
  radius: "4.65px",
9991
9987
  elevation: 10
9992
9988
  };
9989
+ var space = {
9990
+ titleMarginTop: "".concat(theme.space.xsmall, "px")
9991
+ };
9993
9992
  return {
9994
9993
  colors: colors,
9995
9994
  shadows: shadows,
9996
- sizes: sizes
9995
+ sizes: sizes,
9996
+ space: space
9997
9997
  };
9998
9998
  };
9999
9999
 
@@ -10031,6 +10031,24 @@ var getDividerTheme = function getDividerTheme(theme) {
10031
10031
  };
10032
10032
  };
10033
10033
 
10034
+ var getTabsTheme = function getTabsTheme(theme) {
10035
+ var colors = {
10036
+ background: theme.colors.primary,
10037
+ active: theme.colors.invertedText,
10038
+ inactive: "".concat(theme.colors.invertedText, "50")
10039
+ };
10040
+ var space = {
10041
+ flatListHorizontalPadding: "".concat(theme.space.small, "px"),
10042
+ titleMarginLeft: "".concat(theme.space.small, "px"),
10043
+ itemHorizontalPadding: "".concat(theme.space.medium, "px"),
10044
+ itemVerticalPadding: "".concat(theme.space.large, "px")
10045
+ };
10046
+ return {
10047
+ colors: colors,
10048
+ space: space
10049
+ };
10050
+ };
10051
+
10034
10052
  var getIconTheme = function getIconTheme(theme) {
10035
10053
  var colors = {
10036
10054
  text: theme.colors.text,
@@ -10114,11 +10132,11 @@ var getFABTheme = function getFABTheme(theme) {
10114
10132
  actionItemPaddingRight: "".concat(theme.space.medium, "px"),
10115
10133
  actionItemPaddingTop: "".concat(theme.space.small, "px"),
10116
10134
  actionItemPaddingBottom: "".concat(theme.space.small, "px"),
10117
- actionItemMargin: "".concat(theme.space.small, "px"),
10135
+ actionItemMargin: "".concat(theme.space.xsmall, "px"),
10118
10136
  actionItemMarginRight: "".concat(theme.space.large, "px"),
10119
10137
  actionItemTextPaddingLeft: "".concat(theme.space.small, "px"),
10120
10138
  headerTextMarginRight: "".concat(theme.space.large, "px"),
10121
- headerTextMarginBottom: "".concat(theme.space.large, "px")
10139
+ headerTextMarginBottom: "".concat(theme.space.medium, "px")
10122
10140
  };
10123
10141
  var radii = {
10124
10142
  actionItem: "999px"
@@ -10143,6 +10161,7 @@ var getTheme = function getTheme() {
10143
10161
  card: getCardTheme(theme),
10144
10162
  divider: getDividerTheme(theme),
10145
10163
  icon: getIconTheme(theme),
10164
+ tabs: getTabsTheme(theme),
10146
10165
  typography: getTypographyTheme(theme),
10147
10166
  fab: getFABTheme(theme)
10148
10167
  }
@@ -10151,6 +10170,77 @@ var getTheme = function getTheme() {
10151
10170
 
10152
10171
  var theme = getTheme();
10153
10172
 
10173
+ var _templateObject$a, _templateObject2$7, _templateObject3$5, _templateObject4$5, _templateObject5$4, _templateObject6$3, _templateObject7$3, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1;
10174
+ var StyledText$1 = styled(Text$1)(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
10175
+ var themeFontSize = _ref.themeFontSize,
10176
+ theme = _ref.theme;
10177
+
10178
+ switch (themeFontSize) {
10179
+ case 'small':
10180
+ 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);
10181
+
10182
+ case 'medium':
10183
+ 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);
10184
+
10185
+ case 'large':
10186
+ 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);
10187
+
10188
+ case 'xlarge':
10189
+ 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);
10190
+ }
10191
+ }, function (_ref2) {
10192
+ var themeFontWeight = _ref2.themeFontWeight,
10193
+ theme = _ref2.theme;
10194
+
10195
+ switch (themeFontWeight) {
10196
+ case 'light':
10197
+ return css(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.light);
10198
+
10199
+ case 'regular':
10200
+ return css(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.regular);
10201
+
10202
+ case 'semi-bold':
10203
+ return css(_templateObject8$2 || (_templateObject8$2 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.semiBold);
10204
+ }
10205
+ }, function (_ref3) {
10206
+ var themeIntent = _ref3.themeIntent,
10207
+ theme = _ref3.theme;
10208
+
10209
+ switch (themeIntent) {
10210
+ case 'body':
10211
+ return css(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.body);
10212
+
10213
+ case 'subdued':
10214
+ return css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.subdued);
10215
+
10216
+ case 'primary':
10217
+ return css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.primary);
10218
+ }
10219
+ });
10220
+
10221
+ var _excluded$5 = ["children", "fontSize", "fontWeight", "intent"];
10222
+
10223
+ var Text = function Text(_ref) {
10224
+ var children = _ref.children,
10225
+ _ref$fontSize = _ref.fontSize,
10226
+ fontSize = _ref$fontSize === void 0 ? 'medium' : _ref$fontSize,
10227
+ _ref$fontWeight = _ref.fontWeight,
10228
+ fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
10229
+ _ref$intent = _ref.intent,
10230
+ intent = _ref$intent === void 0 ? 'body' : _ref$intent,
10231
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$5);
10232
+
10233
+ return /*#__PURE__*/React.createElement(StyledText$1, _extends$1({
10234
+ themeFontSize: fontSize,
10235
+ themeFontWeight: fontWeight,
10236
+ themeIntent: intent
10237
+ }, nativeProps), children);
10238
+ };
10239
+
10240
+ var Typography = {
10241
+ Text: Text
10242
+ };
10243
+
10154
10244
  var _templateObject$9, _templateObject2$6, _templateObject3$4, _templateObject4$4;
10155
10245
  var BACKGROUND_INTENTS = {
10156
10246
  success: 'successBackground',
@@ -10177,16 +10267,10 @@ var StyledView = styled(View)(_templateObject$9 || (_templateObject$9 = _taggedT
10177
10267
  return theme.__hd__.badge.colors[BACKGROUND_INTENTS[themeIntent]];
10178
10268
  });
10179
10269
  });
10180
- var StyledText$1 = styled(Text$1)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n font-family: ", ";\n font-size: ", ";\n\n ", ";\n"])), function (_ref7) {
10181
- var theme = _ref7.theme;
10182
- return theme.__hd__.badge.fonts["default"];
10183
- }, function (_ref8) {
10184
- var theme = _ref8.theme;
10185
- return theme.__hd__.badge.fontSizes["default"];
10186
- }, function (_ref9) {
10187
- var themeIntent = _ref9.themeIntent;
10188
- return css(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (_ref10) {
10189
- var theme = _ref10.theme;
10270
+ var StyledText = styled(Typography.Text)(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref7) {
10271
+ var themeIntent = _ref7.themeIntent;
10272
+ return css(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (_ref8) {
10273
+ var theme = _ref8.theme;
10190
10274
  return theme.__hd__.badge.colors[themeIntent];
10191
10275
  });
10192
10276
  });
@@ -10205,8 +10289,10 @@ var Badge = function Badge(_ref) {
10205
10289
  themeIntent: intent,
10206
10290
  style: style,
10207
10291
  testID: testID
10208
- }, nativeProps), /*#__PURE__*/React.createElement(StyledText$1, {
10209
- themeIntent: intent
10292
+ }, nativeProps), /*#__PURE__*/React.createElement(StyledText, {
10293
+ themeIntent: intent,
10294
+ fontSize: "small",
10295
+ fontWeight: "semi-bold"
10210
10296
  }, content));
10211
10297
  };
10212
10298
 
@@ -19875,85 +19961,14 @@ var isHeroIcon = function isHeroIcon(x) {
19875
19961
  return IconList.includes(x);
19876
19962
  };
19877
19963
 
19878
- var _templateObject$7, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1;
19879
- var StyledText = styled(Text$1)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
19880
- var themeFontSize = _ref.themeFontSize,
19881
- theme = _ref.theme;
19882
-
19883
- switch (themeFontSize) {
19884
- case 'small':
19885
- 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);
19886
-
19887
- case 'medium':
19888
- 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);
19889
-
19890
- case 'large':
19891
- 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);
19892
-
19893
- case 'xlarge':
19894
- 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);
19895
- }
19896
- }, function (_ref2) {
19897
- var themeFontWeight = _ref2.themeFontWeight,
19898
- theme = _ref2.theme;
19899
-
19900
- switch (themeFontWeight) {
19901
- case 'light':
19902
- return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.light);
19903
-
19904
- case 'regular':
19905
- return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.regular);
19906
-
19907
- case 'semi-bold':
19908
- return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-family: ", ";\n "])), theme.__hd__.typography.fonts.semiBold);
19909
- }
19910
- }, function (_ref3) {
19911
- var themeIntent = _ref3.themeIntent,
19912
- theme = _ref3.theme;
19913
-
19914
- switch (themeIntent) {
19915
- case 'body':
19916
- return css(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.body);
19917
-
19918
- case 'subdued':
19919
- return css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.subdued);
19920
-
19921
- case 'primary':
19922
- return css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.primary);
19923
- }
19924
- });
19925
-
19926
- var _excluded$3 = ["children", "fontSize", "fontWeight", "intent"];
19927
-
19928
- var Text = function Text(_ref) {
19929
- var children = _ref.children,
19930
- _ref$fontSize = _ref.fontSize,
19931
- fontSize = _ref$fontSize === void 0 ? 'medium' : _ref$fontSize,
19932
- _ref$fontWeight = _ref.fontWeight,
19933
- fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
19934
- _ref$intent = _ref.intent,
19935
- intent = _ref$intent === void 0 ? 'body' : _ref$intent,
19936
- nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
19937
-
19938
- return /*#__PURE__*/React.createElement(StyledText, _extends$1({
19939
- themeFontSize: fontSize,
19940
- themeFontWeight: fontWeight,
19941
- themeIntent: intent
19942
- }, nativeProps), children);
19943
- };
19944
-
19945
- var Typography = {
19946
- Text: Text
19947
- };
19948
-
19949
- var _templateObject$6, _templateObject2$3, _templateObject3$2, _templateObject4$2, _templateObject5$2, _templateObject6$1;
19950
- var BottomNavigationTab = styled(View)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
19964
+ var _templateObject$7, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2;
19965
+ var BottomNavigationTab = styled(View)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
19951
19966
  var themeVisibility = _ref.themeVisibility;
19952
19967
  return themeVisibility === false ? 'none' : 'flex';
19953
19968
  });
19954
- var BottomNavigationContainer = styled(View)(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n flex: 1;\n overflow: hidden;\n"])));
19955
- var ContentWrapper = styled(View)(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n flex: 1;\n"])));
19956
- var BottomBarWrapper = styled(View)(_templateObject4$2 || (_templateObject4$2 = _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) {
19969
+ var BottomNavigationContainer = styled(View)(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n flex: 1;\n overflow: hidden;\n"])));
19970
+ var ContentWrapper$1 = styled(View)(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n flex: 1;\n"])));
19971
+ var BottomBarWrapper = styled(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) {
19957
19972
  var theme = _ref2.theme,
19958
19973
  themeInsets = _ref2.themeInsets;
19959
19974
  return theme.__hd__.bottomNavigation.sizes.height + themeInsets.bottom;
@@ -19985,13 +20000,17 @@ var BottomBarWrapper = styled(View)(_templateObject4$2 || (_templateObject4$2 =
19985
20000
  var theme = _ref11.theme;
19986
20001
  return theme.__hd__.bottomNavigation.shadows.elevation;
19987
20002
  });
19988
- var BottomBar = styled(View)(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteral(["\n flex: 1;\n flex-direction: row;\n overflow: hidden;\n align-items: center;\n"])));
19989
- var BottomBarItem = styled(View)(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteral(["\n flex: 1;\n align-items: center;\n"])));
20003
+ var BottomBar = styled(View)(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteral(["\n flex: 1;\n flex-direction: row;\n overflow: hidden;\n align-items: center;\n"])));
20004
+ var BottomBarItem = styled(View)(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n flex: 1;\n align-items: center;\n"])));
20005
+ var StyledBottomBarText = styled(Typography.Text)(_templateObject7$2 || (_templateObject7$2 = _taggedTemplateLiteral(["\n margin-top: ", ";\n"])), function (_ref12) {
20006
+ var theme = _ref12.theme;
20007
+ return theme.__hd__.bottomNavigation.space.titleMarginTop;
20008
+ });
19990
20009
 
19991
20010
  var isIOS = Platform.OS === 'ios';
19992
20011
  Platform.OS === 'android';
19993
20012
 
19994
- var _excluded$2 = ["onChange", "renderActiveTabOnly", "selectedTabKey", "tabs"];
20013
+ var _excluded$3 = ["onChange", "renderActiveTabOnly", "selectedTabKey", "tabs"];
19995
20014
 
19996
20015
  var getInactiveIcon = function getInactiveIcon(icon) {
19997
20016
  var inactiveIcon = "".concat(icon, "-outlined");
@@ -20004,9 +20023,8 @@ var BottomNavigation = function BottomNavigation(_ref) {
20004
20023
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
20005
20024
  selectedTabKey = _ref.selectedTabKey,
20006
20025
  tabs = _ref.tabs,
20007
- nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
20026
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
20008
20027
 
20009
- var theme = useTheme();
20010
20028
  var insets = useSafeAreaInsets();
20011
20029
  /**
20012
20030
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -20024,7 +20042,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
20024
20042
  });
20025
20043
  }
20026
20044
 
20027
- return /*#__PURE__*/React.createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React.createElement(ContentWrapper, null, tabs.map(function (tab) {
20045
+ return /*#__PURE__*/React.createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React.createElement(ContentWrapper$1, null, tabs.map(function (tab) {
20028
20046
  var key = tab.key,
20029
20047
  component = tab.component;
20030
20048
  var active = selectedTabKey === key;
@@ -20071,20 +20089,17 @@ var BottomNavigation = function BottomNavigation(_ref) {
20071
20089
  icon: active ? icon : inactiveIcon,
20072
20090
  intent: active ? 'primary' : 'text',
20073
20091
  testID: "hero-icon-".concat(icon)
20074
- }), title && /*#__PURE__*/React.createElement(Typography.Text, {
20092
+ }), title && /*#__PURE__*/React.createElement(StyledBottomBarText, {
20075
20093
  fontSize: "small",
20076
20094
  fontWeight: "semi-bold",
20077
20095
  intent: active ? 'primary' : 'body',
20078
- style: {
20079
- marginTop: theme.space.xsmall
20080
- },
20081
20096
  numberOfLines: 1
20082
20097
  }, title)));
20083
20098
  }))));
20084
20099
  };
20085
20100
 
20086
- var _templateObject$5;
20087
- var StyledCard = styled(View)(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n border-radius: ", ";\n padding: ", ";\n overflow: hidden;\n"])), function (_ref) {
20101
+ var _templateObject$6;
20102
+ var StyledCard = styled(View)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n border-radius: ", ";\n padding: ", ";\n overflow: hidden;\n"])), function (_ref) {
20088
20103
  var theme = _ref.theme;
20089
20104
  return theme.__hd__.card.radii["default"];
20090
20105
  }, function (_ref2) {
@@ -20096,8 +20111,8 @@ var Card = function Card(props) {
20096
20111
  return /*#__PURE__*/React.createElement(StyledCard, props);
20097
20112
  };
20098
20113
 
20099
- var _templateObject$4, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
20100
- 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) {
20114
+ var _templateObject$5, _templateObject2$3, _templateObject3$2, _templateObject4$2, _templateObject5$2, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
20115
+ var StyledDivider = styled(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) {
20101
20116
  var theme = _ref.theme;
20102
20117
  return theme.__hd__.divider.borderWidths["default"];
20103
20118
  }, function (_ref2) {
@@ -20109,22 +20124,22 @@ var StyledDivider = styled(View)(_templateObject$4 || (_templateObject$4 = _tagg
20109
20124
 
20110
20125
  switch (themeMarginHorizontal) {
20111
20126
  case undefined:
20112
- return css(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral([""])));
20127
+ return css(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral([""])));
20113
20128
 
20114
20129
  case 'xsmall':
20115
- return css(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xsmall);
20130
+ return css(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xsmall);
20116
20131
 
20117
20132
  case 'small':
20118
- return css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.small);
20133
+ return css(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.small);
20119
20134
 
20120
20135
  case 'medium':
20121
- return css(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.medium);
20136
+ return css(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.medium);
20122
20137
 
20123
20138
  case 'large':
20124
- return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.large);
20139
+ return css(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.large);
20125
20140
 
20126
20141
  case 'xlarge':
20127
- return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xlarge);
20142
+ return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xlarge);
20128
20143
  }
20129
20144
  }, function (_ref4) {
20130
20145
  var themeMarginVertical = _ref4.themeMarginVertical,
@@ -20132,7 +20147,7 @@ var StyledDivider = styled(View)(_templateObject$4 || (_templateObject$4 = _tagg
20132
20147
 
20133
20148
  switch (themeMarginVertical) {
20134
20149
  case undefined:
20135
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral([""])));
20150
+ return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral([""])));
20136
20151
 
20137
20152
  case 'xsmall':
20138
20153
  return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.xsmall);
@@ -20151,14 +20166,14 @@ var StyledDivider = styled(View)(_templateObject$4 || (_templateObject$4 = _tagg
20151
20166
  }
20152
20167
  });
20153
20168
 
20154
- var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
20169
+ var _excluded$2 = ["marginHorizontal", "marginVertical", "style", "testID"];
20155
20170
 
20156
20171
  var Divider = function Divider(_ref) {
20157
20172
  var marginHorizontal = _ref.marginHorizontal,
20158
20173
  marginVertical = _ref.marginVertical,
20159
20174
  style = _ref.style,
20160
20175
  testID = _ref.testID,
20161
- nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
20176
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
20162
20177
 
20163
20178
  return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({
20164
20179
  themeMarginHorizontal: marginHorizontal,
@@ -20168,6 +20183,167 @@ var Divider = function Divider(_ref) {
20168
20183
  }, nativeProps));
20169
20184
  };
20170
20185
 
20186
+ var _templateObject$4, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6, _templateObject7, _templateObject8;
20187
+ var TabScreen = styled(View)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
20188
+ var themeVisibility = _ref.themeVisibility;
20189
+ return themeVisibility === false ? 'none' : 'flex';
20190
+ });
20191
+ var TabContainer = styled(View)(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n flex: 1;\n overflow: hidden;\n"])));
20192
+ var ContentWrapper = styled(View)(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n flex: 1;\n"])));
20193
+ var HeaderTabWrapper = styled(View)(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n padding-left: ", "px;\n padding-right: ", "px;\n background-color: ", ";\n"])), function (_ref2) {
20194
+ var themeInsets = _ref2.themeInsets;
20195
+ return Math.max(themeInsets.left, themeInsets.right);
20196
+ }, function (_ref3) {
20197
+ var themeInsets = _ref3.themeInsets;
20198
+ return Math.max(themeInsets.left, themeInsets.right);
20199
+ }, function (_ref4) {
20200
+ var theme = _ref4.theme;
20201
+ return theme.__hd__.tabs.colors.background;
20202
+ });
20203
+ var StyledFlatList = styled(FlatList)(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_ref5) {
20204
+ var theme = _ref5.theme;
20205
+ return theme.__hd__.tabs.space.flatListHorizontalPadding;
20206
+ }, function (_ref6) {
20207
+ var theme = _ref6.theme;
20208
+ return theme.__hd__.tabs.space.flatListHorizontalPadding;
20209
+ });
20210
+ var HeaderTabItem = styled(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) {
20211
+ var theme = _ref7.theme;
20212
+ return theme.__hd__.tabs.space.itemHorizontalPadding;
20213
+ }, function (_ref8) {
20214
+ var theme = _ref8.theme;
20215
+ return theme.__hd__.tabs.space.itemHorizontalPadding;
20216
+ }, function (_ref9) {
20217
+ var theme = _ref9.theme;
20218
+ return theme.__hd__.tabs.space.itemVerticalPadding;
20219
+ }, function (_ref10) {
20220
+ var theme = _ref10.theme;
20221
+ return theme.__hd__.tabs.space.itemVerticalPadding;
20222
+ });
20223
+ var StyledHeaderTabIcon = styled(Icon)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n color: ", ";\n"])), function (_ref11) {
20224
+ var theme = _ref11.theme,
20225
+ themeActive = _ref11.themeActive;
20226
+ return themeActive ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive;
20227
+ });
20228
+ var StyledHeaderTabText = styled(Typography.Text)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-left: ", ";\n color: ", ";\n"])), function (_ref12) {
20229
+ var theme = _ref12.theme;
20230
+ return theme.__hd__.tabs.space.titleMarginLeft;
20231
+ }, function (_ref13) {
20232
+ var theme = _ref13.theme,
20233
+ themeActive = _ref13.themeActive;
20234
+ return themeActive ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive;
20235
+ });
20236
+
20237
+ var _excluded$1 = ["onChange", "renderActiveTabOnly", "selectedTabKey", "tabs"];
20238
+
20239
+ var Tabs = function Tabs(_ref) {
20240
+ var onChange = _ref.onChange,
20241
+ _ref$renderActiveTabO = _ref.renderActiveTabOnly,
20242
+ renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
20243
+ selectedTabKey = _ref.selectedTabKey,
20244
+ tabs = _ref.tabs,
20245
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
20246
+
20247
+ var flatListRef = React.useRef(null);
20248
+ var insets = useSafeAreaInsets();
20249
+ /**
20250
+ * List of loaded tabs, tabs will be loaded when navigated to.
20251
+ */
20252
+
20253
+ var _React$useState = React.useState([selectedTabKey]),
20254
+ _React$useState2 = _slicedToArray(_React$useState, 2),
20255
+ loaded = _React$useState2[0],
20256
+ setLoaded = _React$useState2[1];
20257
+
20258
+ if (!loaded.includes(selectedTabKey)) {
20259
+ // Set the current tab to be loaded if it was not loaded before
20260
+ setLoaded(function (loadedState) {
20261
+ return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
20262
+ });
20263
+ }
20264
+
20265
+ return /*#__PURE__*/React.createElement(TabContainer, nativeProps, /*#__PURE__*/React.createElement(HeaderTabWrapper, {
20266
+ themeInsets: insets
20267
+ }, /*#__PURE__*/React.createElement(StyledFlatList, {
20268
+ ref: flatListRef,
20269
+ horizontal: true,
20270
+ data: tabs,
20271
+ keyExtractor: function keyExtractor(tab) {
20272
+ return String(tab.key);
20273
+ },
20274
+ showsHorizontalScrollIndicator: false,
20275
+ onScrollToIndexFailed: function onScrollToIndexFailed(_ref2) {
20276
+ var index = _ref2.index;
20277
+ setTimeout(function () {
20278
+ var _flatListRef$current;
20279
+
20280
+ return (_flatListRef$current = flatListRef.current) === null || _flatListRef$current === void 0 ? void 0 : _flatListRef$current.scrollToIndex({
20281
+ index: index,
20282
+ viewPosition: 0.5
20283
+ });
20284
+ }, 100);
20285
+ },
20286
+ renderItem: function renderItem(_ref3) {
20287
+ var tab = _ref3.item,
20288
+ index = _ref3.index;
20289
+ var key = tab.key,
20290
+ icon = tab.icon,
20291
+ title = tab.title,
20292
+ testID = tab.testID;
20293
+ var active = selectedTabKey === key;
20294
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
20295
+ key: key,
20296
+ onPress: function onPress() {
20297
+ if (key !== selectedTabKey) {
20298
+ var _flatListRef$current2;
20299
+
20300
+ onChange(key);
20301
+ (_flatListRef$current2 = flatListRef.current) === null || _flatListRef$current2 === void 0 ? void 0 : _flatListRef$current2.scrollToIndex({
20302
+ index: index,
20303
+ viewPosition: 0.5
20304
+ });
20305
+ }
20306
+ },
20307
+ testID: testID
20308
+ }, /*#__PURE__*/React.createElement(HeaderTabItem, null, /*#__PURE__*/React.createElement(StyledHeaderTabIcon, {
20309
+ icon: icon,
20310
+ testID: "hero-icon-".concat(icon),
20311
+ themeActive: active
20312
+ }), /*#__PURE__*/React.createElement(StyledHeaderTabText, {
20313
+ fontWeight: "semi-bold",
20314
+ numberOfLines: 1,
20315
+ themeActive: active
20316
+ }, title)));
20317
+ }
20318
+ })), /*#__PURE__*/React.createElement(ContentWrapper, null, tabs.map(function (tab) {
20319
+ var key = tab.key,
20320
+ component = tab.component;
20321
+ var active = selectedTabKey === key;
20322
+
20323
+ if (renderActiveTabOnly && !active) {
20324
+ return null;
20325
+ }
20326
+
20327
+ if (!loaded.includes(key)) {
20328
+ // Don't render a screen if we've never navigated to it
20329
+ return null;
20330
+ }
20331
+
20332
+ return /*#__PURE__*/React.createElement(TabScreen, {
20333
+ key: key,
20334
+ testID: "tab-screen-".concat(selectedTabKey),
20335
+ pointerEvents: active ? 'auto' : 'none',
20336
+ accessibilityElementsHidden: !active,
20337
+ importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
20338
+ collapsable: false,
20339
+ removeClippedSubviews: // On iOS, set removeClippedSubviews to true only when not focused
20340
+ // This is an workaround for a bug where the clipped view never re-appears.
20341
+ isIOS ? selectedTabKey !== key : true,
20342
+ themeVisibility: active
20343
+ }, component);
20344
+ })));
20345
+ };
20346
+
20171
20347
  var _templateObject$3;
20172
20348
  var StyledFABIcon = styled(Icon)(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n"])), function (_ref) {
20173
20349
  var theme = _ref.theme;
@@ -20305,7 +20481,7 @@ var StyledFAB = styled(FAB)(_templateObject3 || (_templateObject3 = _taggedTempl
20305
20481
  return theme.space.large;
20306
20482
  }, function (_ref2) {
20307
20483
  var theme = _ref2.theme;
20308
- return theme.space.large;
20484
+ return theme.space.small;
20309
20485
  });
20310
20486
  var StyledBackdrop = styled(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) {
20311
20487
  var theme = _ref3.theme;
@@ -20397,4 +20573,28 @@ var index = Object.assign(FAB, {
20397
20573
  ActionGroup: ActionGroup
20398
20574
  });
20399
20575
 
20400
- export { Badge, BottomNavigation, Card, Divider, index as FAB, Icon, ThemeProvider, Typography, getTheme, scale, theme, useTheme };
20576
+ var IconButton = function IconButton(_ref) {
20577
+ var hitSlop = _ref.hitSlop,
20578
+ onPress = _ref.onPress,
20579
+ icon = _ref.icon,
20580
+ testID = _ref.testID,
20581
+ style = _ref.style,
20582
+ size = _ref.size,
20583
+ intent = _ref.intent;
20584
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
20585
+ style: style,
20586
+ onPress: onPress,
20587
+ testID: testID,
20588
+ hitSlop: hitSlop
20589
+ }, /*#__PURE__*/React.createElement(Icon, {
20590
+ icon: icon,
20591
+ size: size,
20592
+ intent: intent
20593
+ }));
20594
+ };
20595
+
20596
+ var Button = {
20597
+ Icon: IconButton
20598
+ };
20599
+
20600
+ export { Badge, BottomNavigation, Button, Card, Divider, index as FAB, Icon, Tabs, ThemeProvider, Typography, getTheme, scale, theme, useTheme };