@splunk/react-ui 4.20.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 (101) hide show
  1. package/Accordion.js +425 -441
  2. package/Anchor.js +147 -193
  3. package/Animation.js +142 -166
  4. package/AnimationToggle.js +197 -253
  5. package/Box.js +145 -194
  6. package/Breadcrumbs.js +288 -298
  7. package/Button.js +488 -613
  8. package/ButtonGroup.js +160 -212
  9. package/ButtonSimple.js +543 -562
  10. package/CHANGELOG.md +26 -0
  11. package/Calendar.js +1107 -1195
  12. package/Card.js +771 -746
  13. package/CardLayout.js +205 -223
  14. package/Chip.js +509 -612
  15. package/Clickable.js +416 -472
  16. package/CloseButton.js +165 -250
  17. package/Code.js +1808 -2172
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -675
  20. package/Color.js +1066 -1297
  21. package/ColumnLayout.js +402 -465
  22. package/ComboBox.js +892 -969
  23. package/Concertina.js +998 -963
  24. package/ControlGroup.js +687 -718
  25. package/Date.js +567 -697
  26. package/DefinitionList.js +308 -310
  27. package/Divider.js +149 -194
  28. package/Dropdown.js +459 -558
  29. package/DualListbox.js +1480 -1735
  30. package/EventListener.js +94 -165
  31. package/File.js +1051 -1173
  32. package/FormRows.js +885 -880
  33. package/Heading.js +216 -263
  34. package/Image.js +446 -558
  35. package/JSONTree.js +690 -699
  36. package/Layer.js +442 -582
  37. package/Link.js +336 -361
  38. package/List.js +213 -237
  39. package/Markdown.js +510 -612
  40. package/Menu.js +1109 -1331
  41. package/Message.js +474 -629
  42. package/MessageBar.js +387 -561
  43. package/Modal.js +810 -798
  44. package/ModalLayer.js +326 -343
  45. package/Monogram.js +308 -368
  46. package/Multiselect.js +3558 -3998
  47. package/Number.js +729 -843
  48. package/Paginator.js +510 -615
  49. package/Paragraph.js +145 -188
  50. package/Popover.js +1470 -1693
  51. package/Progress.js +301 -362
  52. package/RadioBar.js +610 -651
  53. package/RadioList.js +483 -544
  54. package/Resize.js +530 -623
  55. package/ResultsMenu.js +494 -597
  56. package/ScreenReaderContent.js +142 -187
  57. package/Scroll.js +595 -598
  58. package/ScrollContainerContext.js +197 -278
  59. package/Search.js +745 -817
  60. package/Select.js +2441 -2746
  61. package/SidePanel.js +390 -392
  62. package/Slider.js +668 -825
  63. package/SlidingPanels.js +639 -645
  64. package/SplitButton.js +464 -499
  65. package/StaticContent.js +161 -217
  66. package/StepBar.js +386 -466
  67. package/Switch.js +710 -764
  68. package/TabBar.js +724 -815
  69. package/TabLayout.js +406 -438
  70. package/Table.js +4842 -5121
  71. package/Text.js +1169 -1351
  72. package/TextArea.js +1097 -1307
  73. package/Tooltip.js +624 -721
  74. package/TransitionOpen.js +489 -546
  75. package/Typography.js +176 -229
  76. package/WaitSpinner.js +230 -298
  77. package/package.json +14 -15
  78. package/stubs-splunkui.d.ts +4 -1
  79. package/types/src/ComboBox/Option.d.ts +1 -1
  80. package/types/src/Concertina/Concertina.d.ts +4 -0
  81. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  82. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  83. package/types/src/Link/Link.d.ts +7 -3
  84. package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
  85. package/types/src/Markdown/Markdown.d.ts +1 -1
  86. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
  87. package/types/src/Menu/Item.d.ts +1 -1
  88. package/types/src/Menu/Menu.d.ts +1 -0
  89. package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
  90. package/types/src/Multiselect/Option.d.ts +1 -1
  91. package/types/src/Search/Option.d.ts +1 -1
  92. package/types/src/Select/Option.d.ts +1 -1
  93. package/types/src/Select/OptionBase.d.ts +1 -1
  94. package/types/src/fixtures/FetchOptions.d.ts +2 -8
  95. package/useForceUpdate.js +112 -146
  96. package/useKeyPress.js +74 -128
  97. package/usePrevious.js +65 -129
  98. package/useRovingFocus.js +122 -218
  99. package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
  100. /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
  101. /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/Monogram.js CHANGED
