@splunk/react-ui 4.4.1 → 4.5.2

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 (131) hide show
  1. package/Accordion.js +37 -21
  2. package/Anchor.js +2 -2
  3. package/Animation.js +2 -2
  4. package/AnimationToggle.js +2 -2
  5. package/Box.js +2 -2
  6. package/Button.js +36 -12
  7. package/ButtonGroup.js +27 -6
  8. package/ButtonSimple.js +6 -6
  9. package/CHANGELOG.md +61 -1
  10. package/Calendar.js +14 -14
  11. package/Card.js +49 -23
  12. package/CardLayout.js +31 -10
  13. package/Chip.js +77 -53
  14. package/Clickable.js +4 -4
  15. package/CloseButton.js +6 -6
  16. package/Code.js +4 -4
  17. package/CollapsiblePanel.js +6 -6
  18. package/Color.js +103 -56
  19. package/ColumnLayout.js +4 -4
  20. package/ComboBox.js +20 -15
  21. package/Concertina.js +73 -68
  22. package/ControlGroup.js +72 -24
  23. package/Date.js +11 -11
  24. package/DefinitionList.js +6 -6
  25. package/Dropdown.js +12 -12
  26. package/EventListener.js +168 -0
  27. package/FetchOptions.js +8 -8
  28. package/File.js +48 -37
  29. package/FormRows.js +340 -220
  30. package/Image.js +14 -14
  31. package/JSONTree.js +5 -5
  32. package/Layer.js +32 -20
  33. package/Link.js +6 -6
  34. package/List.js +2 -2
  35. package/Markdown.js +250 -88
  36. package/Menu.js +70 -64
  37. package/Message.js +18 -18
  38. package/Modal.js +68 -14
  39. package/ModalLayer.js +4 -4
  40. package/Monogram.js +12 -11
  41. package/Multiselect.js +122 -78
  42. package/Number.js +19 -16
  43. package/Paginator.js +10 -10
  44. package/Paragraph.js +2 -2
  45. package/Popover.js +52 -38
  46. package/Progress.js +8 -8
  47. package/RadioBar.js +56 -69
  48. package/RadioList.js +2 -2
  49. package/Resize.js +19 -15
  50. package/ResultsMenu.js +8 -8
  51. package/ScreenReaderContent.js +2 -2
  52. package/Scroll.js +16 -14
  53. package/ScrollContainerContext.js +5 -5
  54. package/Search.d.ts +2 -0
  55. package/Search.js +797 -0
  56. package/Select.js +63 -35
  57. package/SidePanel.js +6 -6
  58. package/Slider.js +29 -25
  59. package/SlidingPanels.js +4 -4
  60. package/StaticContent.js +2 -2
  61. package/StepBar.js +56 -52
  62. package/Switch.js +8 -8
  63. package/TabBar.js +126 -85
  64. package/TabLayout.js +4 -5
  65. package/Table.js +188 -138
  66. package/Text.js +69 -63
  67. package/Tooltip.js +11 -11
  68. package/TransitionOpen.js +9 -9
  69. package/WaitSpinner.js +3 -4
  70. package/package.json +6 -7
  71. package/types/src/Accordion/AccordionContext.d.ts +10 -0
  72. package/types/src/Accordion/Panel.d.ts +0 -9
  73. package/types/src/Button/Button.d.ts +4 -2
  74. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +7 -0
  75. package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
  76. package/types/src/Card/Card.d.ts +2 -0
  77. package/types/src/CardLayout/CardLayoutContext.d.ts +8 -0
  78. package/types/src/Color/Color.d.ts +2 -2
  79. package/types/src/ComboBox/ComboBox.d.ts +4 -3
  80. package/types/src/Concertina/ConcertinaContext.d.ts +8 -0
  81. package/types/src/Concertina/Panel.d.ts +2 -4
  82. package/types/src/ControlGroup/ControlGroup.d.ts +6 -1
  83. package/types/src/Date/Date.d.ts +3 -3
  84. package/types/src/EventListener/EventListener.d.ts +18 -0
  85. package/types/src/EventListener/index.d.ts +2 -0
  86. package/types/src/File/File.d.ts +6 -4
  87. package/types/src/FormRows/FormRows.d.ts +70 -12
  88. package/types/src/FormRows/FormRowsContext.d.ts +1 -0
  89. package/types/src/FormRows/Row.d.ts +9 -7
  90. package/types/src/Markdown/Markdown.d.ts +2 -0
  91. package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +14 -0
  92. package/types/src/Markdown/renderers/MarkdownCode.d.ts +15 -0
  93. package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +16 -0
  94. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +15 -0
  95. package/types/src/Markdown/renderers/MarkdownImage.d.ts +18 -0
  96. package/types/src/Markdown/renderers/MarkdownItem.d.ts +14 -0
  97. package/types/src/Markdown/renderers/MarkdownLink.d.ts +18 -0
  98. package/types/src/Markdown/renderers/MarkdownList.d.ts +26 -0
  99. package/types/src/Markdown/renderers/MarkdownParagraph.d.ts +14 -0
  100. package/types/src/Markdown/renderers/index.d.ts +10 -0
  101. package/types/src/Modal/Modal.d.ts +15 -3
  102. package/types/src/Monogram/Monogram.d.ts +5 -1
  103. package/types/src/Multiselect/Compact.d.ts +12 -4
  104. package/types/src/Multiselect/Multiselect.d.ts +14 -4
  105. package/types/src/Multiselect/Normal.d.ts +7 -2
  106. package/types/src/Number/Number.d.ts +11 -7
  107. package/types/src/Popover/Popover.d.ts +2 -2
  108. package/types/src/RadioBar/Option.d.ts +4 -14
  109. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  110. package/types/src/RadioBar/RadioBarContext.d.ts +9 -0
  111. package/types/src/Scroll/Inner.d.ts +1 -1
  112. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +4 -4
  113. package/types/src/Search/Option.d.ts +60 -0
  114. package/types/src/Search/Search.d.ts +97 -0
  115. package/types/src/Search/index.d.ts +2 -0
  116. package/types/src/Select/Select.d.ts +6 -2
  117. package/types/src/Select/SelectBase.d.ts +12 -5
  118. package/types/src/Slider/Slider.d.ts +2 -2
  119. package/types/src/StepBar/Step.d.ts +1 -13
  120. package/types/src/StepBar/StepBarContext.d.ts +8 -0
  121. package/types/src/TabBar/Tab.d.ts +5 -13
  122. package/types/src/TabBar/TabBarContext.d.ts +14 -0
  123. package/types/src/Table/Body.d.ts +1 -1
  124. package/types/src/Table/Head.d.ts +1 -1
  125. package/types/src/Table/Row.d.ts +10 -3
  126. package/types/src/Table/Table.d.ts +3 -2
  127. package/types/src/Text/Text.d.ts +11 -7
  128. package/types/src/icons/Sort.d.ts +3 -0
  129. package/types/src/usePrevious/index.d.ts +2 -0
  130. package/types/src/usePrevious/usePrevious.d.ts +12 -0
  131. package/usePrevious.js +137 -0
