@bcgov-sso/common-react-components 1.18.0 → 1.18.1

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/dist/cjs/index.js CHANGED
@@ -3459,18 +3459,40 @@ if (process.env.NODE_ENV !== 'production') {
3459
3459
 
3460
3460
  var PropTypes = propTypes.exports;
3461
3461
 
3462
- function _typeof$1(obj) {
3463
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
3464
- _typeof$1 = function (obj) {
3465
- return typeof obj;
3466
- };
3467
- } else {
3468
- _typeof$1 = function (obj) {
3469
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3470
- };
3462
+ function ownKeys(object, enumerableOnly) {
3463
+ var keys = Object.keys(object);
3464
+
3465
+ if (Object.getOwnPropertySymbols) {
3466
+ var symbols = Object.getOwnPropertySymbols(object);
3467
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
3468
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3469
+ })), keys.push.apply(keys, symbols);
3471
3470
  }
3472
3471
 
3473
- return _typeof$1(obj);
3472
+ return keys;
3473
+ }
3474
+
3475
+ function _objectSpread2(target) {
3476
+ for (var i = 1; i < arguments.length; i++) {
3477
+ var source = null != arguments[i] ? arguments[i] : {};
3478
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
3479
+ _defineProperty$1(target, key, source[key]);
3480
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
3481
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3482
+ });
3483
+ }
3484
+
3485
+ return target;
3486
+ }
3487
+
3488
+ function _typeof$1(obj) {
3489
+ "@babel/helpers - typeof";
3490
+
3491
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
3492
+ return typeof obj;
3493
+ } : function (obj) {
3494
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3495
+ }, _typeof$1(obj);
3474
3496
  }
3475
3497
 
