@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.
@@ -8,6 +8,9 @@ export declare const styles: {
8
8
  danger: {
9
9
  container: string;
10
10
  };
11
+ info: {
12
+ container: string;
13
+ };
11
14
  success: {
12
15
  container: string;
13
16
  };
package/dist/esm/index.js CHANGED
@@ -3451,18 +3451,40 @@ if (process.env.NODE_ENV !== 'production') {
3451
3451
 
3452
3452
  var PropTypes = propTypes.exports;
3453
3453
 
3454
- function _typeof$1(obj) {
3455
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
3456
- _typeof$1 = function (obj) {
3457
- return typeof obj;
3458
- };
3459
- } else {
3460
- _typeof$1 = function (obj) {
3461
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3462
- };
3454
+ function ownKeys(object, enumerableOnly) {
3455
+ var keys = Object.keys(object);
3456
+
3457
+ if (Object.getOwnPropertySymbols) {
3458
+ var symbols = Object.getOwnPropertySymbols(object);
3459
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
3460
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3461
+ })), keys.push.apply(keys, symbols);
3463
3462
  }
3464
3463
 
3465
- return _typeof$1(obj);
3464
+ return keys;
3465
+ }
3466
+
3467
+ function _objectSpread2(target) {
3468
+ for (var i = 1; i < arguments.length; i++) {
3469
+ var source = null != arguments[i] ? arguments[i] : {};
3470
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
3471
+ _defineProperty$1(target, key, source[key]);
3472
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
3473
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3474
+ });
3475
+ }
3476
+
3477
+ return target;
3478
+ }
3479
+
3480
+ function _typeof$1(obj) {
3481
+ "@babel/helpers - typeof";
3482
+
3483
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
3484
+ return typeof obj;
3485
+ } : function (obj) {
3486
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3487
+ }, _typeof$1(obj);
3466
3488
  }
3467
3489
 
