@splunk/react-ui 4.1.0 → 4.4.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 (163) hide show
  1. package/Accordion.js +4 -4
  2. package/Anchor.js +2 -2
  3. package/Animation.js +26 -35
  4. package/AnimationToggle.js +2 -2
  5. package/Box.js +2 -2
  6. package/Button.js +22 -22
  7. package/ButtonGroup.js +2 -2
  8. package/ButtonSimple.js +12 -6
  9. package/CHANGELOG.md +69 -2
  10. package/Calendar.js +23 -23
  11. package/Card.js +15 -15
  12. package/CardLayout.js +2 -2
  13. package/Chip.js +13 -13
  14. package/Clickable.js +4 -4
  15. package/CloseButton.js +8 -8
  16. package/Code.js +1279 -1120
  17. package/CollapsiblePanel.js +11 -11
  18. package/Color.js +111 -172
  19. package/ColumnLayout.js +6 -6
  20. package/ComboBox.js +63 -30
  21. package/Concertina.js +2 -2
  22. package/ControlGroup.js +61 -20
  23. package/Date.js +66 -29
  24. package/DefinitionList.js +2 -2
  25. package/Dropdown.js +6 -6
  26. package/FetchOptions.js +8 -8
  27. package/File.js +87 -72
  28. package/FormRows.js +219 -331
  29. package/Heading.js +2 -2
  30. package/Image.js +15 -15
  31. package/JSONTree.js +63 -20
  32. package/Layer.js +8 -8
  33. package/Link.js +13 -13
  34. package/List.js +2 -2
  35. package/Markdown.js +19 -19
  36. package/Menu.js +315 -230
  37. package/Message.js +19 -19
  38. package/Modal.js +22 -11
  39. package/ModalLayer.js +25 -11
  40. package/Monogram.js +7 -7
  41. package/Multiselect.js +1931 -1057
  42. package/Number.js +40 -27
  43. package/Paginator.js +67 -49
  44. package/Paragraph.js +2 -2
  45. package/Popover.js +62 -35
  46. package/Progress.js +9 -21
  47. package/RadioBar.js +6 -6
  48. package/RadioList.js +2 -2
  49. package/ResultsMenu.js +18 -10
  50. package/ScreenReaderContent.js +2 -2
  51. package/Scroll.js +37 -19
  52. package/ScrollContainerContext.js +2 -2
  53. package/Select.js +1309 -562
  54. package/SidePanel.js +22 -17
  55. package/Slider.js +8 -8
  56. package/SlidingPanels.js +63 -47
  57. package/StaticContent.js +2 -2
  58. package/StepBar.js +8 -8
  59. package/Switch.js +20 -11
  60. package/TabBar.js +54 -40
  61. package/TabLayout.js +4 -4
  62. package/Table.js +148 -85
  63. package/Text.js +474 -356
  64. package/Tooltip.js +6 -6
  65. package/TransitionOpen.js +26 -24
  66. package/WaitSpinner.js +4 -4
  67. package/package.json +8 -7
  68. package/stubs-splunkui.d.ts +1 -0
  69. package/types/src/Accordion/Accordion.d.ts +2 -2
  70. package/types/src/Animation/Animation.d.ts +6 -5
  71. package/types/src/Button/Button.d.ts +2 -2
  72. package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
  73. package/types/src/Calendar/DateTable.d.ts +1 -0
  74. package/types/src/Calendar/MonthHeader.d.ts +2 -2
  75. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -2
  76. package/types/src/Color/Color.d.ts +5 -4
  77. package/types/src/Color/Swatch.d.ts +4 -15
  78. package/types/src/ComboBox/ComboBox.d.ts +2 -2
  79. package/types/src/ControlGroup/ControlGroup.d.ts +7 -2
  80. package/types/src/ControlGroup/ControlGroupContext.d.ts +15 -0
  81. package/types/src/Date/Date.d.ts +7 -5
  82. package/types/src/Date/Icon.d.ts +1 -0
  83. package/types/src/Dropdown/Dropdown.d.ts +1 -1
  84. package/types/src/File/File.d.ts +2 -2
  85. package/types/src/File/FileContext.d.ts +9 -0
  86. package/types/src/File/Icon.d.ts +1 -0
  87. package/types/src/File/IconCloud.d.ts +1 -0
  88. package/types/src/File/Item.d.ts +5 -10
  89. package/types/src/File/PaperClip.d.ts +1 -0
  90. package/types/src/File/Retry.d.ts +1 -0
  91. package/types/src/File/Trash.d.ts +1 -0
  92. package/types/src/FormRows/FormRows.d.ts +11 -69
  93. package/types/src/FormRows/FormRowsContext.d.ts +9 -0
  94. package/types/src/FormRows/Row.d.ts +7 -20
  95. package/types/src/JSONTree/JSONTree.d.ts +14 -2
  96. package/types/src/JSONTree/TreeNode.d.ts +4 -1
  97. package/types/src/Menu/Divider.d.ts +1 -0
  98. package/types/src/Menu/Heading.d.ts +3 -1
  99. package/types/src/Menu/Item.d.ts +22 -6
  100. package/types/src/Menu/Menu.d.ts +17 -18
  101. package/types/src/Menu/MenuContext.d.ts +6 -0
  102. package/types/src/Menu/index.d.ts +1 -0
  103. package/types/src/Multiselect/Compact.d.ts +7 -26
  104. package/types/src/Multiselect/Multiselect.d.ts +7 -2
  105. package/types/src/Multiselect/Normal.d.ts +8 -2
  106. package/types/src/Multiselect/Option.d.ts +4 -1
  107. package/types/src/Number/IncrementIcon.d.ts +1 -0
  108. package/types/src/Number/Number.d.ts +4 -4
  109. package/types/src/Paginator/PageSeparator.d.ts +3 -0
  110. package/types/src/Popover/Popover.d.ts +5 -5
  111. package/types/src/Popover/PopoverContext.d.ts +6 -0
  112. package/types/src/Popover/index.d.ts +1 -0
  113. package/types/src/RadioBar/RadioBar.d.ts +5 -5
  114. package/types/src/RadioList/RadioListContext.d.ts +1 -0
  115. package/types/src/ResultsMenu/ResultsMenu.d.ts +4 -0
  116. package/types/src/Scroll/Inner.d.ts +4 -3
  117. package/types/src/Scroll/Scroll.d.ts +1 -1
  118. package/types/src/Select/Option.d.ts +2 -5
  119. package/types/src/Select/OptionBase.d.ts +94 -0
  120. package/types/src/Select/Select.d.ts +12 -37
  121. package/types/src/Select/SelectBase.d.ts +221 -0
  122. package/types/src/SidePanel/SidePanel.d.ts +4 -0
  123. package/types/src/Slider/Slider.d.ts +4 -4
  124. package/types/src/SlidingPanels/SlidingPanels.d.ts +0 -1
  125. package/types/src/Switch/CheckIcon.d.ts +1 -0
  126. package/types/src/Switch/Switch.d.ts +3 -7
  127. package/types/src/TabBar/Tab.d.ts +4 -1
  128. package/types/src/TabLayout/TabLayout.d.ts +2 -2
  129. package/types/src/Table/DragHandle.d.ts +1 -0
  130. package/types/src/Table/Head.d.ts +2 -0
  131. package/types/src/Table/HeadCell.d.ts +2 -2
  132. package/types/src/Table/HeadDropdownCell.d.ts +1 -1
  133. package/types/src/Table/HeadExpandRowsIcon.d.ts +1 -0
  134. package/types/src/Table/HeadInner.d.ts +3 -3
  135. package/types/src/Table/Table.d.ts +7 -3
  136. package/types/src/Table/Toggle.d.ts +1 -0
  137. package/types/src/Text/IconOutlinedHide.d.ts +1 -0
  138. package/types/src/Text/IconOutlinedView.d.ts +1 -0
  139. package/types/src/Text/Text.d.ts +28 -12
  140. package/types/src/Tooltip/InfoIcon.d.ts +1 -0
  141. package/types/src/Tooltip/Tooltip.d.ts +3 -3
  142. package/types/src/icons/Alert.d.ts +1 -0
  143. package/types/src/icons/AlertFilled.d.ts +1 -0
  144. package/types/src/icons/CaretDown.d.ts +1 -0
  145. package/types/src/icons/CaretRight.d.ts +1 -0
  146. package/types/src/icons/Check.d.ts +1 -0
  147. package/types/src/icons/ChevronDown.d.ts +1 -0
  148. package/types/src/icons/ChevronLeft.d.ts +1 -0
  149. package/types/src/icons/ChevronRight.d.ts +1 -0
  150. package/types/src/icons/CrossMark.d.ts +1 -0
  151. package/types/src/icons/External.d.ts +1 -0
  152. package/types/src/icons/InfoFilled.d.ts +1 -0
  153. package/types/src/icons/More.d.ts +1 -0
  154. package/types/src/icons/MoreVertical.d.ts +1 -0
  155. package/types/src/icons/Plus.d.ts +1 -0
  156. package/types/src/icons/SVG.d.ts +1 -0
  157. package/types/src/icons/Search.d.ts +1 -0
  158. package/types/src/icons/SortedDown.d.ts +1 -0
  159. package/types/src/icons/SortedUp.d.ts +1 -0
  160. package/types/src/icons/Success.d.ts +1 -0
  161. package/types/src/icons/SuccessFilled.d.ts +1 -0
  162. package/types/src/icons/WarningFilled.d.ts +1 -0
  163. package/types/src/utils/types.d.ts +1 -0
