@hero-design/rn 8.35.0-alpha.0 → 8.35.0-alpha.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.
package/lib/index.js CHANGED
@@ -4533,6 +4533,308 @@ var withTheme = function withTheme(C, themeName) {
4533
4533
 
4534
4534
  var defaultTheme = getTheme$1();
4535
4535
 
4536
+ var urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
4537
+ var nanoid = function nanoid() {
4538
+ var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 21;
4539
+ var id = '';
4540
+ var i = size;
4541
+ while (i--) {
4542
+ id += urlAlphabet[Math.random() * 64 | 0];
4543
+ }
4544
+ return id;
4545
+ };
4546
+
4547
+ var ACTIONS;
4548
+ (function (ACTIONS) {
4549
+ ACTIONS[ACTIONS["REGISTER_HOST"] = 0] = "REGISTER_HOST";
4550
+ ACTIONS[ACTIONS["DEREGISTER_HOST"] = 1] = "DEREGISTER_HOST";
4551
+ ACTIONS[ACTIONS["ADD_UPDATE_PORTAL"] = 2] = "ADD_UPDATE_PORTAL";
4552
+ ACTIONS[ACTIONS["REMOVE_PORTAL"] = 3] = "REMOVE_PORTAL";
4553
+ })(ACTIONS || (ACTIONS = {}));
4554
+ var INITIAL_STATE = {};
4555
+
4556
+ var PortalStateContext = /*#__PURE__*/React.createContext(null);
4557
+ var PortalDispatchContext = /*#__PURE__*/React.createContext(null);
4558
+
4559
+ var usePortal = function usePortal() {
4560
+ var hostName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'root';
4561
+ var dispatch = React.useContext(PortalDispatchContext);
4562
+ if (dispatch === null) {
4563
+ throw new Error("'PortalDispatchContext' cannot be null, please add 'PortalProvider' to the root component.");
4564
+ } //#region methods
4565
+
4566
+ var registerHost = React.useCallback(function () {
4567
+ dispatch({
4568
+ type: ACTIONS.REGISTER_HOST,
4569
+ hostName: hostName
4570
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
4571
+ }, []);
4572
+ var deregisterHost = React.useCallback(function () {
4573
+ dispatch({
4574
+ type: ACTIONS.DEREGISTER_HOST,
4575
+ hostName: hostName
4576
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
4577
+ }, []);
4578
+ var addUpdatePortal = React.useCallback(function (name, node) {
4579
+ dispatch({
4580
+ type: ACTIONS.ADD_UPDATE_PORTAL,
4581
+ hostName: hostName,
4582
+ portalName: name,
4583
+ node: node
4584
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
4585
+ }, []);
4586
+ var removePortal = React.useCallback(function (name) {
4587
+ dispatch({
4588
+ type: ACTIONS.REMOVE_PORTAL,
4589
+ hostName: hostName,
4590
+ portalName: name
4591
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
4592
+ }, []); //#endregion
4593
+
4594
+ return {
4595
+ registerHost: registerHost,
4596
+ deregisterHost: deregisterHost,
4597
+ addPortal: addUpdatePortal,
4598
+ updatePortal: addUpdatePortal,
4599
+ removePortal: removePortal
4600
+ };
4601
+ };
4602
+
4603
+ var PortalComponent = function PortalComponent(_ref) {
4604
+ var _providedName = _ref.name,
4605
+ hostName = _ref.hostName,
4606
+ _providedHandleOnMount = _ref.handleOnMount,
4607
+ _providedHandleOnUnmount = _ref.handleOnUnmount,
4608
+ _providedHandleOnUpdate = _ref.handleOnUpdate,
4609
+ children = _ref.children;
4610
+ //#region hooks
4611
+ var _usePortal = usePortal(hostName),
4612
+ addUpdatePortal = _usePortal.addPortal,
4613
+ removePortal = _usePortal.removePortal; //#endregion
4614
+ //#region variables
4615
+
4616
+ var name = React.useMemo(function () {
4617
+ return _providedName || nanoid();
4618
+ }, [_providedName]); //#endregion
4619
+ //#region refs
4620
+
4621
+ var handleOnMountRef = React.useRef();
4622
+ var handleOnUnmountRef = React.useRef();
4623
+ var handleOnUpdateRef = React.useRef(); //#endregion
4624
+ //#region callbacks
4625
+
4626
+ var handleOnMount = React.useCallback(function () {
4627
+ if (_providedHandleOnMount) {
4628
+ _providedHandleOnMount(function () {
4629
+ return addUpdatePortal(name, children);
4630
+ });
4631
+ } else {
4632
+ addUpdatePortal(name, children);
4633
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4634
+ }, [_providedHandleOnMount, addUpdatePortal]);
4635
+ handleOnMountRef.current = handleOnMount;
4636
+ var handleOnUnmount = React.useCallback(function () {
4637
+ if (_providedHandleOnUnmount) {
4638
+ _providedHandleOnUnmount(function () {
4639
+ return removePortal(name);
4640
+ });
4641
+ } else {
4642
+ removePortal(name);
4643
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4644
+ }, [_providedHandleOnUnmount, removePortal]);
4645
+ handleOnUnmountRef.current = handleOnUnmount;
4646
+ var handleOnUpdate = React.useCallback(function () {
4647
+ if (_providedHandleOnUpdate) {
4648
+ _providedHandleOnUpdate(function () {
4649
+ return addUpdatePortal(name, children);
4650
+ });
4651
+ } else {
4652
+ addUpdatePortal(name, children);
4653
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4654
+ }, [_providedHandleOnUpdate, addUpdatePortal, children]);
4655
+ handleOnUpdateRef.current = handleOnUpdate; //#endregion
4656
+ //#region effects
4657
+
4658
+ React.useEffect(function () {
4659
+ var _handleOnMountRef$cur;
4660
+ (_handleOnMountRef$cur = handleOnMountRef.current) === null || _handleOnMountRef$cur === void 0 ? void 0 : _handleOnMountRef$cur.call(handleOnMountRef);
4661
+ return function () {
4662
+ var _handleOnUnmountRef$c;
4663
+ (_handleOnUnmountRef$c = handleOnUnmountRef.current) === null || _handleOnUnmountRef$c === void 0 ? void 0 : _handleOnUnmountRef$c.call(handleOnUnmountRef); // remove callbacks refs
4664
+
4665
+ handleOnMountRef.current = undefined;
4666
+ handleOnUnmountRef.current = undefined;
4667
+ handleOnUpdateRef.current = undefined;
4668
+ };
4669
+ }, []);
4670
+ React.useEffect(function () {
4671
+ var _handleOnUpdateRef$cu;
4672
+ (_handleOnUpdateRef$cu = handleOnUpdateRef.current) === null || _handleOnUpdateRef$cu === void 0 ? void 0 : _handleOnUpdateRef$cu.call(handleOnUpdateRef);
4673
+ }, [children]); //#endregion
4674
+
4675
+ return null;
4676
+ };
4677
+ var Portal = /*#__PURE__*/React.memo(PortalComponent);
4678
+ Portal.displayName = 'Portal';
4679
+
4680
+ var usePortalState = function usePortalState(hostName) {
4681
+ var state = React.useContext(PortalStateContext);
4682
+ if (state === null) {
4683
+ throw new Error("'PortalStateContext' cannot be null, please add 'PortalProvider' to the root component.");
4684
+ }
4685
+ return state[hostName] || [];
4686
+ };
4687
+
4688
+ var PortalHostComponent = function PortalHostComponent(_ref) {
4689
+ var name = _ref.name;
4690
+ //#region hooks
4691
+ var state = usePortalState(name);
4692
+ var _usePortal = usePortal(name),
4693
+ registerHost = _usePortal.registerHost,
4694
+ deregisterHost = _usePortal.deregisterHost; //#endregion
4695
+ //#region effects
4696
+
4697
+ React.useEffect(function () {
4698
+ registerHost();
4699
+ return function () {
4700
+ deregisterHost();
4701
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
4702
+ }, []); //#endregion
4703
+ //#region render
4704
+
4705
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, state.map(function (item) {
4706
+ return item.node;
4707
+ })); //#endregion
4708
+ };
4709
+
4710
+ var PortalHost = /*#__PURE__*/React.memo(PortalHostComponent);
4711
+ PortalHost.displayName = 'PortalHost';
4712
+
4713
+ var isLoggingEnabled = false; // __DEV__ global is by default not defined in React Native Web builds
4714
+
4715
+ var isDev = Boolean(typeof __DEV__ !== 'undefined' && __DEV__);
4716
+ var enableLogging = function enableLogging() {
4717
+ if (!isDev) {
4718
+ console.warn('[Portal] could not enable logging on production!');
4719
+ return;
4720
+ }
4721
+ isLoggingEnabled = true;
4722
+ };
4723
+ var print$1 = function print() {};
4724
+ if (isDev) {
4725
+ print$1 = function print(_ref) {
4726
+ var component = _ref.component,
4727
+ method = _ref.method,
4728
+ params = _ref.params;
4729
+ if (!isLoggingEnabled) {
4730
+ return;
4731
+ }
4732
+ var message = '';
4733
+ if (_typeof(params) === 'object') {
4734
+ message = Object.keys(params).map(function (key) {
4735
+ return "".concat(key, ":").concat(params[key]);
4736
+ }).join(' ');
4737
+ } else {
4738
+ message = "".concat(params !== null && params !== void 0 ? params : '');
4739
+ }
4740
+ console.log("[Portal::".concat([component, method].filter(Boolean).join('::'), "]"), message);
4741
+ };
4742
+ }
4743
+ Object.freeze(print$1);
4744
+
4745
+ var registerHost = function registerHost(state, hostName) {
4746
+ if (!(hostName in state)) {
4747
+ state[hostName] = [];
4748
+ }
4749
+ return state;
4750
+ };
4751
+ var deregisterHost = function deregisterHost(state, hostName) {
4752
+ delete state[hostName];
4753
+ return state;
4754
+ };
4755
+ var addUpdatePortal = function addUpdatePortal(state, hostName, portalName, node) {
4756
+ if (!(hostName in state)) {
4757
+ state = registerHost(state, hostName);
4758
+ }
4759
+ /**
4760
+ * updated portal, if it was already added.
4761
+ */
4762
+
4763
+ var index = state[hostName].findIndex(function (item) {
4764
+ return item.name === portalName;
4765
+ });
4766
+ if (index !== -1) {
4767
+ state[hostName][index].node = node;
4768
+ } else {
4769
+ state[hostName].push({
4770
+ name: portalName,
4771
+ node: node
4772
+ });
4773
+ }
4774
+ return state;
4775
+ };
4776
+ var removePortal = function removePortal(state, hostName, portalName) {
4777
+ if (!(hostName in state)) {
4778
+ print$1({
4779
+ component: reducer.name,
4780
+ method: removePortal.name,
4781
+ params: "Failed to remove portal '".concat(portalName, "', '").concat(hostName, "' was not registered!")
4782
+ });
4783
+ return state;
4784
+ }
4785
+ var index = state[hostName].findIndex(function (item) {
4786
+ return item.name === portalName;
4787
+ });
4788
+ if (index !== -1) state[hostName].splice(index, 1);
4789
+ return state;
4790
+ };
4791
+ var reducer = function reducer(state, action) {
4792
+ var type = action.type;
4793
+ var clonedState = _objectSpread2({}, state);
4794
+ switch (type) {
4795
+ case ACTIONS.REGISTER_HOST:
4796
+ return registerHost(clonedState, action.hostName);
4797
+ case ACTIONS.DEREGISTER_HOST:
4798
+ return deregisterHost(clonedState, action.hostName);
4799
+ case ACTIONS.ADD_UPDATE_PORTAL:
4800
+ return addUpdatePortal(clonedState, action.hostName, action.portalName, action.node);
4801
+ case ACTIONS.REMOVE_PORTAL:
4802
+ return removePortal(clonedState, action.hostName, action.portalName);
4803
+ default:
4804
+ return state;
4805
+ }
4806
+ };
4807
+
4808
+ var PortalProviderComponent = function PortalProviderComponent(_ref) {
4809
+ var _ref$rootHostName = _ref.rootHostName,
4810
+ rootHostName = _ref$rootHostName === void 0 ? 'root' : _ref$rootHostName,
4811
+ _ref$shouldAddRootHos = _ref.shouldAddRootHost,
4812
+ shouldAddRootHost = _ref$shouldAddRootHos === void 0 ? true : _ref$shouldAddRootHos,
4813
+ children = _ref.children;
4814
+ var _useReducer = React.useReducer(reducer, INITIAL_STATE),
4815
+ _useReducer2 = _slicedToArray(_useReducer, 2),
4816
+ state = _useReducer2[0],
4817
+ dispatch = _useReducer2[1];
4818
+ return /*#__PURE__*/React__default["default"].createElement(PortalDispatchContext.Provider, {
4819
+ value: dispatch
4820
+ }, /*#__PURE__*/React__default["default"].createElement(PortalStateContext.Provider, {
4821
+ value: state
4822
+ }, children, shouldAddRootHost && /*#__PURE__*/React__default["default"].createElement(PortalHost, {
4823
+ name: rootHostName
4824
+ })));
4825
+ };
4826
+ var PortalProvider = /*#__PURE__*/React.memo(PortalProviderComponent);
4827
+ PortalProvider.displayName = 'PortalProvider';
4828
+
4829
+ var index$c = /*#__PURE__*/Object.freeze({
4830
+ __proto__: null,
4831
+ Portal: Portal,
4832
+ PortalHost: PortalHost,
4833
+ PortalProvider: PortalProvider,
4834
+ usePortal: usePortal,
4835
+ enableLogging: enableLogging
4836
+ });
4837
+
4536
4838
  function getDefaultExportFromCjs (x) {
4537
4839
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
4538
4840
  }
@@ -6355,7 +6657,7 @@ var StyledText$3 = index$b(reactNative.Text)(function (_ref) {
6355
6657
  });
6356
6658
  });
6357
6659
 
6358
- var _excluded$A = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
6660
+ var _excluded$z = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
6359
6661
  var Text = function Text(_ref) {
6360
6662
  var children = _ref.children,
6361
6663
  _ref$fontSize = _ref.fontSize,
@@ -6368,7 +6670,7 @@ var Text = function Text(_ref) {
6368
6670
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
6369
6671
  _ref$allowFontScaling = _ref.allowFontScaling,
6370
6672
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
6371
- nativeProps = _objectWithoutProperties(_ref, _excluded$A);
6673
+ nativeProps = _objectWithoutProperties(_ref, _excluded$z);
6372
6674
  useDeprecation('Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.');
6373
6675
  return /*#__PURE__*/React__default["default"].createElement(StyledText$3, _extends$1({}, nativeProps, {
6374
6676
  themeFontSize: fontSize,
@@ -6398,7 +6700,7 @@ var StyledCaption = index$b(reactNative.Text)(function (_ref) {
6398
6700
  };
6399
6701
  });
6400
6702
 
6401
- var _excluded$z = ["children", "fontWeight", "intent", "allowFontScaling"];
6703
+ var _excluded$y = ["children", "fontWeight", "intent", "allowFontScaling"];
6402
6704
  var Caption = function Caption(_ref) {
6403
6705
  var children = _ref.children,
6404
6706
  _ref$fontWeight = _ref.fontWeight,
@@ -6407,7 +6709,7 @@ var Caption = function Caption(_ref) {
6407
6709
  intent = _ref$intent === void 0 ? 'body' : _ref$intent,
6408
6710
  _ref$allowFontScaling = _ref.allowFontScaling,
6409
6711
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
6410
- nativeProps = _objectWithoutProperties(_ref, _excluded$z);
6712
+ nativeProps = _objectWithoutProperties(_ref, _excluded$y);
6411
6713
  return /*#__PURE__*/React__default["default"].createElement(StyledCaption, _extends$1({}, nativeProps, {
6412
6714
  themeFontWeight: fontWeight,
6413
6715
  themeIntent: intent,
@@ -6426,14 +6728,14 @@ var StyledLabel$1 = index$b(reactNative.Text)(function (_ref) {
6426
6728
  };
6427
6729
  });
6428
6730
 
6429
- var _excluded$y = ["children", "intent", "allowFontScaling"];
6731
+ var _excluded$x = ["children", "intent", "allowFontScaling"];
6430
6732
  var Label = function Label(_ref) {
6431
6733
  var children = _ref.children,
6432
6734
  _ref$intent = _ref.intent,
6433
6735
  intent = _ref$intent === void 0 ? 'body' : _ref$intent,
6434
6736
  _ref$allowFontScaling = _ref.allowFontScaling,
6435
6737
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
6436
- nativeProps = _objectWithoutProperties(_ref, _excluded$y);
6738
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
6437
6739
  return /*#__PURE__*/React__default["default"].createElement(StyledLabel$1, _extends$1({}, nativeProps, {
6438
6740
  themeIntent: intent,
6439
6741
  allowFontScaling: allowFontScaling
@@ -6454,7 +6756,7 @@ var StyledTitle$1 = index$b(reactNative.Text)(function (_ref) {
6454
6756
  };
6455
6757
  });
6456
6758
 
6457
- var _excluded$x = ["children", "intent", "allowFontScaling", "level", "typeface"];
6759
+ var _excluded$w = ["children", "intent", "allowFontScaling", "level", "typeface"];
6458
6760
  var Title = function Title(_ref) {
6459
6761
  var children = _ref.children,
6460
6762
  _ref$intent = _ref.intent,
@@ -6465,7 +6767,7 @@ var Title = function Title(_ref) {
6465
6767
  level = _ref$level === void 0 ? 'h1' : _ref$level,
6466
6768
  _ref$typeface = _ref.typeface,
6467
6769
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
6468
- nativeProps = _objectWithoutProperties(_ref, _excluded$x);
6770
+ nativeProps = _objectWithoutProperties(_ref, _excluded$w);
6469
6771
  return /*#__PURE__*/React__default["default"].createElement(StyledTitle$1, _extends$1({}, nativeProps, {
6470
6772
  themeLevel: level,
6471
6773
  themeTypeface: typeface,
@@ -6500,7 +6802,7 @@ var StyledBody = index$b(reactNative.Text)(function (_ref) {
6500
6802
  };
6501
6803
  });
6502
6804
 
6503
- var _excluded$w = ["children", "intent", "allowFontScaling", "typeface", "variant"];
6805
+ var _excluded$v = ["children", "intent", "allowFontScaling", "typeface", "variant"];
6504
6806
  var Body = function Body(_ref) {
6505
6807
  var children = _ref.children,
6506
6808
  _ref$intent = _ref.intent,
@@ -6511,7 +6813,7 @@ var Body = function Body(_ref) {
6511
6813
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
6512
6814
  _ref$variant = _ref.variant,
6513
6815
  variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
6514
- nativeProps = _objectWithoutProperties(_ref, _excluded$w);
6816
+ nativeProps = _objectWithoutProperties(_ref, _excluded$v);
6515
6817
  return /*#__PURE__*/React__default["default"].createElement(StyledBody, _extends$1({}, nativeProps, {
6516
6818
  themeTypeface: typeface,
6517
6819
  themeIntent: intent,
@@ -7041,10 +7343,10 @@ var StyledHeroIcon = index$b(HeroIcon)(function (_ref) {
7041
7343
  };
7042
7344
  });
7043
7345
 
7044
- var _excluded$v = ["style"];
7346
+ var _excluded$u = ["style"];
7045
7347
  var AnimatedIcon = function AnimatedIcon(_ref) {
7046
7348
  var style = _ref.style,
7047
- otherProps = _objectWithoutProperties(_ref, _excluded$v);
7349
+ otherProps = _objectWithoutProperties(_ref, _excluded$u);
7048
7350
  var rotateAnimation = React.useRef(new reactNative.Animated.Value(0));
7049
7351
  React.useEffect(function () {
7050
7352
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current, {
@@ -7149,7 +7451,7 @@ var AccordionItem = function AccordionItem(_ref) {
7149
7451
  }, content));
7150
7452
  };
7151
7453
 
7152
- var _excluded$u = ["key"];
7454
+ var _excluded$t = ["key"];
7153
7455
  var Accordion = function Accordion(_ref) {
7154
7456
  var items = _ref.items,
7155
7457
  activeItemKey = _ref.activeItemKey,
@@ -7170,7 +7472,7 @@ var Accordion = function Accordion(_ref) {
7170
7472
  testID: testID
7171
7473
  }, items.map(function (_ref2, index) {
7172
7474
  var key = _ref2.key,
7173
- props = _objectWithoutProperties(_ref2, _excluded$u);
7475
+ props = _objectWithoutProperties(_ref2, _excluded$t);
7174
7476
  var open = _activeItemKey === key;
7175
7477
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
7176
7478
  key: key
@@ -7568,7 +7870,7 @@ var StyledStatus = index$b(reactNative.Animated.View)(function (_ref3) {
7568
7870
  };
7569
7871
  });
7570
7872
 
7571
- var _excluded$t = ["children", "visible", "intent", "style", "testID"];
7873
+ var _excluded$s = ["children", "visible", "intent", "style", "testID"];
7572
7874
  var Status = function Status(_ref) {
7573
7875
  var children = _ref.children,
7574
7876
  _ref$visible = _ref.visible,
@@ -7577,7 +7879,7 @@ var Status = function Status(_ref) {
7577
7879
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
7578
7880
  style = _ref.style,
7579
7881
  testID = _ref.testID,
7580
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
7882
+ nativeProps = _objectWithoutProperties(_ref, _excluded$s);
7581
7883
  var _React$useRef = React__default["default"].useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
7582
7884
  opacity = _React$useRef.current;
7583
7885
  var isFirstRendering = React__default["default"].useRef(true);
@@ -7610,7 +7912,7 @@ var Status = function Status(_ref) {
7610
7912
  }));
7611
7913
  };
7612
7914
 
7613
- var _excluded$s = ["content", "visible", "max", "intent", "style", "testID"];
7915
+ var _excluded$r = ["content", "visible", "max", "intent", "style", "testID"];
7614
7916
  var DEFAULT_MAX_NUMBER = 99;
7615
7917
  var getPaddingState = function getPaddingState(content) {
7616
7918
  return content.length > 1 ? 'wideContent' : 'narrowContent';
@@ -7625,7 +7927,7 @@ var Badge = function Badge(_ref) {
7625
7927
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
7626
7928
  style = _ref.style,
7627
7929
  testID = _ref.testID,
7628
- nativeProps = _objectWithoutProperties(_ref, _excluded$s);
7930
+ nativeProps = _objectWithoutProperties(_ref, _excluded$r);
7629
7931
  var _React$useRef = React__default["default"].useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
7630
7932
  opacity = _React$useRef.current;
7631
7933
  var isFirstRendering = React__default["default"].useRef(true);
@@ -7729,7 +8031,7 @@ function omit(keys, obj) {
7729
8031
  return result;
7730
8032
  }
7731
8033
 
7732
- var _excluded$r = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
8034
+ var _excluded$q = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
7733
8035
  var getInactiveIcon = function getInactiveIcon(icon) {
7734
8036
  var inactiveIcon = "".concat(icon, "-outlined");
7735
8037
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -7740,7 +8042,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
7740
8042
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
7741
8043
  selectedTabKey = _ref.selectedTabKey,
7742
8044
  tabs = _ref.tabs,
7743
- nativeProps = _objectWithoutProperties(_ref, _excluded$r);
8045
+ nativeProps = _objectWithoutProperties(_ref, _excluded$q);
7744
8046
  var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
7745
8047
  /**
7746
8048
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -7826,13 +8128,13 @@ var StyledDivider = index$b(reactNative.View)(function (_ref) {
7826
8128
  }, horizontalMargin), verticalMargin);
7827
8129
  });
7828
8130
 
7829
- var _excluded$q = ["marginHorizontal", "marginVertical", "style", "testID"];
8131
+ var _excluded$p = ["marginHorizontal", "marginVertical", "style", "testID"];
7830
8132
  var Divider = function Divider(_ref) {
7831
8133
  var marginHorizontal = _ref.marginHorizontal,
7832
8134
  marginVertical = _ref.marginVertical,
7833
8135
  style = _ref.style,
7834
8136
  testID = _ref.testID,
7835
- nativeProps = _objectWithoutProperties(_ref, _excluded$q);
8137
+ nativeProps = _objectWithoutProperties(_ref, _excluded$p);
7836
8138
  return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({}, nativeProps, {
7837
8139
  themeMarginHorizontal: marginHorizontal,
7838
8140
  themeMarginVertical: marginVertical,
@@ -7962,7 +8264,7 @@ var StyledLoadingDot = index$b(reactNative.View)(function (_ref2) {
7962
8264
  }, themeStyling());
7963
8265
  });
7964
8266
 
7965
- var _excluded$p = ["count", "size", "testID", "themeVariant"];
8267
+ var _excluded$o = ["count", "size", "testID", "themeVariant"];
7966
8268
  var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
7967
8269
  var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
7968
8270
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -7994,7 +8296,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
7994
8296
  size = _ref2$size === void 0 ? 12 : _ref2$size,
7995
8297
  testID = _ref2.testID,
7996
8298
  themeVariant = _ref2.themeVariant,
7997
- nativeProps = _objectWithoutProperties(_ref2, _excluded$p);
8299
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$o);
7998
8300
  var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
7999
8301
  React.useEffect(function () {
8000
8302
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
@@ -8433,11 +8735,11 @@ var Header = function Header(_ref) {
8433
8735
  })) : null), showDivider ? /*#__PURE__*/React__default["default"].createElement(Divider, null) : null);
8434
8736
  };
8435
8737
 
8436
- var _excluded$o = ["scrollEventThrottle"];
8738
+ var _excluded$n = ["scrollEventThrottle"];
8437
8739
  var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
8438
8740
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
8439
8741
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
8440
- props = _objectWithoutProperties(_ref, _excluded$o);
8742
+ props = _objectWithoutProperties(_ref, _excluded$n);
8441
8743
  var _useContext = React.useContext(BottomSheetContext),
8442
8744
  setInternalShowDivider = _useContext.setInternalShowDivider;
8443
8745
  var onScrollBeginDrag = React.useCallback(function (e) {
@@ -8752,7 +9054,7 @@ var borderWidths = {
8752
9054
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
8753
9055
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
8754
9056
 
8755
- var _excluded$n = ["theme"];
9057
+ var _excluded$m = ["theme"];
8756
9058
  var getThemeValue = function getThemeValue(theme, key, props) {
8757
9059
  var propConfig = config[key];
8758
9060
  var propValue = props[key];
@@ -8779,18 +9081,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
8779
9081
  var configKeys = Object.keys(config);
8780
9082
  var StyledBox = index$b(reactNative.View)(function (_ref5) {
8781
9083
  var theme = _ref5.theme,
8782
- otherProps = _objectWithoutProperties(_ref5, _excluded$n);
9084
+ otherProps = _objectWithoutProperties(_ref5, _excluded$m);
8783
9085
  var styleProps = pick(configKeys, otherProps);
8784
9086
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
8785
9087
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
8786
9088
  });
8787
9089
 
8788
- var _excluded$m = ["children", "style", "testID"];
9090
+ var _excluded$l = ["children", "style", "testID"];
8789
9091
  var Box = function Box(_ref) {
8790
9092
  var children = _ref.children,
8791
9093
  style = _ref.style,
8792
9094
  testID = _ref.testID,
8793
- otherProps = _objectWithoutProperties(_ref, _excluded$m);
9095
+ otherProps = _objectWithoutProperties(_ref, _excluded$l);
8794
9096
  return /*#__PURE__*/React__default["default"].createElement(StyledBox, _extends$1({}, otherProps, {
8795
9097
  style: style,
8796
9098
  testID: testID
@@ -11426,7 +11728,7 @@ var Calendar = function Calendar(_ref) {
11426
11728
  })));
11427
11729
  };
11428
11730
 
11429
- var _excluded$l = ["rounded", "size", "testID", "style"];
11731
+ var _excluded$k = ["rounded", "size", "testID", "style"];
11430
11732
  var Image = function Image(_ref) {
11431
11733
  var _ref$rounded = _ref.rounded,
11432
11734
  rounded = _ref$rounded === void 0 ? false : _ref$rounded,
@@ -11434,7 +11736,7 @@ var Image = function Image(_ref) {
11434
11736
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
11435
11737
  testID = _ref.testID,
11436
11738
  style = _ref.style,
11437
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$l);
11739
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$k);
11438
11740
  var theme = useTheme();
11439
11741
  var imageSize = theme.__hd__.image.sizes[size];
11440
11742
  return /*#__PURE__*/React__default["default"].createElement(reactNative.Image, _extends$1({
@@ -11636,12 +11938,12 @@ var Indicator = index$b(reactNative.View)(function (_ref2) {
11636
11938
  };
11637
11939
  });
11638
11940
 
11639
- var _excluded$k = ["intent", "children"];
11941
+ var _excluded$j = ["intent", "children"];
11640
11942
  var DataCard = function DataCard(_ref) {
11641
11943
  var _ref$intent = _ref.intent,
11642
11944
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
11643
11945
  children = _ref.children,
11644
- nativeProps = _objectWithoutProperties(_ref, _excluded$k);
11946
+ nativeProps = _objectWithoutProperties(_ref, _excluded$j);
11645
11947
  return /*#__PURE__*/React__default["default"].createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default["default"].createElement(Indicator, {
11646
11948
  themeIntent: intent,
11647
11949
  testID: "data-card-indicator"
@@ -11659,11 +11961,11 @@ var StyledCard$1 = index$b(reactNative.View)(function (_ref) {
11659
11961
  });
11660
11962
  });
11661
11963
 
11662
- var _excluded$j = ["intent", "children"];
11964
+ var _excluded$i = ["intent", "children"];
11663
11965
  var Card = function Card(_ref) {
11664
11966
  var intent = _ref.intent,
11665
11967
  children = _ref.children,
11666
- nativeProps = _objectWithoutProperties(_ref, _excluded$j);
11968
+ nativeProps = _objectWithoutProperties(_ref, _excluded$i);
11667
11969
  return /*#__PURE__*/React__default["default"].createElement(StyledCard$1, _extends$1({}, nativeProps, {
11668
11970
  themeIntent: intent
11669
11971
  }), children);
@@ -11870,7 +12172,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11870
12172
  });
11871
12173
  CardCarousel.displayName = 'CardCarousel';
11872
12174
 
11873
- var _excluded$i = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "pageControlPosition"];
12175
+ var _excluded$h = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "pageControlPosition"];
11874
12176
  function useStateFromProp(initialValue) {
11875
12177
  var _useState = React.useState(initialValue),
11876
12178
  _useState2 = _slicedToArray(_useState, 2),
@@ -11895,7 +12197,7 @@ var Carousel = function Carousel(_ref) {
11895
12197
  shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop : _ref$shouldShowPagina,
11896
12198
  _ref$pageControlPosit = _ref.pageControlPosition,
11897
12199
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'bottom' : _ref$pageControlPosit,
11898
- nativeProps = _objectWithoutProperties(_ref, _excluded$i);
12200
+ nativeProps = _objectWithoutProperties(_ref, _excluded$h);
11899
12201
  useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop);
11900
12202
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
11901
12203
  var carouselRef = React.useRef(null);
@@ -12218,7 +12520,7 @@ var StyledErrorAndMaxLengthContainer = index$b(reactNative.View)(function () {
12218
12520
  };
12219
12521
  });
12220
12522
 
12221
- var _excluded$h = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
12523
+ var _excluded$g = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
12222
12524
  var getState$1 = function getState(_ref) {
12223
12525
  var disabled = _ref.disabled,
12224
12526
  error = _ref.error,
@@ -12270,7 +12572,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
12270
12572
  allowFontScaling = _ref2$allowFontScalin === void 0 ? false : _ref2$allowFontScalin,
12271
12573
  _ref2$variant = _ref2.variant,
12272
12574
  variant = _ref2$variant === void 0 ? 'text' : _ref2$variant,
12273
- nativeProps = _objectWithoutProperties(_ref2, _excluded$h);
12575
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$g);
12274
12576
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
12275
12577
  var isEmptyValue = displayText.length === 0;
12276
12578
  var actualSuffix = loading ? 'loading' : suffix;
@@ -12714,11 +13016,11 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
12714
13016
  }))));
12715
13017
  };
12716
13018
 
12717
- var _excluded$g = ["variant"];
13019
+ var _excluded$f = ["variant"];
12718
13020
  var DatePicker = function DatePicker(_ref) {
12719
13021
  var _ref$variant = _ref.variant,
12720
13022
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
12721
- props = _objectWithoutProperties(_ref, _excluded$g);
13023
+ props = _objectWithoutProperties(_ref, _excluded$f);
12722
13024
  if (variant === 'calendar') {
12723
13025
  return /*#__PURE__*/React__default["default"].createElement(DatePickerCalendar, props);
12724
13026
  }
@@ -13152,7 +13454,7 @@ var StyledErrorDescription = index$b(Typography.Body)(function (_ref9) {
13152
13454
  };
13153
13455
  });
13154
13456
 
13155
- var _excluded$f = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"],
13457
+ var _excluded$e = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"],
13156
13458
  _excluded2 = ["visible", "variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"];
13157
13459
  var renderImage$1 = function renderImage(image) {
13158
13460
  if ( /*#__PURE__*/React.isValidElement(image)) {
@@ -13178,7 +13480,7 @@ var ErrorPage = function ErrorPage(_ref) {
13178
13480
  onCtaPress = _ref.onCtaPress,
13179
13481
  secondaryCtaText = _ref.secondaryCtaText,
13180
13482
  onSecondaryCtaPress = _ref.onSecondaryCtaPress,
13181
- nativeProps = _objectWithoutProperties(_ref, _excluded$f);
13483
+ nativeProps = _objectWithoutProperties(_ref, _excluded$e);
13182
13484
  var showCta = ctaText && onCtaPress !== undefined;
13183
13485
  var showSecondaryCta = secondaryCtaText && onSecondaryCtaPress !== undefined;
13184
13486
  var showButtonContainer = showCta || showSecondaryCta;
@@ -13337,11 +13639,11 @@ var StyledIconContainer = index$b(Box)(function (_ref4) {
13337
13639
  };
13338
13640
  });
13339
13641
 
13340
- var _excluded$e = ["active"];
13642
+ var _excluded$d = ["active"];
13341
13643
  var AnimatedIcons = reactNative.Animated.createAnimatedComponent(StyledFABIcon);
13342
13644
  var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
13343
13645
  var active = _ref.active,
13344
- iconProps = _objectWithoutProperties(_ref, _excluded$e);
13646
+ iconProps = _objectWithoutProperties(_ref, _excluded$d);
13345
13647
  var rotateAnimation = React.useRef(new reactNative.Animated.Value(active ? 1 : 0));
13346
13648
  React.useEffect(function () {
13347
13649
  var animation = reactNative.Animated.spring(rotateAnimation.current, {
@@ -13594,136 +13896,6 @@ var StyledHeaderText = index$b(Typography.Title)(function (_ref3) {
13594
13896
  };
13595
13897
  });
13596
13898
 
13597
- var _excluded$d = ["style", "children"];
13598
- var FABModalPresenter = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
13599
- var style = _ref2.style,
13600
- children = _ref2.children,
13601
- props = _objectWithoutProperties(_ref2, _excluded$d);
13602
- var animatedOpacity = React.useRef(new reactNative.Animated.Value(0));
13603
- React__default["default"].useEffect(function () {
13604
- reactNative.Animated.spring(animatedOpacity.current, {
13605
- toValue: 1,
13606
- useNativeDriver: true
13607
- }).start();
13608
- }, []);
13609
- React__default["default"].useImperativeHandle(ref, function () {
13610
- return {
13611
- animatedOut: function animatedOut(completion) {
13612
- reactNative.Animated.spring(animatedOpacity.current, {
13613
- toValue: 0,
13614
- useNativeDriver: true
13615
- }).start(function () {
13616
- completion === null || completion === void 0 ? void 0 : completion();
13617
- });
13618
- }
13619
- };
13620
- });
13621
- return /*#__PURE__*/React__default["default"].createElement(Box, {
13622
- style: reactNative.StyleSheet.absoluteFill,
13623
- pointerEvents: "box-none"
13624
- }, /*#__PURE__*/React__default["default"].createElement(reactNative.Animated.View, _extends$1({
13625
- style: [{
13626
- width: '100%',
13627
- height: '100%',
13628
- justifyContent: 'center',
13629
- alignItems: 'center',
13630
- opacity: animatedOpacity.current
13631
- }, style]
13632
- }, props, {
13633
- pointerEvents: "box-none"
13634
- }), children));
13635
- });
13636
- /**
13637
- * Present a modal on screen immediately.
13638
- *
13639
- * The new presented modal will be on top of existing modals if there are any.
13640
- *
13641
- * @param Content A component to be presented as a modal on screen.
13642
- * This component will be centered horizontally and vertically on screen with
13643
- * a semitransparent black overlay underneath.
13644
- * @param contentProps Props for this modal component.
13645
- * @returns A `ModalHandler` you can use to dismiss the modal.
13646
- */
13647
- var showFABModal = function showFABModal(content) {
13648
- var _ref3 = null;
13649
- var rootSiblings = null;
13650
- var dismiss = function dismiss(onDismiss) {
13651
- if (rootSiblings) {
13652
- var cleanup = function cleanup() {
13653
- var _rootSiblings;
13654
- (_rootSiblings = rootSiblings) === null || _rootSiblings === void 0 ? void 0 : _rootSiblings.destroy();
13655
- rootSiblings = null;
13656
- _ref3 = null;
13657
- onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
13658
- };
13659
- if (_ref3) {
13660
- _ref3.animatedOut(cleanup);
13661
- } else {
13662
- cleanup();
13663
- }
13664
- }
13665
- };
13666
- var update = function update(newContent) {
13667
- var _rootSiblings2;
13668
- (_rootSiblings2 = rootSiblings) === null || _rootSiblings2 === void 0 ? void 0 : _rootSiblings2.update( /*#__PURE__*/React__default["default"].createElement(FABModalPresenter, {
13669
- ref: function ref(_ref) {
13670
- _ref3 = _ref;
13671
- }
13672
- }, newContent));
13673
- };
13674
- rootSiblings = new RootSiblings__default["default"]( /*#__PURE__*/React__default["default"].createElement(FABModalPresenter, {
13675
- ref: function ref(_ref) {
13676
- _ref3 = _ref;
13677
- }
13678
- }, content));
13679
- return {
13680
- dismiss: dismiss,
13681
- update: update
13682
- };
13683
- };
13684
- FABModalPresenter.displayName = 'FABModalPresenter';
13685
-
13686
- var wrapperStyle$1 = {
13687
- width: reactNative.Dimensions.get('window').width,
13688
- height: reactNative.Dimensions.get('window').height
13689
- };
13690
- var fABModal = function fABModal(_ref) {
13691
- var children = _ref.children,
13692
- onShow = _ref.onShow,
13693
- testID = _ref.testID,
13694
- _ref$visible = _ref.visible,
13695
- visible = _ref$visible === void 0 ? true : _ref$visible;
13696
- var _React$useState = React__default["default"].useState(),
13697
- _React$useState2 = _slicedToArray(_React$useState, 2),
13698
- modalHandler = _React$useState2[0],
13699
- setModalHandler = _React$useState2[1];
13700
- var getModalContent = React__default["default"].useCallback(function () {
13701
- return /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
13702
- pointerEvents: "box-none",
13703
- style: wrapperStyle$1,
13704
- testID: testID
13705
- }, children);
13706
- }, [visible, children, onShow, testID]);
13707
- React__default["default"].useEffect(function () {
13708
- if (visible) {
13709
- // Modal does not exist, create a new one
13710
- if (!modalHandler) {
13711
- var newModalHandler = showFABModal(getModalContent());
13712
- setModalHandler(newModalHandler);
13713
- onShow === null || onShow === void 0 ? void 0 : onShow();
13714
- }
13715
- // Modal already exists, update it
13716
- else {
13717
- modalHandler.update(getModalContent());
13718
- }
13719
- } else {
13720
- modalHandler === null || modalHandler === void 0 ? void 0 : modalHandler.dismiss();
13721
- setModalHandler(undefined);
13722
- }
13723
- }, [getModalContent]);
13724
- return null;
13725
- };
13726
-
13727
13899
  var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
13728
13900
  var headerTitle = _ref.headerTitle,
13729
13901
  onPress = _ref.onPress,
@@ -13774,7 +13946,7 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
13774
13946
  inputRange: [0, 1],
13775
13947
  outputRange: [0, 1]
13776
13948
  });
13777
- return /*#__PURE__*/React__default["default"].createElement(fABModal, null, /*#__PURE__*/React__default["default"].createElement(StyledContainer$2, {
13949
+ return /*#__PURE__*/React__default["default"].createElement(StyledContainer$2, {
13778
13950
  testID: testID,
13779
13951
  pointerEvents: "box-none",
13780
13952
  style: style
@@ -13818,7 +13990,7 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
13818
13990
  active: active,
13819
13991
  title: fabTitle,
13820
13992
  ref: fabRef
13821
- })));
13993
+ }));
13822
13994
  });
13823
13995
  ActionGroup.displayName = 'FAB.ActionGroup';
13824
13996
 
@@ -33884,6 +34056,7 @@ exports.List = List;
33884
34056
  exports.Modal = index$6;
33885
34057
  exports.PageControl = PageControl;
33886
34058
  exports.PinInput = PinInput;
34059
+ exports.Portal = index$c;
33887
34060
  exports.Progress = Progress;
33888
34061
  exports.Radio = CompoundRadio;
33889
34062
  exports.Rate = Rate;