@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/Chip.js CHANGED
@@ -1,619 +1,516 @@
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 = 217);
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
- /***/ 217:
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 */ Chip_Chip; });
127
-
128
- // EXTERNAL MODULE: external "react"
129
- var external_react_ = __webpack_require__(2);
130
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
131
-
132
- // EXTERNAL MODULE: external "lodash/omit"
133
- var omit_ = __webpack_require__(5);
134
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
135
-
136
- // EXTERNAL MODULE: external "prop-types"
137
- var external_prop_types_ = __webpack_require__(1);
138
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
139
-
140
- // EXTERNAL MODULE: external "@splunk/react-icons/Cross"
141
- var Cross_ = __webpack_require__(26);
142
- var Cross_default = /*#__PURE__*/__webpack_require__.n(Cross_);
143
-
144
- // EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close"
145
- var Close_ = __webpack_require__(27);
146
- var Close_default = /*#__PURE__*/__webpack_require__.n(Close_);
147
-
148
- // EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
149
- var i18n_ = __webpack_require__(4);
150
-
151
- // EXTERNAL MODULE: external "@splunk/ui-utils/color"
152
- var color_ = __webpack_require__(50);
153
-
154
- // EXTERNAL MODULE: external "@splunk/themes"
155
- var themes_ = __webpack_require__(0);
156
-
157
- // EXTERNAL MODULE: external "styled-components"
158
- var external_styled_components_ = __webpack_require__(3);
159
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
160
-
161
- // EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
162
- var Clickable_ = __webpack_require__(12);
163
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
164
-
165
- // CONCATENATED MODULE: ./src/Chip/ChipStyles.ts
166
-
167
-
168
-
169
- var StyledBasic = external_styled_components_default.a.div.withConfig({
170
- displayName: "ChipStyles__StyledBasic",
171
- componentId: "sc-1sd3tsh-0"
172
- })(["", ";background-color:", ";border:1px solid transparent;flex:0 1 auto;max-width:calc(100% - 3px);border-radius:2px;", ";", " ", " ", ""], themes_["mixins"].reset('inline-flex'), Object(themes_["pickVariant"])('$appearance', {
173
- "default": {
174
- enterprise: {
175
- dark: themes_["variables"].gray45,
176
- light: themes_["variables"].gray92
177
- },
178
- prisma: themes_["variables"].neutral100
179
- },
180
- info: {
181
- enterprise: themes_["variables"].infoColorL30
182
- },
183
- success: {
184
- enterprise: themes_["variables"].successColorL30
185
- },
186
- warning: {
187
- enterprise: themes_["variables"].warningColorL30
188
- },
189
- error: {
190
- enterprise: themes_["variables"].errorColorL30,
191
- prisma: themes_["variables"].accentColorNegative
192
- },
193
- outline: {
194
- prisma: 'transparent'
195
- },
196
- custom: function custom(_ref) {
197
- var $backgroundColor = _ref.$backgroundColor;
198
- return $backgroundColor;
199
- }
200
- }), function (_ref2) {
201
- var $appearance = _ref2.$appearance;
202
- return $appearance === 'outline' && Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorder);
203
- }, Object(themes_["pick"])({
204
- enterprise: Object(external_styled_components_["css"])(["color:", ";line-height:", ";margin:0 2px 2px 0;"], themes_["variables"].textGray, themes_["variables"].lineHeight),
205
- prisma: Object(external_styled_components_["css"])(["color:", ";line-height:16px;margin:1px;"], function (_ref3) {
206
- var $appearance = _ref3.$appearance;
207
- return $appearance === 'error' ? themes_["variables"].contentColorInverted : themes_["variables"].contentColorDefault;
208
- })
209
- }), Object(themes_["pick"])({
210
- enterprise: {
211
- comfortable: Object(external_styled_components_["css"])(["height:calc(", " - 6px);padding:4px 7px;"], themes_["variables"].inputHeight),
212
- compact: Object(external_styled_components_["css"])(["height:calc(", " - 6px);padding:2px 4px;"], themes_["variables"].inputHeight)
213
- },
214
- prisma: {
215
- comfortable: Object(external_styled_components_["css"])(["height:calc(", " - 8px);padding:7px 7px;font-size:", ";"], themes_["variables"].inputHeight, themes_["variables"].fontSizeSmall),
216
- compact: Object(external_styled_components_["css"])(["height:calc(", " - 8px);padding:3px 7px;font-size:", ";"], themes_["variables"].inputHeight, themes_["variables"].fontSizeSmall)
217
- }
218
- }), function (_ref4) {
219
- var $disabled = _ref4.$disabled;
220
- return $disabled && Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pickVariant"])('$appearance', {
221
- "default": {
222
- enterprise: {
223
- dark: 'rgba(0, 0, 0, 0.15)',
224
- light: 'rgba(0, 0, 0, 0.05)'
225
- },
226
- prisma: themes_["variables"].interactiveColorBackgroundDisabled
227
- },
228
- info: {
229
- enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].infoColorL10, 0.3)
230
- },
231
- success: {
232
- enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].successColorL10, 0.3)
233
- },
234
- warning: {
235
- enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].warningColorL10, 0.3)
236
- },
237
- error: {
238
- enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].errorColorL10, 0.3),
239
- prisma: themes_["variables"].interactiveColorBackgroundDisabled
240
- },
241
- outline: {
242
- prisma: themes_["variables"].interactiveColorBackgroundDisabled
243
- },
244
- custom: {
245
- enterprise: {
246
- dark: 'rgba(0, 0, 0, 0.15)',
247
- light: 'rgba(0, 0, 0, 0.05)'
248
- },
249
- prisma: themes_["variables"].interactiveColorBackgroundDisabled
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 a = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
15
+ /******/;
16
+ e.d(a, {
17
+ a
18
+ });
19
+ /******/ return a;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (r, a) => {
27
+ /******/ for (var o in a) {
28
+ /******/ if (e.o(a, o) && !e.o(r, o)) {
29
+ /******/ Object.defineProperty(r, o, {
30
+ enumerable: true,
31
+ get: a[o]
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 */ V
65
+ });
66
+ // CONCATENATED MODULE: external "react"
67
+ const a = require("react");
68
+ var o = e.n(a);
69
+ // CONCATENATED MODULE: external "lodash/omit"
70
+ const n = require("lodash/omit");
71
+ var t = e.n(n);
72
+ // CONCATENATED MODULE: external "prop-types"
73
+ const i = require("prop-types");
74
+ var l = e.n(i);
75
+ // CONCATENATED MODULE: external "@splunk/react-icons/Cross"
76
+ const s = require("@splunk/react-icons/Cross");
77
+ var c = e.n(s);
78
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
79
+ const p = require("@splunk/react-icons/enterprise/Close");
80
+ var u = e.n(p);
81
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
82
+ const d = require("@splunk/ui-utils/i18n");
83
+ // CONCATENATED MODULE: external "@splunk/ui-utils/color"
84
+ const f = require("@splunk/ui-utils/color");
85
+ // CONCATENATED MODULE: external "@splunk/themes"
86
+ const v = require("@splunk/themes");
87
+ // CONCATENATED MODULE: external "styled-components"
88
+ const b = require("styled-components");
89
+ var g = e.n(b);
90
+ // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
91
+ const m = require("@splunk/react-ui/Clickable");
92
+ var h = e.n(m);
93
+ // CONCATENATED MODULE: ./src/Chip/ChipStyles.ts
94
+ var C = g().div.withConfig({
95
+ displayName: "ChipStyles__StyledBasic",
96
+ componentId: "sc-1sd3tsh-0"
97
+ })([ "", ";background-color:", ";border:1px solid transparent;flex:0 1 auto;max-width:calc(100% - 3px);border-radius:2px;", ";", " ", " ", "" ], v.mixins.reset("inline-flex"), (0,
98
+ v.pickVariant)("$appearance", {
99
+ default: {
100
+ enterprise: {
101
+ dark: v.variables.gray45,
102
+ light: v.variables.gray92
103
+ },
104
+ prisma: v.variables.neutral100
105
+ },
106
+ info: {
107
+ enterprise: v.variables.infoColorL30
108
+ },
109
+ success: {
110
+ enterprise: v.variables.successColorL30
111
+ },
112
+ warning: {
113
+ enterprise: v.variables.warningColorL30
114
+ },
115
+ error: {
116
+ enterprise: v.variables.errorColorL30,
117
+ prisma: v.variables.accentColorNegative
118
+ },
119
+ outline: {
120
+ prisma: "transparent"
121
+ },
122
+ custom: function e(r) {
123
+ var a = r.$backgroundColor;
124
+ return a;
125
+ }
126
+ }), (function(e) {
127
+ var r = e.$appearance;
128
+ return r === "outline" && (0, b.css)([ "border-color:", ";" ], v.variables.interactiveColorBorder);
129
+ }), (0, v.pick)({
130
+ enterprise: (0, b.css)([ "color:", ";line-height:", ";margin:0 2px 2px 0;" ], v.variables.textGray, v.variables.lineHeight),
131
+ prisma: (0, b.css)([ "color:", ";line-height:16px;margin:1px;" ], (function(e) {
132
+ var r = e.$appearance;
133
+ return r === "error" ? v.variables.contentColorInverted : v.variables.contentColorDefault;
134
+ }))
135
+ }), (0, v.pick)({
136
+ enterprise: {
137
+ comfortable: (0, b.css)([ "height:calc(", " - 6px);padding:4px 7px;" ], v.variables.inputHeight),
138
+ compact: (0, b.css)([ "height:calc(", " - 6px);padding:2px 4px;" ], v.variables.inputHeight)
139
+ },
140
+ prisma: {
141
+ comfortable: (0, b.css)([ "height:calc(", " - 8px);padding:7px 7px;font-size:", ";" ], v.variables.inputHeight, v.variables.fontSizeSmall),
142
+ compact: (0, b.css)([ "height:calc(", " - 8px);padding:3px 7px;font-size:", ";" ], v.variables.inputHeight, v.variables.fontSizeSmall)
143
+ }
144
+ }), (function(e) {
145
+ var r = e.$disabled;
146
+ return r && (0, b.css)([ "background-color:", ";" ], (0, v.pickVariant)("$appearance", {
147
+ default: {
148
+ enterprise: {
149
+ dark: "rgba(0, 0, 0, 0.15)",
150
+ light: "rgba(0, 0, 0, 0.05)"
151
+ },
152
+ prisma: v.variables.interactiveColorBackgroundDisabled
153
+ },
154
+ info: {
155
+ enterprise: v.mixins.colorWithAlpha(v.variables.infoColorL10, .3)
156
+ },
157
+ success: {
158
+ enterprise: v.mixins.colorWithAlpha(v.variables.successColorL10, .3)
159
+ },
160
+ warning: {
161
+ enterprise: v.mixins.colorWithAlpha(v.variables.warningColorL10, .3)
162
+ },
163
+ error: {
164
+ enterprise: v.mixins.colorWithAlpha(v.variables.errorColorL10, .3),
165
+ prisma: v.variables.interactiveColorBackgroundDisabled
166
+ },
167
+ outline: {
168
+ prisma: v.variables.interactiveColorBackgroundDisabled
169
+ },
170
+ custom: {
171
+ enterprise: {
172
+ dark: "rgba(0, 0, 0, 0.15)",
173
+ light: "rgba(0, 0, 0, 0.05)"
174
+ },
175
+ prisma: v.variables.interactiveColorBackgroundDisabled
176
+ }
177
+ }));
178
+ }));
179
+ var y = g()(C).withConfig({
180
+ displayName: "ChipStyles__Styled",
181
+ componentId: "sc-1sd3tsh-1"
182
+ })([ "align-items:center;" ]);
183
+ var x = g().div.withConfig({
184
+ displayName: "ChipStyles__StyledInner",
185
+ componentId: "sc-1sd3tsh-2"
186
+ })([ "", ";" ], (0, v.pick)({
187
+ enterprise: (0, b.css)([ "display:flex;max-width:100%;" ]),
188
+ prisma: (0, b.css)([ "display:grid;max-width:100%;height:16px;column-gap:", ";", ";" ], (0,
189
+ v.pick)({
190
+ prisma: {
191
+ compact: v.variables.spacingXSmall,
192
+ comfortable: v.variables.spacingSmall
193
+ }
194
+ }), (function(e) {
195
+ var r = e.$icon, a = e.$removable;
196
+ var o = (0, b.css)([ "grid-template-columns:1fr;" ]);
197
+ if (r && a) {
198
+ o = (0, b.css)([ "grid-template-columns:0fr 1fr 0fr;" ]);
199
+ } else if (r) {
200
+ o = (0, b.css)([ "grid-template-columns:0fr 1fr;" ]);
201
+ } else if (a) {
202
+ o = (0, b.css)([ "grid-template-columns:1fr 0fr;" ]);
203
+ }
204
+ return o;
205
+ }))
206
+ }));
207
+ var $ = g().div.withConfig({
208
+ displayName: "ChipStyles__StyledIcon",
209
+ componentId: "sc-1sd3tsh-3"
210
+ })([ "", ";margin-right:", ";color:", ";" ], (0, v.pick)({
211
+ prisma: {
212
+ compact: (0, b.css)([ "font-size:14px;display:inline-flex;svg{height:16px;vertical-align:baseline;}" ]),
213
+ comfortable: (0, b.css)([ "font-size:18px;display:inline-flex;align-self:center;svg{height:16px;vertical-align:baseline;}" ])
214
+ },
215
+ enterprise: (0, b.css)([ "flex:0 0 auto;" ])
216
+ }), (0, v.pick)({
217
+ enterprise: "3px"
218
+ }), (0, v.pickVariant)("$disabled", {
219
+ true: v.variables.contentColorDisabled,
220
+ false: {
221
+ enterprise: function e(r) {
222
+ var a = r.$foregroundColor;
223
+ return a || v.variables.contentColorDefault;
224
+ },
225
+ prisma: function e(r) {
226
+ var a = r.$foregroundColor, o = r.$appearance;
227
+ return a || (o === "error" ? v.variables.contentColorInverted : v.variables.contentColorDefault);
228
+ }
229
+ }
230
+ }));
231
+ var k = g().div.withConfig({
232
+ displayName: "ChipStyles__StyledLabel",
233
+ componentId: "sc-1sd3tsh-4"
234
+ })([ "", " ", ";color:", ";" ], v.mixins.ellipsis(), (0, v.pick)({
235
+ enterprise: (0, b.css)([ "flex:0 1 auto;" ])
236
+ }), (0, v.pickVariant)("$disabled", {
237
+ true: v.variables.contentColorDisabled,
238
+ false: {
239
+ enterprise: function e(r) {
240
+ var a = r.$appearance, o = r.$foregroundColor;
241
+ return o || (a === "default" || a === "outline" ? v.variables.contentColorDefault : v.variables.gray30);
242
+ },
243
+ prisma: function e(r) {
244
+ var a = r.$appearance, o = r.$foregroundColor;
245
+ return o || (a === "error" ? v.variables.contentColorInverted : v.variables.contentColorActive);
246
+ }
247
+ }
248
+ }));
249
+ var S = g().span.withConfig({
250
+ displayName: "ChipStyles__StyledRemove",
251
+ componentId: "sc-1sd3tsh-5"
252
+ })([ "", ";" ], (0, v.pick)({
253
+ enterprise: (0, b.css)([ "flex:0 0 auto;padding-left:", ";font-size:", ";color:", ";" ], v.variables.spacingQuarter, (0,
254
+ v.pick)({
255
+ compact: "9px",
256
+ comfortable: "10.5px"
257
+ }), (0, v.pickVariant)("$disabled", {
258
+ true: v.variables.contentColorDisabled,
259
+ false: {
260
+ enterprise: function e(r) {
261
+ var a = r.$foregroundColor, o = r.$appearance;
262
+ return a || (o === "default" || o === "outline" ? v.variables.textGray : v.variables.gray30);
263
+ }
264
+ }
265
+ })),
266
+ prisma: (0, b.css)([ "font-size:", ";display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:12px;font-size:9px;color:", ";" ], (0,
267
+ v.pick)({
268
+ compact: "9px",
269
+ comfortable: "10.5px"
270
+ }), (function(e) {
271
+ var r = e.$disabled, a = e.$foregroundColor;
272
+ return r ? v.variables.contentColorDisabled : a || "inherit";
273
+ }))
274
+ }));
275
+ var w = g()(C.withComponent(h())).withConfig({
276
+ displayName: "ChipStyles__StyledClickable",
277
+ componentId: "sc-1sd3tsh-6"
278
+ })([ "flex:0 1 auto;line-height:16px;cursor:pointer;&:focus{", ";}&:not([disabled]):hover{", ";}", ";" ], (0,
279
+ v.pick)({
280
+ enterprise: (0, b.css)([ "box-shadow:", ";color:", ";" ], v.variables.focusShadow, v.variables.linkColor),
281
+ prisma: (0, b.css)([ "color:", ";", "{background-color:", ";box-shadow:0 0 0 3px ", ";}" ], v.variables.contentColorActive,
282
+ /* sc-sel */
283
+ S, v.variables.interactiveColorOverlayHover, v.variables.focusColor)
284
+ }), (0, v.pick)({
285
+ enterprise: (0, b.css)([ "background-color:", ";", "{color:", ";}" ], (0, v.pickVariant)("$appearance", {
286
+ default: {
287
+ dark: v.variables.gray30,
288
+ light: v.variables.gray96
289
+ },
290
+ info: v.variables.infoColorL20,
291
+ success: v.variables.successColorL20,
292
+ warning: v.variables.warningColorL20,
293
+ error: v.variables.errorColorL20,
294
+ custom: {
295
+ dark: v.variables.gray30,
296
+ light: v.variables.gray96
297
+ }
298
+ }),
299
+ /* sc-sel */
300
+ S, (function(e) {
301
+ var r = e.$foregroundColor;
302
+ return r || v.variables.linkColor;
303
+ })),
304
+ prisma: (0, b.css)([ "color:", ";", "{background-color:", ";", ";}" ], v.variables.contentColorActive,
305
+ /* sc-sel */
306
+ S, v.variables.interactiveColorOverlayHover, (function(e) {
307
+ var r = e.$appearance;
308
+ return r === "error" && (0, b.css)([ "color:", ";" ], v.variables.contentColorInverted);
309
+ }))
310
+ }), (0, v.pick)({
311
+ prisma: (0, b.css)([ "&:not([disabled]):active ", "{background-color:", ";}" ],
312
+ /* sc-sel */
313
+ S, v.variables.interactiveColorOverlayActive)
314
+ }));
315
+ // CONCATENATED MODULE: ./src/Chip/Chip.tsx
316
+ function O() {
317
+ O = Object.assign || function(e) {
318
+ for (var r = 1; r < arguments.length; r++) {
319
+ var a = arguments[r];
320
+ for (var o in a) {
321
+ if (Object.prototype.hasOwnProperty.call(a, o)) {
322
+ e[o] = a[o];
323
+ }
324
+ }
325
+ }
326
+ return e;
327
+ };
328
+ return O.apply(this, arguments);
250
329
  }
251
- }));
252
- });
253
- var Styled = external_styled_components_default()(StyledBasic).withConfig({
254
- displayName: "ChipStyles__Styled",
255
- componentId: "sc-1sd3tsh-1"
256
- })(["align-items:center;"]);
257
- var StyledInner = external_styled_components_default.a.div.withConfig({
258
- displayName: "ChipStyles__StyledInner",
259
- componentId: "sc-1sd3tsh-2"
260
- })(["", ";"], Object(themes_["pick"])({
261
- enterprise: Object(external_styled_components_["css"])(["display:flex;max-width:100%;"]),
262
- prisma: Object(external_styled_components_["css"])(["display:grid;max-width:100%;height:16px;column-gap:", ";", ";"], Object(themes_["pick"])({
263
- prisma: {
264
- compact: themes_["variables"].spacingXSmall,
265
- comfortable: themes_["variables"].spacingSmall
330
+ function _(e, r) {
331
+ return q(e) || E(e, r) || j(e, r) || R();
266
332
  }
267
- }), function (_ref5) {
268
- var $icon = _ref5.$icon,
269
- $removable = _ref5.$removable;
270
- var gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:1fr;"]);
271
-
272
- if ($icon && $removable) {
273
- gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:0fr 1fr 0fr;"]);
274
- } else if ($icon) {
275
- gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:0fr 1fr;"]);
276
- } else if ($removable) {
277
- gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:1fr 0fr;"]);
333
+ function R() {
334
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
278
335
  }
279
-
280
- return gridColumns;
281
- })
282
- }));
283
- var StyledIcon = external_styled_components_default.a.div.withConfig({
284
- displayName: "ChipStyles__StyledIcon",
285
- componentId: "sc-1sd3tsh-3"
286
- })(["", ";margin-right:", ";color:", ";"], Object(themes_["pick"])({
287
- prisma: {
288
- compact: Object(external_styled_components_["css"])(["font-size:14px;display:inline-flex;svg{height:16px;vertical-align:baseline;}"]),
289
- comfortable: Object(external_styled_components_["css"])(["font-size:18px;display:inline-flex;align-self:center;svg{height:16px;vertical-align:baseline;}"])
290
- },
291
- enterprise: Object(external_styled_components_["css"])(["flex:0 0 auto;"])
292
- }), Object(themes_["pick"])({
293
- enterprise: '3px'
294
- }), Object(themes_["pickVariant"])('$disabled', {
295
- "true": themes_["variables"].contentColorDisabled,
296
- "false": {
297
- enterprise: function enterprise(_ref6) {
298
- var $foregroundColor = _ref6.$foregroundColor;
299
- return $foregroundColor || themes_["variables"].contentColorDefault;
300
- },
301
- prisma: function prisma(_ref7) {
302
- var $foregroundColor = _ref7.$foregroundColor,
303
- $appearance = _ref7.$appearance;
304
- return $foregroundColor || ($appearance === 'error' ? themes_["variables"].contentColorInverted : themes_["variables"].contentColorDefault);
336
+ function j(e, r) {
337
+ if (!e) return;
338
+ if (typeof e === "string") return I(e, r);
339
+ var a = Object.prototype.toString.call(e).slice(8, -1);
340
+ if (a === "Object" && e.constructor) a = e.constructor.name;
341
+ if (a === "Map" || a === "Set") return Array.from(e);
342
+ if (a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)) return I(e, r);
305
343
  }
306
- }
307
- }));
308
- var StyledLabel = external_styled_components_default.a.div.withConfig({
309
- displayName: "ChipStyles__StyledLabel",
310
- componentId: "sc-1sd3tsh-4"
311
- })(["", " ", ";color:", ";"], themes_["mixins"].ellipsis(), Object(themes_["pick"])({
312
- enterprise: Object(external_styled_components_["css"])(["flex:0 1 auto;"])
313
- }), Object(themes_["pickVariant"])('$disabled', {
314
- "true": themes_["variables"].contentColorDisabled,
315
- "false": {
316
- enterprise: function enterprise(_ref8) {
317
- var $appearance = _ref8.$appearance,
318
- $foregroundColor = _ref8.$foregroundColor;
319
- return $foregroundColor || ($appearance === 'default' || $appearance === 'outline' ? themes_["variables"].contentColorDefault : themes_["variables"].gray30);
320
- },
321
- prisma: function prisma(_ref9) {
322
- var $appearance = _ref9.$appearance,
323
- $foregroundColor = _ref9.$foregroundColor;
324
- return $foregroundColor || ($appearance === 'error' ? themes_["variables"].contentColorInverted : themes_["variables"].contentColorActive);
344
+ function I(e, r) {
345
+ if (r == null || r > e.length) r = e.length;
346
+ for (var a = 0, o = new Array(r); a < r; a++) {
347
+ o[a] = e[a];
348
+ }
349
+ return o;
325
350
  }
326
- }
327
- }));
328
- var StyledRemove = external_styled_components_default.a.span.withConfig({
329
- displayName: "ChipStyles__StyledRemove",
330
- componentId: "sc-1sd3tsh-5"
331
- })(["", ";"], Object(themes_["pick"])({
332
- enterprise: Object(external_styled_components_["css"])(["flex:0 0 auto;padding-left:", ";font-size:", ";color:", ";"], themes_["variables"].spacingQuarter, Object(themes_["pick"])({
333
- compact: '9px',
334
- comfortable: '10.5px'
335
- }), Object(themes_["pickVariant"])('$disabled', {
336
- "true": themes_["variables"].contentColorDisabled,
337
- "false": {
338
- enterprise: function enterprise(_ref10) {
339
- var $foregroundColor = _ref10.$foregroundColor,
340
- $appearance = _ref10.$appearance;
341
- return $foregroundColor || ($appearance === 'default' || $appearance === 'outline' ? themes_["variables"].textGray : themes_["variables"].gray30);
342
- }
351
+ function E(e, r) {
352
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
353
+ var a = [];
354
+ var o = true;
355
+ var n = false;
356
+ var t = undefined;
357
+ try {
358
+ for (var i = e[Symbol.iterator](), l; !(o = (l = i.next()).done); o = true) {
359
+ a.push(l.value);
360
+ if (r && a.length === r) break;
361
+ }
362
+ } catch (e) {
363
+ n = true;
364
+ t = e;
365
+ } finally {
366
+ try {
367
+ if (!o && i["return"] != null) i["return"]();
368
+ } finally {
369
+ if (n) throw t;
370
+ }
371
+ }
372
+ return a;
343
373
  }
344
- })),
345
- prisma: Object(external_styled_components_["css"])(["font-size:", ";display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:12px;font-size:9px;color:", ";"], Object(themes_["pick"])({
346
- compact: '9px',
347
- comfortable: '10.5px'
348
- }), function (_ref11) {
349
- var $disabled = _ref11.$disabled,
350
- $foregroundColor = _ref11.$foregroundColor;
351
- return $disabled ? themes_["variables"].contentColorDisabled : $foregroundColor || 'inherit';
352
- })
353
- }));
354
- var StyledClickable = external_styled_components_default()(StyledBasic.withComponent(Clickable_default.a)).withConfig({
355
- displayName: "ChipStyles__StyledClickable",
356
- componentId: "sc-1sd3tsh-6"
357
- })(["flex:0 1 auto;line-height:16px;cursor:pointer;&:focus{", ";}&:not([disabled]):hover{", ";}", ";"], Object(themes_["pick"])({
358
- enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].linkColor),
359
- prisma: Object(external_styled_components_["css"])(["color:", ";", "{background-color:", ";box-shadow:0 0 0 3px ", ";}"], themes_["variables"].contentColorActive,
360
- /* sc-sel */
361
- StyledRemove, themes_["variables"].interactiveColorOverlayHover, themes_["variables"].focusColor)
362
- }), Object(themes_["pick"])({
363
- enterprise: Object(external_styled_components_["css"])(["background-color:", ";", "{color:", ";}"], Object(themes_["pickVariant"])('$appearance', {
364
- "default": {
365
- dark: themes_["variables"].gray30,
366
- light: themes_["variables"].gray96
367
- },
368
- info: themes_["variables"].infoColorL20,
369
- success: themes_["variables"].successColorL20,
370
- warning: themes_["variables"].warningColorL20,
371
- error: themes_["variables"].errorColorL20,
372
- custom: {
373
- dark: themes_["variables"].gray30,
374
- light: themes_["variables"].gray96
374
+ function q(e) {
375
+ if (Array.isArray(e)) return e;
375
376
  }
376
- }),
377
- /* sc-sel */
378
- StyledRemove, function (_ref12) {
379
- var $foregroundColor = _ref12.$foregroundColor;
380
- return $foregroundColor || themes_["variables"].linkColor;
381
- }),
382
- prisma: Object(external_styled_components_["css"])(["color:", ";", "{background-color:", ";", ";}"], themes_["variables"].contentColorActive,
383
- /* sc-sel */
384
- StyledRemove, themes_["variables"].interactiveColorOverlayHover, function (_ref13) {
385
- var $appearance = _ref13.$appearance;
386
- return $appearance === 'error' && Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorInverted);
387
- })
388
- }), Object(themes_["pick"])({
389
- prisma: Object(external_styled_components_["css"])(["&:not([disabled]):active ", "{background-color:", ";}"],
390
- /* sc-sel */
391
- StyledRemove, themes_["variables"].interactiveColorOverlayActive)
392
- }));
393
-
394
- // CONCATENATED MODULE: ./src/Chip/Chip.tsx
395
- 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); }
396
-
397
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
398
-
399
- 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."); }
400
-
401
- 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); }
402
-
403
- 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; }
404
-
405
- 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; }
406
-
407
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
408
-
409
- 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; }
410
-
411
- 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; }
412
-
413
-
414
-
415
-
416
-
417
-
418
-
419
-
420
-
421
-
422
- var propTypes = {
423
- appearance: external_prop_types_default.a.oneOf(['info', 'success', 'warning', 'error', 'outline']),
424
- backgroundColor: external_prop_types_default.a.string,
425
- children: external_prop_types_default.a.node.isRequired,
426
- disabled: external_prop_types_default.a.bool,
427
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
428
- foregroundColor: external_prop_types_default.a.string,
429
- icon: external_prop_types_default.a.node,
430
- onRequestRemove: external_prop_types_default.a.func,
431
-
432
- /** Includes this value in `onRequestRemove` callbacks. */
433
- value: external_prop_types_default.a.any
434
- };
435
- var defaultProps = {
436
- disabled: false
437
- };
438
-
439
- function isInteractive(props) {
440
- return !!props.onRequestRemove;
441
- }
442
-
443
- function getSharedProps(props) {
444
- var appearance = props.appearance,
445
- backgroundColor = props.backgroundColor,
446
- disabled = props.disabled,
447
- foregroundColor = props.foregroundColor,
448
- icon = props.icon,
449
- otherProps = _objectWithoutProperties(props, ["appearance", "backgroundColor", "disabled", "foregroundColor", "icon"]); // Validate that the color being rendered into the CSS is restricted to only values that are of CSS type <color>.
450
-
451
-
452
- var $foregroundColor = foregroundColor && Object(color_["isCSSColor"])(foregroundColor) ? foregroundColor : undefined;
453
- var $backgroundColor = backgroundColor && Object(color_["isCSSColor"])(backgroundColor) ? backgroundColor : undefined;
454
- var sharedProps = {
455
- 'data-test': 'chip',
456
- $appearance: appearance || ($backgroundColor ? 'custom' : 'default'),
457
- $backgroundColor: $backgroundColor,
458
- $foregroundColor: $foregroundColor,
459
- disabled: disabled,
460
- icon: icon
461
- };
462
- return [sharedProps, otherProps];
463
- }
464
-
465
- function ChipInteractive(props) {
466
- var _getSharedProps = getSharedProps(props),
467
- _getSharedProps2 = _slicedToArray(_getSharedProps, 2),
468
- sharedProps = _getSharedProps2[0],
469
- ownProps = _getSharedProps2[1];
470
-
471
- var $appearance = sharedProps.$appearance,
472
- $foregroundColor = sharedProps.$foregroundColor,
473
- disabled = sharedProps.disabled,
474
- icon = sharedProps.icon,
475
- otherSharedProps = _objectWithoutProperties(sharedProps, ["$appearance", "$foregroundColor", "disabled", "icon"]);
476
-
477
- var children = ownProps.children,
478
- elementRef = ownProps.elementRef,
479
- onRequestRemove = ownProps.onRequestRemove,
480
- value = ownProps.value,
481
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef", "onRequestRemove", "value"]);
482
-
483
- var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
484
- isEnterprise = _useSplunkTheme.isEnterprise;
485
-
486
- var handleRemoveClick = Object(external_react_["useCallback"])(function (e) {
487
- onRequestRemove(e, {
488
- value: value
489
- });
490
- }, [onRequestRemove, value]);
491
- return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({
492
- $appearance: $appearance,
493
- $disabled: disabled,
494
- $foregroundColor: $foregroundColor,
495
- "data-test-value": value,
496
- disabled: disabled,
497
- elementRef: elementRef,
498
- onClick: handleRemoveClick
499
- }, otherSharedProps, omit_default()(otherProps, Object.keys(propTypes))), /*#__PURE__*/external_react_default.a.createElement(StyledInner, {
500
- $icon: !!icon,
501
- $removable: true
502
- }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, {
503
- $appearance: $appearance,
504
- $disabled: disabled,
505
- $foregroundColor: $foregroundColor
506
- }, icon), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
507
- "data-test": "label",
508
- $appearance: $appearance,
509
- $disabled: disabled,
510
- $foregroundColor: $foregroundColor
511
- }, children), /*#__PURE__*/external_react_default.a.createElement(StyledRemove, {
512
- $appearance: $appearance,
513
- $disabled: disabled,
514
- $foregroundColor: $foregroundColor
515
- }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, {
516
- "data-test": "cross",
517
- hideDefaultTooltip: true,
518
- screenReaderText: Object(i18n_["_"])('Remove'),
519
- size: 0.85
520
- }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, {
521
- "aria-label": Object(i18n_["_"])('Remove'),
522
- "data-test": "cross",
523
- height: "20px",
524
- width: "20px"
525
- }))));
526
- }
527
-
528
- function ChipNonInteractive(props) {
529
- var _getSharedProps3 = getSharedProps(props),
530
- _getSharedProps4 = _slicedToArray(_getSharedProps3, 2),
531
- sharedProps = _getSharedProps4[0],
532
- ownProps = _getSharedProps4[1];
533
-
534
- var $appearance = sharedProps.$appearance,
535
- $foregroundColor = sharedProps.$foregroundColor,
536
- disabled = sharedProps.disabled,
537
- icon = sharedProps.icon,
538
- otherSharedProps = _objectWithoutProperties(sharedProps, ["$appearance", "$foregroundColor", "disabled", "icon"]);
539
-
540
- var children = ownProps.children,
541
- elementRef = ownProps.elementRef,
542
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef"]);
543
-
544
- return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
545
- $appearance: $appearance,
546
- $disabled: disabled,
547
- ref: elementRef
548
- }, otherSharedProps, omit_default()(otherProps, Object.keys(propTypes))), /*#__PURE__*/external_react_default.a.createElement(StyledInner, {
549
- $icon: !!icon,
550
- $removable: false
551
- }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, {
552
- $appearance: $appearance,
553
- $disabled: disabled,
554
- $foregroundColor: $foregroundColor
555
- }, icon), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
556
- "data-test": "label",
557
- $appearance: $appearance,
558
- $disabled: disabled,
559
- $foregroundColor: $foregroundColor
560
- }, children)));
561
- }
562
-
563
- function Chip(props) {
564
- // @docs-props-type ChipPropsBase
565
- return isInteractive(props) ? /*#__PURE__*/external_react_default.a.createElement(ChipInteractive, props) : /*#__PURE__*/external_react_default.a.createElement(ChipNonInteractive, props);
566
- }
567
-
568
- Chip.propTypes = propTypes;
569
- Chip.defaultProps = defaultProps;
570
- /* harmony default export */ var Chip_Chip = (Chip);
571
- // CONCATENATED MODULE: ./src/Chip/index.ts
572
-
573
-
574
-
575
- /***/ }),
576
-
577
- /***/ 26:
578
- /***/ (function(module, exports) {
579
-
580
- module.exports = require("@splunk/react-icons/Cross");
581
-
582
- /***/ }),
583
-
584
- /***/ 27:
585
- /***/ (function(module, exports) {
586
-
587
- module.exports = require("@splunk/react-icons/enterprise/Close");
588
-
589
- /***/ }),
590
-
591
- /***/ 3:
592
- /***/ (function(module, exports) {
593
-
594
- module.exports = require("styled-components");
595
-
596
- /***/ }),
597
-
598
- /***/ 4:
599
- /***/ (function(module, exports) {
600
-
601
- module.exports = require("@splunk/ui-utils/i18n");
602
-
603
- /***/ }),
604
-
605
- /***/ 5:
606
- /***/ (function(module, exports) {
607
-
608
- module.exports = require("lodash/omit");
609
-
610
- /***/ }),
611
-
612
- /***/ 50:
613
- /***/ (function(module, exports) {
614
-
615
- module.exports = require("@splunk/ui-utils/color");
616
-
617
- /***/ })
618
-
619
- /******/ });
377
+ function A(e, r) {
378
+ if (e == null) return {};
379
+ var a = D(e, r);
380
+ var o, n;
381
+ if (Object.getOwnPropertySymbols) {
382
+ var t = Object.getOwnPropertySymbols(e);
383
+ for (n = 0; n < t.length; n++) {
384
+ o = t[n];
385
+ if (r.indexOf(o) >= 0) continue;
386
+ if (!Object.prototype.propertyIsEnumerable.call(e, o)) continue;
387
+ a[o] = e[o];
388
+ }
389
+ }
390
+ return a;
391
+ }
392
+ function D(e, r) {
393
+ if (e == null) return {};
394
+ var a = {};
395
+ var o = Object.keys(e);
396
+ var n, t;
397
+ for (t = 0; t < o.length; t++) {
398
+ n = o[t];
399
+ if (r.indexOf(n) >= 0) continue;
400
+ a[n] = e[n];
401
+ }
402
+ return a;
403
+ }
404
+ var L = {
405
+ appearance: l().oneOf([ "info", "success", "warning", "error", "outline" ]),
406
+ backgroundColor: l().string,
407
+ children: l().node.isRequired,
408
+ disabled: l().bool,
409
+ elementRef: l().oneOfType([ l().func, l().object ]),
410
+ foregroundColor: l().string,
411
+ icon: l().node,
412
+ onRequestRemove: l().func,
413
+ /** Includes this value in `onRequestRemove` callbacks. */
414
+ value: l().any
415
+ };
416
+ var z = {
417
+ disabled: false
418
+ };
419
+ function N(e) {
420
+ return !!e.onRequestRemove;
421
+ }
422
+ function P(e) {
423
+ var r = e.appearance, a = e.backgroundColor, o = e.disabled, n = e.foregroundColor, t = e.icon, i = A(e, [ "appearance", "backgroundColor", "disabled", "foregroundColor", "icon" ]);
424
+ // Validate that the color being rendered into the CSS is restricted to only values that are of CSS type <color>.
425
+ var l = n && (0, f.isCSSColor)(n) ? n : undefined;
426
+ var s = a && (0, f.isCSSColor)(a) ? a : undefined;
427
+ var c = {
428
+ "data-test": "chip",
429
+ $appearance: r || (s ? "custom" : "default"),
430
+ $backgroundColor: s,
431
+ $foregroundColor: l,
432
+ disabled: o,
433
+ icon: t
434
+ };
435
+ return [ c, i ];
436
+ }
437
+ function T(e) {
438
+ var r = P(e), n = _(r, 2), i = n[0], l = n[1];
439
+ var s = i.$appearance, p = i.$foregroundColor, f = i.disabled, b = i.icon, g = A(i, [ "$appearance", "$foregroundColor", "disabled", "icon" ]);
440
+ var m = l.children, h = l.elementRef, C = l.onRequestRemove, y = l.value, R = A(l, [ "children", "elementRef", "onRequestRemove", "value" ]);
441
+ var j = (0, v.useSplunkTheme)(), I = j.isEnterprise;
442
+ var E = (0, a.useCallback)((function(e) {
443
+ C(e, {
444
+ value: y
445
+ });
446
+ }), [ C, y ]);
447
+
448
+ return o().createElement(w, O({
449
+ $appearance: s,
450
+ $disabled: f,
451
+ $foregroundColor: p,
452
+ "data-test-value": y,
453
+ disabled: f,
454
+ elementRef: h,
455
+ onClick: E
456
+ }, g, t()(R, Object.keys(L))), o().createElement(x, {
457
+ $icon: !!b,
458
+ $removable: true
459
+ }, b && o().createElement($, {
460
+ $appearance: s,
461
+ $disabled: f,
462
+ $foregroundColor: p
463
+ }, b), o().createElement(k, {
464
+ "data-test": "label",
465
+ $appearance: s,
466
+ $disabled: f,
467
+ $foregroundColor: p
468
+ }, m), o().createElement(S, {
469
+ $appearance: s,
470
+ $disabled: f,
471
+ $foregroundColor: p
472
+ }, I ? o().createElement(u(), {
473
+ "data-test": "cross",
474
+ hideDefaultTooltip: true,
475
+ screenReaderText: (0, d._)("Remove"),
476
+ size: .85
477
+ }) : o().createElement(c(), {
478
+ "aria-label": (0, d._)("Remove"),
479
+ "data-test": "cross",
480
+ height: "20px",
481
+ width: "20px"
482
+ }))));
483
+ }
484
+ function H(e) {
485
+ var r = P(e), a = _(r, 2), n = a[0], i = a[1];
486
+ var l = n.$appearance, s = n.$foregroundColor, c = n.disabled, p = n.icon, u = A(n, [ "$appearance", "$foregroundColor", "disabled", "icon" ]);
487
+ var d = i.children, f = i.elementRef, v = A(i, [ "children", "elementRef" ]);
488
+
489
+ return o().createElement(y, O({
490
+ $appearance: l,
491
+ $disabled: c,
492
+ ref: f
493
+ }, u, t()(v, Object.keys(L))), o().createElement(x, {
494
+ $icon: !!p,
495
+ $removable: false
496
+ }, p && o().createElement($, {
497
+ $appearance: l,
498
+ $disabled: c,
499
+ $foregroundColor: s
500
+ }, p), o().createElement(k, {
501
+ "data-test": "label",
502
+ $appearance: l,
503
+ $disabled: c,
504
+ $foregroundColor: s
505
+ }, d)));
506
+ }
507
+ function B(e) {
508
+ // @docs-props-type ChipPropsBase
509
+ return N(e) ? o().createElement(T, e) : o().createElement(H, e);
510
+ }
511
+ B.propTypes = L;
512
+ B.defaultProps = z;
513
+ /* harmony default export */ const V = B;
514
+ // CONCATENATED MODULE: ./src/Chip/index.ts
515
+ module.exports = r;
516
+ /******/})();