@canonical/react-components 0.47.1 → 0.47.3

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 +36 -61
  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 +5 -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 +29 -42
  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 +42 -46
  96. package/dist/components/Select/index.js +1 -1
  97. package/dist/components/Slider/Slider.js +31 -36
  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 +55 -47
  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 +41 -36
  151. package/dist/hooks/useClickOutside.d.ts +0 -6
  152. package/dist/hooks/useClickOutside.js +0 -32
@@ -7,20 +7,19 @@ exports.default = void 0;
7
7
  var _classnames = _interopRequireDefault(require("classnames"));
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _hooks = require("../../hooks");
10
- var _excluded = ["children", "className", "highlighted", "overlay", "thumbnail", "title"];
11
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
11
  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 _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; }
14
- 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; }
15
- var Card = function Card(_ref) {
16
- var children = _ref.children,
17
- className = _ref.className,
18
- highlighted = _ref.highlighted,
19
- overlay = _ref.overlay,
20
- thumbnail = _ref.thumbnail,
21
- title = _ref.title,
22
- props = _objectWithoutProperties(_ref, _excluded);
23
- var titleId = (0, _hooks.useId)();
12
+ const Card = _ref => {
13
+ let {
14
+ children,
15
+ className,
16
+ highlighted,
17
+ overlay,
18
+ thumbnail,
19
+ title,
20
+ ...props
21
+ } = _ref;
22
+ const titleId = (0, _hooks.useId)();
24
23
  return /*#__PURE__*/_react.default.createElement("div", _extends({
25
24
  "aria-labelledby": title ? titleId : undefined,
26
25
  className: (0, _classnames.default)(className, {
@@ -42,5 +41,4 @@ var Card = function Card(_ref) {
42
41
  className: "p-card__content"
43
42
  }, children));
44
43
  };
45
- var _default = Card;
46
- exports.default = _default;
44
+ var _default = exports.default = Card;
@@ -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 _Card.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,24 +7,22 @@ exports.default = void 0;
8
7
  var _classnames = _interopRequireDefault(require("classnames"));
9
8
  var _react = _interopRequireWildcard(require("react"));
10
9
  var _useId = require("../../../hooks/useId");
11
- var _excluded = ["inputType", "label", "labelClassName", "indeterminate", "inline"];
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 _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 CheckableInput = function CheckableInput(_ref) {
19
- var inputType = _ref.inputType,
20
- label = _ref.label,
21
- labelClassName = _ref.labelClassName,
22
- _ref$indeterminate = _ref.indeterminate,
23
- indeterminate = _ref$indeterminate === void 0 ? false : _ref$indeterminate,
24
- inline = _ref.inline,
25
- checkboxProps = _objectWithoutProperties(_ref, _excluded);
26
- var inputId = (0, _useId.useId)();
27
- var inputRef = (0, _react.useRef)(null);
28
- (0, _react.useEffect)(function () {
14
+ const CheckableInput = _ref => {
15
+ let {
16
+ inputType,
17
+ label,
18
+ labelClassName,
19
+ indeterminate = false,
20
+ inline,
21
+ ...checkboxProps
22
+ } = _ref;
23
+ const inputId = (0, _useId.useId)();
24
+ const inputRef = (0, _react.useRef)(null);
25
+ (0, _react.useEffect)(() => {
29
26
  inputRef.current.indeterminate = indeterminate;
30
27
  }, [indeterminate]);
31
28
  return /*#__PURE__*/_react.default.createElement("label", {
@@ -42,5 +39,4 @@ var CheckableInput = function CheckableInput(_ref) {
42
39
  id: inputId
43
40
  }, label));
44
41
  };
45
- var _default = CheckableInput;
46
- exports.default = _default;
42
+ var _default = exports.default = CheckableInput;
@@ -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 _CheckableInput.default;
10
10
  }
11
11
  });
@@ -6,21 +6,18 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _CheckableInput = _interopRequireDefault(require("./CheckableInput"));
9
- var _excluded = ["label", "indeterminate"];
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 CheckboxInput = function CheckboxInput(_ref) {
15
- var label = _ref.label,
16
- _ref$indeterminate = _ref.indeterminate,
17
- indeterminate = _ref$indeterminate === void 0 ? false : _ref$indeterminate,
18
- checkboxProps = _objectWithoutProperties(_ref, _excluded);
11
+ const CheckboxInput = _ref => {
12
+ let {
13
+ label,
14
+ indeterminate = false,
15
+ ...checkboxProps
16
+ } = _ref;
19
17
  return /*#__PURE__*/_react.default.createElement(_CheckableInput.default, _extends({
20
18
  label: label,
21
19
  inputType: "checkbox",
22
20
  indeterminate: indeterminate
23
21
  }, checkboxProps));
24
22
  };
25
- var _default = CheckboxInput;
26
- exports.default = _default;
23
+ var _default = exports.default = CheckboxInput;
@@ -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 _CheckboxInput.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,42 +7,33 @@ exports.default = exports.Label = exports.ChipType = void 0;
8
7
  var _react = _interopRequireDefault(require("react"));
9
8
  var _utils = require("../../utils");
10
9
  var _classnames = _interopRequireDefault(require("classnames"));
11
- var _excluded = ["appearance", "lead", "onClick", "onDismiss", "quoteValue", "selected", "subString", "value"];
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
  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); }
14
- 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; }
15
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
- 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); }
17
- 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; }
18
- 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; }
19
- var Label = /*#__PURE__*/function (Label) {
12
+ let Label = exports.Label = /*#__PURE__*/function (Label) {
20
13
  Label["Dismiss"] = "Dismiss";
21
14
  return Label;
22
15
  }({});
23
- exports.Label = Label;
24
- var ChipType = {
16
+ const ChipType = exports.ChipType = {
25
17
  CAUTION: "caution",
26
18
  INFORMATION: "information",
27
19
  NEGATIVE: "negative",
28
20
  POSITIVE: "positive"
29
21
  };
30
- exports.ChipType = ChipType;
31
- var Chip = function Chip(_ref) {
32
- var _classNames;
33
- var appearance = _ref.appearance,
34
- _ref$lead = _ref.lead,
35
- lead = _ref$lead === void 0 ? "" : _ref$lead,
36
- onClick = _ref.onClick,
37
- onDismiss = _ref.onDismiss,
38
- quoteValue = _ref.quoteValue,
39
- selected = _ref.selected,
40
- _ref$subString = _ref.subString,
41
- subString = _ref$subString === void 0 ? "" : _ref$subString,
42
- value = _ref.value,
43
- props = _objectWithoutProperties(_ref, _excluded);
22
+ const Chip = _ref => {
23
+ let {
24
+ appearance,
25
+ lead = "",
26
+ onClick,
27
+ onDismiss,
28
+ quoteValue,
29
+ selected,
30
+ subString = "",
31
+ value,
32
+ ...props
33
+ } = _ref;
44
34
  // When user tabs over chip and presses Enter or Space key, chip will trigger
45
35
  // click functionality
46
- var _onKeyDown = function onKeyDown(e) {
36
+ const onKeyDown = e => {
47
37
  // The " " value is what is returned for the spacebar
48
38
  if (e.key === " " || e.key === "Enter") {
49
39
  if (typeof onClick === "function") {
@@ -54,8 +44,8 @@ var Chip = function Chip(_ref) {
54
44
  }
55
45
  }
56
46
  };
57
- var chipValue = (0, _utils.highlightSubString)(value, subString).text;
58
- var chipContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, lead && /*#__PURE__*/_react.default.createElement("span", {
47
+ const chipValue = (0, _utils.highlightSubString)(value, subString).text;
48
+ const chipContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, lead && /*#__PURE__*/_react.default.createElement("span", {
59
49
  className: "p-chip__lead"
60
50
  }, lead.toUpperCase()), /*#__PURE__*/_react.default.createElement("span", {
61
51
  className: "p-chip__value",
@@ -63,7 +53,10 @@ var Chip = function Chip(_ref) {
63
53
  __html: quoteValue ? "'".concat(chipValue, "'") : chipValue
64
54
  }
65
55
  }));
66
- var chipClassName = (0, _classnames.default)((_classNames = {}, _defineProperty(_classNames, "p-chip--".concat(appearance), !!appearance), _defineProperty(_classNames, "p-chip", !appearance), _classNames), props.className);
56
+ const chipClassName = (0, _classnames.default)({
57
+ ["p-chip--".concat(appearance)]: !!appearance,
58
+ "p-chip": !appearance
59
+ }, props.className);
67
60
  if (onDismiss) {
68
61
  return /*#__PURE__*/_react.default.createElement("span", _extends({}, props, {
69
62
  className: chipClassName
@@ -79,12 +72,9 @@ var Chip = function Chip(_ref) {
79
72
  "aria-pressed": selected,
80
73
  className: chipClassName,
81
74
  onClick: onClick,
82
- onKeyDown: function onKeyDown(e) {
83
- return _onKeyDown(e);
84
- },
75
+ onKeyDown: e => onKeyDown(e),
85
76
  type: "button"
86
77
  }), chipContent);
87
78
  }
88
79
  };
89
- var _default = Chip;
90
- exports.default = _default;
80
+ var _default = exports.default = Chip;
@@ -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 _Chip.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
  });
@@ -9,23 +8,22 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _CodeSnippet = _interopRequireWildcard(require("../CodeSnippet"));
11
10
  var _utils = require("../../utils");
12
- var _excluded = ["children", "className", "inline", "copyable", "numbered"];
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; }
11
+ 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); }
12
+ 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
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
14
  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); }