package/TabBar.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 = 122);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 123);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -142,7 +142,7 @@ function updateReactRef(ref, current) {
142
142
 
143
143
  /***/ }),
144
144
 
145
- /***/ 122:
145
+ /***/ 123:
146
146
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
147
147
 
148
148
  "use strict";
@@ -198,7 +198,7 @@ var Styled = external_styled_components_default.a.div.withConfig({
198
198
  var id_ = __webpack_require__(10);
199
199
 
200
200
  // EXTERNAL MODULE: external "@splunk/react-ui/Popover"
201
- var Popover_ = __webpack_require__(18);
201
+ var Popover_ = __webpack_require__(17);
202
202
  var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
203
203
 
204
204
  // EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
@@ -411,6 +411,7 @@ var propTypes = {
411
411
 
412
412
  /** @private. The internal key of the tab */
413
413
  tabKey: external_prop_types_default.a.number,
414
+ to: external_prop_types_default.a.string,
414
415
  tooltip: external_prop_types_default.a.node
415
416
  };
416
417
  var defaultProps = {
@@ -457,14 +458,23 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
457
458
 
458
459
  _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
459
460
  var _this$props = _this.props,
461
+ active = _this$props.active,
460
462
  onClick = _this$props.onClick,
461
463
  tabId = _this$props.tabId,
462
- tabKey = _this$props.tabKey;
463
- onClick === null || onClick === void 0 ? void 0 : onClick(e, {
464
- tabId: tabId,
465
- tabKey: tabKey
466
- });
467
- e.preventDefault();
464
+ tabKey = _this$props.tabKey,
465
+ to = _this$props.to; // preserve the previous behaviour from 2ad8e7eaf47 to avoid firing unnecessary onChange events
466
+ // while preventing the "to" prop from incorrectly triggering <Clickable>'s providedOnClick on the active tab
467
+
468
+ if (!active) {
469
+ onClick === null || onClick === void 0 ? void 0 : onClick(e, {
470
+ tabId: tabId,
471
+ tabKey: tabKey
472
+ });
473
+ }
474
+
475
+ if (to == null || to != null && active) {
476
+ e.preventDefault();
477
+ }
468
478
  });
469
479
 
470
480
  _defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
@@ -509,8 +519,9 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
509
519
  label = _this$props3.label,
510
520
  layout = _this$props3.layout,
511
521
  tabId = _this$props3.tabId,
522
+ to = _this$props3.to,
512
523
  tooltip = _this$props3.tooltip,
513
- otherProps = _objectWithoutProperties(_this$props3, ["active", "appearance", "ariaControls", "count", "disabled", "icon", "iconSize", "label", "layout", "tabId", "tooltip"]);
524
+ otherProps = _objectWithoutProperties(_this$props3, ["active", "appearance", "ariaControls", "count", "disabled", "icon", "iconSize", "label", "layout", "tabId", "to", "tooltip"]);
514
525
 
515
526
  var _this$state = this.state,
516
527
  anchor = _this$state.anchor,
@@ -526,7 +537,7 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
526
537
  disabled: disabled,
527
538
  elementRef: this.handleMount
528
539
  }, otherProps, {
529
- onClick: active ? undefined : this.handleClick,
540
+ onClick: this.handleClick,
530
541
  onFocus: this.handleFocus,
531
542
  onMouseEnter: this.handleTooltipOpen,
532
543
  onBlur: this.handleTooltipClose,
@@ -536,7 +547,8 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
536
547
  // prop is of type React.ReactNode, which means title
537
548
  // can end up showing as "[object Object]"
538
549
  ,
539
- title: label
550
+ title: label,
551
+ to: to
540
552
  }), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