@@ -1,374 +1,314 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 226);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("@splunk/themes");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, exports) {
99
-
100
- module.exports = require("prop-types");
101
-
102
- /***/ }),
103
-
104
- /***/ 12:
105
- /***/ (function(module, exports) {
106
-
107
- module.exports = require("@splunk/react-ui/Clickable");
108
-
109
- /***/ }),
110
-
111
- /***/ 2:
112
- /***/ (function(module, exports) {
113
-
114
- module.exports = require("react");
115
-
116
- /***/ }),
117
-
118
- /***/ 226:
119
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
120
-
121
- "use strict";
122
- // ESM COMPAT FLAG
123
- __webpack_require__.r(__webpack_exports__);
124
-
125
- // EXPORTS
126
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ Monogram_Monogram; });
127
- __webpack_require__.d(__webpack_exports__, "getInitials", function() { return /* reexport */ getInitials; });
128
-
129
- // EXTERNAL MODULE: external "react"
130
- var external_react_ = __webpack_require__(2);
131
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
132
-
133
- // EXTERNAL MODULE: external "prop-types"
134
- var external_prop_types_ = __webpack_require__(1);
135
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
136
-
137
- // EXTERNAL MODULE: external "lodash/omit"
138
- var omit_ = __webpack_require__(5);
139
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
140
-
141
- // EXTERNAL MODULE: external "styled-components"
142
- var external_styled_components_ = __webpack_require__(3);
143
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
144
-
145
- // EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
146
- var Clickable_ = __webpack_require__(12);
147
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
148
-
149
- // EXTERNAL MODULE: external "@splunk/themes"
150
- var themes_ = __webpack_require__(0);
151
-
152
- // CONCATENATED MODULE: ./src/Monogram/MonogramStyles.ts
153
-
154
-
155
- // Thanks: https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0
156
-
157
- var hashCode = function hashCode(input) {
158
- var hash = 0;
159
-
160
- for (var i = 0; i < input.length;) {
161
- hash = (hash << 5) - hash + input.charCodeAt(i++) | 0; // eslint-disable-line no-bitwise, no-plusplus
162
- }
163
-
164
- return hash;
165
- };
166
-
167
- var backgroundColors = ['#006d9c', '#ec9960', '#af575a', '#62b3b2', '#4fa484', '#f8be34', '#5a4575', '#708794', '#294e70', '#b6c75a', '#5cc05c', '#007abd', '#dc4e41', '#f1813f', '#f8be34', '#53a051', '#006d9c', '#77d6d8', '#f589ad', '#6a2c5d'];
168
- var Styled = external_styled_components_default.a.div.withConfig({
169
- displayName: "MonogramStyles__Styled",
170
- componentId: "r5ud6k-0"
171
- })(["", ";align-items:center;justify-content:center;border-radius:50%;font-weight:normal;", " background-color:", ";", ";& + &{margin-left:4px;}"], themes_["mixins"].reset('inline-flex'), Object(themes_["pick"])({
172
- prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive)
173
- }), function (_ref) {
174
- var $backgroundColor = _ref.$backgroundColor,
175
- $initials = _ref.$initials;
176
-
177
- if ($backgroundColor === 'theme') {
178
- return Object(themes_["pick"])({
179
- enterprise: {
180
- dark: themes_["variables"].gray45,
181
- light: themes_["variables"].gray92
182
- },
183
- prisma: themes_["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
184
66
  });
185
- }
186
-
187
- if ($backgroundColor === 'auto') {
188
- return backgroundColors[hashCode($initials) % backgroundColors.length];
189
- }
190
-
191
- return $backgroundColor;
192
- }, function (_ref2) {
193
- var $size = _ref2.$size;
194
-
195
- if (typeof $size === 'number') {
196
- return Object(external_styled_components_["css"])(["height:", "px;width:", "px;"], $size, $size);
197
- }
198
-
199
- if (typeof $size === 'string') {
200
- return Object(themes_["pickVariant"])('$size', {
201
- small: Object(external_styled_components_["css"])(["font-size:", ";", ""], themes_["variables"].fontSize, Object(themes_["pick"])({
202
- enterprise: Object(external_styled_components_["css"])(["height:32px;width:32px;"]),
203
- prisma: Object(external_styled_components_["css"])(["height:24px;width:24px;"])
204
- })),
205
- medium: Object(external_styled_components_["css"])(["height:48px;width:48px;font-size:", ";"], themes_["variables"].fontSize),
206
- large: Object(external_styled_components_["css"])(["height:80px;width:80px;font-size:", ";"], themes_["variables"].fontSizeXXLarge),
207
- xlarge: Object(external_styled_components_["css"])(["width:144px;height:144px;font-size:36px;font-weight:700;"])
208
- });
209
- }
210
-
211
- return Object(external_styled_components_["css"])(["height:48px;width:48px;font-size:", ";"], themes_["variables"].fontSize);
212
- });
213
- var StyledClickableComponent = Styled.withComponent(Clickable_default.a);
214
- var StyledClickable = external_styled_components_default()(StyledClickableComponent).withConfig({
215
- displayName: "MonogramStyles__StyledClickable",
216
- componentId: "r5ud6k-1"
217
- })(["cursor:pointer;position:relative;:focus,:hover{", "}:focus{box-shadow:", ";z-index:1;}:active{", "}"], Object(themes_["pick"])({
218
- enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadowInset),
219
- prisma: Object(external_styled_components_["css"])(["border:1px solid transparent;background-color:", ";"], themes_["variables"].neutral200)
220
- }), Object(themes_["pick"])({
221
- enterprise: themes_["variables"].focusShadowInset,
222
- prisma: themes_["variables"].focusShadow
223
- }), Object(themes_["pick"])({
224
- enterprise: Object(external_styled_components_["css"])(["opacity:0.85;"]),
225
- prisma: Object(external_styled_components_["css"])(["border:1px solid transparent;background-color:", ";opacity:1;"], themes_["variables"].neutral200)
226
- }));
227
- var Initials = external_styled_components_default.a.span.withConfig({
228
- displayName: "MonogramStyles__Initials",
229
- componentId: "r5ud6k-2"
230
- })(["opacity:0.8;text-transform:capitalize;"]);
231
-
232
- // CONCATENATED MODULE: ./src/Monogram/Monogram.tsx
233
- 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); }
234
-
235
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
236
-
237
- 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."); }
238
-
239
- 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); }
240
-
241
- 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; }
242
-
243
- 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; }
244
-
245
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
246
-
247
- 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; }
248
-
249
- 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; }
250
-
251
-
252
-
253
-
254
-
255
- var propTypes = {
256
- backgroundColor: external_prop_types_default.a.string,
257
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
258
- initials: external_prop_types_default.a.string.isRequired,
259
- name: external_prop_types_default.a.string,
260
- onClick: external_prop_types_default.a.func,
261
- size: external_prop_types_default.a.oneOfType([external_prop_types_default.a.oneOf(['small', 'medium', 'large', 'xlarge']), external_prop_types_default.a.number])
262
- };
263
- var defaultProps = {
264
- backgroundColor: 'theme',
265
- size: 'medium'
266
- };
267
-
268
- function isInteractive(props) {
269
- return !!props.onClick;
270
- }
271
- /**
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
+ /**
272
258
  * Returns a suitable set of initials for a name. Uses the first character of each
273
259
  * name segment and omits middle segments if the segment count is greater than three.
274
260
  * @param {string} name - The full name.
275
261
  * @returns {string} Limited to three characters. Empty if `name` is empty.
276
262
  * @public
277
- */
278
-
279
-
280
- function getInitials(name) {
281
- var initials = (name.match(/[^\s-]+/g) || []).map(function (segment) {
282
- return segment[0];
283
- }).join('');
284
- return initials.length > 3 ? "".concat(initials[0]).concat(initials[initials.length - 1]) : initials;
285
- }
286
-
287
- function getSharedProps(props) {
288
- var backgroundColor = props.backgroundColor,
289
- initials = props.initials,
290
- size = props.size,
291
- otherProps = _objectWithoutProperties(props, ["backgroundColor", "initials", "size"]);
292
-
293
- var sharedProps = {
294
- 'data-test': 'monogram',
295
- $backgroundColor: backgroundColor,
296
- $initials: initials,
297
- $size: size
298
- };
299
- return [sharedProps, otherProps];
300
- }
301
-
302
- function MonogramInteractive(props) {
303
- var _getSharedProps = getSharedProps(props),
304
- _getSharedProps2 = _slicedToArray(_getSharedProps, 2),
305
- sharedProps = _getSharedProps2[0],
306
- ownProps = _getSharedProps2[1];
307
-
308
- var children = ownProps.children,
309
- elementRef = ownProps.elementRef,
310
- name = ownProps.name,
311
- onClick = ownProps.onClick,
312
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef", "name", "onClick"]);
313
-
314
- var handleClick = Object(external_react_["useCallback"])(function (e) {
315
- onClick(e, {
316
- name: name
317
- });
318
- }, [onClick, name]);
319
- return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({
320
- elementRef: elementRef,
321
- onClick: handleClick
322
- }, sharedProps, omit_default()(otherProps, Object.keys(propTypes))), children);
323
- }
324
-
325
- function MonogramNonInteractive(props) {
326
- var _getSharedProps3 = getSharedProps(props),
327
- _getSharedProps4 = _slicedToArray(_getSharedProps3, 2),
328
- sharedProps = _getSharedProps4[0],
329
- ownProps = _getSharedProps4[1];
330
-
331
- var children = ownProps.children,
332
- elementRef = ownProps.elementRef,
333
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef"]);
334
-
335
- return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
336
- ref: elementRef
337
- }, sharedProps, omit_default()(otherProps, Object.keys(propTypes))), children);
338
- }
339
-
340
- function Monogram(props) {
341
- // @docs-props-type MonogramPropsBase
342
- if (false) {}
343
-
344
- var children = /*#__PURE__*/external_react_default.a.createElement(Initials, {
345
- "data-test": "initials"
346
- }, props.initials);
347
- return isInteractive(props) ? /*#__PURE__*/external_react_default.a.createElement(MonogramInteractive, props, children) : /*#__PURE__*/external_react_default.a.createElement(MonogramNonInteractive, props, children);
348
- }
349
-
350
- Monogram.propTypes = propTypes;
351
- Monogram.defaultProps = defaultProps;
352
- /* harmony default export */ var Monogram_Monogram = (Monogram);
353
-
354
- // CONCATENATED MODULE: ./src/Monogram/index.ts
355
-
356
-
357
-
358
- /***/ }),
359
-
360
- /***/ 3:
361
- /***/ (function(module, exports) {
362
-
363
- module.exports = require("styled-components");
364
-
365
- /***/ }),
366
-
367
- /***/ 5:
368
- /***/ (function(module, exports) {
369
-
370
- module.exports = require("lodash/omit");
371
-
372
- /***/ })
373
-
374
- /******/ });
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
+ /******/})();