@uncinc/uncinc-react-kitchen-sink 2.20.13 → 2.21.0

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,
@@ -298,9 +298,10 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
298
298
  // allowing us to add more checkboxes eventually.
299
299
  var renderChoices = function renderChoices() {
300
300
  return /*#__PURE__*/React.createElement("fieldset", {
301
- className: "GoogleConsentCookieBanner__choices",
302
- "aria-labelledby": labelId
303
- }, cookieLevels.map(function (choice) {
301
+ className: "GoogleConsentCookieBanner__choices"
302
+ }, manualHeader && /*#__PURE__*/React.createElement("legend", {
303
+ className: "manualHeader"
304
+ }, manualHeader), cookieLevels.map(function (choice) {
304
305
  return /*#__PURE__*/React.createElement("div", {
305
306
  className: "GoogleConsentCookieBanner__category",
306
307
  key: choice.value
@@ -377,9 +378,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
377
378
  className: "GoogleConsentCookieBanner__content__message"
378
379
  }, /*#__PURE__*/React.createElement("div", {
379
380
  className: "GoogleConsentCookieBanner__checkboxes-container"
380
- }, manualHeader && /*#__PURE__*/React.createElement("div", {
381
- className: "manualHeader"
382
- }, manualHeader), renderChoices())), /*#__PURE__*/React.createElement("div", {
381
+ }, renderChoices())), /*#__PURE__*/React.createElement("div", {
383
382
  className: "GoogleConsentCookieBanner__content__buttons"
384
383
  }, /*#__PURE__*/React.createElement(Button, {
385
384
  className: "Button--cta",
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import './style.scss';
3
3
  declare interface ControlPanelProps {
4
+ downloadName?: string;
4
5
  scale: number;
5
6
  setScale: (scale: number) => void;
6
7
  numPages: number;
@@ -64,7 +64,9 @@ var ControlPanel = function ControlPanel(props) {
64
64
  downloadButton = _props$downloadButton === void 0 ? defaultButtons.download : _props$downloadButton,
65
65
  _props$printButton = props.printButton,
66
66
  printButton = _props$printButton === void 0 ? defaultButtons.print : _props$printButton,
67
- dualPage = props.dualPage;
67
+ dualPage = props.dualPage,
68
+ _props$downloadName = props.downloadName,
69
+ downloadName = _props$downloadName === void 0 ? 'download' : _props$downloadName;
68
70
  var isFirstPage = pageNumber === 1;
69
71
  var isLastPage = pageNumber === numPages;
70
72
  var firstPageClass = isFirstPage ? 'disabled' : 'clickable';
@@ -195,7 +197,7 @@ var ControlPanel = function ControlPanel(props) {
195
197
  className: "ControlPanel__pageControl"
196
198
  }, /*#__PURE__*/React.createElement("a", {
197
199
  href: file,
198
- download: "download"
200
+ download: downloadName
199
201
  }, /*#__PURE__*/React.createElement("button", {
200
202
  type: "button",
201
203
  id: "PDFReader__downloadButton"
@@ -1,5 +1,6 @@
1
1
  import React, { JSXElementConstructor } from 'react';
2
2
  export declare interface PDFReaderProps {
3
+ downloadName?: string;
3
4
  url: string;
4
5
  goToFirstPageButton?: React.ReactNode;
5
6
  goToNextPageButton?: React.ReactNode;
@@ -30,7 +30,8 @@ var PDFReader = function PDFReader(_ref) {
30
30
  height = _ref.height,
31
31
  dualPageWidthThreshold = _ref.dualPageWidthThreshold,
32
32
  _ref$defaultScale = _ref.defaultScale,
33
- defaultScale = _ref$defaultScale === void 0 ? 1.0 : _ref$defaultScale;
33
+ defaultScale = _ref$defaultScale === void 0 ? 1.0 : _ref$defaultScale,
34
+ downloadName = _ref.downloadName;
34
35
  var _useState = useState(defaultScale),
35
36
  _useState2 = _slicedToArray(_useState, 2),
36
37
  scale = _useState2[0],
@@ -89,7 +90,8 @@ var PDFReader = function PDFReader(_ref) {
89
90
  zoomOutButton: zoomOutButton,
90
91
  downloadButton: downloadButton,
91
92
  printButton: printButton,
92
- dualPage: showDualPage
93
+ dualPage: showDualPage,
94
+ downloadName: downloadName
93
95
  }), /*#__PURE__*/React.createElement(Document, {
94
96
  file: url,
95
97
  onLoadSuccess: onDocumentLoadSuccess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.20.13",
3
+ "version": "2.21.0",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",