@uncinc/uncinc-react-kitchen-sink 2.20.14 → 2.21.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.
@@ -1,6 +1,3 @@
1
1
  import React from 'react';
2
- export interface AccessibleLinkDescriptionProps {
3
- id: string;
4
- }
5
- declare const AccessibleLinkDescription: React.FC<AccessibleLinkDescriptionProps>;
2
+ declare const AccessibleLinkDescription: React.FC;
6
3
  export default AccessibleLinkDescription;
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- var AccessibleLinkDescription = function AccessibleLinkDescription(_ref) {
4
- var id = _ref.id;
3
+ var AccessibleLinkDescription = function AccessibleLinkDescription() {
5
4
  var _useTranslation = useTranslation(),
6
5
  t = _useTranslation.t;
7
6
  return /*#__PURE__*/React.createElement("span", {
8
- className: "visually-hidden",
9
- id: id
7
+ className: "visually-hidden"
10
8
  }, t(['atoms.accessible_link_description', 'Opens in a new tab']));
11
9
  };
12
10
  export default AccessibleLinkDescription;
@@ -6,7 +6,6 @@ import React from 'react';
6
6
  import { Link } from 'react-router-dom';
7
7
  import PropTypes from 'prop-types';
8
8
  import classNames from 'classnames';
9
- import { v4 as uuidv4 } from 'uuid';
10
9
  import gtm from '../../helpers/gtm';
11
10
  import { isExternalLink, isHashLink } from '../../helpers/link';
12
11
  import withMapping from '../../Context/withMapping';
@@ -26,7 +25,6 @@ export var Button = function Button(_ref) {
26
25
  target = _ref.target,
27
26
  forwardRef = _ref.forwardRef,
28
27
  props = _objectWithoutProperties(_ref, _excluded);
29
- var accessibleLinkDescriptionId = "accessible-link-description-".concat(uuidv4());
30
28
  var classes = classNames('Button', className, {
31
29
  'Button--primary': primary,
32
30
  'Button--inverted': inverted,
@@ -57,44 +55,35 @@ export var Button = function Button(_ref) {
57
55
  );
58
56
  }
59
57
  if (isExternalLink(href)) {
60
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", _extends({
58
+ return /*#__PURE__*/React.createElement("a", _extends({
61
59
  className: classes,
62
60
  href: href,
63
61
  target: "_blank",
64
62
  rel: "noreferrer noopener"
65
63
  }, props, {
66
64
  ref: forwardRef,
67
- onClick: onClick,
68
- "aria-describedby": accessibleLinkDescriptionId
69
- }), children), /*#__PURE__*/React.createElement(AccessibleLinkDescription, {
70
- id: accessibleLinkDescriptionId
71
- }));
65
+ onClick: onClick
66
+ }), children, /*#__PURE__*/React.createElement(AccessibleLinkDescription, null));
72
67
  }
73
68
  if (isHashLink(href)) {
74
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", _extends({
69
+ return /*#__PURE__*/React.createElement("a", _extends({
75
70
  className: classes,
76
71
  href: href,
77
72
  target: target,
78
73
  rel: "noreferrer noopener"
79
74
  }, props, {
80
75
  ref: forwardRef,
81
- onClick: onClick,
82
- "aria-describedby": target === '_blank' ? accessibleLinkDescriptionId : undefined
83
- }), children), target === '_blank' && /*#__PURE__*/React.createElement(AccessibleLinkDescription, {
84
- id: accessibleLinkDescriptionId
85
- }));
76
+ onClick: onClick
77
+ }), children, target === '_blank' && /*#__PURE__*/React.createElement(AccessibleLinkDescription, null));
86
78
  }
87
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Link, _extends({
79
+ return /*#__PURE__*/React.createElement(Link, _extends({
88
80
  to: href,
89
81
  className: classes,
90
82
  target: target
91
83
  }, props, {
92
84
  ref: forwardRef,
93
- onClick: onClick,
94
- "aria-describedby": target === '_blank' ? accessibleLinkDescriptionId : undefined
95
- }), children), target === '_blank' && /*#__PURE__*/React.createElement(AccessibleLinkDescription, {
96
- id: accessibleLinkDescriptionId
97
- }));
85
+ onClick: onClick
86
+ }), children, target === '_blank' && /*#__PURE__*/React.createElement(AccessibleLinkDescription, null));
98
87
  };
