@splunk/react-ui 4.21.0 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +24 -3
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1807 -2084
  18. package/CollapsiblePanel.js +586 -519
  19. package/Color.js +1068 -1068
  20. package/ColumnLayout.js +402 -363
  21. package/ComboBox.js +903 -794
  22. package/Concertina.js +997 -802
  23. package/ControlGroup.js +687 -594
  24. package/Date.js +567 -547
  25. package/DefinitionList.js +308 -234
  26. package/Divider.js +149 -118
  27. package/Dropdown.js +459 -416
  28. package/DualListbox.js +1479 -1541
  29. package/EventListener.js +94 -97
  30. package/File.js +1051 -969
  31. package/FormRows.js +883 -696
  32. package/Heading.js +216 -193
  33. package/Image.js +446 -402
  34. package/JSONTree.js +690 -551
  35. package/Layer.js +437 -410
  36. package/Link.js +336 -255
  37. package/List.js +213 -161
  38. package/Markdown.js +509 -487
  39. package/Menu.js +1104 -1056
  40. package/Message.js +475 -441
  41. package/MessageBar.js +387 -373
  42. package/Modal.js +810 -634
  43. package/ModalLayer.js +326 -243
  44. package/Monogram.js +308 -276
  45. package/Multiselect.js +3564 -3364
  46. package/Number.js +729 -687
  47. package/Paginator.js +510 -449
  48. package/Paragraph.js +145 -112
  49. package/Popover.js +1459 -1432
  50. package/Progress.js +301 -246
  51. package/RadioBar.js +634 -527
  52. package/RadioList.js +483 -444
  53. package/Resize.js +530 -489
  54. package/ResultsMenu.js +479 -455
  55. package/ScreenReaderContent.js +142 -111
  56. package/Scroll.js +595 -456
  57. package/ScrollContainerContext.js +197 -206
  58. package/Search.js +756 -650
  59. package/Select.js +2446 -2345
  60. package/SidePanel.js +390 -284
  61. package/Slider.js +680 -676
  62. package/SlidingPanels.js +639 -503
  63. package/SplitButton.js +464 -367
  64. package/StaticContent.js +161 -133
  65. package/StepBar.js +386 -358
  66. package/Switch.js +710 -640
  67. package/TabBar.js +741 -680
  68. package/TabLayout.js +406 -322
  69. package/Table.js +4974 -4616
  70. package/Text.js +1170 -1138
  71. package/TextArea.js +1102 -1090
  72. package/Tooltip.js +624 -581
  73. package/TransitionOpen.js +489 -422
  74. package/Typography.js +176 -153
  75. package/WaitSpinner.js +230 -206
  76. package/package.json +7 -7
  77. package/types/src/Color/Color.d.ts +0 -1
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/types/src/RadioBar/RadioBar.d.ts +1 -0
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
  82. package/types/src/Select/docs/examples/Icons.d.ts +1 -9
  83. package/types/src/Slider/Slider.d.ts +1 -0
  84. package/types/src/TabBar/Tab.d.ts +10 -1
  85. package/types/src/TabBar/TabBar.d.ts +4 -2
  86. package/types/src/Table/Head.d.ts +7 -3
  87. package/types/src/Table/Table.d.ts +3 -2
  88. package/types/src/Table/TableContext.d.ts +2 -0
  89. package/useForceUpdate.js +112 -82
  90. package/useKeyPress.js +74 -71
  91. package/usePrevious.js +65 -65
  92. package/useRovingFocus.js +122 -138
