@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 +61 -48
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Alert/Alert.d.ts +4 -1
- package/dist/esm/index.js +61 -48
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Alert/Alert.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,15 @@ 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
|
};
|
|
14
17
|
};
|
|
15
18
|
};
|
|
16
|
-
declare type Variant = 'danger' | 'success';
|
|
19
|
+
declare type Variant = 'danger' | 'success' | 'info';
|
|
17
20
|
interface Props {
|
|
18
21
|
variant?: Variant;
|
|
19
22
|
content?: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -2654,8 +2654,6 @@ var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
2654
2654
|
|
|
2655
2655
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
2656
2656
|
|
|
2657
|
-
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2658
|
-
|
|
2659
2657
|
/**
|
|
2660
2658
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2661
2659
|
*
|
|
@@ -2668,7 +2666,7 @@ var printWarning$1 = function() {};
|
|
|
2668
2666
|
if (process.env.NODE_ENV !== 'production') {
|
|
2669
2667
|
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
2670
2668
|
var loggedTypeFailures = {};
|
|
2671
|
-
var has$1 =
|
|
2669
|
+
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2672
2670
|
|
|
2673
2671
|
printWarning$1 = function(text) {
|
|
2674
2672
|
var message = 'Warning: ' + text;
|
|
@@ -2680,7 +2678,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2680
2678
|
// This error was thrown as a convenience so that you can use this stack
|
|
2681
2679
|
// to find the callsite that caused this warning to fire.
|
|
2682
2680
|
throw new Error(message);
|
|
2683
|
-
} catch (x) {
|
|
2681
|
+
} catch (x) {}
|
|
2684
2682
|
};
|
|
2685
2683
|
}
|
|
2686
2684
|
|
|
@@ -2709,8 +2707,7 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
2709
2707
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2710
2708
|
var err = Error(
|
|
2711
2709
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
2712
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
2713
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
2710
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
2714
2711
|
);
|
|
2715
2712
|
err.name = 'Invariant Violation';
|
|
2716
2713
|
throw err;
|
|
@@ -2769,9 +2766,9 @@ var ReactIs$1 = reactIs$1.exports;
|
|
|
2769
2766
|
var assign = objectAssign;
|
|
2770
2767
|
|
|
2771
2768
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
2772
|
-
var has = has$2;
|
|
2773
2769
|
var checkPropTypes = checkPropTypes_1;
|
|
2774
2770
|
|
|
2771
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2775
2772
|
var printWarning = function() {};
|
|
2776
2773
|
|
|
2777
2774
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2872,7 +2869,6 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2872
2869
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
2873
2870
|
var ReactPropTypes = {
|
|
2874
2871
|
array: createPrimitiveTypeChecker('array'),
|
|
2875
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
2876
2872
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
2877
2873
|
func: createPrimitiveTypeChecker('function'),
|
|
2878
2874
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -2918,9 +2914,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2918
2914
|
* is prohibitively expensive if they are created too often, such as what
|
|
2919
2915
|
* happens in oneOfType() for any type before the one that matched.
|
|
2920
2916
|
*/
|
|
2921
|
-
function PropTypeError(message
|
|
2917
|
+
function PropTypeError(message) {
|
|
2922
2918
|
this.message = message;
|
|
2923
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
2924
2919
|
this.stack = '';
|
|
2925
2920
|
}
|
|
2926
2921
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -2955,7 +2950,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2955
2950
|
) {
|
|
2956
2951
|
printWarning(
|
|
2957
2952
|
'You are manually calling a React.PropTypes validation ' +
|
|
2958
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
2953
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
2959
2954
|
'and will throw in the standalone `prop-types` package. ' +
|
|
2960
2955
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
2961
2956
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -2994,10 +2989,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2994
2989
|
// 'of type `object`'.
|
|
2995
2990
|
var preciseType = getPreciseType(propValue);
|
|
2996
2991
|
|
|
2997
|
-
return new PropTypeError(
|
|
2998
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
2999
|
-
{expectedType: expectedType}
|
|
3000
|
-
);
|
|
2992
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
3001
2993
|
}
|
|
3002
2994
|
return null;
|
|
3003
2995
|
}
|
|
@@ -3141,19 +3133,14 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3141
3133
|
}
|
|
3142
3134
|
|
|
3143
3135
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3144
|
-
var expectedTypes = [];
|
|
3145
3136
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
3146
3137
|
var checker = arrayOfTypeCheckers[i];
|
|
3147
|
-
|
|
3148
|
-
if (checkerResult == null) {
|
|
3138
|
+
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
|
|
3149
3139
|
return null;
|
|
3150
3140
|
}
|
|
3151
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
3152
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
3153
|
-
}
|
|
3154
3141
|
}
|
|
3155
|
-
|
|
3156
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
3142
|
+
|
|
3143
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
3157
3144
|
}
|
|
3158
3145
|
return createChainableTypeChecker(validate);
|
|
3159
3146
|
}
|
|
@@ -3168,13 +3155,6 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3168
3155
|
return createChainableTypeChecker(validate);
|
|
3169
3156
|
}
|
|
3170
3157
|
|
|
3171
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
3172
|
-
return new PropTypeError(
|
|
3173
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
3174
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
3175
|
-
);
|
|
3176
|
-
}
|
|
3177
|
-
|
|
3178
3158
|
function createShapeTypeChecker(shapeTypes) {
|
|
3179
3159
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3180
3160
|
var propValue = props[propName];
|
|
@@ -3184,8 +3164,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3184
3164
|
}
|
|
3185
3165
|
for (var key in shapeTypes) {
|
|
3186
3166
|
var checker = shapeTypes[key];
|
|
3187
|
-
if (
|
|
3188
|
-
|
|
3167
|
+
if (!checker) {
|
|
3168
|
+
continue;
|
|
3189
3169
|
}
|
|
3190
3170
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
3191
3171
|
if (error) {
|
|
@@ -3204,18 +3184,16 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3204
3184
|
if (propType !== 'object') {
|
|
3205
3185
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
3206
3186
|
}
|
|
3207
|
-
// We need to check all keys in case some are required but missing from
|
|
3187
|
+
// We need to check all keys in case some are required but missing from
|
|
3188
|
+
// props.
|
|
3208
3189
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
3209
3190
|
for (var key in allKeys) {
|
|
3210
3191
|
var checker = shapeTypes[key];
|
|
3211
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
3212
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3213
|
-
}
|
|
3214
3192
|
if (!checker) {
|
|
3215
3193
|
return new PropTypeError(
|
|
3216
3194
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
3217
3195
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
3218
|
-
'\nValid keys: ' +
|
|
3196
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
3219
3197
|
);
|
|
3220
3198
|
}
|
|
3221
3199
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
@@ -3400,7 +3378,6 @@ var factoryWithThrowingShims = function() {
|
|
|
3400
3378
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
3401
3379
|
var ReactPropTypes = {
|
|
3402
3380
|
array: shim,
|
|
3403
|
-
bigint: shim,
|
|
3404
3381
|
bool: shim,
|
|
3405
3382
|
func: shim,
|
|
3406
3383
|
number: shim,
|
|
@@ -3856,6 +3833,11 @@ var faExclamationTriangle = {
|
|
|
3856
3833
|
iconName: 'exclamation-triangle',
|
|
3857
3834
|
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
3835
|
};
|
|
3836
|
+
var faInfoCircle = {
|
|
3837
|
+
prefix: 'fas',
|
|
3838
|
+
iconName: 'info-circle',
|
|
3839
|
+
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"]
|
|
3840
|
+
};
|
|
3859
3841
|
|
|
3860
3842
|
const SECONDARY_BLUE = '#38598a';
|
|
3861
3843
|
const LANDING_HEADER_FONT = '22px';
|
|
@@ -3987,7 +3969,8 @@ function _interopRequireDefault(obj) {
|
|
|
3987
3969
|
};
|
|
3988
3970
|
}
|
|
3989
3971
|
|
|
3990
|
-
module.exports = _interopRequireDefault
|
|
3972
|
+
module.exports = _interopRequireDefault;
|
|
3973
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
3991
3974
|
}(interopRequireDefault));
|
|
3992
3975
|
|
|
3993
3976
|
function _extends() {
|
|
@@ -8449,14 +8432,25 @@ var _typeof = {exports: {}};
|
|
|
8449
8432
|
function _typeof(obj) {
|
|
8450
8433
|
"@babel/helpers - typeof";
|
|
8451
8434
|
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8435
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
8436
|
+
module.exports = _typeof = function _typeof(obj) {
|
|
8437
|
+
return typeof obj;
|
|
8438
|
+
};
|
|
8439
|
+
|
|
8440
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
8441
|
+
} else {
|
|
8442
|
+
module.exports = _typeof = function _typeof(obj) {
|
|
8443
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
8444
|
+
};
|
|
8445
|
+
|
|
8446
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
8447
|
+
}
|
|
8448
|
+
|
|
8449
|
+
return _typeof(obj);
|
|
8457
8450
|
}
|
|
8458
8451
|
|
|
8459
|
-
module.exports = _typeof
|
|
8452
|
+
module.exports = _typeof;
|
|
8453
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
8460
8454
|
}(_typeof));
|
|
8461
8455
|
|
|
8462
8456
|
(function (module) {
|
|
@@ -8512,7 +8506,8 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
8512
8506
|
return newObj;
|
|
8513
8507
|
}
|
|
8514
8508
|
|
|
8515
|
-
module.exports = _interopRequireWildcard
|
|
8509
|
+
module.exports = _interopRequireWildcard;
|
|
8510
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
8516
8511
|
}(interopRequireWildcard));
|
|
8517
8512
|
|
|
8518
8513
|
var _interopRequireDefault = interopRequireDefault.exports;
|
|
@@ -8705,6 +8700,11 @@ const styles = {
|
|
|
8705
8700
|
danger: {
|
|
8706
8701
|
container: `
|
|
8707
8702
|
background-color: #EAC2C1;
|
|
8703
|
+
`,
|
|
8704
|
+
},
|
|
8705
|
+
info: {
|
|
8706
|
+
container: `
|
|
8707
|
+
background-color: #FFDD81;
|
|
8708
8708
|
`,
|
|
8709
8709
|
},
|
|
8710
8710
|
success: {
|
|
@@ -8742,9 +8742,22 @@ const DangerIcon = (React.createElement("div", { style: {
|
|
|
8742
8742
|
color: '#d94532',
|
|
8743
8743
|
marginBottom: '0.1em',
|
|
8744
8744
|
}, size: "sm" })));
|
|
8745
|
+
const InfoIcon = (React.createElement("div", { style: {
|
|
8746
|
+
backgroundColor: 'white',
|
|
8747
|
+
marginRight: '1em',
|
|
8748
|
+
borderRadius: '50%',
|
|
8749
|
+
height: '1.5em',
|
|
8750
|
+
width: '1.5em',
|
|
8751
|
+
display: 'inline-block',
|
|
8752
|
+
textAlign: 'center',
|
|
8753
|
+
border: '1px solid #434a44',
|
|
8754
|
+
} },
|
|
8755
|
+
React.createElement(FontAwesomeIcon, { icon: faInfoCircle, style: {
|
|
8756
|
+
color: '#000',
|
|
8757
|
+
marginBottom: '0.1em',
|
|
8758
|
+
}, size: "sm" })));
|
|
8745
8759
|
const Alert = (props) => (React.createElement(DefaultAlert, Object.assign({}, props),
|
|
8746
|
-
props.variant === 'success'
|
|
8747
|
-
props.variant === 'danger' && DangerIcon,
|
|
8760
|
+
props.variant === 'success' ? SuccessIcon : props.variant === 'danger' ? DangerIcon : InfoIcon,
|
|
8748
8761
|
props.children,
|
|
8749
8762
|
props.content,
|
|
8750
8763
|
React.createElement(DefaultAlert.Close, null, "X")));
|