package/StepBar.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 115);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 116);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -108,7 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
108
108
 
109
109
  /***/ }),
110
110
 
111
- /***/ 115:
111
+ /***/ 116:
112
112
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
113
113
 
114
114
  "use strict";
@@ -142,7 +142,7 @@ var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(exte
142
142
  var themes_ = __webpack_require__(0);
143
143
 
144
144
  // EXTERNAL MODULE: external "@splunk/react-icons/Error"
145
- var Error_ = __webpack_require__(63);
145
+ var Error_ = __webpack_require__(66);
146
146
  var Error_default = /*#__PURE__*/__webpack_require__.n(Error_);
147
147
 
148
148
  // EXTERNAL MODULE: ./src/icons/ThemedIcon.tsx
@@ -179,7 +179,7 @@ function AlertFilled(props) {
179
179
  }, props));
180
180
  }
181
181
  // EXTERNAL MODULE: external "@splunk/react-icons/Success"
182
- var Success_ = __webpack_require__(64);
182
+ var Success_ = __webpack_require__(67);
183
183
  var Success_default = /*#__PURE__*/__webpack_require__.n(Success_);
184
184
 
185
185
  // CONCATENATED MODULE: ./src/icons/Success.tsx
@@ -214,6 +214,8 @@ function SuccessFilled(props) {
214
214
 
215
215
 
216
216
 
217
+ var primaryBackgroundColor = '#1A8929'; // SUI-2439 to meet WCAG AA compliance
218
+
217
219
  var iconWrapper = Object(external_styled_components_["css"])(["align-items:center;height:24px;width:24px;margin:0 14px 0 16px;"]);
218
220
  var StyledSuccess = external_styled_components_default()(SuccessFilled).withConfig({
219
221
  displayName: "StepStyles__StyledSuccess",
@@ -265,17 +267,24 @@ var StyledSvg = external_styled_components_default.a.svg.withConfig({
265
267
  var StyledPrevOrActiveRect = external_styled_components_default.a.rect.withConfig({
266
268
  displayName: "StepStyles__StyledPrevOrActiveRect",
267
269
  componentId: "sc-756fxp-4"
268
- })(["fill:", ";"], themes_["variables"].interactiveColorPrimary);
270
+ })(["fill:", ";"], primaryBackgroundColor);
269
271
  var StyledPrevOrActiveCircle = StyledPrevOrActiveRect.withComponent('circle');
270
272
  var StyledGray = external_styled_components_default.a.rect.withConfig({
271
273
  displayName: "StepStyles__StyledGray",
272
274
  componentId: "sc-756fxp-5"
273
- })(["fill:", ";"], themes_["variables"].textDisabledColor);
275
+ })(["fill:", ";"], themes_["variables"].gray60);
274
276
  var StyledNext = external_styled_components_default.a.circle.withConfig({
275
277
  displayName: "StepStyles__StyledNext",
276
278
  componentId: "sc-756fxp-6"
277
- })(["stroke:", ";stroke-width:3px;fill:", ";"], themes_["variables"].textDisabledColor, themes_["variables"].backgroundColor);
279
+ })(["stroke:", ";stroke-width:3px;fill:", ";"], themes_["variables"].gray60, themes_["variables"].backgroundColor);
280
+
281
+ // CONCATENATED MODULE: ./src/StepBar/StepBarContext.tsx
278
282
 
