@uncinc/uncinc-react-kitchen-sink 2.21.3 → 2.21.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.
@@ -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.21.4",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",