541
553
  "data-test": "label",
542
554
  $withUnderline: appearance === 'navigation'
@@ -623,28 +635,36 @@ function TabBar(_ref) {
623
635
  var previousTabKey = Object(external_react_["useMemo"])(function () {
624
636
  return layout === 'vertical' ? 'up' : 'left';
625
637
  }, [layout]);
626
- var tabKeyCounter = 0;
627
- var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (child) {
628
- var tabOnClick = function tabOnClick(e, data) {
638
+
639
+ var tabOnFocus = function tabOnFocus(e, data) {
640
+ var tabKey = data.tabKey;
641
+
642
+ if (tabKey != null) {
643
+ focusedTabKey.current = tabKey;
644
+ }
645
+
646
+ if (autoActivate) {
629
647
  onChange === null || onChange === void 0 ? void 0 : onChange(e, {
630
648
  selectedTabId: data.tabId
631
649
  });
632
- };
633
-
634
- var tabOnFocus = function tabOnFocus(e, data) {
635
- var tabKey = data.tabKey;
650
+ }
651
+ };
636
652
 
637
- if (tabKey != null) {
638
- focusedTabKey.current = tabKey;
639
- }
653
+ var tabOnClick = function tabOnClick(e, data) {
654
+ onChange === null || onChange === void 0 ? void 0 : onChange(e, {
655
+ selectedTabId: data.tabId
656
+ });
657
+ };
640
658
 
641
- if (autoActivate) {
642
- onChange === null || onChange === void 0 ? void 0 : onChange(e, {
643
- selectedTabId: data.tabId
644
- });
645
- }
646
- };
659
+ var tabKeyCounter = 0;
660
+ var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (child) {
661
+ // <TabBar> allows non-<Tab> children, pass them through without any modification
662
+ if (typeof child.type === 'string' || child.type.name !== TabBar_Tab.name) {
663
+ return child;
664
+ }
647
665
 
666
+ var ref = /*#__PURE__*/external_react_default.a.createRef();
667
+ tabRefs.push(ref);
648
668
  var childProps = {
649
669
  active: activeTabId === child.props.tabId,
650
670
  appearance: appearance,
@@ -653,19 +673,13 @@ function TabBar(_ref) {
653
673
  layout: layout,
654
674
  onClick: tabOnClick,
655
675
  onFocus: tabOnFocus,
676
+ ref: ref,
656
677
  style: tabWidth && tabWidth > minTabWidth ? {
657
678
  width: tabWidth
658
- } : child.props.style
659
- }; // <TabBar> allows non-<Tab> children, so this makes sure that the tabKey is only applied to actual tabs
660
-
661
- if (typeof child.type !== 'string' && child.type.name === TabBar_Tab.name) {
662
- var ref = /*#__PURE__*/external_react_default.a.createRef();
663
- childProps.ref = ref;
664
- tabRefs.push(ref);
665
- childProps.tabKey = tabKeyCounter;
666
- tabKeyCounter += 1;
667
- }
668
-
679
+ } : child.props.style,
680
+ tabKey: tabKeyCounter
681
+ };
682
+ tabKeyCounter += 1;
669
683
  return /*#__PURE__*/Object(external_react_["cloneElement"])(child, childProps);
670
684
  });
