@uncinc/uncinc-react-kitchen-sink 2.21.3 → 2.22.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.
@@ -14,8 +14,9 @@ var DIRECTION_BACKWARDS = -1;
14
14
  var LottieAnimation = /*#__PURE__*/React.forwardRef(function (props, ref) {
15
15
  var id = props.id,
16
16
  className = props.className,
17
- _props$ariaLabel = props.ariaLabel,
18
- ariaLabel = _props$ariaLabel === void 0 ? 'animation' : _props$ariaLabel,
17
+ ariaLabel = props.ariaLabel,
18
+ _props$ariaHidden = props.ariaHidden,
19
+ ariaHidden = _props$ariaHidden === void 0 ? false : _props$ariaHidden,
19
20
  data = props.data,
20
21
  path = props.path,
21
22
  _props$renderer = props.renderer,
@@ -176,7 +177,8 @@ var LottieAnimation = /*#__PURE__*/React.forwardRef(function (props, ref) {
176
177
  return /*#__PURE__*/React.createElement("div", _extends({
177
178
  className: lottieClasses,
178
179
  id: "lottie--".concat(lottieId),
179
- "aria-label": ariaLabel
180
+ "aria-label": ariaLabel,
181
+ "aria-hidden": ariaHidden
180
182
  // Only make the Lottie interactable if we provide the necessary props,
181
183
  // otherwise it's just a plain div.
182
184
  }, pauseOnClick || activateOnHover ? {
@@ -186,6 +188,8 @@ var LottieAnimation = /*#__PURE__*/React.forwardRef(function (props, ref) {
186
188
  onMouseLeave: onMouseLeave,
187
189
  onClick: onClick,
188
190
  onKeyDown: onKeyDown
189
- } : {}));
191
+ } : {
192
+ role: 'img'
193
+ }));
190
194
  });
191
195
  export default LottieAnimation;
@@ -11,7 +11,8 @@ export interface LottieConfig<T extends RendererType = 'svg'> extends Omit<Anima
11
11
  export interface LottieProps extends Omit<Partial<LottieConfig>, 'animationData' | 'autoplay'> {
12
12
  id?: string;
13
13
  className?: string;
14
- ariaLabel?: string;
14
+ ariaLabel: string;
15
+ ariaHidden?: boolean;
15
16
  data?: unknown;
16
17
  autoPlay?: AnimationConfig['autoplay'];
17
18
  delay?: number;
@@ -1,5 +1,5 @@
1
1
  export default Share;
2
- declare function Share({ title, pageTitle, url, items, onClick, customItems, withLabels, headingLevel }: {
2
+ declare function Share({ title, pageTitle, url, items, onClick, customItems, withLabels, headingLevel, isDropdown }: {
3
3
  title: any;
4
4
  pageTitle: any;
5
5
  url: any;
@@ -8,6 +8,7 @@ declare function Share({ title, pageTitle, url, items, onClick, customItems, wit
8
8
  customItems: any;
9
9
  withLabels: any;
10
10
  headingLevel?: number | undefined;
11
+ isDropdown?: boolean | undefined;
11
12
  }): React.JSX.Element;
12
13
  declare namespace Share {
13
14
  namespace defaultProps {
@@ -18,6 +19,7 @@ declare namespace Share {
18
19
  function onClick(): void;
19
20
  let withLabels: boolean;
20
21
  let customItems: {};
22
+ let isDropdown: boolean;
21
23
  }
22
24
  }
23
25
  import React from 'react';
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import React from 'react';
2
3
  import { EmailShareButton, FacebookShareButton, LinkedinShareButton, TwitterShareButton, WhatsappShareButton, PinterestShareButton, RedditShareButton, TelegramShareButton } from 'react-share';
3
4
  import './style.scss';
@@ -44,7 +45,9 @@ var Share = function Share(_ref2) {
44
45
  customItems = _ref2.customItems,
45
46
  withLabels = _ref2.withLabels,
46
47
  _ref2$headingLevel = _ref2.headingLevel,
47
- headingLevel = _ref2$headingLevel === void 0 ? 3 : _ref2$headingLevel;
48
+ headingLevel = _ref2$headingLevel === void 0 ? 3 : _ref2$headingLevel,
49
+ _ref2$isDropdown = _ref2.isDropdown,
50
+ isDropdown = _ref2$isDropdown === void 0 ? true : _ref2$isDropdown;
48
51
  var HeadingTag = "h".concat(headingLevel);
49
52
  var windowUrl = url || window.location.href;
50
53
  var buttons = items.map(function (item) {
@@ -65,10 +68,12 @@ var Share = function Share(_ref2) {
65
68
  className: "Share"
66
69
  }, /*#__PURE__*/React.createElement("div", {
67
70
  className: "Share__wrapper"
68
- }, /*#__PURE__*/React.createElement(HeadingTag, {
69
- className: "Share__title",
70
- tabIndex: "0"
71
- }, title), /*#__PURE__*/React.createElement("div", {
71
+ }, /*#__PURE__*/React.createElement(HeadingTag, _extends({
72
+ className: "Share__title"
73
+ }, isDropdown && {
74
+ tabIndex: '0',
75
+ role: 'button'
76
+ }), title), /*#__PURE__*/React.createElement("div", {
72
77
  className: "Share__buttons"
73
78
  }, buttons)));
74
79
  };
@@ -79,6 +84,7 @@ Share.defaultProps = {
79
84
  items: ['mail', 'facebook', 'linkedin', 'twitter', 'whatsapp'],
80
85
  onClick: function onClick() {},
81
86
  withLabels: false,
82
- customItems: {}
87
+ customItems: {},
88
+ isDropdown: true
83
89
  };
84
90
  export default Share;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.21.3",
3
+ "version": "2.22.0",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",