3476
3498
  function _defineProperty$1(obj, key, value) {
@@ -3488,40 +3510,6 @@ function _defineProperty$1(obj, key, value) {
3488
3510
  return obj;
3489
3511
  }
3490
3512
 
3491
- function ownKeys(object, enumerableOnly) {
3492
- var keys = Object.keys(object);
3493
-
3494
- if (Object.getOwnPropertySymbols) {
3495
- var symbols = Object.getOwnPropertySymbols(object);
3496
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
3497
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3498
- });
3499
- keys.push.apply(keys, symbols);
3500
- }
3501
-
3502
- return keys;
3503
- }
3504
-
3505
- function _objectSpread2(target) {
3506
- for (var i = 1; i < arguments.length; i++) {
3507
- var source = arguments[i] != null ? arguments[i] : {};
3508
-
3509
- if (i % 2) {
3510
- ownKeys(Object(source), true).forEach(function (key) {
3511
- _defineProperty$1(target, key, source[key]);
3512
- });
3513
- } else if (Object.getOwnPropertyDescriptors) {
3514
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3515
- } else {
3516
- ownKeys(Object(source)).forEach(function (key) {
3517
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3518
- });
3519
- }
3520
- }
3521
-
3522
- return target;
3523
- }
3524
-
3525
3513
  function _objectWithoutPropertiesLoose$1(source, excluded) {
3526
3514
  if (source == null) return {};
3527
3515
  var target = {};
@@ -3559,30 +3547,51 @@ function _objectWithoutProperties(source, excluded) {
3559
3547
  }
3560
3548
 
3561
3549
  function _toConsumableArray(arr) {
3562
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
3550
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
3563
3551
  }
3564
3552
 
3565
3553
  function _arrayWithoutHoles(arr) {
3566
- if (Array.isArray(arr)) {
3567
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
3568
-
3569
- return arr2;
3570
- }
3554
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
3571
3555
  }
3572
3556
 
3573
3557
  function _iterableToArray(iter) {
3574
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
3558
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3559
+ }
3560
+
3561
+ function _unsupportedIterableToArray(o, minLen) {
3562
+ if (!o) return;
3563
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
3564
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3565
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3566
+ if (n === "Map" || n === "Set") return Array.from(o);
3567
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
3568
+ }
3569
+
3570
+ function _arrayLikeToArray(arr, len) {
3571
+ if (len == null || len > arr.length) len = arr.length;
3572
+
3573
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
3574
+
3575
+ return arr2;
3575
3576
  }
3576
3577
 
3577
3578
  function _nonIterableSpread() {
3578
- throw new TypeError("Invalid attempt to spread non-iterable instance");
3579
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3579
3580
  }
3580
3581
 
3581
3582
  // Get CSS class list from a props object
3582
3583
  function classList(props) {
3583
3584
  var _classes;
3584
3585
 
3585
- var spin = props.spin,
3586
+ var beat = props.beat,
3587
+ fade = props.fade,
3588
+ beatFade = props.beatFade,
3589
+ bounce = props.bounce,
3590
+ shake = props.shake,
3591
+ flash = props.flash,
3592
+ spin = props.spin,
3593
+ spinPulse = props.spinPulse,
3594
+ spinReverse = props.spinReverse,
3586
3595
  pulse = props.pulse,
3587
3596
  fixedWidth = props.fixedWidth,
3588
3597
  inverse = props.inverse,
@@ -3594,7 +3603,15 @@ function classList(props) {
3594
3603
  pull = props.pull; // map of CSS class names to properties
3595
3604
 
3596
3605
  var classes = (_classes = {
3606
+ 'fa-beat': beat,
3607
+ 'fa-fade': fade,
3608
+ 'fa-beat-fade': beatFade,
3609
+ 'fa-bounce': bounce,
3610
+ 'fa-shake': shake,
3611
+ 'fa-flash': flash,
3597
3612
  'fa-spin': spin,
3613
+ 'fa-spin-reverse': spinReverse,
3614
+ 'fa-spin-pulse': spinPulse,
3598
3615
  'fa-pulse': pulse,
3599
3616
  'fa-fw': fixedWidth,
3600
3617
  'fa-inverse': inverse,
@@ -3635,6 +3652,8 @@ function camelize(string) {
3635
3652
  return string.substr(0, 1).toLowerCase() + string.substr(1);
3636
3653
  }
3637
3654
 
3655
+ var _excluded$1 = ["style"];
3656
+
3638
3657
  function capitalize(val) {
3639
3658
  return val.charAt(0).toUpperCase() + val.slice(1);
3640
3659
  }
@@ -3694,12 +3713,12 @@ function convert(createElement, element) {
3694
3713
 
3695
3714
  var _extraProps$style = extraProps.style,
3696
3715
  existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
3697
- remaining = _objectWithoutProperties(extraProps, ["style"]);
3716
+ remaining = _objectWithoutProperties(extraProps, _excluded$1);
3698
3717
 
3699
- mixins.attrs['style'] = _objectSpread2({}, mixins.attrs['style'], {}, existingStyle);
3718
+ mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);
3700
3719
  /* eslint-enable */
3701
3720
 
3702
- return createElement.apply(void 0, [element.tag, _objectSpread2({}, mixins.attrs, {}, remaining)].concat(_toConsumableArray(children)));
3721
+ return createElement.apply(void 0, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));
3703
3722
  }
3704
3723
 
3705
3724
  var PRODUCTION = false;
@@ -3723,6 +3742,10 @@ function normalizeIconArgs(icon) {
3723
3742
  return icon;
3724
3743
  }
3725
3744
 
3745
+ if (parse.icon) {
3746
+ return parse.icon(icon);
3747
+ } // if the icon is null, there's nothing to do
3748
+
3726
3749
 
3727
3750
  if (icon === null) {
3728
3751
  return null;
@@ -3762,24 +3785,27 @@ function objectWithKey(key, value) {
3762
3785
  return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty$1({}, key, value) : {};
3763
3786
  }
3764
3787
 
3788
+ var _excluded = ["forwardedRef"];
3765
3789
  function FontAwesomeIcon(_ref) {
3766
3790
  var forwardedRef = _ref.forwardedRef,
3767
- props = _objectWithoutProperties(_ref, ["forwardedRef"]);
3791
+ props = _objectWithoutProperties(_ref, _excluded);
3768
3792
 
3769
3793
  var iconArgs = props.icon,
3770
3794
  maskArgs = props.mask,
3771
3795
  symbol = props.symbol,
3772
3796
  className = props.className,
3773
3797
  title = props.title,
3774
- titleId = props.titleId;
3798
+ titleId = props.titleId,
3799
+ maskId = props.maskId;
3775
3800
  var iconLookup = normalizeIconArgs(iconArgs);
3776
3801
  var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
3777
3802
  var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
3778
3803
  var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
3779
- var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {
3804
+ var renderedIcon = icon(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
3780
3805
  symbol: symbol,
3781
3806
  title: title,
3782
- titleId: titleId
3807
+ titleId: titleId,
3808
+ maskId: maskId
3783
3809
  }));
3784
3810
 
3785
3811
  if (!renderedIcon) {
@@ -3801,9 +3827,14 @@ function FontAwesomeIcon(_ref) {
3801
3827
  }
3802
3828
  FontAwesomeIcon.displayName = 'FontAwesomeIcon';
3803
3829
  FontAwesomeIcon.propTypes = {
3830
+ beat: PropTypes.bool,
3804
3831
  border: PropTypes.bool,
3832
+ bounce: PropTypes.bool,
3805
3833
  className: PropTypes.string,
3834
+ fade: PropTypes.bool,
3835
+ flash: PropTypes.bool,
3806
3836
  mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
3837
+ maskId: PropTypes.string,
3807
3838
  fixedWidth: PropTypes.bool,
3808
3839
  inverse: PropTypes.bool,
3809
3840
  flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
@@ -3812,10 +3843,14 @@ FontAwesomeIcon.propTypes = {
3812
3843
  pull: PropTypes.oneOf(['right', 'left']),
3813
3844
  pulse: PropTypes.bool,
3814
3845
  rotation: PropTypes.oneOf([0, 90, 180, 270]),
3815
- size: PropTypes.oneOf(['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
3846
+ shake: PropTypes.bool,
3847
+ size: PropTypes.oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
3816
3848
  spin: PropTypes.bool,
3849
+ spinPulse: PropTypes.bool,
3850
+ spinReverse: PropTypes.bool,
3817
3851
  symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
3818
3852
  title: PropTypes.string,
3853
+ titleId: PropTypes.string,
3819
3854
  transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
3820
3855
  swapOpacity: PropTypes.bool
3821
3856
  };
@@ -3823,6 +3858,7 @@ FontAwesomeIcon.defaultProps = {
3823
3858
  border: false,
3824
3859
  className: '',
3825
3860
  mask: null,
3861
+ maskId: null,
3826
3862
  fixedWidth: false,
3827
3863
  inverse: false,
3828
3864
  flip: null,
@@ -3833,8 +3869,14 @@ FontAwesomeIcon.defaultProps = {
3833
3869
  rotation: null,
3834
3870
  size: null,
3835
3871
  spin: false,
3872
+ beat: false,
3873
+ fade: false,
3874
+ beatFade: false,
3875
+ bounce: false,
3876
+ shake: false,
3836
3877
  symbol: false,
3837
3878
  title: '',
3879
+ titleId: null,
3838
3880
  transform: null,
3839
3881
  swapOpacity: false
3840
3882
  };
@@ -3864,6 +3906,11 @@ var faExclamationTriangle = {
3864
3906
  iconName: 'exclamation-triangle',
3865
3907
  icon: [576, 512, [], "f071", "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]
3866
3908
  };
3909
+ var faInfoCircle = {
3910
+ prefix: 'fas',
3911
+ iconName: 'info-circle',
3912
+ icon: [512, 512, [], "f05a", "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"]
3913
+ };
3867
3914
 
3868
3915
  const SECONDARY_BLUE = '#38598a';
3869
3916
  const LANDING_HEADER_FONT = '22px';
@@ -8713,6 +8760,11 @@ const styles = {
8713
8760
  danger: {
8714
8761
  container: `
8715
8762
  background-color: #EAC2C1;
8763
+ `,
8764
+ },
8765
+ info: {
8766
+ container: `
8767
+ background-color: #FFDD81;
8716
8768
  `,
8717
8769
  },
8718
8770
  success: {
@@ -8750,9 +8802,22 @@ const DangerIcon = (React__default["default"].createElement("div", { style: {
8750
8802
  color: '#d94532',
8751
8803
  marginBottom: '0.1em',
8752
8804
  }, size: "sm" })));
8805
+ const InfoIcon = (React__default["default"].createElement("div", { style: {
8806
+ backgroundColor: 'white',
8807
+ marginRight: '1em',
8808
+ borderRadius: '50%',
8809
+ height: '1.5em',
8810
+ width: '1.5em',
8811
+ display: 'inline-block',
8812
+ textAlign: 'center',
8813
+ border: '1px solid #434a44',
8814
+ } },
8815
+ React__default["default"].createElement(FontAwesomeIcon, { icon: faInfoCircle, style: {
8816
+ color: '#000',
8817
+ marginBottom: '0.1em',
8818
+ }, size: "sm" })));
8753
8819
  const Alert = (props) => (React__default["default"].createElement(DefaultAlert, Object.assign({}, props),
8754
- props.variant === 'success' && SuccessIcon,
8755
- props.variant === 'danger' && DangerIcon,
8820
+ props.variant === 'success' ? SuccessIcon : props.variant === 'danger' ? DangerIcon : InfoIcon,
8756
8821
  props.children,
8757
8822
  props.content,
8758
8823
  React__default["default"].createElement(DefaultAlert.Close, null, "X")));