17
- 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; }
18
- 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; }
19
15
  /**
20
16
  * @deprecated Code component is deprecated. Use CodeSnippet component or inline `<code>` instead.
21
17
  */
22
- var Code = function Code(_ref) {
23
- var children = _ref.children,
24
- className = _ref.className,
25
- inline = _ref.inline,
26
- copyable = _ref.copyable,
27
- numbered = _ref.numbered,
28
- props = _objectWithoutProperties(_ref, _excluded);
18
+ const Code = _ref => {
19
+ let {
20
+ children,
21
+ className,
22
+ inline,
23
+ copyable,
24
+ numbered,
25
+ ...props
26
+ } = _ref;
29
27
  if (_utils.IS_DEV) {
30
28
  console.warn("Code component is deprecated. Use CodeSnippet component or inline `<code>` instead.");
31
29
  }
@@ -34,7 +32,7 @@ var Code = function Code(_ref) {
34
32
  className: className
35
33
  }, props), children);
36
34
  } else {
37
- var appearance = null;
35
+ let appearance = null;
38
36
  if (numbered) {
39
37
  appearance = _CodeSnippet.CodeSnippetBlockAppearance.NUMBERED;
40
38
  } else if (copyable) {
@@ -42,7 +40,7 @@ var Code = function Code(_ref) {
42
40
  }
43
41
  return /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
44
42
  blocks: [{
45
- appearance: appearance,
43
+ appearance,
46
44
  code: children
47
45
  }]
48
46
  });
