@hero-design/rn 7.0.6 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.eslintrc.json +4 -3
  2. package/babel.config.js +1 -1
  3. package/es/index.js +411 -134
  4. package/lib/index.js +411 -131
  5. package/package.json +5 -4
  6. package/playground/components/BottomNavigation.tsx +69 -0
  7. package/playground/components/Card.tsx +174 -112
  8. package/playground/components/FAB.tsx +49 -0
  9. package/playground/index.tsx +6 -1
  10. package/rollup.config.js +1 -1
  11. package/src/components/BottomNavigation/StyledBottomNavigation.tsx +58 -0
  12. package/src/components/BottomNavigation/__tests__/BottomNavigation.spec.tsx +95 -0
  13. package/src/components/BottomNavigation/__tests__/__snapshots__/BottomNavigation.spec.tsx.snap +315 -0
  14. package/src/components/BottomNavigation/index.tsx +169 -0
  15. package/src/components/Card/StyledCard.tsx +1 -0
  16. package/src/components/Card/__tests__/__snapshots__/Card.spec.tsx.snap +5 -4
  17. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +5 -4
  18. package/src/components/FAB/AnimatedFABIcon.tsx +47 -0
  19. package/src/components/FAB/StyledFABContainer.tsx +14 -0
  20. package/src/components/FAB/StyledFABIcon.tsx +9 -0
  21. package/src/components/FAB/__tests__/AnimatedFABIcon.spec.tsx +20 -0
  22. package/src/components/FAB/__tests__/StyledFABContainer.spec.tsx +18 -0
  23. package/src/components/FAB/__tests__/StyledFABIcon.spec.tsx +16 -0
  24. package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +71 -0
  25. package/src/components/FAB/__tests__/__snapshots__/StyledFABContainer.spec.tsx.snap +46 -0
  26. package/src/components/FAB/__tests__/__snapshots__/StyledFABIcon.spec.tsx.snap +21 -0
  27. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +120 -0
  28. package/src/components/FAB/__tests__/index.spec.tsx +58 -0
  29. package/src/components/FAB/index.tsx +56 -0
  30. package/src/components/Icon/index.tsx +1 -1
  31. package/src/components/Icon/utils.ts +6 -0
  32. package/src/components/Typography/Text/StyledText.tsx +5 -1
  33. package/src/components/Typography/Text/index.tsx +1 -1
  34. package/src/index.ts +6 -0
  35. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +30 -1
  36. package/src/theme/components/bottomNavigation.ts +23 -0
  37. package/src/theme/components/card.ts +1 -1
  38. package/src/theme/components/fab.ts +21 -0
  39. package/src/theme/components/typography.ts +1 -0
  40. package/src/theme/global/space.ts +11 -9
  41. package/src/theme/global/typography.ts +11 -9
  42. package/src/theme/index.ts +6 -0
  43. package/src/utils/__tests__/scale.spec.ts +26 -0
  44. package/src/utils/helpers.ts +4 -0
  45. package/src/utils/scale.ts +10 -0
  46. package/testUtils/setup.ts +4 -0
  47. package/types/playground/components/BottomNavigation.d.ts +2 -0
  48. package/types/playground/components/FAB.d.ts +2 -0
  49. package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +17 -0
  50. package/types/{components/Card/__tests__/Card.spec.d.ts → src/components/BottomNavigation/__tests__/BottomNavigation.spec.d.ts} +0 -0
  51. package/types/src/components/BottomNavigation/index.d.ts +40 -0
  52. package/types/src/components/FAB/AnimatedFABIcon.d.ts +6 -0
  53. package/types/src/components/FAB/StyledFABContainer.d.ts +3 -0
  54. package/types/src/components/FAB/StyledFABIcon.d.ts +3 -0
  55. package/types/{components/Card/__tests__/StyledCard.spec.d.ts → src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts} +0 -0
  56. package/types/{components/Divider/__tests__/StyledDivider.spec.d.ts → src/components/FAB/__tests__/StyledFABContainer.spec.d.ts} +0 -0
  57. package/types/{components/ExampleComponent/__tests__/StyledView.spec.d.ts → src/components/FAB/__tests__/StyledFABIcon.spec.d.ts} +0 -0
  58. package/types/src/components/{Typography/Text/__test__ → FAB/__tests__}/index.spec.d.ts +0 -0
  59. package/types/src/components/FAB/index.d.ts +30 -0
  60. package/types/src/components/Icon/index.d.ts +1 -1
  61. package/types/src/components/Icon/utils.d.ts +2 -0
  62. package/types/src/components/Typography/Text/StyledText.d.ts +1 -1
  63. package/types/src/components/Typography/Text/index.d.ts +1 -1
  64. package/types/src/index.d.ts +4 -1
  65. package/types/src/theme/components/bottomNavigation.d.ts +17 -0
  66. package/types/src/theme/components/fab.d.ts +15 -0
  67. package/types/src/theme/components/typography.d.ts +1 -0
  68. package/types/src/theme/index.d.ts +4 -0
  69. package/types/src/{components/Typography/Text/__test__/StyledText.spec.d.ts → utils/__tests__/scale.spec.d.ts} +0 -0
  70. package/types/src/utils/helpers.d.ts +2 -0
  71. package/types/src/utils/scale.d.ts +2 -0
  72. package/.expo/README.md +0 -15
  73. package/.expo/packager-info.json +0 -10
  74. package/.expo/settings.json +0 -10
  75. package/types/components/Card/StyledCard.d.ts +0 -3
  76. package/types/components/Card/index.d.ts +0 -5
  77. package/types/components/Divider/StyledDivider.d.ts +0 -7
  78. package/types/components/Divider/index.d.ts +0 -12
  79. package/types/components/ExampleComponent/StyledView.d.ts +0 -7
  80. package/types/components/ExampleComponent/index.d.ts +0 -16
  81. package/types/index.d.ts +0 -5
  82. package/types/styled-components.d.ts +0 -6
  83. package/types/theme/__tests__/index.spec.d.ts +0 -1
  84. package/types/theme/components/card.d.ts +0 -10
  85. package/types/theme/components/divider.d.ts +0 -17
  86. package/types/theme/components/exampleComponent.d.ts +0 -14
  87. package/types/theme/global/borders.d.ts +0 -4
  88. package/types/theme/global/colors.d.ts +0 -26
  89. package/types/theme/global/index.d.ts +0 -63
  90. package/types/theme/global/space.d.ts +0 -12
  91. package/types/theme/global/typography.d.ts +0 -21
  92. package/types/theme/index.d.ts +0 -13
