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

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
@@ -2662,8 +2662,6 @@ var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2662
2662
 
2663
2663
  var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
2664
2664
 
2665
- var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
2666
-
2667
2665
  /**
2668
2666
  * Copyright (c) 2013-present, Facebook, Inc.
2669
2667
  *
@@ -2676,7 +2674,7 @@ var printWarning$1 = function() {};
2676
2674
  if (process.env.NODE_ENV !== 'production') {
2677
2675
  var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
2678
2676
  var loggedTypeFailures = {};
2679
- var has$1 = has$2;
2677
+ var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
2680
2678
 
2681
2679
  printWarning$1 = function(text) {
2682
2680
  var message = 'Warning: ' + text;
@@ -2688,7 +2686,7 @@ if (process.env.NODE_ENV !== 'production') {
2688
2686
  // This error was thrown as a convenience so that you can use this stack
2689
2687
  // to find the callsite that caused this warning to fire.
2690
2688
  throw new Error(message);
2691
- } catch (x) { /**/ }
2689
+ } catch (x) {}
2692
2690
  };
2693
2691
  }
2694
2692
 
@@ -2717,8 +2715,7 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
2717
2715
  if (typeof typeSpecs[typeSpecName] !== 'function') {
2718
2716
  var err = Error(
2719
2717
  (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
2720
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
2721
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
2718
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
2722
2719
  );
2723
2720
  err.name = 'Invariant Violation';
2724
2721
  throw err;
@@ -2777,9 +2774,9 @@ var ReactIs$1 = reactIs$1.exports;
2777
2774
  var assign = objectAssign;
2778
2775
 
2779
2776
  var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
2780
- var has = has$2;
2781
2777
  var checkPropTypes = checkPropTypes_1;
2782
2778
 
2779
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
2783
2780
  var printWarning = function() {};
2784
2781
 
2785
2782
  if (process.env.NODE_ENV !== 'production') {
@@ -2880,7 +2877,6 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2880
2877
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
2881
2878
  var ReactPropTypes = {
2882
2879
  array: createPrimitiveTypeChecker('array'),
2883
- bigint: createPrimitiveTypeChecker('bigint'),
2884
2880
  bool: createPrimitiveTypeChecker('boolean'),
2885
2881
  func: createPrimitiveTypeChecker('function'),
2886
2882
  number: createPrimitiveTypeChecker('number'),
@@ -2926,9 +2922,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2926
2922
  * is prohibitively expensive if they are created too often, such as what
2927
2923
  * happens in oneOfType() for any type before the one that matched.
2928
2924
  */
2929
- function PropTypeError(message, data) {
2925
+ function PropTypeError(message) {
2930
2926
  this.message = message;
2931
- this.data = data && typeof data === 'object' ? data: {};
2932
2927
  this.stack = '';
2933
2928
  }
2934
2929
  // Make `instanceof Error` still work for returned errors.
@@ -2963,7 +2958,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2963
2958
  ) {
2964
2959
  printWarning(
2965
2960
  'You are manually calling a React.PropTypes validation ' +
2966
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
2961
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
2967
2962
  'and will throw in the standalone `prop-types` package. ' +
2968
2963
  'You may be seeing this warning due to a third-party PropTypes ' +
2969
2964
  'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
@@ -3002,10 +2997,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3002
2997
  // 'of type `object`'.
3003
2998
  var preciseType = getPreciseType(propValue);
3004
2999
 
3005
- return new PropTypeError(
3006
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
3007
- {expectedType: expectedType}
3008
- );
3000
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
3009
3001
  }
3010
3002
  return null;
3011
3003
  }
@@ -3149,19 +3141,14 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3149
3141
  }
3150
3142
 
3151
3143
  function validate(props, propName, componentName, location, propFullName) {
3152
- var expectedTypes = [];
3153
3144
  for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3154
3145
  var checker = arrayOfTypeCheckers[i];
3155
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
3156
- if (checkerResult == null) {
3146
+ if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
3157
3147
  return null;
3158
3148
  }
3159
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
3160
- expectedTypes.push(checkerResult.data.expectedType);
3161
- }
3162
3149
  }
3163
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
3164
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
3150
+
3151
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
3165
3152
  }
3166
3153
  return createChainableTypeChecker(validate);
3167
3154
  }
@@ -3176,13 +3163,6 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3176
3163
  return createChainableTypeChecker(validate);
3177
3164
  }
3178
3165
 