@@ -54,5 +52,4 @@ Code.propTypes = {
54
52
  copyable: _propTypes.default.bool,
55
53
  numbered: _propTypes.default.bool
56
54
  };
57
- var _default = Code;
58
- exports.default = _default;
55
+ var _default = exports.default = Code;
@@ -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 _Code.default;
10
10
  }
11
11
  });
@@ -7,24 +7,19 @@ exports.default = CodeSnippet;
7
7
  var _classnames = _interopRequireDefault(require("classnames"));
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _CodeSnippetBlock = _interopRequireDefault(require("./CodeSnippetBlock"));
10
- var _excluded = ["className", "blocks"];
11
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
11
  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 _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; }
14
- 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; }
15
12
  function CodeSnippet(_ref) {
16
- var className = _ref.className,
17
- blocks = _ref.blocks,
18
- props = _objectWithoutProperties(_ref, _excluded);
13
+ let {
14
+ className,
15
+ blocks,
16
+ ...props
17
+ } = _ref;
19
18
  return /*#__PURE__*/_react.default.createElement("div", _extends({
20
19
  className: (0, _classnames.default)("p-code-snippet", {
21
- "is-bordered": blocks.some(function (block) {
22
- return block.content;
23
- })
20
+ "is-bordered": blocks.some(block => block.content)
24
21
  }, className)
25
- }, props), blocks.map(function (blockProps, i) {
26
- return /*#__PURE__*/_react.default.createElement(_CodeSnippetBlock.default, _extends({
27
- key: "code-snippet-block-".concat(i)
28
- }, blockProps));
29
- }));
22
+ }, props), blocks.map((blockProps, i) => /*#__PURE__*/_react.default.createElement(_CodeSnippetBlock.default, _extends({
23
+ key: "code-snippet-block-".concat(i)
24
+ }, blockProps))));
30
25
  }