package/lib/index.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var require$$0$1 = require('react-native');
7
+ var reactNativeSafeAreaContext = require('react-native-safe-area-context');
7
8
 
8
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
10
 
@@ -8139,7 +8140,7 @@ Processor$1["default"] = Processor$1;
8139
8140
  Root$2.registerProcessor(Processor$1);
8140
8141
  Document$1.registerProcessor(Processor$1);
8141
8142
 
8142
- var _excluded$3 = ["inputs"],
8143
+ var _excluded$5 = ["inputs"],
8143
8144
  _excluded2 = ["inputId"];
8144
8145
 
8145
8146
  var Declaration$1 = declaration;
@@ -8156,7 +8157,7 @@ function fromJSON$1(json, inputs) {
8156
8157
  });
8157
8158
 
8158
8159
  var ownInputs = json.inputs,
8159
- defaults = _objectWithoutProperties$1(json, _excluded$3);
8160
+ defaults = _objectWithoutProperties$1(json, _excluded$5);
8160
8161
 
8161
8162
  if (ownInputs) {
8162
8163
  inputs = [];
@@ -9881,30 +9882,41 @@ var systemPalette = {
9881
9882
  outline: palette.greyLight60
9882
9883
  };
9883
9884
 
9885
+ var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
9886
+
9887
+ var scale = function scale(size) {
9888
+ var _Dimensions$get = require$$0$1.Dimensions.get('window'),
9889
+ width = _Dimensions$get.width,
9890
+ height = _Dimensions$get.height;
9891
+
9892
+ var shortDimension = width < height ? width : height;
9893
+ return shortDimension / BASE_WIDTH * size;
9894
+ };
9895
+
9884
9896
  var BASE$1 = 8;
9885
9897
  var space = {
9886
- xxsmall: BASE$1 * 0.25,
9887
- xsmall: BASE$1 * 0.5,
9888
- small: BASE$1,
9889
- medium: BASE$1 * 2,
9890
- large: BASE$1 * 3,
9891
- xlarge: BASE$1 * 4,
9892
- xxlarge: BASE$1 * 5,
9893
- xxxlarge: BASE$1 * 6,
9894
- xxxxlarge: BASE$1 * 7
9898
+ xxsmall: scale(BASE$1 * 0.25),
9899
+ xsmall: scale(BASE$1 * 0.5),
9900
+ small: scale(BASE$1),
9901
+ medium: scale(BASE$1 * 2),
9902
+ large: scale(BASE$1 * 3),
9903
+ xlarge: scale(BASE$1 * 4),
9904
+ xxlarge: scale(BASE$1 * 5),
9905
+ xxxlarge: scale(BASE$1 * 6),
9906
+ xxxxlarge: scale(BASE$1 * 7)
9895
9907
  };
9896
9908
 
9897
9909
  var BASE = 16;
9898
9910
  var fontSizes = {
9899
- xxxxxlarge: BASE * 2,
9900
- xxxxlarge: BASE * 1.75,
9901
- xxxlarge: BASE * 1.5,
9902
- xxlarge: BASE * 1.25,
9903
- xlarge: BASE * 1.125,
9904
- large: BASE,
9905
- medium: BASE * 0.875,
9906
- small: BASE * 0.75,
9907
- xsmall: BASE * 0.625 // 10
9911
+ xxxxxlarge: scale(BASE * 2),
9912
+ xxxxlarge: scale(BASE * 1.75),
9913
+ xxxlarge: scale(BASE * 1.5),
9914
+ xxlarge: scale(BASE * 1.25),
9915
+ xlarge: scale(BASE * 1.125),
9916
+ large: scale(BASE),
9917
+ medium: scale(BASE * 0.875),
9918
+ small: scale(BASE * 0.75),
9919
+ xsmall: scale(BASE * 0.625) // 10
9908
9920
 
9909
9921
  };
9910
9922
  var fontWeights = {
@@ -9970,12 +9982,33 @@ var getBadgeTheme = function getBadgeTheme(theme) {
9970
9982
  };
9971
9983
  };
9972
9984
 
9985
+ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
9986
+ var colors = {
9987
+ shadow: theme.colors.backgroundDark,
9988
+ background: theme.colors.platformBackground
9989
+ };
9990
+ var sizes = {
9991
+ height: 72
9992
+ };
9993
+ var shadows = {
9994
+ offset: "0px 3px",
9995
+ opacity: 0.27,
9996
+ radius: "4.65px",
9997
+ elevation: 10
9998
+ };
9999
+ return {
10000
+ colors: colors,
10001
+ shadows: shadows,
10002
+ sizes: sizes
10003
+ };
10004
+ };
10005
+
9973
10006
  var getCardTheme = function getCardTheme(theme) {
9974
10007
  var radii = {
9975
10008
  "default": "12px"
9976
10009
  };
9977
10010
  var padding = {
9978
- "default": "".concat(theme.space.medium, "px")
10011
+ "default": "".concat(theme.space.small, "px")
9979
10012
  };
9980
10013
  return {
9981
10014
  radii: radii,
@@ -10029,7 +10062,8 @@ var getIconTheme = function getIconTheme(theme) {
10029
10062
  var getTypographyTheme = function getTypographyTheme(theme) {
10030
10063
  var colors = {
10031
10064
  body: theme.colors.text,
10032
- subdued: theme.colors.disabledText
10065
+ subdued: theme.colors.disabledText,
10066
+ primary: theme.colors.primary
10033
10067
  };
10034
10068
  var fontSizes = {
10035
10069
  small: theme.fontSizes.small,
@@ -10056,29 +10090,50 @@ var getTypographyTheme = function getTypographyTheme(theme) {
10056
10090
  };
10057
10091
  };
10058
10092
 
10093
+ var getFABTheme = function getFABTheme(theme) {
10094
+ var colors = {
10095
+ buttonBackground: theme.colors.backgroundDark,
10096
+ icon: theme.colors.invertedText
10097
+ };
10098
+ var sizes = {
10099
+ width: '64px',
10100
+ height: '64px'
10101
+ };
10102
+ var fontSizes = {
10103
+ "default": "".concat(theme.fontSizes.xxxxlarge, "px")
10104
+ };
10105
+ return {
10106
+ fontSizes: fontSizes,
10107
+ colors: colors,
10108
+ sizes: sizes
10109
+ };
10110
+ };
10111
+
10059
10112
  var getTheme = function getTheme() {
10060
10113
  var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalTheme;
10061
10114
  return _objectSpread2(_objectSpread2({}, theme), {}, {
10062
10115
  __hd__: {
10063
10116
  badge: getBadgeTheme(theme),
10117
+ bottomNavigation: getBottomNavigationTheme(theme),
10064
10118
  card: getCardTheme(theme),
10065
10119
  divider: getDividerTheme(theme),
10066
10120
  icon: getIconTheme(theme),
10067
- typography: getTypographyTheme(theme)
10121
+ typography: getTypographyTheme(theme),
10122
+ fab: getFABTheme(theme)
10068
10123
  }
10069
10124
  });
10070
10125
  };
10071
10126
 
10072
10127
  var theme = getTheme();
10073
10128
 
10074
- var _templateObject$4, _templateObject2$3, _templateObject3$2, _templateObject4$2;
10129
+ var _templateObject$7, _templateObject2$4, _templateObject3$3, _templateObject4$3;
10075
10130
  var BACKGROUND_INTENTS = {
10076
10131
  success: 'successBackground',
10077
10132
  warning: 'warningBackground',
10078
10133
  danger: 'dangerBackground',
10079
10134
  info: 'infoBackground'
10080
10135
  };
10081
- var StyledView = styled(require$$0$1.View)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n\n ", ";\n"])), function (_ref) {
10136
+ var StyledView = styled(require$$0$1.View)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n\n ", ";\n"])), function (_ref) {
10082
10137
  var theme = _ref.theme;
10083
10138
  return theme.__hd__.badge.borderWidths["default"];
10084
10139
  }, function (_ref2) {
@@ -10089,7 +10144,7 @@ var StyledView = styled(require$$0$1.View)(_templateObject$4 || (_templateObject
10089
10144
  return theme.__hd__.badge.padding["default"];
10090
10145
  }, function (_ref4) {
10091
10146
  var themeIntent = _ref4.themeIntent;
10092
- return css(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n border-color: ", ";\n background-color: ", ";\n "])), function (_ref5) {
10147
+ return css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n border-color: ", ";\n background-color: ", ";\n "])), function (_ref5) {
10093
10148
  var theme = _ref5.theme;
10094
10149
  return theme.__hd__.badge.colors[themeIntent];
10095
10150
  }, function (_ref6) {
@@ -10097,7 +10152,7 @@ var StyledView = styled(require$$0$1.View)(_templateObject$4 || (_templateObject
10097
10152
  return theme.__hd__.badge.colors[BACKGROUND_INTENTS[themeIntent]];
10098
10153
  });
10099
10154
  });
10100
- var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n font-weight: ", ";\n font-size: ", ";\n\n ", ";\n"])), function (_ref7) {
10155
+ var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n font-weight: ", ";\n font-size: ", ";\n\n ", ";\n"])), function (_ref7) {
10101
10156
  var theme = _ref7.theme;
10102
10157
  return theme.__hd__.badge.fontWeights["default"];
10103
10158
  }, function (_ref8) {
@@ -10105,13 +10160,13 @@ var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$2 || (_templateObj
10105
10160
  return theme.__hd__.badge.fontSizes["default"];
10106
10161
  }, function (_ref9) {
10107
10162
  var themeIntent = _ref9.themeIntent;
10108
- return css(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (_ref10) {
10163
+ return css(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (_ref10) {
10109
10164
  var theme = _ref10.theme;
10110
10165
  return theme.__hd__.badge.colors[themeIntent];
10111
10166
  });
10112
10167
  });
10113
10168
 
10114
- var _excluded$2 = ["content", "intent", "style", "testID"];
10169
+ var _excluded$4 = ["content", "intent", "style", "testID"];
10115
10170
 
10116
10171
  var Badge = function Badge(_ref) {
10117
10172
  var content = _ref.content,
@@ -10119,7 +10174,7 @@ var Badge = function Badge(_ref) {
10119
10174
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
10120
10175
  style = _ref.style,
10121
10176
  testID = _ref.testID,
10122
- nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
10177
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$4);
10123
10178
 
10124
10179
  return /*#__PURE__*/React__default["default"].createElement(StyledView, _extends$1({
10125
10180
  themeIntent: intent,
@@ -10130,91 +10185,6 @@ var Badge = function Badge(_ref) {
10130
10185
  }, content));
10131
10186
  };
10132
10187
 
10133
- var _templateObject$3;
10134
- var StyledCard = styled(require$$0$1.View)(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n border-radius: ", ";\n padding: ", ";\n"])), function (_ref) {
10135
- var theme = _ref.theme;
10136
- return theme.__hd__.card.radii["default"];
10137
- }, function (_ref2) {
10138
- var theme = _ref2.theme;
10139
- return theme.__hd__.card.padding["default"];
10140
- });
10141
-
10142
- var Card = function Card(props) {
10143
- return /*#__PURE__*/React__default["default"].createElement(StyledCard, props);
10144
- };
10145
-
10146
- var _templateObject$2, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11, _templateObject12, _templateObject13;
10147
- var StyledDivider = styled(require$$0$1.View)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n max-width: 100%;\n\n ", "\n\n ", "\n"])), function (_ref) {
10148
- var theme = _ref.theme;
10149
- return theme.__hd__.divider.borderWidths["default"];
10150
- }, function (_ref2) {
10151
- var theme = _ref2.theme;
10152
- return theme.__hd__.divider.colors["default"];
10153
- }, function (_ref3) {
10154
- var themeMarginHorizontal = _ref3.themeMarginHorizontal,
10155
- theme = _ref3.theme;
10156
-
10157
- switch (themeMarginHorizontal) {
10158
- case undefined:
10159
- return css(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral([""])));
10160
-
10161
- case 'xsmall':
10162
- return css(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xsmall);
10163
-
10164
- case 'small':
10165
- return css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.small);
10166
-
10167
- case 'medium':
10168
- return css(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.medium);
10169
-
10170
- case 'large':
10171
- return css(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.large);
10172
-
10173
- case 'xlarge':
10174
- return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xlarge);
10175
- }
10176
- }, function (_ref4) {
10177
- var themeMarginVertical = _ref4.themeMarginVertical,
10178
- theme = _ref4.theme;
10179
-
10180
- switch (themeMarginVertical) {
10181
- case undefined:
10182
- return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral([""])));
10183
-
10184
- case 'xsmall':
10185
- return css(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.xsmall);
10186
-
10187
- case 'small':
10188
- return css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.small);
10189
-
10190
- case 'medium':
10191
- return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.medium);
10192
-
10193
- case 'large':
10194
- return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.large);
10195
-
10196
- case 'xlarge':
10197
- return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.xlarge);
10198
- }
10199
- });
10200
-
10201
- var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
10202
-
10203
- var Divider = function Divider(_ref) {
10204
- var marginHorizontal = _ref.marginHorizontal,
10205
- marginVertical = _ref.marginVertical,
10206
- style = _ref.style,
10207
- testID = _ref.testID,
10208
- nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
10209
-
10210
- return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({
10211
- themeMarginHorizontal: marginHorizontal,
10212
- themeMarginVertical: marginVertical,
10213
- style: style,
10214
- testID: testID
10215
- }, nativeProps));
10216
- };
10217
-
10218
10188
  var dist = {};
