@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/RadioList.js CHANGED
@@ -1,547 +1,486 @@
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 = 189);
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
- /***/ 189:
105
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
-
107
- "use strict";
108
- // ESM COMPAT FLAG
109
- __webpack_require__.r(__webpack_exports__);
110
-
111
- // EXPORTS
112
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ RadioList_RadioList; });
113
- __webpack_require__.d(__webpack_exports__, "Option", function() { return /* reexport */ RadioList_Option; });
114
-
115
- // EXTERNAL MODULE: external "react"
116
- var external_react_ = __webpack_require__(2);
117
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
118
-
119
- // EXTERNAL MODULE: external "prop-types"
120
- var external_prop_types_ = __webpack_require__(1);
121
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
122
-
123
- // EXTERNAL MODULE: external "lodash/omit"
124
- var omit_ = __webpack_require__(5);
125
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
126
-
127
- // EXTERNAL MODULE: external "@splunk/ui-utils/id"
128
- var id_ = __webpack_require__(8);
129
-
130
- // CONCATENATED MODULE: ./src/RadioList/RadioListContext.ts
131
-
132
- var RadioListContext = /*#__PURE__*/Object(external_react_["createContext"])({});
133
- RadioListContext.displayName = 'RadioList';
134
- /* harmony default export */ var RadioList_RadioListContext = (RadioListContext);
135
- // EXTERNAL MODULE: external "styled-components"
136
- var external_styled_components_ = __webpack_require__(3);
137
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
138
-
139
- // EXTERNAL MODULE: external "@splunk/themes"
140
- var themes_ = __webpack_require__(0);
141
-
142
- // CONCATENATED MODULE: ./src/RadioList/OptionStyles.ts
143
-
144
-
145
- var StyledWrapper = external_styled_components_default.a.div.withConfig({
146
- displayName: "OptionStyles__StyledWrapper",
147
- componentId: "imaqjt-0"
148
- })(["position:relative;padding:", ";"], Object(themes_["pick"])({
149
- prisma: {
150
- comfortable: '10px 0',
151
- compact: '6px 0'
152
- },
153
- enterprise: '7px 0 7px 0'
154
- }));
155
- var StyledLabel = external_styled_components_default.a.label.withConfig({
156
- displayName: "OptionStyles__StyledLabel",
157
- componentId: "imaqjt-1"
158
- })(["", ";", ";position:relative;flex:1 1 auto;padding-left:", ";margin-left:", ";cursor:pointer;&::before,&::after{display:block;content:'';position:absolute;border-radius:50%;}&::before{box-sizing:border-box;top:0;border:", ";", "}&::after{opacity:0;width:8px;height:8px;", " background-color:", ";}", " ", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({
159
- prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive)
160
- }), Object(themes_["pick"])({
161
- prisma: '10px',
162
- enterprise: themes_["variables"].spacingQuarter
163
- }), Object(themes_["pick"])({
164
- prisma: '20px',
165
- enterprise: '18px'
166
- }), Object(themes_["pick"])({
167
- prisma: Object(external_styled_components_["css"])(["2px solid ", ""], themes_["variables"].contentColorMuted),
168
- enterprise: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray80)
169
- }), Object(themes_["pick"])({
170
- prisma: Object(external_styled_components_["css"])(["width:20px;height:20px;left:-20px;"]),
171
- enterprise: Object(external_styled_components_["css"])(["width:18px;height:18px;left:-18px;"])
172
- }), Object(themes_["pick"])({
173
- prisma: Object(external_styled_components_["css"])(["top:6px;left:-14px;"]),
174
- enterprise: Object(external_styled_components_["css"])(["top:5px;left:-13px;"])
175
- }), Object(themes_["pick"])({
176
- prisma: themes_["variables"].white,
177
- enterprise: {
178
- dark: themes_["variables"].gray80,
179
- light: themes_["variables"].gray45
180
- }
181
- }), Object(themes_["pick"])({
182
- compact: {
183
- enterprise: Object(external_styled_components_["css"])(["font-size:", ";"], themes_["variables"].fontSizeSmall)
184
- }
185
- }), Object(themes_["pick"])({
186
- prisma: Object(external_styled_components_["css"])(["&:hover{&::before{box-shadow:", ";border-color:", ";background-color:", ";}"], themes_["variables"].hoverShadow, themes_["variables"].contentColorDefault, themes_["mixins"].overlayColors(themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayHover))
187
- }));
188
- var StyledRadioInput = external_styled_components_default.a.input.withConfig({
189
- displayName: "OptionStyles__StyledRadioInput",
190
- componentId: "imaqjt-2"
191
- })(["opacity:0;position:absolute;top:10px;left:0;&:focus{& + ", "::before{box-shadow:", ";}}&:checked + ", "::after{opacity:1;}&:checked + ", "::before{", "}&:disabled,&:disabled + ", "{color:", ";cursor:not-allowed;}&:disabled + ", "::before{", ";}&:disabled:not(:checked) + ", "::before{", ";}&:disabled + ", "::after{background-color:", ";}", " ", ""],
192
- /* sc-sel */
193
- StyledLabel, themes_["variables"].focusShadow,
194
- /* sc-sel */
195
- StyledLabel,
196
- /* sc-sel */
197
- StyledLabel, Object(themes_["pick"])({
198
- prisma: Object(external_styled_components_["css"])(["border-color:transparent;background-color:", ";"], themes_["variables"].interactiveColorPrimary),
199
- enterprise: {
200
- dark: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray80),
201
- light: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray45)
202
- }
203
- }),
204
- /* sc-sel */
205
- StyledLabel, Object(themes_["pick"])({
206
- prisma: themes_["variables"].contentColorDisabled,
207
- enterprise: {
208
- dark: themes_["variables"].gray45,
209
- light: themes_["variables"].gray80
210
- }
211
- }),
212
- /* sc-sel */
213
- StyledLabel, Object(themes_["pick"])({
214
- enterprise: {
215
- dark: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray45),
216
- light: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray80)
217
- }
218
- }),
219
- /* sc-sel */
220
- StyledLabel, Object(themes_["pick"])({
221
- prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].contentColorDisabled)
222
- }),
223
- /* sc-sel */
224
- StyledLabel, Object(themes_["pick"])({
225
- prisma: themes_["variables"].contentColorDisabled,
226
- enterprise: {
227
- dark: themes_["variables"].gray45,
228
- light: themes_["variables"].gray80
229
- }
230
- }), function (_ref) {
231
- var $error = _ref.$error;
232
- return $error && Object(external_styled_components_["css"])(["&:not(:disabled) + ", "{color:", ";&::before{border-color:", ";}}&:checked:not(:disabled) + ", "{&::before{border-color:", ";}", "}", ""],
233
- /* sc-sel */
234
- StyledLabel, Object(themes_["pick"])({
235
- prisma: themes_["variables"].accentColorNegative,
236
- enterprise: themes_["variables"].errorColor
237
- }), Object(themes_["pick"])({
238
- prisma: themes_["variables"].accentColorNegative,
239
- enterprise: {
240
- dark: themes_["variables"].errorColor,
241
- light: themes_["variables"].errorColorL30
242
- }
243
- }),
244
- /* sc-sel */
245
- StyledLabel, Object(themes_["pick"])({
246
- prisma: themes_["variables"].accentColorNegative,
247
- enterprise: themes_["variables"].errorColor
248
- }), Object(themes_["pick"])({
249
- enterprise: Object(external_styled_components_["css"])(["&::after{background-color:", ";}"], themes_["variables"].errorColor)
250
- }), Object(themes_["pick"])({
251
- prisma: Object(external_styled_components_["css"])(["&:not(:disabled):checked + ", "{&::before{background-color:", ";}}"],
252
- /* sc-sel */
253
- StyledLabel, themes_["variables"].accentColorNegative)
254
- }));
255
- }, Object(themes_["pick"])({
256
- prisma: Object(external_styled_components_["css"])(["&:active + ", "::before{background-color:", ";}&:active + ", "::after{background-color:", ";}&:checked:active + ", "::before{border-color:transparent;background-color:", ";}&:disabled + ", ":hover::before{box-shadow:none;}&:checked:disabled + ", "{&::before{background-color:", ";}&::after{background-color:rgba(255,255,255,0.3);}}"],
257
- /* sc-sel */
258
- StyledLabel, themes_["mixins"].overlayColors(themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayActive),
259
- /* sc-sel */
260
- StyledLabel, themes_["mixins"].overlayColors(themes_["variables"].white, themes_["variables"].interactiveColorOverlayActive),
261
- /* sc-sel */
262
- StyledLabel, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorPrimary, themes_["variables"].interactiveColorOverlayActive),
263
- /* sc-sel */
264
- StyledLabel,
265
- /* sc-sel */
266
- StyledLabel, themes_["variables"].interactiveColorBackgroundDisabled)
267
- }));
268
- // CONCATENATED MODULE: ./src/RadioList/Option.tsx
269
- 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); }
270
-
271
- 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; }
272
-
273
- 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; }
274
-
275
-
276
-
277
-
278
-
279
-
280
- var propTypes = {
281
- children: external_prop_types_default.a.node,
282
- disabled: external_prop_types_default.a.bool,
283
- error: external_prop_types_default.a.bool,
284
- id: external_prop_types_default.a.string,
285
- onChange: external_prop_types_default.a.func,
286
- value: external_prop_types_default.a.any.isRequired
287
- };
288
-
289
- function Option(_ref) {
290
- var children = _ref.children,
291
- _ref$disabled = _ref.disabled,
292
- disabledProp = _ref$disabled === void 0 ? false : _ref$disabled,
293
- _ref$error = _ref.error,
294
- errorProp = _ref$error === void 0 ? false : _ref$error,
295
- idProp = _ref.id,
296
- onChange = _ref.onChange,
297
- value = _ref.value,
298
- otherProps = _objectWithoutProperties(_ref, ["children", "disabled", "error", "id", "onChange", "value"]);
299
-
300
- // @docs-props-type OptionPropsBase
301
- var _useRef = Object(external_react_["useRef"])(idProp || Object(id_["createDOMID"])('radio-option')),
302
- id = _useRef.current;
303
-
304
- var radioList = Object(external_react_["useContext"])(RadioList_RadioListContext);
305
-
306
- var handleOnChange = function handleOnChange(e) {
307
- var _radioList$onChange;
308
-
309
- e.stopPropagation();
310
- onChange === null || onChange === void 0 ? void 0 : onChange(e, {
311
- value: value,
312
- name: radioList.name
313
- });
314
- (_radioList$onChange = radioList.onChange) === null || _radioList$onChange === void 0 ? void 0 : _radioList$onChange.call(radioList, e, {
315
- value: value,
316
- name: radioList.name
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = r => {
12
+ /******/ var a = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
15
+ /******/;
16
+ e.d(a, {
17
+ a
18
+ });
19
+ /******/ return a;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (r, a) => {
27
+ /******/ for (var o in a) {
28
+ /******/ if (e.o(a, o) && !e.o(r, o)) {
29
+ /******/ Object.defineProperty(r, o, {
30
+ enumerable: true,
31
+ get: a[o]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var r = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(r);
62
+ // EXPORTS
63
+ e.d(r, {
64
+ Option: () => /* reexport */ C,
65
+ default: () => /* reexport */ M
317
66
  });
318
- };
319
-
320
- var checked = false;
321
-
322
- if ((radioList === null || radioList === void 0 ? void 0 : radioList.value) !== undefined) {
323
- checked = radioList.value === value;
324
- }
325
-
326
- var disabled = disabledProp;
327
-
328
- if (radioList === null || radioList === void 0 ? void 0 : radioList.disabled) {
329
- disabled = radioList.disabled;
330
- }
331
-
332
- var $error = errorProp;
333
-
334
- if (radioList === null || radioList === void 0 ? void 0 : radioList.error) {
335
- $error = radioList.error;
336
- }
337
-
338
- return /*#__PURE__*/external_react_default.a.createElement(StyledWrapper, _extends({
339
- "data-test": "option",
340
- "data-test-value": value
341
- }, otherProps, {
342
- "data-checked": checked
343
- }), /*#__PURE__*/external_react_default.a.createElement(StyledRadioInput, {
344
- id: id,
345
- type: "radio",
346
- name: radioList.name,
347
- $error: $error,
348
- disabled: disabled,
349
- value: value.toString(),
350
- checked: checked,
351
- onChange: handleOnChange,
352
- "data-test": "input"
353
- }), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
354
- htmlFor: id,
355
- "data-test": "label"
356
- }, children));
357
- }
358
-
359
- Option.propTypes = propTypes;
360
- /* harmony default export */ var RadioList_Option = (Option);
361
- // EXTERNAL MODULE: external "@splunk/react-ui/Box"
362
- var Box_ = __webpack_require__(6);
363
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
364
-
365
- // CONCATENATED MODULE: ./src/RadioList/RadioListStyles.ts
366
-
367
-
368
-
369
- var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
370
- displayName: "RadioListStyles__StyledBox",
371
- componentId: "sc-1qg10hx-0"
372
- })(["align-items:flex-start;flex-wrap:wrap;flex-direction:", ";", ""], function (props) {
373
- return props.direction;
374
- }, function (props) {
375
- return props.direction === 'row' && Object(external_styled_components_["css"])(["", "{margin-right:40px;margin-inline-end:40px;}"], StyledWrapper);
376
- });
377
-
378
- // CONCATENATED MODULE: ./src/RadioList/RadioList.tsx
379
- function RadioList_extends() { RadioList_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 RadioList_extends.apply(this, arguments); }
380
-
381
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
382
-
383
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
384
-
385
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
386
-
387
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
388
-
389
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
390
-
391
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
392
-
393
- function RadioList_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = RadioList_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; }
394
-
395
- function RadioList_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; }
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
- var RadioList_propTypes = {
405
- direction: external_prop_types_default.a.oneOf(['row', 'column']),
406
- children: external_prop_types_default.a.node,
407
- defaultValue: external_prop_types_default.a.any,
408
- disabled: external_prop_types_default.a.bool,
409
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
410
- error: external_prop_types_default.a.bool,
411
- name: external_prop_types_default.a.string,
412
- onChange: external_prop_types_default.a.func,
413
-
414
- /** @private. */
415
- required: external_prop_types_default.a.bool,
416
- value: external_prop_types_default.a.any,
417
- labelledBy: external_prop_types_default.a.string,
418
- describedBy: external_prop_types_default.a.string
419
- };
420
-
421
- function RadioList(_ref) {
422
- var children = _ref.children,
423
- defaultValueProp = _ref.defaultValue,
424
- describedBy = _ref.describedBy,
425
- _ref$direction = _ref.direction,
426
- direction = _ref$direction === void 0 ? 'column' : _ref$direction,
427
- _ref$disabled = _ref.disabled,
428
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
429
- _ref$error = _ref.error,
430
- error = _ref$error === void 0 ? false : _ref$error,
431
- labelledBy = _ref.labelledBy,
432
- nameProp = _ref.name,
433
- onChange = _ref.onChange,
434
- required = _ref.required,
435
- valueProp = _ref.value,
436
- otherProps = RadioList_objectWithoutProperties(_ref, ["children", "defaultValue", "describedBy", "direction", "disabled", "error", "labelledBy", "name", "onChange", "required", "value"]);
437
-
438
- // @docs-props-type RadioListPropsBase
439
- // TODO: Implement shared isControlled hook (SUI-5283).
440
- // See material-ui for similar pattern to handle controlled/un-controlled in functional components w/ hooks
441
- // https://github.com/mui-org/material-ui/blob/60d99a39836fb82f4da1477a717f642c216fb0b9/packages/material-ui/src/utils/useControlled.js
442
- var _useRef = Object(external_react_["useRef"])(valueProp !== undefined),
443
- isControlledExternally = _useRef.current;
444
-
445
- var _useState = Object(external_react_["useState"])(defaultValueProp),
446
- _useState2 = _slicedToArray(_useState, 2),
447
- valueState = _useState2[0],
448
- setValueState = _useState2[1];
449
-
450
- var value = isControlledExternally ? valueProp : valueState;
451
-
452
- var _useRef2 = Object(external_react_["useRef"])(nameProp || Object(id_["createDOMID"])('radio-name')),
453
- name = _useRef2.current;
454
-
455
- var handleChange = function handleChange(e, data) {
456
- if (!isControlledExternally) {
457
- setValueState(data.value);
67
+ // CONCATENATED MODULE: external "react"
68
+ const a = require("react");
69
+ var o = e.n(a);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const i = require("prop-types");
72
+ var t = e.n(i);
73
+ // CONCATENATED MODULE: external "lodash/omit"
74
+ const n = require("lodash/omit");
75
+ var l = e.n(n);
76
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
77
+ const s = require("@splunk/ui-utils/id");
78
+ // CONCATENATED MODULE: ./src/RadioList/RadioListContext.ts
79
+ var c = (0, a.createContext)({});
80
+ c.displayName = "RadioList";
81
+ /* harmony default export */ const d = c;
82
+ // CONCATENATED MODULE: external "styled-components"
83
+ const u = require("styled-components");
84
+ var b = e.n(u);
85
+ // CONCATENATED MODULE: external "@splunk/themes"
86
+ const p = require("@splunk/themes");
87
+ // CONCATENATED MODULE: ./src/RadioList/OptionStyles.ts
88
+ var v = b().div.withConfig({
89
+ displayName: "OptionStyles__StyledWrapper",
90
+ componentId: "imaqjt-0"
91
+ })([ "position:relative;padding:", ";" ], (0, p.pick)({
92
+ prisma: {
93
+ comfortable: "10px 0",
94
+ compact: "6px 0"
95
+ },
96
+ enterprise: "7px 0 7px 0"
97
+ }));
98
+ var f = b().label.withConfig({
99
+ displayName: "OptionStyles__StyledLabel",
100
+ componentId: "imaqjt-1"
101
+ })([ "", ";", ";position:relative;flex:1 1 auto;padding-left:", ";margin-left:", ";cursor:pointer;&::before,&::after{display:block;content:'';position:absolute;border-radius:50%;}&::before{box-sizing:border-box;top:0;border:", ";", "}&::after{opacity:0;width:8px;height:8px;", " background-color:", ";}", " ", "" ], p.mixins.reset("block"), (0,
102
+ p.pick)({
103
+ prisma: (0, u.css)([ "color:", ";" ], p.variables.contentColorActive)
104
+ }), (0, p.pick)({
105
+ prisma: "10px",
106
+ enterprise: p.variables.spacingQuarter
107
+ }), (0, p.pick)({
108
+ prisma: "20px",
109
+ enterprise: "18px"
110
+ }), (0, p.pick)({
111
+ prisma: (0, u.css)([ "2px solid ", "" ], p.variables.contentColorMuted),
112
+ enterprise: (0, u.css)([ "1px solid ", "" ], p.variables.gray80)
113
+ }), (0, p.pick)({
114
+ prisma: (0, u.css)([ "width:20px;height:20px;left:-20px;" ]),
115
+ enterprise: (0, u.css)([ "width:18px;height:18px;left:-18px;" ])
116
+ }), (0, p.pick)({
117
+ prisma: (0, u.css)([ "top:6px;left:-14px;" ]),
118
+ enterprise: (0, u.css)([ "top:5px;left:-13px;" ])
119
+ }), (0, p.pick)({
120
+ prisma: p.variables.white,
121
+ enterprise: {
122
+ dark: p.variables.gray80,
123
+ light: p.variables.gray45
124
+ }
125
+ }), (0, p.pick)({
126
+ compact: {
127
+ enterprise: (0, u.css)([ "font-size:", ";" ], p.variables.fontSizeSmall)
128
+ }
129
+ }), (0, p.pick)({
130
+ prisma: (0, u.css)([ "&:hover{&::before{box-shadow:", ";border-color:", ";background-color:", ";}" ], p.variables.hoverShadow, p.variables.contentColorDefault, p.mixins.overlayColors(p.variables.backgroundColorPage, p.variables.interactiveColorOverlayHover))
131
+ }));
132
+ var y = b().input.withConfig({
133
+ displayName: "OptionStyles__StyledRadioInput",
134
+ componentId: "imaqjt-2"
135
+ })([ "opacity:0;position:absolute;top:10px;left:0;&:focus{& + ", "::before{box-shadow:", ";}}&:checked + ", "::after{opacity:1;}&:checked + ", "::before{", "}&:disabled,&:disabled + ", "{color:", ";cursor:not-allowed;}&:disabled + ", "::before{", ";}&:disabled:not(:checked) + ", "::before{", ";}&:disabled + ", "::after{background-color:", ";}", " ", "" ],
136
+ /* sc-sel */
137
+ f, p.variables.focusShadow,
138
+ /* sc-sel */
139
+ f,
140
+ /* sc-sel */
141
+ f, (0, p.pick)({
142
+ prisma: (0, u.css)([ "border-color:transparent;background-color:", ";" ], p.variables.interactiveColorPrimary),
143
+ enterprise: {
144
+ dark: (0, u.css)([ "border-color:", ";" ], p.variables.gray80),
145
+ light: (0, u.css)([ "border-color:", ";" ], p.variables.gray45)
146
+ }
147
+ }),
148
+ /* sc-sel */
149
+ f, (0, p.pick)({
150
+ prisma: p.variables.contentColorDisabled,
151
+ enterprise: {
152
+ dark: p.variables.gray45,
153
+ light: p.variables.gray80
154
+ }
155
+ }),
156
+ /* sc-sel */
157
+ f, (0, p.pick)({
158
+ enterprise: {
159
+ dark: (0, u.css)([ "border-color:", ";" ], p.variables.gray45),
160
+ light: (0, u.css)([ "border-color:", ";" ], p.variables.gray80)
161
+ }
162
+ }),
163
+ /* sc-sel */
164
+ f, (0, p.pick)({
165
+ prisma: (0, u.css)([ "border-color:", ";" ], p.variables.contentColorDisabled)
166
+ }),
167
+ /* sc-sel */
168
+ f, (0, p.pick)({
169
+ prisma: p.variables.contentColorDisabled,
170
+ enterprise: {
171
+ dark: p.variables.gray45,
172
+ light: p.variables.gray80
173
+ }
174
+ }), (function(e) {
175
+ var r = e.$error;
176
+ return r && (0, u.css)([ "&:not(:disabled) + ", "{color:", ";&::before{border-color:", ";}}&:checked:not(:disabled) + ", "{&::before{border-color:", ";}", "}", "" ],
177
+ /* sc-sel */
178
+ f, (0, p.pick)({
179
+ prisma: p.variables.accentColorNegative,
180
+ enterprise: p.variables.errorColor
181
+ }), (0, p.pick)({
182
+ prisma: p.variables.accentColorNegative,
183
+ enterprise: {
184
+ dark: p.variables.errorColor,
185
+ light: p.variables.errorColorL30
186
+ }
187
+ }),
188
+ /* sc-sel */
189
+ f, (0, p.pick)({
190
+ prisma: p.variables.accentColorNegative,
191
+ enterprise: p.variables.errorColor
192
+ }), (0, p.pick)({
193
+ enterprise: (0, u.css)([ "&::after{background-color:", ";}" ], p.variables.errorColor)
194
+ }), (0, p.pick)({
195
+ prisma: (0, u.css)([ "&:not(:disabled):checked + ", "{&::before{background-color:", ";}}" ],
196
+ /* sc-sel */
197
+ f, p.variables.accentColorNegative)
198
+ }));
199
+ }), (0, p.pick)({
200
+ prisma: (0, u.css)([ "&:active + ", "::before{background-color:", ";}&:active + ", "::after{background-color:", ";}&:checked:active + ", "::before{border-color:transparent;background-color:", ";}&:disabled + ", ":hover::before{box-shadow:none;}&:checked:disabled + ", "{&::before{background-color:", ";}&::after{background-color:rgba(255,255,255,0.3);}}" ],
201
+ /* sc-sel */
202
+ f, p.mixins.overlayColors(p.variables.backgroundColorPage, p.variables.interactiveColorOverlayActive),
203
+ /* sc-sel */
204
+ f, p.mixins.overlayColors(p.variables.white, p.variables.interactiveColorOverlayActive),
205
+ /* sc-sel */
206
+ f, p.mixins.overlayColors(p.variables.interactiveColorPrimary, p.variables.interactiveColorOverlayActive),
207
+ /* sc-sel */
208
+ f,
209
+ /* sc-sel */
210
+ f, p.variables.interactiveColorBackgroundDisabled)
211
+ }));
212
+ // CONCATENATED MODULE: ./src/RadioList/Option.tsx
213
+ function g() {
214
+ g = Object.assign || function(e) {
215
+ for (var r = 1; r < arguments.length; r++) {
216
+ var a = arguments[r];
217
+ for (var o in a) {
218
+ if (Object.prototype.hasOwnProperty.call(a, o)) {
219
+ e[o] = a[o];
220
+ }
221
+ }
222
+ }
223
+ return e;
224
+ };
225
+ return g.apply(this, arguments);
226
+ }
227
+ function m(e, r) {
228
+ if (e == null) return {};
229
+ var a = h(e, r);
230
+ var o, i;
231
+ if (Object.getOwnPropertySymbols) {
232
+ var t = Object.getOwnPropertySymbols(e);
233
+ for (i = 0; i < t.length; i++) {
234
+ o = t[i];
235
+ if (r.indexOf(o) >= 0) continue;
236
+ if (!Object.prototype.propertyIsEnumerable.call(e, o)) continue;
237
+ a[o] = e[o];
238
+ }
239
+ }
240
+ return a;
241
+ }
242
+ function h(e, r) {
243
+ if (e == null) return {};
244
+ var a = {};
245
+ var o = Object.keys(e);
246
+ var i, t;
247
+ for (t = 0; t < o.length; t++) {
248
+ i = o[t];
249
+ if (r.indexOf(i) >= 0) continue;
250
+ a[i] = e[i];
251
+ }
252
+ return a;
253
+ }
254
+ var k = {
255
+ children: t().node,
256
+ disabled: t().bool,
257
+ error: t().bool,
258
+ id: t().string,
259
+ onChange: t().func,
260
+ value: t().any.isRequired
261
+ };
262
+ function x(e) {
263
+ var r = e.children, i = e.disabled, t = i === void 0 ? false : i, n = e.error, l = n === void 0 ? false : n, c = e.id, u = e.onChange, b = e.value, p = m(e, [ "children", "disabled", "error", "id", "onChange", "value" ]);
264
+ // @docs-props-type OptionPropsBase
265
+ var h = (0, a.useRef)(c || (0, s.createDOMID)("radio-option")), k = h.current;
266
+ var x = (0, a.useContext)(d);
267
+ var C = function e(r) {
268
+ var a;
269
+ r.stopPropagation();
270
+ u === null || u === void 0 ? void 0 : u(r, {
271
+ value: b,
272
+ name: x.name
273
+ });
274
+ (a = x.onChange) === null || a === void 0 ? void 0 : a.call(x, r, {
275
+ value: b,
276
+ name: x.name
277
+ });
278
+ };
279
+ var O = false;
280
+ if ((x === null || x === void 0 ? void 0 : x.value) !== undefined) {
281
+ O = x.value === b;
282
+ }
283
+ var w = t;
284
+ if (x === null || x === void 0 ? void 0 : x.disabled) {
285
+ w = x.disabled;
286
+ }
287
+ var S = l;
288
+ if (x === null || x === void 0 ? void 0 : x.error) {
289
+ S = x.error;
290
+ }
291
+
292
+ return o().createElement(v, g({
293
+ "data-test": "option",
294
+ "data-test-value": b
295
+ }, p, {
296
+ "data-checked": O
297
+ }), o().createElement(y, {
298
+ id: k,
299
+ type: "radio",
300
+ name: x.name,
301
+ $error: S,
302
+ disabled: w,
303
+ value: b.toString(),
304
+ checked: O,
305
+ onChange: C,
306
+ "data-test": "input"
307
+ }), o().createElement(f, {
308
+ htmlFor: k,
309
+ "data-test": "label"
310
+ }, r));
311
+ }
312
+ x.propTypes = k;
313
+ /* harmony default export */ const C = x;
314
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
315
+ const O = require("@splunk/react-ui/Box");
316
+ var w = e.n(O);
317
+ // CONCATENATED MODULE: ./src/RadioList/RadioListStyles.ts
318
+ var S = b()(w()).withConfig({
319
+ displayName: "RadioListStyles__StyledBox",
320
+ componentId: "sc-1qg10hx-0"
321
+ })([ "align-items:flex-start;flex-wrap:wrap;flex-direction:", ";", "" ], (function(e) {
322
+ return e.direction;
323
+ }), (function(e) {
324
+ return e.direction === "row" && (0, u.css)([ "", "{margin-right:40px;margin-inline-end:40px;}" ], v);
325
+ }));
326
+ // CONCATENATED MODULE: ./src/RadioList/RadioList.tsx
327
+ function j() {
328
+ j = Object.assign || function(e) {
329
+ for (var r = 1; r < arguments.length; r++) {
330
+ var a = arguments[r];
331
+ for (var o in a) {
332
+ if (Object.prototype.hasOwnProperty.call(a, o)) {
333
+ e[o] = a[o];
334
+ }
335
+ }
336
+ }
337
+ return e;
338
+ };
339
+ return j.apply(this, arguments);
340
+ }
341
+ function q(e, r) {
342
+ return E(e) || A(e, r) || I(e, r) || P();
343
+ }
344
+ function P() {
345
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
346
+ }
347
+ function I(e, r) {
348
+ if (!e) return;
349
+ if (typeof e === "string") return _(e, r);
350
+ var a = Object.prototype.toString.call(e).slice(8, -1);
351
+ if (a === "Object" && e.constructor) a = e.constructor.name;
352
+ if (a === "Map" || a === "Set") return Array.from(e);
353
+ if (a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)) return _(e, r);
354
+ }
355
+ function _(e, r) {
356
+ if (r == null || r > e.length) r = e.length;
357
+ for (var a = 0, o = new Array(r); a < r; a++) {
358
+ o[a] = e[a];
359
+ }
360
+ return o;
361
+ }
362
+ function A(e, r) {
363
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
364
+ var a = [];
365
+ var o = true;
366
+ var i = false;
367
+ var t = undefined;
368
+ try {
369
+ for (var n = e[Symbol.iterator](), l; !(o = (l = n.next()).done); o = true) {
370
+ a.push(l.value);
371
+ if (r && a.length === r) break;
372
+ }
373
+ } catch (e) {
374
+ i = true;
375
+ t = e;
376
+ } finally {
377
+ try {
378
+ if (!o && n["return"] != null) n["return"]();
379
+ } finally {
380
+ if (i) throw t;
381
+ }
382
+ }
383
+ return a;
384
+ }
385
+ function E(e) {
386
+ if (Array.isArray(e)) return e;
387
+ }
388
+ function B(e, r) {
389
+ if (e == null) return {};
390
+ var a = D(e, r);
391
+ var o, i;
392
+ if (Object.getOwnPropertySymbols) {
393
+ var t = Object.getOwnPropertySymbols(e);
394
+ for (i = 0; i < t.length; i++) {
395
+ o = t[i];
396
+ if (r.indexOf(o) >= 0) continue;
397
+ if (!Object.prototype.propertyIsEnumerable.call(e, o)) continue;
398
+ a[o] = e[o];
399
+ }
400
+ }
401
+ return a;
402
+ }
403
+ function D(e, r) {
404
+ if (e == null) return {};
405
+ var a = {};
406
+ var o = Object.keys(e);
407
+ var i, t;
408
+ for (t = 0; t < o.length; t++) {
409
+ i = o[t];
410
+ if (r.indexOf(i) >= 0) continue;
411
+ a[i] = e[i];
412
+ }
413
+ return a;
458
414
  }
459
-
460
- onChange === null || onChange === void 0 ? void 0 : onChange(e, data);
461
- }; // Check correct props are passed
462
-
463
-
464
- if (false) {}
465
-
466
- if (false) {} // Check if changing from controlled to un-controlled
467
-
468
-
469
- Object(external_react_["useEffect"])(function () {
470
- if (false) {}
471
- }, [valueProp, isControlledExternally]);
472
-
473
- var _useRef3 = Object(external_react_["useRef"])(defaultValueProp),
474
- defaultValue = _useRef3.current;
475
-
476
- Object(external_react_["useEffect"])(function () {
477
- if (false) {}
478
- }, [defaultValue, defaultValueProp, isControlledExternally]);
479
- var labelledByAttr = otherProps['aria-labelledby'];
480
- var describedByAttr = otherProps['aria-describedby'];
481
- return /*#__PURE__*/external_react_default.a.createElement(RadioList_RadioListContext.Provider, {
482
- value: {
483
- value: value,
484
- name: name,
485
- onChange: handleChange,
486
- error: error,
487
- disabled: disabled
415
+ var N = {
416
+ direction: t().oneOf([ "row", "column" ]),
417
+ children: t().node,
418
+ defaultValue: t().any,
419
+ disabled: t().bool,
420
+ elementRef: t().oneOfType([ t().func, t().object ]),
421
+ error: t().bool,
422
+ name: t().string,
423
+ onChange: t().func,
424
+ /** @private. */
425
+ required: t().bool,
426
+ value: t().any,
427
+ labelledBy: t().string,
428
+ describedBy: t().string
429
+ };
430
+ function R(e) {
431
+ var r = e.children, i = e.defaultValue, t = e.describedBy, n = e.direction, c = n === void 0 ? "column" : n, u = e.disabled, b = u === void 0 ? false : u, p = e.error, v = p === void 0 ? false : p, f = e.labelledBy, y = e.name, g = e.onChange, m = e.required, h = e.value, k = B(e, [ "children", "defaultValue", "describedBy", "direction", "disabled", "error", "labelledBy", "name", "onChange", "required", "value" ]);
432
+ // @docs-props-type RadioListPropsBase
433
+ // TODO: Implement shared isControlled hook (SUI-5283).
434
+ // See material-ui for similar pattern to handle controlled/un-controlled in functional components w/ hooks
435
+ // https://github.com/mui-org/material-ui/blob/60d99a39836fb82f4da1477a717f642c216fb0b9/packages/material-ui/src/utils/useControlled.js
436
+ var x = (0, a.useRef)(h !== undefined), C = x.current;
437
+ var O = (0, a.useState)(i), w = q(O, 2), P = w[0], I = w[1];
438
+ var _ = C ? h : P;
439
+ var A = (0, a.useRef)(y || (0, s.createDOMID)("radio-name")), E = A.current;
440
+ var D = function e(r, a) {
441
+ if (!C) {
442
+ I(a.value);
443
+ }
444
+ g === null || g === void 0 ? void 0 : g(r, a);
445
+ };
446
+ // Check correct props are passed
447
+ if (false) {}
448
+ if (false) {}
449
+ // Check if changing from controlled to un-controlled
450
+ (0, a.useEffect)((function() {
451
+ if (false) {}
452
+ }), [ h, C ]);
453
+ var N = (0, a.useRef)(i), R = N.current;
454
+ (0, a.useEffect)((function() {
455
+ if (false) {}
456
+ }), [ R, i, C ]);
457
+ var M = k["aria-labelledby"];
458
+ var T = k["aria-describedby"];
459
+
460
+ return o().createElement(d.Provider, {
461
+ value: {
462
+ value: _,
463
+ name: E,
464
+ onChange: D,
465
+ error: v,
466
+ disabled: b
467
+ }
468
+ }, o().createElement(S, j({
469
+ flex: true,
470
+ direction: c,
471
+ role: "radiogroup",
472
+ "data-test": "radio-list",
473
+ "data-test-value": _
474
+ }, l()(k, [ "aria-labelledby", "aria-describedby" ]), {
475
+ "aria-labelledby": M ? "".concat(M, " ").concat(f) : f,
476
+ "aria-describedby": T ? "".concat(T, " ").concat(t) : t,
477
+ "aria-required": m
478
+ }), r));
488
479
  }
489
- }, /*#__PURE__*/external_react_default.a.createElement(StyledBox, RadioList_extends({
490
- flex: true,
491
- direction: direction,
492
- role: "radiogroup",
493
- "data-test": "radio-list",
494
- "data-test-value": value
495
- }, omit_default()(otherProps, ['aria-labelledby', 'aria-describedby']), {
496
- "aria-labelledby": labelledByAttr ? "".concat(labelledByAttr, " ").concat(labelledBy) : labelledBy,
497
- "aria-describedby": describedByAttr ? "".concat(describedByAttr, " ").concat(describedBy) : describedBy,
498
- "aria-required": required
499
- }), children));
500
- }
501
-
502
- RadioList.propTypes = RadioList_propTypes;
503
- RadioList.Option = RadioList_Option;
504
- /* harmony default export */ var RadioList_RadioList = (RadioList);
505
- // only for styled components using RadioList
506
- // CONCATENATED MODULE: ./src/RadioList/index.ts
507
-
508
-
509
-
510
- /***/ }),
511
-
512
- /***/ 2:
513
- /***/ (function(module, exports) {
514
-
515
- module.exports = require("react");
516
-
517
- /***/ }),
518
-
519
- /***/ 3:
520
- /***/ (function(module, exports) {
521
-
522
- module.exports = require("styled-components");
523
-
524
- /***/ }),
525
-
526
- /***/ 5:
527
- /***/ (function(module, exports) {
528
-
529
- module.exports = require("lodash/omit");
530
-
531
- /***/ }),
532
-
533
- /***/ 6:
534
- /***/ (function(module, exports) {
535
-
536
- module.exports = require("@splunk/react-ui/Box");
537
-
538
- /***/ }),
539
-
540
- /***/ 8:
541
- /***/ (function(module, exports) {
542
-
543
- module.exports = require("@splunk/ui-utils/id");
544
-
545
- /***/ })
546
-
547
- /******/ });
480
+ R.propTypes = N;
481
+ R.Option = C;
482
+ /* harmony default export */ const M = R;
483
+ // only for styled components using RadioList
484
+ // CONCATENATED MODULE: ./src/RadioList/index.ts
485
+ module.exports = r;
486
+ /******/})();