@@ -10,32 +10,31 @@ var _react = _interopRequireDefault(require("react"));
10
10
  var _CodeSnippetDropdown = _interopRequireDefault(require("./CodeSnippetDropdown"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  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
- var CodeSnippetBlockAppearance = {
13
+ const CodeSnippetBlockAppearance = exports.CodeSnippetBlockAppearance = {
14
14
  LINUX_PROMPT: "linuxPrompt",
15
15
  NUMBERED: "numbered",
16
16
  URL: "url",
17
17
  WINDOWS_PROMPT: "windowsPrompt"
18
18
  };
19
- exports.CodeSnippetBlockAppearance = CodeSnippetBlockAppearance;
20
19
  function CodeSnippetBlock(_ref) {
21
- var appearance = _ref.appearance,
22
- code = _ref.code,
23
- content = _ref.content,
24
- dropdowns = _ref.dropdowns,
25
- _ref$stacked = _ref.stacked,
26
- stacked = _ref$stacked === void 0 ? false : _ref$stacked,
27
- title = _ref.title,
28
- _ref$wrapLines = _ref.wrapLines,
29
- wrapLines = _ref$wrapLines === void 0 ? false : _ref$wrapLines;
30
- var className = "p-code-snippet__block";
31
- var isNumbered = appearance === CodeSnippetBlockAppearance.NUMBERED;
32
- var hasIcon = appearance === CodeSnippetBlockAppearance.LINUX_PROMPT || appearance === CodeSnippetBlockAppearance.WINDOWS_PROMPT || appearance === CodeSnippetBlockAppearance.URL;
33
- var numberedCode;
20
+ let {
21
+ appearance,
22
+ code,
23
+ content,
24
+ dropdowns,
25
+ stacked = false,
26
+ title,
27
+ wrapLines = false
28
+ } = _ref;
29
+ let className = "p-code-snippet__block";
30
+ const isNumbered = appearance === CodeSnippetBlockAppearance.NUMBERED;
31
+ const hasIcon = appearance === CodeSnippetBlockAppearance.LINUX_PROMPT || appearance === CodeSnippetBlockAppearance.WINDOWS_PROMPT || appearance === CodeSnippetBlockAppearance.URL;
32
+ let numberedCode;
34
33
  if (isNumbered) {
35
34
  className += "--numbered";
36
35
 
37
36
  // wrap code lines in spans (and preserve the whitespace)
38
- var lines;
37
+ let lines;
39
38
  if (Array.isArray(code)) {
40
39
  lines = code;
41
40
  } else if (typeof code === "string") {
@@ -45,13 +44,11 @@ function CodeSnippetBlock(_ref) {
45
44
  // a single line number.
46
45
  lines = [code];
47
46
  }
48
- numberedCode = lines.map(function (line, i) {
49
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
50
- key: "p-code-snippet__line-".concat(i)
51
- }, /*#__PURE__*/_react.default.createElement("span", {
52
- className: "p-code-snippet__line"
53
- }, line), "\n");
54
- });
47
+ numberedCode = lines.map((line, i) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
48
+ key: "p-code-snippet__line-".concat(i)
49
+ }, /*#__PURE__*/_react.default.createElement("span", {
50
+ className: "p-code-snippet__line"
51
+ }, line), "\n"));
55
52
  } else if (hasIcon) {
56
53
  className += "--icon";
57
54
  }
@@ -60,18 +57,16 @@ function CodeSnippetBlock(_ref) {
60
57
  "is-url": appearance === CodeSnippetBlockAppearance.URL,
61
58
  "is-wrapped": wrapLines
62
59
  });
63
- var hasDropdowns = dropdowns && dropdowns.length;
60
+ const hasDropdowns = dropdowns && dropdowns.length;
64
61
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (title || hasDropdowns) && /*#__PURE__*/_react.default.createElement("div", {
65
62
  className: "p-code-snippet__header ".concat(stacked ? "is-stacked" : "")
66
63
  }, /*#__PURE__*/_react.default.createElement("h5", {
67
64
  className: "p-code-snippet__title"
68
65
  }, title), hasDropdowns && /*#__PURE__*/_react.default.createElement("div", {
69
66
  className: "p-code-snippet__dropdowns"
70
- }, dropdowns.map(function (dropdown, i) {
71
- return /*#__PURE__*/_react.default.createElement(_CodeSnippetDropdown.default, _extends({}, dropdown, {
72
- key: "code-snippet-dropdown-".concat(i)
73
- }));
74
- }))), /*#__PURE__*/_react.default.createElement("pre", {
67
+ }, dropdowns.map((dropdown, i) => /*#__PURE__*/_react.default.createElement(_CodeSnippetDropdown.default, _extends({}, dropdown, {
68
+ key: "code-snippet-dropdown-".concat(i)
69
+ }))))), /*#__PURE__*/_react.default.createElement("pre", {
75
70
  className: className
76
71
  }, /*#__PURE__*/_react.default.createElement("code", null, isNumbered ? numberedCode : code)), content);
