@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/Button.js CHANGED
@@ -1,619 +1,494 @@
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 = 194);
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
- /***/ 126:
105
- /***/ (function(module, exports) {
106
-
107
- module.exports = require("@splunk/react-icons/ArrowSquareTopRightInset");
108
-
109
- /***/ }),
110
-
111
- /***/ 194:
112
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
113
-
114
- "use strict";
115
- // ESM COMPAT FLAG
116
- __webpack_require__.r(__webpack_exports__);
117
-
118
- // EXPORTS
119
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Button_Button; });
120
-
121
- // EXTERNAL MODULE: external "react"
122
- var external_react_ = __webpack_require__(2);
123
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
124
-
125
- // EXTERNAL MODULE: external "prop-types"
126
- var external_prop_types_ = __webpack_require__(1);
127
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
128
-
129
- // EXTERNAL MODULE: external "lodash/isString"
130
- var isString_ = __webpack_require__(23);
131
- var isString_default = /*#__PURE__*/__webpack_require__.n(isString_);
132
-
133
- // EXTERNAL MODULE: external "@splunk/react-ui/Dropdown"
134
- var Dropdown_ = __webpack_require__(22);
135
-
136
- // EXTERNAL MODULE: external "@splunk/ui-utils/style"
137
- var style_ = __webpack_require__(41);
138
-
139
- // EXTERNAL MODULE: external "styled-components"
140
- var external_styled_components_ = __webpack_require__(3);
141
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
142
-
143
- // EXTERNAL MODULE: external "@splunk/react-ui/ButtonSimple"
144
- var ButtonSimple_ = __webpack_require__(64);
145
- var ButtonSimple_default = /*#__PURE__*/__webpack_require__.n(ButtonSimple_);
146
-
147
- // EXTERNAL MODULE: external "@splunk/themes"
148
- var themes_ = __webpack_require__(0);
149
-
150
- // CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
151
-
152
-
153
-
154
- var StyledIcon = external_styled_components_default.a.span.withConfig({
155
- displayName: "ButtonStyles__StyledIcon",
156
- componentId: "eqxqs2-0"
157
- })(["display:flex;align-items:center;flex-shrink:0;font-size:", ";", ";"], Object(themes_["pick"])({
158
- enterprise: 'inherit',
159
- prisma: {
160
- comfortable: '21px',
161
- compact: '16px'
162
- }
163
- }), Object(themes_["pickVariant"])('$isIconOnly', {
164
- "false": {
165
- enterprise: Object(external_styled_components_["css"])(["padding-right:3px;"]),
166
- prisma: Object(external_styled_components_["css"])(["padding-right:8px;"])
167
- }
168
- }));
169
- var StyledButtonSimple = external_styled_components_default()(ButtonSimple_default.a).withConfig({
170
- displayName: "ButtonStyles__StyledButtonSimple",
171
- componentId: "eqxqs2-1"
172
- })(["text-align:center;vertical-align:middle;text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{display:inline-block;vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}"], themes_["variables"].lineHeight, themes_["variables"].inputHeight, Object(themes_["pick"])({
173
- enterprise: {
174
- comfortable: '5px 14px',
175
- compact: '2px 14px'
176
- },
177
- prisma: {
178
- comfortable: function comfortable(_ref) {
179
- var $hasPrismaIcon = _ref.$hasPrismaIcon;
180
- return $hasPrismaIcon ? '7px 18px' : '9px 18px';
181
- },
182
- compact: function compact(_ref2) {
183
- var $isMenu = _ref2.$isMenu;
184
- return $isMenu ? '5px 8px 5px 16px' : '5px 16px';
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 = t => {
12
+ /******/ var n = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(n, {
17
+ a: n
18
+ });
19
+ /******/ return n;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var r in n) {
28
+ /******/ if (e.o(n, r) && !e.o(t, r)) {
29
+ /******/ Object.defineProperty(t, r, {
30
+ enumerable: true,
31
+ get: n[r]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
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 t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ default: () => /* reexport */ U
65
+ });
66
+ // CONCATENATED MODULE: external "react"
67
+ const n = require("react");
68
+ var r = e.n(n);
69
+ // CONCATENATED MODULE: external "prop-types"
70
+ const i = require("prop-types");
71
+ var a = e.n(i);
72
+ // CONCATENATED MODULE: external "lodash/isString"
73
+ const o = require("lodash/isString");
74
+ var l = e.n(o);
75
+ // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
76
+ const c = require("@splunk/react-ui/Dropdown");
77
+ // CONCATENATED MODULE: external "@splunk/ui-utils/style"
78
+ const s = require("@splunk/ui-utils/style");
79
+ // CONCATENATED MODULE: external "styled-components"
80
+ const p = require("styled-components");
81
+ var u = e.n(p);
82
+ // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
83
+ const f = require("@splunk/react-ui/ButtonSimple");
84
+ var d = e.n(f);
85
+ // CONCATENATED MODULE: external "@splunk/themes"
86
+ const m = require("@splunk/themes");
87
+ // CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
88
+ var v = u().span.withConfig({
89
+ displayName: "ButtonStyles__StyledIcon",
90
+ componentId: "eqxqs2-0"
91
+ })([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", ";" ], (0,
92
+ m.pick)({
93
+ enterprise: "inherit",
94
+ prisma: {
95
+ comfortable: "21px",
96
+ compact: "16px"
97
+ }
98
+ }), (0, m.pickVariant)("$isIconOnly", {
99
+ false: {
100
+ enterprise: (0, p.css)([ "padding-right:3px;" ]),
101
+ prisma: (0, p.css)([ "padding-right:8px;" ])
102
+ }
103
+ }));
104
+ var y = u()(d()).withConfig({
105
+ displayName: "ButtonStyles__StyledButtonSimple",
106
+ componentId: "eqxqs2-1"
107
+ })([ "text-align:center;vertical-align:middle;text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{display:inline-block;vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], m.variables.lineHeight, m.variables.inputHeight, (0,
108
+ m.pick)({
109
+ enterprise: {
110
+ comfortable: "5px 14px",
111
+ compact: "2px 14px"
112
+ },
113
+ prisma: {
114
+ comfortable: function e(t) {
115
+ var n = t.$hasPrismaIcon;
116
+ return n ? "7px 18px" : "9px 18px";
117
+ },
118
+ compact: function e(t) {
119
+ var n = t.$isMenu;
120
+ return n ? "5px 8px 5px 16px" : "5px 16px";
121
+ }
122
+ }
123
+ }), (function(e) {
124
+ var t = e.$inline, n = e.append, r = e.prepend;
125
+ return !t && !n && !r && (0, p.css)([ "width:100%;" ]);
126
+ }), (function(e) {
127
+ var t = e.$isIconOnly;
128
+ return t && (0, p.css)([ "box-sizing:border-box;padding:", ";width:", ";min-width:", ";" ], (0,
129
+ m.pick)({
130
+ enterprise: {
131
+ comfortable: "0 5px",
132
+ compact: "0 2px"
133
+ },
134
+ prisma: {
135
+ comfortable: (0, p.css)([ "0px calc(", " / 2 - 1px)" ], m.variables.inputHeight),
136
+ compact: (0, p.css)([ "0px calc(", " / 2 - 1px)" ], m.variables.inputHeight)
137
+ }
138
+ }), m.variables.inputHeight, m.variables.inputHeight);
139
+ }), (function(e) {
140
+ var t = e.$isIconOnly;
141
+ return t ? null : (0, p.css)([ "width:auto;" ]);
142
+ }), (function(e) {
143
+ var t = e.prepend;
144
+ return !t && (0, p.css)([ "margin-left:", ";" ], (0, m.pick)({
145
+ enterprise: m.variables.spacingHalf,
146
+ prisma: m.variables.spacingSmall
147
+ }));
148
+ }));
149
+ var b = u().span.withConfig({
150
+ displayName: "ButtonStyles__StyledContentWrapper",
151
+ componentId: "eqxqs2-2"
152
+ })([ "display:flex;flex-direction:row;justify-content:center;align-items:center;max-width:100%;padding:", ";" ], (0,
153
+ m.pick)({
154
+ enterprise: function e(t) {
155
+ var n = t.$error;
156
+ if (n) {
157
+ return "1px";
158
+ }
159
+ return (0, m.pickVariant)("$appearance", {
160
+ default: "0",
161
+ secondary: "0",
162
+ destructive: "1px",
163
+ primary: "1px",
164
+ pill: "0",
165
+ toggle: "0",
166
+ // === default
167
+ flat: "0"
168
+ });
169
+ },
170
+ prisma: (0, m.pickVariant)("$appearance", {
171
+ default: 0,
172
+ secondary: "1px 0",
173
+ primary: "1px 0",
174
+ destructive: "1px 0",
175
+ pill: "1px 0",
176
+ // === secondary
177
+ toggle: "0",
178
+ flat: "1px 0"
179
+ })
180
+ }));
181
+ var h = u().span.withConfig({
182
+ displayName: "ButtonStyles__StyledLabel",
183
+ componentId: "eqxqs2-3"
184
+ })([ "text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", "" ], (0,
185
+ m.pick)({
186
+ enterprise: "3px",
187
+ prisma: "10px"
188
+ }), (function(e) {
189
+ var t = e.$isMenu;
190
+ return t && (0, p.css)([ "flex:1 1 auto;text-align:left;" ]);
191
+ }));
192
+ var x = u().span.withConfig({
193
+ displayName: "ButtonStyles__StyledCaretWrapper",
194
+ componentId: "eqxqs2-4"
195
+ })([ "display:inline-flex;", "" ], (0, m.pickVariant)("$disabled", {
196
+ false: {
197
+ prisma: (0, m.pickVariant)("$primary", {
198
+ true: (0, p.css)([ "color:", ";" ], m.variables.contentColorInverted),
199
+ false: (0, p.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ], m.variables.contentColorDefault,
200
+ /* sc-sel */
201
+ y,
202
+ /* sc-sel */
203
+ y, m.variables.contentColorDefault)
204
+ })
205
+ }
206
+ }));
207
+ // CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
208
+ const g = require("@splunk/react-icons/CaretSmallDown");
209
+ var w = e.n(g);
210
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
211
+ const k = require("@splunk/react-icons/enterprise/Caret");
212
+ var S = e.n(k);
213
+ // CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
214
+ var C = function e() {
215
+ var t = (0, m.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
216
+ var a = i ? "20px" : "24px";
217
+ return n ? r().createElement(S(), {
218
+ screenReaderText: null,
219
+ hideDefaultTooltip: true,
220
+ size: .5
221
+ }) : r().createElement(w(), {
222
+ height: a,
223
+ width: a
224
+ });
225
+ };
226
+ /* harmony default export */ const O = C;
227
+ // CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
228
+ const q = require("@splunk/react-icons/ArrowSquareTopRightInset");
229
+ var _ = e.n(q);
230
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
231
+ const $ = require("@splunk/react-icons/enterprise/External");
232
+ var I = e.n($);
233
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
234
+ const E = require("@splunk/ui-utils/i18n");
235
+ // CONCATENATED MODULE: ./src/Button/icons/External.tsx
236
+ var P = (0, E._)("Open externally");
237
+ function j() {
238
+ var e = (0, m.useSplunkTheme)(), t = e.isEnterprise, n = e.isCompact;
239
+ var i = n ? "20px" : "24px";
240
+ return t ? r().createElement(I(), {
241
+ screenReaderText: P,
242
+ size: .8,
243
+ style: {
244
+ verticalAlign: "baseline"
245
+ }
246
+ }) : r().createElement(_(), {
247
+ "aria-label": P,
248
+ height: i,
249
+ width: i
250
+ }, r().createElement("title", null, P));
185
251
  }
186
- }
187
- }), function (_ref3) {
188
- var $inline = _ref3.$inline,
189
- append = _ref3.append,
190
- prepend = _ref3.prepend;
191
- return !$inline && !append && !prepend && Object(external_styled_components_["css"])(["width:100%;"]);
192
- }, function (_ref4) {
193
- var $isIconOnly = _ref4.$isIconOnly;
194
- return $isIconOnly && Object(external_styled_components_["css"])(["box-sizing:border-box;padding:", ";width:", ";min-width:", ";"], Object(themes_["pick"])({
195
- enterprise: {
196
- comfortable: '0 5px',
197
- compact: '0 2px'
198
- },
199
- prisma: {
200
- comfortable: Object(external_styled_components_["css"])(["0px calc(", " / 2 - 1px)"], themes_["variables"].inputHeight),
201
- compact: Object(external_styled_components_["css"])(["0px calc(", " / 2 - 1px)"], themes_["variables"].inputHeight)
252
+ /* harmony default export */ const N = j;
253
+ // CONCATENATED MODULE: ./src/Button/Button.tsx
254
+ function M(e) {
255
+ "@babel/helpers - typeof";
256
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
257
+ M = function e(t) {
258
+ return typeof t;
259
+ };
260
+ } else {
261
+ M = function e(t) {
262
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
263
+ };
264
+ }
265
+ return M(e);
202
266
  }
203
- }), themes_["variables"].inputHeight, themes_["variables"].inputHeight);
204
- }, function (_ref5) {
205
- var $isIconOnly = _ref5.$isIconOnly;
206
- return $isIconOnly ? null : Object(external_styled_components_["css"])(["width:auto;"]);
207
- }, function (_ref6) {
208
- var prepend = _ref6.prepend;
209
- return !prepend && Object(external_styled_components_["css"])(["margin-left:", ";"], Object(themes_["pick"])({
210
- enterprise: themes_["variables"].spacingHalf,
211
- prisma: themes_["variables"].spacingSmall
212
- }));
213
- });
214
- var StyledContentWrapper = external_styled_components_default.a.span.withConfig({
215
- displayName: "ButtonStyles__StyledContentWrapper",
216
- componentId: "eqxqs2-2"
217
- })(["display:flex;flex-direction:row;justify-content:center;align-items:center;max-width:100%;padding:", ";"], Object(themes_["pick"])({
218
- enterprise: function enterprise(_ref7) {
219
- var $error = _ref7.$error;
220
-
221
- if ($error) {
222
- return '1px';
267
+ function T() {
268
+ T = Object.assign || function(e) {
269
+ for (var t = 1; t < arguments.length; t++) {
270
+ var n = arguments[t];
271
+ for (var r in n) {
272
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
273
+ e[r] = n[r];
274
+ }
275
+ }
276
+ }
277
+ return e;
278
+ };
279
+ return T.apply(this, arguments);
223
280
  }
224
-
225
- return Object(themes_["pickVariant"])('$appearance', {
226
- "default": '0',
227
- secondary: '0',
228
- destructive: '1px',
229
- primary: '1px',
230
- pill: '0',
231
- toggle: '0',
232
- // === default
233
- flat: '0' // === default
234
-
235
- });
236
- },
237
- prisma: Object(themes_["pickVariant"])('$appearance', {
238
- "default": 0,
239
- secondary: '1px 0',
240
- primary: '1px 0',
241
- destructive: '1px 0',
242
- pill: '1px 0',
243
- // === secondary
244
- toggle: '0',
245
- flat: '1px 0'
246
- })
247
- }));
248
- var StyledLabel = external_styled_components_default.a.span.withConfig({
249
- displayName: "ButtonStyles__StyledLabel",
250
- componentId: "eqxqs2-3"
251
- })(["text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", ""], Object(themes_["pick"])({
252
- enterprise: '3px',
253
- prisma: '10px'
254
- }), function (_ref8) {
255
- var $isMenu = _ref8.$isMenu;
256
- return $isMenu && Object(external_styled_components_["css"])(["flex:1 1 auto;text-align:left;"]);
257
- });
258
- var StyledCaretWrapper = external_styled_components_default.a.span.withConfig({
259
- displayName: "ButtonStyles__StyledCaretWrapper",
260
- componentId: "eqxqs2-4"
261
- })(["display:inline-flex;", ""], Object(themes_["pickVariant"])('$disabled', {
262
- "false": {
263
- prisma: Object(themes_["pickVariant"])('$primary', {
264
- "true": Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorInverted),
265
- "false": Object(external_styled_components_["css"])(["color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}"], themes_["variables"].contentColorDefault,
266
- /* sc-sel */
267
- StyledButtonSimple,
268
- /* sc-sel */
269
- StyledButtonSimple, themes_["variables"].contentColorDefault)
270
- })
271
- }
272
- }));
273
-
274
- // EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown"
275
- var CaretSmallDown_ = __webpack_require__(56);
276
- var CaretSmallDown_default = /*#__PURE__*/__webpack_require__.n(CaretSmallDown_);
277
-
278
- // EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret"
279
- var Caret_ = __webpack_require__(57);
280
- var Caret_default = /*#__PURE__*/__webpack_require__.n(Caret_);
281
-
282
- // CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
283
-
284
-
285
-
286
-
287
-
288
- var CaretSmallDown_CaretSmallDown = function CaretSmallDown() {
289
- var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
290
- isEnterprise = _useSplunkTheme.isEnterprise,
291
- isCompact = _useSplunkTheme.isCompact;
292
-
293
- var prismaSize = isCompact ? '20px' : '24px';
294
- return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, {
295
- screenReaderText: null,
296
- hideDefaultTooltip: true,
297
- size: 0.5
298
- }) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, {
299
- height: prismaSize,
300
- width: prismaSize
301
- });
302
- };
303
-
304
- /* harmony default export */ var icons_CaretSmallDown = (CaretSmallDown_CaretSmallDown);
305
- // EXTERNAL MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
306
- var ArrowSquareTopRightInset_ = __webpack_require__(126);
307
- var ArrowSquareTopRightInset_default = /*#__PURE__*/__webpack_require__.n(ArrowSquareTopRightInset_);
308
-
309
- // EXTERNAL MODULE: external "@splunk/react-icons/enterprise/External"
310
- var External_ = __webpack_require__(65);
311
- var External_default = /*#__PURE__*/__webpack_require__.n(External_);
312
-
313
- // EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
314
- var i18n_ = __webpack_require__(4);
315
-
316
- // CONCATENATED MODULE: ./src/Button/icons/External.tsx
317
-
318
-
319
-
320
-
321
-
322
-
323
- var External_label = Object(i18n_["_"])('Open externally');
324
-
325
- function External() {
326
- var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
327
- isEnterprise = _useSplunkTheme.isEnterprise,
328
- isCompact = _useSplunkTheme.isCompact;
329
-
330
- var prismaSize = isCompact ? '20px' : '24px';
331
- return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(External_default.a, {
332
- screenReaderText: External_label,
333
- size: 0.8,
334
- style: {
335
- verticalAlign: 'baseline'
281
+ function R(e, t) {
282
+ if (!(e instanceof t)) {
283
+ throw new TypeError("Cannot call a class as a function");
284
+ }
336
285
  }
337
- }) : /*#__PURE__*/external_react_default.a.createElement(ArrowSquareTopRightInset_default.a, {
338
- "aria-label": External_label,
339
- height: prismaSize,
340
- width: prismaSize
341
- }, /*#__PURE__*/external_react_default.a.createElement("title", null, External_label));
342
- }
343
-
344
- /* harmony default export */ var icons_External = (External);
345
- // CONCATENATED MODULE: ./src/Button/Button.tsx
346
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
347
-
348
- 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); }
349
-
350
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
351
-
352
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
353
-
354
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
355
-
356
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
357
-
358
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
359
-
360
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
361
-
362
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
363
-
364
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
365
-
366
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
367
-
368
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
369
-
370
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
- var propTypes = {
381
- action: external_prop_types_default.a.string,
382
- appearance: external_prop_types_default.a.oneOf(['default', 'secondary', 'primary', 'destructive', 'pill', 'toggle', 'flat']),
383
- append: external_prop_types_default.a.bool,
384
- children: external_prop_types_default.a.node,
385
-
386
- /** @private An additional className to add to the button. */
387
- classNamePrivate: external_prop_types_default.a.string,
388
- disabled: external_prop_types_default.a.bool,
389
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
390
- error: external_prop_types_default.a.bool,
391
- icon: external_prop_types_default.a.node,
392
- inline: external_prop_types_default.a.bool,
393
- isMenu: external_prop_types_default.a.bool,
394
- label: external_prop_types_default.a.node,
395
- onClick: external_prop_types_default.a.func,
396
- openInNewContext: external_prop_types_default.a.bool,
397
- prepend: external_prop_types_default.a.bool,
398
- selected: external_prop_types_default.a.bool,
399
- to: external_prop_types_default.a.string,
400
- value: external_prop_types_default.a.any
401
- };
402
- var defaultProps = {
403
- appearance: 'default',
404
- append: false,
405
- disabled: false,
406
- error: false,
407
- inline: true,
408
- isMenu: false,
409
- openInNewContext: false,
410
- prepend: false,
411
- selected: false
412
- };
413
-
414
- var Button_Button = /*#__PURE__*/function (_Component) {
415
- _inherits(Button, _Component);
416
-
417
- var _super = _createSuper(Button);
418
-
419
- // @docs-props-type ButtonPropsBase
420
- function Button(props) {
421
- var _this;
422
-
423
- _classCallCheck(this, Button);
424
-
425
- _this = _super.call(this, props);
426
-
427
- _defineProperty(_assertThisInitialized(_this), "component", null);
428
-
429
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
430
- var _this$props = _this.props,
431
- label = _this$props.label,
432
- icon = _this$props.icon,
433
- value = _this$props.value,
434
- action = _this$props.action,
435
- onClick = _this$props.onClick;
436
- onClick === null || onClick === void 0 ? void 0 : onClick(e, {
437
- label: label,
438
- icon: icon,
439
- value: value,
440
- action: action
441
- });
442
- });
443
-
444
- _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) {
445
- _this.component = c;
446
- });
447
-
448
- if (false) {}
449
-
450
- return _this;
451
- }
452
-
453
- _createClass(Button, [{
454
- key: "focus",
455
-
456
- /**
457
- * Places focus on the button.
458
- */
459
- value: function focus() {
460
- var _this$component;
461
-
462
- (_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.focus();
286
+ function B(e, t) {
287
+ for (var n = 0; n < t.length; n++) {
288
+ var r = t[n];
289
+ r.enumerable = r.enumerable || false;
290
+ r.configurable = true;
291
+ if ("value" in r) r.writable = true;
292
+ Object.defineProperty(e, r.key, r);
293
+ }
294
+ }
295
+ function D(e, t, n) {
296
+ if (t) B(e.prototype, t);
297
+ if (n) B(e, n);
298
+ return e;
299
+ }
300
+ function H(e, t) {
301
+ if (typeof t !== "function" && t !== null) {
302
+ throw new TypeError("Super expression must either be null or a function");
303
+ }
304
+ e.prototype = Object.create(t && t.prototype, {
305
+ constructor: {
306
+ value: e,
307
+ writable: true,
308
+ configurable: true
309
+ }
310
+ });
311
+ if (t) V(e, t);
463
312
  }
464
- }, {
465
- key: "render",
466
- value: function render() {
467
- var _this$props2 = this.props,
468
- action = _this$props2.action,
469
- appearance = _this$props2.appearance,
470
- append = _this$props2.append,
471
- className = _this$props2.className,
472
- classNamePrivate = _this$props2.classNamePrivate,
473
- disabled = _this$props2.disabled,
474
- error = _this$props2.error,
475
- icon = _this$props2.icon,
476
- inline = _this$props2.inline,
477
- isMenu = _this$props2.isMenu,
478
- onClick = _this$props2.onClick,
479
- openInNewContext = _this$props2.openInNewContext,
480
- prepend = _this$props2.prepend,
481
- to = _this$props2.to,
482
- value = _this$props2.value;
483
- var _this$props3 = this.props,
484
- children = _this$props3.children,
485
- label = _this$props3.label;
486
-
487
- if (!label && isString_default()(children)) {
488
- label = children;
489
- children = null;
490
- }
491
-
492
- var isIconOnly = !!(icon && !label && !isMenu && !children);
493
- var hasPrismaIcon = to && openInNewContext || isMenu || !!icon;
494
- return /*#__PURE__*/external_react_default.a.createElement(StyledButtonSimple, _extends({
495
- "aria-haspopup": isMenu || undefined,
496
- "aria-invalid": error || undefined,
497
- "data-test": "button"
498
- }, this.props, {
499
- className: Object(style_["toClassName"])(className, classNamePrivate),
500
- "data-action": action,
501
- "data-inline": inline || null,
502
- disabled: disabled,
503
- append: append,
504
- prepend: prepend,
505
- $inline: inline,
506
- $hasPrismaIcon: hasPrismaIcon,
507
- $isIconOnly: isIconOnly,
508
- $isMenu: isMenu // @ts-expect-error - this is problematic for two reasons:
509
- // * value is only a valid attribute on button (not on a)
510
- // * this component's value prop is of type any, which can result
511
- // in "[object Object]" attribute values
512
- ,
513
- value: value,
514
- onClick: onClick ? this.handleClick : undefined,
515
- ref: this.handleMount,
516
- openInNewContext: openInNewContext,
517
- appearance: appearance
518
- }), /*#__PURE__*/external_react_default.a.createElement(StyledContentWrapper, {
519
- $appearance: appearance,
520
- $error: error
521
- }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, {
522
- $isIconOnly: isIconOnly
523
- }, icon), label && /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
524
- "data-test": "label",
525
- $isMenu: isMenu
526
- }, label), children, isMenu && /*#__PURE__*/external_react_default.a.createElement(StyledCaretWrapper, {
527
- $disabled: disabled,
528
- $primary: appearance === 'primary'
529
- }, /*#__PURE__*/external_react_default.a.createElement(icons_CaretSmallDown, null)), openInNewContext && /*#__PURE__*/external_react_default.a.createElement(icons_External, null)));
313
+ function V(e, t) {
314
+ V = Object.setPrototypeOf || function e(t, n) {
315
+ t.__proto__ = n;
316
+ return t;
317
+ };
318
+ return V(e, t);
530
319
  }
531
- }]);
532
-
533
- return Button;
534
- }(external_react_["Component"]);
535
-
536
- _defineProperty(Button_Button, "propTypes", propTypes);
537
-
538
- _defineProperty(Button_Button, "defaultProps", defaultProps);
539
-
540
- _defineProperty(Button_Button, Dropdown_["legacyRefMode"], true);
541
-
542
- /* harmony default export */ var src_Button_Button = (Button_Button);
543
- // CONCATENATED MODULE: ./src/Button/index.ts
544
-
545
-
546
-
547
- /***/ }),
548
-
549
- /***/ 2:
550
- /***/ (function(module, exports) {
551
-
552
- module.exports = require("react");
553
-
554
- /***/ }),
555
-
556
- /***/ 22:
557
- /***/ (function(module, exports) {
558
-
559
- module.exports = require("@splunk/react-ui/Dropdown");
560
-
561
- /***/ }),
562
-
563
- /***/ 23:
564
- /***/ (function(module, exports) {
565
-
566
- module.exports = require("lodash/isString");
567
-
568
- /***/ }),
569
-
570
- /***/ 3:
571
- /***/ (function(module, exports) {
572
-
573
- module.exports = require("styled-components");
574
-
575
- /***/ }),
576
-
577
- /***/ 4:
578
- /***/ (function(module, exports) {
579
-
580
- module.exports = require("@splunk/ui-utils/i18n");
581
-
582
- /***/ }),
583
-
584
- /***/ 41:
585
- /***/ (function(module, exports) {
586
-
587
- module.exports = require("@splunk/ui-utils/style");
588
-
589
- /***/ }),
590
-
591
- /***/ 56:
592
- /***/ (function(module, exports) {
593
-
594
- module.exports = require("@splunk/react-icons/CaretSmallDown");
595
-
596
- /***/ }),
597
-
598
- /***/ 57:
599
- /***/ (function(module, exports) {
600
-
601
- module.exports = require("@splunk/react-icons/enterprise/Caret");
602
-
603
- /***/ }),
604
-
605
- /***/ 64:
606
- /***/ (function(module, exports) {
607
-
608
- module.exports = require("@splunk/react-ui/ButtonSimple");
609
-
610
- /***/ }),
611
-
612
- /***/ 65:
613
- /***/ (function(module, exports) {
614
-
615
- module.exports = require("@splunk/react-icons/enterprise/External");
616
-
617
- /***/ })
618
-
619
- /******/ });
320
+ function z(e) {
321
+ var t = L();
322
+ return function n() {
323
+ var r = F(e), i;
324
+ if (t) {
325
+ var a = F(this).constructor;
326
+ i = Reflect.construct(r, arguments, a);
327
+ } else {
328
+ i = r.apply(this, arguments);
329
+ }
330
+ return A(this, i);
331
+ };
332
+ }
333
+ function A(e, t) {
334
+ if (t && (M(t) === "object" || typeof t === "function")) {
335
+ return t;
336
+ }
337
+ return W(e);
338
+ }
339
+ function W(e) {
340
+ if (e === void 0) {
341
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
342
+ }
343
+ return e;
344
+ }
345
+ function L() {
346
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
347
+ if (Reflect.construct.sham) return false;
348
+ if (typeof Proxy === "function") return true;
349
+ try {
350
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
351
+ return true;
352
+ } catch (e) {
353
+ return false;
354
+ }
355
+ }
356
+ function F(e) {
357
+ F = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
358
+ return t.__proto__ || Object.getPrototypeOf(t);
359
+ };
360
+ return F(e);
361
+ }
362
+ function G(e, t, n) {
363
+ if (t in e) {
364
+ Object.defineProperty(e, t, {
365
+ value: n,
366
+ enumerable: true,
367
+ configurable: true,
368
+ writable: true
369
+ });
370
+ } else {
371
+ e[t] = n;
372
+ }
373
+ return e;
374
+ }
375
+ var J = {
376
+ action: a().string,
377
+ appearance: a().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat" ]),
378
+ append: a().bool,
379
+ children: a().node,
380
+ /** @private An additional className to add to the button. */
381
+ classNamePrivate: a().string,
382
+ disabled: a().bool,
383
+ elementRef: a().oneOfType([ a().func, a().object ]),
384
+ error: a().bool,
385
+ icon: a().node,
386
+ inline: a().bool,
387
+ isMenu: a().bool,
388
+ label: a().node,
389
+ onClick: a().func,
390
+ openInNewContext: a().bool,
391
+ prepend: a().bool,
392
+ selected: a().bool,
393
+ to: a().string,
394
+ value: a().any
395
+ };
396
+ var K = {
397
+ appearance: "default",
398
+ append: false,
399
+ disabled: false,
400
+ error: false,
401
+ inline: true,
402
+ isMenu: false,
403
+ openInNewContext: false,
404
+ prepend: false,
405
+ selected: false
406
+ };
407
+ var Q = function(e) {
408
+ H(n, e);
409
+ var t = z(n);
410
+ // @docs-props-type ButtonPropsBase
411
+ function n(e) {
412
+ var r;
413
+ R(this, n);
414
+ r = t.call(this, e);
415
+ G(W(r), "component", null);
416
+ G(W(r), "handleClick", (function(e) {
417
+ var t = r.props, n = t.label, i = t.icon, a = t.value, o = t.action, l = t.onClick;
418
+ l === null || l === void 0 ? void 0 : l(e, {
419
+ label: n,
420
+ icon: i,
421
+ value: a,
422
+ action: o
423
+ });
424
+ }));
425
+ G(W(r), "handleMount", (function(e) {
426
+ r.component = e;
427
+ }));
428
+ if (false) {}
429
+ return r;
430
+ }
431
+ D(n, [ {
432
+ key: "focus",
433
+ /**
434
+ * Places focus on the button.
435
+ */
436
+ value: function e() {
437
+ var t;
438
+ (t = this.component) === null || t === void 0 ? void 0 : t.focus();
439
+ }
440
+ }, {
441
+ key: "render",
442
+ value: function e() {
443
+ var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, c = t.classNamePrivate, p = t.disabled, u = t.error, f = t.icon, d = t.inline, m = t.isMenu, g = t.onClick, w = t.openInNewContext, k = t.prepend, S = t.to, C = t.value;
444
+ var q = this.props, _ = q.children, $ = q.label;
445
+ if (!$ && l()(_)) {
446
+ $ = _;
447
+ _ = null;
448
+ }
449
+ var I = !!(f && !$ && !m && !_);
450
+ var E = S && w || m || !!f;
451
+
452
+ return r().createElement(y, T({
453
+ "aria-haspopup": m || undefined,
454
+ "aria-invalid": u || undefined,
455
+ "data-test": "button"
456
+ }, this.props, {
457
+ className: (0, s.toClassName)(o, c),
458
+ "data-action": n,
459
+ "data-inline": d || null,
460
+ disabled: p,
461
+ append: a,
462
+ prepend: k,
463
+ $inline: d,
464
+ $hasPrismaIcon: E,
465
+ $isIconOnly: I,
466
+ $isMenu: m,
467
+ value: C,
468
+ onClick: g ? this.handleClick : undefined,
469
+ ref: this.handleMount,
470
+ openInNewContext: w,
471
+ appearance: i
472
+ }), r().createElement(b, {
473
+ $appearance: i,
474
+ $error: u
475
+ }, f && r().createElement(v, {
476
+ $isIconOnly: I
477
+ }, f), $ && r().createElement(h, {
478
+ "data-test": "label",
479
+ $isMenu: m
480
+ }, $), _, m && r().createElement(x, {
481
+ $disabled: p,
482
+ $primary: i === "primary"
483
+ }, r().createElement(O, null)), w && r().createElement(N, null)));
484
+ }
485
+ } ]);
486
+ return n;
487
+ }(n.Component);
488
+ G(Q, "propTypes", J);
489
+ G(Q, "defaultProps", K);
490
+ G(Q, c.legacyRefMode, true);
491
+ /* harmony default export */ const U = Q;
492
+ // CONCATENATED MODULE: ./src/Button/index.ts
493
+ module.exports = t;
494
+ /******/})();