@splunk/react-ui 4.21.0 → 4.21.1

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 (83) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +7 -2
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1808 -2084
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -519
  20. package/Color.js +1066 -1069
  21. package/ColumnLayout.js +402 -363
  22. package/ComboBox.js +891 -794
  23. package/Concertina.js +997 -802
  24. package/ControlGroup.js +687 -594
  25. package/Date.js +567 -547
  26. package/DefinitionList.js +308 -234
  27. package/Divider.js +149 -118
  28. package/Dropdown.js +459 -416
  29. package/DualListbox.js +1479 -1541
  30. package/EventListener.js +94 -97
  31. package/File.js +1051 -969
  32. package/FormRows.js +883 -696
  33. package/Heading.js +216 -193
  34. package/Image.js +446 -402
  35. package/JSONTree.js +690 -551
  36. package/Layer.js +437 -410
  37. package/Link.js +336 -255
  38. package/List.js +213 -161
  39. package/Markdown.js +509 -487
  40. package/Menu.js +1105 -1056
  41. package/Message.js +475 -441
  42. package/MessageBar.js +387 -373
  43. package/Modal.js +810 -634
  44. package/ModalLayer.js +326 -243
  45. package/Monogram.js +308 -276
  46. package/Multiselect.js +3550 -3364
  47. package/Number.js +729 -687
  48. package/Paginator.js +510 -449
  49. package/Paragraph.js +145 -112
  50. package/Popover.js +1459 -1432
  51. package/Progress.js +301 -246
  52. package/RadioBar.js +610 -527
  53. package/RadioList.js +483 -444
  54. package/Resize.js +530 -489
  55. package/ResultsMenu.js +494 -455
  56. package/ScreenReaderContent.js +142 -111
  57. package/Scroll.js +595 -456
  58. package/ScrollContainerContext.js +197 -206
  59. package/Search.js +744 -650
  60. package/Select.js +2442 -2345
  61. package/SidePanel.js +390 -284
  62. package/Slider.js +669 -676
  63. package/SlidingPanels.js +639 -503
  64. package/SplitButton.js +464 -367
  65. package/StaticContent.js +161 -133
  66. package/StepBar.js +386 -358
  67. package/Switch.js +710 -640
  68. package/TabBar.js +726 -680
  69. package/TabLayout.js +406 -322
  70. package/Table.js +4842 -4616
  71. package/Text.js +1170 -1138
  72. package/TextArea.js +1102 -1090
  73. package/Tooltip.js +624 -581
  74. package/TransitionOpen.js +489 -422
  75. package/Typography.js +176 -153
  76. package/WaitSpinner.js +230 -206
  77. package/package.json +5 -5
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/useForceUpdate.js +112 -82
  81. package/useKeyPress.js +74 -71
  82. package/usePrevious.js +65 -65
  83. package/useRovingFocus.js +122 -138