77
72
  }
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = CodeSnippetDropdown;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- var _excluded = ["options", "onChange"],
9
- _excluded2 = ["label", "value"];
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
9
  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
10
  function CodeSnippetDropdown(_ref) {
15
- var options = _ref.options,
16
- onChange = _ref.onChange,
17
- props = _objectWithoutProperties(_ref, _excluded);
11
+ let {
12
+ options,
13
+ onChange,
14
+ ...props
15
+ } = _ref;
18
16
  return /*#__PURE__*/_react.default.createElement("select", _extends({
19
17
  className: "p-code-snippet__dropdown",
20
18
  onChange: onChange
21
- }, props), options.map(function (_ref2) {
22
- var label = _ref2.label,
23
- value = _ref2.value,
24
- props = _objectWithoutProperties(_ref2, _excluded2);
19
+ }, props), options.map(_ref2 => {
20
+ let {
21
+ label,
22
+ value,
23
+ ...props
24
+ } = _ref2;
25
25
  return /*#__PURE__*/_react.default.createElement("option", _extends({
26
26
  value: value,
27
27
  key: value + "" || label
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "CodeSnippetBlockAppearance", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _CodeSnippetBlock.CodeSnippetBlockAppearance;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "default", {
13
13
  enumerable: true,
14
- get: function get() {
14
+ get: function () {
15
15
  return _CodeSnippet.default;
16
16
  }
17
17
  });
@@ -1,39 +1,37 @@
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.colSizes = void 0;
8
7
  var _classnames = _interopRequireDefault(require("classnames"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
- var _excluded = ["children", "className", "element", "emptyLarge", "emptyMedium", "emptySmall", "large", "medium", "size", "small"];
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 colSizes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
19
- exports.colSizes = colSizes;
20
- var Col = function Col(_ref) {
21
- var _classNames;
22
- var children = _ref.children,
23
- className = _ref.className,
24
- _ref$element = _ref.element,
25
- Component = _ref$element === void 0 ? "div" : _ref$element,
26
- emptyLarge = _ref.emptyLarge,
27
- emptyMedium = _ref.emptyMedium,
28
- emptySmall = _ref.emptySmall,
29
- large = _ref.large,
30
- medium = _ref.medium,
31
- size = _ref.size,
32
- small = _ref.small,
33
- props = _objectWithoutProperties(_ref, _excluded);
11
+ const colSizes = exports.colSizes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
12
+ const Col = _ref => {
13
+ let {
14
+ children,
15
+ className,
16
+ element: Component = "div",
17
+ emptyLarge,
18
+ emptyMedium,
19
+ emptySmall,
20
+ large,
21
+ medium,
22
+ size,
23
+ small,
24
+ ...props
25
+ } = _ref;
34
26
  return /*#__PURE__*/_react.default.createElement(Component, _extends({
35
- className: (0, _classnames.default)(className, "col-".concat(size), (_classNames = {}, _defineProperty(_classNames, "col-small-".concat(small), !!small), _defineProperty(_classNames, "col-medium-".concat(medium), !!medium), _defineProperty(_classNames, "col-large-".concat(large), !!large), _defineProperty(_classNames, "col-start-small-".concat(emptySmall), !!emptySmall), _defineProperty(_classNames, "col-start-medium-".concat(emptyMedium), !!emptyMedium), _defineProperty(_classNames, "col-start-large-".concat(emptyLarge), !!emptyLarge), _classNames))
27
+ className: (0, _classnames.default)(className, "col-".concat(size), {
28
+ ["col-small-".concat(small)]: !!small,
29
+ ["col-medium-".concat(medium)]: !!medium,
30
+ ["col-large-".concat(large)]: !!large,
31
+ ["col-start-small-".concat(emptySmall)]: !!emptySmall,
32
+ ["col-start-medium-".concat(emptyMedium)]: !!emptyMedium,
33
+ ["col-start-large-".concat(emptyLarge)]: !!emptyLarge
34
+ })
36
35
  }, props), children);
37
36
  };
38
- var _default = Col;
39
- exports.default = _default;
37
+ var _default = exports.default = Col;