3468
3490
  function _defineProperty$1(obj, key, value) {
@@ -3480,40 +3502,6 @@ function _defineProperty$1(obj, key, value) {
3480
3502
  return obj;
3481
3503
  }
3482
3504
 
3483
- function ownKeys(object, enumerableOnly) {
3484
- var keys = Object.keys(object);
3485
-
3486
- if (Object.getOwnPropertySymbols) {
3487
- var symbols = Object.getOwnPropertySymbols(object);
3488
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
3489
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3490
- });
3491
- keys.push.apply(keys, symbols);
3492
- }
3493
-
3494
- return keys;
3495
- }
3496
-
3497
- function _objectSpread2(target) {
3498
- for (var i = 1; i < arguments.length; i++) {
3499
- var source = arguments[i] != null ? arguments[i] : {};
3500
-
3501
- if (i % 2) {
3502
- ownKeys(Object(source), true).forEach(function (key) {
3503
- _defineProperty$1(target, key, source[key]);
3504
- });
3505
- } else if (Object.getOwnPropertyDescriptors) {
3506
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3507
- } else {
3508
- ownKeys(Object(source)).forEach(function (key) {
3509
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3510
- });
3511
- }
3512
- }
3513
-
3514
- return target;
3515
- }
3516
-
3517
3505
  function _objectWithoutPropertiesLoose$1(source, excluded) {
3518
3506
  if (source == null) return {};
3519
3507
  var target = {};
@@ -3551,30 +3539,51 @@ function _objectWithoutProperties(source, excluded) {
3551
3539
  }
3552
3540
 
3553
3541
  function _toConsumableArray(arr) {
3554
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
3542
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
3555
3543
  }
3556
3544
 
3557
3545
  function _arrayWithoutHoles(arr) {
3558
- if (Array.isArray(arr)) {
3559
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
3560
-
3561
- return arr2;
3562
- }
3546
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
3563
3547
  }
3564
3548
 
3565
3549
  function _iterableToArray(iter) {
3566
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
3550
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3551
+ }
3552
+
3553
+ function _unsupportedIterableToArray(o, minLen) {
3554
+ if (!o) return;
3555
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
3556
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3557
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3558
+ if (n === "Map" || n === "Set") return Array.from(o);
3559
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
3560
+ }
3561
+
3562
+ function _arrayLikeToArray(arr, len) {
3563
+ if (len == null || len > arr.length) len = arr.length;
3564
+
3565
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
3566
+
3567
+ return arr2;
3567
3568
  }
3568
3569
 
3569
3570
  function _nonIterableSpread() {
3570
- throw new TypeError("Invalid attempt to spread non-iterable instance");
3571
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3571
3572
  }
3572
3573
 
3573
3574
  // Get CSS class list from a props object
3574
3575
  function classList(props) {
3575
3576
  var _classes;
3576
3577
 
3577
- var spin = props.spin,
3578
+ var beat = props.beat,
3579
+ fade = props.fade,
3580
+ beatFade = props.beatFade,
3581
+ bounce = props.bounce,
3582
+ shake = props.shake,
3583
+ flash = props.flash,
3584
+ spin = props.spin,
3585
+ spinPulse = props.spinPulse,
3586
+ spinReverse = props.spinReverse,
3578
3587
  pulse = props.pulse,
3579
3588
  fixedWidth = props.fixedWidth,
3580
3589
  inverse = props.inverse,
@@ -3586,7 +3595,15 @@ function classList(props) {
3586
3595
  pull = props.pull; // map of CSS class names to properties
3587
3596
 
3588
3597
  var classes = (_classes = {
3598
+ 'fa-beat': beat,
3599
+ 'fa-fade': fade,
3600
+ 'fa-beat-fade': beatFade,
3601
+ 'fa-bounce': bounce,
3602
+ 'fa-shake': shake,
3603
+ 'fa-flash': flash,
3589
3604
  'fa-spin': spin,
3605
+ 'fa-spin-reverse': spinReverse,
3606
+ 'fa-spin-pulse': spinPulse,
3590
3607
  'fa-pulse': pulse,
3591
3608
  'fa-fw': fixedWidth,
3592
3609
  'fa-inverse': inverse,
@@ -3627,6 +3644,8 @@ function camelize(string) {
3627
3644
  return string.substr(0, 1).toLowerCase() + string.substr(1);
3628
3645
  }
3629
3646
 
3647
+ var _excluded$1 = ["style"];
3648
+
3630
3649
  function capitalize(val) {
3631
3650
  return val.charAt(0).toUpperCase() + val.slice(1);
3632
3651
  }
@@ -3686,12 +3705,12 @@ function convert(createElement, element) {
3686
3705
 
3687
3706
  var _extraProps$style = extraProps.style,
3688
3707
  existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
3689
- remaining = _objectWithoutProperties(extraProps, ["style"]);
3708
+ remaining = _objectWithoutProperties(extraProps, _excluded$1);
3690
3709
 
3691
- mixins.attrs['style'] = _objectSpread2({}, mixins.attrs['style'], {}, existingStyle);
3710
+ mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);
3692
3711
  /* eslint-enable */
3693
3712
 
3694
- return createElement.apply(void 0, [element.tag, _objectSpread2({}, mixins.attrs, {}, remaining)].concat(_toConsumableArray(children)));
3713
+ return createElement.apply(void 0, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));
3695
3714
  }
3696
3715
 
3697
3716
  var PRODUCTION = false;
@@ -3715,6 +3734,10 @@ function normalizeIconArgs(icon) {
3715
3734
  return icon;
3716
3735
  }
3717
3736
 
3737
+ if (parse.icon) {
3738
+ return parse.icon(icon);
3739
+ } // if the icon is null, there's nothing to do
3740
+
3718
3741
 
3719
3742
  if (icon === null) {
3720
3743
  return null;
@@ -3754,24 +3777,27 @@ function objectWithKey(key, value) {
3754
3777
  return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty$1({}, key, value) : {};
3755
3778
  }
3756
3779
 
3780
+ var _excluded = ["forwardedRef"];
3757
3781
  function FontAwesomeIcon(_ref) {
3758
3782
  var forwardedRef = _ref.forwardedRef,
3759
- props = _objectWithoutProperties(_ref, ["forwardedRef"]);
3783
+ props = _objectWithoutProperties(_ref, _excluded);
3760
3784
 
3761
3785
  var iconArgs = props.icon,
3762
3786
  maskArgs = props.mask,
3763
3787
  symbol = props.symbol,
3764
3788
  className = props.className,
3765
3789
  title = props.title,
3766
- titleId = props.titleId;
3790
+ titleId = props.titleId,
3791
+ maskId = props.maskId;
3767
3792
  var iconLookup = normalizeIconArgs(iconArgs);
3768
3793
  var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
3769
3794
  var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
3770
3795
  var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
3771
- var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {
3796
+ var renderedIcon = icon(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
3772
3797
  symbol: symbol,
3773
3798
  title: title,
3774
- titleId: titleId
3799
+ titleId: titleId,
3800
+ maskId: maskId
3775
3801
  }));
3776
3802
 
3777
3803
  if (!renderedIcon) {
@@ -3793,9 +3819,14 @@ function FontAwesomeIcon(_ref) {
3793
3819
  }
3794
3820
  FontAwesomeIcon.displayName = 'FontAwesomeIcon';
3795
3821
  FontAwesomeIcon.propTypes = {
3822
+ beat: PropTypes.bool,
3796
3823
  border: PropTypes.bool,
3824
+ bounce: PropTypes.bool,
3797
3825
  className: PropTypes.string,
3826
+ fade: PropTypes.bool,
3827
+ flash: PropTypes.bool,
3798
3828
  mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
3829
+ maskId: PropTypes.string,
3799
3830
  fixedWidth: PropTypes.bool,
3800
3831
  inverse: PropTypes.bool,
3801
3832
  flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
@@ -3804,10 +3835,14 @@ FontAwesomeIcon.propTypes = {
3804
3835
  pull: PropTypes.oneOf(['right', 'left']),
3805
3836
  pulse: PropTypes.bool,
3806
3837
  rotation: PropTypes.oneOf([0, 90, 180, 270]),
3807
- size: PropTypes.oneOf(['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
3838
+ shake: PropTypes.bool,
3839
+ size: PropTypes.oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
3808
3840
  spin: PropTypes.bool,
3841
+ spinPulse: PropTypes.bool,
3842
+ spinReverse: PropTypes.bool,
3809
3843
  symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
3810
3844
  title: PropTypes.string,
3845
+ titleId: PropTypes.string,
3811
3846
  transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
3812
3847
  swapOpacity: PropTypes.bool
3813
3848
  };
@@ -3815,6 +3850,7 @@ FontAwesomeIcon.defaultProps = {
3815
3850
  border: false,
3816
3851
  className: '',
3817
3852
  mask: null,
3853
+ maskId: null,
3818
3854
  fixedWidth: false,
3819
3855
  inverse: false,
3820
3856
  flip: null,
@@ -3825,8 +3861,14 @@ FontAwesomeIcon.defaultProps = {
3825
3861
  rotation: null,
3826
3862
  size: null,
3827
3863
  spin: false,
3864
+ beat: false,
3865
+ fade: false,
3866
+ beatFade: false,
3867
+ bounce: false,
3868
+ shake: false,
3828
3869
  symbol: false,
3829
3870
  title: '',
3871
+ titleId: null,
3830
3872
  transform: null,
3831
3873
  swapOpacity: false
3832
3874
  };
@@ -3856,6 +3898,11 @@ var faExclamationTriangle = {
3856
3898
  iconName: 'exclamation-triangle',
3857
3899
  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"]
3858
3900
  };
3901
+ var faInfoCircle = {
3902
+ prefix: 'fas',
3903
+ iconName: 'info-circle',
3904
+ 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"]
3905
+ };
3859
3906
 
3860
3907
  const SECONDARY_BLUE = '#38598a';
3861
3908
  const LANDING_HEADER_FONT = '22px';
@@ -8705,6 +8752,11 @@ const styles = {
8705
8752
  danger: {
8706
8753
  container: `
8707
8754
  background-color: #EAC2C1;
8755
+ `,
8756
+ },
8757
+ info: {
8758
+ container: `
8759
+ background-color: #FFDD81;
8708
8760
  `,
8709
8761
  },
8710
8762
  success: {
@@ -8742,9 +8794,22 @@ const DangerIcon = (React.createElement("div", { style: {
8742
8794
  color: '#d94532',
8743
8795
  marginBottom: '0.1em',
8744
8796
  }, size: "sm" })));
8797
+ const InfoIcon = (React.createElement("div", { style: {
8798
+ backgroundColor: 'white',
8799
+ marginRight: '1em',
8800
+ borderRadius: '50%',
8801
+ height: '1.5em',
8802
+ width: '1.5em',
8803
+ display: 'inline-block',
8804
+ textAlign: 'center',
8805
+ border: '1px solid #434a44',
8806
+ } },
8807
+ React.createElement(FontAwesomeIcon, { icon: faInfoCircle, style: {
8808
+ color: '#000',
8809
+ marginBottom: '0.1em',
8810
+ }, size: "sm" })));
8745
8811
  const Alert = (props) => (React.createElement(DefaultAlert, Object.assign({}, props),
8746
- props.variant === 'success' && SuccessIcon,
8747
- props.variant === 'danger' && DangerIcon,
8812
+ props.variant === 'success' ? SuccessIcon : props.variant === 'danger' ? DangerIcon : InfoIcon,
8748
8813
  props.children,
8749
8814
  props.content,
8750
8815
  React.createElement(DefaultAlert.Close, null, "X")));