283
+ var StepBarContext = /*#__PURE__*/Object(external_react_["createContext"])({
284
+ activeStepId: 0
285
+ });
286
+ StepBarContext.displayName = 'StepBar';
287
+ /* harmony default export */ var StepBar_StepBarContext = (StepBarContext);
279
288
  // CONCATENATED MODULE: ./src/StepBar/Step.tsx
280
289
  function Step_extends() { Step_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 Step_extends.apply(this, arguments); }
281
290
 
@@ -287,14 +296,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
287
296
 
288
297
 
289
298
 
299
+
290
300
  var propTypes = {
291
301
  children: external_prop_types_default.a.node,
292
302
  elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
293
303
  error: external_prop_types_default.a.bool,
294
- idCounter: external_prop_types_default.a.string,
295
- isFirst: external_prop_types_default.a.bool,
296
- isLast: external_prop_types_default.a.bool,
297
- status: external_prop_types_default.a.oneOf(['prev', 'active', 'next']),
298
304
  stepId: external_prop_types_default.a.any
299
305
  };
300
306
 
@@ -303,20 +309,35 @@ function Step(_ref) {
303
309
  elementRef = _ref.elementRef,
304
310
  _ref$error = _ref.error,
305
311
  error = _ref$error === void 0 ? false : _ref$error,
306
- idCounter = _ref.idCounter,
307
- _ref$isFirst = _ref.isFirst,
308
- isFirst = _ref$isFirst === void 0 ? false : _ref$isFirst,
309
- _ref$isLast = _ref.isLast,
310
- isLast = _ref$isLast === void 0 ? false : _ref$isLast,
311
- _ref$status = _ref.status,
312
- status = _ref$status === void 0 ? 'next' : _ref$status,
313
312
  stepId = _ref.stepId,
314
- otherProps = _objectWithoutProperties(_ref, ["children", "elementRef", "error", "idCounter", "isFirst", "isLast", "status", "stepId"]);
313
+ otherProps = _objectWithoutProperties(_ref, ["children", "elementRef", "error", "stepId"]);
315
314
 
316
315
  // @docs-props-type StepPropsBase
316
+ var _useContext = Object(external_react_["useContext"])(StepBarContext),
317
+ activeStepIdContext = _useContext.activeStepId,
318
+ idCounterContext = _useContext.idCounter,
319
+ lastChildIndexContext = _useContext.lastChildIndex;
320
+
317
321
  var _useSplunkTheme = useSplunkTheme_default()(),
318
322
  family = _useSplunkTheme.family;
319
323
 
324
+ var status = 'next';
325
+ var active = activeStepIdContext === stepId;
326
+ var isFirst = stepId === 0;
327
+ var isLast = stepId === lastChildIndexContext;
328
+
329
+ if (stepId < activeStepIdContext) {
330
+ status = 'prev';
331
+ }
332
+
333
+ if (active && !error) {
334
+ status = 'active';
335
+ }
336
+
337
+ if (active && error) {
338
+ status = 'error';
339
+ }
340
+
320
341
  if (family === 'enterprise') {
321
342
  return /*#__PURE__*/external_react_default.a.createElement(Styled, Step_extends({
322
343
  $status: status,
@@ -368,7 +389,7 @@ function Step(_ref) {
368
389
  "data-test-status": status,
369
390
  "data-test": "step",
370
391
  "data-test-step-id": stepId,
371
- $idCounter: idCounter,
392
+ $idCounter: idCounterContext,
372
393
  ref: elementRef
373
394
  }, otherProps), status === 'prev' && /*#__PURE__*/external_react_default.a.createElement(StyledSuccess, null), status === 'error' && /*#__PURE__*/external_react_default.a.createElement(StyledAlert, null), children);
374
395
  }
@@ -403,6 +424,7 @@ function StepBar_objectWithoutPropertiesLoose(source, excluded) { if (source ==
403
424
 
404
425
 
405
426
 
427
+
406
428
  var StepBar_propTypes = {
407
429
  activeStepId: external_prop_types_default.a.any.isRequired,
408
430
  children: external_prop_types_default.a.node,
@@ -423,44 +445,20 @@ function StepBar(_ref) {
423
445
  idCounter = _useRef.current;
424
446
 
425
447
  var activeIndex = 0;
426
- var foundActive = false;
427
448
  var validChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]);
428
449
  var lastChildIndex = validChildren.length - 1;
429
450
  var clonedChildren = validChildren.map(function (child, idx) {
430
451
  var stepId = child.props.stepId || idx;
431
452
  var error = child.props.error;
432
- var active = activeStepId === stepId;
433
- var childProps = {
434
- status: 'prev',
435
- stepId: stepId,
436
- idCounter: idCounter
437
- };
438
-
439
- if (foundActive) {
440
- childProps.status = 'next';
441
- }
442
-
443
- if (active && !error) {
444
- childProps.status = 'active';
445
- foundActive = true;
446
- activeIndex = idx;
447
- }
448
453
 
449
- if (active && error) {
450
- childProps.status = 'error';
451
- foundActive = true;
454
+ if (stepId === activeStepId) {
452
455
  activeIndex = idx;
453
456
  }
454
457
 
455
- if (idx === 0) {
456
- childProps.isFirst = true;
457
- }
458
-
459
- if (idx === lastChildIndex) {
460
- childProps.isLast = true;
461
- }
462
-
463
- return /*#__PURE__*/Object(external_react_["cloneElement"])(child, childProps);
458
+ return /*#__PURE__*/Object(external_react_["cloneElement"])(child, {
459
+ stepId: stepId,
460
+ error: error
461
+ });
464
462
  });
465
463
  return /*#__PURE__*/external_react_default.a.createElement(StepBarStyles_Styled, StepBar_extends({
466
464
  $inline: inline,
@@ -473,7 +471,13 @@ function StepBar(_ref) {
473
471
  "aria-valuenow": activeIndex + 1,
474
472
  $idCounter: idCounter,
475
473
  ref: elementRef
476
- }, otherProps), clonedChildren);
474
+ }, otherProps), /*#__PURE__*/external_react_default.a.createElement(StepBar_StepBarContext.Provider, {
475
+ value: {
476
+ idCounter: idCounter,
477
+ lastChildIndex: lastChildIndex,
478
+ activeStepId: activeStepId
479
+ }
480
+ }, clonedChildren));
477
481
  }
478
482
 
479
483
  StepBar.propTypes = StepBar_propTypes;
@@ -532,14 +536,14 @@ function SVG(props) {
532
536
 
533
537
  /***/ }),
534
538
 
535
- /***/ 63:
539
+ /***/ 66:
536
540
  /***/ (function(module, exports) {
537
541
 
538
542
  module.exports = require("@splunk/react-icons/Error");
539
543
 
540
544
  /***/ }),
541
545
 
542
- /***/ 64:
546
+ /***/ 67:
543
547
  /***/ (function(module, exports) {
544
548
 
545
549
  module.exports = require("@splunk/react-icons/Success");
package/Switch.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 129);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 140);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -108,14 +108,14 @@ module.exports = require("@splunk/ui-utils/id");
108
108
 
109
109
  /***/ }),