package/Monogram.js CHANGED
@@ -1,282 +1,314 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- "default": () => (/* reexport */ Monogram_Monogram),
55
- getInitials: () => (/* reexport */ getInitials)
56
- });
57
-
58
- ;// CONCATENATED MODULE: external "react"
59
- const external_react_namespaceObject = require("react");
60
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
61
- ;// CONCATENATED MODULE: external "prop-types"
62
- const external_prop_types_namespaceObject = require("prop-types");
63
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
64
- ;// CONCATENATED MODULE: external "lodash/omit"
65
- const omit_namespaceObject = require("lodash/omit");
66
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
67
- ;// CONCATENATED MODULE: external "styled-components"
68
- const external_styled_components_namespaceObject = require("styled-components");
69
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
70
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
71
- const Clickable_namespaceObject = require("@splunk/react-ui/Clickable");
72
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_namespaceObject);
73
- ;// CONCATENATED MODULE: external "@splunk/themes"
74
- const themes_namespaceObject = require("@splunk/themes");
75
- ;// CONCATENATED MODULE: ./src/Monogram/MonogramStyles.ts
76
-
77
-
78
- // Thanks: https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0
79
-
80
- var hashCode = function hashCode(input) {
81
- var hash = 0;
82
-
83
- for (var i = 0; i < input.length;) {
84
- hash = (hash << 5) - hash + input.charCodeAt(i++) | 0; // eslint-disable-line no-bitwise, no-plusplus
85
- }
86
-
87
- return hash;
88
- };
89
-
90
- var backgroundColors = ['#006d9c', '#ec9960', '#af575a', '#62b3b2', '#4fa484', '#f8be34', '#5a4575', '#708794', '#294e70', '#b6c75a', '#5cc05c', '#007abd', '#dc4e41', '#f1813f', '#f8be34', '#53a051', '#006d9c', '#77d6d8', '#f589ad', '#6a2c5d'];
91
- var Styled = external_styled_components_default().div.withConfig({
92
- displayName: "MonogramStyles__Styled",
93
- componentId: "r5ud6k-0"
94
- })(["", ";align-items:center;justify-content:center;border-radius:50%;font-weight:normal;", " background-color:", ";", ";& + &{margin-left:4px;}"], themes_namespaceObject.mixins.reset('inline-flex'), (0,themes_namespaceObject.pick)({
95
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.contentColorActive)
96
- }), function (_ref) {
97
- var $backgroundColor = _ref.$backgroundColor,
98
- $initials = _ref.$initials;
99
-
100
- if ($backgroundColor === 'theme') {
101
- return (0,themes_namespaceObject.pick)({
102
- enterprise: {
103
- dark: themes_namespaceObject.variables.gray45,
104
- light: themes_namespaceObject.variables.gray92
105
- },
106
- prisma: themes_namespaceObject.variables.neutral100
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = r => {
12
+ /******/ var t = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
15
+ /******/;
16
+ e.d(t, {
17
+ a: t
18
+ });
19
+ /******/ return t;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (r, t) => {
27
+ /******/ for (var n in t) {
28
+ /******/ if (e.o(t, n) && !e.o(r, n)) {
29
+ /******/ Object.defineProperty(r, n, {
30
+ enumerable: true,
31
+ get: t[n]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var r = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(r);
62
+ // EXPORTS
63
+ e.d(r, {
64
+ default: () => /* reexport */ R,
65
+ getInitials: () => /* reexport */ P
107
66
  });
108
- }
109
-
110
- if ($backgroundColor === 'auto') {
111
- return backgroundColors[hashCode($initials) % backgroundColors.length];
112
- }
113
-
114
- return $backgroundColor;
115
- }, function (_ref2) {
116
- var $size = _ref2.$size;
117
-
118
- if (typeof $size === 'number') {
119
- return (0,external_styled_components_namespaceObject.css)(["height:", "px;width:", "px;"], $size, $size);
120
- }
121
-
122
- if (typeof $size === 'string') {
123
- return (0,themes_namespaceObject.pickVariant)('$size', {
124
- small: (0,external_styled_components_namespaceObject.css)(["font-size:", ";", ""], themes_namespaceObject.variables.fontSize, (0,themes_namespaceObject.pick)({
125
- enterprise: (0,external_styled_components_namespaceObject.css)(["height:32px;width:32px;"]),
126
- prisma: (0,external_styled_components_namespaceObject.css)(["height:24px;width:24px;"])
127
- })),
128
- medium: (0,external_styled_components_namespaceObject.css)(["height:48px;width:48px;font-size:", ";"], themes_namespaceObject.variables.fontSize),
129
- large: (0,external_styled_components_namespaceObject.css)(["height:80px;width:80px;font-size:", ";"], themes_namespaceObject.variables.fontSizeXXLarge),
130
- xlarge: (0,external_styled_components_namespaceObject.css)(["width:144px;height:144px;font-size:36px;font-weight:700;"])
131
- });
132
- }
133
-
134
- return (0,external_styled_components_namespaceObject.css)(["height:48px;width:48px;font-size:", ";"], themes_namespaceObject.variables.fontSize);
135
- });
136
- var StyledClickableComponent = Styled.withComponent((Clickable_default()));
137
- var StyledClickable = external_styled_components_default()(StyledClickableComponent).withConfig({
138
- displayName: "MonogramStyles__StyledClickable",
139
- componentId: "r5ud6k-1"
140
- })(["cursor:pointer;position:relative;:focus,:hover{", "}:focus{box-shadow:", ";z-index:1;}:active{", "}"], (0,themes_namespaceObject.pick)({
141
- enterprise: (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";"], themes_namespaceObject.variables.focusShadowInset),
142
- prisma: (0,external_styled_components_namespaceObject.css)(["border:1px solid transparent;background-color:", ";"], themes_namespaceObject.variables.neutral200)
143
- }), (0,themes_namespaceObject.pick)({
144
- enterprise: themes_namespaceObject.variables.focusShadowInset,
145
- prisma: themes_namespaceObject.variables.focusShadow
146
- }), (0,themes_namespaceObject.pick)({
147
- enterprise: (0,external_styled_components_namespaceObject.css)(["opacity:0.85;"]),
148
- prisma: (0,external_styled_components_namespaceObject.css)(["border:1px solid transparent;background-color:", ";opacity:1;"], themes_namespaceObject.variables.neutral200)
149
- }));
150
- var Initials = external_styled_components_default().span.withConfig({
151
- displayName: "MonogramStyles__Initials",
152
- componentId: "r5ud6k-2"
153
- })(["opacity:0.8;text-transform:capitalize;"]);
154
-
155
- ;// CONCATENATED MODULE: ./src/Monogram/Monogram.tsx
156
- function _extends() { _extends = Object.assign || 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); }
157
-
158
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
159
-
160
- 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."); }
161
-
162
- 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); }
163
-
164
- 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; }
165
-
166
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
167
-
168
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
169
-
170
- 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; }
171
-
172
- 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; }
173
-
174
-
175
-
176
-
177
-
178
- var propTypes = {
179
- backgroundColor: (external_prop_types_default()).string,
180
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
181
- initials: (external_prop_types_default()).string.isRequired,
182
- name: (external_prop_types_default()).string,
183
- onClick: (external_prop_types_default()).func,
184
- size: external_prop_types_default().oneOfType([external_prop_types_default().oneOf(['small', 'medium', 'large', 'xlarge']), (external_prop_types_default()).number])
185
- };
186
- var defaultProps = {
187
- backgroundColor: 'theme',
188
- size: 'medium'
189
- };
190
-
191
- function isInteractive(props) {
192
- return !!props.onClick;
193
- }
194
- /**
67
+ // CONCATENATED MODULE: external "react"
68
+ const t = require("react");
69
+ var n = e.n(t);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const i = require("prop-types");
72
+ var a = e.n(i);
73
+ // CONCATENATED MODULE: external "lodash/omit"
74
+ const o = require("lodash/omit");
75
+ var s = e.n(o);
76
+ // CONCATENATED MODULE: external "styled-components"
77
+ const c = require("styled-components");
78
+ var l = e.n(c);
79
+ // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
80
+ const u = require("@splunk/react-ui/Clickable");
81
+ var f = e.n(u);
82
+ // CONCATENATED MODULE: external "@splunk/themes"
83
+ const p = require("@splunk/themes");
84
+ // CONCATENATED MODULE: ./src/Monogram/MonogramStyles.ts
85
+ // Thanks: https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0
86
+ var d = function e(r) {
87
+ var t = 0;
88
+ for (var n = 0; n < r.length; ) {
89
+ t = (t << 5) - t + r.charCodeAt(n++) | 0;
90
+ // eslint-disable-line no-bitwise, no-plusplus
91
+ }
92
+ return t;
93
+ };
94
+ var m = [ "#006d9c", "#ec9960", "#af575a", "#62b3b2", "#4fa484", "#f8be34", "#5a4575", "#708794", "#294e70", "#b6c75a", "#5cc05c", "#007abd", "#dc4e41", "#f1813f", "#f8be34", "#53a051", "#006d9c", "#77d6d8", "#f589ad", "#6a2c5d" ];
95
+ var b = l().div.withConfig({
96
+ displayName: "MonogramStyles__Styled",
97
+ componentId: "r5ud6k-0"
98
+ })([ "", ";align-items:center;justify-content:center;border-radius:50%;font-weight:normal;", " background-color:", ";", ";& + &{margin-left:4px;}" ], p.mixins.reset("inline-flex"), (0,
99
+ p.pick)({
100
+ prisma: (0, c.css)([ "color:", ";" ], p.variables.contentColorActive)
101
+ }), (function(e) {
102
+ var r = e.$backgroundColor, t = e.$initials;
103
+ if (r === "theme") {
104
+ return (0, p.pick)({
105
+ enterprise: {
106
+ dark: p.variables.gray45,
107
+ light: p.variables.gray92
108
+ },
109
+ prisma: p.variables.neutral100
110
+ });
111
+ }
112
+ if (r === "auto") {
113
+ return m[d(t) % m.length];
114
+ }
115
+ return r;
116
+ }), (function(e) {
117
+ var r = e.$size;
118
+ if (typeof r === "number") {
119
+ return (0, c.css)([ "height:", "px;width:", "px;" ], r, r);
120
+ }
121
+ if (typeof r === "string") {
122
+ return (0, p.pickVariant)("$size", {
123
+ small: (0, c.css)([ "font-size:", ";", "" ], p.variables.fontSize, (0, p.pick)({
124
+ enterprise: (0, c.css)([ "height:32px;width:32px;" ]),
125
+ prisma: (0, c.css)([ "height:24px;width:24px;" ])
126
+ })),
127
+ medium: (0, c.css)([ "height:48px;width:48px;font-size:", ";" ], p.variables.fontSize),
128
+ large: (0, c.css)([ "height:80px;width:80px;font-size:", ";" ], p.variables.fontSizeXXLarge),
129
+ xlarge: (0, c.css)([ "width:144px;height:144px;font-size:36px;font-weight:700;" ])
130
+ });
131
+ }
132
+ return (0, c.css)([ "height:48px;width:48px;font-size:", ";" ], p.variables.fontSize);
133
+ }));
134
+ var v = b.withComponent(f());
135
+ var h = l()(v).withConfig({
136
+ displayName: "MonogramStyles__StyledClickable",
137
+ componentId: "r5ud6k-1"
138
+ })([ "cursor:pointer;position:relative;:focus,:hover{", "}:focus{box-shadow:", ";z-index:1;}:active{", "}" ], (0,
139
+ p.pick)({
140
+ enterprise: (0, c.css)([ "box-shadow:", ";" ], p.variables.focusShadowInset),
141
+ prisma: (0, c.css)([ "border:1px solid transparent;background-color:", ";" ], p.variables.neutral200)
142
+ }), (0, p.pick)({
143
+ enterprise: p.variables.focusShadowInset,
144
+ prisma: p.variables.focusShadow
145
+ }), (0, p.pick)({
146
+ enterprise: (0, c.css)([ "opacity:0.85;" ]),
147
+ prisma: (0, c.css)([ "border:1px solid transparent;background-color:", ";opacity:1;" ], p.variables.neutral200)
148
+ }));
149
+ var g = l().span.withConfig({
150
+ displayName: "MonogramStyles__Initials",
151
+ componentId: "r5ud6k-2"
152
+ })([ "opacity:0.8;text-transform:capitalize;" ]);
153
+ // CONCATENATED MODULE: ./src/Monogram/Monogram.tsx
154
+ function y() {
155
+ y = Object.assign || function(e) {
156
+ for (var r = 1; r < arguments.length; r++) {
157
+ var t = arguments[r];
158
+ for (var n in t) {
159
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
160
+ e[n] = t[n];
161
+ }
162
+ }
163
+ }
164
+ return e;
165
+ };
166
+ return y.apply(this, arguments);
167
+ }
168
+ function k(e, r) {
169
+ return C(e) || O(e, r) || w(e, r) || x();
170
+ }
171
+ function x() {
172
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
173
+ }
174
+ function w(e, r) {
175
+ if (!e) return;
176
+ if (typeof e === "string") return S(e, r);
177
+ var t = Object.prototype.toString.call(e).slice(8, -1);
178
+ if (t === "Object" && e.constructor) t = e.constructor.name;
179
+ if (t === "Map" || t === "Set") return Array.from(e);
180
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return S(e, r);
181
+ }
182
+ function S(e, r) {
183
+ if (r == null || r > e.length) r = e.length;
184
+ for (var t = 0, n = new Array(r); t < r; t++) {
185
+ n[t] = e[t];
186
+ }
187
+ return n;
188
+ }
189
+ function O(e, r) {
190
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
191
+ var t = [];
192
+ var n = true;
193
+ var i = false;
194
+ var a = undefined;
195
+ try {
196
+ for (var o = e[Symbol.iterator](), s; !(n = (s = o.next()).done); n = true) {
197
+ t.push(s.value);
198
+ if (r && t.length === r) break;
199
+ }
200
+ } catch (e) {
201
+ i = true;
202
+ a = e;
203
+ } finally {
204
+ try {
205
+ if (!n && o["return"] != null) o["return"]();
206
+ } finally {
207
+ if (i) throw a;
208
+ }
209
+ }
210
+ return t;
211
+ }
212
+ function C(e) {
213
+ if (Array.isArray(e)) return e;
214
+ }
215
+ function j(e, r) {
216
+ if (e == null) return {};
217
+ var t = z(e, r);
218
+ var n, i;
219
+ if (Object.getOwnPropertySymbols) {
220
+ var a = Object.getOwnPropertySymbols(e);
221
+ for (i = 0; i < a.length; i++) {
222
+ n = a[i];
223
+ if (r.indexOf(n) >= 0) continue;
224
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
225
+ t[n] = e[n];
226
+ }
227
+ }
228
+ return t;
229
+ }
230
+ function z(e, r) {
231
+ if (e == null) return {};
232
+ var t = {};
233
+ var n = Object.keys(e);
234
+ var i, a;
235
+ for (a = 0; a < n.length; a++) {
236
+ i = n[a];
237
+ if (r.indexOf(i) >= 0) continue;
238
+ t[i] = e[i];
239
+ }
240
+ return t;
241
+ }
242
+ var I = {
243
+ backgroundColor: a().string,
244
+ elementRef: a().oneOfType([ a().func, a().object ]),
245
+ initials: a().string.isRequired,
246
+ name: a().string,
247
+ onClick: a().func,
248
+ size: a().oneOfType([ a().oneOf([ "small", "medium", "large", "xlarge" ]), a().number ])
249
+ };
250
+ var _ = {
251
+ backgroundColor: "theme",
252
+ size: "medium"
253
+ };
254
+ function A(e) {
255
+ return !!e.onClick;
256
+ }
257
+ /**
195
258
  * Returns a suitable set of initials for a name. Uses the first character of each
196
259
  * name segment and omits middle segments if the segment count is greater than three.
197
260
  * @param {string} name - The full name.
198
261
  * @returns {string} Limited to three characters. Empty if `name` is empty.
199
262
  * @public
200
- */
201
-
202
-
203
- function getInitials(name) {
204
- var initials = (name.match(/[^\s-]+/g) || []).map(function (segment) {
205
- return segment[0];
206
- }).join('');
207
- return initials.length > 3 ? "".concat(initials[0]).concat(initials[initials.length - 1]) : initials;
208
- }
209
-
210
- function getSharedProps(props) {
211
- var backgroundColor = props.backgroundColor,
212
- initials = props.initials,
213
- size = props.size,
214
- otherProps = _objectWithoutProperties(props, ["backgroundColor", "initials", "size"]);
215
-
216
- var sharedProps = {
217
- 'data-test': 'monogram',
218
- $backgroundColor: backgroundColor,
219
- $initials: initials,
220
- $size: size
221
- };
222
- return [sharedProps, otherProps];
223
- }
224
-
225
- function MonogramInteractive(props) {
226
- var _getSharedProps = getSharedProps(props),
227
- _getSharedProps2 = _slicedToArray(_getSharedProps, 2),
228
- sharedProps = _getSharedProps2[0],
229
- ownProps = _getSharedProps2[1];
230
-
231
- var children = ownProps.children,
232
- elementRef = ownProps.elementRef,
233
- name = ownProps.name,
234
- onClick = ownProps.onClick,
235
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef", "name", "onClick"]);
236
-
237
- var handleClick = (0,external_react_namespaceObject.useCallback)(function (e) {
238
- onClick(e, {
239
- name: name
240
- });
241
- }, [onClick, name]);
242
- return /*#__PURE__*/external_react_default().createElement(StyledClickable, _extends({
243
- elementRef: elementRef,
244
- onClick: handleClick
245
- }, sharedProps, omit_default()(otherProps, Object.keys(propTypes))), children);
246
- }
247
-
248
- function MonogramNonInteractive(props) {
249
- var _getSharedProps3 = getSharedProps(props),
250
- _getSharedProps4 = _slicedToArray(_getSharedProps3, 2),
251
- sharedProps = _getSharedProps4[0],
252
- ownProps = _getSharedProps4[1];
253
-
254
- var children = ownProps.children,
255
- elementRef = ownProps.elementRef,
256
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef"]);
257
-
258
- return /*#__PURE__*/external_react_default().createElement(Styled, _extends({
259
- ref: elementRef
260
- }, sharedProps, omit_default()(otherProps, Object.keys(propTypes))), children);
261
- }
262
-
263
- function Monogram(props) {
264
- // @docs-props-type MonogramPropsBase
265
- if (false) {}
266
-
267
- var children = /*#__PURE__*/external_react_default().createElement(Initials, {
268
- "data-test": "initials"
269
- }, props.initials);
270
- return isInteractive(props) ? /*#__PURE__*/external_react_default().createElement(MonogramInteractive, props, children) : /*#__PURE__*/external_react_default().createElement(MonogramNonInteractive, props, children);
271
- }
272
-
273
- Monogram.propTypes = propTypes;
274
- Monogram.defaultProps = defaultProps;
275
- /* harmony default export */ const Monogram_Monogram = (Monogram);
276
-
277
- ;// CONCATENATED MODULE: ./src/Monogram/index.ts
278
-
279
-
280
- module.exports = __webpack_exports__;
281
- /******/ })()
282
- ;
263
+ */ function P(e) {
264
+ var r = (e.match(/[^\s-]+/g) || []).map((function(e) {
265
+ return e[0];
266
+ })).join("");
267
+ return r.length > 3 ? "".concat(r[0]).concat(r[r.length - 1]) : r;
268
+ }
269
+ function $(e) {
270
+ var r = e.backgroundColor, t = e.initials, n = e.size, i = j(e, [ "backgroundColor", "initials", "size" ]);
271
+ var a = {
272
+ "data-test": "monogram",
273
+ $backgroundColor: r,
274
+ $initials: t,
275
+ $size: n
276
+ };
277
+ return [ a, i ];
278
+ }
279
+ function q(e) {
280
+ var r = $(e), i = k(r, 2), a = i[0], o = i[1];
281
+ var c = o.children, l = o.elementRef, u = o.name, f = o.onClick, p = j(o, [ "children", "elementRef", "name", "onClick" ]);
282
+ var d = (0, t.useCallback)((function(e) {
283
+ f(e, {
284
+ name: u
285
+ });
286
+ }), [ f, u ]);
287
+
288
+ return n().createElement(h, y({
289
+ elementRef: l,
290
+ onClick: d
291
+ }, a, s()(p, Object.keys(I))), c);
292
+ }
293
+ function E(e) {
294
+ var r = $(e), t = k(r, 2), i = t[0], a = t[1];
295
+ var o = a.children, c = a.elementRef, l = j(a, [ "children", "elementRef" ]);
296
+
297
+ return n().createElement(b, y({
298
+ ref: c
299
+ }, i, s()(l, Object.keys(I))), o);
300
+ }
301
+ function M(e) {
302
+ // @docs-props-type MonogramPropsBase
303
+ if (false) {}
304
+ var r = n().createElement(g, {
305
+ "data-test": "initials"
306
+ }, e.initials);
307
+ return A(e) ? n().createElement(q, e, r) : n().createElement(E, e, r);
308
+ }
309
+ M.propTypes = I;
310
+ M.defaultProps = _;
311
+ /* harmony default export */ const R = M;
312
+ // CONCATENATED MODULE: ./src/Monogram/index.ts
313
+ module.exports = r;
314
+ /******/})();