package/RadioList.js CHANGED
@@ -1,447 +1,486 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- Option: () => (/* reexport */ RadioList_Option),
55
- "default": () => (/* reexport */ RadioList_RadioList)
56
- });
57
-
58
- ;// CONCATENATED MODULE: external "react"
59
- const external_react_namespaceObject = require("react");
60
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
61
- ;// CONCATENATED MODULE: external "prop-types"
62
- const external_prop_types_namespaceObject = require("prop-types");
63
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
64
- ;// CONCATENATED MODULE: external "lodash/omit"
65
- const omit_namespaceObject = require("lodash/omit");
66
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
67
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/id"
68
- const id_namespaceObject = require("@splunk/ui-utils/id");
69
- ;// CONCATENATED MODULE: ./src/RadioList/RadioListContext.ts
70
-
71
- var RadioListContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)({});
72
- RadioListContext.displayName = 'RadioList';
73
- /* harmony default export */ const RadioList_RadioListContext = (RadioListContext);
74
- ;// CONCATENATED MODULE: external "styled-components"
75
- const external_styled_components_namespaceObject = require("styled-components");
76
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
77
- ;// CONCATENATED MODULE: external "@splunk/themes"
78
- const themes_namespaceObject = require("@splunk/themes");
79
- ;// CONCATENATED MODULE: ./src/RadioList/OptionStyles.ts
80
-
81
-
82
- var StyledWrapper = external_styled_components_default().div.withConfig({
83
- displayName: "OptionStyles__StyledWrapper",
84
- componentId: "imaqjt-0"
85
- })(["position:relative;padding:", ";"], (0,themes_namespaceObject.pick)({
86
- prisma: {
87
- comfortable: '10px 0',
88
- compact: '6px 0'
89
- },
90
- enterprise: '7px 0 7px 0'
91
- }));
92
- var StyledLabel = external_styled_components_default().label.withConfig({
93
- displayName: "OptionStyles__StyledLabel",
94
- componentId: "imaqjt-1"
95
- })(["", ";", ";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_namespaceObject.mixins.reset('block'), (0,themes_namespaceObject.pick)({
96
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.contentColorActive)
97
- }), (0,themes_namespaceObject.pick)({
98
- prisma: '10px',
99
- enterprise: themes_namespaceObject.variables.spacingQuarter
100
- }), (0,themes_namespaceObject.pick)({
101
- prisma: '20px',
102
- enterprise: '18px'
103
- }), (0,themes_namespaceObject.pick)({
104
- prisma: (0,external_styled_components_namespaceObject.css)(["2px solid ", ""], themes_namespaceObject.variables.contentColorMuted),
105
- enterprise: (0,external_styled_components_namespaceObject.css)(["1px solid ", ""], themes_namespaceObject.variables.gray80)
106
- }), (0,themes_namespaceObject.pick)({
107
- prisma: (0,external_styled_components_namespaceObject.css)(["width:20px;height:20px;left:-20px;"]),
108
- enterprise: (0,external_styled_components_namespaceObject.css)(["width:18px;height:18px;left:-18px;"])
109
- }), (0,themes_namespaceObject.pick)({
110
- prisma: (0,external_styled_components_namespaceObject.css)(["top:6px;left:-14px;"]),
111
- enterprise: (0,external_styled_components_namespaceObject.css)(["top:5px;left:-13px;"])
112
- }), (0,themes_namespaceObject.pick)({
113
- prisma: themes_namespaceObject.variables.white,
114
- enterprise: {
115
- dark: themes_namespaceObject.variables.gray80,
116
- light: themes_namespaceObject.variables.gray45
117
- }
118
- }), (0,themes_namespaceObject.pick)({
119
- compact: {
120
- enterprise: (0,external_styled_components_namespaceObject.css)(["font-size:", ";"], themes_namespaceObject.variables.fontSizeSmall)
121
- }
122
- }), (0,themes_namespaceObject.pick)({
123
- prisma: (0,external_styled_components_namespaceObject.css)(["&:hover{&::before{box-shadow:", ";border-color:", ";background-color:", ";}"], themes_namespaceObject.variables.hoverShadow, themes_namespaceObject.variables.contentColorDefault, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.backgroundColorPage, themes_namespaceObject.variables.interactiveColorOverlayHover))
124
- }));
125
- var StyledRadioInput = external_styled_components_default().input.withConfig({
126
- displayName: "OptionStyles__StyledRadioInput",
127
- componentId: "imaqjt-2"
128
- })(["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:", ";}", " ", ""],
129
- /* sc-sel */
130
- StyledLabel, themes_namespaceObject.variables.focusShadow,
131
- /* sc-sel */
132
- StyledLabel,
133
- /* sc-sel */
134
- StyledLabel, (0,themes_namespaceObject.pick)({
135
- prisma: (0,external_styled_components_namespaceObject.css)(["border-color:transparent;background-color:", ";"], themes_namespaceObject.variables.interactiveColorPrimary),
136
- enterprise: {
137
- dark: (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.gray80),
138
- light: (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.gray45)
139
- }
140
- }),
141
- /* sc-sel */
142
- StyledLabel, (0,themes_namespaceObject.pick)({
143
- prisma: themes_namespaceObject.variables.contentColorDisabled,
144
- enterprise: {
145
- dark: themes_namespaceObject.variables.gray45,
146
- light: themes_namespaceObject.variables.gray80
147
- }
148
- }),
149
- /* sc-sel */
150
- StyledLabel, (0,themes_namespaceObject.pick)({
151
- enterprise: {
152
- dark: (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.gray45),
153
- light: (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.gray80)
154
- }
155
- }),
156
- /* sc-sel */
157
- StyledLabel, (0,themes_namespaceObject.pick)({
158
- prisma: (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.contentColorDisabled)
159
- }),
160
- /* sc-sel */
161
- StyledLabel, (0,themes_namespaceObject.pick)({
162
- prisma: themes_namespaceObject.variables.contentColorDisabled,
163
- enterprise: {
164
- dark: themes_namespaceObject.variables.gray45,
165
- light: themes_namespaceObject.variables.gray80
166
- }
167
- }), function (_ref) {
168
- var $error = _ref.$error;
169
- return $error && (0,external_styled_components_namespaceObject.css)(["&:not(:disabled) + ", "{color:", ";&::before{border-color:", ";}}&:checked:not(:disabled) + ", "{&::before{border-color:", ";}", "}", ""],
170
- /* sc-sel */
171
- StyledLabel, (0,themes_namespaceObject.pick)({
172
- prisma: themes_namespaceObject.variables.accentColorNegative,
173
- enterprise: themes_namespaceObject.variables.errorColor
174
- }), (0,themes_namespaceObject.pick)({
175
- prisma: themes_namespaceObject.variables.accentColorNegative,
176
- enterprise: {
177
- dark: themes_namespaceObject.variables.errorColor,
178
- light: themes_namespaceObject.variables.errorColorL30
179
- }
180
- }),
181
- /* sc-sel */
182
- StyledLabel, (0,themes_namespaceObject.pick)({
183
- prisma: themes_namespaceObject.variables.accentColorNegative,
184
- enterprise: themes_namespaceObject.variables.errorColor
185
- }), (0,themes_namespaceObject.pick)({
186
- enterprise: (0,external_styled_components_namespaceObject.css)(["&::after{background-color:", ";}"], themes_namespaceObject.variables.errorColor)
187
- }), (0,themes_namespaceObject.pick)({
188
- prisma: (0,external_styled_components_namespaceObject.css)(["&:not(:disabled):checked + ", "{&::before{background-color:", ";}}"],
189
- /* sc-sel */
190
- StyledLabel, themes_namespaceObject.variables.accentColorNegative)
191
- }));
192
- }, (0,themes_namespaceObject.pick)({
193
- prisma: (0,external_styled_components_namespaceObject.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);}}"],
194
- /* sc-sel */
195
- StyledLabel, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.backgroundColorPage, themes_namespaceObject.variables.interactiveColorOverlayActive),
196
- /* sc-sel */
197
- StyledLabel, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.white, themes_namespaceObject.variables.interactiveColorOverlayActive),
198
- /* sc-sel */
199
- StyledLabel, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.interactiveColorPrimary, themes_namespaceObject.variables.interactiveColorOverlayActive),
200
- /* sc-sel */
201
- StyledLabel,
202
- /* sc-sel */
203
- StyledLabel, themes_namespaceObject.variables.interactiveColorBackgroundDisabled)
204
- }));
205
- ;// CONCATENATED MODULE: ./src/RadioList/Option.tsx
206
- 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); }
207
-
208
- 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; }
209
-
210
- 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; }
211
-
212
-
213
-
214
-
215
-
216
-
217
- var propTypes = {
218
- children: (external_prop_types_default()).node,
219
- disabled: (external_prop_types_default()).bool,
220
- error: (external_prop_types_default()).bool,
221
- id: (external_prop_types_default()).string,
222
- onChange: (external_prop_types_default()).func,
223
- value: (external_prop_types_default()).any.isRequired
224
- };
225
-
226
- function Option(_ref) {
227
- var children = _ref.children,
228
- _ref$disabled = _ref.disabled,
229
- disabledProp = _ref$disabled === void 0 ? false : _ref$disabled,
230
- _ref$error = _ref.error,
231
- errorProp = _ref$error === void 0 ? false : _ref$error,
232
- idProp = _ref.id,
233
- onChange = _ref.onChange,
234
- value = _ref.value,
235
- otherProps = _objectWithoutProperties(_ref, ["children", "disabled", "error", "id", "onChange", "value"]);
236
-
237
- // @docs-props-type OptionPropsBase
238
- var _useRef = (0,external_react_namespaceObject.useRef)(idProp || (0,id_namespaceObject.createDOMID)('radio-option')),
239
- id = _useRef.current;
240
-
241
- var radioList = (0,external_react_namespaceObject.useContext)(RadioList_RadioListContext);
242
-
243
- var handleOnChange = function handleOnChange(e) {
244
- var _radioList$onChange;
245
-
246
- e.stopPropagation();
247
- onChange === null || onChange === void 0 ? void 0 : onChange(e, {
248
- value: value,
249
- name: radioList.name
250
- });
251
- (_radioList$onChange = radioList.onChange) === null || _radioList$onChange === void 0 ? void 0 : _radioList$onChange.call(radioList, e, {
252
- value: value,
253
- 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
254
66
  });
255
- };
256
-
257
- var checked = false;
258
-
259
- if ((radioList === null || radioList === void 0 ? void 0 : radioList.value) !== undefined) {
260
- checked = radioList.value === value;
261
- }
262
-
263
- var disabled = disabledProp;
264
-
265
- if (radioList === null || radioList === void 0 ? void 0 : radioList.disabled) {
266
- disabled = radioList.disabled;
267
- }
268
-
269
- var $error = errorProp;
270
-
271
- if (radioList === null || radioList === void 0 ? void 0 : radioList.error) {
272
- $error = radioList.error;
273
- }
274
-
275
- return /*#__PURE__*/external_react_default().createElement(StyledWrapper, _extends({
276
- "data-test": "option",
277
- "data-test-value": value
278
- }, otherProps, {
279
- "data-checked": checked
280
- }), /*#__PURE__*/external_react_default().createElement(StyledRadioInput, {
281
- id: id,
282
- type: "radio",
283
- name: radioList.name,
284
- $error: $error,
285
- disabled: disabled,
286
- value: value.toString(),
287
- checked: checked,
288
- onChange: handleOnChange,
289
- "data-test": "input"
290
- }), /*#__PURE__*/external_react_default().createElement(StyledLabel, {
291
- htmlFor: id,
292
- "data-test": "label"
293
- }, children));
294
- }
295
-
296
- Option.propTypes = propTypes;
297
- /* harmony default export */ const RadioList_Option = (Option);
298
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Box"
299
- const Box_namespaceObject = require("@splunk/react-ui/Box");
300
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_namespaceObject);
301
- ;// CONCATENATED MODULE: ./src/RadioList/RadioListStyles.ts
302
-
303
-
304
-
305
- var StyledBox = external_styled_components_default()((Box_default())).withConfig({
306
- displayName: "RadioListStyles__StyledBox",
307
- componentId: "sc-1qg10hx-0"
308
- })(["align-items:flex-start;flex-wrap:wrap;flex-direction:", ";", ""], function (props) {
309
- return props.direction;
310
- }, function (props) {
311
- return props.direction === 'row' && (0,external_styled_components_namespaceObject.css)(["", "{margin-right:40px;margin-inline-end:40px;}"], StyledWrapper);
312
- });
313
-
314
- ;// CONCATENATED MODULE: ./src/RadioList/RadioList.tsx
315
- 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); }
316
-
317
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
318
-
319
- 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."); }
320
-
321
- 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); }
322
-
323
- 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; }
324
-
325
- 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; }
326
-
327
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
328
-
329
- 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; }
330
-
331
- 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; }
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
- var RadioList_propTypes = {
341
- direction: external_prop_types_default().oneOf(['row', 'column']),
342
- children: (external_prop_types_default()).node,
343
- defaultValue: (external_prop_types_default()).any,
344
- disabled: (external_prop_types_default()).bool,
345
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
346
- error: (external_prop_types_default()).bool,
347
- name: (external_prop_types_default()).string,
348
- onChange: (external_prop_types_default()).func,
349
-
350
- /** @private. */
351
- required: (external_prop_types_default()).bool,
352
- value: (external_prop_types_default()).any,
353
- labelledBy: (external_prop_types_default()).string,
354
- describedBy: (external_prop_types_default()).string
355
- };
356
-
357
- function RadioList(_ref) {
358
- var children = _ref.children,
359
- defaultValueProp = _ref.defaultValue,
360
- describedBy = _ref.describedBy,
361
- _ref$direction = _ref.direction,
362
- direction = _ref$direction === void 0 ? 'column' : _ref$direction,
363
- _ref$disabled = _ref.disabled,
364
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
365
- _ref$error = _ref.error,
366
- error = _ref$error === void 0 ? false : _ref$error,
367
- labelledBy = _ref.labelledBy,
368
- nameProp = _ref.name,
369
- onChange = _ref.onChange,
370
- required = _ref.required,
371
- valueProp = _ref.value,
372
- otherProps = RadioList_objectWithoutProperties(_ref, ["children", "defaultValue", "describedBy", "direction", "disabled", "error", "labelledBy", "name", "onChange", "required", "value"]);
373
-
374
- // @docs-props-type RadioListPropsBase
375
- // TODO: Implement shared isControlled hook (SUI-5283).
376
- // See material-ui for similar pattern to handle controlled/un-controlled in functional components w/ hooks
377
- // https://github.com/mui-org/material-ui/blob/60d99a39836fb82f4da1477a717f642c216fb0b9/packages/material-ui/src/utils/useControlled.js
378
- var _useRef = (0,external_react_namespaceObject.useRef)(valueProp !== undefined),
379
- isControlledExternally = _useRef.current;
380
-
381
- var _useState = (0,external_react_namespaceObject.useState)(defaultValueProp),
382
- _useState2 = _slicedToArray(_useState, 2),
383
- valueState = _useState2[0],
384
- setValueState = _useState2[1];
385
-
386
- var value = isControlledExternally ? valueProp : valueState;
387
-
388
- var _useRef2 = (0,external_react_namespaceObject.useRef)(nameProp || (0,id_namespaceObject.createDOMID)('radio-name')),
389
- name = _useRef2.current;
390
-
391
- var handleChange = function handleChange(e, data) {
392
- if (!isControlledExternally) {
393
- 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;
394
414
  }
395
-
396
- onChange === null || onChange === void 0 ? void 0 : onChange(e, data);
397
- }; // Check correct props are passed
398
-
399
-
400
- if (false) {}
401
-
402
- if (false) {} // Check if changing from controlled to un-controlled
403
-
404
-
405
- (0,external_react_namespaceObject.useEffect)(function () {
406
- if (false) {}
407
- }, [valueProp, isControlledExternally]);
408
-
409
- var _useRef3 = (0,external_react_namespaceObject.useRef)(defaultValueProp),
410
- defaultValue = _useRef3.current;
411
-
412
- (0,external_react_namespaceObject.useEffect)(function () {
413
- if (false) {}
414
- }, [defaultValue, defaultValueProp, isControlledExternally]);
415
- var labelledByAttr = otherProps['aria-labelledby'];
416
- var describedByAttr = otherProps['aria-describedby'];
417
- return /*#__PURE__*/external_react_default().createElement(RadioList_RadioListContext.Provider, {
418
- value: {
419
- value: value,
420
- name: name,
421
- onChange: handleChange,
422
- error: error,
423
- 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));
424
479
  }
425
- }, /*#__PURE__*/external_react_default().createElement(StyledBox, RadioList_extends({
426
- flex: true,
427
- direction: direction,
428
- role: "radiogroup",
429
- "data-test": "radio-list",
430
- "data-test-value": value
431
- }, omit_default()(otherProps, ['aria-labelledby', 'aria-describedby']), {
432
- "aria-labelledby": labelledByAttr ? "".concat(labelledByAttr, " ").concat(labelledBy) : labelledBy,
433
- "aria-describedby": describedByAttr ? "".concat(describedByAttr, " ").concat(describedBy) : describedBy,
434
- "aria-required": required
435
- }), children));
436
- }
437
-
438
- RadioList.propTypes = RadioList_propTypes;
439
- RadioList.Option = RadioList_Option;
440
- /* harmony default export */ const RadioList_RadioList = (RadioList);
441
- // only for styled components using RadioList
442
- ;// CONCATENATED MODULE: ./src/RadioList/index.ts
443
-
444
-
445
- module.exports = __webpack_exports__;
446
- /******/ })()
447
- ;
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
+ /******/})();