@canonical/react-components 0.47.1 → 0.47.2

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.
Files changed (152) hide show
  1. package/dist/__mocks__/nanoid.js +3 -3
  2. package/dist/components/Accordion/Accordion.js +28 -41
  3. package/dist/components/Accordion/AccordionSection/AccordionSection.js +18 -18
  4. package/dist/components/Accordion/AccordionSection/index.js +1 -1
  5. package/dist/components/Accordion/index.js +1 -1
  6. package/dist/components/ActionButton/ActionButton.js +34 -66
  7. package/dist/components/ActionButton/index.js +1 -1
  8. package/dist/components/ArticlePagination/ArticlePagination.js +10 -12
  9. package/dist/components/ArticlePagination/index.js +1 -1
  10. package/dist/components/Badge/Badge.js +24 -29
  11. package/dist/components/Badge/index.js +1 -1
  12. package/dist/components/Button/Button.js +21 -26
  13. package/dist/components/Button/index.js +4 -5
  14. package/dist/components/Card/Card.js +12 -14
  15. package/dist/components/Card/index.js +1 -1
  16. package/dist/components/CheckboxInput/CheckableInput/CheckableInput.js +15 -19
  17. package/dist/components/CheckboxInput/CheckableInput/index.js +1 -1
  18. package/dist/components/CheckboxInput/CheckboxInput.js +7 -10
  19. package/dist/components/CheckboxInput/index.js +1 -1
  20. package/dist/components/Chip/Chip.js +23 -33
  21. package/dist/components/Chip/index.js +1 -1
  22. package/dist/components/Code/Code.js +14 -17
  23. package/dist/components/Code/index.js +1 -1
  24. package/dist/components/CodeSnippet/CodeSnippet.js +9 -14
  25. package/dist/components/CodeSnippet/CodeSnippetBlock.js +24 -29
  26. package/dist/components/CodeSnippet/CodeSnippetDropdown.js +11 -11
  27. package/dist/components/CodeSnippet/index.js +2 -2
  28. package/dist/components/Col/Col.js +24 -26
  29. package/dist/components/Col/index.js +4 -5
  30. package/dist/components/ConfirmationButton/ConfirmationButton.js +18 -21
  31. package/dist/components/ConfirmationButton/index.js +1 -1
  32. package/dist/components/ConfirmationModal/ConfirmationModal.js +11 -15
  33. package/dist/components/ConfirmationModal/index.js +1 -1
  34. package/dist/components/ContextualMenu/ContextualMenu.js +89 -107
  35. package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +4 -4
  36. package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +97 -107
  37. package/dist/components/ContextualMenu/ContextualMenuDropdown/index.js +1 -1
  38. package/dist/components/ContextualMenu/index.js +1 -1
  39. package/dist/components/EmptyState/EmptyState.js +9 -11
  40. package/dist/components/EmptyState/index.js +1 -1
  41. package/dist/components/Field/Field.js +66 -65
  42. package/dist/components/Field/index.js +1 -1
  43. package/dist/components/Form/Form.js +9 -11
  44. package/dist/components/Form/index.js +1 -1
  45. package/dist/components/Icon/Icon.js +9 -12
  46. package/dist/components/Icon/index.js +4 -5
  47. package/dist/components/Input/Input.js +38 -45
  48. package/dist/components/Input/index.js +1 -1
  49. package/dist/components/Label/Label.js +9 -11
  50. package/dist/components/Label/index.js +1 -1
  51. package/dist/components/Link/Link.js +12 -18
  52. package/dist/components/Link/index.js +1 -1
  53. package/dist/components/List/List.js +50 -54
  54. package/dist/components/List/index.js +1 -1
  55. package/dist/components/Loader/Loader.js +2 -3
  56. package/dist/components/Loader/index.js +1 -1
  57. package/dist/components/MainTable/MainTable.js +87 -104
  58. package/dist/components/MainTable/index.js +1 -1
  59. package/dist/components/Modal/Modal.js +37 -38
  60. package/dist/components/Modal/index.js +1 -1
  61. package/dist/components/ModularTable/ModularTable.js +63 -77
  62. package/dist/components/ModularTable/index.js +1 -1
  63. package/dist/components/Navigation/Navigation.js +63 -97
  64. package/dist/components/Navigation/NavigationLink/NavigationLink.js +32 -35
  65. package/dist/components/Navigation/NavigationLink/index.js +1 -1
  66. package/dist/components/Navigation/NavigationMenu/NavigationMenu.js +26 -45
  67. package/dist/components/Navigation/NavigationMenu/index.js +1 -1
  68. package/dist/components/Navigation/index.js +1 -1
  69. package/dist/components/Notification/Notification.js +49 -59
  70. package/dist/components/Notification/index.js +4 -5
  71. package/dist/components/NotificationProvider/NotificationProvider.js +47 -68
  72. package/dist/components/NotificationProvider/index.js +7 -7
  73. package/dist/components/NotificationProvider/messageBuilder.js +9 -9
  74. package/dist/components/NotificationProvider/types.d.ts +1 -0
  75. package/dist/components/Pagination/Pagination.js +50 -69
  76. package/dist/components/Pagination/PaginationButton/PaginationButton.js +11 -12
  77. package/dist/components/Pagination/PaginationButton/index.js +1 -1
  78. package/dist/components/Pagination/PaginationItem/PaginationItem.js +7 -7
  79. package/dist/components/Pagination/PaginationItem/index.js +1 -1
  80. package/dist/components/Pagination/index.js +1 -1
  81. package/dist/components/PasswordToggle/PasswordToggle.d.ts +1 -1
  82. package/dist/components/PasswordToggle/PasswordToggle.js +25 -40
  83. package/dist/components/PasswordToggle/index.js +1 -1
  84. package/dist/components/RadioInput/RadioInput.js +6 -8
  85. package/dist/components/RadioInput/index.js +1 -1
  86. package/dist/components/Row/Row.js +7 -9
  87. package/dist/components/Row/index.js +1 -1
  88. package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +38 -51
  89. package/dist/components/SearchAndFilter/FilterPanelSection/index.js +1 -1
  90. package/dist/components/SearchAndFilter/SearchAndFilter.js +75 -135
  91. package/dist/components/SearchAndFilter/index.js +1 -1
  92. package/dist/components/SearchAndFilter/utils.js +4 -8
  93. package/dist/components/SearchBox/SearchBox.js +25 -33
  94. package/dist/components/SearchBox/index.js +1 -1
  95. package/dist/components/Select/Select.js +38 -44
  96. package/dist/components/Select/index.js +1 -1
  97. package/dist/components/Slider/Slider.js +27 -35
  98. package/dist/components/Slider/index.js +1 -1
  99. package/dist/components/Spinner/Spinner.js +10 -15
  100. package/dist/components/Spinner/index.js +1 -1
  101. package/dist/components/StatusLabel/StatusLabel.js +11 -13
  102. package/dist/components/StatusLabel/index.js +4 -5
  103. package/dist/components/Strip/Strip.js +27 -34
  104. package/dist/components/Strip/index.js +1 -1
  105. package/dist/components/SummaryButton/SummaryButton.js +9 -8
  106. package/dist/components/SummaryButton/index.js +1 -1
  107. package/dist/components/Switch/Switch.js +7 -10
  108. package/dist/components/Switch/index.js +1 -1
  109. package/dist/components/Table/Table.js +9 -13
  110. package/dist/components/Table/index.js +1 -1
  111. package/dist/components/TableCell/TableCell.js +11 -17
  112. package/dist/components/TableCell/index.js +1 -1
  113. package/dist/components/TableHeader/TableHeader.js +7 -9
  114. package/dist/components/TableHeader/index.js +1 -1
  115. package/dist/components/TablePagination/TablePagination.d.ts +37 -0
  116. package/dist/components/TablePagination/TablePagination.js +125 -0
  117. package/dist/components/TablePagination/TablePagination.scss +40 -0
  118. package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +16 -0
  119. package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.js +66 -0
  120. package/dist/components/TablePagination/TablePaginationControls/index.d.ts +2 -0
  121. package/dist/components/TablePagination/TablePaginationControls/index.js +13 -0
  122. package/dist/components/TablePagination/index.d.ts +2 -0
  123. package/dist/components/TablePagination/index.js +13 -0
  124. package/dist/components/TableRow/TableRow.js +6 -8
  125. package/dist/components/TableRow/index.js +1 -1
  126. package/dist/components/Tabs/Tabs.js +17 -17
  127. package/dist/components/Tabs/index.js +1 -1
  128. package/dist/components/Textarea/Textarea.js +51 -45
  129. package/dist/components/Textarea/index.js +1 -1
  130. package/dist/components/Tooltip/Tooltip.d.ts +5 -1
  131. package/dist/components/Tooltip/Tooltip.js +76 -79
  132. package/dist/components/Tooltip/index.js +4 -5
  133. package/dist/enums.js +2 -3
  134. package/dist/hooks/index.d.ts +1 -1
  135. package/dist/hooks/index.js +16 -10
  136. package/dist/hooks/useId.js +1 -3
  137. package/dist/hooks/useListener.d.ts +2 -1
  138. package/dist/hooks/useListener.js +25 -24
  139. package/dist/hooks/useOnClickOutside.d.ts +12 -0
  140. package/dist/hooks/useOnClickOutside.js +45 -0
  141. package/dist/hooks/useOnEscapePressed.d.ts +3 -1
  142. package/dist/hooks/useOnEscapePressed.js +13 -6
  143. package/dist/hooks/usePagination.js +17 -29
  144. package/dist/hooks/usePrevious.js +4 -4
  145. package/dist/hooks/useThrottle.js +16 -25
  146. package/dist/hooks/useWindowFitment.js +30 -28
  147. package/dist/index.d.ts +3 -1
  148. package/dist/index.js +86 -74
  149. package/dist/utils.js +6 -13
  150. package/package.json +42 -35
  151. package/dist/hooks/useClickOutside.d.ts +0 -6
  152. package/dist/hooks/useClickOutside.js +0 -32
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.nanoid = void 0;
7
- var id = 0;
8
- beforeEach(function () {
7
+ let id = 0;
8
+ beforeEach(() => {
9
9
  id = 0;
10
10
  });
11
- var nanoid = function nanoid() {
11
+ const nanoid = () => {
12
12
  id++;
13
13
  return "mock-nanoid-".concat(id);
14
14
  };
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -8,46 +7,35 @@ exports.default = void 0;
8
7
  var _classnames = _interopRequireDefault(require("classnames"));
9
8
  var _react = _interopRequireWildcard(require("react"));
10
9
  var _AccordionSection = _interopRequireDefault(require("./AccordionSection"));
11
- var _excluded = ["key"],
12
- _excluded2 = ["className", "expanded", "externallyControlled", "onExpandedChange", "sections", "titleElement"];
13
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
13
  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); }
23
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
24
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
25
- var generateSections = function generateSections(sections, setExpanded, expanded, titleElement) {
26
- return sections.map(function (_ref, i) {
27
- var key = _ref.key,
28
- props = _objectWithoutProperties(_ref, _excluded);
29
- return /*#__PURE__*/_react.default.createElement(_AccordionSection.default, _extends({
30
- expanded: expanded,
31
- key: key || i,
32
- sectionKey: key === null || key === void 0 ? void 0 : key.toString(),
33
- setExpanded: setExpanded,
34
- titleElement: titleElement
35
- }, props));
36
- });
37
- };
38
- var Accordion = function Accordion(_ref2) {
39
- var className = _ref2.className,
40
- expanded = _ref2.expanded,
41
- externallyControlled = _ref2.externallyControlled,
42
- onExpandedChange = _ref2.onExpandedChange,
43
- sections = _ref2.sections,
44
- titleElement = _ref2.titleElement,
45
- asideProps = _objectWithoutProperties(_ref2, _excluded2);
46
- var _useState = (0, _react.useState)(expanded),
47
- _useState2 = _slicedToArray(_useState, 2),
48
- expandedSection = _useState2[0],
49
- setExpandedSection = _useState2[1];
50
- var setExpanded = function setExpanded(id, title) {
14
+ const generateSections = (sections, setExpanded, expanded, titleElement) => sections.map((_ref, i) => {
15
+ let {
16
+ key,
17
+ ...props
18
+ } = _ref;
19
+ return /*#__PURE__*/_react.default.createElement(_AccordionSection.default, _extends({
20
+ expanded: expanded,
21
+ key: key || i,
22
+ sectionKey: key === null || key === void 0 ? void 0 : key.toString(),
23
+ setExpanded: setExpanded,
24
+ titleElement: titleElement
25
+ }, props));
26
+ });
27
+ const Accordion = _ref2 => {
28
+ let {
29
+ className,
30
+ expanded,
31
+ externallyControlled,
32
+ onExpandedChange,
33
+ sections,
34
+ titleElement,
35
+ ...asideProps
36
+ } = _ref2;
37
+ const [expandedSection, setExpandedSection] = (0, _react.useState)(expanded);
38
+ const setExpanded = (id, title) => {
51
39
  setExpandedSection(id);
52
40
  onExpandedChange && onExpandedChange(id, title);
53
41
  };
@@ -60,5 +48,4 @@ var Accordion = function Accordion(_ref2) {
60
48
  className: "p-accordion__list"
61
49
  }, generateSections(sections, setExpanded, externallyControlled ? expanded : expandedSection, titleElement)));
62
50
  };
63
- var _default = Accordion;
64
- exports.default = _default;
51
+ var _default = exports.default = Accordion;
@@ -7,21 +7,22 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _useId = require("../../../hooks/useId");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- var AccordionSection = function AccordionSection(_ref) {
11
- var content = _ref.content,
12
- expanded = _ref.expanded,
13
- onTitleClick = _ref.onTitleClick,
14
- sectionKey = _ref.sectionKey,
15
- setExpanded = _ref.setExpanded,
16
- title = _ref.title,
17
- titleElement = _ref.titleElement,
18
- _ref$headingLevel = _ref.headingLevel,
19
- headingLevel = _ref$headingLevel === void 0 ? 3 : _ref$headingLevel;
20
- var sectionId = (0, _useId.useId)();
21
- var tabId = (0, _useId.useId)();
22
- var key = sectionKey || sectionId;
23
- var isExpanded = expanded === key;
24
- var Title = titleElement || "div";
10
+ const AccordionSection = _ref => {
11
+ let {
12
+ content,
13
+ expanded,
14
+ onTitleClick,
15
+ sectionKey,
16
+ setExpanded,
17
+ title,
18
+ titleElement,
19
+ headingLevel = 3
20
+ } = _ref;
21
+ const sectionId = (0, _useId.useId)();
22
+ const tabId = (0, _useId.useId)();
23
+ const key = sectionKey || sectionId;
24
+ const isExpanded = expanded === key;
25
+ const Title = titleElement || "div";
25
26
  return /*#__PURE__*/_react.default.createElement("li", {
26
27
  className: "p-accordion__group"
27
28
  }, /*#__PURE__*/_react.default.createElement(Title, {
@@ -33,7 +34,7 @@ var AccordionSection = function AccordionSection(_ref) {
33
34
  "aria-expanded": isExpanded ? "true" : "false",
34
35
  className: "p-accordion__tab",
35
36
  id: tabId,
36
- onClick: function onClick() {
37
+ onClick: () => {
37
38
  if (isExpanded) {
38
39
  setExpanded(null, null);
39
40
  } else {
@@ -51,5 +52,4 @@ var AccordionSection = function AccordionSection(_ref) {
51
52
  role: "tabpanel"
52
53
  }, content));
53
54
  };
54
- var _default = AccordionSection;
55
- exports.default = _default;
55
+ var _default = exports.default = AccordionSection;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _AccordionSection.default;
10
10
  }
11
11
  });
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _Accordion.default;
10
10
  }
11
11
  });
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -8,63 +7,37 @@ exports.default = exports.SUCCESS_DURATION = exports.Label = exports.LOADER_MIN_
8
7
  var _classnames = _interopRequireDefault(require("classnames"));
9
8
  var _react = _interopRequireWildcard(require("react"));
10
9
  var _Icon = _interopRequireDefault(require("../Icon"));
11
- var _excluded = ["appearance", "children", "className", "disabled", "inline", "loading", "success"];
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
  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); }
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
- var LOADER_MIN_DURATION = 400; // minimium duration (ms) loader displays
25
- exports.LOADER_MIN_DURATION = LOADER_MIN_DURATION;
26
- var SUCCESS_DURATION = 2000; // duration (ms) success tick is displayed
27
- exports.SUCCESS_DURATION = SUCCESS_DURATION;
28
- var Label = /*#__PURE__*/function (Label) {
14
+ const LOADER_MIN_DURATION = exports.LOADER_MIN_DURATION = 400; // minimium duration (ms) loader displays
15
+ const SUCCESS_DURATION = exports.SUCCESS_DURATION = 2000; // duration (ms) success tick is displayed
16
+ let Label = exports.Label = /*#__PURE__*/function (Label) {
29
17
  Label["WAITING"] = "Waiting for action to complete";
30
18
  Label["SUCCESS"] = "Action completed";
31
19
  return Label;
32
20
  }({});
33
- exports.Label = Label;
34
- var ActionButton = function ActionButton(_ref) {
35
- var appearance = _ref.appearance,
36
- children = _ref.children,
37
- className = _ref.className,
38
- _ref$disabled = _ref.disabled,
39
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
40
- _ref$inline = _ref.inline,
41
- inline = _ref$inline === void 0 ? false : _ref$inline,
42
- _ref$loading = _ref.loading,
43
- loading = _ref$loading === void 0 ? false : _ref$loading,
44
- _ref$success = _ref.success,
45
- success = _ref$success === void 0 ? false : _ref$success,
46
- buttonProps = _objectWithoutProperties(_ref, _excluded);
47
- var _useState = (0, _react.useState)(),
48
- _useState2 = _slicedToArray(_useState, 2),
49
- height = _useState2[0],
50
- setHeight = _useState2[1];
51
- var _useState3 = (0, _react.useState)(),
52
- _useState4 = _slicedToArray(_useState3, 2),
53
- width = _useState4[0],
54
- setWidth = _useState4[1];
55
- var _useState5 = (0, _react.useState)(false),
56
- _useState6 = _slicedToArray(_useState5, 2),
57
- showLoader = _useState6[0],
58
- setShowLoader = _useState6[1];
59
- var _useState7 = (0, _react.useState)(false),
60
- _useState8 = _slicedToArray(_useState7, 2),
61
- showSuccess = _useState8[0],
62
- setShowSuccess = _useState8[1];
63
- var ref = (0, _react.useRef)(null);
21
+ const ActionButton = _ref => {
22
+ let {
23
+ appearance,
24
+ children,
25
+ className,
26
+ disabled = false,
27
+ inline = false,
28
+ loading = false,
29
+ success = false,
30
+ ...buttonProps
31
+ } = _ref;
32
+ const [height, setHeight] = (0, _react.useState)();
33
+ const [width, setWidth] = (0, _react.useState)();
34
+ const [showLoader, setShowLoader] = (0, _react.useState)(false);
35
+ const [showSuccess, setShowSuccess] = (0, _react.useState)(false);
36
+ const ref = (0, _react.useRef)(null);
64
37
 
65
38
  // Set up loader timer
66
- (0, _react.useEffect)(function () {
67
- var loaderTimeout;
39
+ (0, _react.useEffect)(() => {
40
+ let loaderTimeout;
68
41
  if (loading) {
69
42
  // Explicitly set button dimensions
70
43
  if (ref.current && !!ref.current.getBoundingClientRect()) {
@@ -74,7 +47,7 @@ var ActionButton = function ActionButton(_ref) {
74
47
  setShowLoader(true);
75
48
  }
76
49
  if (!loading && showLoader) {
77
- loaderTimeout = window.setTimeout(function () {
50
+ loaderTimeout = window.setTimeout(() => {
78
51
  setShowLoader(false);
79
52
  if (success) {
80
53
  setShowSuccess(true);
@@ -85,33 +58,29 @@ var ActionButton = function ActionButton(_ref) {
85
58
  setHeight(null);
86
59
  setWidth(null);
87
60
  }
88
- return function () {
89
- return window.clearTimeout(loaderTimeout);
90
- };
61
+ return () => window.clearTimeout(loaderTimeout);
91
62
  }, [loading, showLoader, success]);
92
63
 
93
64
  // Set up success timer
94
- (0, _react.useEffect)(function () {
95
- var successTimeout;
65
+ (0, _react.useEffect)(() => {
66
+ let successTimeout;
96
67
  if (showSuccess) {
97
- successTimeout = window.setTimeout(function () {
68
+ successTimeout = window.setTimeout(() => {
98
69
  setHeight(null);
99
70
  setWidth(null);
100
71
  setShowSuccess(false);
101
72
  }, SUCCESS_DURATION);
102
73
  }
103
- return function () {
104
- return window.clearTimeout(successTimeout);
105
- };
74
+ return () => window.clearTimeout(successTimeout);
106
75
  }, [showSuccess]);
107
- var buttonClasses = (0, _classnames.default)(className, "p-action-button", appearance ? "p-button--".concat(appearance) : "p-button", {
76
+ const buttonClasses = (0, _classnames.default)(className, "p-action-button", appearance ? "p-button--".concat(appearance) : "p-button", {
108
77
  "is-processing": showLoader || showSuccess,
109
78
  "is-disabled": disabled,
110
79
  "is-inline": inline
111
80
  });
112
- var showIcon = showLoader || showSuccess;
113
- var icon = showLoader && "spinner" || showSuccess && "success" || null;
114
- var iconLight = appearance === "positive" || appearance === "negative";
81
+ const showIcon = showLoader || showSuccess;
82
+ const icon = showLoader && "spinner" || showSuccess && "success" || null;
83
+ const iconLight = appearance === "positive" || appearance === "negative";
115
84
 
116
85
  // This component uses the base button element instead of the Button component
117
86
  // as the button requires a ref and Button would have to be updated to use
@@ -132,5 +101,4 @@ var ActionButton = function ActionButton(_ref) {
132
101
  name: icon
133
102
  }) : children);
134
103
  };
135
- var _default = ActionButton;
136
- exports.default = _default;
104
+ var _default = exports.default = ActionButton;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _ActionButton.default;
10
10
  }
11
11
  });
@@ -6,18 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _classnames = _interopRequireDefault(require("classnames"));
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _excluded = ["className", "nextURL", "nextLabel", "previousURL", "previousLabel"];
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
10
  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); }
12
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- var ArticlePagination = function ArticlePagination(_ref) {
15
- var className = _ref.className,
16
- nextURL = _ref.nextURL,
17
- nextLabel = _ref.nextLabel,
18
- previousURL = _ref.previousURL,
19
- previousLabel = _ref.previousLabel,
20
- props = _objectWithoutProperties(_ref, _excluded);
11
+ const ArticlePagination = _ref => {
12
+ let {
13
+ className,
14
+ nextURL,
15
+ nextLabel,
16
+ previousURL,
17
+ previousLabel,
18
+ ...props
19
+ } = _ref;
21
20
  return /*#__PURE__*/_react.default.createElement("footer", _extends({
22
21
  className: (0, _classnames.default)(className, "p-article-pagination")
23
22
  }, props), previousURL && previousLabel && /*#__PURE__*/_react.default.createElement("a", {
@@ -36,5 +35,4 @@ var ArticlePagination = function ArticlePagination(_ref) {
36
35
  className: "p-article-pagination__title"
37
36
  }, nextLabel)));
38
37
  };
39
- var _default = ArticlePagination;
40
- exports.default = _default;
38
+ var _default = exports.default = ArticlePagination;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _ArticlePagination.default;
10
10
  }
11
11
  });
@@ -1,21 +1,14 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = exports.BadgeType = void 0;
8
7
  var _classnames = _interopRequireDefault(require("classnames"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
- var _excluded = ["value", "badgeType", "className", "isNegative"];
11
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
10
  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); }
13
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
- var BadgeType = {
11
+ const BadgeType = exports.BadgeType = {
19
12
  ROUNDED_LARGE_NUMBER: "ROUNDED_LARGE_NUMBER",
20
13
  UNDEFINED_LARGE_NUMBER: "UNDEFINED_LARGE_NUMBER"
21
14
  };
@@ -23,45 +16,47 @@ var BadgeType = {
23
16
  /**
24
17
  * The props for the Badge component.
25
18
  */
26
- exports.BadgeType = BadgeType;
27
- var MAX_VAL = 999;
28
- var units = ["", "k", "M", "B", "T"];
29
- var round = function round(value) {
30
- var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
19
+
20
+ const MAX_VAL = 999;
21
+ const units = ["", "k", "M", "B", "T"];
22
+ const round = function (value) {
23
+ let unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
31
24
  if (value < 1000) {
32
- var truncatedValue = Number(value.toString().slice(0, 3));
25
+ const truncatedValue = Number(value.toString().slice(0, 3));
33
26
  return "".concat(truncatedValue).concat(units[unit]);
34
27
  }
35
28
  if (unit >= units.length - 1) {
36
29
  return "999T";
37
30
  }
38
- var newValue = value / 1000;
31
+ const newValue = value / 1000;
39
32
  return round(newValue, unit + 1);
40
33
  };
41
- var clamp = function clamp(value) {
34
+ const clamp = value => {
42
35
  if (value > MAX_VAL) {
43
36
  return "".concat(MAX_VAL, "+");
44
37
  }
45
38
  return value;
46
39
  };
47
- var Badge = function Badge(_ref) {
48
- var _classNames;
49
- var value = _ref.value,
50
- _ref$badgeType = _ref.badgeType,
51
- badgeType = _ref$badgeType === void 0 ? BadgeType.UNDEFINED_LARGE_NUMBER : _ref$badgeType,
52
- className = _ref.className,
53
- isNegative = _ref.isNegative,
54
- spanProps = _objectWithoutProperties(_ref, _excluded);
55
- var badgeClassName = (0, _classnames.default)((_classNames = {}, _defineProperty(_classNames, "p-badge--negative", !!isNegative), _defineProperty(_classNames, "p-badge", !isNegative), _classNames), className);
56
- var safeValue = Math.round(value);
40
+ const Badge = _ref => {
41
+ let {
42
+ value,
43
+ badgeType = BadgeType.UNDEFINED_LARGE_NUMBER,
44
+ className,
45
+ isNegative,
46
+ ...spanProps
47
+ } = _ref;
48
+ const badgeClassName = (0, _classnames.default)({
49
+ ["p-badge--negative"]: !!isNegative,
50
+ "p-badge": !isNegative
51
+ }, className);
52
+ let safeValue = Math.round(value);
57
53
  if (value < 0) {
58
54
  console.error("The value used in the badge should be positive");
59
55
  safeValue = 0;
60
56
  }
61
- var formattedValue = badgeType === BadgeType.ROUNDED_LARGE_NUMBER ? round(safeValue) : clamp(safeValue);
57
+ const formattedValue = badgeType === BadgeType.ROUNDED_LARGE_NUMBER ? round(safeValue) : clamp(safeValue);
62
58
  return /*#__PURE__*/_react.default.createElement("span", _extends({}, spanProps, {
63
59
  className: badgeClassName
64
60
  }), formattedValue);
65
61
  };
66
- var _default = Badge;
67
- exports.default = _default;
62
+ var _default = exports.default = Badge;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _Badge.default;
10
10
  }
11
11
  });
@@ -6,12 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = exports.ButtonAppearance = void 0;
7
7
  var _classnames = _interopRequireDefault(require("classnames"));
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _excluded = ["appearance", "children", "className", "dense", "disabled", "element", "hasIcon", "inline", "onClick", "small"];
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
10
  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); }
12
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- var ButtonAppearance = {
11
+ const ButtonAppearance = exports.ButtonAppearance = {
15
12
  BASE: "base",
16
13
  BRAND: "brand",
17
14
  DEFAULT: "",
@@ -24,36 +21,35 @@ var ButtonAppearance = {
24
21
  * The type of the Button props.
25
22
  * @template P - The type of the props if providing a component to `element`
26
23
  */
27
- exports.ButtonAppearance = ButtonAppearance;
24
+
28
25
  /**
29
26
  * A component for the Vanilla button.
30
27
  * @template P - The type of the props if providing a component to `element`
31
28
  */
32
- var Button = function Button(_ref) {
33
- var appearance = _ref.appearance,
34
- children = _ref.children,
35
- className = _ref.className,
36
- dense = _ref.dense,
37
- disabled = _ref.disabled,
38
- _ref$element = _ref.element,
39
- Component = _ref$element === void 0 ? "button" : _ref$element,
40
- hasIcon = _ref.hasIcon,
41
- inline = _ref.inline,
42
- onClick = _ref.onClick,
43
- small = _ref.small,
44
- buttonProps = _objectWithoutProperties(_ref, _excluded);
45
- var classes = (0, _classnames.default)(appearance ? "p-button--".concat(appearance) : "p-button", {
29
+ const Button = _ref => {
30
+ let {
31
+ appearance,
32
+ children,
33
+ className,
34
+ dense,
35
+ disabled,
36
+ element: Component = "button",
37
+ hasIcon,
38
+ inline,
39
+ onClick,
40
+ small,
41
+ ...buttonProps
42
+ } = _ref;
43
+ const classes = (0, _classnames.default)(appearance ? "p-button--".concat(appearance) : "p-button", {
46
44
  "has-icon": hasIcon,
47
45
  "is-dense": dense,
48
46
  "is-disabled": Component !== "button" && disabled,
49
47
  "is-inline": inline,
50
48
  "is-small": small
51
49
  }, className);
52
- var onClickDisabled = function onClickDisabled(e) {
53
- return e.preventDefault();
54
- };
55
- var disabledProp = Component === "button" ? {
56
- disabled: disabled
50
+ const onClickDisabled = e => e.preventDefault();
51
+ const disabledProp = Component === "button" ? {
52
+ disabled
57
53
  } : {
58
54
  "aria-disabled": disabled
59
55
  };
@@ -62,5 +58,4 @@ var Button = function Button(_ref) {
62
58
  onClick: disabled ? onClickDisabled : onClick
63
59
  }, disabledProp, buttonProps), children);
64
60
  };
65
- var _default = Button;
66
- exports.default = _default;
61
+ var _default = exports.default = Button;
@@ -1,21 +1,20 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  Object.defineProperty(exports, "ButtonAppearance", {
8
7
  enumerable: true,
9
- get: function get() {
8
+ get: function () {
10
9
  return _Button.ButtonAppearance;
11
10
  }
12
11
  });
13
12
  Object.defineProperty(exports, "default", {
14
13
  enumerable: true,
15
- get: function get() {
14
+ get: function () {
16
15
  return _Button.default;
17
16
  }
18
17
  });
19
18
  var _Button = _interopRequireWildcard(require("./Button"));
20
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }