@splunk/react-ui 4.21.0 → 4.22.0

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 (92) 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 +24 -3
  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 +1807 -2084
  18. package/CollapsiblePanel.js +586 -519
  19. package/Color.js +1068 -1068
  20. package/ColumnLayout.js +402 -363
  21. package/ComboBox.js +903 -794
  22. package/Concertina.js +997 -802
  23. package/ControlGroup.js +687 -594
  24. package/Date.js +567 -547
  25. package/DefinitionList.js +308 -234
  26. package/Divider.js +149 -118
  27. package/Dropdown.js +459 -416
  28. package/DualListbox.js +1479 -1541
  29. package/EventListener.js +94 -97
  30. package/File.js +1051 -969
  31. package/FormRows.js +883 -696
  32. package/Heading.js +216 -193
  33. package/Image.js +446 -402
  34. package/JSONTree.js +690 -551
  35. package/Layer.js +437 -410
  36. package/Link.js +336 -255
  37. package/List.js +213 -161
  38. package/Markdown.js +509 -487
  39. package/Menu.js +1104 -1056
  40. package/Message.js +475 -441
  41. package/MessageBar.js +387 -373
  42. package/Modal.js +810 -634
  43. package/ModalLayer.js +326 -243
  44. package/Monogram.js +308 -276
  45. package/Multiselect.js +3564 -3364
  46. package/Number.js +729 -687
  47. package/Paginator.js +510 -449
  48. package/Paragraph.js +145 -112
  49. package/Popover.js +1459 -1432
  50. package/Progress.js +301 -246
  51. package/RadioBar.js +634 -527
  52. package/RadioList.js +483 -444
  53. package/Resize.js +530 -489
  54. package/ResultsMenu.js +479 -455
  55. package/ScreenReaderContent.js +142 -111
  56. package/Scroll.js +595 -456
  57. package/ScrollContainerContext.js +197 -206
  58. package/Search.js +756 -650
  59. package/Select.js +2446 -2345
  60. package/SidePanel.js +390 -284
  61. package/Slider.js +680 -676
  62. package/SlidingPanels.js +639 -503
  63. package/SplitButton.js +464 -367
  64. package/StaticContent.js +161 -133
  65. package/StepBar.js +386 -358
  66. package/Switch.js +710 -640
  67. package/TabBar.js +741 -680
  68. package/TabLayout.js +406 -322
  69. package/Table.js +4974 -4616
  70. package/Text.js +1170 -1138
  71. package/TextArea.js +1102 -1090
  72. package/Tooltip.js +624 -581
  73. package/TransitionOpen.js +489 -422
  74. package/Typography.js +176 -153
  75. package/WaitSpinner.js +230 -206
  76. package/package.json +7 -7
  77. package/types/src/Color/Color.d.ts +0 -1
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/types/src/RadioBar/RadioBar.d.ts +1 -0
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
  82. package/types/src/Select/docs/examples/Icons.d.ts +1 -9
  83. package/types/src/Slider/Slider.d.ts +1 -0
  84. package/types/src/TabBar/Tab.d.ts +10 -1
  85. package/types/src/TabBar/TabBar.d.ts +4 -2
  86. package/types/src/Table/Head.d.ts +7 -3
  87. package/types/src/Table/Table.d.ts +3 -2
  88. package/types/src/Table/TableContext.d.ts +2 -0
  89. package/useForceUpdate.js +112 -82
  90. package/useKeyPress.js +74 -71
  91. package/usePrevious.js +65 -65
  92. package/useRovingFocus.js +122 -138
package/Chip.js CHANGED
@@ -1,495 +1,516 @@
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 */ Chip_Chip)
55
- });
56
-
57
- ;// CONCATENATED MODULE: external "react"
58
- const external_react_namespaceObject = require("react");
59
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
60
- ;// CONCATENATED MODULE: external "lodash/omit"
61
- const omit_namespaceObject = require("lodash/omit");
62
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
63
- ;// CONCATENATED MODULE: external "prop-types"
64
- const external_prop_types_namespaceObject = require("prop-types");
65
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
66
- ;// CONCATENATED MODULE: external "@splunk/react-icons/Cross"
67
- const Cross_namespaceObject = require("@splunk/react-icons/Cross");
68
- var Cross_default = /*#__PURE__*/__webpack_require__.n(Cross_namespaceObject);
69
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
70
- const Close_namespaceObject = require("@splunk/react-icons/enterprise/Close");
71
- var Close_default = /*#__PURE__*/__webpack_require__.n(Close_namespaceObject);
72
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
73
- const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
74
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/color"
75
- const color_namespaceObject = require("@splunk/ui-utils/color");
76
- ;// CONCATENATED MODULE: external "@splunk/themes"
77
- const themes_namespaceObject = require("@splunk/themes");
78
- ;// CONCATENATED MODULE: external "styled-components"
79
- const external_styled_components_namespaceObject = require("styled-components");
80
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
81
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
82
- const Clickable_namespaceObject = require("@splunk/react-ui/Clickable");
83
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_namespaceObject);
84
- ;// CONCATENATED MODULE: ./src/Chip/ChipStyles.ts
85
-
86
-
87
-
88
- var StyledBasic = external_styled_components_default().div.withConfig({
89
- displayName: "ChipStyles__StyledBasic",
90
- componentId: "sc-1sd3tsh-0"
91
- })(["", ";background-color:", ";border:1px solid transparent;flex:0 1 auto;max-width:calc(100% - 3px);border-radius:2px;", ";", " ", " ", ""], themes_namespaceObject.mixins.reset('inline-flex'), (0,themes_namespaceObject.pickVariant)('$appearance', {
92
- "default": {
93
- enterprise: {
94
- dark: themes_namespaceObject.variables.gray45,
95
- light: themes_namespaceObject.variables.gray92
96
- },
97
- prisma: themes_namespaceObject.variables.neutral100
98
- },
99
- info: {
100
- enterprise: themes_namespaceObject.variables.infoColorL30
101
- },
102
- success: {
103
- enterprise: themes_namespaceObject.variables.successColorL30
104
- },
105
- warning: {
106
- enterprise: themes_namespaceObject.variables.warningColorL30
107
- },
108
- error: {
109
- enterprise: themes_namespaceObject.variables.errorColorL30,
110
- prisma: themes_namespaceObject.variables.accentColorNegative
111
- },
112
- outline: {
113
- prisma: 'transparent'
114
- },
115
- custom: function custom(_ref) {
116
- var $backgroundColor = _ref.$backgroundColor;
117
- return $backgroundColor;
118
- }
119
- }), function (_ref2) {
120
- var $appearance = _ref2.$appearance;
121
- return $appearance === 'outline' && (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.interactiveColorBorder);
122
- }, (0,themes_namespaceObject.pick)({
123
- enterprise: (0,external_styled_components_namespaceObject.css)(["color:", ";line-height:", ";margin:0 2px 2px 0;"], themes_namespaceObject.variables.textGray, themes_namespaceObject.variables.lineHeight),
124
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";line-height:16px;margin:1px;"], function (_ref3) {
125
- var $appearance = _ref3.$appearance;
126
- return $appearance === 'error' ? themes_namespaceObject.variables.contentColorInverted : themes_namespaceObject.variables.contentColorDefault;
127
- })
128
- }), (0,themes_namespaceObject.pick)({
129
- enterprise: {
130
- comfortable: (0,external_styled_components_namespaceObject.css)(["height:calc(", " - 6px);padding:4px 7px;"], themes_namespaceObject.variables.inputHeight),
131
- compact: (0,external_styled_components_namespaceObject.css)(["height:calc(", " - 6px);padding:2px 4px;"], themes_namespaceObject.variables.inputHeight)
132
- },
133
- prisma: {
134
- comfortable: (0,external_styled_components_namespaceObject.css)(["height:calc(", " - 8px);padding:7px 7px;font-size:", ";"], themes_namespaceObject.variables.inputHeight, themes_namespaceObject.variables.fontSizeSmall),
135
- compact: (0,external_styled_components_namespaceObject.css)(["height:calc(", " - 8px);padding:3px 7px;font-size:", ";"], themes_namespaceObject.variables.inputHeight, themes_namespaceObject.variables.fontSizeSmall)
136
- }
137
- }), function (_ref4) {
138
- var $disabled = _ref4.$disabled;
139
- return $disabled && (0,external_styled_components_namespaceObject.css)(["background-color:", ";"], (0,themes_namespaceObject.pickVariant)('$appearance', {
140
- "default": {
141
- enterprise: {
142
- dark: 'rgba(0, 0, 0, 0.15)',
143
- light: 'rgba(0, 0, 0, 0.05)'
144
- },
145
- prisma: themes_namespaceObject.variables.interactiveColorBackgroundDisabled
146
- },
147
- info: {
148
- enterprise: themes_namespaceObject.mixins.colorWithAlpha(themes_namespaceObject.variables.infoColorL10, 0.3)
149
- },
150
- success: {
151
- enterprise: themes_namespaceObject.mixins.colorWithAlpha(themes_namespaceObject.variables.successColorL10, 0.3)
152
- },
153
- warning: {
154
- enterprise: themes_namespaceObject.mixins.colorWithAlpha(themes_namespaceObject.variables.warningColorL10, 0.3)
155
- },
156
- error: {
157
- enterprise: themes_namespaceObject.mixins.colorWithAlpha(themes_namespaceObject.variables.errorColorL10, 0.3),
158
- prisma: themes_namespaceObject.variables.interactiveColorBackgroundDisabled
159
- },
160
- outline: {
161
- prisma: themes_namespaceObject.variables.interactiveColorBackgroundDisabled
162
- },
163
- custom: {
164
- enterprise: {
165
- dark: 'rgba(0, 0, 0, 0.15)',
166
- light: 'rgba(0, 0, 0, 0.05)'
167
- },
168
- prisma: themes_namespaceObject.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);
169
329
  }
170
- }));
171
- });
172
- var Styled = external_styled_components_default()(StyledBasic).withConfig({
173
- displayName: "ChipStyles__Styled",
174
- componentId: "sc-1sd3tsh-1"
175
- })(["align-items:center;"]);
176
- var StyledInner = external_styled_components_default().div.withConfig({
177
- displayName: "ChipStyles__StyledInner",
178
- componentId: "sc-1sd3tsh-2"
179
- })(["", ";"], (0,themes_namespaceObject.pick)({
180
- enterprise: (0,external_styled_components_namespaceObject.css)(["display:flex;max-width:100%;"]),
181
- prisma: (0,external_styled_components_namespaceObject.css)(["display:grid;max-width:100%;height:16px;column-gap:", ";", ";"], (0,themes_namespaceObject.pick)({
182
- prisma: {
183
- compact: themes_namespaceObject.variables.spacingXSmall,
184
- comfortable: themes_namespaceObject.variables.spacingSmall
330
+ function _(e, r) {
331
+ return q(e) || E(e, r) || j(e, r) || R();
185
332
  }
186
- }), function (_ref5) {
187
- var $icon = _ref5.$icon,
188
- $removable = _ref5.$removable;
189
- var gridColumns = (0,external_styled_components_namespaceObject.css)(["grid-template-columns:1fr;"]);
190
-
191
- if ($icon && $removable) {
192
- gridColumns = (0,external_styled_components_namespaceObject.css)(["grid-template-columns:0fr 1fr 0fr;"]);
193
- } else if ($icon) {
194
- gridColumns = (0,external_styled_components_namespaceObject.css)(["grid-template-columns:0fr 1fr;"]);
195
- } else if ($removable) {
196
- gridColumns = (0,external_styled_components_namespaceObject.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.");
197
335
  }
198
-
199
- return gridColumns;
200
- })
201
- }));
202
- var StyledIcon = external_styled_components_default().div.withConfig({
203
- displayName: "ChipStyles__StyledIcon",
204
- componentId: "sc-1sd3tsh-3"
205
- })(["", ";margin-right:", ";color:", ";"], (0,themes_namespaceObject.pick)({
206
- prisma: {
207
- compact: (0,external_styled_components_namespaceObject.css)(["font-size:14px;display:inline-flex;svg{height:16px;vertical-align:baseline;}"]),
208
- comfortable: (0,external_styled_components_namespaceObject.css)(["font-size:18px;display:inline-flex;align-self:center;svg{height:16px;vertical-align:baseline;}"])
209
- },
210
- enterprise: (0,external_styled_components_namespaceObject.css)(["flex:0 0 auto;"])
211
- }), (0,themes_namespaceObject.pick)({
212
- enterprise: '3px'
213
- }), (0,themes_namespaceObject.pickVariant)('$disabled', {
214
- "true": themes_namespaceObject.variables.contentColorDisabled,
215
- "false": {
216
- enterprise: function enterprise(_ref6) {
217
- var $foregroundColor = _ref6.$foregroundColor;
218
- return $foregroundColor || themes_namespaceObject.variables.contentColorDefault;
219
- },
220
- prisma: function prisma(_ref7) {
221
- var $foregroundColor = _ref7.$foregroundColor,
222
- $appearance = _ref7.$appearance;
223
- return $foregroundColor || ($appearance === 'error' ? themes_namespaceObject.variables.contentColorInverted : themes_namespaceObject.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);
224
343
  }
225
- }
226
- }));
227
- var StyledLabel = external_styled_components_default().div.withConfig({
228
- displayName: "ChipStyles__StyledLabel",
229
- componentId: "sc-1sd3tsh-4"
230
- })(["", " ", ";color:", ";"], themes_namespaceObject.mixins.ellipsis(), (0,themes_namespaceObject.pick)({
231
- enterprise: (0,external_styled_components_namespaceObject.css)(["flex:0 1 auto;"])
232
- }), (0,themes_namespaceObject.pickVariant)('$disabled', {
233
- "true": themes_namespaceObject.variables.contentColorDisabled,
234
- "false": {
235
- enterprise: function enterprise(_ref8) {
236
- var $appearance = _ref8.$appearance,
237
- $foregroundColor = _ref8.$foregroundColor;
238
- return $foregroundColor || ($appearance === 'default' || $appearance === 'outline' ? themes_namespaceObject.variables.contentColorDefault : themes_namespaceObject.variables.gray30);
239
- },
240
- prisma: function prisma(_ref9) {
241
- var $appearance = _ref9.$appearance,
242
- $foregroundColor = _ref9.$foregroundColor;
243
- return $foregroundColor || ($appearance === 'error' ? themes_namespaceObject.variables.contentColorInverted : themes_namespaceObject.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;
244
350
  }
245
- }
246
- }));
247
- var StyledRemove = external_styled_components_default().span.withConfig({
248
- displayName: "ChipStyles__StyledRemove",
249
- componentId: "sc-1sd3tsh-5"
250
- })(["", ";"], (0,themes_namespaceObject.pick)({
251
- enterprise: (0,external_styled_components_namespaceObject.css)(["flex:0 0 auto;padding-left:", ";font-size:", ";color:", ";"], themes_namespaceObject.variables.spacingQuarter, (0,themes_namespaceObject.pick)({
252
- compact: '9px',
253
- comfortable: '10.5px'
254
- }), (0,themes_namespaceObject.pickVariant)('$disabled', {
255
- "true": themes_namespaceObject.variables.contentColorDisabled,
256
- "false": {
257
- enterprise: function enterprise(_ref10) {
258
- var $foregroundColor = _ref10.$foregroundColor,
259
- $appearance = _ref10.$appearance;
260
- return $foregroundColor || ($appearance === 'default' || $appearance === 'outline' ? themes_namespaceObject.variables.textGray : themes_namespaceObject.variables.gray30);
261
- }
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;
262
373
  }
263
- })),
264
- prisma: (0,external_styled_components_namespaceObject.css)(["font-size:", ";display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:12px;font-size:9px;color:", ";"], (0,themes_namespaceObject.pick)({
265
- compact: '9px',
266
- comfortable: '10.5px'
267
- }), function (_ref11) {
268
- var $disabled = _ref11.$disabled,
269
- $foregroundColor = _ref11.$foregroundColor;
270
- return $disabled ? themes_namespaceObject.variables.contentColorDisabled : $foregroundColor || 'inherit';
271
- })
272
- }));
273
- var StyledClickable = external_styled_components_default()(StyledBasic.withComponent((Clickable_default()))).withConfig({
274
- displayName: "ChipStyles__StyledClickable",
275
- componentId: "sc-1sd3tsh-6"
276
- })(["flex:0 1 auto;line-height:16px;cursor:pointer;&:focus{", ";}&:not([disabled]):hover{", ";}", ";"], (0,themes_namespaceObject.pick)({
277
- enterprise: (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";color:", ";"], themes_namespaceObject.variables.focusShadow, themes_namespaceObject.variables.linkColor),
278
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";", "{background-color:", ";box-shadow:0 0 0 3px ", ";}"], themes_namespaceObject.variables.contentColorActive,
279
- /* sc-sel */
280
- StyledRemove, themes_namespaceObject.variables.interactiveColorOverlayHover, themes_namespaceObject.variables.focusColor)
281
- }), (0,themes_namespaceObject.pick)({
282
- enterprise: (0,external_styled_components_namespaceObject.css)(["background-color:", ";", "{color:", ";}"], (0,themes_namespaceObject.pickVariant)('$appearance', {
283
- "default": {
284
- dark: themes_namespaceObject.variables.gray30,
285
- light: themes_namespaceObject.variables.gray96
286
- },
287
- info: themes_namespaceObject.variables.infoColorL20,
288
- success: themes_namespaceObject.variables.successColorL20,
289
- warning: themes_namespaceObject.variables.warningColorL20,
290
- error: themes_namespaceObject.variables.errorColorL20,
291
- custom: {
292
- dark: themes_namespaceObject.variables.gray30,
293
- light: themes_namespaceObject.variables.gray96
374
+ function q(e) {
375
+ if (Array.isArray(e)) return e;
294
376
  }
295
- }),
296
- /* sc-sel */
297
- StyledRemove, function (_ref12) {
298
- var $foregroundColor = _ref12.$foregroundColor;
299
- return $foregroundColor || themes_namespaceObject.variables.linkColor;
300
- }),
301
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";", "{background-color:", ";", ";}"], themes_namespaceObject.variables.contentColorActive,
302
- /* sc-sel */
303
- StyledRemove, themes_namespaceObject.variables.interactiveColorOverlayHover, function (_ref13) {
304
- var $appearance = _ref13.$appearance;
305
- return $appearance === 'error' && (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.contentColorInverted);
306
- })
307
- }), (0,themes_namespaceObject.pick)({
308
- prisma: (0,external_styled_components_namespaceObject.css)(["&:not([disabled]):active ", "{background-color:", ";}"],
309
- /* sc-sel */
310
- StyledRemove, themes_namespaceObject.variables.interactiveColorOverlayActive)
311
- }));
312
-
313
- ;// CONCATENATED MODULE: ./src/Chip/Chip.tsx
314
- 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); }
315
-
316
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
317
-
318
- 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."); }
319
-
320
- 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); }
321
-
322
- 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; }
323
-
324
- 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; }
325
-
326
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
327
-
328
- 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; }
329
-
330
- 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; }
331
-
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
- var propTypes = {
342
- appearance: external_prop_types_default().oneOf(['info', 'success', 'warning', 'error', 'outline']),
343
- backgroundColor: (external_prop_types_default()).string,
344
- children: (external_prop_types_default()).node.isRequired,
345
- disabled: (external_prop_types_default()).bool,
346
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
347
- foregroundColor: (external_prop_types_default()).string,
348
- icon: (external_prop_types_default()).node,
349
- onRequestRemove: (external_prop_types_default()).func,
350
-
351
- /** Includes this value in `onRequestRemove` callbacks. */
352
- value: (external_prop_types_default()).any
353
- };
354
- var defaultProps = {
355
- disabled: false
356
- };
357
-
358
- function isInteractive(props) {
359
- return !!props.onRequestRemove;
360
- }
361
-
362
- function getSharedProps(props) {
363
- var appearance = props.appearance,
364
- backgroundColor = props.backgroundColor,
365
- disabled = props.disabled,
366
- foregroundColor = props.foregroundColor,
367
- icon = props.icon,
368
- 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>.
369
-
370
-
371
- var $foregroundColor = foregroundColor && (0,color_namespaceObject.isCSSColor)(foregroundColor) ? foregroundColor : undefined;
372
- var $backgroundColor = backgroundColor && (0,color_namespaceObject.isCSSColor)(backgroundColor) ? backgroundColor : undefined;
373
- var sharedProps = {
374
- 'data-test': 'chip',
375
- $appearance: appearance || ($backgroundColor ? 'custom' : 'default'),
376
- $backgroundColor: $backgroundColor,
377
- $foregroundColor: $foregroundColor,
378
- disabled: disabled,
379
- icon: icon
380
- };
381
- return [sharedProps, otherProps];
382
- }
383
-
384
- function ChipInteractive(props) {
385
- var _getSharedProps = getSharedProps(props),
386
- _getSharedProps2 = _slicedToArray(_getSharedProps, 2),
387
- sharedProps = _getSharedProps2[0],
388
- ownProps = _getSharedProps2[1];
389
-
390
- var $appearance = sharedProps.$appearance,
391
- $foregroundColor = sharedProps.$foregroundColor,
392
- disabled = sharedProps.disabled,
393
- icon = sharedProps.icon,
394
- otherSharedProps = _objectWithoutProperties(sharedProps, ["$appearance", "$foregroundColor", "disabled", "icon"]);
395
-
396
- var children = ownProps.children,
397
- elementRef = ownProps.elementRef,
398
- onRequestRemove = ownProps.onRequestRemove,
399
- value = ownProps.value,
400
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef", "onRequestRemove", "value"]);
401
-
402
- var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
403
- isEnterprise = _useSplunkTheme.isEnterprise;
404
-
405
- var handleRemoveClick = (0,external_react_namespaceObject.useCallback)(function (e) {
406
- onRequestRemove(e, {
407
- value: value
408
- });
409
- }, [onRequestRemove, value]);
410
- return /*#__PURE__*/external_react_default().createElement(StyledClickable, _extends({
411
- $appearance: $appearance,
412
- $disabled: disabled,
413
- $foregroundColor: $foregroundColor,
414
- "data-test-value": value,
415
- disabled: disabled,
416
- elementRef: elementRef,
417
- onClick: handleRemoveClick
418
- }, otherSharedProps, omit_default()(otherProps, Object.keys(propTypes))), /*#__PURE__*/external_react_default().createElement(StyledInner, {
419
- $icon: !!icon,
420
- $removable: true
421
- }, icon && /*#__PURE__*/external_react_default().createElement(StyledIcon, {
422
- $appearance: $appearance,
423
- $disabled: disabled,
424
- $foregroundColor: $foregroundColor
425
- }, icon), /*#__PURE__*/external_react_default().createElement(StyledLabel, {
426
- "data-test": "label",
427
- $appearance: $appearance,
428
- $disabled: disabled,
429
- $foregroundColor: $foregroundColor
430
- }, children), /*#__PURE__*/external_react_default().createElement(StyledRemove, {
431
- $appearance: $appearance,
432
- $disabled: disabled,
433
- $foregroundColor: $foregroundColor
434
- }, isEnterprise ? /*#__PURE__*/external_react_default().createElement((Close_default()), {
435
- "data-test": "cross",
436
- hideDefaultTooltip: true,
437
- screenReaderText: (0,i18n_namespaceObject._)('Remove'),
438
- size: 0.85
439
- }) : /*#__PURE__*/external_react_default().createElement((Cross_default()), {
440
- "aria-label": (0,i18n_namespaceObject._)('Remove'),
441
- "data-test": "cross",
442
- height: "20px",
443
- width: "20px"
444
- }))));
445
- }
446
-
447
- function ChipNonInteractive(props) {
448
- var _getSharedProps3 = getSharedProps(props),
449
- _getSharedProps4 = _slicedToArray(_getSharedProps3, 2),
450
- sharedProps = _getSharedProps4[0],
451
- ownProps = _getSharedProps4[1];
452
-
453
- var $appearance = sharedProps.$appearance,
454
- $foregroundColor = sharedProps.$foregroundColor,
455
- disabled = sharedProps.disabled,
456
- icon = sharedProps.icon,
457
- otherSharedProps = _objectWithoutProperties(sharedProps, ["$appearance", "$foregroundColor", "disabled", "icon"]);
458
-
459
- var children = ownProps.children,
460
- elementRef = ownProps.elementRef,
461
- otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef"]);
462
-
463
- return /*#__PURE__*/external_react_default().createElement(Styled, _extends({
464
- $appearance: $appearance,
465
- $disabled: disabled,
466
- ref: elementRef
467
- }, otherSharedProps, omit_default()(otherProps, Object.keys(propTypes))), /*#__PURE__*/external_react_default().createElement(StyledInner, {
468
- $icon: !!icon,
469
- $removable: false
470
- }, icon && /*#__PURE__*/external_react_default().createElement(StyledIcon, {
471
- $appearance: $appearance,
472
- $disabled: disabled,
473
- $foregroundColor: $foregroundColor
474
- }, icon), /*#__PURE__*/external_react_default().createElement(StyledLabel, {
475
- "data-test": "label",
476
- $appearance: $appearance,
477
- $disabled: disabled,
478
- $foregroundColor: $foregroundColor
479
- }, children)));
480
- }
481
-
482
- function Chip(props) {
483
- // @docs-props-type ChipPropsBase
484
- return isInteractive(props) ? /*#__PURE__*/external_react_default().createElement(ChipInteractive, props) : /*#__PURE__*/external_react_default().createElement(ChipNonInteractive, props);
485
- }
486
-
487
- Chip.propTypes = propTypes;
488
- Chip.defaultProps = defaultProps;
489
- /* harmony default export */ const Chip_Chip = (Chip);
490
- ;// CONCATENATED MODULE: ./src/Chip/index.ts
491
-
492
-
493
- module.exports = __webpack_exports__;
494
- /******/ })()
495
- ;
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
+ /******/})();