10219
10189
 
10220
10190
  function _interopRequireDefault$5(obj) {
@@ -19843,12 +19813,12 @@ var heroIconConfig = {
19843
19813
  preferences: preferences
19844
19814
  };
19845
19815
 
19846
- var _templateObject$1, _templateObject2$1;
19816
+ var _templateObject$6, _templateObject2$3;
19847
19817
  var HeroIcon = dist.createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
19848
- var StyledHeroIcon = styled(HeroIcon)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref) {
19818
+ var StyledHeroIcon = styled(HeroIcon)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref) {
19849
19819
  var themeIntent = _ref.themeIntent,
19850
19820
  themeSize = _ref.themeSize;
19851
- return css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", "px;\n "])), function (_ref2) {
19821
+ return css(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", "px;\n "])), function (_ref2) {
19852
19822
  var theme = _ref2.theme;
19853
19823
  return theme.__hd__.icon.colors[themeIntent];
19854
19824
  }, function (_ref3) {
@@ -19874,23 +19844,29 @@ var Icon = function Icon(_ref) {
19874
19844
  });
19875
19845
  };
19876
19846
 
19877
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
19878
- var StyledText = styled(require$$0$1.Text)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
19847
+ var IconList = ['activate', 'add-person', 'adjustment', 'alignment', 'bank', 'bell', 'billing', 'bookmark', 'box-check', 'box', 'buildings', 'cake', 'calendar-clock', 'calendar', 'carat-down-small', 'carat-down', 'carat-left', 'carat-right', 'carat-up', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'double-buildings', 'edit-template', 'envelope', 'expense', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'folder-user', 'folder', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'home', 'image', 'import', 'incident-siren', 'instapay', 'list', 'loading', 'loading-2', 'location', 'lock', 'media-content', 'menu', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'node', 'open-folder', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane', 'play-circle', 'print', 'raising-hands', 'reply', 'reschedule', 'rostering', 'save', 'schedule', 'search-person', 'send', 'speaker', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'survey', 'switch', 'tag', 'target', 'teams', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'activate-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'arrow-down', 'arrow-left', 'arrow-right', 'arrow-up', 'at-sign', 'bell-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bookmark-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'camera-outlined', 'cancel', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'comment-outlined', 'contacts-outlined', 'credit-card-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-coin-shine-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-outlined', 'edit-template-outlined', 'email-outlined', 'enter-arrow', 'envelope-outlined', 'expense-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-verified-outlined', 'folder-outlined', 'folder-user-outlined', 'funnel-filter-outline', 'graph-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'link-1', 'link-2', 'list-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'multiple-folders-outlined', 'multiple-users-outlined', 'node-outlined', 'number-points', 'number', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'qr-code-outlined', 're-assign', 'refresh', 'remove', 'reply-outlined', 'restart', 'return-arrow', 'rostering-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'send-outlined', 'share-1', 'share-2', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'speaker-outlined', 'star-outlined', 'stopwatch-outlined', 'strikethrough', 'survey-outlined', 'switch-outlined', 'sync', 'target-outlined', 'timesheet-outlined', 'transfer', 'trash-bin-outlined', 'unavailable', 'underline', 'unlock-outlined', 'upload-outlined', 'user-outlined', 'video-1-outlined', 'video-2-outlined'];
19848
+
19849
+ var isHeroIcon = function isHeroIcon(x) {
19850
+ return IconList.includes(x);
19851
+ };
19852
+
19853
+ var _templateObject$5, _templateObject2$2, _templateObject3$2, _templateObject4$2, _templateObject5$2, _templateObject6$2, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1;
19854
+ var StyledText = styled(require$$0$1.Text)(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
19879
19855
  var themeFontSize = _ref.themeFontSize,
19880
19856
  theme = _ref.theme;
19881
19857
 
19882
19858
  switch (themeFontSize) {
19883
19859
  case 'small':
19884
- return css(_templateObject2 || (_templateObject2 = _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);
19860
+ return css(_templateObject2$2 || (_templateObject2$2 = _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);
19885
19861
 
19886
19862
  case 'medium':
19887
- return css(_templateObject3 || (_templateObject3 = _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);
19863
+ return css(_templateObject3$2 || (_templateObject3$2 = _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);
19888
19864
 
19889
19865
  case 'large':
19890
- return css(_templateObject4 || (_templateObject4 = _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);
19866
+ return css(_templateObject4$2 || (_templateObject4$2 = _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);
19891
19867
 
19892
19868
  case 'xlarge':
19893
- return css(_templateObject5 || (_templateObject5 = _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);
19869
+ return css(_templateObject5$2 || (_templateObject5$2 = _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);
19894
19870
  }
19895
19871
  }, function (_ref2) {
19896
19872
  var themeFontWeight = _ref2.themeFontWeight,
@@ -19898,13 +19874,13 @@ var StyledText = styled(require$$0$1.Text)(_templateObject || (_templateObject =
19898
19874
 
19899
19875
  switch (themeFontWeight) {
19900
19876
  case 'light':
19901
- return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-weight: ", ";\n "])), theme.__hd__.typography.fontWeights.light);
19877
+ return css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n font-weight: ", ";\n "])), theme.__hd__.typography.fontWeights.light);
19902
19878
 
19903
19879
  case 'regular':
19904
- return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n font-weight: ", ";\n "])), theme.__hd__.typography.fontWeights.regular);
19880
+ return css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n font-weight: ", ";\n "])), theme.__hd__.typography.fontWeights.regular);
19905
19881
 
19906
19882
  case 'semi-bold':
19907
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-weight: ", ";\n "])), theme.__hd__.typography.fontWeights.semiBold);
19883
+ return css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral(["\n font-weight: ", ";\n "])), theme.__hd__.typography.fontWeights.semiBold);
19908
19884
  }
19909
19885
  }, function (_ref3) {
19910
19886
  var themeIntent = _ref3.themeIntent,
@@ -19912,14 +19888,17 @@ var StyledText = styled(require$$0$1.Text)(_templateObject || (_templateObject =
19912
19888
 
19913
19889
  switch (themeIntent) {
19914
19890
  case 'body':
19915
- return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.body);
19891
+ return css(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.body);
19916
19892
 
19917
19893
  case 'subdued':
19918
- return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.subdued);
19894
+ return css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.subdued);
19895
+
19896
+ case 'primary':
19897
+ return css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme.__hd__.typography.colors.primary);
19919
19898
  }
19920
19899
  });
19921
19900
 
19922
- var _excluded = ["children", "fontSize", "fontWeight", "intent"];
19901
+ var _excluded$3 = ["children", "fontSize", "fontWeight", "intent"];
19923
19902
 
19924
19903
  var Text = function Text(_ref) {
19925
19904
  var children = _ref.children,
@@ -19929,7 +19908,7 @@ var Text = function Text(_ref) {
19929
19908
  fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
19930
19909
  _ref$intent = _ref.intent,
19931
19910
  intent = _ref$intent === void 0 ? 'body' : _ref$intent,
19932
- nativeProps = _objectWithoutProperties$1(_ref, _excluded);
19911
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
19933
19912
 
19934
19913
  return /*#__PURE__*/React__default["default"].createElement(StyledText, _extends$1({
19935
19914
  themeFontSize: fontSize,
@@ -19942,12 +19921,313 @@ var Typography = {
19942
19921
  Text: Text
19943
19922
  };
19944
19923
 
19924
+ var _templateObject$4, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1;
19925
+ var BottomNavigationTab = styled(require$$0$1.View)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n flex: 1;\n display: ", ";\n"])), function (_ref) {
19926
+ var themeVisibility = _ref.themeVisibility;
19927
+ return themeVisibility === false ? 'none' : 'flex';
19928
+ });
19929
+ var BottomNavigationContainer = styled(require$$0$1.View)(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n flex: 1;\n overflow: hidden;\n"])));
19930
+ var ContentWrapper = styled(require$$0$1.View)(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n flex: 1;\n"])));
19931
+ var BottomBarWrapper = styled(require$$0$1.View)(_templateObject4$1 || (_templateObject4$1 = _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) {
19932
+ var theme = _ref2.theme,
19933
+ themeInsets = _ref2.themeInsets;
19934
+ return theme.__hd__.bottomNavigation.sizes.height + themeInsets.bottom;
19935
+ }, function (_ref3) {
19936
+ var themeInsets = _ref3.themeInsets;
19937
+ return themeInsets.bottom;
19938
+ }, function (_ref4) {
19939
+ var themeInsets = _ref4.themeInsets;
19940
+ return Math.max(themeInsets.left, themeInsets.right);
19941
+ }, function (_ref5) {
19942
+ var themeInsets = _ref5.themeInsets;
19943
+ return Math.max(themeInsets.left, themeInsets.right);
19944
+ }, function (_ref6) {
19945
+ var theme = _ref6.theme;
19946
+ return theme.__hd__.bottomNavigation.colors.background;
19947
+ }, function (_ref7) {
19948
+ var theme = _ref7.theme;
19949
+ return theme.__hd__.bottomNavigation.colors.shadow;
19950
+ }, function (_ref8) {
19951
+ var theme = _ref8.theme;
19952
+ return theme.__hd__.bottomNavigation.shadows.offset;
19953
+ }, function (_ref9) {
19954
+ var theme = _ref9.theme;
19955
+ return theme.__hd__.bottomNavigation.shadows.opacity;
19956
+ }, function (_ref10) {
19957
+ var theme = _ref10.theme;
19958
+ return theme.__hd__.bottomNavigation.shadows.radius;
19959
+ }, function (_ref11) {
19960
+ var theme = _ref11.theme;
19961
+ return theme.__hd__.bottomNavigation.shadows.elevation;
19962
+ });
19963
+ var BottomBar = styled(require$$0$1.View)(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n flex: 1;\n flex-direction: row;\n overflow: hidden;\n align-items: center;\n"])));
19964
+ var BottomBarItem = styled(require$$0$1.View)(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteral(["\n flex: 1;\n align-items: center;\n"])));
19965
+
19966
+ var isIOS = require$$0$1.Platform.OS === 'ios';
19967
+ require$$0$1.Platform.OS === 'android';
19968
+
19969
+ var _excluded$2 = ["onChange", "renderActiveTabOnly", "selectedTabKey", "tabs"];
19970
+
19971
+ var getInactiveIcon = function getInactiveIcon(icon) {
19972
+ var inactiveIcon = "".concat(icon, "-outlined");
19973
+ return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
19974
+ };
19975
+
19976
+ var BottomNavigation = function BottomNavigation(_ref) {
19977
+ var onChange = _ref.onChange,
19978
+ _ref$renderActiveTabO = _ref.renderActiveTabOnly,
19979
+ renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
19980
+ selectedTabKey = _ref.selectedTabKey,
19981
+ tabs = _ref.tabs,
19982
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
19983
+
19984
+ var theme = useTheme();
19985
+ var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
19986
+ /**
19987
+ * List of loaded tabs, tabs will be loaded when navigated to.
19988
+ */
19989
+
19990
+ var _React$useState = React__default["default"].useState([selectedTabKey]),
19991
+ _React$useState2 = _slicedToArray(_React$useState, 2),
19992
+ loaded = _React$useState2[0],
19993
+ setLoaded = _React$useState2[1];
19994
+
19995
+ if (!loaded.includes(selectedTabKey)) {
19996
+ // Set the current tab to be loaded if it was not loaded before
19997
+ setLoaded(function (loadedState) {
19998
+ return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
19999
+ });
20000
+ }
20001
+
20002
+ return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper, null, tabs.map(function (tab) {
20003
+ var key = tab.key,
20004
+ component = tab.component;
20005
+ var active = selectedTabKey === key;
20006
+
20007
+ if (renderActiveTabOnly && !active) {
20008
+ return null;
20009
+ }
20010
+
20011
+ if (!loaded.includes(key)) {
20012
+ // Don't render a screen if we've never navigated to it
20013
+ return null;
20014
+ }
20015
+
20016
+ return /*#__PURE__*/React__default["default"].createElement(BottomNavigationTab, {
20017
+ key: key,
20018
+ testID: "route-screen-".concat(selectedTabKey),
20019
+ pointerEvents: active ? 'auto' : 'none',
20020
+ accessibilityElementsHidden: !active,
20021
+ importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
20022
+ collapsable: false,
20023
+ removeClippedSubviews: // On iOS, set removeClippedSubviews to true only when not focused
20024
+ // This is an workaround for a bug where the clipped view never re-appears.
20025
+ isIOS ? selectedTabKey !== key : true,
20026
+ themeVisibility: active
20027
+ }, component);
20028
+ })), /*#__PURE__*/React__default["default"].createElement(BottomBarWrapper, {
20029
+ themeInsets: insets
20030
+ }, /*#__PURE__*/React__default["default"].createElement(BottomBar, null, tabs.map(function (tab) {
20031
+ var key = tab.key,
20032
+ icon = tab.icon,
20033
+ title = tab.title,
20034
+ testID = tab.testID;
20035
+ var active = selectedTabKey === key;
20036
+ var inactiveIcon = getInactiveIcon(icon);
20037
+ return /*#__PURE__*/React__default["default"].createElement(require$$0$1.TouchableWithoutFeedback, {
20038
+ key: key,
20039
+ onPress: function onPress() {
20040
+ if (key !== selectedTabKey) {
20041
+ onChange(key);
20042
+ }
20043
+ },
20044
+ testID: testID
20045
+ }, /*#__PURE__*/React__default["default"].createElement(BottomBarItem, null, /*#__PURE__*/React__default["default"].createElement(Icon, {
20046
+ icon: active ? icon : inactiveIcon,
20047
+ intent: active ? 'primary' : 'text',
20048
+ testID: "hero-icon-".concat(icon)
20049
+ }), title && /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
20050
+ fontSize: "small",
20051
+ fontWeight: "semi-bold",
20052
+ intent: active ? 'primary' : 'body',
20053
+ style: {
20054
+ marginTop: theme.space.xsmall
20055
+ },
20056
+ numberOfLines: 1
20057
+ }, title)));
20058
+ }))));
20059
+ };
20060
+
20061
+ var _templateObject$3;
20062
+ var StyledCard = styled(require$$0$1.View)(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n border-radius: ", ";\n padding: ", ";\n overflow: hidden;\n"])), function (_ref) {
20063
+ var theme = _ref.theme;
20064
+ return theme.__hd__.card.radii["default"];
20065
+ }, function (_ref2) {
20066
+ var theme = _ref2.theme;
20067
+ return theme.__hd__.card.padding["default"];
20068
+ });
20069
+
20070
+ var Card = function Card(props) {
20071
+ return /*#__PURE__*/React__default["default"].createElement(StyledCard, props);
20072
+ };
20073
+
20074
+ var _templateObject$2, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
20075
+ var StyledDivider = styled(require$$0$1.View)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n max-width: 100%;\n\n ", "\n\n ", "\n"])), function (_ref) {
20076
+ var theme = _ref.theme;
20077
+ return theme.__hd__.divider.borderWidths["default"];
20078
+ }, function (_ref2) {
20079
+ var theme = _ref2.theme;
20080
+ return theme.__hd__.divider.colors["default"];
20081
+ }, function (_ref3) {
20082
+ var themeMarginHorizontal = _ref3.themeMarginHorizontal,
20083
+ theme = _ref3.theme;
20084
+
20085
+ switch (themeMarginHorizontal) {
20086
+ case undefined:
20087
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""])));
20088
+
20089
+ case 'xsmall':
20090
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xsmall);
20091
+
20092
+ case 'small':
20093
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.small);
20094
+
20095
+ case 'medium':
20096
+ return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.medium);
20097
+
20098
+ case 'large':
20099
+ return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.large);
20100
+
20101
+ case 'xlarge':
20102
+ return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-horizontal: ", ";\n "])), theme.__hd__.divider.space.xlarge);
20103
+ }
20104
+ }, function (_ref4) {
20105
+ var themeMarginVertical = _ref4.themeMarginVertical,
20106
+ theme = _ref4.theme;
20107
+
20108
+ switch (themeMarginVertical) {
20109
+ case undefined:
20110
+ return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral([""])));
20111
+
20112
+ case 'xsmall':
20113
+ return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.xsmall);
20114
+
20115
+ case 'small':
20116
+ return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.small);
20117
+
20118
+ case 'medium':
20119
+ return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.medium);
20120
+
20121
+ case 'large':
20122
+ return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.large);
20123
+
20124
+ case 'xlarge':
20125
+ return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n margin-vertical: ", ";\n "])), theme.__hd__.divider.space.xlarge);
20126
+ }
20127
+ });
20128
+
20129
+ var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
20130
+
20131
+ var Divider = function Divider(_ref) {
20132
+ var marginHorizontal = _ref.marginHorizontal,
20133
+ marginVertical = _ref.marginVertical,
20134
+ style = _ref.style,
20135
+ testID = _ref.testID,
20136
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
20137
+
20138
+ return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({
20139
+ themeMarginHorizontal: marginHorizontal,
20140
+ themeMarginVertical: marginVertical,
20141
+ style: style,
20142
+ testID: testID
20143
+ }, nativeProps));
20144
+ };
20145
+
20146
+ var _templateObject$1;
20147
+ var StyledFABIcon = styled(Icon)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n"])), function (_ref) {
20148
+ var theme = _ref.theme;
20149
+ return theme.__hd__.fab.colors.icon;
20150
+ }, function (_ref2) {
20151
+ var theme = _ref2.theme;
20152
+ return theme.__hd__.fab.fontSizes["default"];
20153
+ });
20154
+
20155
+ var _excluded = ["active"];
20156
+ var AnimatedIcons = require$$0$1.Animated.createAnimatedComponent(StyledFABIcon);
20157
+
20158
+ var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
20159
+ var active = _ref.active,
20160
+ iconProps = _objectWithoutProperties$1(_ref, _excluded);
20161
+
20162
+ var rotateAnimation = React.useRef(new require$$0$1.Animated.Value(active ? 1 : 0));
20163
+ React.useEffect(function () {
20164
+ var animation = require$$0$1.Animated.timing(rotateAnimation.current, {
20165
+ toValue: active ? 1 : 0,
20166
+ useNativeDriver: true
20167
+ });
20168
+ animation.start();
20169
+ return function () {
20170
+ animation.stop();
20171
+ };
20172
+ }, [active]);
20173
+ var interpolatedRotateAnimation = rotateAnimation.current.interpolate({
20174
+ inputRange: [0, 1],
20175
+ outputRange: ['0deg', '-45deg']
20176
+ });
20177
+ return /*#__PURE__*/React__default["default"].createElement(require$$0$1.Animated.View, {
20178
+ style: require$$0$1.StyleSheet.flatten([{
20179
+ transform: [{
20180
+ rotate: interpolatedRotateAnimation
20181
+ }]
20182
+ }])
20183
+ }, /*#__PURE__*/React__default["default"].createElement(AnimatedIcons, iconProps));
20184
+ };
20185
+
20186
+ var _templateObject;
20187
+ var StyledFABContainer = styled(require$$0$1.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) {
20188
+ var theme = _ref.theme;
20189
+ return theme.__hd__.fab.sizes.height;
20190
+ }, function (_ref2) {
20191
+ var theme = _ref2.theme;
20192
+ return theme.__hd__.fab.sizes.width;
20193
+ }, function (_ref3) {
20194
+ var theme = _ref3.theme;
20195
+ return theme.__hd__.fab.colors.buttonBackground;
20196
+ });
20197
+
20198
+ var FAB = function FAB(_ref) {
20199
+ var _onPress = _ref.onPress,
20200
+ icon = _ref.icon,
20201
+ animated = _ref.animated,
20202
+ testID = _ref.testID,
20203
+ active = _ref.active,
20204
+ style = _ref.style;
20205
+ return /*#__PURE__*/React__default["default"].createElement(StyledFABContainer, {
20206
+ testID: testID,
20207
+ onPress: function onPress() {
20208
+ _onPress === null || _onPress === void 0 ? void 0 : _onPress();
20209
+ },
20210
+ activeOpacity: 0.6,
20211
+ style: style
20212
+ }, animated ? /*#__PURE__*/React__default["default"].createElement(AnimatedFABIcon, {
20213
+ active: active,
20214
+ icon: icon,
20215
+ testID: "animatedFABIcon"
20216
+ }) : /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
20217
+ icon: icon,
20218
+ testID: "styledFABIcon"
20219
+ }));
20220
+ };
20221
+
19945
20222
  exports.Badge = Badge;
20223
+ exports.BottomNavigation = BottomNavigation;
19946
20224
  exports.Card = Card;
19947
20225
  exports.Divider = Divider;
20226
+ exports.FAB = FAB;
19948
20227
  exports.Icon = Icon;
19949
20228
  exports.ThemeProvider = ThemeProvider;
19950
20229
  exports.Typography = Typography;
19951
20230
  exports.getTheme = getTheme;
20231
+ exports.scale = scale;
19952
20232
  exports.theme = theme;
19953
20233
  exports.useTheme = useTheme;