@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/Switch.js CHANGED
@@ -1,769 +1,715 @@
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 = 209);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("@splunk/themes");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, exports) {
99
-
100
- module.exports = require("prop-types");
101
-
102
- /***/ }),
103
-
104
- /***/ 12:
105
- /***/ (function(module, exports) {
106
-
107
- module.exports = require("@splunk/react-ui/Clickable");
108
-
109
- /***/ }),
110
-
111
- /***/ 14:
112
- /***/ (function(module, exports) {
113
-
114
- module.exports = require("@splunk/react-ui/ScreenReaderContent");
115
-
116
- /***/ }),
117
-
118
- /***/ 2:
119
- /***/ (function(module, exports) {
120
-
121
- module.exports = require("react");
122
-
123
- /***/ }),
124
-
125
- /***/ 209:
126
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
127
-
128
- "use strict";
129
- // ESM COMPAT FLAG
130
- __webpack_require__.r(__webpack_exports__);
131
-
132
- // EXPORTS
133
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Switch_Switch; });
134
-
135
- // EXTERNAL MODULE: external "react"
136
- var external_react_ = __webpack_require__(2);
137
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
138
-
139
- // EXTERNAL MODULE: external "prop-types"
140
- var external_prop_types_ = __webpack_require__(1);
141
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
142
-
143
- // EXTERNAL MODULE: external "@splunk/react-ui/AnimationToggle"
144
- var AnimationToggle_ = __webpack_require__(51);
145
- var AnimationToggle_default = /*#__PURE__*/__webpack_require__.n(AnimationToggle_);
146
-
147
- // EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
148
- var ScreenReaderContent_ = __webpack_require__(14);
149
- var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
150
-
151
- // EXTERNAL MODULE: external "@splunk/ui-utils/id"
152
- var id_ = __webpack_require__(8);
153
-
154
- // EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Check"
155
- var Check_ = __webpack_require__(97);
156
- var Check_default = /*#__PURE__*/__webpack_require__.n(Check_);
157
-
158
- // EXTERNAL MODULE: external "@splunk/themes"
159
- var themes_ = __webpack_require__(0);
160
-
161
- // CONCATENATED MODULE: ./src/Switch/CheckIcon.tsx
162
-
163
-
164
-
165
- function CheckIcon() {
166
- var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
167
- family = _useSplunkTheme.family;
168
-
169
- if (family === 'enterprise') {
170
- return /*#__PURE__*/external_react_default.a.createElement(Check_default.a, {
171
- inline: false,
172
- size: "12px",
173
- screenReaderText: null,
174
- hideDefaultTooltip: true,
175
- style: {
176
- marginTop: '1px'
177
- }
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 t in a) {
28
+ /******/ if (e.o(a, t) && !e.o(r, t)) {
29
+ /******/ Object.defineProperty(r, t, {
30
+ enumerable: true,
31
+ get: a[t]
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 */ X
178
65
  });
179
- }
180
-
181
- return /*#__PURE__*/external_react_default.a.createElement("svg", {
182
- width: "12",
183
- height: "12",
184
- viewBox: "-1 -2 11 10",
185
- style: {
186
- display: 'block'
187
- },
188
- xmlns: "http://www.w3.org/2000/svg"
189
- }, /*#__PURE__*/external_react_default.a.createElement("path", {
190
- d: "M8.70711 0.292893C9.09763 0.683417 9.09763 1.31658 8.70711 1.70711L4.32132 6.0929C3.73559 6.67862 2.78596 6.67869 2.20015 6.09305L0.292997 4.18646C-0.0975845 3.79599 -0.0976776 3.16282 0.292789 2.77224C0.683256 2.38166 1.31642 2.38157 1.707 2.77203L3.26061 4.32518L7.29289 0.292893C7.68342 -0.0976311 8.31658 -0.0976311 8.70711 0.292893Z",
191
- fill: "currentColor"
192
- }));
193
- }
194
- // EXTERNAL MODULE: external "styled-components"
195
- var external_styled_components_ = __webpack_require__(3);
196
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
197
-
198
- // EXTERNAL MODULE: external "@splunk/react-ui/Box"
199
- var Box_ = __webpack_require__(6);
200
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
201
-
202
- // EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
203
- var Clickable_ = __webpack_require__(12);
204
- var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
205
-
206
- // CONCATENATED MODULE: ./src/Switch/SwitchStyles.ts
207
-
208
-
209
-
210
-
211
- var diameter = '18px';
212
- var toggleDiameter = '20px';
213
- var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
214
- displayName: "SwitchStyles__StyledBox",
215
- componentId: "sc-844ieu-0"
216
- })(["display:inline;position:relative;color:", ";flex-shrink:0;padding:", ";[data-inline] + &{margin-left:", ";}"], Object(themes_["pickVariant"])('$switchState', {
217
- error: {
218
- enterprise: themes_["variables"].errorColor,
219
- prisma: themes_["variables"].accentColorNegative
220
- },
221
- disabled: {
222
- enterprise: themes_["variables"].textDisabledColor,
223
- prisma: themes_["variables"].contentColorDisabled
224
- }
225
- }), Object(themes_["pick"])({
226
- enterprise: Object(external_styled_components_["css"])(["calc((", " - ", ") / 2) 0"], themes_["variables"].inputHeight, diameter),
227
- prisma: {
228
- compact: '6px 0',
229
- comfortable: '10px 0'
230
- }
231
- }), Object(themes_["pick"])({
232
- enterprise: themes_["variables"].spacingHalf,
233
- prisma: themes_["variables"].spacingSmall
234
- }));
235
- var StyledCheckboxClickable = external_styled_components_default()(Clickable_default.a).withConfig({
236
- displayName: "SwitchStyles__StyledCheckboxClickable",
237
- componentId: "sc-844ieu-1"
238
- })(["", " position:relative;width:", ";height:", ";line-height:", ";padding:2px;border-radius:2px;cursor:pointer;flex:0 0 auto;border:", ";color:", ";", " &:focus{box-shadow:", ";}", " ", " &[disabled]{cursor:not-allowed;border-color:", ";", "}"], themes_["mixins"].reset('inline'), diameter, diameter, diameter, Object(themes_["pick"])({
239
- enterprise: Object(themes_["pick"])({
240
- light: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray45),
241
- dark: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray80)
242
- }),
243
- prisma: Object(external_styled_components_["css"])(["2px solid ", ""], themes_["variables"].contentColorMuted)
244
- }), Object(themes_["pick"])({
245
- enterprise: Object(themes_["pick"])({
246
- light: themes_["variables"].gray45,
247
- dark: themes_["variables"].gray80
248
- }),
249
- prisma: themes_["variables"].white
250
- }), Object(themes_["pick"])({
251
- prisma: Object(external_styled_components_["css"])(["top:1px;padding:1px;border-radius:3px;", " ", ""], function (_ref) {
252
- var $interactive = _ref.$interactive;
253
- return $interactive && Object(external_styled_components_["css"])(["&:not([disabled]):not(:focus):hover{box-shadow:0 0 0 2px ", ",0 0 0 5px ", ";}"], themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayHover);
254
- }, function (_ref2) {
255
- var $selected = _ref2.$selected;
256
- return !$selected && Object(external_styled_components_["css"])(["&:not([disabled]):not(:focus):hover{border-color:", ";}"], themes_["variables"].contentColorDefault);
257
- })
258
- }), themes_["variables"].focusShadow, function (_ref3) {
259
- var $selected = _ref3.$selected;
260
- return $selected && Object(external_styled_components_["css"])(["&:not([disabled]){border-color:", ";background-color:", ";}"], Object(themes_["pick"])({
261
- enterprise: {
262
- light: themes_["variables"].gray45,
263
- dark: themes_["variables"].gray80
264
- },
265
- prisma: themes_["variables"].interactiveColorPrimary
266
- }), Object(themes_["pick"])({
267
- enterprise: '#none',
268
- prisma: Object(external_styled_components_["css"])(["", ";"], themes_["variables"].interactiveColorPrimary)
269
- }));
270
- }, function (_ref4) {
271
- var $error = _ref4.$error;
272
- return $error && Object(themes_["pick"])({
273
- enterprise: Object(themes_["pick"])({
274
- light: Object(external_styled_components_["css"])(["&:not([disabled]){border-color:", ";color:", ";", "}"], themes_["variables"].errorColorL30, themes_["variables"].errorColor, function (_ref5) {
275
- var $selected = _ref5.$selected;
276
- return $selected && Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].errorColor);
277
- }),
278
- dark: Object(external_styled_components_["css"])(["border-color:", ";}"], themes_["variables"].errorColor)
279
- }),
280
- prisma: Object(external_styled_components_["css"])(["&:not([disabled]){border-color:", ";", "}"], themes_["variables"].accentColorNegative, function (_ref6) {
281
- var $selected = _ref6.$selected;
282
- return $selected && Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].accentColorNegative);
283
- })
284
- });
285
- }, Object(themes_["pick"])({
286
- enterprise: {
287
- light: themes_["variables"].borderColor,
288
- dark: themes_["variables"].gray45
289
- },
290
- prisma: themes_["variables"].contentColorDisabled
291
- }), function (_ref7) {
292
- var $selected = _ref7.$selected;
293
- return $selected && Object(themes_["pick"])({
294
- prisma: Object(external_styled_components_["css"])(["border-color:transparent;background-color:", ";"], themes_["variables"].interactiveColorBackgroundDisabled)
295
- });
296
- });
297
- var StyledCheckboxSpan = StyledCheckboxClickable.withComponent('span');
298
- var StyledSome = external_styled_components_default.a.div.withConfig({
299
- displayName: "SwitchStyles__StyledSome",
300
- componentId: "sc-844ieu-2"
301
- })(["display:block;margin:", ";height:", ";width:", ";background:currentColor;border-radius:1px;"], Object(themes_["pick"])({
302
- enterprise: '2px',
303
- prisma: '5px 2px'
304
- }), Object(themes_["pick"])({
305
- enterprise: Object(external_styled_components_["css"])(["calc(", " - 10px);"], diameter),
306
- prisma: '2px'
307
- }), Object(themes_["pick"])({
308
- enterprise: Object(external_styled_components_["css"])(["calc(", " - 10px);"], diameter),
309
- prisma: '8px'
310
- }));
311
- var StyledIndicator = external_styled_components_default.a.div.withConfig({
312
- displayName: "SwitchStyles__StyledIndicator",
313
- componentId: "sc-844ieu-3"
314
- })(["background-color:", ";border-color:", ";box-sizing:border-box;border-radius:50%;border-width:1px;position:absolute;left:-1px;top:-1px;", ";", " ", " ", ""], Object(themes_["pick"])({
315
- enterprise: {
316
- light: themes_["variables"].gray98,
317
- dark: themes_["variables"].gray80
318
- },
319
- prisma: themes_["variables"].white
320
- }), Object(themes_["pick"])({
321
- enterprise: {
322
- light: themes_["variables"].gray60,
323
- dark: themes_["variables"].borderColor
324
- },
325
- prisma: themes_["variables"].transparent
326
- }), function (_ref8) {
327
- var $delay = _ref8.$delay;
328
- return $delay && Object(external_styled_components_["css"])(["transition:left ", ";"], $delay);
329
- }, Object(themes_["pick"])({
330
- enterprise: Object(external_styled_components_["css"])(["width:", ";height:", ";border-style:solid;"], diameter, diameter),
331
- prisma: Object(external_styled_components_["css"])(["height:16px;width:16px;margin:2px;border-style:none;box-shadow:", ";"], themes_["variables"].embossShadow)
332
- }), function (_ref9) {
333
- var $disabled = _ref9.$disabled;
334
- return $disabled && Object(external_styled_components_["css"])(["border-color:", ";border-style:solid;background-color:", ";"], Object(themes_["pick"])({
335
- enterprise: {
336
- light: themes_["mixins"].colorWithAlpha(themes_["variables"].borderLightColor, 0.8),
337
- dark: themes_["variables"].gray22
338
- },
339
- prisma: themes_["variables"].transparent
340
- }), Object(themes_["pick"])({
341
- enterprise: {
342
- dark: themes_["variables"].gray45
343
- },
344
- prisma: themes_["mixins"].colorWithAlpha(themes_["variables"].white, 0.3)
345
- }));
346
- }, function (_ref10) {
347
- var $selected = _ref10.$selected;
348
- return $selected && Object(external_styled_components_["css"])(["left:", ";"], Object(themes_["pick"])({
349
- enterprise: Object(external_styled_components_["css"])(["calc(100% - ", " + 1px)"], diameter),
350
- prisma: Object(external_styled_components_["css"])(["calc(100% - ", " + 1px)"], toggleDiameter)
351
- }));
352
- });
353
- var StyledToggleOutline = external_styled_components_default.a.div.withConfig({
354
- displayName: "SwitchStyles__StyledToggleOutline",
355
- componentId: "sc-844ieu-4"
356
- })(["position:absolute;border:1px solid transparent;", ";border-radius:", ";top:-1px;right:-1px;bottom:-1px;left:-1px;z-index:1;", " ", ""], function (_ref11) {
357
- var $delay = _ref11.$delay;
358
- return $delay && Object(external_styled_components_["css"])(["transition:border-color ", ";"], $delay);
359
- }, Object(themes_["pick"])({
360
- enterprise: Object(external_styled_components_["css"])(["calc(", " * 0.5)"], diameter),
361
- prisma: '15px'
362
- }), Object(themes_["pick"])({
363
- prisma: Object(external_styled_components_["css"])(["margin:-6px;"])
364
- }), function (_ref12) {
365
- var $error = _ref12.$error;
366
- return $error && Object(external_styled_components_["css"])(["border-color:", ";"], Object(themes_["pick"])({
367
- enterprise: themes_["variables"].errorColor,
368
- prisma: themes_["variables"].transparent
369
- }));
370
- });
371
- var StyledToggleClickable = external_styled_components_default()(Clickable_default.a).withConfig({
372
- displayName: "SwitchStyles__StyledToggleClickable",
373
- componentId: "sc-844ieu-5"
374
- })(["position:relative;", " border-radius:", ";transition:background-color ", ";flex:0 0 auto;border:1px solid ", ";", " &:not([disabled]){&:focus{outline:0;box-shadow:", ";", "}&:hover ", "{background-color:", ";}&:hover ", "{background-color:", ";}};&[disabled]{border:1px solid ", ";background-color:", ";", " ", "}", ";", ""], Object(themes_["pick"])({
375
- enterprise: Object(themes_["pick"])({
376
- light: Object(external_styled_components_["css"])(["width:calc(", " * 2);background-color:", ";height:", ";"], diameter, themes_["variables"].gray98, diameter),
377
- dark: Object(external_styled_components_["css"])(["width:calc(", " * 2);background-color:", ";height:", ";"], diameter, themes_["variables"].gray45, diameter)
378
- }),
379
- prisma: Object(external_styled_components_["css"])(["width:32px;background-color:", ";height:", ";top:1px;"], themes_["variables"].contentColorMuted, toggleDiameter)
380
- }), diameter, function (props) {
381
- return props.$delay;
382
- }, Object(themes_["pick"])({
383
- enterprise: {
384
- light: themes_["variables"].gray60,
385
- dark: themes_["variables"].borderColor
386
- },
387
- prisma: themes_["variables"].transparent
388
- }), Object(themes_["pick"])({
389
- enterprise: Object(external_styled_components_["css"])(["box-shadow:inset 0 2px 0 rgba(0,0,0,0.1);"])
390
- }), Object(themes_["pick"])({
391
- enterprise: Object(external_styled_components_["css"])(["", ",inset 0 2px 0 rgba(0,0,0,0.1);"], themes_["variables"].focusShadow),
392
- prisma: themes_["variables"].focusShadow
393
- }), Object(themes_["pick"])({
394
- enterprise: Object(external_styled_components_["css"])(["> ", "{border-color:", ";}"],
395
- /* sc-sel */
396
- StyledToggleOutline, themes_["mixins"].colorWithAlpha(themes_["variables"].focusColor, 0.8))
397
- }),
398
- /* sc-sel */
399
- StyledIndicator, Object(themes_["pick"])({
400
- enterprise: Object(themes_["pick"])({
401
- light: themes_["variables"].gray96,
402
- dark: '#b1bcc7'
403
- }),
404
- prisma: themes_["variables"].white
405
- }),
406
- /* sc-sel */
407
- StyledToggleOutline, Object(themes_["pick"])({
408
- prisma: themes_["variables"].interactiveColorOverlayHover
409
- }), Object(themes_["pick"])({
410
- enterprise: {
411
- light: themes_["variables"].borderLightColor,
412
- dark: themes_["variables"].borderColor
413
- },
414
- prisma: themes_["variables"].transparent
415
- }), Object(themes_["pick"])({
416
- enterprise: {
417
- light: themes_["variables"].gray96,
418
- dark: themes_["variables"].gray30
419
- },
420
- prisma: themes_["variables"].interactiveColorBackgroundDisabled
421
- }), Object(themes_["pick"])({
422
- enterprise: Object(external_styled_components_["css"])(["box-shadow:inset 0 2px 0 rgba(0,0,0,0.06);"])
423
- }), function (_ref13) {
424
- var $selected = _ref13.$selected;
425
- return $selected && Object(external_styled_components_["css"])(["border-color:transparent;background-color:", ";"], Object(themes_["pick"])({
426
- enterprise: Object(themes_["pick"])({
427
- light: themes_["variables"].accentColorL40,
428
- dark: themes_["variables"].accentColorD20
429
- }),
430
- prisma: themes_["mixins"].colorWithAlpha(themes_["variables"].interactiveColorPrimary, 0.7)
431
- }));
432
- }, function (_ref14) {
433
- var $selected = _ref14.$selected;
434
- return $selected && Object(external_styled_components_["css"])(["border-color:", ";background-color:", ";", ""], Object(themes_["pick"])({
435
- enterprise: themes_["variables"].accentColorL10,
436
- prisma: themes_["variables"].transparent
437
- }), Object(themes_["pick"])({
438
- enterprise: themes_["variables"].accentColorL10,
439
- prisma: themes_["variables"].interactiveColorPrimary
440
- }), Object(themes_["pick"])({
441
- prisma: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].embossShadow)
442
- }));
443
- }, function (_ref15) {
444
- var $error = _ref15.$error;
445
- return $error && Object(external_styled_components_["css"])(["border-color:", ";", ";"], Object(themes_["pick"])({
446
- enterprise: themes_["variables"].errorColor,
447
- prisma: themes_["variables"].transparent
448
- }), Object(themes_["pick"])({
449
- prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].accentColorNegative)
450
- }));
451
- });
452
- var StyledToggleSpan = StyledToggleClickable.withComponent('span');
453
- var StyledLabel = external_styled_components_default.a.label.withConfig({
454
- displayName: "SwitchStyles__StyledLabel",
455
- componentId: "sc-844ieu-6"
456
- })(["", " flex:1 1 auto;padding-left:", ";color:inherit;", ";"], themes_["mixins"].reset('inline-block'), Object(themes_["pick"])({
457
- enterprise: Object(external_styled_components_["css"])(["", ";"], themes_["variables"].spacingQuarter),
458
- prisma: '8px'
459
- }), function (_ref16) {
460
- var $disabled = _ref16.$disabled;
461
- return !$disabled && Object(external_styled_components_["css"])(["cursor:pointer;"]);
462
- });
463
-
464
- // CONCATENATED MODULE: ./src/Switch/Switch.tsx
465
- 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); }
466
-
467
- 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); }
468
-
469
- 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; }
470
-
471
- 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; }
472
-
473
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
474
-
475
- 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); } }
476
-
477
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
478
-
479
- 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); }
480
-
481
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
482
-
483
- 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); }; }
484
-
485
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
486
-
487
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
488
-
489
- 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; } }
490
-
491
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
492
-
493
- 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; }
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
- var propTypes = {
503
- appearance: external_prop_types_default.a.oneOf(['checkbox', 'toggle']),
504
- children: external_prop_types_default.a.node,
505
- disabled: external_prop_types_default.a.bool,
506
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
507
- error: external_prop_types_default.a.bool,
508
- id: external_prop_types_default.a.string,
509
- inline: external_prop_types_default.a.bool,
510
-
511
- /** @private */
512
- interactive: external_prop_types_default.a.bool,
513
- labelledBy: external_prop_types_default.a.string,
514
- onClick: external_prop_types_default.a.func,
515
-
516
- /** @private. */
517
- required: external_prop_types_default.a.bool,
518
- selected: external_prop_types_default.a.oneOf([true, false, 'some']),
519
- selectedLabel: external_prop_types_default.a.string,
520
- someSelectedLabel: external_prop_types_default.a.string,
521
- unselectedLabel: external_prop_types_default.a.string,
522
- value: external_prop_types_default.a.any
523
- };
524
- var defaultProps = {
525
- appearance: 'checkbox',
526
- disabled: false,
527
- error: false,
528
- inline: false,
529
- interactive: true,
530
- selected: false
531
- };
532
- // unclear why the manual ref is needed here (only for styled-components)
533
- var StyledClickables = {
534
- checkbox: StyledCheckboxClickable,
535
- toggle: StyledToggleClickable
536
- };
537
- var StyledSpans = {
538
- checkbox: StyledCheckboxSpan,
539
- toggle: StyledToggleSpan
540
- };
541
- /**
542
- * `Switch` is a basic form control with an on/off state.
543
- */
544
-
545
- var Switch_Switch = /*#__PURE__*/function (_Component) {
546
- _inherits(Switch, _Component);
547
-
548
- var _super = _createSuper(Switch);
549
-
550
- _createClass(Switch, null, [{
551
- key: "validateProps",
552
- // @docs-props-type SwitchPropsBase
553
- value: function validateProps(_ref) {
554
- var selected = _ref.selected,
555
- appearance = _ref.appearance;
556
-
557
- if (false) {}
66
+ // CONCATENATED MODULE: external "react"
67
+ const a = require("react");
68
+ var t = e.n(a);
69
+ // CONCATENATED MODULE: external "prop-types"
70
+ const i = require("prop-types");
71
+ var o = e.n(i);
72
+ // CONCATENATED MODULE: external "@splunk/react-ui/AnimationToggle"
73
+ const n = require("@splunk/react-ui/AnimationToggle");
74
+ var l = e.n(n);
75
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
76
+ const s = require("@splunk/react-ui/ScreenReaderContent");
77
+ var c = e.n(s);
78
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
79
+ const d = require("@splunk/ui-utils/id");
80
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Check"
81
+ const p = require("@splunk/react-icons/enterprise/Check");
82
+ var u = e.n(p);
83
+ // CONCATENATED MODULE: external "@splunk/themes"
84
+ const b = require("@splunk/themes");
85
+ // CONCATENATED MODULE: ./src/Switch/CheckIcon.tsx
86
+ function v() {
87
+ var e = (0, b.useSplunkTheme)(), r = e.family;
88
+ if (r === "enterprise") {
89
+
90
+ return t().createElement(u(), {
91
+ inline: false,
92
+ size: "12px",
93
+ screenReaderText: null,
94
+ hideDefaultTooltip: true,
95
+ style: {
96
+ marginTop: "1px"
97
+ }
98
+ });
99
+ }
100
+
101
+ return t().createElement("svg", {
102
+ width: "12",
103
+ height: "12",
104
+ viewBox: "-1 -2 11 10",
105
+ style: {
106
+ display: "block"
107
+ },
108
+ xmlns: "http://www.w3.org/2000/svg"
109
+ }, t().createElement("path", {
110
+ d: "M8.70711 0.292893C9.09763 0.683417 9.09763 1.31658 8.70711 1.70711L4.32132 6.0929C3.73559 6.67862 2.78596 6.67869 2.20015 6.09305L0.292997 4.18646C-0.0975845 3.79599 -0.0976776 3.16282 0.292789 2.77224C0.683256 2.38166 1.31642 2.38157 1.707 2.77203L3.26061 4.32518L7.29289 0.292893C7.68342 -0.0976311 8.31658 -0.0976311 8.70711 0.292893Z",
111
+ fill: "currentColor"
112
+ }));
558
113
  }
559
- }]);
560
-
561
- function Switch(props) {
562
- var _this;
563
-
564
- _classCallCheck(this, Switch);
565
-
566
- _this = _super.call(this, props);
567
-
568
- _defineProperty(_assertThisInitialized(_this), "clickableId", void 0);
569
-
570
- _defineProperty(_assertThisInitialized(_this), "labelId", void 0);
571
-
572
- _defineProperty(_assertThisInitialized(_this), "toggle", null);
573
-
574
- _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", Switch.validateProps);
575
-
576
- _defineProperty(_assertThisInitialized(_this), "handleContainerClick", function (e) {
577
- var _this$props$onClick, _this$props2;
578
-
579
- var _this$props = _this.props,
580
- value = _this$props.value,
581
- selected = _this$props.selected;
582
- (_this$props$onClick = (_this$props2 = _this.props).onClick) === null || _this$props$onClick === void 0 ? void 0 : _this$props$onClick.call(_this$props2, e, {
583
- value: value,
584
- // @ts-expect-error - safe due to individual prop interfaces
585
- selected: selected
586
- });
587
- });
588
-
589
- _this.labelId = Object(id_["createDOMID"])('label');
590
- _this.clickableId = Object(id_["createDOMID"])('clickable');
591
- Switch.validateProps(props);
592
- return _this;
593
- }
594
-
595
- _createClass(Switch, [{
596
- key: "focus",
597
-
598
- /**
599
- * Place focus on the toggle.
600
- */
601
- value: function focus() {
602
- var _this$toggle;
603
-
604
- (_this$toggle = this.toggle) === null || _this$toggle === void 0 ? void 0 : _this$toggle.focus();
605
- }
606
- }, {
607
- key: "render",
608
- value: function render() {
609
- var _this2 = this;
610
-
611
- var _this$props3 = this.props,
612
- appearance = _this$props3.appearance,
613
- children = _this$props3.children,
614
- disabled = _this$props3.disabled,
615
- error = _this$props3.error,
616
- id = _this$props3.id,
617
- inline = _this$props3.inline,
618
- interactive = _this$props3.interactive,
619
- labelledBy = _this$props3.labelledBy,
620
- onClick = _this$props3.onClick,
621
- required = _this$props3.required,
622
- selected = _this$props3.selected,
623
- selectedLabel = _this$props3.selectedLabel,
624
- someSelectedLabel = _this$props3.someSelectedLabel,
625
- unselectedLabel = _this$props3.unselectedLabel,
626
- value = _this$props3.value,
627
- otherProps = _objectWithoutProperties(_this$props3, ["appearance", "children", "disabled", "error", "id", "inline", "interactive", "labelledBy", "onClick", "required", "selected", "selectedLabel", "someSelectedLabel", "unselectedLabel", "value"]);
628
-
629
- var labelId = labelledBy; // consumer defined external label
630
-
631
- var clickableId = id; // consumer defined id
632
- // if has internal label defined with children....
633
-
634
- if (children) {
635
- labelId = this.labelId; // must use generated labelId
636
-
637
- clickableId = id || this.clickableId; // must have an id
638
- }
639
-
640
- var ariaChecked = selected === 'some' ? 'mixed' : selected;
641
- var stateLabels = {
642
- "true": selectedLabel,
643
- "false": unselectedLabel,
644
- some: someSelectedLabel
645
- };
646
- var switchProps = {
647
- disabled: disabled,
648
- $interactive: interactive,
649
- $error: error,
650
- $selected: selected === 'some' || selected,
651
- 'aria-labelledby': interactive ? labelId : undefined,
652
- 'aria-checked': interactive ? ariaChecked : undefined,
653
- 'aria-invalid': error ? true : undefined,
654
- 'aria-required': required,
655
- id: clickableId,
656
- ref: function ref(c) {
657
- _this2.toggle = c;
114
+ // CONCATENATED MODULE: external "styled-components"
115
+ const f = require("styled-components");
116
+ var h = e.n(f);
117
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
118
+ const g = require("@splunk/react-ui/Box");
119
+ var m = e.n(g);
120
+ // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
121
+ const y = require("@splunk/react-ui/Clickable");
122
+ var k = e.n(y);
123
+ // CONCATENATED MODULE: ./src/Switch/SwitchStyles.ts
124
+ var x = "18px";
125
+ var C = "20px";
126
+ var w = h()(m()).withConfig({
127
+ displayName: "SwitchStyles__StyledBox",
128
+ componentId: "sc-844ieu-0"
129
+ })([ "display:inline;position:relative;color:", ";flex-shrink:0;padding:", ";[data-inline] + &{margin-left:", ";}" ], (0,
130
+ b.pickVariant)("$switchState", {
131
+ error: {
132
+ enterprise: b.variables.errorColor,
133
+ prisma: b.variables.accentColorNegative
134
+ },
135
+ disabled: {
136
+ enterprise: b.variables.textDisabledColor,
137
+ prisma: b.variables.contentColorDisabled
138
+ }
139
+ }), (0, b.pick)({
140
+ enterprise: (0, f.css)([ "calc((", " - ", ") / 2) 0" ], b.variables.inputHeight, x),
141
+ prisma: {
142
+ compact: "6px 0",
143
+ comfortable: "10px 0"
144
+ }
145
+ }), (0, b.pick)({
146
+ enterprise: b.variables.spacingHalf,
147
+ prisma: b.variables.spacingSmall
148
+ }));
149
+ var S = h()(k()).withConfig({
150
+ displayName: "SwitchStyles__StyledCheckboxClickable",
151
+ componentId: "sc-844ieu-1"
152
+ })([ "", " position:relative;width:", ";height:", ";line-height:", ";padding:2px;border-radius:2px;cursor:pointer;flex:0 0 auto;border:", ";color:", ";", " &:focus{box-shadow:", ";}", " ", " &[disabled]{cursor:not-allowed;border-color:", ";", "}" ], b.mixins.reset("inline"), x, x, x, (0,
153
+ b.pick)({
154
+ enterprise: (0, b.pick)({
155
+ light: (0, f.css)([ "1px solid ", "" ], b.variables.gray45),
156
+ dark: (0, f.css)([ "1px solid ", "" ], b.variables.gray80)
157
+ }),
158
+ prisma: (0, f.css)([ "2px solid ", "" ], b.variables.contentColorMuted)
159
+ }), (0, b.pick)({
160
+ enterprise: (0, b.pick)({
161
+ light: b.variables.gray45,
162
+ dark: b.variables.gray80
163
+ }),
164
+ prisma: b.variables.white
165
+ }), (0, b.pick)({
166
+ prisma: (0, f.css)([ "top:1px;padding:1px;border-radius:3px;", " ", "" ], (function(e) {
167
+ var r = e.$interactive;
168
+ return r && (0, f.css)([ "&:not([disabled]):not(:focus):hover{box-shadow:0 0 0 2px ", ",0 0 0 5px ", ";}" ], b.variables.backgroundColorPage, b.variables.interactiveColorOverlayHover);
169
+ }), (function(e) {
170
+ var r = e.$selected;
171
+ return !r && (0, f.css)([ "&:not([disabled]):not(:focus):hover{border-color:", ";}" ], b.variables.contentColorDefault);
172
+ }))
173
+ }), b.variables.focusShadow, (function(e) {
174
+ var r = e.$selected;
175
+ return r && (0, f.css)([ "&:not([disabled]){border-color:", ";background-color:", ";}" ], (0,
176
+ b.pick)({
177
+ enterprise: {
178
+ light: b.variables.gray45,
179
+ dark: b.variables.gray80
180
+ },
181
+ prisma: b.variables.interactiveColorPrimary
182
+ }), (0, b.pick)({
183
+ enterprise: "#none",
184
+ prisma: (0, f.css)([ "", ";" ], b.variables.interactiveColorPrimary)
185
+ }));
186
+ }), (function(e) {
187
+ var r = e.$error;
188
+ return r && (0, b.pick)({
189
+ enterprise: (0, b.pick)({
190
+ light: (0, f.css)([ "&:not([disabled]){border-color:", ";color:", ";", "}" ], b.variables.errorColorL30, b.variables.errorColor, (function(e) {
191
+ var r = e.$selected;
192
+ return r && (0, f.css)([ "border-color:", ";" ], b.variables.errorColor);
193
+ })),
194
+ dark: (0, f.css)([ "border-color:", ";}" ], b.variables.errorColor)
195
+ }),
196
+ prisma: (0, f.css)([ "&:not([disabled]){border-color:", ";", "}" ], b.variables.accentColorNegative, (function(e) {
197
+ var r = e.$selected;
198
+ return r && (0, f.css)([ "background-color:", ";" ], b.variables.accentColorNegative);
199
+ }))
200
+ });
201
+ }), (0, b.pick)({
202
+ enterprise: {
203
+ light: b.variables.borderColor,
204
+ dark: b.variables.gray45
205
+ },
206
+ prisma: b.variables.contentColorDisabled
207
+ }), (function(e) {
208
+ var r = e.$selected;
209
+ return r && (0, b.pick)({
210
+ prisma: (0, f.css)([ "border-color:transparent;background-color:", ";" ], b.variables.interactiveColorBackgroundDisabled)
211
+ });
212
+ }));
213
+ var O = S.withComponent("span");
214
+ var $ = h().div.withConfig({
215
+ displayName: "SwitchStyles__StyledSome",
216
+ componentId: "sc-844ieu-2"
217
+ })([ "display:block;margin:", ";height:", ";width:", ";background:currentColor;border-radius:1px;" ], (0,
218
+ b.pick)({
219
+ enterprise: "2px",
220
+ prisma: "5px 2px"
221
+ }), (0, b.pick)({
222
+ enterprise: (0, f.css)([ "calc(", " - 10px);" ], x),
223
+ prisma: "2px"
224
+ }), (0, b.pick)({
225
+ enterprise: (0, f.css)([ "calc(", " - 10px);" ], x),
226
+ prisma: "8px"
227
+ }));
228
+ var _ = h().div.withConfig({
229
+ displayName: "SwitchStyles__StyledIndicator",
230
+ componentId: "sc-844ieu-3"
231
+ })([ "background-color:", ";border-color:", ";box-sizing:border-box;border-radius:50%;border-width:1px;position:absolute;left:-1px;top:-1px;", ";", " ", " ", "" ], (0,
232
+ b.pick)({
233
+ enterprise: {
234
+ light: b.variables.gray98,
235
+ dark: b.variables.gray80
236
+ },
237
+ prisma: b.variables.white
238
+ }), (0, b.pick)({
239
+ enterprise: {
240
+ light: b.variables.gray60,
241
+ dark: b.variables.borderColor
658
242
  },
659
- onClick: disabled || !interactive ? undefined : this.handleContainerClick,
660
- 'data-test': 'button',
661
- 'data-selected': selected
662
- };
663
- var StyledClickable = StyledClickables[appearance];
664
- var StyledSpan = StyledSpans[appearance];
665
-
666
- var renderToggle = function renderToggle(delay) {
667
- return function () {
668
- var toggleChildren = /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(StyledIndicator, {
669
- $delay: delay,
670
- $disabled: disabled,
671
- $error: !disabled && error,
672
- $selected: selected
673
- }), /*#__PURE__*/external_react_default.a.createElement(StyledToggleOutline, {
674
- $delay: delay,
675
- $error: !disabled && error
676
- }));
677
- return interactive ? /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({
678
- role: "switch"
679
- }, switchProps, {
680
- $delay: delay
681
- }), toggleChildren) : /*#__PURE__*/external_react_default.a.createElement(StyledSpan, _extends({}, switchProps, {
682
- $delay: delay
683
- }), toggleChildren);
243
+ prisma: b.variables.transparent
244
+ }), (function(e) {
245
+ var r = e.$delay;
246
+ return r && (0, f.css)([ "transition:left ", ";" ], r);
247
+ }), (0, b.pick)({
248
+ enterprise: (0, f.css)([ "width:", ";height:", ";border-style:solid;" ], x, x),
249
+ prisma: (0, f.css)([ "height:16px;width:16px;margin:2px;border-style:none;box-shadow:", ";" ], b.variables.embossShadow)
250
+ }), (function(e) {
251
+ var r = e.$disabled;
252
+ return r && (0, f.css)([ "border-color:", ";border-style:solid;background-color:", ";" ], (0,
253
+ b.pick)({
254
+ enterprise: {
255
+ light: b.mixins.colorWithAlpha(b.variables.borderLightColor, .8),
256
+ dark: b.variables.gray22
257
+ },
258
+ prisma: b.variables.transparent
259
+ }), (0, b.pick)({
260
+ enterprise: {
261
+ dark: b.variables.gray45
262
+ },
263
+ prisma: b.mixins.colorWithAlpha(b.variables.white, .3)
264
+ }));
265
+ }), (function(e) {
266
+ var r = e.$selected;
267
+ return r && (0, f.css)([ "left:", ";" ], (0, b.pick)({
268
+ enterprise: (0, f.css)([ "calc(100% - ", " + 1px)" ], x),
269
+ prisma: (0, f.css)([ "calc(100% - ", " + 1px)" ], C)
270
+ }));
271
+ }));
272
+ var P = h().div.withConfig({
273
+ displayName: "SwitchStyles__StyledToggleOutline",
274
+ componentId: "sc-844ieu-4"
275
+ })([ "position:absolute;border:1px solid transparent;", ";border-radius:", ";top:-1px;right:-1px;bottom:-1px;left:-1px;z-index:1;", " ", "" ], (function(e) {
276
+ var r = e.$delay;
277
+ return r && (0, f.css)([ "transition:border-color ", ";" ], r);
278
+ }), (0, b.pick)({
279
+ enterprise: (0, f.css)([ "calc(", " * 0.5)" ], x),
280
+ prisma: "15px"
281
+ }), (0, b.pick)({
282
+ prisma: (0, f.css)([ "margin:-6px;" ])
283
+ }), (function(e) {
284
+ var r = e.$error;
285
+ return r && (0, f.css)([ "border-color:", ";" ], (0, b.pick)({
286
+ enterprise: b.variables.errorColor,
287
+ prisma: b.variables.transparent
288
+ }));
289
+ }));
290
+ var E = h()(k()).withConfig({
291
+ displayName: "SwitchStyles__StyledToggleClickable",
292
+ componentId: "sc-844ieu-5"
293
+ })([ "position:relative;", " border-radius:", ";transition:background-color ", ";flex:0 0 auto;border:1px solid ", ";", " &:not([disabled]){&:focus{outline:0;box-shadow:", ";", "}&:hover ", "{background-color:", ";}&:hover ", "{background-color:", ";}};&[disabled]{border:1px solid ", ";background-color:", ";", " ", "}", ";", "" ], (0,
294
+ b.pick)({
295
+ enterprise: (0, b.pick)({
296
+ light: (0, f.css)([ "width:calc(", " * 2);background-color:", ";height:", ";" ], x, b.variables.gray98, x),
297
+ dark: (0, f.css)([ "width:calc(", " * 2);background-color:", ";height:", ";" ], x, b.variables.gray45, x)
298
+ }),
299
+ prisma: (0, f.css)([ "width:32px;background-color:", ";height:", ";top:1px;" ], b.variables.contentColorMuted, C)
300
+ }), x, (function(e) {
301
+ return e.$delay;
302
+ }), (0, b.pick)({
303
+ enterprise: {
304
+ light: b.variables.gray60,
305
+ dark: b.variables.borderColor
306
+ },
307
+ prisma: b.variables.transparent
308
+ }), (0, b.pick)({
309
+ enterprise: (0, f.css)([ "box-shadow:inset 0 2px 0 rgba(0,0,0,0.1);" ])
310
+ }), (0, b.pick)({
311
+ enterprise: (0, f.css)([ "", ",inset 0 2px 0 rgba(0,0,0,0.1);" ], b.variables.focusShadow),
312
+ prisma: b.variables.focusShadow
313
+ }), (0, b.pick)({
314
+ enterprise: (0, f.css)([ "> ", "{border-color:", ";}" ],
315
+ /* sc-sel */
316
+ P, b.mixins.colorWithAlpha(b.variables.focusColor, .8))
317
+ }),
318
+ /* sc-sel */
319
+ _, (0, b.pick)({
320
+ enterprise: (0, b.pick)({
321
+ light: b.variables.gray96,
322
+ dark: "#b1bcc7"
323
+ }),
324
+ prisma: b.variables.white
325
+ }),
326
+ /* sc-sel */
327
+ P, (0, b.pick)({
328
+ prisma: b.variables.interactiveColorOverlayHover
329
+ }), (0, b.pick)({
330
+ enterprise: {
331
+ light: b.variables.borderLightColor,
332
+ dark: b.variables.borderColor
333
+ },
334
+ prisma: b.variables.transparent
335
+ }), (0, b.pick)({
336
+ enterprise: {
337
+ light: b.variables.gray96,
338
+ dark: b.variables.gray30
339
+ },
340
+ prisma: b.variables.interactiveColorBackgroundDisabled
341
+ }), (0, b.pick)({
342
+ enterprise: (0, f.css)([ "box-shadow:inset 0 2px 0 rgba(0,0,0,0.06);" ])
343
+ }), (function(e) {
344
+ var r = e.$selected;
345
+ return r && (0, f.css)([ "border-color:transparent;background-color:", ";" ], (0,
346
+ b.pick)({
347
+ enterprise: (0, b.pick)({
348
+ light: b.variables.accentColorL40,
349
+ dark: b.variables.accentColorD20
350
+ }),
351
+ prisma: b.mixins.colorWithAlpha(b.variables.interactiveColorPrimary, .7)
352
+ }));
353
+ }), (function(e) {
354
+ var r = e.$selected;
355
+ return r && (0, f.css)([ "border-color:", ";background-color:", ";", "" ], (0, b.pick)({
356
+ enterprise: b.variables.accentColorL10,
357
+ prisma: b.variables.transparent
358
+ }), (0, b.pick)({
359
+ enterprise: b.variables.accentColorL10,
360
+ prisma: b.variables.interactiveColorPrimary
361
+ }), (0, b.pick)({
362
+ prisma: (0, f.css)([ "box-shadow:", ";" ], b.variables.embossShadow)
363
+ }));
364
+ }), (function(e) {
365
+ var r = e.$error;
366
+ return r && (0, f.css)([ "border-color:", ";", ";" ], (0, b.pick)({
367
+ enterprise: b.variables.errorColor,
368
+ prisma: b.variables.transparent
369
+ }), (0, b.pick)({
370
+ prisma: (0, f.css)([ "background-color:", ";" ], b.variables.accentColorNegative)
371
+ }));
372
+ }));
373
+ var L = E.withComponent("span");
374
+ var j = h().label.withConfig({
375
+ displayName: "SwitchStyles__StyledLabel",
376
+ componentId: "sc-844ieu-6"
377
+ })([ "", " flex:1 1 auto;padding-left:", ";color:inherit;", ";" ], b.mixins.reset("inline-block"), (0,
378
+ b.pick)({
379
+ enterprise: (0, f.css)([ "", ";" ], b.variables.spacingQuarter),
380
+ prisma: "8px"
381
+ }), (function(e) {
382
+ var r = e.$disabled;
383
+ return !r && (0, f.css)([ "cursor:pointer;" ]);
384
+ }));
385
+ // CONCATENATED MODULE: ./src/Switch/Switch.tsx
386
+ function I(e) {
387
+ "@babel/helpers - typeof";
388
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
389
+ I = function e(r) {
390
+ return typeof r;
391
+ };
392
+ } else {
393
+ I = function e(r) {
394
+ return r && typeof Symbol === "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
395
+ };
396
+ }
397
+ return I(e);
398
+ }
399
+ function D() {
400
+ D = Object.assign || function(e) {
401
+ for (var r = 1; r < arguments.length; r++) {
402
+ var a = arguments[r];
403
+ for (var t in a) {
404
+ if (Object.prototype.hasOwnProperty.call(a, t)) {
405
+ e[t] = a[t];
406
+ }
407
+ }
408
+ }
409
+ return e;
684
410
  };
685
- };
686
-
687
- var renderNonToggle = function renderNonToggle() {
688
- var nonToggleChildren = /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, selected === true && appearance === 'checkbox' && /*#__PURE__*/external_react_default.a.createElement(CheckIcon, null), selected === 'some' && appearance === 'checkbox' && /*#__PURE__*/external_react_default.a.createElement(StyledSome, null));
689
- return interactive ? /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({
690
- "data-clickable": true,
691
- role: appearance
692
- }, switchProps), nonToggleChildren) : /*#__PURE__*/external_react_default.a.createElement(StyledSpan, switchProps, nonToggleChildren);
693
- };
694
-
695
- var switchState = disabled && 'disabled' || error && 'error' || null;
696
- var hasCustomizedScreenReaderContent = !!selectedLabel || !!someSelectedLabel || !!unselectedLabel;
697
- return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
698
- flex: true,
699
- inline: inline,
700
- "data-test": "switch",
701
- "data-test-selected": selected,
702
- "data-test-value": value,
703
- "data-test-error": error ? true : undefined,
704
- "data-error": error ? true : undefined,
705
- "data-disabled": disabled ? true : undefined,
706
- $switchState: switchState
707
- }, otherProps), appearance === 'toggle' && /*#__PURE__*/external_react_default.a.createElement(AnimationToggle_default.a, {
708
- on: renderToggle('200ms'),
709
- off: renderToggle()
710
- }), appearance !== 'toggle' && renderNonToggle(), interactive && hasCustomizedScreenReaderContent && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, stateLabels["".concat(selected)]), children && /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
711
- $disabled: disabled,
712
- "data-test": "label",
713
- id: labelId,
714
- htmlFor: clickableId,
715
- "data-disabled": disabled || null
716
- }, children));
411
+ return D.apply(this, arguments);
412
+ }
413
+ function q(e, r) {
414
+ if (e == null) return {};
415
+ var a = T(e, r);
416
+ var t, i;
417
+ if (Object.getOwnPropertySymbols) {
418
+ var o = Object.getOwnPropertySymbols(e);
419
+ for (i = 0; i < o.length; i++) {
420
+ t = o[i];
421
+ if (r.indexOf(t) >= 0) continue;
422
+ if (!Object.prototype.propertyIsEnumerable.call(e, t)) continue;
423
+ a[t] = e[t];
424
+ }
425
+ }
426
+ return a;
427
+ }
428
+ function T(e, r) {
429
+ if (e == null) return {};
430
+ var a = {};
431
+ var t = Object.keys(e);
432
+ var i, o;
433
+ for (o = 0; o < t.length; o++) {
434
+ i = t[o];
435
+ if (r.indexOf(i) >= 0) continue;
436
+ a[i] = e[i];
437
+ }
438
+ return a;
439
+ }
440
+ function N(e, r) {
441
+ if (!(e instanceof r)) {
442
+ throw new TypeError("Cannot call a class as a function");
443
+ }
444
+ }
445
+ function R(e, r) {
446
+ for (var a = 0; a < r.length; a++) {
447
+ var t = r[a];
448
+ t.enumerable = t.enumerable || false;
449
+ t.configurable = true;
450
+ if ("value" in t) t.writable = true;
451
+ Object.defineProperty(e, t.key, t);
452
+ }
717
453
  }