110
110
 
111
- /***/ 11:
111
+ /***/ 12:
112
112
  /***/ (function(module, exports) {
113
113
 
114
114
  module.exports = require("@splunk/react-ui/Clickable");
115
115
 
116
116
  /***/ }),
117
117
 
118
- /***/ 129:
118
+ /***/ 140:
119
119
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
120
120
 
121
121
  "use strict";
@@ -138,7 +138,7 @@ var AnimationToggle_ = __webpack_require__(34);
138
138
  var AnimationToggle_default = /*#__PURE__*/__webpack_require__.n(AnimationToggle_);
139
139
 
140
140
  // EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
141
- var ScreenReaderContent_ = __webpack_require__(14);
141
+ var ScreenReaderContent_ = __webpack_require__(15);
142
142
  var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
143
143
 
144
144
  // EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
@@ -148,7 +148,7 @@ var i18n_ = __webpack_require__(5);
148
148
  var id_ = __webpack_require__(10);
149
149
 
150
150
  // EXTERNAL MODULE: external "@splunk/react-icons/Check"
151
- var Check_ = __webpack_require__(44);
151
+ var Check_ = __webpack_require__(45);
152
152
  var Check_default = /*#__PURE__*/__webpack_require__.n(Check_);
153
153
 
154
154
  // EXTERNAL MODULE: external "@splunk/themes"
@@ -196,7 +196,7 @@ var Box_ = __webpack_require__(8);
196
196
  var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
197
197
 
198
198
  // EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
199
- var Clickable_ = __webpack_require__(11);
199
+ var Clickable_ = __webpack_require__(12);
200
200
  var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
201
201
 
202
202
  // CONCATENATED MODULE: ./src/Switch/SwitchStyles.ts
@@ -726,7 +726,7 @@ _defineProperty(Switch_Switch, "defaultProps", defaultProps);
726
726
 
727
727
  /***/ }),
728
728
 
729
- /***/ 14:
729
+ /***/ 15:
730
730
  /***/ (function(module, exports) {
731
731
 
732
732
  module.exports = require("@splunk/react-ui/ScreenReaderContent");
@@ -754,7 +754,7 @@ module.exports = require("@splunk/react-ui/AnimationToggle");
754
754
 
755
755
  /***/ }),
756
756
 
757
- /***/ 44:
757
+ /***/ 45:
758
758
  /***/ (function(module, exports) {
759
759
 
760
760
  module.exports = require("@splunk/react-icons/Check");