3179
- function invalidValidatorError(componentName, location, propFullName, key, type) {
3180
- return new PropTypeError(
3181
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
3182
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
3183
- );
3184
- }
3185
-
3186
3166
  function createShapeTypeChecker(shapeTypes) {
3187
3167
  function validate(props, propName, componentName, location, propFullName) {
3188
3168
  var propValue = props[propName];
@@ -3192,8 +3172,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3192
3172
  }
3193
3173
  for (var key in shapeTypes) {
3194
3174
  var checker = shapeTypes[key];
3195
- if (typeof checker !== 'function') {
3196
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3175
+ if (!checker) {
3176
+ continue;
3197
3177
  }
3198
3178
  var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
3199
3179
  if (error) {
@@ -3212,18 +3192,16 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3212
3192
  if (propType !== 'object') {
3213
3193
  return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3214
3194
  }
3215
- // We need to check all keys in case some are required but missing from props.
3195
+ // We need to check all keys in case some are required but missing from
3196
+ // props.
3216
3197
  var allKeys = assign({}, props[propName], shapeTypes);
3217
3198
  for (var key in allKeys) {
3218
3199
  var checker = shapeTypes[key];
3219
- if (has(shapeTypes, key) && typeof checker !== 'function') {
3220
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3221
- }
3222
3200
  if (!checker) {
3223
3201
  return new PropTypeError(
3224
3202
  'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
3225
3203
  '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
3226
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
3204
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
3227
3205
  );
3228
3206
  }
3229
3207
  var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
@@ -3408,7 +3386,6 @@ var factoryWithThrowingShims = function() {
3408
3386
  // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
3409
3387
  var ReactPropTypes = {
3410
3388
  array: shim,
3411
- bigint: shim,
3412
3389
  bool: shim,
3413
3390
  func: shim,
3414
3391
  number: shim,
@@ -3864,6 +3841,11 @@ var faExclamationTriangle = {
3864
3841
  iconName: 'exclamation-triangle',
3865
3842
  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
3843
  };
3844
+ var faInfoCircle = {
3845
+ prefix: 'fas',
3846
+ iconName: 'info-circle',
3847
+ 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"]
3848
+ };
3867
3849
 
3868
3850
  const SECONDARY_BLUE = '#38598a';
3869
3851
  const LANDING_HEADER_FONT = '22px';
@@ -3995,7 +3977,8 @@ function _interopRequireDefault(obj) {
3995
3977
  };
3996
3978
  }
3997
3979
 
3998
- module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
3980
+ module.exports = _interopRequireDefault;
3981
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
3999
3982
  }(interopRequireDefault));
4000
3983
 
4001
3984
  function _extends() {
@@ -8457,14 +8440,25 @@ var _typeof = {exports: {}};
8457
8440
  function _typeof(obj) {
8458
8441
  "@babel/helpers - typeof";
8459
8442
 
8460
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
8461
- return typeof obj;
8462
- } : function (obj) {
8463
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8464
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
8443
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
8444
+ module.exports = _typeof = function _typeof(obj) {
8445
+ return typeof obj;
8446
+ };
8447
+
8448
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
8449
+ } else {
8450
+ module.exports = _typeof = function _typeof(obj) {
8451
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8452
+ };
8453
+
8454
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
8455
+ }
8456
+
8457
+ return _typeof(obj);
8465
8458
  }
8466
8459
 
8467
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
8460
+ module.exports = _typeof;
8461
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
8468
8462
  }(_typeof));
8469
8463
 
8470
8464
  (function (module) {
@@ -8520,7 +8514,8 @@ function _interopRequireWildcard(obj, nodeInterop) {
8520
8514
  return newObj;
8521
8515
  }
8522
8516
 
8523
- module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;
8517
+ module.exports = _interopRequireWildcard;
8518
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
8524
8519
  }(interopRequireWildcard));
8525
8520
 
8526
8521
  var _interopRequireDefault = interopRequireDefault.exports;
@@ -8713,6 +8708,11 @@ const styles = {
8713
8708
  danger: {
8714
8709
  container: `
8715
8710
  background-color: #EAC2C1;
8711
+ `,
8712
+ },
8713
+ info: {
8714
+ container: `
8715
+ background-color: #FFDD81;
8716
8716
  `,
8717
8717
  },
8718
8718
  success: {
@@ -8750,9 +8750,22 @@ const DangerIcon = (React__default["default"].createElement("div", { style: {
8750
8750
  color: '#d94532',
8751
8751
  marginBottom: '0.1em',
8752
8752
  }, size: "sm" })));
8753
+ const InfoIcon = (React__default["default"].createElement("div", { style: {
8754
+ backgroundColor: 'white',
8755
+ marginRight: '1em',
8756
+ borderRadius: '50%',
8757
+ height: '1.5em',
8758
+ width: '1.5em',
8759
+ display: 'inline-block',
8760
+ textAlign: 'center',
8761
+ border: '1px solid #434a44',
8762
+ } },
8763
+ React__default["default"].createElement(FontAwesomeIcon, { icon: faInfoCircle, style: {
8764
+ color: '#000',
8765
+ marginBottom: '0.1em',
8766
+ }, size: "sm" })));
8753
8767
  const Alert = (props) => (React__default["default"].createElement(DefaultAlert, Object.assign({}, props),
8754
- props.variant === 'success' && SuccessIcon,
8755
- props.variant === 'danger' && DangerIcon,
8768
+ props.variant === 'success' ? SuccessIcon : props.variant === 'danger' ? DangerIcon : InfoIcon,
8756
8769
  props.children,
8757
8770
  props.content,
8758
8771
  React__default["default"].createElement(DefaultAlert.Close, null, "X")));