718
- }]);
719
-
720
- return Switch;
721
- }(external_react_["Component"]);
722
-
723
- _defineProperty(Switch_Switch, "propTypes", propTypes);
724
-
725
- _defineProperty(Switch_Switch, "defaultProps", defaultProps);
726
-
727
- /* harmony default export */ var src_Switch_Switch = (Switch_Switch);
728
- // CONCATENATED MODULE: ./src/Switch/index.ts
729
-
730
-
731
-
732
- /***/ }),
733
-
734
- /***/ 3:
735
- /***/ (function(module, exports) {
736
-
737
- module.exports = require("styled-components");
738
-
739
- /***/ }),
740
-
741
- /***/ 51:
742
- /***/ (function(module, exports) {
743
-
744
- module.exports = require("@splunk/react-ui/AnimationToggle");
745
-
746
- /***/ }),
747
-
748
- /***/ 6:
749
- /***/ (function(module, exports) {
750
-
751
- module.exports = require("@splunk/react-ui/Box");
752
-
753
- /***/ }),
754
-
755
- /***/ 8:
756
- /***/ (function(module, exports) {
757
-
758
- module.exports = require("@splunk/ui-utils/id");
759
-
760
- /***/ }),
761
-
762
- /***/ 97:
763
- /***/ (function(module, exports) {
764
-
765
- module.exports = require("@splunk/react-icons/enterprise/Check");
766
-
767
- /***/ })
768
-
769
- /******/ });
454
+ function B(e, r, a) {
455
+ if (r) R(e.prototype, r);
456
+ if (a) R(e, a);
457
+ return e;
458
+ }
459
+ function M(e, r) {
460
+ if (typeof r !== "function" && r !== null) {
461
+ throw new TypeError("Super expression must either be null or a function");
462
+ }
463
+ e.prototype = Object.create(r && r.prototype, {
464
+ constructor: {
465
+ value: e,
466
+ writable: true,
467
+ configurable: true
468
+ }
469
+ });
470
+ if (r) A(e, r);
471
+ }
472
+ function A(e, r) {
473
+ A = Object.setPrototypeOf || function e(r, a) {
474
+ r.__proto__ = a;
475
+ return r;
476
+ };
477
+ return A(e, r);
478
+ }
479
+ function H(e) {
480
+ var r = F();
481
+ return function a() {
482
+ var t = Q(e), i;
483
+ if (r) {
484
+ var o = Q(this).constructor;
485
+ i = Reflect.construct(t, arguments, o);
486
+ } else {
487
+ i = t.apply(this, arguments);
488
+ }
489
+ return W(this, i);
490
+ };
491
+ }
492
+ function W(e, r) {
493
+ if (r && (I(r) === "object" || typeof r === "function")) {
494
+ return r;
495
+ }
496
+ return z(e);
497
+ }
498
+ function z(e) {
499
+ if (e === void 0) {
500
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
501
+ }
502
+ return e;
503
+ }
504
+ function F() {
505
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
506
+ if (Reflect.construct.sham) return false;
507
+ if (typeof Proxy === "function") return true;
508
+ try {
509
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
510
+ return true;
511
+ } catch (e) {
512
+ return false;
513
+ }
514
+ }
515
+ function Q(e) {
516
+ Q = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
517
+ return r.__proto__ || Object.getPrototypeOf(r);
518
+ };
519
+ return Q(e);
520
+ }
521
+ function U(e, r, a) {
522
+ if (r in e) {
523
+ Object.defineProperty(e, r, {
524
+ value: a,
525
+ enumerable: true,
526
+ configurable: true,
527
+ writable: true
528
+ });
529
+ } else {
530
+ e[r] = a;
531
+ }
532
+ return e;
533
+ }
534
+ var V = {
535
+ appearance: o().oneOf([ "checkbox", "toggle" ]),
536
+ children: o().node,
537
+ disabled: o().bool,
538
+ elementRef: o().oneOfType([ o().func, o().object ]),
539
+ error: o().bool,
540
+ id: o().string,
541
+ inline: o().bool,
542
+ /** @private */
543
+ interactive: o().bool,
544
+ labelledBy: o().string,
545
+ onClick: o().func,
546
+ /** @private. */
547
+ required: o().bool,
548
+ selected: o().oneOf([ true, false, "some" ]),
549
+ selectedLabel: o().string,
550
+ someSelectedLabel: o().string,
551
+ unselectedLabel: o().string,
552
+ value: o().any
553
+ };
554
+ var Z = {
555
+ appearance: "checkbox",
556
+ disabled: false,
557
+ error: false,
558
+ inline: false,
559
+ interactive: true,
560
+ selected: false
561
+ };
562
+ // unclear why the manual ref is needed here (only for styled-components)
563
+ var G = {
564
+ checkbox: S,
565
+ toggle: E
566
+ };
567
+ var J = {
568
+ checkbox: O,
569
+ toggle: L
570
+ };
571
+ /**
572
+ * `Switch` is a basic form control with an on/off state.
573
+ */ var K = function(e) {
574
+ M(a, e);
575
+ var r = H(a);
576
+ B(a, null, [ {
577
+ key: "validateProps",
578
+ // @docs-props-type SwitchPropsBase
579
+ value: function e(r) {
580
+ var a = r.selected, t = r.appearance;
581
+ if (false) {}
582
+ }
583
+ } ]);
584
+ function a(e) {
585
+ var t;
586
+ N(this, a);
587
+ t = r.call(this, e);
588
+ U(z(t), "clickableId", void 0);
589
+ U(z(t), "labelId", void 0);
590
+ U(z(t), "toggle", null);
591
+ U(z(t), "componentDidUpdate", a.validateProps);
592
+ U(z(t), "handleContainerClick", (function(e) {
593
+ var r, a;
594
+ var i = t.props, o = i.value, n = i.selected;
595
+ (r = (a = t.props).onClick) === null || r === void 0 ? void 0 : r.call(a, e, {
596
+ value: o,
597
+ // @ts-expect-error - safe due to individual prop interfaces
598
+ selected: n
599
+ });
600
+ }));
601
+ t.labelId = (0, d.createDOMID)("label");
602
+ t.clickableId = (0, d.createDOMID)("clickable");
603
+ a.validateProps(e);
604
+ return t;
605
+ }
606
+ B(a, [ {
607
+ key: "focus",
608
+ /**
609
+ * Place focus on the toggle.
610
+ */
611
+ value: function e() {
612
+ var r;
613
+ (r = this.toggle) === null || r === void 0 ? void 0 : r.focus();
614
+ }
615
+ }, {
616
+ key: "render",
617
+ value: function e() {
618
+ var r = this;
619
+ var a = this.props, i = a.appearance, o = a.children, n = a.disabled, s = a.error, d = a.id, p = a.inline, u = a.interactive, b = a.labelledBy, f = a.onClick, h = a.required, g = a.selected, m = a.selectedLabel, y = a.someSelectedLabel, k = a.unselectedLabel, x = a.value, C = q(a, [ "appearance", "children", "disabled", "error", "id", "inline", "interactive", "labelledBy", "onClick", "required", "selected", "selectedLabel", "someSelectedLabel", "unselectedLabel", "value" ]);
620
+ var S = b;
621
+ // consumer defined external label
622
+ var O = d;
623
+ // consumer defined id
624
+ // if has internal label defined with children....
625
+ if (o) {
626
+ S = this.labelId;
627
+ // must use generated labelId
628
+ O = d || this.clickableId;
629
+ // must have an id
630
+ }
631
+ var E = g === "some" ? "mixed" : g;
632
+ var L = {
633
+ true: m,
634
+ false: k,
635
+ some: y
636
+ };
637
+ var I = {
638
+ disabled: n,
639
+ $interactive: u,
640
+ $error: s,
641
+ $selected: g === "some" || g,
642
+ "aria-labelledby": u ? S : undefined,
643
+ "aria-checked": u ? E : undefined,
644
+ "aria-invalid": s ? true : undefined,
645
+ "aria-required": h,
646
+ id: O,
647
+ ref: function e(a) {
648
+ r.toggle = a;
649
+ },
650
+ onClick: n || !u ? undefined : this.handleContainerClick,
651
+ "data-test": "button",
652
+ "data-selected": g
653
+ };
654
+ var T = G[i];
655
+ var N = J[i];
656
+ var R = function e(r) {
657
+ return function() {
658
+ var e = t().createElement(t().Fragment, null, t().createElement(_, {
659
+ $delay: r,
660
+ $disabled: n,
661
+ $error: !n && s,
662
+ $selected: g
663
+ }), t().createElement(P, {
664
+ $delay: r,
665
+ $error: !n && s
666
+ }));
667
+ return u ? t().createElement(T, D({
668
+ role: "switch"
669
+ }, I, {
670
+ $delay: r
671
+ }), e) : t().createElement(N, D({}, I, {
672
+ $delay: r
673
+ }), e);
674
+ };
675
+ };
676
+ var B = function e() {
677
+ var r = t().createElement(t().Fragment, null, g === true && i === "checkbox" && t().createElement(v, null), g === "some" && i === "checkbox" && t().createElement($, null));
678
+ return u ? t().createElement(T, D({
679
+ "data-clickable": true,
680
+ role: i
681
+ }, I), r) : t().createElement(N, I, r);
682
+ };
683
+ var M = n && "disabled" || s && "error" || null;
684
+ var A = !!m || !!y || !!k;
685
+
686
+ return t().createElement(w, D({
687
+ flex: true,
688
+ inline: p,
689
+ "data-test": "switch",
690
+ "data-test-selected": g,
691
+ "data-test-value": x,
692
+ "data-test-error": s ? true : undefined,
693
+ "data-error": s ? true : undefined,
694
+ "data-disabled": n ? true : undefined,
695
+ $switchState: M
696
+ }, C), i === "toggle" && t().createElement(l(), {
697
+ on: R("200ms"),
698
+ off: R()
699
+ }), i !== "toggle" && B(), u && A && t().createElement(c(), null, L["".concat(g)]), o && t().createElement(j, {
700
+ $disabled: n,
701
+ "data-test": "label",
702
+ id: S,
703
+ htmlFor: O,
704
+ "data-disabled": n || null
705
+ }, o));
706
+ }
707
+ } ]);
708
+ return a;
709
+ }(a.Component);
710
+ U(K, "propTypes", V);
711
+ U(K, "defaultProps", Z);
712
+ /* harmony default export */ const X = K;
713
+ // CONCATENATED MODULE: ./src/Switch/index.ts
714
+ module.exports = r;
715
+ /******/})();