99
88
  Button.defaultProps = {
100
89
  primary: true,
@@ -48,10 +48,11 @@ var GenericFormElement = function GenericFormElement(props) {
48
48
  property: "schema:text",
49
49
  html: description,
50
50
  className: "FormElement__description ".concat(className, "__description")
51
- }), error && touched ? /*#__PURE__*/React.createElement("div", {
51
+ }), /*#__PURE__*/React.createElement("div", {
52
52
  "aria-live": "assertive",
53
- id: errorId,
53
+ id: errorId
54
+ }, error && touched ? /*#__PURE__*/React.createElement("div", {
54
55
  className: "FormElement__error ".concat(className, "__error")
55
- }, error) : null);
56
+ }, error) : null));
56
57
  };
57
58
  export default withMapping(GenericFormElement);
@@ -104,6 +104,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
104
104
  defaultValues = _props$defaultValues === void 0 ? categoryDefaultValues : _props$defaultValues,
105
105
  _props$manualHeader = props.manualHeader,
106
106
  manualHeader = _props$manualHeader === void 0 ? '' : _props$manualHeader,
107
+ manualBody = props.manualBody,
107
108
  _props$manualButtonCl = props.manualButtonClassname,
108
109
  manualButtonClassname = _props$manualButtonCl === void 0 ? 'Button' : _props$manualButtonCl,
109
110
  _props$necessaryButto = props.necessaryButtonInverted,
@@ -297,10 +298,13 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
297
298
  // This function renders the different options of checkboxes,
298
299
  // allowing us to add more checkboxes eventually.
299
300
  var renderChoices = function renderChoices() {
300
- return /*#__PURE__*/React.createElement("fieldset", {
301
- className: "GoogleConsentCookieBanner__choices",
302
- "aria-labelledby": labelId
303
- }, cookieLevels.map(function (choice) {
301
+ return /*#__PURE__*/React.createElement(React.Fragment, null, manualBody && /*#__PURE__*/React.createElement("p", {
302
+ className: "GoogleConsentCookieBanner__manual-body"
303
+ }, manualBody), /*#__PURE__*/React.createElement("fieldset", {
304
+ className: "GoogleConsentCookieBanner__choices"
305
+ }, manualHeader && /*#__PURE__*/React.createElement("legend", {
306
+ className: "manualHeader"
307
+ }, manualHeader), cookieLevels.map(function (choice) {
304
308
  return /*#__PURE__*/React.createElement("div", {
305
309
  className: "GoogleConsentCookieBanner__category",
306
310
  key: choice.value
@@ -325,7 +329,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
325
329
  }, /*#__PURE__*/React.createElement("div", {
326
330
  className: "GoogleConsentCookieBanner__category__description"
327
331
  }, choice.contents()))));
328
- }));
332
+ })));
329
333
  };
330
334
  return /*#__PURE__*/React.createElement("div", {
331
335
  className: classes,
@@ -377,9 +381,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
377
381
  className: "GoogleConsentCookieBanner__content__message"
378
382
  }, /*#__PURE__*/React.createElement("div", {
379
383
  className: "GoogleConsentCookieBanner__checkboxes-container"
380
- }, manualHeader && /*#__PURE__*/React.createElement("div", {
381
- className: "manualHeader"
382
- }, manualHeader), renderChoices())), /*#__PURE__*/React.createElement("div", {
384
+ }, renderChoices())), /*#__PURE__*/React.createElement("div", {
383
385
  className: "GoogleConsentCookieBanner__content__buttons"
384
386
  }, /*#__PURE__*/React.createElement(Button, {
385
387
  className: "Button--cta",
@@ -58,6 +58,7 @@ export interface CookieCompliancePopupProps {
58
58
  cookieContentsShowLess?: string;
59
59
  manualText?: string;
60
60
  manualHeader?: string;
61
+ manualBody?: string;
61
62
  onAgree?: Function;
62
63
  showAcceptOnlyNeeded?: boolean;
63
64
  showAcceptOnlyNeededSelections?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.20.14",
3
+ "version": "2.21.1",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",