671
685
  return /*#__PURE__*/external_react_default.a.createElement(Styled, TabBar_extends({
@@ -718,7 +732,7 @@ module.exports = require("@splunk/react-ui/ScreenReaderContent");
718
732
 
719
733
  /***/ }),
720
734
 
721
- /***/ 18:
735
+ /***/ 17:
722
736
  /***/ (function(module, exports) {
723
737
 
724
738
  module.exports = require("@splunk/react-ui/Popover");
package/TabLayout.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 = 130);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 128);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -108,7 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
108
108
 
109
109
  /***/ }),
110
110
 
111
- /***/ 130:
111
+ /***/ 128:
112
112
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
113
113
 
114
114
  "use strict";
@@ -134,7 +134,7 @@ var external_lodash_ = __webpack_require__(4);
134
134
  var id_ = __webpack_require__(10);
135
135
 
136
136
  // EXTERNAL MODULE: external "@splunk/react-ui/TabBar"
137
- var TabBar_ = __webpack_require__(69);
137
+ var TabBar_ = __webpack_require__(71);
138
138
  var TabBar_default = /*#__PURE__*/__webpack_require__.n(TabBar_);
139
139
 
140
140
  // EXTERNAL MODULE: external "styled-components"
@@ -406,7 +406,7 @@ module.exports = require("lodash");
406
406
 
407
407
  /***/ }),
408
408
 
409
- /***/ 69:
409
+ /***/ 71:
410
410
  /***/ (function(module, exports) {
411
411
 
412
412
  module.exports = require("@splunk/react-ui/TabBar");