@uncinc/uncinc-react-kitchen-sink 2.20.7 → 2.20.8

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.
@@ -81,7 +81,7 @@ export var Checkbox = function Checkbox(props) {
81
81
  disabled: disabled,
82
82
  className: className,
83
83
  required: required,
84
- "aria-describedby": "".concat(errorId, " ").concat(descriptionId),
84
+ "aria-describedby": "".concat(error ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
85
85
  "aria-invalid": Boolean(error)
86
86
  })), typeof title === 'string' ? ReactHtmlParser(title) : title);
87
87
  }));
@@ -37,7 +37,7 @@ var GenericFormElement = function GenericFormElement(props) {
37
37
  }), /*#__PURE__*/React.createElement("div", {
38
38
  className: "FormElement__inner ".concat(className, "__inner")
39
39
  }, includeFieldSet && /*#__PURE__*/React.createElement("fieldset", {
40
- "aria-describedby": "".concat(errorId, " ").concat(descriptionId),
40
+ "aria-describedby": "".concat(error && touched ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
41
41
  "aria-invalid": Boolean(error && touched)
42
42
  }, title && /*#__PURE__*/React.createElement("legend", null, title, !required && displayRequiredIndicator === 'optional' && /*#__PURE__*/React.createElement("span", {
43
43
  className: "FormElement__optional ".concat(className, "__optional")
@@ -97,7 +97,7 @@ export var TextField = function TextField(props) {
97
97
  name: fieldName,
98
98
  validate: handleValidation,
99
99
  onKeyUp: handleChange,
100
- "aria-describedby": "".concat(errorId, " ").concat(descriptionId),
100
+ "aria-describedby": "".concat(error && isTouched ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
101
101
  "aria-invalid": Boolean(error && isTouched),
102
102
  autoComplete: autoCompleteField ? fieldName : undefined,
103
103
  type: revealPassword ? 'text' : inputType,
@@ -72,7 +72,7 @@ var Textarea = function Textarea(props) {
72
72
  onChange(event);
73
73
  }
74
74
  },
75
- "aria-describedby": "".concat(errorId, " ").concat(descriptionId),
75
+ "aria-describedby": "".concat(error && isTouched ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
76
76
  "aria-invalid": Boolean(error && isTouched)
77
77
  })));
78
78
  };
@@ -277,7 +277,8 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
277
277
  isOpen: !isAnswered,
278
278
  disableClosers: true
279
279
  }),
280
- dialogHelpersProps = _useDialogHelpers.dialogHelpersProps;
280
+ dialogHelpersProps = _useDialogHelpers.dialogHelpersProps,
281
+ labelId = _useDialogHelpers.labelId;
281
282
 
282
283
  // Enable only Escape key to close, not click outside
283
284
  useEscape({
@@ -298,7 +299,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
298
299
  var renderChoices = function renderChoices() {
299
300
  return /*#__PURE__*/React.createElement("fieldset", {
300
301
  className: "GoogleConsentCookieBanner__choices",
301
- "aria-labelledby": "cookie-banner-title"
302
+ "aria-labelledby": labelId
302
303
  }, cookieLevels.map(function (choice) {
303
304
  return /*#__PURE__*/React.createElement("div", {
304
305
  className: "GoogleConsentCookieBanner__category",
@@ -333,6 +334,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
333
334
  }, /*#__PURE__*/React.createElement(Container, {
334
335
  fluid: fluid
335
336
  }, /*#__PURE__*/React.createElement("div", _extends({}, dialogHelpersProps, {
337
+ "aria-labelledby": labelId,
336
338
  ref: wrapperElement,
337
339
  className: "GoogleConsentCookieBanner__content ".concat(manualChoiceVisible ? 'GoogleConsentCookieBanner__content--full-height' : '')
338
340
  }), /*#__PURE__*/React.createElement("div", {
@@ -340,7 +342,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
340
342
  }, /*#__PURE__*/React.createElement("div", {
341
343
  className: "col-12 GoogleConsentCookieBanner__content_header"
342
344
  }, title && /*#__PURE__*/React.createElement("h3", {
343
- id: "cookie-banner-title"
345
+ id: labelId
344
346
  }, title), /*#__PURE__*/React.createElement("button", {
345
347
  type: "button",
346
348
  className: "GoogleConsentCookieBanner__close-button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.20.7",
3
+ "version": "2.20.8",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",