@unicef/material-ui 0.12.2 → 0.12.4

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/prod.js CHANGED
@@ -6848,6 +6848,20 @@ function isPhoneNumberText(value) {
6848
6848
  return true;
6849
6849
  }
6850
6850
 
6851
+ /**
6852
+ *
6853
+ * @param {String} value Value text to be validated
6854
+ * @returns {Boolean} Whether the given value string contains safe text (no html tags)
6855
+ */
6856
+ function isRegexCaseInSensitive(value, regexRule) {
6857
+ var valueToTest = value || '';
6858
+ var regexStr = regexRule;
6859
+ if (!regexStr) return true; // if no regex, then accept any text
6860
+
6861
+ var regex = new RegExp(regexStr, 'i');
6862
+ return regex.test(valueToTest);
6863
+ }
6864
+
6851
6865
  /**
6852
6866
  *
6853
6867
  * @param {String} value Value text to be validated
@@ -41784,6 +41798,10 @@ function ForwardRefForm(props, ref) {
41784
41798
  return isAlphanumericText(value);
41785
41799
  });
41786
41800
 
41801
+ lib_2.addValidationRule('matchRegexpCaseInSensitive', function (value, regexStr) {
41802
+ return isRegexCaseInSensitive(value, regexStr);
41803
+ });
41804
+
41787
41805
  return React__default.createElement(lib_2, _extends$1({}, props, { ref: ref }));
41788
41806
  }
41789
41807
 
@@ -42675,6 +42693,8 @@ function UAsyncBadge(_ref) {
42675
42693
  var variant = _ref.variant,
42676
42694
  text = _ref.text,
42677
42695
  visible = _ref.visible,
42696
+ ariaRole = _ref.ariaRole,
42697
+ ariaLive = _ref.ariaLive,
42678
42698
  onReset = _ref.onReset;
42679
42699
 
42680
42700
  var classes = useStyles$p();
@@ -42698,8 +42718,8 @@ function UAsyncBadge(_ref) {
42698
42718
  { className: classes.root },
42699
42719
  visible && React__default.createElement(Chip$1, {
42700
42720
  ref: chipRef,
42701
- role: 'status',
42702
- 'aria-live': 'polite',
42721
+ role: ariaRole,
42722
+ 'aria-live': ariaLive,
42703
42723
  className: classes.chip + ' ' + classes[variant],
42704
42724
  avatar: variant === 'loading' ? React__default.createElement(CircularProgress$1, { size: 16 }) : variant === 'error' ? React__default.createElement(HighlightOffIcon, { size: 16 }) : variant === 'success' && React__default.createElement(DoneIcon, { size: 16 }),
42705
42725
  classes: { avatar: classes[variant] },
@@ -42717,7 +42737,16 @@ UAsyncBadge.propTypes = {
42717
42737
  /** display status of the badge */
42718
42738
  visible: PropTypes__default.bool,
42719
42739
  /** trigger reset of the badge */
42720
- onReset: PropTypes__default.func
42740
+ onReset: PropTypes__default.func,
42741
+ /** Aria role of the badge */
42742
+ ariaRole: PropTypes__default.oneOf(['log', 'status', 'alert']),
42743
+ /** Aria live of the badge */
42744
+ ariaLive: PropTypes__default.oneOf(['polite', 'assertive', 'off'])
42745
+ };
42746
+
42747
+ UAsyncBadge.defaultTypes = {
42748
+ ariaRole: 'alert',
42749
+ ariaLive: 'assertive'
42721
42750
  };
42722
42751
 
42723
42752
  var useStyles$q = makeStyles$1(function () {